diff options
| author | Armin Wolf <W_Armin@gmx.de> | 2026-09-01 22:01:42 +0200 |
|---|---|---|
| committer | Guenter Roeck <linux@roeck-us.net> | 2026-10-18 09:35:06 -0700 |
| commit | 720e4bd86c65651fc670dfd4c2cdecf5e414d804 (patch) | |
| tree | cedd812b1d29c00cad868fbccfe4e1169d41c0e0 /drivers/hwmon | |
| parent | d2e24a5bc9f18cc5f12ded598a92e7900a7c9236 (diff) | |
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 <W_Armin@gmx.de>
Link: https://patch.msgid.link/20260901200142.495319-2-W_Armin@gmx.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
| -rw-r--r-- | drivers/hwmon/spd5118.c | 8 |
1 files changed, 8 insertions, 0 deletions
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) |
