I have been reading up on SPI and how to create kernel drivers but I am still unsure about how all of this works.
For example:
static struct spi_driver ds1305_driver = {
.driver.name = "rtc-ds1343",
.driver.owner = THIS_MODULE,
.probe = ds1343_probe,
.remove = __devexit_p(ds1343_remove),
/* REVISIT add suspend/resume */
};
If i understand this correctly, you should add spi_board_info in a board file (older systems) or into the device tree, which then lets SPI know how to communicate with the actual device.
From looking at other's implementations, it seems that this really just lets the kernel know what chip select, data rate, etc etc. Basic SPI information.
Questions:
Then, when the system boots, the kernel driver will send a clock to the device and read the device's name?
Is it standardized that all devices have their name written in some location or am I just totally wrong on this?
Is the general SPI driver responsible for probing the device for this information (in my case mxc_spi-0)?
Lastly, if it does read the device's name, does it then scroll through the available drivers and match with this spi_driver.driver.name?
I'm really confused on the details.
Thanks!