
Simplify I2C and SPI Register Access With regmap
Replace hand-written register accessors with regmap: one config for I2C or SPI, read and write, update_bits, caching and a debugfs register dump on Linux 6.12.
Tag
71 posts

Replace hand-written register accessors with regmap: one config for I2C or SPI, read and write, update_bits, caching and a debugfs register dump on Linux 6.12.

Build a complete I2C client driver for a TMP102-style sensor on Linux 6.12: id tables, probe, SMBus reads, a sysfs attribute, device tree node and test output.

Learn how I2C and SPI work on the wire, what each costs in pins and speed, and how Linux splits each into controller drivers and client drivers for developers.

Learn what register_filesystem does, which file_system_type fields matter, how mount finds your type by name, and how to unregister it safely on module unload.

Build a tiny kernel filesystem that exposes one read-only file, using simple_fill_super, get_tree_nodev and simple_read_from_buffer from libfs on Linux 6.12.

Create an ext4 filesystem inside a plain file, read its superblock with dumpe2fs, and walk inodes and directories with debugfs without mounting anything.

The Linux VFS gives every filesystem four shared objects, superblock, inode, dentry and file, plus operation tables that make ext4, tmpfs and FUSE look alike.

Move sleeping work out of an interrupt handler with INIT_WORK, schedule_work and a worker function on Linux 6.12, including delayed work and safe teardown.

See how KVM reuses the Linux scheduler, memory manager, MMU notifiers, eventfds and cgroups instead of building its own, and where to read each in the source.

Linux splits interrupt work into a fast top half and a deferred bottom half. See what belongs in each, the four mechanisms, and how they trade latency and cost.

Register, use and release an interrupt handler with request_irq and free_irq in a Linux 6.12 platform driver, with flags, return codes and common errors.

Sleeping means the scheduler switches tasks, and an interrupt handler has no task to switch away from. See the reasons, the error message and the fixes.