[lm-sensors] [PATCH] hwmon: INA219 and INA226 support

Felten, Lothar l-felten at ti.com
Tue May 22 09:13:35 CEST 2012


Hi Guenter,

> Hi Lothar,
>
> > Hello,
> >
> > This patch brings support for the Texas Instruments INA219 and INA226
> power monitors.
> >
> I have a couple of observations.
>
> [ ... ]
> > +
> > +/* settings - depend on use case */
> > +#define INA219_CONFIG_DEFAULT          0x219F  /* PGA=1 */
> > +#define INA226_CONFIG_DEFAULT          0x4527  /* averages=16 */
> > +
>
> With this configuration (PGA=1), the dynamic range for the shunt
> resistor voltage is 40 mV. Since we report the value in mV, it does not
> provide much value to do that. It might be better to use PGA=8 instead,
> for a dynamic range of 320 mV.
>
> Did you have a special reason for selecting PGA=1 ? Otherwise, I think
> we should change it to PGA=8.

No there was no special reason, the default setting after reset is PGA=8, this
Is probably the best selection. So that should be:
#define INA219_CONFIG_DEFAULT          0x399F  /* default values */

INA2XX_SHUNT_VOLTAGE will then go from -320mV to +320mV, that should be ok.

> [ ... ]
>
> > +
> > +       if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
> > +               return -ENODEV;
> > +
>
> This is actually wrong; we need to check for I2C_FUNC_SMBUS_WORD_DATA
> instead. I fixed that already.
>
> Thanks,
> Guenter

Best regards,
Lothar




Texas Instruments Belgium SA, Rond Point Schuman 6– Boîte 5, 1040 Bruxelles. BCE: 0414.207.123. RPM Bruxelles. IBAN: BE83570121895615. Swift: CITIBEBX. TVA BE 0414.207.123




More information about the lm-sensors mailing list