Skip to content

Commit 9c53523

Browse files
hkallweitAndi Shyti
authored andcommitted
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>
1 parent 48ace62 commit 9c53523

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
@@ -163,6 +163,14 @@ config I2C_I801
163163
This driver can also be built as a module. If so, the module
164164
will be called i2c-i801.
165165

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

drivers/i2c/busses/i2c-i801.c

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

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

292-
#if IS_ENABLED(CONFIG_I2C_MUX_GPIO) && defined CONFIG_DMI
292+
#ifdef CONFIG_I2C_I801_MUX
293293
struct platform_device *mux_pdev;
294294
struct gpiod_lookup_table *lookup;
295295
struct notifier_block mux_notifier_block;
@@ -1300,7 +1300,7 @@ static void i801_probe_optional_slaves(struct i801_priv *priv)
13001300
register_dell_lis3lv02d_i2c_device(priv);
13011301

13021302
/* Instantiate SPD EEPROMs unless the SMBus is multiplexed */
1303-
#if IS_ENABLED(CONFIG_I2C_MUX_GPIO)
1303+
#ifdef CONFIG_I2C_I801_MUX
13041304
if (!priv->mux_pdev)
13051305
#endif
13061306
i2c_register_spd(&priv->adapter);
@@ -1310,7 +1310,7 @@ static void __init input_apanel_init(void) {}
13101310
static void i801_probe_optional_slaves(struct i801_priv *priv) {}
13111311
#endif /* CONFIG_X86 && CONFIG_DMI */
13121312

1313-
#if IS_ENABLED(CONFIG_I2C_MUX_GPIO) && defined CONFIG_DMI
1313+
#ifdef CONFIG_I2C_I801_MUX
13141314
static struct i801_mux_config i801_mux_config_asus_z8_d12 = {
13151315
.gpio_chip = "gpio_ich",
13161316
.values = { 0x02, 0x03 },

0 commit comments

Comments
 (0)