Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: Jerome Brunet <jbrunet@baylibre.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Jean Delvare <jdelvare@suse.com>,
	 Jonathan Corbet <corbet@lwn.net>,
	Patrick Rudolph <patrick.rudolph@9elements.com>,
	 Naresh Solanki <naresh.solanki@9elements.com>,
	 Rob Herring <robh@kernel.org>,
	 Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>,
	Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>,
	linux-hwmon@vger.kernel.org,  linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org,  devicetree@vger.kernel.org,
	linux-i2c@vger.kernel.org,  Vaishnav Achath <vaishnav.a@ti.com>
Subject: Re: [PATCH v4 7/7] hwmon: (pmbus/tps25990): add initial support
Date: Fri, 08 Nov 2024 09:47:36 +0100	[thread overview]
Message-ID: <1jpln62jtj.fsf@starbuckisacylon.baylibre.com> (raw)
In-Reply-To: <df0db75a-b5e1-4bd8-8a59-de85b0a77fa5@roeck-us.net> (Guenter Roeck's message of "Wed, 6 Nov 2024 10:59:11 -0800")

On Wed 06 Nov 2024 at 10:59, Guenter Roeck <linux@roeck-us.net> wrote:

>> +
>> +static int tps25990_mfr_write_protect_set(struct i2c_client *client,
>> +					  u8 protect)
>> +{
>> +	/*
>> +	 * The chip has a single protection mode, set it regardless of
>> +	 * the specific protection requested
>> +	 */
>> +	return pmbus_write_byte_data(client, -1, TPS25990_MFR_WRITE_PROTECT,
>> +				     protect ? 0x0 : 0xa2);
>
> After some thought, I think it would be better to reject all protect values
> other than 0 (no write protection) and PB_WP_ALL because that is what the chip
> supports. Something like

Since operation would not be allowed, it's maps the closest indeed.

>
> 	if (protect & ~PB_WP_ALL)
> 		return -ENXIO;		// or -EINVAL ? Not really sure.

The command is supported but the argument would not be, so -EINVAL seems
appropriate to me.

>
> Thanks,
> Guenter

-- 
Jerome

  reply	other threads:[~2024-11-08  8:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-05 17:58 [PATCH v4 0/7] hwmon: pmbus: add tps25990 efuse support Jerome Brunet
2024-11-05 17:58 ` [PATCH v4 1/7] hwmon: (pmbus) add documentation for existing flags Jerome Brunet
2024-11-06 15:57   ` Guenter Roeck
2024-11-05 17:58 ` [PATCH v4 2/7] hwmon: (pmbus/core) allow drivers to override WRITE_PROTECT Jerome Brunet
2024-11-06 15:58   ` Guenter Roeck
2024-11-05 17:58 ` [PATCH v4 3/7] hwmon: (pmbus/core) improve handling of write protected regulators Jerome Brunet
2024-11-05 17:58 ` [PATCH v4 4/7] hwmon: (pmbus/core) add wp module param Jerome Brunet
2024-11-05 17:58 ` [PATCH v4 5/7] hwmon: (pmbus/core) clear faults after setting smbalert mask Jerome Brunet
2024-11-06 16:03   ` Guenter Roeck
2024-11-05 17:58 ` [PATCH v4 6/7] dt-bindings: hwmon: pmbus: add ti tps25990 support Jerome Brunet
2024-11-06 16:05   ` Guenter Roeck
2024-11-05 17:58 ` [PATCH v4 7/7] hwmon: (pmbus/tps25990): add initial support Jerome Brunet
2024-11-06 18:59   ` Guenter Roeck
2024-11-08  8:47     ` Jerome Brunet [this message]
2024-11-06 16:12 ` [PATCH v4 0/7] hwmon: pmbus: add tps25990 efuse support Guenter Roeck
2024-11-08  8:52   ` 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=1jpln62jtj.fsf@starbuckisacylon.baylibre.com \
    --to=jbrunet@baylibre.com \
    --cc=Delphine_CC_Chiu@wiwynn.com \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=jdelvare@suse.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=naresh.solanki@9elements.com \
    --cc=patrick.rudolph@9elements.com \
    --cc=robh@kernel.org \
    --cc=vaishnav.a@ti.com \
    /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