aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLan Tianyu <tianyu.lan@intel.com>2014-08-15 01:38:59 -0400
committerWolfram Sang <wsa@the-dreams.de>2014-08-19 11:19:39 -0400
commit366047515c6eab2ff886bc28d1c2b0ad041d040a (patch)
tree5cb391fb269e26814318a138b15642a3e5c94c2d
parent7d1311b93e58ed55f3a31cc8f94c4b8fe988a2b9 (diff)
i2c: rework kernel config I2C_ACPI
Commit da3c6647(I2C/ACPI: Clean up I2C ACPI code and Add CONFIG_I2C_ACPI config) adds a new kernel config I2C_ACPI and make I2C core built in when the config is selected. This is wrong because distributions etc generally compile I2C as a module and the commit broken that. This patch is to rename I2C_ACPI to ACPI_I2C_OPREGION. New config only controls ACPI I2C operation region code and depends on I2C=y. Signed-off-by: Lan Tianyu <tianyu.lan@intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> [wsa: removed unrelated change for Kconfig] Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
-rw-r--r--drivers/i2c/Kconfig15
-rw-r--r--drivers/i2c/Makefile2
-rw-r--r--drivers/i2c/i2c-acpi.c2
-rw-r--r--include/linux/i2c.h12
4 files changed, 17 insertions, 14 deletions
diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
index 3e3b680dc007..b51a402752c4 100644
--- a/drivers/i2c/Kconfig
+++ b/drivers/i2c/Kconfig
@@ -23,17 +23,14 @@ config I2C
23 This I2C support can also be built as a module. If so, the module 23 This I2C support can also be built as a module. If so, the module
24 will be called i2c-core. 24 will be called i2c-core.
25 25
26config I2C_ACPI 26config ACPI_I2C_OPREGION
27 bool "I2C ACPI support" 27 bool "ACPI I2C Operation region support"
28 select I2C 28 depends on I2C=y && ACPI
29 depends on ACPI
30 default y 29 default y
31 help 30 help
32 Say Y here if you want to enable ACPI I2C support. This includes support 31 Say Y here if you want to enable ACPI I2C operation region support.
33 for automatic enumeration of I2C slave devices and support for ACPI I2C 32 Operation Regions allow firmware (BIOS) code to access I2C slave devices,
34 Operation Regions. Operation Regions allow firmware (BIOS) code to 33 such as smart batteries through an I2C host controller driver.
35 access I2C slave devices, such as smart batteries through an I2C host
36 controller driver.
37 34
38if I2C 35if I2C
39 36
diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
index a1f590cbb435..e0228b228256 100644
--- a/drivers/i2c/Makefile
+++ b/drivers/i2c/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5i2ccore-y := i2c-core.o 5i2ccore-y := i2c-core.o
6i2ccore-$(CONFIG_I2C_ACPI) += i2c-acpi.o 6i2ccore-$(CONFIG_ACPI) += i2c-acpi.o
7 7
8obj-$(CONFIG_I2C_BOARDINFO) += i2c-boardinfo.o 8obj-$(CONFIG_I2C_BOARDINFO) += i2c-boardinfo.o
9obj-$(CONFIG_I2C) += i2ccore.o 9obj-$(CONFIG_I2C) += i2ccore.o
diff --git a/drivers/i2c/i2c-acpi.c b/drivers/i2c/i2c-acpi.c
index e8b61967334b..0dbc18c15c43 100644
--- a/drivers/i2c/i2c-acpi.c
+++ b/drivers/i2c/i2c-acpi.c
@@ -126,6 +126,7 @@ void acpi_i2c_register_devices(struct i2c_adapter *adap)
126 dev_warn(&adap->dev, "failed to enumerate I2C slaves\n"); 126 dev_warn(&adap->dev, "failed to enumerate I2C slaves\n");
127} 127}
128 128
129#ifdef CONFIG_ACPI_I2C_OPREGION
129static int acpi_gsb_i2c_read_bytes(struct i2c_client *client, 130static int acpi_gsb_i2c_read_bytes(struct i2c_client *client,
130 u8 cmd, u8 *data, u8 data_len) 131 u8 cmd, u8 *data, u8 data_len)
131{ 132{
@@ -360,3 +361,4 @@ void acpi_i2c_remove_space_handler(struct i2c_adapter *adapter)
360 361
361 acpi_bus_detach_private_data(handle); 362 acpi_bus_detach_private_data(handle);
362} 363}
364#endif
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index ea507665896c..a95efeb53a8b 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -577,16 +577,20 @@ static inline struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node
577} 577}
578#endif /* CONFIG_OF */ 578#endif /* CONFIG_OF */
579 579
580#ifdef CONFIG_I2C_ACPI 580#ifdef CONFIG_ACPI
581int acpi_i2c_install_space_handler(struct i2c_adapter *adapter);
582void acpi_i2c_remove_space_handler(struct i2c_adapter *adapter);
583void acpi_i2c_register_devices(struct i2c_adapter *adap); 581void acpi_i2c_register_devices(struct i2c_adapter *adap);
584#else 582#else
585static inline void acpi_i2c_register_devices(struct i2c_adapter *adap) { } 583static inline void acpi_i2c_register_devices(struct i2c_adapter *adap) { }
584#endif /* CONFIG_ACPI */
585
586#ifdef CONFIG_ACPI_I2C_OPREGION
587int acpi_i2c_install_space_handler(struct i2c_adapter *adapter);
588void acpi_i2c_remove_space_handler(struct i2c_adapter *adapter);
589#else
586static inline void acpi_i2c_remove_space_handler(struct i2c_adapter *adapter) 590static inline void acpi_i2c_remove_space_handler(struct i2c_adapter *adapter)
587{ } 591{ }
588static inline int acpi_i2c_install_space_handler(struct i2c_adapter *adapter) 592static inline int acpi_i2c_install_space_handler(struct i2c_adapter *adapter)
589{ return 0; } 593{ return 0; }
590#endif 594#endif /* CONFIG_ACPI_I2C_OPREGION */
591 595
592#endif /* _LINUX_I2C_H */ 596#endif /* _LINUX_I2C_H */