Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Lan Tianyu and committed by
Wolfram Sang
36604751 7d1311b9

+17 -14
+6 -9
drivers/i2c/Kconfig
··· 23 23 This I2C support can also be built as a module. If so, the module 24 24 will be called i2c-core. 25 25 26 - config I2C_ACPI 27 - bool "I2C ACPI support" 28 - select I2C 29 - depends on ACPI 26 + config ACPI_I2C_OPREGION 27 + bool "ACPI I2C Operation region support" 28 + depends on I2C=y && ACPI 30 29 default y 31 30 help 32 - Say Y here if you want to enable ACPI I2C support. This includes support 33 - for automatic enumeration of I2C slave devices and support for ACPI I2C 34 - Operation Regions. Operation Regions allow firmware (BIOS) code to 35 - access I2C slave devices, such as smart batteries through an I2C host 36 - controller driver. 31 + Say Y here if you want to enable ACPI I2C operation region support. 32 + Operation Regions allow firmware (BIOS) code to access I2C slave devices, 33 + such as smart batteries through an I2C host controller driver. 37 34 38 35 if I2C 39 36
+1 -1
drivers/i2c/Makefile
··· 3 3 # 4 4 5 5 i2ccore-y := i2c-core.o 6 - i2ccore-$(CONFIG_I2C_ACPI) += i2c-acpi.o 6 + i2ccore-$(CONFIG_ACPI) += i2c-acpi.o 7 7 8 8 obj-$(CONFIG_I2C_BOARDINFO) += i2c-boardinfo.o 9 9 obj-$(CONFIG_I2C) += i2ccore.o
+2
drivers/i2c/i2c-acpi.c
··· 126 126 dev_warn(&adap->dev, "failed to enumerate I2C slaves\n"); 127 127 } 128 128 129 + #ifdef CONFIG_ACPI_I2C_OPREGION 129 130 static int acpi_gsb_i2c_read_bytes(struct i2c_client *client, 130 131 u8 cmd, u8 *data, u8 data_len) 131 132 { ··· 361 360 362 361 acpi_bus_detach_private_data(handle); 363 362 } 363 + #endif
+8 -4
include/linux/i2c.h
··· 577 577 } 578 578 #endif /* CONFIG_OF */ 579 579 580 - #ifdef CONFIG_I2C_ACPI 581 - int acpi_i2c_install_space_handler(struct i2c_adapter *adapter); 582 - void acpi_i2c_remove_space_handler(struct i2c_adapter *adapter); 580 + #ifdef CONFIG_ACPI 583 581 void acpi_i2c_register_devices(struct i2c_adapter *adap); 584 582 #else 585 583 static inline void acpi_i2c_register_devices(struct i2c_adapter *adap) { } 584 + #endif /* CONFIG_ACPI */ 585 + 586 + #ifdef CONFIG_ACPI_I2C_OPREGION 587 + int acpi_i2c_install_space_handler(struct i2c_adapter *adapter); 588 + void acpi_i2c_remove_space_handler(struct i2c_adapter *adapter); 589 + #else 586 590 static inline void acpi_i2c_remove_space_handler(struct i2c_adapter *adapter) 587 591 { } 588 592 static inline int acpi_i2c_install_space_handler(struct i2c_adapter *adapter) 589 593 { return 0; } 590 - #endif 594 + #endif /* CONFIG_ACPI_I2C_OPREGION */ 591 595 592 596 #endif /* _LINUX_I2C_H */