[PATCH 2/2] hwmon: (pmbus/tps53679) Select page 0 for single-page TPS536C7
From: Pradhan, Sanman
Date: Wed Sep 16 2026 - 16:13:08 EST
From: Sanman Pradhan <psanman@xxxxxxxxxxx>
tps536c7_identify() sets info->pages to 1 for a single-channel part and
then accesses page 0 (writing PMBUS_PHASE) without ensuring PAGE is
actually 0. pmbus_set_page() does not update the PAGE register when
info->pages is 1, so if boot firmware left PAGE set to another value the
PHASE writes and subsequent telemetry may target the wrong page.
Select page 0 explicitly and verify it before configuring PHASE.
Signed-off-by: Sanman Pradhan <psanman@xxxxxxxxxxx>
---
drivers/hwmon/pmbus/tps53679.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/hwmon/pmbus/tps53679.c b/drivers/hwmon/pmbus/tps53679.c
index f38c19b8cc43..b68313485511 100644
--- a/drivers/hwmon/pmbus/tps53679.c
+++ b/drivers/hwmon/pmbus/tps53679.c
@@ -299,6 +299,30 @@ static int tps536c7_identify(struct i2c_client *client,
*/
info->pages = phases_b ? 2 : 1;
+ /*
+ * pmbus_set_page() does not update the PAGE register on single-page
+ * devices, so select page 0 explicitly and verify it in case the
+ * boot firmware left the device on another page.
+ */
+ if (info->pages == 1) {
+ ret = i2c_smbus_read_byte_data(client, PMBUS_PAGE);
+ if (ret < 0)
+ return ret;
+ if (ret != 0) {
+ ret = i2c_smbus_write_byte_data(client, PMBUS_PAGE, 0);
+ if (ret < 0)
+ return ret;
+ ret = i2c_smbus_read_byte_data(client, PMBUS_PAGE);
+ if (ret < 0)
+ return ret;
+ if (ret != 0) {
+ dev_err(&client->dev,
+ "failed to select page 0\n");
+ return -EIO;
+ }
+ }
+ }
+
/*
* With info->phases[] left unset the PMBus core never programs the
* PHASE selector, so make sure each page reports the aggregate
--
2.34.1