>>>>> "Nico" == Nico Golde <[EMAIL PROTECTED]> writes:
Nico> This is a bug in libacpi which still needs to be adapter for
Nico> the new sysfs interface :/ Patches welcome :)
Hi Nico;
A partial fix follows. This allows correct battery percentage on my box.
The battery status is still wrong (reports "charging" when
/sys/class/power_supply/BAT0/status
contains "Full".
Fixing that looked like it required understanding more about the sysfs
acpi interface that I do right now.
--- libacpi.c.orig
+++ libacpi.c
@@ -536,17 +536,17 @@
return NOT_PRESENT;
}
- snprintf(sysfile, MAX_NAME, "%s/charge_full_design",
info->info_file);
+ snprintf(sysfile, MAX_NAME, "%s/energy_full_design",
info->info_file);
if((buf = get_acpi_content(sysfile)) == NULL)
return NOT_SUPPORTED;
info->design_cap = strtol(buf, NULL, 10);
- snprintf(sysfile, MAX_NAME, "%s/charge_full", info->info_file);
+ snprintf(sysfile, MAX_NAME, "%s/energy_full", info->info_file);
if((buf = get_acpi_content(sysfile)) == NULL)
return NOT_SUPPORTED;
info->last_full_cap = strtol(buf, NULL, 10);
- snprintf(sysfile, MAX_NAME, "%s/charge_now", info->info_file);
+ snprintf(sysfile, MAX_NAME, "%s/energy_now", info->info_file);
if((buf = get_acpi_content(sysfile)) == NULL)
return NOT_SUPPORTED;
info->remaining_cap = strtol(buf, NULL, 10);
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]