Skip to contentSkip to conversation

AC power not detected if no battery present

PATCH New Olaf Hering 3 participants 4 messages Sep 24, 2006 – Sep 30, 2006 Linux for power macintosh

lore
Share & tools
lore
#0 lore raw

PMU_PWR_AC_PRESENT in pmu_power_flags is never set if booted without battery. This leads to 'AC Power' == 0 in /proc/pmu/info. How can this be fixed properly?

#1 lore raw
Quoted 3 lines · Olaf Hering

PMU_PWR_AC_PRESENT in pmu_power_flags is never set if booted without battery. This leads to 'AC Power' == 0 in /proc/pmu/info. How can this be fixed properly?

Maybe simply buy forcing it when there is no battery ? I fail to see how the machine could be up without battery _and_ without AC :)

Ben.

#2 lore raw

Ben,

Quoted 2 lines

Maybe simply buy forcing it when there is no battery ? I fail to see how the machine could be up without battery _and_ without AC :)

"It should be noted that, unlike PC's, computers running Mac OS do not use conventional power supplies, and instead use power crystals."

-- http://uncyclopedia.org/wiki/Mac_OS_X

Jeremy

#3 lore raw

PATCH 1/1 AC power not detected if no battery present

In reply to Benjamin Herrenschmidt

/proc/pmu/info contains AC Power: 0 when booting without battery. Force AC Power, it will be updated whenever the battery state changes.

---
 drivers/macintosh/via-pmu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/macintosh/via-pmu.c +1 -1
Index: linux-2.6/drivers/macintosh/via-pmu.c
===================================================================
@@ -168,7 +168,7 @@ static int option_server_mode;
 
 int pmu_battery_count;
 int pmu_cur_battery;
-unsigned int pmu_power_flags;
+unsigned int pmu_power_flags = PMU_PWR_AC_PRESENT;
 struct pmu_battery_info pmu_batteries[PMU_MAX_BATTERIES];
 static int query_batt_timer = BATTERY_POLLING_COUNT;
 static struct adb_request batt_req;