Re: [PATCH] 2.6.24-rc1: ensure "present" sysfs attribute even if battery is absent

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrey Borzenkov <arvidjaar@...>
Cc: <linux-acpi@...>, <linux-kernel@...>, <dwmw2@...>
Date: Saturday, October 27, 2007 - 2:42 pm

On Sat, Oct 27, 2007 at 08:54:30PM +0400, Andrey Borzenkov wrote:

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.
Is that possible with the ACPI?

The good example is ds2760 batteries:

drivers/power/ds2760_battery.c - is platform device
drivers/w1/slaves/w1_ds2760.c - is w1 slave, which
registers/unregisters pdevs on the detection/removal.


Bad idea. Don't use present attribute, if possible.


-- 
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] 2.6.24-rc1: ensure "present" sysfs attribute even if..., Andrey Borzenkov, (Sat Oct 27, 12:54 pm)
Re: [PATCH] 2.6.24-rc1: ensure "present" sysfs attribute eve..., Anton Vorontsov, (Sat Oct 27, 2:42 pm)
Re: [PATCH] 2.6.24-rc1: ensure "present" sysfs attribute eve..., Alexey Starikovskiy, (Sat Oct 27, 1:16 pm)
Re: [PATCH] 2.6.24-rc1: ensure "present" sysfs attribute eve..., Alexey Starikovskiy, (Sat Oct 27, 2:18 pm)