Wednesday, September 07, 2022

Re: Changing sysctl hw.sensors names on a T410

On Wed Sep 7, 2022 at 10:42 AM EDT, Lévai, Dániel wrote:

> I noticed this weirdness here on an old but trusty T410 ThinkPad, in that it sometimes changes its sysctl hw.sensors names for its battery.
> Sometimes it's watthour/power and other times it's amphour/current:

Doesn't seem like a problem with obsd. Your "smart" battery seems to report in
watts or Amps randomly, or for some internal reason.

Snippet from sys/dev/acpi/acpisbs.c (acpi smart battery status):

> acpisbs_setup_sensors(struct acpisbs_softc *sc)
> {
> ...
> ...
> if (check.sensor_type == SENSOR_AMPHOUR &&
> sc->sc_battery.units == ACPISBS_UNITS_MW)
> /* translate to watt-hours */
> sc->sc_sensors[i].type = SENSOR_WATTHOUR;
> else
> sc->sc_sensors[i].type = check.sensor_type;
>
> ...
> ...
> }

Hope that answers your question

--
Jaskaran

No comments:

Post a Comment