From: Laxman Dewangan <ldewangan@nvidia.com>
To: Rob Herring <robh@kernel.org>
Cc: Chanwoo Choi <cw00.choi@samsung.com>,
Venkat Reddy Talla <vreddytalla@nvidia.com>,
MyungJoo Ham <myungjoo.ham@samsung.com>,
Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Kumar Gala <galak@codeaurora.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4] extcon: gpio: Add the support for Device tree bindings
Date: Wed, 1 Jun 2016 20:19:39 +0530 [thread overview]
Message-ID: <574EF603.2020408@nvidia.com> (raw)
In-Reply-To: <CAL_JsqJ+WBRj0DTREezp1JaanS2EQqSfefQGyPO4BGFVcwqwnw@mail.gmail.com>
On Tuesday 31 May 2016 09:18 PM, Rob Herring wrote:
> On Tue, May 31, 2016 at 8:44 AM, Laxman Dewangan <ldewangan@nvidia.com> wrote:
>> Hi Rob,
>>
>> On Tuesday 31 May 2016 07:05 PM, Rob Herring wrote:
>>> On Tue, May 31, 2016 at 2:35 AM, Chanwoo Choi <cw00.choi@samsung.com>
>>> wrote:
>>>> The extcon-gpio.c driver can separate the kind of external connector
>>>> by using the 'extcon-id' property.
>>> This use of DT is just broken. Come up with another way.
>>>
>>>
>>
>> Can we have the DT binding very similar to IIO, clock, reset etc?
> In what way? I'm guessing you mean to describe what controller a
> connector is associated with. Certainly, some sort of phandle
> reference will be needed. However. the node it points to is what needs
> a lot of work first.
Here, we just need to define that controller support how many different
cable? It does not say anything that which cable is what and all its on
platform dependent.
So for gpio-extcon, it will just say 1 cable. the name is not decided by
driver but it is by platform.
>> Here is details for extcon-jack DT binding and its client:
>>
>> The client can get the cable information through its node or extcon name
>> and once cable information is available, it can register for notification
>> when state gets changed.
>>
>> The typical dt nodes are:
>>
>> Extcon-driver node:
>>
>> extcon: arizona-extcon {
>> compatible = "wlf,arizona-extcon";
>> #extcon-cells = <1>;
>> };
>>
>>
>>
>> Driver need to specify the cable ID as
> Unless you have cables hardwired to a board, please stop describing
> cables in DT. Connectors!
If some controller only support cable with names then we need to do it.
Like palmas extcon, it detect VBUS, ID_GND, RIDA, RIDB, RIDC. So for
these cases, driver need to define cables.
Driver can specify that cable index 0 is for VBUS, 1 is for ID-GND etc.
>
>> Cable ID
>> ----------------------------
>> Mechanical 0
>> Microphone 1
>> Headphone 2
>> Line-out 3
> No, please don't create some made up some number space. I don't see
> why you need this. You should just need the phandle to "the microphone
> jack" node.
I am thinking that I will need the phandle of extcon nodes with index
for cable ID.
>> Here #extcon-cells is must and specifies the size of extcon cells. The
>> client need to provide the driver specific information as argument along
>> with handle.
>>
>>
>> Extcon Client node:
>>
>> audio-controller@b0000 {
>> ::::
>> extcon-cables = <&extcon 1>, <&extcon 3>;
>> extcon-cable-names = "Microphone", "Line-out";
>> };
>>
>> and client driver can register the cable by passing the cable name
>> as above along with its node.
>>
>> struct extcon_cable {
>> struct extcon_dev *edev,
>> int cable_id;
>> };
> If you are showing driver details to explain the binding, something is wrong.
I have USB OTG driver which need the notification when VBUS or ID
detected. For this, it can get the phandle of extcon and cable ID from
that driver for "id" and "vbus".
I have platform like follows:
I have 2 gpios which detect the ID and VBUS.
Both are independent. My USB driver get the extcon handle from the DT:
extcon_vbus: extcon@0 {
comptaible = "extcon-gpio";
gpio = <&gpio JETSON_VBUS_GPIO 0>;
#extcon-cells = <1>;
};
extcon_id: extcon@1 {
comptaible = "extcon-gpio";
gpio = <&gpio JETSON_ID_GPIO 0>;
#extcon-cells = <1>;
};
usb-otg {
::
extcon-cable = <&extcon_vbus 0 &extcon_d 0>;
extcon-cable-names = "id", "vbus";
::
};
>> edev_mic_cable = extcon_get_extcon_cable(dev, "Microphone");
>> extcon_register_notification(edev_mic_cable, notifier);
>>
>> edev_line_out_cable = extcon_get_extcon_cable(dev, "Line-out");
>> extcon_register_notification(edev_line_out_cable, notifier);
> Just remember that "*-names" should be optional (nor am I a fan of
> adding -names everywhere). This can be defined as first entry is mic
> and 2nd entry is line-out.
>
> Rob
next prev parent reply other threads:[~2016-06-01 15:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-26 11:47 [PATCH v4] extcon: gpio: Add the support for Device tree bindings Venkat Reddy Talla
2016-05-26 13:21 ` Chanwoo Choi
2016-05-27 5:13 ` Venkat Reddy Talla
2016-05-31 7:13 ` Chanwoo Choi
2016-05-27 15:29 ` Rob Herring
2016-05-31 6:44 ` Chanwoo Choi
2016-05-31 7:35 ` Chanwoo Choi
2016-05-31 13:35 ` Rob Herring
2016-05-31 13:44 ` Laxman Dewangan
2016-05-31 15:48 ` Rob Herring
2016-06-01 14:49 ` Laxman Dewangan [this message]
2016-06-01 16:00 ` Rob Herring
2016-05-31 14:34 ` Chanwoo Choi
2016-06-07 1:52 ` Chanwoo Choi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=574EF603.2020408@nvidia.com \
--to=ldewangan@nvidia.com \
--cc=cw00.choi@samsung.com \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=myungjoo.ham@samsung.com \
--cc=pawel.moll@arm.com \
--cc=robh@kernel.org \
--cc=vreddytalla@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox