Seventh Chapter LED will blink for me: Control light Emitting diodes
Reading experience
The realization principle of LED drive
Although the Linux driver deals directly with hardware, it is not the Linux driver that writes data directly to the memory in the hardware, but interacts with the native I/O memory.
Writing LED drivers
Test LED Driver
LED-driven porting
When modifying the Linux-powered source code, try not to modify the Linux driver's excuses.
LED driver is the first real Linux driver to deal with hardware, although the LED driver is not complicated, just control four LEDs, but led driver has included all the necessary parts of Linux drive. A complete Linux drive consists primarily of internal processing and interaction with hardware components. The internal processing mainly refers to the Linux driver loading, unloading, device file-related action processing (read and write device files, send I/O commands to the device file), and business logic. Interaction with hardware mainly refers to the data interaction with the registers in hardware through IOWRITE32, IOREAD32 and other functions. The porting of Linux drivers on different platforms is also handled in these two parts. If you are porting between different Linux versions, primarily porting the first part (Linux-driven internal processing, the Linux kernel API will vary greatly when the Linux kernel version is large), if porting on different hardware platforms, the main porting is the second part. Indifferent, in some cases, Linux-driven porting is basically equivalent to rewriting the Linux driver, in this case, it is necessary to better understand the advanced technology of Linux drivers.
Android Deep Explore (Volume 1) HAL and Driver Development seventh chapter LED will blink for me: Control LEDs