Re: [GIT PULL RFC] directly poll battery strength when reading power_supply

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/06/2011 01:56 AM, Richard Hughes wrote:
> On 3 December 2011 06:13, Jeremy Fitzhardinge <jeremy@xxxxxxxx> wrote:
>> The only functional change I made from Daniel's patch is keeping the power_supply type as BATTERY rather
>> than USB.
> How is upower supposed to know that the device is:
>
> a) a mouse
> b) not powering the computer
>
> Any ideas welcome. I suppose we could look at the hid device, but this
> seems like a hack. Thanks.

(CC power_supply maintainers: the discussion is how to represent
power_supplies for self-powered HID devices like wireless mice.)

I've been thinking about this.  I think the obvious fix is that the
power_supply should have a link to the root of the device tree it
powers.   So the system battery and line power should point to the root,
whereas a battery powered device would point to itself.
Something like  HID UPS would appear to be in the middle of the USB
devices, but actually powers the whole machine (or more).

In other words, the power_supply device is the management interface for
the power supply, and it appears in the device tree wherever it was
detected, but that location only has a vague and implicit relationship
with the hardware it actually powers; it needs another attribute to
explicitly denote that information.

And if the device being pointed to is a mouse, then upower knows its
powering a mouse.

I'll look at putting together a patch to see if my suggestion makes any
sense in practice.

Thanks,
    J
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux