Re: [PATCH v3] extcon: gpio: Add the support for Device tree bindings

From: Rob Herring
Date: Wed Oct 21 2015 - 18:36:23 EST


On Tue, Oct 20, 2015 at 11:37 PM, Chanwoo Choi <cw00.choi@xxxxxxxxxxx> wrote:
> This patch adds the support for Device tree bindings of extcon-gpio driver.
> The extcon-gpio device tree node must include the both 'extcon-id' and
> 'extcon-gpio' property.

I think this is too tied to the Linux driver. Instead, think about
what the connector contains. I think you should define a usb connector
node and compatible (e.g. usb-connector or usb-ab-connector). This
probably needs to distinguish the connector type as well especially
with TypeC coming.

>
> For exmaple:
> usb_cable: extcon-gpio-0 {
> compatible = "extcon-gpio";
> extcon-id = <EXTCON_USB>;
> extcon-gpio = <&gpio6 1 GPIO_ACTIVE_HIGH>;

This tied to a Vbus detect circuit?

So "vbus-detect-gpios" in the connector node.

For host side (or OTG host mode), you may also need a vbus-supply
regulator property. OTG will also need an id-gpios for ID pin.

> }
>
> ta_cable: extcon-gpio-1 {

This is all the same connector as above?

> compatible = "extcon-gpio";
> extcon-id = <EXTCON_CHG_USB_DCP>;
> extcon-gpio = <&gpio3 2 GPIO_ACTIVE_LOW>;

This is just detecting D+ and D- are both pulled high?

So "dcp-detect-gpios" in the connector node.

> debounce-ms = <50>; /* 50 millisecond */
> wakeup-source;

wakeup-source implies an interrupt as I read Sudeep's series. Either
gpios need to be allowed or these need to be defined as interrupts.

> }
>
> &dwc3_usb {
> extcon = <&usb_cable>;
> };
>
> &charger {
> extcon = <&ta_cable>;

Not sure what to do with this. Both can point to a single connector
node I think.

Rob
--
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/