From: Jerome Brunet <jbrunet@baylibre.com>
To: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Jean Delvare <jdelvare@suse.com>,
Guenter Roeck <linux@roeck-us.net>,
Jonathan Corbet <corbet@lwn.net>
Cc: linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org,
linux-doc@vger.kernel.org, Jerome Brunet <jbrunet@baylibre.com>
Subject: [PATCH 3/5] hwmon: (pmbus/core) allow drivers to override WRITE_PROTECT
Date: Fri, 20 Sep 2024 18:47:04 +0200 [thread overview]
Message-ID: <20240920-pmbus-wp-v1-3-d679ef31c483@baylibre.com> (raw)
In-Reply-To: <20240920-pmbus-wp-v1-0-d679ef31c483@baylibre.com>
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>
---
drivers/hwmon/pmbus/pmbus_core.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index 0ea6fe7eb17c..82522fc9090a 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
@@ -2712,9 +2712,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, 0xff, PMBUS_WRITE_PROTECT);
if (ret > 0 && (ret & PB_WP_ANY))
data->flags |= PMBUS_WRITE_PROTECTED | PMBUS_SKIP_STATUS_CHECK;
--
2.45.2
next prev parent reply other threads:[~2024-09-20 16:47 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-20 16:47 [PATCH 0/5] hwmon: (pmbus/core) support write protected pmbus regulators Jerome Brunet
2024-09-20 16:47 ` [PATCH 1/5] regulator: core: add callback to perform runtime init Jerome Brunet
2024-09-20 16:47 ` [PATCH 2/5] regulator: core: remove machine init callback from config Jerome Brunet
2024-09-24 8:12 ` Mark Brown
2024-09-20 16:47 ` Jerome Brunet [this message]
2024-09-20 16:47 ` [PATCH 4/5] hwmon: (pmbus/core) improve handling of write protected regulators Jerome Brunet
2024-09-20 21:13 ` Guenter Roeck
2024-09-21 11:32 ` Jerome Brunet
2024-09-21 15:22 ` Guenter Roeck
2024-09-21 16:49 ` Jerome Brunet
2024-09-21 17:16 ` Guenter Roeck
2024-09-23 12:21 ` Mark Brown
2024-09-23 16:53 ` Jerome Brunet
2024-09-24 8:11 ` Mark Brown
2024-09-23 13:21 ` Mark Brown
2024-09-23 16:44 ` Guenter Roeck
2024-10-08 12:44 ` Jerome Brunet
2024-09-20 16:47 ` [PATCH 5/5] hwmon: (pmbus/core) add wp module param Jerome Brunet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240920-pmbus-wp-v1-3-d679ef31c483@baylibre.com \
--to=jbrunet@baylibre.com \
--cc=broonie@kernel.org \
--cc=corbet@lwn.net \
--cc=jdelvare@suse.com \
--cc=lgirdwood@gmail.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®