The steps needed to write SPI client drivers are as follows:
- Declare device IDs supported by the driver. You can do that using spi_device_id. If the DT is supported, use of_device_id too. You can make an exclusive use of the DT.
- Call MODULE_DEVICE_TABLE(spi, my_id_table); in order to expose the driver along with its SPI device table IDs to userspace. If the DT is supported, you must call MODULE_DEVICE_TABLE(of, your_of_match_table); in order to expose OF (device tree) related module aliases to user space. The preceding calls to MODULE_DEVICE_TABLE will export informations that will be collected by depmod to update the modules.alias file, thus allowing the driver to be automatically found and loaded if it is build ...