lkml.org 
[lkml]   [2022]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3] hwmon: (pmbus/core): Implement regulator get_status
From
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

\
 
 \ /
  Last update: 2022-11-21 12:39    [W:0.056 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site