This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

how can i use spidev.c in dm355?

     I am using mv_pro_4.0.1  in dm355 platform,now i want to use spi0 and spi1 to communication with other devices which is  like using i2c open() , read() ,and write() to various device by sub address in userspace. My linux kernel is 2.6.10,I have find the spidev.c and spidev_test.c in linux2.6.30,So i have transplanted the spidev.c as a module in linux kernel 2.6.10,but when i insmod the module,i cann't find the needful device in /dev/ path,so i cann't run spidev_test.c to test spi,I think there may be some errors in dm355 device driver,but i don't know how to modify it? Any help will be appreciated!

  • i have read the source ,davinci_spi_board_init() must support board info for the spidev driver ,just like the spi_eeprom example,but i don't know how can i support the board info?

  • I have add some code  for spi_board_info just as:    
    spi_board_info dm355_spi_board_info[] ={    
    //add by duke 2009.6.18
            {
             .modalias = "spidev",
             .platform_data = NULL,//&davinci_8k_spi_eeprom_info,
             .mode = SPI_MODE_0,
             .irq = 0,
             .max_speed_hz = 2 * 1000 * 1000 /* max sample rate at 3V */ ,
             .bus_num = 65535,
             .chip_select = 0,
             },
    .....................
    but the spidev_probe cann't been call yet!why?the modalias name is the same as the spidev_spi name
    static struct spi_driver spidev_spi = {
    .driver = {
    .name = "spidev",
    .bus = &spi_bus_type,
    .owner = THIS_MODULE,
    },
    .probe = spidev_probe,
    .remove = __devexit_p(spidev_remove),
    /* NOTE:  suspend/resume methods are not necessary here.
     * We don't do anything except pass the requests to/from
     * the underlying controller.  The refrigerator handles
     * most issues; the controller driver handles the rest.
     */
    };

  • Mr Zuo,

     

    I am having the same problem than you, loading spidev driver and no /dev/spiXXX is created. I was wondiring if you sort out the problem and how you did it. Help will be appreciated. Thanks in advance,

     

    Jesus Lopez