Skip to content

Commit 29fdd5b

Browse files
committed
Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c fixes from Wolfram Sang: "Here is the fixup for the 'lowlight' of my last pull request. I2C is not selected anymore by I2C_ACPI. Instead, the code in question now depends on I2C=y. Also, Mika has agreed to support me and be the maintainer for I2C-ACPI related patches. Finally, a new-ID-patch came along last week" * 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: MAINTAINERS: add maintainer for ACPI parts of I2C i2c: i801: Add PCI ID for Intel Braswell i2c: rework kernel config I2C_ACPI
2 parents d1433d5 + 4560d67 commit 29fdd5b

File tree

6 files changed

+26
-14
lines changed

6 files changed

+26
-14
lines changed

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4446,6 +4446,13 @@ F: include/linux/i2c-*.h
44464446
F: include/uapi/linux/i2c.h
44474447
F: include/uapi/linux/i2c-*.h
44484448

4449+
I2C ACPI SUPPORT
4450+
M: Mika Westerberg <[email protected]>
4451+
4452+
4453+
S: Maintained
4454+
F: drivers/i2c/i2c-acpi.c
4455+
44494456
I2C-TAOS-EVM DRIVER
44504457
M: Jean Delvare <[email protected]>
44514458

drivers/i2c/Kconfig

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,14 @@ config I2C
2323
This I2C support can also be built as a module. If so, the module
2424
will be called i2c-core.
2525

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
3029
default y
3130
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.
3734

3835
if I2C
3936

drivers/i2c/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55
i2ccore-y := i2c-core.o
6-
i2ccore-$(CONFIG_I2C_ACPI) += i2c-acpi.o
6+
i2ccore-$(CONFIG_ACPI) += i2c-acpi.o
77

88
obj-$(CONFIG_I2C_BOARDINFO) += i2c-boardinfo.o
99
obj-$(CONFIG_I2C) += i2ccore.o

drivers/i2c/busses/i2c-i801.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@
164164

165165
/* Older devices have their ID defined in <linux/pci_ids.h> */
166166
#define PCI_DEVICE_ID_INTEL_BAYTRAIL_SMBUS 0x0f12
167+
#define PCI_DEVICE_ID_INTEL_BRASWELL_SMBUS 0x2292
167168
#define PCI_DEVICE_ID_INTEL_COUGARPOINT_SMBUS 0x1c22
168169
#define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS 0x1d22
169170
/* Patsburg also has three 'Integrated Device Function' SMBus controllers */
@@ -828,6 +829,7 @@ static const struct pci_device_id i801_ids[] = {
828829
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_WILDCATPOINT_SMBUS) },
829830
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_WILDCATPOINT_LP_SMBUS) },
830831
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BAYTRAIL_SMBUS) },
832+
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BRASWELL_SMBUS) },
831833
{ 0, }
832834
};
833835

drivers/i2c/i2c-acpi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ void acpi_i2c_register_devices(struct i2c_adapter *adap)
126126
dev_warn(&adap->dev, "failed to enumerate I2C slaves\n");
127127
}
128128

129+
#ifdef CONFIG_ACPI_I2C_OPREGION
129130
static int acpi_gsb_i2c_read_bytes(struct i2c_client *client,
130131
u8 cmd, u8 *data, u8 data_len)
131132
{
@@ -360,3 +361,4 @@ void acpi_i2c_remove_space_handler(struct i2c_adapter *adapter)
360361

361362
acpi_bus_detach_private_data(handle);
362363
}
364+
#endif

include/linux/i2c.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -577,16 +577,20 @@ static inline struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node
577577
}
578578
#endif /* CONFIG_OF */
579579

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
583581
void acpi_i2c_register_devices(struct i2c_adapter *adap);
584582
#else
585583
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
586590
static inline void acpi_i2c_remove_space_handler(struct i2c_adapter *adapter)
587591
{ }
588592
static inline int acpi_i2c_install_space_handler(struct i2c_adapter *adapter)
589593
{ return 0; }
590-
#endif
594+
#endif /* CONFIG_ACPI_I2C_OPREGION */
591595

592596
#endif /* _LINUX_I2C_H */

0 commit comments

Comments
 (0)