Skip to content

Commit

Permalink
i2c-i801: Simplify dependency towards GPIOLIB
Browse files Browse the repository at this point in the history
Arbitrarily selecting GPIOLIB causes trouble on some architectures,
so don't do that. Instead, just make the optional multiplexing code
depend on CONFIG_I2C_MUX_GPIO instead of CONFIG_I2C_MUX for now. We
can revisit if the i2c-i801 driver ever supports other multiplexing
flavors.

Also make that optional code depend on DMI, as it won't do anything
without that.

Signed-off-by: Jean Delvare <[email protected]>
Cc: Fengguang Wu <[email protected]>
  • Loading branch information
Jean Delvare authored and Jean Delvare committed Oct 28, 2012
1 parent 31d178b commit 79e3e5b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion drivers/i2c/busses/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ config I2C_I801
tristate "Intel 82801 (ICH/PCH)"
depends on PCI
select CHECK_SIGNATURE if X86 && DMI
select GPIOLIB if I2C_MUX
help
If you say yes to this option, support will be included for the Intel
801 family of mainboard I2C interfaces. Specifically, the following
Expand Down
9 changes: 6 additions & 3 deletions drivers/i2c/busses/i2c-i801.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@
#include <linux/wait.h>
#include <linux/err.h>

#if defined CONFIG_I2C_MUX || defined CONFIG_I2C_MUX_MODULE
#if (defined CONFIG_I2C_MUX_GPIO || defined CONFIG_I2C_MUX_GPIO_MODULE) && \
defined CONFIG_DMI
#include <linux/gpio.h>
#include <linux/i2c-mux-gpio.h>
#include <linux/platform_device.h>
Expand Down Expand Up @@ -192,7 +193,8 @@ struct i801_priv {
int len;
u8 *data;

#if defined CONFIG_I2C_MUX || defined CONFIG_I2C_MUX_MODULE
#if (defined CONFIG_I2C_MUX_GPIO || defined CONFIG_I2C_MUX_GPIO_MODULE) && \
defined CONFIG_DMI
const struct i801_mux_config *mux_drvdata;
struct platform_device *mux_pdev;
#endif
Expand Down Expand Up @@ -921,7 +923,8 @@ static void __init input_apanel_init(void) {}
static void __devinit i801_probe_optional_slaves(struct i801_priv *priv) {}
#endif /* CONFIG_X86 && CONFIG_DMI */

#if defined CONFIG_I2C_MUX || defined CONFIG_I2C_MUX_MODULE
#if (defined CONFIG_I2C_MUX_GPIO || defined CONFIG_I2C_MUX_GPIO_MODULE) && \
defined CONFIG_DMI
static struct i801_mux_config i801_mux_config_asus_z8_d12 = {
.gpio_chip = "gpio_ich",
.values = { 0x02, 0x03 },
Expand Down

0 comments on commit 79e3e5b

Please sign in to comment.