Skip to content

Commit c82cd8f

Browse files
committed
i2c: i801: Fix missing Kconfig dependency
JIRA: https://issues.redhat.com/browse/RHEL-47426 commit 9c53523 Author: Heiner Kallweit <hkallweit1@gmail.com> Date: Thu Apr 4 22:09:50 2024 +0200 i2c: i801: Fix missing Kconfig dependency The original change adds usage of i2c_root_adapter(), which is implemented in i2c-mux.c. Therefore we can't use the multiplexing if I2C_I801=y and I2C_MUX=m. Handling the dependencies in the code would become unnecessarily complex, therefore create a new config symbol. Fixes: 893fef0 ("i2c: i801: Call i2c_register_spd for muxed child segments") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202404042206.MjAQC32x-lkp@intel.com/ Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: David Arcari <darcari@redhat.com>
1 parent f19cc49 commit c82cd8f

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

drivers/i2c/busses/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,14 @@ config I2C_I801
164164
This driver can also be built as a module. If so, the module
165165
will be called i2c-i801.
166166

167+
config I2C_I801_MUX
168+
def_bool I2C_I801
169+
depends on DMI && I2C_MUX_GPIO
170+
depends on !(I2C_I801=y && I2C_MUX=m)
171+
help
172+
Optional support for multiplexed SMBUS on certain systems with
173+
more than 8 memory slots.
174+
167175
config I2C_ISCH
168176
tristate "Intel SCH SMBus 1.0"
169177
depends on PCI

drivers/i2c/busses/i2c-i801.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
#include <linux/pm_runtime.h>
122122
#include <linux/mutex.h>
123123

124-
#if IS_ENABLED(CONFIG_I2C_MUX_GPIO) && defined CONFIG_DMI
124+
#ifdef CONFIG_I2C_I801_MUX
125125
#include <linux/gpio/machine.h>
126126
#include <linux/platform_data/i2c-mux-gpio.h>
127127
#endif
@@ -291,7 +291,7 @@ struct i801_priv {
291291
int len;
292292
u8 *data;
293293

294-
#if IS_ENABLED(CONFIG_I2C_MUX_GPIO) && defined CONFIG_DMI
294+
#ifdef CONFIG_I2C_I801_MUX
295295
struct platform_device *mux_pdev;
296296
struct gpiod_lookup_table *lookup;
297297
struct notifier_block mux_notifier_block;
@@ -1304,7 +1304,7 @@ static void i801_probe_optional_slaves(struct i801_priv *priv)
13041304
register_dell_lis3lv02d_i2c_device(priv);
13051305

13061306
/* Instantiate SPD EEPROMs unless the SMBus is multiplexed */
1307-
#if IS_ENABLED(CONFIG_I2C_MUX_GPIO)
1307+
#ifdef CONFIG_I2C_I801_MUX
13081308
if (!priv->mux_pdev)
13091309
#endif
13101310
i2c_register_spd(&priv->adapter);
@@ -1314,7 +1314,7 @@ static void __init input_apanel_init(void) {}
13141314
static void i801_probe_optional_slaves(struct i801_priv *priv) {}
13151315
#endif /* CONFIG_X86 && CONFIG_DMI */
13161316

1317-
#if IS_ENABLED(CONFIG_I2C_MUX_GPIO) && defined CONFIG_DMI
1317+
#ifdef CONFIG_I2C_I801_MUX
13181318
static struct i801_mux_config i801_mux_config_asus_z8_d12 = {
13191319
.gpio_chip = "gpio_ich",
13201320
.values = { 0x02, 0x03 },

0 commit comments

Comments
 (0)