summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJerome Brunet <jbrunet@baylibre.com>2024-11-05 18:58:39 +0100
committerGuenter Roeck <linux@roeck-us.net>2024-11-12 13:54:39 -0800
commit7a750b3986b7910711a5525dde0c84b541e72746 (patch)
treedf7ef1f7b865389b741dbd6dbbd946379903ac3e /drivers
parent544177f20be2eebc7dd2a55feaf186ac68acc22d (diff)
downloadlinux-stable-7a750b3986b7910711a5525dde0c84b541e72746.tar.gz
linux-stable-7a750b3986b7910711a5525dde0c84b541e72746.tar.bz2
linux-stable-7a750b3986b7910711a5525dde0c84b541e72746.zip
hwmon: (pmbus/core) allow drivers to override WRITE_PROTECT
Use _pmbus_read_byte_data() rather than calling smbus directly to check the write protection status. This give a chance to device implementing write protection differently to report back on the actual write protection status. Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Message-ID: <20241105-tps25990-v4-2-0e312ac70b62@baylibre.com> [groeck: Fix page parameter of _pmbus_read_byte_data()] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hwmon/pmbus/pmbus_core.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index ce7fd4ca9d89..7f88b5d08046 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
@@ -2719,9 +2719,7 @@ static int pmbus_init_common(struct i2c_client *client, struct pmbus_data *data,
* limit registers need to be disabled.
*/
if (!(data->flags & PMBUS_NO_WRITE_PROTECT)) {
- pmbus_wait(client);
- ret = i2c_smbus_read_byte_data(client, PMBUS_WRITE_PROTECT);
- pmbus_update_ts(client, false);
+ ret = _pmbus_read_byte_data(client, -1, PMBUS_WRITE_PROTECT);
if (ret > 0 && (ret & PB_WP_ANY))
data->flags |= PMBUS_WRITE_PROTECTED | PMBUS_SKIP_STATUS_CHECK;