mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
hwmon: (pmbus/tps53679) Select page 0 for single-page TPS536C7
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 before configuring PHASE. Signed-off-by: Sanman Pradhan <psanman@juniper.net> Link: https://patch.msgid.link/20260916235406.681131-3-sanman.pradhan@hpe.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
parent
4810ec90c4
commit
c3147b4d1b
|
|
@ -283,6 +283,17 @@ 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 in case the boot firmware
|
||||
* left the device on another page.
|
||||
*/
|
||||
if (info->pages == 1) {
|
||||
ret = i2c_smbus_write_byte_data(client, PMBUS_PAGE, 0);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* With info->phases[] left unset the PMBus core never programs the
|
||||
* PHASE selector, so make sure each page reports the aggregate
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user