December 26, 2011

SPI Driver with multiple chip selects


I wrote spi eeprom driver that reads and writes from eeprom device.
I used spi char device api to connect the driver to linux kernel.
I want to modify the driver to support multiple eeprom devices. Each SPI device is connected to single chip select. The spi_add_device api gets structure containing single and unique spi chip select. How can I build SPI device driver with single “father” that holds the chip protocol and below it many “kids” that holds the chip select info
I’d like to know, what is the best way to implement this driver?
Attached the driver skeleton.
Thank you for your help
Yaniv Lankry
HW SW Board support Team