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

SPI and device tree

Like I2C devices, SPI devices belong to the non-memory mapped devices family in the DT, but are addressable too. Here, the address means the CS index among the list of CS (starting from 0) given to the controller (the master). As an example, we may have three different SPI devices sitting on the SPI bus, each with its CS line. The master will be given general purpose input/output (GPIO) set, each representing the CS to activate a device. If Device X uses the second GPIO line as the CS, we must set its address to 1 (as we always start from 0) in the reg property.

The following is a real DT listing for SPI devices:

ecspi1 { fsl,spi-num-chipselects = <3>; cs-gpios = <&gpio5 17 0>, <&gpio5 17 0>, <&gpio5 17 0>; pinctrl-0 = ...
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