linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Naresh Solanki <naresh.solanki@9elements.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org, Jean Delvare <jdelvare@suse.com>,
	broonie@kernel.org,
	Patrick Rudolph <patrick.rudolph@9elements.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] hwmon: (pmbus/core): Implement regulator get_status
Date: Mon, 21 Nov 2022 17:05:51 +0530	[thread overview]
Message-ID: <71571dd9-65a8-4ccd-3fe5-88c22dd5b492@9elements.com> (raw)
In-Reply-To: <20221120141432.GA1790249@roeck-us.net>

Hi Guenter,

On 20-11-2022 07:44 pm, Guenter Roeck wrote:
> On Sat, Nov 19, 2022 at 07:25:16PM +0100, Naresh Solanki wrote:
>> From: Patrick Rudolph <patrick.rudolph@9elements.com>
>>
>> Add get_status for pmbus_regulator_ops.
>>
>> Changes:
>> - use lock throughout the function
>> - Avoid line continuation upto 100 column
>> - Optimize use of & and | operator
>> - Check for VOUT, IOUT, TEMPERATURE bit in status word before checking
>>    respective status register for fault.
>> - Report regulator current status.
>>
> Change log should be after '---'
Sure
> 
> Also, when looking into this, I realized that we already have
> pmbus_regulator_get_error_flags() which has somewhat overlapping
> functionality. Would it be possible to utilize that function to get
> the error status instead of more or less hand-coding it ?
Sure. But looking at get_status scope, I feel that we are already 
checking the following:
1. Check if regulator is off & yes then return off
2. If not off then it should be on & has power good then return on
3. If no power good then this itself is error condition so return error. 
Decoding status register for fault just double confirms that & may not 
be needed in get_status unless we are going to print or utilize the 
error bit information in some other way but that is out of scope of 
get_status call unless I missed something.

Does this approach makes sense ?
> 
> Thanks,
> Guenter

      reply	other threads:[~2022-11-21 11:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-19 18:25 [PATCH v3] hwmon: (pmbus/core): Implement regulator get_status Naresh Solanki
2022-11-20 14:14 ` Guenter Roeck
2022-11-21 11:35   ` Naresh Solanki [this message]

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=71571dd9-65a8-4ccd-3fe5-88c22dd5b492@9elements.com \
    --to=naresh.solanki@9elements.com \
    --cc=broonie@kernel.org \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=patrick.rudolph@9elements.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;
as well as URLs for NNTP newsgroup(s).