Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Linux Device Driver Development

You're reading from   Linux Device Driver Development Everything you need to start with device driver development for Linux kernel and embedded Linux

Arrow left icon
Product type Paperback
Published in Apr 2022
Publisher Packt
ISBN-13 9781803240060
Length 708 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
John Madieu John Madieu
Author Profile Icon John Madieu
John Madieu
Arrow right icon
View More author details
Toc

Table of Contents (23) Chapters Close

Preface 1. Section 1 -Linux Kernel Development Basics
2. Chapter 1: Introduction to Kernel Development FREE CHAPTER 3. Chapter 2: Understanding Linux Kernel Module Basic Concepts 4. Chapter 3: Dealing with Kernel Core Helpers 5. Chapter 4: Writing Character Device Drivers 6. Section 2 - Linux Kernel Platform Abstraction and Device Drivers
7. Chapter 5: Understanding and Leveraging the Device Tree 8. Chapter 6: Introduction to Devices, Drivers, and Platform Abstraction 9. Chapter 7: Understanding the Concept of Platform Devices and Drivers 10. Chapter 8: Writing I2C Device Drivers 11. Chapter 9: Writing SPI Device Drivers 12. Section 3 - Making the Most out of Your Hardware
13. Chapter 10: Understanding the Linux Kernel Memory Allocation 14. Chapter 11: Implementing Direct Memory Access (DMA) Support 15. Chapter 12: Abstracting Memory Access – Introduction to the Regmap API: a Register Map Abstraction 16. Chapter 13: Demystifying the Kernel IRQ Framework 17. Chapter 14: Introduction to the Linux Device Model 18. Section 4 - Misc Kernel Subsystems for the Embedded World
19. Chapter 15: Digging into the IIO Framework 20. Chapter 16: Getting the Most Out of the Pin Controller and GPIO Subsystems 21. Chapter 17: Leveraging the Linux Kernel Input Subsystem 22. Other Books You May Enjoy

What this book covers

Chapter 1, Introduction to Kernel Development, introduces the Linux kernel development process. The chapter will discuss the downloading, configuring, and compiling steps of a kernel, for x86 as well as for ARM-based systems.

Chapter 2, Understanding Linux Kernel Module Basic Concepts, deals with Linux modularity by means of kernel modules and describes their loading/unloading. It also describes module architecture with some basic concepts.

Chapter 3, Dealing with Kernel Core Helpers, walks through frequently used kernel functions and mechanisms, such as the work queue, wait queue, mutexes, spinlock, and any other facilities that are useful for improved driver reliability.

Chapter 4, Writing Character Device Drivers, focuses on exporting device functionalities to the user space by means of character devices, as well as supporting custom commands using the ioctl interface.

Chapter 5, Understanding and Leveraging the Device Tree, discusses the mechanism to declare and describe devices to the kernel. This chapter explains device addressing, resource handling, and every data type supported in device tree (DT) and their kernel APIs.

Chapter 6, Introduction to Devices, Drivers, and Platform Abstraction, explains the general concept of platform devices, the concept of a pseudo-platform bus, as well as the device- and driver-matching mechanisms.

Chapter 7, Understanding the Concept of Platform Devices and Drivers, describes platform driver architecture in a general manner, and how to handle platform data.

Chapter 8, Writing I2C Device Drivers, dives into I2C device driver architecture, the data structures, and device addressing and accessing methods on the bus.

Chapter 9, Writing SPI Device Drivers, describes SPI-based device driver architecture, as well as the data structures involved. The chapter discusses each device's access method and specificities, as well as traps you should avoid. SPI DT binding is discussed too.

Chapter 10, Understanding the Linux Kernel Memory Allocation, first introduces the concept of virtual memory, to describe the whole kernel memory layout. This chapter then walks through the kernel memory management subsystem, discussing memory allocation and mapping, their APIs, and all devices involved in such mechanisms, as well as the kernel caching mechanism.

Chapter 11, Implementing Direct Memory Access (DMA) Support, introduces DMA and its new kernel API: the DMA Engine API. This chapter will talk about different DMA mappings and describe how to address cache coherency issues. In addition, the chapter summarizes all the concepts with a generic use case.

Chapter 12, Abstracting Memory Access – Introduction to the Regmap API: a Register Map Abstraction, provides an overview of the register map APIs and how they abstract the underlying SPI and I2C transactions. This chapter describes the generic API, as well as the dedicated API.

Chapter 13, Demystifying the Kernel IRQ Framework, demystifies the Linux IRQ core. This chapter walks through Linux IRQ management, starting from interrupt propagation over the system and moving to interrupt controller drivers, thus explaining the concept of IRQ multiplexing, using the Linux IRQ domain API.

Chapter 14, Introduction to the Linux Device Model, provides an overview of the heart of Linux, describing how objects are represented in the kernel, and how Linux is designed under the hood in a general manner, starting from kobject to devices, through to buses, classes, and device drivers.

Chapter 15, Delving into the IIO Framework, introduces the kernel data acquisition and measurement framework, to handle Digital-to-Analog Converters (DACs) and Analog-to-Digital Converters (ADCs). This chapter walks through the IIO APIs, both from kernel space and user space (thanks to libiio), dealing with triggered buffers and continuous data capture.

Chapter 16, Getting the Most Out of the Pin Controller and GPIO Subsystems, describes the kernel pin control infrastructure and APIs, as well as GPIO chip drivers and gpiolib, which is the kernel API to handle GPIO. This chapter also discusses the old and deprecated integer-based GPIO interface, as well as the descriptor-based interface, which is the new one, and finally, the way they can be configured from within the device tree. It also covers libgpiod, which is the official library for dealing with GPIO in user space.

Chapter 17, Leveraging the Linux Kernel Input Subsystem, provides a global view of input subsystems, dealing with both IRQ-based and polled input devices, and introducing both APIs. This chapter explains and shows how user space code deals with such devices.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image