Skip to Content
Linux Device Drivers Development
book

Linux Device Drivers Development

by John Madieu
October 2017
Intermediate to advanced
586 pages
14h 8m
English
Packt Publishing
Content preview from Linux Device Drivers Development

Putting it all together

The steps needed to write SPI client drivers are as follows:

  1. 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.
  2. 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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux Device Drivers, Second Edition

Linux Device Drivers, Second Edition

Jonathan Corbet, Alessandro Rubini
Linux Device Drivers, 3rd Edition

Linux Device Drivers, 3rd Edition

Jonathan Corbet, Alessandro Rubini, Greg Kroah-Hartman

Publisher Resources

ISBN: 9781785280009Supplemental Content