Re: [PATCH v7 3/3] iio: adc: add driver for the MAX34417 Four-Channel High Dynamic Range Power Accumulator
From: Andy Shevchenko
Date: Tue Nov 24 2026 - 05:14:15 EST
On Tue, Nov 24, 2026 at 10:30:52AM +0100, Neil Armstrong wrote:
> On 11/23/26 20:39, Andy Shevchenko wrote:
> > On Mon, Nov 23, 2026 at 06:47:46PM +0100, Neil Armstrong wrote:
...
> > > +#define MAX34417_MIN_RSENSE_UOHM (1 * MILLI)
> > > +#define MAX34417_MAX_RSENSE_UOHM (100 * MILLI)
> > > +#define MAX34417_DEFAULT_RSENSE_UOHM (1 * MILLI)
> >
> > Oh, it's micro, but you use MILLI. Also even in macros we nowadays want to see
> > the unit as defined in SI.
> >
> > #define MAX34417_MIN_RSENSE_uOhm (1 * (MICRO / MILLI))
> > #define MAX34417_MAX_RSENSE_uOhm (100 * (MICRO / MILLI))
> > #define MAX34417_DEFAULT_RSENSE_uOhm (1 * (MICRO / MILLI))
> >
> > Alternatively add another patch to start Ohm multipliers in units.h
> >
> > #define MICROOHM_PER_MILLIOHM 1000
> >
> > I will Ack it.
>
> Hmm, I want to express the min/max/default rsense in uOhm, minimum is 1000 uOhm,
> max is 100000 uOhm, so initially they were:
> #define MAX34417_MIN_RSENSE (1000)
> #define MAX34417_MAX_RSENSE (100000)
>
> and the unit is uOhm, so how should I define them ?
>
> with #define MICROOHM_PER_MILLIOHM 1000
>
> #define MAX34417_MIN_RSENSE_uOhm (1 * MICROOHM_PER_MILLIOHM)
> #define MAX34417_MAX_RSENSE_uOhm (100 * MICROOHM_PER_MILLIOHM)
>
> ?
Yes, precisely!
--
With Best Regards,
Andy Shevchenko