[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <71571dd9-65a8-4ccd-3fe5-88c22dd5b492@9elements.com>
Date: Mon, 21 Nov 2022 17:05:51 +0530
From: Naresh Solanki <naresh.solanki@...ements.com>
To: Guenter Roeck <linux@...ck-us.net>
Cc: linux-hwmon@...r.kernel.org, Jean Delvare <jdelvare@...e.com>,
broonie@...nel.org,
Patrick Rudolph <patrick.rudolph@...ements.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] hwmon: (pmbus/core): Implement regulator get_status
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@...ements.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
Powered by blists - more mailing lists