Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1604226 > unrolled thread

[PATCH 1/2] extcon: usb-gpio: Add level trigger support

Started byBaolin Wang <baolin.wang@linaro.org>
First post2017-03-20 09:10 +0100
Last post2017-03-24 13:50 +0100
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/2] extcon: usb-gpio: Add level trigger support Baolin Wang <baolin.wang@linaro.org> - 2017-03-20 09:10 +0100
    Re: [PATCH 1/2] extcon: usb-gpio: Add level trigger support Chanwoo Choi <cw00.choi@samsung.com> - 2017-03-24 12:10 +0100
      Re: [PATCH 1/2] extcon: usb-gpio: Add level trigger support Baolin Wang <baolin.wang@linaro.org> - 2017-03-24 13:00 +0100
        Re: [PATCH 1/2] extcon: usb-gpio: Add level trigger support Rob Herring <robh+dt@kernel.org> - 2017-03-24 13:50 +0100

#1604226 — [PATCH 1/2] extcon: usb-gpio: Add level trigger support

FromBaolin Wang <baolin.wang@linaro.org>
Date2017-03-20 09:10 +0100
Subject[PATCH 1/2] extcon: usb-gpio: Add level trigger support
Message-ID<tn0y5-1TW-3@gated-at.bofh.it>
Now extcon-usb-gpio only supports for GPIO egdge trigger, but VBUS/ID
gpios' detection can be triggered by the level trigger on some platforms.
Thus intoduce one property 'extcon-gpio,level-trigger' to identify this
situation.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
 .../devicetree/bindings/extcon/extcon-usb-gpio.txt |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt b/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
index dfc14f7..191504b 100644
--- a/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
+++ b/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
@@ -9,6 +9,9 @@ Required properties:
 Either one of id-gpio or vbus-gpio must be present. Both can be present as well.
 - id-gpio: gpio for USB ID pin. See gpio binding.
 - vbus-gpio: gpio for USB VBUS pin.
