LDM data structures
The goal is to build a complete DT that will map each physical device present on the system, and introduce their hierarchy. One common and generic structure has been created to represent any object that could be a part of the device model. The upper level of LDM relies on the bus represented in the kernel as an instance of struct bus_type
; the device driver, represented by a struct device_driver
structure, and the device, which is the last element represented as an instance of the struct device
structure. In this section, we will design a bus driver packt bus, in order to explore into LDM data structures and mechanisms in detail.
The bus
A bus is a channel link between devices and processors. The hardware entity that manages the bus and exports its protocol to devices is called the bus controller. For example, the USB controller provides USB support. The I2C controller provides I2C bus support. Therefore, the bus controller, being a device on its own, must be registered...