How to Avoid Writing Device Drivers for Embedded Linux
summary
Explains how to avoid kernel drivers by using concrete user‑space interfaces: GPIO sysfs export (write numbers to export, read/write value, set edge and poll for interrupts), gpiochip character device with ioctl for atomic multi‑line control, PWM period and duty in ns via /sys/class/pwm export/enable, and i2c-dev ioctl to talk to devices (example: Adafruit ambient‑light sensor at 0x39 — register 0x8A returns 0x50). Covers UIO for mapping device registers, notes DMA and kernel subsystems remain reasons to write kernel drivers.
AI-written summary · about
chapters (24)
- 0:00Intro
- 0:12About Chris Simmonds
- 0:54Conventional device driver model
- 1:43How applications interact device drivers
- 4:15A note about device trees
- 5:03GPIO: General Purpose Input/Output
- 6:10Two userspace drivers!
- 7:23The gpiolib systs interface
- 9:25Inside a gplochip
- 10:11Exporting a GPIO pin
- 10:47Inputs and outputs
- 12:06Interrupts
- 13:33The gpio-cdev interface
- 15:36gpio-cdev example 22
- 18:49PWM: Pulse-Width Modulation
- 20:26The PWM systs interface
- 22:09Exporting a PWM
- 23:12PWM example
- 23:5512C: the Inter IC bus
- 25:53The 12c-dev driver
- 26:53Detecting 12c slaves using cdetect
- 29:5512C code example - light sensor, addr 0x39
- 31:05Other examples
- 33:36What are you missing?
related talks
59mUnderstanding the Structure of a Linux Kernel Device Driver
50mHow Not to Write X86 Platform Drivers
37mIndustrial IO and You- Nonsense Hacks!
51mGPIO for Engineers and Makers
19mPinctrl and GPIO - Interactions and Footguns
44mNew GPIO Interface for User Space
35mCompound Interest - Dealing with Two Decades of Technical Debt in Embedded...
19mPinctrl and GPIO - Interactions and Footguns
