Linux I2C development
 help / color / mirror / Atom feed
From: Brigham Campbell <me@brighamcampbell.com>
To: Jean Delvare <jdelvare@suse.de>, linux-i2c@vger.kernel.org
Cc: "Wolfram Sang" <wsa+renesas@sang-engineering.com>,
	"Brigham Campbell" <me@brighamcampbell.com>,
	"Gero Schwäricke" <gero.schwaericke@sevenlab.de>
Subject: [PATCH v4 0/2] i2c-tools: Make tools accept bus path
Date: Sun, 05 Jul 2026 22:27:52 -0600	[thread overview]
Message-ID: <20260705-accept-device-path-v4-0-c62caa708a9e@brighamcampbell.com> (raw)

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.

I've tested these changes by running i2cdetect, i2cget, and i2cset.
Please be aware that my current test setup has an i801 bus controller
with what seems to be no slave devices connected, so my testing has been
superficial, involving mostly failed read/writes. This patch series only
touches code that actually opens the character device file, so I'm
satisfied with this testing. If maintainers prefer, I'm happy to test
more rigorously.

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.

Signed-off-by: Brigham Campbell <me@brighamcampbell.com>
---
Brigham Campbell (2):
      i2c-tools: Allow passing device file paths
      i2c-tools: Document device paths as I2CBUS arg

 tools/i2cbusses.c   | 40 ++++++++++++++++++++++++++++++++++------
 tools/i2cbusses.h   |  4 +++-
 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, 82 insertions(+), 67 deletions(-)
---
base-commit: 5852f5375eea6ca9dabf31f4772cb8b8ecc905d8
change-id: 20260530-accept-device-path-539164c9c1df

Best regards,
--  
Brigham Campbell <me@brighamcampbell.com>


             reply	other threads:[~2026-07-06  4:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06  4:27 Brigham Campbell [this message]
2026-07-06  4:27 ` [PATCH v4 1/2] i2c-tools: Allow passing device file paths Brigham Campbell
2026-07-06  4:27 ` [PATCH v4 2/2] i2c-tools: Document device paths as I2CBUS arg Brigham Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260705-accept-device-path-v4-0-c62caa708a9e@brighamcampbell.com \
    --to=me@brighamcampbell.com \
    --cc=gero.schwaericke@sevenlab.de \
    --cc=jdelvare@suse.de \
    --cc=linux-i2c@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox