summaryrefslogtreecommitdiff
path: root/hald/device_pm.c
AgeCommit message (Collapse)AuthorFilesLines
2008-03-17autofix primary (ACPI) batteries which charge with a rate > 50 WDanny Kukawka1-1/+26
This patch try to detect automatically broken batteries which tell that they charge a primary (Laptop) battery with a chargerate higher than 50 W (50.000 mW), which is IMO in 100% of the cases wrong for Laptop batteries. Maybe we can also assume a much lower level as criterion. To get valid remaining time values this patch set in such cases battery.remaining_time.calculate_per_time=true and calculate the remaining time based on time and the chargelevel.
2008-03-03comment out debugging spew for nowDavid Zeuthen1-1/+1
2008-01-29fixed device_pm_abstract_props() to set also battery.charge_level.designDanny Kukawka1-0/+10
Fixed device_pm_abstract_props() to set also battery.charge_level.design since the key is mandatory.
2008-01-15fix percentage for empty batteriesDanny Kukawka1-7/+11
With commit d7144f2aa1b59f9a0acfa0daada69e2a4ffd54d8 the handling of empty batteries changed, which cause massive problems with multi battery machines. In the past the battery.charge_level.percentage key was removed if there where any problems with calculate the remaining percentage of a battery. This include the case where the current charge level was 0, which was/is IMO also wrong, since 0 is a correct value for a percentage. With the current HAL the battery get set in such cases to 100% which cause e.g. KPowersave to assume the battery is full and not empty, which also lead to wrong overall remaining percentage calculation (never reach critical battery levels, always over 50%) in multi battery systems, which can lead to crash the complete system if both batteries get empty! This patch change the code to remove the key again on problems. IMO we should think about change the behavior if the current charge level is really 0 to set the percentage also to 0. The userspace tools should be able to handle this!
2007-12-06fix normalised_rate if dis-/charging state is unknownDanny Kukawka1-2/+53
This fixes problems with machines which report not the correct charging state in some cases (e.g. battery report 'charged' if on battery). With this patch normalised_rate get set only to 0 if: * the battery is not a primary (ACPI) battery * the machines is on AC or * there is in a multi battery system an other primary (ACPI) battery is discharging This should fix: https://bugzilla.novell.com/show_bug.cgi?id=258755
2007-07-04fix some warnings in the device_pm codeRichard Hughes1-2/+2
Fix a couple of warnings for unused variables, and include all the correct headers. No code changes.
2007-07-03add device_pm.{c|h} to abstract out some of the common codeRichard Hughes1-0/+259
This can't just be put into util_pm as it relies on HalDevice, which we can't use in addons and probers. It's also needed for other cleanup patches I'll need for power_supply device class device.