[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <u4aigv7nhsqygisyrhcohq25tvktsukjexng6zddib6kvj6hwl@vaa2pset4qbi>
Date: Tue, 24 Jun 2025 09:29:25 +0200
From: Uwe Kleine-König <ukleinek@...nel.org>
To: Dimitri Fedrau <dima.fedrau@...il.com>
Cc: dimitri.fedrau@...bherr.com, Jean Delvare <jdelvare@...e.com>,
Guenter Roeck <linux@...ck-us.net>, linux-pwm@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-hwmon@...r.kernel.org
Subject: Re: [PATCH v3] pwm: mc33xs2410: add support for temperature sensors
On Tue, Jun 24, 2025 at 09:04:42AM +0200, Dimitri Fedrau wrote:
> Hi Uwe,
>
> Am Mon, Jun 23, 2025 at 11:07:24AM +0200 schrieb Uwe Kleine-König:
> > hello Dimitri,
> >
> > On Thu, Jun 19, 2025 at 07:32:42PM +0200, Dimitri Fedrau via B4 Relay wrote:
> > > @@ -29,6 +30,8 @@
> > >
> > > #include <linux/spi/spi.h>
> > >
> > > +/* ctrl registers */
> > > +
> > > #define MC33XS2410_GLB_CTRL 0x00
> > > #define MC33XS2410_GLB_CTRL_MODE GENMASK(7, 6)
> > > #define MC33XS2410_GLB_CTRL_MODE_NORMAL FIELD_PREP(MC33XS2410_GLB_CTRL_MODE, 1)
> > > @@ -51,6 +54,21 @@
> > >
> > > #define MC33XS2410_WDT 0x14
> > >
> > > +#define MC33XS2410_TEMP_WT 0x29
> > > +#define MC33XS2410_TEMP_WT_MASK GENMASK(7, 0)
> > > +
> > > +/* diag registers */
> > > +
> > > +/* chan in { 1 ... 4 } */
> > > +#define MC33XS2410_OUT_STA(chan) (0x02 + (chan) - 1)
> > > +#define MC33XS2410_OUT_STA_OTW BIT(8)
> > > +
> > > +#define MC33XS2410_TS_TEMP_DIE 0x26
> > > +#define MC33XS2410_TS_TEMP_MASK GENMASK(9, 0)
> >
> > Keep the registers in address order please
>
> Aren't they ? There are "ctrl" and "diag" registers and I didn't mix up
> adresses. There is a comment for each of them when defines start.
+#define MC33XS2410_TEMP_WT 0x29
...
+#define MC33XS2410_TS_TEMP_DIE 0x26
> > > +/* chan in { 1 ... 4 } */
> > > +#define MC33XS2410_TS_TEMP(chan) (0x2f + (chan) - 1)
> >
> > I wonder if it would be cleaner if this was abstracted using mfd. Then
> > the hwmon driver could live in drivers/hwmon
> >
> I will have a look into auxiliary devices as Guenter proposed in a
> following mail.
FTR: auxiliary device is also fine for me.
Best regards
Uwe
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists