Messages in this thread | | | Date | Fri, 25 Oct 2013 15:15:05 -0700 | From | Anton Vorontsov <> | Subject | Re: [PATCH] power:power_supply_syfs : Treat PROP_TYPE as a regular attribute first |
| |
On Thu, Aug 15, 2013 at 02:09:58AM +0300, Philippe De Swert wrote: > These days we often have USB powered devices. This means that often the > type is variable. Common examples are smartphones which can be charged > through a normal USB port on a PC/laptop, a dedicated charger, etc... > Often those chips also have support for other charger types like a > mains/DC charger. This means that often there are several psy structures > in the driver and makes it impossible to stick to just one type.
I would guess that a lot of userland code assumes that the type is fixed. We can't break this assumption. Plus I don't think we really need the changing types.
> Userspace sometimes needs to behave differently based on the type of charger > connected to such devices.
A system with several charger should either:
1. Register all of them (mains, usb, etc.) as a separate power supply device, and then use PROP_ONLINE to specify whether something is connected to the port or not.
2. Register only the charger type that is currently connected to the system.
This is how we've been doing things from the very start.
Thanks,
Anton
| |