+- extcon-gpio,level-trigger: Boolean, set this gpio's interrupt flag to
+level trigger. If not specified defaults to false, gpio's interrupt flag
+defaults to edge trigger.
 
 Example: Examples of extcon-usb-gpio node in dra7-evm.dts as listed below:
 	extcon_usb1 {
-- 
1.7.9.5

[toc] | [next] | [standalone]


#1608332

FromChanwoo Choi <cw00.choi@samsung.com>
Date2017-03-24 12:10 +0100
Message-ID<tovgv-E0-43@gated-at.bofh.it>
In reply to#1604226
Hi,

On 2017년 03월 20일 16:59, Baolin Wang wrote:
> Now extcon-usb-gpio only supports for GPIO egdge trigger, but VBUS/ID
> gpios' detection can be triggered by the level trigger on some platforms.
> Thus intoduce one property 'extcon-gpio,level-trigger' to identify this
> situation.
> 
> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
> ---
>  .../devicetree/bindings/extcon/extcon-usb-gpio.txt |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt b/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
> index dfc14f7..191504b 100644
> --- a/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
> +++ b/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
> @@ -9,6 +9,9 @@ Required properties:
>  Either one of id-gpio or vbus-gpio must be present. Both can be present as well.
>  - id-gpio: gpio for USB ID pin. See gpio binding.
>  - vbus-gpio: gpio for USB VBUS pin.
> +- extcon-gpio,level-trigger: Boolean, set this gpio's interrupt flag to

It is 'extcon-usb-gpio' instead of 'extcon-gpio'.

> +level trigger. If not specified defaults to false, gpio's interrupt flag
> +defaults to edge trigger.

I understand why you need the new flag.
But, I'm not sure it is right way to add the new flag for interrupt flag.

IMHO, I think that we need to find the more proper way to get the interrupt flag
or maybe, we may need to implement the new helper api to get the interrupt
flag for gpio pin when we use the gpio as the interrupt source, 

>  
>  Example: Examples of extcon-usb-gpio node in dra7-evm.dts as listed below:
>  	extcon_usb1 {
> 


-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

[toc] | [prev] | [next] | [standalone]


#1608358

FromBaolin Wang <baolin.wang@linaro.org>
Date2017-03-24 13:00 +0100
Message-ID<tow2R-10z-1@gated-at.bofh.it>
In reply to#1608332
Hi,

On 24 March 2017 at 19:08, Chanwoo Choi <cw00.choi@samsung.com> wrote:
> Hi,
>
> On 2017년 03월 20일 16:59, Baolin Wang wrote:
>> Now extcon-usb-gpio only supports for GPIO egdge trigger, but VBUS/ID
>> gpios' detection can be triggered by the level trigger on some platforms.
>> Thus intoduce one property 'extcon-gpio,level-trigger' to identify this
>> situation.
>>
>> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
>> ---
>>  .../devicetree/bindings/extcon/extcon-usb-gpio.txt |    3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt b/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
>> index dfc14f7..191504b 100644
>> --- a/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
>> +++ b/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
>> @@ -9,6 +9,9 @@ Required properties:
>>  Either one of id-gpio or vbus-gpio must be present. Both can be present as well.
>>  - id-gpio: gpio for USB ID pin. See gpio binding.
>>  - vbus-gpio: gpio for USB VBUS pin.
>> +- extcon-gpio,level-trigger: Boolean, set this gpio's interrupt flag to
>
> It is 'extcon-usb-gpio' instead of 'extcon-gpio'.

Sure.

>
>> +level trigger. If not specified defaults to false, gpio's interrupt flag
>> +defaults to edge trigger.
>
> I understand why you need the new flag.
> But, I'm not sure it is right way to add the new flag for interrupt flag.
>
> IMHO, I think that we need to find the more proper way to get the interrupt flag
> or maybe, we may need to implement the new helper api to get the interrupt
> flag for gpio pin when we use the gpio as the interrupt source,

Yes, I agree with you. We already have helper functions to get
interrupt flag from device tree, but we can not get the irq number of
GPIO to configure in device tree, then I introduce one new flag to
indicate the trigger type. But I like to change the patch if there are
any good suggestion. Thanks.

-- 
Baolin.wang
Best Regards

[toc] | [prev] | [next] | [standalone]


#1608380

FromRob Herring <robh+dt@kernel.org>
Date2017-03-24 13:50 +0100
Message-ID<towPf-1DH-1@gated-at.bofh.it>
In reply to#1608358
On Fri, Mar 24, 2017 at 6:56 AM, Baolin Wang <baolin.wang@linaro.org> wrote:
> Hi,
>
> On 24 March 2017 at 19:08, Chanwoo Choi <cw00.choi@samsung.com> wrote:
>> Hi,
>>
>> On 2017년 03월 20일 16:59, Baolin Wang wrote:
>>> Now extcon-usb-gpio only supports for GPIO egdge trigger, but VBUS/ID
>>> gpios' detection can be triggered by the level trigger on some platforms.
>>> Thus intoduce one property 'extcon-gpio,level-trigger' to identify this
>>> situation.
>>>
>>> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
>>> ---
>>>  .../devicetree/bindings/extcon/extcon-usb-gpio.txt |    3 +++
>>>  1 file changed, 3 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt b/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
>>> index dfc14f7..191504b 100644
>>> --- a/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
>>> +++ b/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
>>> @@ -9,6 +9,9 @@ Required properties:
>>>  Either one of id-gpio or vbus-gpio must be present. Both can be present as well.
>>>  - id-gpio: gpio for USB ID pin. See gpio binding.
>>>  - vbus-gpio: gpio for USB VBUS pin.
>>> +- extcon-gpio,level-trigger: Boolean, set this gpio's interrupt flag to
>>
>> It is 'extcon-usb-gpio' instead of 'extcon-gpio'.
>
> Sure.

"extcon-gpio" is not a vendor, so don't make it a vendor prefix.

>>> +level trigger. If not specified defaults to false, gpio's interrupt flag
>>> +defaults to edge trigger.
>>
>> I understand why you need the new flag.
>> But, I'm not sure it is right way to add the new flag for interrupt flag.
>>
>> IMHO, I think that we need to find the more proper way to get the interrupt flag
>> or maybe, we may need to implement the new helper api to get the interrupt
>> flag for gpio pin when we use the gpio as the interrupt source,
>
> Yes, I agree with you. We already have helper functions to get
> interrupt flag from device tree, but we can not get the irq number of
> GPIO to configure in device tree, then I introduce one new flag to
> indicate the trigger type. But I like to change the patch if there are
> any good suggestion. Thanks.

The extcon binding needs an overhaul in general. I'm not going to take
extensions to a broken binding. What's needed is a USB connector
binding like we have for HDMI and other video connectors. And for
USB-C, those need to be combined.

Rob

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web