[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<PH0PR03MB6938294669F61BA99DC90D168E2E2@PH0PR03MB6938.namprd03.prod.outlook.com>
Date: Mon, 25 Nov 2024 03:07:31 +0000
From: "Encarnacion, Cedric justine" <Cedricjustine.Encarnacion@...log.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Guenter Roeck
<linux@...ck-us.net>
CC: "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-i2c@...r.kernel.org" <linux-i2c@...r.kernel.org>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
"linux-hwmon@...r.kernel.org" <linux-hwmon@...r.kernel.org>,
Jean Delvare
<jdelvare@...e.com>, Jonathan Corbet <corbet@....net>,
Delphine CC Chiu
<Delphine_CC_Chiu@...ynn.com>,
Rob Herring <robh@...nel.org>,
Krzysztof
Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
"Sabau,
Radu bogdan" <Radu.Sabau@...log.com>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
"Torreno, Alexis Czezar"
<AlexisCzezar.Torreno@...log.com>
Subject: RE: [PATCH 2/2] hwmon: (pmbus/adp1050): add support for adp1051,
adp1055 and ltp8800
> -----Original Message-----
> From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Sent: Thursday, November 21, 2024 12:29 AM
> To: Guenter Roeck <linux@...ck-us.net>
> Cc: Encarnacion, Cedric justine <Cedricjustine.Encarnacion@...log.com>;
> devicetree@...r.kernel.org; linux-kernel@...r.kernel.org; linux-
> i2c@...r.kernel.org; linux-doc@...r.kernel.org; linux-hwmon@...r.kernel.org;
> Jean Delvare <jdelvare@...e.com>; Jonathan Corbet <corbet@....net>;
> Delphine CC Chiu <Delphine_CC_Chiu@...ynn.com>; Rob Herring
> <robh@...nel.org>; Krzysztof Kozlowski <krzk+dt@...nel.org>; Conor Dooley
> <conor+dt@...nel.org>; Sabau, Radu bogdan <Radu.Sabau@...log.com>; Uwe
> Kleine-König <u.kleine-koenig@...gutronix.de>; Torreno, Alexis Czezar
> <AlexisCzezar.Torreno@...log.com>
> Subject: Re: [PATCH 2/2] hwmon: (pmbus/adp1050): add support for adp1051,
> adp1055 and ltp8800
>
> [External]
>
> On Wed, Nov 20, 2024 at 06:53:58AM -0800, Guenter Roeck wrote:
> > On 11/20/24 05:52, Andy Shevchenko wrote:
> > > On Wed, Nov 20, 2024 at 11:58:26AM +0800, Cedric Encarnacion wrote:
>
> ...
>
> > > > +#if IS_ENABLED(CONFIG_SENSORS_ADP1050_REGULATOR)
> > >
> > > Why? Is the data type undefined without this?
> >
> > Look into other drivers. That is how it is implemented there, and not
> > really the point. One has to know about an alternative to use it.
> >
> > > > +static const struct regulator_desc adp1050_reg_desc[] = {
> > > > + PMBUS_REGULATOR_ONE("vout"),
> > > > +};
> > > > +#endif /* CONFIG_SENSORS_ADP1050_REGULATOR */
> > >
> > > Note, this can be dropped anyway in order to use PTR_IF() below, if required.
> >
> > FWIW, PTR_IF() isn't widely used, and I for my part was not aware that
> > it exists.
>
> Yeah, it's a relatively new one...
>
> ...
>
> > > > +#if IS_ENABLED(CONFIG_SENSORS_ADP1050_REGULATOR)
> > > > + .num_regulators = 1,
> > > > + .reg_desc = adp1050_reg_desc,
> > > > +#endif
> > >
> > > Ditto, are the fields not defined without the symbol?
> >
> > They are, but they must be 0/NULL. PTR_IF() would be an alternative.
> > It is a bit odd to use it for a non-pointer, but it is type-agnostic,
> > so using it should be ok to avoid the #ifdefs. We should maybe adopt
> > that mechanism for other PMBus drivers.
>
> I see, thanks for elaboration on all of this.
>
> ...
>
> > > Please, split this patch to at least two:
> > > 1) Introduce chip_info;
> >
> > That would really be "Use driver data to point to chip info".
>
> I agree on the title, what I meant is the rough description of what should be
> done in the change.
>
> > > 2) add new devices.
> >
> > I don't really care much about separating those two (after all, they
> > are related), but adding regulator support to the driver is a major
> > change and should be a separate patch. On top of that, it isn't even
> > mentioned in the patch description.
>
> Indeed, that's why I mentioned "at least" in the reply.
In this case, I will be separating this patch into two: one adding the new
devices and another adding regulator support. I will also be sticking to
using the #ifdefs but let me know if we should start using PTR_IF().
Thanks,
Cedric
Powered by blists - more mailing lists