linux-gbmc: Backport adm1273 and adm1281 support
ref: https://github.com/torvalds/linux/blob/master/drivers/hwmon/pmbus/adm1275.c
Tested:
hotswap_in | 11.79 Amps | ok
hotswap_in | 555.50 Watts | ok
hotswap_in | 29 degrees C | ok
hotswap_in | 47.91 Volts | ok
Fusion-Link:
Platforms-Affected: all ttf
Smoke-Bug-Id: 418641065
Google-Bug-Id: 418934313
Change-Id: I37d125435803163dcba5a50745303d7aaf8a5e15
Signed-off-by: Charles Hsu <charles.hsu@quanta.corp-partner.google.com>
(cherry picked from commit b039dd52a6fb9990c6af8136d3e1a093870c9c58)
diff --git a/recipes-kernel/linux/files/0001-hwmon-add-support-for-adm1273-and-adm1281.patch b/recipes-kernel/linux/files/0001-hwmon-add-support-for-adm1273-and-adm1281.patch
new file mode 100644
index 0000000..3b45545
--- /dev/null
+++ b/recipes-kernel/linux/files/0001-hwmon-add-support-for-adm1273-and-adm1281.patch
@@ -0,0 +1,76 @@
+From e499d6b32f22f7162d653999da5b517003308d43 Mon Sep 17 00:00:00 2001
+From: Charles Hsu <charles.hsu@quanta.corp-partner.google.com>
+Date: Wed, 21 May 2025 09:01:18 +0800
+Subject: [PATCH] hwmon: add support for adm1273 and adm1281
+
+Add support for adm1273 and adm1281 which is similar to adm1275
+and other chips of the series.
+
+Signed-off-by: Charles Hsu <charles.hsu@quanta.corp-partner.google.com>
+Patch Tracking Bug: b/418934313
+Upstream-Status: Backport
+Justification: change to new HSC
+---
+ drivers/hwmon/pmbus/adm1275.c | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/hwmon/pmbus/adm1275.c b/drivers/hwmon/pmbus/adm1275.c
+index 501646cbef10..75f6c8ee8b7b 100644
+--- a/drivers/hwmon/pmbus/adm1275.c
++++ b/drivers/hwmon/pmbus/adm1275.c
+@@ -18,7 +18,7 @@
+ #include <linux/log2.h>
+ #include "pmbus.h"
+
+-enum chips { adm1075, adm1272, adm1275, adm1276, adm1278, adm1293, adm1294 };
++enum chips { adm1075, adm1272, adm1273, adm1275, adm1276, adm1278, adm1281, adm1293, adm1294 };
+
+ #define ADM1275_MFR_STATUS_IOUT_WARN2 BIT(0)
+ #define ADM1293_MFR_STATUS_VAUX_UV_WARN BIT(5)
+@@ -479,9 +479,11 @@ static int adm1275_read_byte_data(struct i2c_client *client, int page, int reg)
+ static const struct i2c_device_id adm1275_id[] = {
+ { "adm1075", adm1075 },
+ { "adm1272", adm1272 },
++ { "adm1273", adm1273 },
+ { "adm1275", adm1275 },
+ { "adm1276", adm1276 },
+ { "adm1278", adm1278 },
++ { "adm1281", adm1281 },
+ { "adm1293", adm1293 },
+ { "adm1294", adm1294 },
+ { }
+@@ -554,7 +556,8 @@ static int adm1275_probe(struct i2c_client *client)
+ "Device mismatch: Configured %s, detected %s\n",
+ client->name, mid->name);
+
+- if (mid->driver_data == adm1272 || mid->driver_data == adm1278 ||
++ if (mid->driver_data == adm1272 || mid->driver_data == adm1273 ||
++ mid->driver_data == adm1278 || mid->driver_data == adm1281 ||
+ mid->driver_data == adm1293 || mid->driver_data == adm1294)
+ config_read_fn = i2c_smbus_read_word_data;
+ else
+@@ -628,6 +631,7 @@ static int adm1275_probe(struct i2c_client *client)
+ PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT;
+ break;
+ case adm1272:
++ case adm1273:
+ data->have_vout = true;
+ data->have_pin_max = true;
+ data->have_temp_max = true;
+@@ -703,6 +707,7 @@ static int adm1275_probe(struct i2c_client *client)
+ PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT;
+ break;
+ case adm1278:
++ case adm1281:
+ data->have_vout = true;
+ data->have_pin_max = true;
+ data->have_temp_max = true;
+@@ -863,4 +868,4 @@ module_i2c_driver(adm1275_driver);
+ MODULE_AUTHOR("Guenter Roeck");
+ MODULE_DESCRIPTION("PMBus driver for Analog Devices ADM1275 and compatibles");
+ MODULE_LICENSE("GPL");
+-MODULE_IMPORT_NS(PMBUS);
++MODULE_IMPORT_NS("PMBUS");
+--
+2.34.1
+
diff --git a/recipes-kernel/linux/linux-gbmc_5.15.bb b/recipes-kernel/linux/linux-gbmc_5.15.bb
index 44d5c5a..94b01a5 100644
--- a/recipes-kernel/linux/linux-gbmc_5.15.bb
+++ b/recipes-kernel/linux/linux-gbmc_5.15.bb
@@ -25,6 +25,7 @@
file://0001-iio-adc-npcm-add-reset-method-to-fix-get-value-faile.patch \
file://0001-hwmon-pmbus-Initialise-page-count-in-pmbus_identify.patch \
file://0001-i2c-npcm-Add-clock-toggle-recovery.patch \
+ file://0001-hwmon-add-support-for-adm1273-and-adm1281.patch \
"
SRC_URI:append:aspeed-g6 = " \