From: Armin Wolf <W_Armin@gmx.de>
To: linux@roeck-us.net
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
ggirouard@bungeetaco.com
Subject: [PATCH v4 2/2] hwmon: (spd5118) Avoid probing when 16-bit addressing is enabled
Date: Tue, 1 Sep 2026 22:01:42 +0200 [thread overview]
Message-ID: <20260901200142.495319-2-W_Armin@gmx.de> (raw)
In-Reply-To: <20260901200142.495319-1-W_Armin@gmx.de>
Support for 16-bit addressing was removed when support for i3c
was added to the driver. Switching between 8-bit and 16-bit addressing
might confuse the system firmware, so we are forced to bail out if
16-bit addressing was configured during boot.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
Changes since v3:
- new patch
---
drivers/hwmon/spd5118.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/hwmon/spd5118.c b/drivers/hwmon/spd5118.c
index f79b46085ecc..52f354489341 100644
--- a/drivers/hwmon/spd5118.c
+++ b/drivers/hwmon/spd5118.c
@@ -16,6 +16,7 @@
#include <linux/bitops.h>
#include <linux/bits.h>
+#include <linux/dev_printk.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/i3c/device.h>
@@ -664,6 +665,13 @@ static int spd5118_i2c_init(struct i2c_client *client)
if (mode < 0)
return mode;
+ /* 16-bit addressing is not supported */
+ if (mode & SPD5118_LEGACY_MODE_ADDR) {
+ dev_notice(&client->dev,
+ "Unable to access device due to 16-bit addressing being enabled\n");
+ return -ENODEV;
+ }
+
err = i2c_smbus_write_byte_data(client, SPD5118_REG_I2C_LEGACY_MODE,
mode & ~SPD5118_LEGACY_PAGE_MASK);
if (err < 0)
--
2.39.5
next prev parent reply other threads:[~2026-09-01 20:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-01 20:01 [PATCH v4 1/2] hwmon: (spd5118) Select page 0 unconditionally during probe Armin Wolf
2026-09-01 20:01 ` Armin Wolf [this message]
2026-09-01 20:14 ` [PATCH v4 2/2] hwmon: (spd5118) Avoid probing when 16-bit addressing is enabled sashiko-bot
2026-09-01 23:04 ` Guenter Roeck
2026-09-02 16:56 ` Armin Wolf
2026-09-02 18:25 ` Guenter Roeck
2026-09-01 20:09 ` [PATCH v4 1/2] hwmon: (spd5118) Select page 0 unconditionally during probe sashiko-bot
2026-09-01 23:03 ` Guenter Roeck
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=20260901200142.495319-2-W_Armin@gmx.de \
--to=w_armin@gmx.de \
--cc=ggirouard@bungeetaco.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
/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