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.

SPI character device for DM355

I am using DM355 EVM and I want to connect  normal ADC IC communicating with DM355 using SPI . in LSP , I have touchscreen device driver for adx7846 and eeprom driver.But the problem is the touch screen driver is input type device  and eeprom one is MTD. I just want SPI to configure and initiate the IC .My questions are..

1- Do I need to write my own character driver??if yes than is there any example available?? i am using LSP 1.2 and MV4.

2- If its fine to use after proper modification than which one is preferable input or MTD ??

 

  • And what if I want to use current eeprom mtd driver  for my use then how can I add my device's platform data ??

     

  • Digant Desai said:
    Do I need to write my own character driver??if yes than is there any example available??

     This depends on how your ADC would interface with the end user of your driver, if you are passing data from the API based ADC to the user than a character driver probably makes the most sense. As to examples you just need to find the driver that is closest to what you want to do and take a peek at its source, from a low level configuration standpoint I would not be suprised if both the touch screen and eeprom drivers use the same SPI code, so at the low end you probably want to start with that. At the high end where the character driver would actually be instantiated you need to find what kind of driver you really want it to be, this may be something custom you put together or a modification of another driver. The closest I could think of would be an audio driver, as that reads and writes samples from an audio ADC/DAC, though that may not be what you had in mind.

    Digant Desai said:
    If its fine to use after proper modification than which one is preferable input or MTD ??

    You probably do not want to use a block based MTD driver, since an ADC acts more like a character device would, in particular it would not make much sense to have a filesystem on your ADC which largely rules out a block driver like MTD.

    Digant Desai said:
    And what if I want to use current eeprom mtd driver  for my use then how can I add my device's platform data ??

    I am not sure exactly what you are asking for here by platform data, the EEPROM driver at the high level does not make much sense for accessing an ADC, my suspicion is that you will want to make your own custom character device interface.

  • hmm....

    do MV has any support for SPI1 and 2 ??

    What do i need to do in order to use spi1 ??

    If I want to use existing MTD device driver just for basic SPI code than how should I add my device's Platform data and how do my probe function being called to register my device with SPI controller bus & driver ?? Because it is shown in the code for EEprom only...I have normal IC with out any file system or bulk transfer ...

  • I have used SPI1 using direct register accessing through a character driver.

    Thank you for help.

    By the way If I want to make my data word length =20 bit , than apart from writing soft SPI on GPIO is there any other way I can make use of the hardware ??

  • Digant Desai said:
    I have used SPI1 using direct register accessing through a character driver.

    That is one way to do it, I am glad that is working for you.

    Digant Desai said:
    By the way If I want to make my data word length =20 bit , than apart from writing soft SPI on GPIO is there any other way I can make use of the hardware ??

    If you do need a true 20 bit word length than I suspect you would have to use the GPIO solution, however I can say that you can get the SPI to access 24 bit addressable SPI EEPROMs by doing repeated byte sized writes for the address, perhaps your SPI peripheral can handle something similar?

  • In my driver (attached here) , I am not able to get 10 + 10 + 10 bit transfer done :((

    can you help me by making it work ???? I am getting kernel tainted on change

    in SPI data register :(

     

    If I want to make my SPI1 driver same as SPI0 ..than can you guide me how can I do that ....

    I want all the features like SPI0 's driver has ...except MTD interface ....

    please help

  • Ne kluuu ne 1 ??   ;-)