Re: [PATCH] extcon : callback function to read cable property

From: anish singh
Date: Tue Nov 20 2012 - 04:32:06 EST


On Tue, Nov 20, 2012 at 1:24 AM, Anton Vorontsov <cbouatmailru@xxxxxxxxx> wrote:
> On Tue, Nov 20, 2012 at 09:14:41AM +0000, Tc, Jenny wrote:
> [...]
>> > For example,
>> > Firstly, the power_supply charging framework check state of charger cable
>> > whether attached or detached cable. Second, when power_supply charging
>> > framework receive the changed state of host system from 'Host system
>> > notifier', change charging current of charger cable.
>>
>> Not just SUSPEND, but we need to handle RESUME , UPDATE etc. Also this doesnât help us to
>> define a standard interface for the charger cable state/properties. IMHO it's not right
>> to provide different interfaces for different cables. This doesn't help us to standardize
>> the charger cable interface.
>>
>> This thread has been running for a quite long time. Unfortunately we couldn't make an
>> agreement on the final solution. I would like to recap the overall requirement and
>> would like to propose alternate solutions. The requirements is to
>> "Provide a generic interface for charger cable states and charger cable properties"
>>
>> Even though extcon subsystem handles charger cable states, it's not enough to handle
>> all kind of charger cable states. It can handle just 2 states CONNECT/DISCONNECT.
>> But there are scenarios where we need to handle more than 2 states
>> (eg. USB SUSPEND/RESUME/UPDATE etc). Also extcon doesn't have any mechanism to
>> read cable properties in a generic way. Extcon charger-cable consumer driver
>> implementations (eg charger-manager), defines charger cable properties statically (current in mA)
>> inside the consumer driver. This is not enough, since the charger cable properties may change dynamically
>>
>> In existing form extcon cannot support different charger cable states and their
>> properties in a generic way. Also we couldn't find a final solution on how to modify the
>> extcon to support these requirements. From the whole discussion what I conclude is
>> * extcon is not designed to support cable properties
>
> The idea of using union seemed good to me, what happened to it?
>
> I mean, MyungJoo Ham wrote:
>
> | We may have:
> | enum extcon_cable_type {
> | EXTCON_CT_REGULATOR,
> | EXTCON_CT_PSY,
> | EXTCON_CT_CHARGER_CB,
> | ...
> | };
> | and have the following included at struct extcon_cable:
> | union {
> | struct regulator *reg;
> | struct power_supply *psy;
> | struct charger_cable *charger_cb;
> | ...
> | } cable data;
> | enum extcon_cable_type cable_type;
>
> This sounds good to me...
+1 for this idea.
>
>> * extcon is not designed to support any cable state other than CONNECT/DISCONNECT
>
> Dunno for this one. Can we get these additional states via "properties" as
> described above?
>
> Thanks,
> Anton.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/