From: Alan Jenkins <sourcejedi.lkml@googlemail.com>
To: avorontsov@ru.mvista.com
Cc: Maxim Levitsky <maximlevitsky@gmail.com>,
Anton Vorontsov <cbou@mail.ru>,
David Woodhouse <dwmw2@infradead.org>,
linux acpi <linux-acpi@vger.kernel.org>,
Alexey Starikovskiy <alexey.y.starikovskiy@linux.intel.com>
Subject: Re: [PATCH] ACPI: battery: register power_supply subdevice even when battery not present
Date: Fri, 11 Sep 2009 15:16:22 +0100 [thread overview]
Message-ID: <9b2b86520909110716o7f426eaeya4e14570b3b0b0a5@mail.gmail.com> (raw)
In-Reply-To: <20090911131022.GA3803@oksana.dev.rtsoft.ru>
On 9/11/09, Anton Vorontsov <avorontsov@ru.mvista.com> wrote:
> On Fri, Sep 11, 2009 at 01:28:42PM +0100, Alan Jenkins wrote:
>> [CC power_supply maintainers]
>>
>> I tried to fix the ACPI battery driver so it created a power supply
>> device even if the battery is not present. All the other battery
>> drivers do this. It would let e.g. gnome-power-manager to detect the
>> presence of a battery bay, and allow configuration of battery
>> behaviour even when the battery has been removed.
>
> This was discussed several times already.
>
> http://lkml.org/lkml/2009/4/27/314
> http://lkml.org/lkml/2007/10/27/170
>
>> Unfortunately this is not as easy as I thought.
>
> And not possible for certain batteries.
>
> [...]
>> I can think of some more complex ways to do this
>>
>> 1) Destroy and recreate the battery device on hotplug.
>> 2) Modify the generic power supply class to allow changing the set of
>> attribute.
>> 3) Restructure the interface to provide a "battery bay" device as a
>> parent.
>>
>> 1) and 2) are hacks. 1) could at least cause annoyingly spurious UI
>> events. 2) sounds like a bad idea, but existing userspace _might_
>> handle it because it already happens at registration time. (Power
>> supply attributes aren't available on the initial ADD uevent; they are
>> added in a follow-up CHANGE uevent).
>>
>> 3) could be backwards compatible and relatively straightforward. The
>> "battery bay" could be a new type of power supply device, with no
>> attributes of its own.
>
> Yes, that would be nice. There could be some attributes though,
> I can think of a temperature sensor (measures ambient/bay
> temperature), a battery presence/lock sensor etc.
>
> IIRC, battery bay in iPaq hx4700 devices can report if a battery is
> locked (that's all it can do, but still useful).
>
>> It could be created automatically for non-acpi batteries.
>
> Why? If there is no bay, we don't need any device for it.
I thought it would be easier for userspace... but actually there's no
point since programs will still have to handle older kernels.
Ok, I'll write 3) and see what happens.
Alan
next prev parent reply other threads:[~2009-09-11 14:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-11 12:28 [PATCH] ACPI: battery: register power_supply subdevice even when battery not present Alan Jenkins
2009-09-11 13:10 ` Anton Vorontsov
2009-09-11 14:16 ` Alan Jenkins [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-04-05 16:23 Alexey Starikovskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9b2b86520909110716o7f426eaeya4e14570b3b0b0a5@mail.gmail.com \
--to=sourcejedi.lkml@googlemail.com \
--cc=alexey.y.starikovskiy@linux.intel.com \
--cc=avorontsov@ru.mvista.com \
--cc=cbou@mail.ru \
--cc=dwmw2@infradead.org \
--cc=linux-acpi@vger.kernel.org \
--cc=maximlevitsky@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox