๐”– Scriptorium
โœฆ   LIBER   โœฆ

๐Ÿ“

Mastering Linux Device Driver Development

โœ Scribed by John Madieu


Tongue
English
Leaves
647
Category
Library

โฌ‡  Acquire This Volume

No coin nor oath required. For personal study only.

โœฆ Table of Contents


Cover
Title Page
Copyright and Credits
About Packt
Contributors
Table of Contents
Preface
Section 1:Kernel Core Frameworks for Embedded Device Driver Development
Chapter 01: Linux Kernel Concepts for Embedded Developers
Technical requirements
The kernel locking API and shared objects
Spinlocks
Mutexes
The try-lock method
Waiting, sensing, and blocking in the Linux kernel
Work deferring mechanisms
SoftIRQs
Tasklets
Workqueues
Workqueues โ€“ a new generation
Linux kernel interrupt management
Designing an interrupt handler
Summary
Chapter 02: Leveraging the Regmap API and Simplifying the Code
Technical requirements
Introduction to regmap and its data structures โ€“ I2C, SPI, and MMIO
Accessing device registers
Quick recap on Linux kernel IRQ management
Regmap IRQ API and data structures
Summary
Chapter 03: Delving into the MFD Subsystem and Syscon API
Technical requirements
Introducing the MFD subsystem and Syscon APIs
Device tree binding for MFD devices
Understanding Syscon and simple-mfd
Introducing simple-mfd
Summary
Chapter 04: Storming the Common Clock Framework
Technical requirements
CCF data structures and interfaces
Understanding struct clk_hw and its dependencies
Registering/unregistering the clock provider
Exposing clocks to others (in detail)
Writing a clock provider driver
Providing clock ops
Putting it all together โ€“ global overview
Grabbing and releasing clocks
Preparing/unpreparing clocks
Rate functions
Parent functions
Putting it all together
Section 2: Multimedia and Power Saving in Embedded Linux Systems
Chapter 05: ALSA SoC Framework โ€“ Leveraging Codec and Platform Class Drivers
Technical requirements
Introduction to ASoC
ASoC Digital Audio Interface
ASoC sub-elements
Writing codec class drivers
Codec DAI and PCM (AKA DSP) configurations
The concept of controls
The concept of DAPM
Writing the platform class driver
The CPU DAI driver
The platform DMA driver AKA PCM DMA driver
Summary
Chapter 06: ALSA SoC Framework โ€“ Delving into the Machine Class Drivers
Technical requirements
Introduction to machine class drivers
The DAI link
Machine routing consideration
Codec pins
Board connectors
Machine routing
Clocking and formatting considerations
Sound card registration
Leveraging the simple-card machine driver
Codec-less sound cards
Summary
Chapter 07: Demystifying V4L2 and Video Capture Device Drivers
Technical requirements
Framework architecture and the main data structures
Initializing and registering a V4L2 device
Introducing video device drivers โ€“ the bridge driver
Initializing and registering the video device
Video device file operations
V4L2 ioctl handling
The videobuf2 interface and APIs
The concept of sub-devices
Sub-device initialization
Sub-device operations
Traditional sub-device (un)registration
V4L2 controls infrastructure
A word about control inheritance
Summary
Chapter 08: Integrating with V4L2 Async and Media Controller Frameworks
Technical requirements
The V4L2 async interface and the concept of graph binding
Graph binding
The V4L2 async and graph-oriented API
V4L2 async
The Linux media controller framework
The media controller abstraction model
Integrating media controller support in the driver
Media controller from user space
Summary
Chapter 09: Leveraging the V4L2 API from the User Space
Technical requirements
Introduction to V4L2 from user space
The V4L2 user space API
Video device opening and property management
Querying the device capabilities
Buffer management
Image (buffer) format
Requesting buffers
Enqueueing the buffer and enabling streaming
Dequeuing buffers
V4L2 user space tools
Using v4l2-ctl
Debugging V4L2 in user space
Summary
Chapter 10: Linux Kernel Power Management
Technical requirements
The concept of power management on Linux-based systems
Runtime power management
System power management sleep states
Adding power management capabilities to device drivers
Implementing runtime PM capability
System suspend and resume sequences
Implementing system sleep capability
Being a source of system wakeup
Wakeup source and sysfs (or debugfs)
The IRQF_NO_SUSPEND flag
Summary
Section 3: Staying Up to Date with Other Linux Kernel Subsystems
Chapter 11: Writing PCI Device Drivers
Technical requirements
Introduction to PCI buses and interfaces
Terminology
PCI bus enumeration, device configuration, and addressing
PCI address spaces
Interrupt distribution
The Linux kernel PCI subsystem and data structures
PCI data structures
Overview of the PCI driver structure
PCI and Direct Memory Access (DMA)
PCI coherent (aka consistent) mapping
Streaming DMA mapping
Summary
Chapter 12: Leveraging the NVMEM Framework
Technical requirements
Introducing NVMEM data structures and APIs
Writing the NVMEM provider driver
NVMEM device (un)registration
Implementing NVMEM read/write callbacks
Device tree bindings for NVMEM providers
NVMEM consumer driver APIs
NVMEM in user space
Summary
Chapter 13: Watchdog Device Drivers
Technical requirements
Watchdog data structures and APIs
Registering/unregistering a watchdog device
Handling pretimeouts and governors
GPIO-based watchdogs
The watchdog user space interface
Starting and stopping the watchdog
Getting watchdog capabilities and identity
Setting and getting the timeout and pretimeout
Getting the (boot/reboot) status
The watchdog sysfs interface
Summary
Chapter 14: Linux Kernel Debugging Tips and Best Practices
Technical requirements
Understanding the Linux kernel release process
Linux kernel development tips
Message printing
Linux kernel tracing and performance analysis
Using Ftrace to instrument the code
Linux kernel debugging tips
Oops and panic analysis
Using objdump to identify the faulty code line in the kernel module
Summary
Other Books You May Enjoy
Index


