[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2af2888f-919c-40a0-901a-8eb0bc1f1257@roeck-us.net>
Date: Tue, 4 Mar 2025 03:07:00 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: Dzmitry Sankouski <dsankouski@...il.com>
Cc: Jean Delvare <jdelvare@...e.com>, Jonathan Corbet <corbet@....net>,
linux-hwmon@...r.kernel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] hwmon: (max77705) add initial support
On 3/4/25 02:03, Dzmitry Sankouski wrote:
> ср, 26 февр. 2025 г. в 16:53, Guenter Roeck <linux@...ck-us.net>:
>>
>> On 2/25/25 11:11, Dzmitry Sankouski wrote:
>>> Add support for max77705 hwmon. Includes charger input, system bus, and
>>> vbyp measurements.
>>>
>>> Signed-off-by: Dzmitry Sankouski <dsankouski@...il.com>
>>> ---
>>> Maxim MAX77705 is a Companion Power Management and Type-C interface IC.
>>> It includes charger and fuel gauge blocks, and is capable of measuring
>>> charger input current, system bus volatage and current, and bypass
>>> voltage.
>>>
>>> This patch add support for mentioned measurements.
> (...)
>>> +
>>> +struct channel_desc {
>>> + u8 reg;
>>> + u8 avg_reg;
>>> + const char *const label;
>>> + // register resolution. nano Volts for voltage, nano Amperes for current
>>> + u64 resolution;
>>
>> Why u64 ?
>>
>
> Resolution is in nano Volts, and VBYP value is typically 5v, which leads to
> u32 overflow.
>
That is not a valid reason. The resolution itself does not overflow.
The conversion to 64-bit calculations can be done there.
> (...)
>>
>> This is unusual for an mfd driver. Why not pass regmap from the parent
>> driver ?
>>
>
> This limits access to shared device register map by using readable table
> with related registers only.
>
I do not see that as valid reason to implement separate regmaps. That
only complicates the code.
Guenter
Powered by blists - more mailing lists