A message for Linux.com registered users: We are in the process of making changes to the Linux forums. Starting Monday, 8/13/18 at 6:00 PM PT, you will be unable to access the forums. They will re-launch as soon as possible on Wednesday, 8/15/18 with new features and improved functionality. Thank you for your patience and stay tuned for the new improved forums.

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

Click Here!