๐Ÿ“œ SIMILAR VOLUMES


Mastering Linux Device Driver Developmen
โœ John Madieu ๐Ÿ“‚ Library ๐Ÿ“… 2021 ๐Ÿ› Packt Publishing Ltd ๐ŸŒ English

<p><b>Master the art of developing customized device drivers for your embedded Linux systems</b></p>Key Features<ul><li>Stay up to date with the Linux PCI, ASoC, and V4L2 subsystems and write device drivers for them</li><li>Get to grips with the Linux kernel power management infrastructure</li><li>A

Mastering Linux Device Driver Developmen
โœ John Madieu ๐Ÿ“‚ Library ๐Ÿ“… 2021 ๐Ÿ› Packt Publishing Ltd ๐ŸŒ English

<p><b>Master the art of developing customized device drivers for your embedded Linux systems</b></p>Key Features<ul><li>Stay up to date with the Linux PCI, ASoC, and V4L2 subsystems and write device drivers for them</li><li>Get to grips with the Linux kernel power management infrastructure</li><li>A

Linux Device Drivers Development
โœ John Madieu ๐Ÿ“‚ Library ๐Ÿ“… 2017 ๐Ÿ› Packt Publishing ๐ŸŒ English

Linux kernel is a complex, portable, modular and widely used piece of software, running on around 80% of servers and embedded systems in more than half of devices throughout the World. Device drivers play a critical role in how well a Linux system performs. As Linux has turned out to be one of the m

Linux Device Drivers Development
โœ John Madieu ๐Ÿ“‚ Library ๐Ÿ“… 2017 ๐Ÿ› Packt Publishing ๐ŸŒ English

Linux kernel is a complex, portable, modular and widely used piece of software, running on around 80% of servers and embedded systems in more than half of devices throughout the World. Device drivers play a critical role in how well a Linux system performs. As Linux has turned out to be one of the m