Lines Matching refs:batt
104 static int pmu_query_battery(struct pmu_softc *sc, int batt,
109 static void pmu_battery_notify(struct pmu_battstate *batt,
874 pmu_query_battery(struct pmu_softc *sc, int batt, struct pmu_battstate *info)
880 reg = batt + 1;
938 pmu_battery_notify(struct pmu_battstate *batt, struct pmu_battstate *old)
943 new_acline = (batt->state & PMU_PWR_AC_PRESENT) ? 1 : 0;
957 struct pmu_battstate batt;
966 error = pmu_query_battery(sc, 0, &batt);
967 pmu_battery_notify(&batt, &cur_batt);
968 cur_batt = batt;
1000 struct pmu_battstate batt;
1006 error = pmu_query_battery(sc, 0, &batt);
1011 result = (batt.state & PMU_PWR_AC_PRESENT) ? 1 : 0;
1021 struct pmu_battstate batt;
1026 error = pmu_query_battery(sc, arg2 & 0x00ff, &batt);
1033 result = (batt.state & PMU_PWR_BATT_PRESENT) ? 1 : 0;
1036 result = (batt.state & PMU_PWR_BATT_CHARGING) ? 1 : 0;
1039 result = batt.charge;
1042 result = batt.maxcharge;
1045 result = batt.current;
1048 result = batt.voltage;
1053 if (batt.current >= 0)
1054 result = (batt.maxcharge - batt.charge) /* mAh */ * 60
1055 / batt.current /* mA */;
1057 result = (batt.charge /* mAh */ * 60)
1058 / (-batt.current /* mA */);
1062 result = (batt.charge * 100) / batt.maxcharge;