[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250602140947.GA58087@francesco-nb>
Date: Mon, 2 Jun 2025 16:09:47 +0200
From: Francesco Dolcini <francesco@...cini.it>
To: Quentin Schulz <quentin.schulz@...rry.de>
Cc: João Paulo Gonçalves <jpaulo.silvagoncalves@...il.com>,
Jean Delvare <jdelvare@...e.com>,
Guenter Roeck <linux@...ck-us.net>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Farouk Bouabid <farouk.bouabid@...rry.de>,
linux-hwmon@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org,
João Paulo Gonçalves <joao.goncalves@...adex.com>
Subject: Re: [PATCH 2/3] hwmon: (amc6821) Move reading fan data from OF to a
function
Hello Quentin, João
On Mon, Jun 02, 2025 at 03:21:31PM +0200, Quentin Schulz wrote:
> On 5/30/25 7:46 PM, João Paulo Gonçalves wrote:
> > From: João Paulo Gonçalves <joao.goncalves@...adex.com>
> >
> > Move fan property reading from OF to a separate function. This keeps OF
> > data handling separate from the code logic and makes it easier to add
> > features like cooling device support that use the same fan node.
> >
> > Signed-off-by: João Paulo Gonçalves <joao.goncalves@...adex.com>
> > ---
> > drivers/hwmon/amc6821.c | 58 +++++++++++++++++++++++++++++++------------------
> > 1 file changed, 37 insertions(+), 21 deletions(-)
> >
> > diff --git a/drivers/hwmon/amc6821.c b/drivers/hwmon/amc6821.c
> > index 13a789cc85d24da282430eb2d4edf0003617fe6b..a969fad803ae1abb05113ce15f2476e83df029d9 100644
> > --- a/drivers/hwmon/amc6821.c
> > +++ b/drivers/hwmon/amc6821.c
> > @@ -126,6 +126,7 @@ module_param(init, int, 0444);
> > struct amc6821_data {
> > struct regmap *regmap;
> > struct mutex update_lock;
> > + enum pwm_polarity of_pwm_polarity;
>
> Do we actually need to keep the information about the OF polarity?
...
> Otherwise I would have said we just need to store the "computed" polarity,
> the output of amc6821_pwm_polarity instead of going through the logic every
> time we ask for the polarity.
I would do this. This pwminv parameter is already weird, given that this
is just a HW configuration, and we have it just for legacy reason.
Francesco
Powered by blists - more mailing lists