[SRU][N][PATCH 5/11] i2c: piix4: Register SPDs

Alice C. Munduruca alice.munduruca at canonical.com
Tue Sep 2 14:37:14 UTC 2025


From: Thomas Weißschuh <linux at weissschuh.net>

The piix4 I2C bus can carry SPDs, register them if present.
Only look on bus 0, as this is where the SPDs seem to be located.

Only the first 8 slots are supported. If the system has more,
then these will not be visible.

The AUX bus can not be probed as on some platforms it reports all
devices present and all reads return "0".
This would allow the ee1004 to be probed incorrectly.

Signed-off-by: Thomas Weißschuh <linux at weissschuh.net>
Reviewed-by: Guenter Roeck <linux at roeck-us.net>
Tested-by: Guenter Roeck <linux at roeck-us.net>
Signed-off-by: Andi Shyti <andi.shyti at kernel.org>
(backported from commit de4f2f52f93257433c9029ba2b4044cd9f029b21)
[cremfuelled: Added to the existing dependencies for I2C_PIIX4]
BugLink: https://bugs.launchpad.net/bugs/2114963
Signed-off-by: Alice C. Munduruca <alice.munduruca at canonical.com>
---
 drivers/i2c/busses/Kconfig     | 3 ++-
 drivers/i2c/busses/i2c-piix4.c | 9 +++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 5748ab0e28ac..ce006bc27da2 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -188,7 +188,8 @@ config I2C_ISMT
 
 config I2C_PIIX4
 	tristate "Intel PIIX4 and compatible (ATI/AMD/Serverworks/Broadcom/SMSC)"
-	depends on PCI
+	depends on PCI && HAS_IOPORT
+	select I2C_SMBUS
 	help
 	  If you say yes to this option, support will be included for the Intel
 	  PIIX4 family of mainboard I2C interfaces.  Specifically, the following
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
index 6a0392172b2f..5af934617810 100644
--- a/drivers/i2c/busses/i2c-piix4.c
+++ b/drivers/i2c/busses/i2c-piix4.c
@@ -29,6 +29,7 @@
 #include <linux/stddef.h>
 #include <linux/ioport.h>
 #include <linux/i2c.h>
+#include <linux/i2c-smbus.h>
 #include <linux/slab.h>
 #include <linux/dmi.h>
 #include <linux/acpi.h>
@@ -982,6 +983,14 @@ static int piix4_add_adapter(struct pci_dev *dev, unsigned short smba,
 		return retval;
 	}
 
+	/*
+	 * The AUX bus can not be probed as on some platforms it reports all
+	 * devices present and all reads return "0".
+	 * This would allow the ee1004 to be probed incorrectly.
+	 */
+	if (port == 0)
+		i2c_register_spd(adap);
+
 	*padap = adap;
 	return 0;
 }
-- 
2.48.1




More information about the kernel-team mailing list