mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
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>
This commit is contained in:
parent
d2e24a5bc9
commit
720e4bd86c
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user