[PATCH v5 0/2] i2c-tools: Make tools accept bus path
Brigham Campbell <[email protected]> Wed, 22 Jul 2026 02:52:39 -0600
| Newsgroups | org.kernel.vger.linux-i2c |
|---|---|
| Message-ID | <20260722-accept-device-path-v5-0-9c0bf9b4da26@brighamcampbell.com> |
The purpose of this series is to make i2c-tools userspace utilities accept an i2c bus character device file path as an argument. This is useful, for example, if a sysadmin creates udev rules to create a persistent symlink to an i2c bus and wishes to use that symlink with i2c-tools. Since v1: * Scrapped brittle checking against device major number 89 in favor of an i2c_bus_hint variant struct. Since v2: * Scrapped i2c_bus_hint variant in favor of combining the lookup and open steps into one function. No more awkward variant. Since v3: * Rebased onto `master` and fixed minor conflicts. Since v4: * Inline much of the functionality of open_i2c_dev. * Where possible, make functions static. Signed-off-by: Brigham Campbell <[email protected]> --- Brigham Campbell (2): i2c-tools: Allow passing device file paths i2c-tools: Document device paths as I2CBUS arg tools/i2cbusses.c | 127 ++++++++++++++++++++++++++++++---------------------- tools/i2cbusses.h | 3 +- tools/i2cdetect.8 | 8 ++-- tools/i2cdetect.c | 14 +++--- tools/i2cdump.8 | 7 +-- tools/i2cdump.c | 14 +++--- tools/i2cget.8 | 9 ++-- tools/i2cget.c | 13 +++--- tools/i2cset.8 | 12 ++--- tools/i2cset.c | 13 +++--- tools/i2ctransfer.8 | 2 +- tools/i2ctransfer.c | 13 +++--- 12 files changed, 120 insertions(+), 115 deletions(-) --- base-commit: 5852f5375eea6ca9dabf31f4772cb8b8ecc905d8 change-id: 20260530-accept-device-path-539164c9c1df Thanks! -- Brigham Campbell https://brighamcampbell.com