- Subject: Re: [PATCH] hwmon: INA219 and INA226 support
- From: "Felten, Lothar" <l-felten@xxxxxx>
- Date: Tue, 22 May 2012 07:13:35 +0000
- Accept-language: en-US
- In-reply-to: <1337618663.22553.357.camel@groeck-laptop>
- Thread-index: Ac0tQYHOD3vG6sGXQBeloX+fE+BdBgKHrRuAACCDrsA=
- Thread-topic: [PATCH] hwmon: INA219 and INA226 support
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
_______________________________________________
lm-sensors mailing list
lm-sensors@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
[Video for Linux]
[Mplayer Users]
[Linux USB Devel]
[Linux Audio Users]
[Photos]
[Yosemite Photos]
[Free Singles Community]
[Linux Kernel]
[Linux SCSI]
[XFree86]
[Yosemite Backpacking]