summaryrefslogtreecommitdiff
path: root/sys/arch/loongson
diff options
context:
space:
mode:
authorFrederic Cambus <fcambus@cvs.openbsd.org>2016-12-05 15:04:16 +0000
committerFrederic Cambus <fcambus@cvs.openbsd.org>2016-12-05 15:04:16 +0000
commit3d100bed7e17dd2604e5f1599df3b353a9eabe00 (patch)
tree8ab51667961a2f259b91394f5103bac5a41bf0d2 /sys/arch/loongson
parente26e2b336e58950e4f78039b9e6cc918f44932a3 (diff)
Harmonize battery state thresholds accross platforms.
Use the same values hardcoded in sys/dev/acpi/acpi.c where possible. OK visa@
Diffstat (limited to 'sys/arch/loongson')
-rw-r--r--sys/arch/loongson/dev/kb3310.c5
-rw-r--r--sys/arch/loongson/dev/stsec.c11
2 files changed, 7 insertions, 9 deletions
diff --git a/sys/arch/loongson/dev/kb3310.c b/sys/arch/loongson/dev/kb3310.c
index d9887dc5a0e..044eccef39e 100644
--- a/sys/arch/loongson/dev/kb3310.c
+++ b/sys/arch/loongson/dev/kb3310.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kb3310.c,v 1.21 2016/11/15 13:53:35 fcambus Exp $ */
+/* $OpenBSD: kb3310.c,v 1.22 2016/12/05 15:04:15 fcambus Exp $ */
/*
* Copyright (c) 2010 Otto Moerbeek <otto@drijf.net>
*
@@ -408,8 +408,7 @@ ykbec_refresh(void *arg)
ykbec_apmdata.battery_state = APM_BATT_CHARGING;
else if (ISSET(bat_status, BAT_STATUS_BAT_LOW))
ykbec_apmdata.battery_state = APM_BATT_CRITICAL;
- /* XXX arbitrary */
- else if (cap_pct > 60)
+ else if (cap_pct > 50)
ykbec_apmdata.battery_state = APM_BATT_HIGH;
else
ykbec_apmdata.battery_state = APM_BATT_LOW;
diff --git a/sys/arch/loongson/dev/stsec.c b/sys/arch/loongson/dev/stsec.c
index 31a6387ff93..0dcd4c85b20 100644
--- a/sys/arch/loongson/dev/stsec.c
+++ b/sys/arch/loongson/dev/stsec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: stsec.c,v 1.4 2010/03/08 20:56:20 miod Exp $ */
+/* $OpenBSD: stsec.c,v 1.5 2016/12/05 15:04:15 fcambus Exp $ */
/*
* Copyright (c) 2010 Miodrag Vallat.
@@ -323,13 +323,12 @@ stsec_sensors_update(void *vsc)
} else {
if (ISSET(control, STC_CHARGE_ENABLE))
stsec_apmdata.battery_state = APM_BATT_CHARGING;
- /* XXX arbitrary */
- else if (cap_pct < 10)
- stsec_apmdata.battery_state = APM_BATT_CRITICAL;
- else if (cap_pct > 60)
+ else if (cap_pct > 50)
stsec_apmdata.battery_state = APM_BATT_HIGH;
- else
+ else if (cap_pct > 25)
stsec_apmdata.battery_state = APM_BATT_LOW;
+ else
+ stsec_apmdata.battery_state = APM_BATT_CRITICAL;
stsec_apmdata.minutes_left = -1; /* unknown */
}