[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250624070442.GA3383@legfed1>
Date: Tue, 24 Jun 2025 09:04:42 +0200
From: Dimitri Fedrau <dima.fedrau@...il.com>
To: Uwe Kleine-König <ukleinek@...nel.org>
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
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.
> > +/* 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.
> Liebe Grüße
> Uwe
Viele Grüße
Dimitri
Powered by blists - more mailing lists