On Saturday 27 October 2007, Anton Vorontsov wrote: > On Sat, Oct 27, 2007 at 08:54:30PM +0400, Andrey Borzenkov wrote: > > I am not exactly sure about this one ... what other power_supply class > > drivers do? Should I fix HAL instead (but then, I do not know whether HAL > > is the only application that is using this interface). > > Well, PROP_PRESENT wasn't my idea, currently it's used by pmu and > olpc drivers becuase it's not trivial to register/unregister their > batteries on physical insertion/removal. I have some plans to teach > at least pmu batteries to not use PROP_PRESENT. I don't have any > OLPC, thus I can't convert it. > > To sum this: the good way to handle "missing" batteries is to > unregister them, so they'll not show up in the /sys/class/power_supply. Well, in this case HAL behaviour makes sense (default to present == true if "present" attribute is missing) > Is that possible with the ACPI? > At least looking in ACPI specs, this looks possible. What currently is presented as battery object is actually battery bay according to ACPI spec: Unlike most other devices, when a battery is inserted or removed from the system, the device itself (the battery bay) is still considered to be present in the system. When battery is inserted/removed, ACPI notifies us and we can check whether battery is actually present and update registration accordingly. From the sysfs structure POV probably nothing has to be changed; just when and how power_supply is registered under /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:0n Alexey, does it make sense (or doable)?
Attachment:
signature.asc
Description: This is a digitally signed message part.
- Follow-Ups:
- [PATCH] [2.6.24-rc] ACPI: register power_supply subdevice only when battery is present
- From: Andrey Borzenkov <[email protected]>
- [PATCH] [2.6.24-rc] ACPI: register power_supply subdevice only when battery is present
- References:
- [PATCH] 2.6.24-rc1: ensure "present" sysfs attribute even if battery is absent
- From: Andrey Borzenkov <[email protected]>
- Re: [PATCH] 2.6.24-rc1: ensure "present" sysfs attribute even if battery is absent
- From: Anton Vorontsov <[email protected]>
- [PATCH] 2.6.24-rc1: ensure "present" sysfs attribute even if battery is absent
- Prev by Date: Re: [PATCH 2/2] Version 9 (2.6.24-rc1) Smack: Simplified Mandatory Access Control Kernel
- Next by Date: Re: [PATCH] proc_fs.h redux
- Previous by thread: Re: [PATCH] 2.6.24-rc1: ensure "present" sysfs attribute even if battery is absent
- Next by thread: [PATCH] [2.6.24-rc] ACPI: register power_supply subdevice only when battery is present
- Index(es):