Configuring shunt_resistor in hwmon

Lei YU mine260309 at gmail.com
Tue Jan 7 14:20:07 AEDT 2020


On Tue, Jan 7, 2020 at 5:38 AM James Feist <james.feist at linux.intel.com> wrote:
>
> On 1/6/20 1:29 PM, Alex Qiu wrote:
> > Hi James,
> >
> > Thanks for your quick reply and reviewing my code in the morning!
> >
> > That looks interesting, so this ScaleFactor will be used to multiply the
> > voltage value from hwmon without setting the shunt_resistor explicitly?
> > I do have a little concern on the resolution, because it's only
> > reporting 0.165V with default shunt_resistor setting, but we'll try and
> > see if this will work for our case. In the meantime, do you know any
> > other method that will work?
>
> That's all I'm aware of in dbus-sensors. We have a voltage divider
> in-front of our ADC channels, so we use this scale factor to calculate
> the actual voltage. Anything else I think you'd need to add as a new
> change if you're using dbus-sensors. I'm not sure if phosphor-hwmon
> offers anything you could use or not.

With phosphor-hwmon, you could define GAIN, OFFSET in the config file
to adjust the reading.
See details in
https://github.com/openbmc/docs/blob/master/architecture/sensor-architecture.md#my-sensors-are-not-defined-in-an-mrw


More information about the openbmc mailing list