RE: [PATCH] EXTCON: Get and set cable properties

From: Tc, Jenny
Date: Fri Dec 14 2012 - 19:16:22 EST



> > I replied on the thread and pointed out issues that I see with this
> > solution. IMHO It's not fair to register a cable with
> > power_supply/regulator/charger manager just to expose the cable
> properties.
> Don't we do that with already in allmost all drivers?Like if I have a keyboard
> driver and then I register with input framework and if the keyboard driver
> needs clk services then I register with clk framework as well and same with
> other services needed by keyboard driver.I think it makes sense for a cable
> to register with different framework if it supports that functionality as those
> services also would know that we have a cable with so and so property.

IMHO it's not a good choice to register a cable itself with any of the three subsystem
(power_supply/regulator/charger manager)

For example it cannot register with power_supply subsystem since it's not a
power_supply. It's just source for a power_supply.We register either charger/battery with
power supply. I couldn't find a way to register the cable with power supply subsystem.

In previous discussion Anton also agreed to this.

Anton,
Could you please confirm?

I think the same case with regulator framework also. A cable doesnât belong to a regulator framework.
A cable doesnât expose any control attribute (current control/voltage control). It just have properties (eg current)
controlled by external agents (Host machine/wall charger)

And charger manager is a consumer and not a provider. It cannot decide the charger cable capabilities.


> > > As I said, extcon provider driver didn't provide directly charging
> > > current(int
> > > mA) and some state(unsigned long state) because the extcon provider
> > > driver(Micro USB interface controller device or other device related
> > > to external connector) haven't mechanism which detect dynamically
> > > charging current immediately. If you wish to provide charging
> > > current data to extcon consumer driver or framework, you should use
> > > regulator/power_supply framework or other method in extcon provider
> driver.

This information need not to come from the extcon provider. It can come from any driver
Who knows the state of a cable. It may be a platform driver or may be a driver belongs to any
of the three subsystem we discussed above (power_supply/regulator/charger_manager).
Just by having an API like this (extcon_cable_set_data), it's not mandatory to register the cable
with any of the subsystem.

> > > Also if you want to define 'struct extcon_chrgr_cable_props', you
> > > should certainly show how detect dynamically charging current or state.

For USB cables, it's determined by USB enumeration. For USB 3.0 it would be 900mA and
USB 2.0 it's 500mA. Also in un configured state this would be 150 and 100mA respectively
¢éì®&Þ~º&¶¬–+-±éÝ¥Šw®žË±Êâmébžìdz¹Þ)í…æèw*jg¬±¨¶‰šŽŠÝj/êäz¹ÞŠà2ŠÞ¨è­Ú&¢)ß«a¶Úþø®G«éh®æj:+v‰¨Šwè†Ù>Wš±êÞiÛaxPjØm¶Ÿÿà -»+ƒùdš_