From 720e4bd86c65651fc670dfd4c2cdecf5e414d804 Mon Sep 17 00:00:00 2001 From: Armin Wolf Date: Tue, 1 Sep 2026 22:01:42 +0200 Subject: hwmon: (spd5118) Avoid probing when 16-bit addressing is enabled 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 Link: https://patch.msgid.link/20260901200142.495319-2-W_Armin@gmx.de Signed-off-by: Guenter Roeck --- drivers/hwmon/spd5118.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/hwmon') 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 #include +#include #include #include #include @@ -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) -- cgit v1.2.3