Re: [PATCH v1 2/2] hwmon: (amc6821) Add PWM polarity configuration with OF

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Quentin,

On Wed, Feb 19, 2025 at 11:08:43AM +0100, Quentin Schulz wrote:
> On 2/18/25 5:56 PM, Francesco Dolcini wrote:
> > From: Francesco Dolcini <francesco.dolcini@xxxxxxxxxxx>
> > 
> > Add support to configure the PWM-Out pin polarity based on a device
> > tree property.
> > 
> > Signed-off-by: Francesco Dolcini <francesco.dolcini@xxxxxxxxxxx>
> > ---
> >   drivers/hwmon/amc6821.c | 7 +++++--
> >   1 file changed, 5 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/hwmon/amc6821.c b/drivers/hwmon/amc6821.c
> > index 1e3c6acd8974..1ea2d97eebca 100644
> > --- a/drivers/hwmon/amc6821.c
> > +++ b/drivers/hwmon/amc6821.c
> > @@ -845,7 +845,7 @@ static int amc6821_detect(struct i2c_client *client, struct i2c_board_info *info
> >   	return 0;
> >   }
> > -static int amc6821_init_client(struct amc6821_data *data)
> > +static int amc6821_init_client(struct i2c_client *client, struct amc6821_data *data)
> >   {
> >   	struct regmap *regmap = data->regmap;
> >   	int err;
> > @@ -864,6 +864,9 @@ static int amc6821_init_client(struct amc6821_data *data)
> >   		if (err)
> >   			return err;
> > +		if (of_property_read_bool(client->dev.of_node, "ti,pwm-inverted"))
> 
> I know that the AMC6821 is doing a lot of smart things, but this really
> tickled me. PWM controllers actually do support that already via
> PWM_POLARITY_INVERTED flag for example. See
> Documentation/devicetree/bindings/hwmon/adt7475.yaml which seems to be
> another HWMON driver which acts as a PWM controller. I'm not sure this is
> relevant, applicable or desired but I wanted to highlight this.


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux