From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Rob Herring <robh@kernel.org>
Cc: pawel.moll@arm.com, mark.rutland@arm.com,
ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
myungjoo.ham@samsung.com, cw00.choi@samsung.com,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-sh@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH] extcon-usb-gpio: add enable pin support
Date: Fri, 11 Dec 2015 18:33:18 +0000 [thread overview]
Message-ID: <566B16EE.5080206@cogentembedded.com> (raw)
In-Reply-To: <20151211035312.GA9088@rob-hp-laptop>
Hello.
On 12/11/2015 06:53 AM, Rob Herring wrote:
>> Sometimes there's a real OTG chip behind the USB ID signal mapped to a GPIO
>> pin: in my case it's Maxim Integrated MAX3355E which integrates Vbus charge
>> pump and comparators and passes thru the ID signal from an OTG connector.
>> This chip also has the SHDN# pin which should be driven high for the normal
>> operation and low to save power; it is connected to a GPIO pin as well on,
>> hence we'll have to teach the driver to parse the new optional device tree
>> property, "enable-gpio"...
>
> Some wierd spacing going on here.
I like my text properly filling up the given columns. What's the problem? :-)
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>>
>> ---
>> The patch is against the 'extcon-next' branch of the 'extcon.git' repo.
>>
>> Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt | 3 +++
>> drivers/extcon/extcon-usb-gpio.c | 5 +++++
>> 2 files changed, 8 insertions(+)
>>
>> Index: extcon/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
>> =================================>> --- extcon.orig/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
>> +++ extcon/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
>> @@ -7,6 +7,9 @@ Required properties:
>> - compatible: Should be "linux,extcon-usb-gpio"
>> - id-gpio: gpio for USB ID pin. See gpio binding.
>>
>> +Optional properties:
>> +- enable-gpio: gpio for the enable pin. See gpio binding.
>
> Use -gpios as -gpio is deprecated.
Didn't know, thanks.
[...]
>> Index: extcon/drivers/extcon/extcon-usb-gpio.c
>> =================================>> --- extcon.orig/drivers/extcon/extcon-usb-gpio.c
>> +++ extcon/drivers/extcon/extcon-usb-gpio.c
[...]
>> @@ -99,6 +100,8 @@ static int usb_extcon_probe(struct platf
>> return -ENOMEM;
>>
>> info->dev = dev;
>> + info->enable_gpiod = devm_gpiod_get_optional(&pdev->dev, "enable",
>> + GPIOD_OUT_HIGH);
>> info->id_gpiod = devm_gpiod_get(&pdev->dev, "id", GPIOD_IN);
>> if (IS_ERR(info->id_gpiod)) {
>> dev_err(dev, "failed to get ID GPIO\n");
>> @@ -155,6 +158,8 @@ static int usb_extcon_remove(struct plat
>>
>> cancel_delayed_work_sync(&info->wq_detcable);
>>
>> + gpiod_set_value_cansleep(info->enable_gpiod, 0);
> Shouldn't you support either polarity?
The gpiolib does that for me -- devm_gpiod_get_optional() should read the
polarity from DT.
> Rob
MBR, Sergei
WARNING: multiple messages have this Message-ID (diff)
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Rob Herring <robh@kernel.org>
Cc: pawel.moll@arm.com, mark.rutland@arm.com,
ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
myungjoo.ham@samsung.com, cw00.choi@samsung.com,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-sh@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH] extcon-usb-gpio: add enable pin support
Date: Fri, 11 Dec 2015 21:33:18 +0300 [thread overview]
Message-ID: <566B16EE.5080206@cogentembedded.com> (raw)
In-Reply-To: <20151211035312.GA9088@rob-hp-laptop>
Hello.
On 12/11/2015 06:53 AM, Rob Herring wrote:
>> Sometimes there's a real OTG chip behind the USB ID signal mapped to a GPIO
>> pin: in my case it's Maxim Integrated MAX3355E which integrates Vbus charge
>> pump and comparators and passes thru the ID signal from an OTG connector.
>> This chip also has the SHDN# pin which should be driven high for the normal
>> operation and low to save power; it is connected to a GPIO pin as well on,
>> hence we'll have to teach the driver to parse the new optional device tree
>> property, "enable-gpio"...
>
> Some wierd spacing going on here.
I like my text properly filling up the given columns. What's the problem? :-)
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>>
>> ---
>> The patch is against the 'extcon-next' branch of the 'extcon.git' repo.
>>
>> Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt | 3 +++
>> drivers/extcon/extcon-usb-gpio.c | 5 +++++
>> 2 files changed, 8 insertions(+)
>>
>> Index: extcon/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
>> ===================================================================
>> --- extcon.orig/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
>> +++ extcon/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
>> @@ -7,6 +7,9 @@ Required properties:
>> - compatible: Should be "linux,extcon-usb-gpio"
>> - id-gpio: gpio for USB ID pin. See gpio binding.
>>
>> +Optional properties:
>> +- enable-gpio: gpio for the enable pin. See gpio binding.
>
> Use -gpios as -gpio is deprecated.
Didn't know, thanks.
[...]
>> Index: extcon/drivers/extcon/extcon-usb-gpio.c
>> ===================================================================
>> --- extcon.orig/drivers/extcon/extcon-usb-gpio.c
>> +++ extcon/drivers/extcon/extcon-usb-gpio.c
[...]
>> @@ -99,6 +100,8 @@ static int usb_extcon_probe(struct platf
>> return -ENOMEM;
>>
>> info->dev = dev;
>> + info->enable_gpiod = devm_gpiod_get_optional(&pdev->dev, "enable",
>> + GPIOD_OUT_HIGH);
>> info->id_gpiod = devm_gpiod_get(&pdev->dev, "id", GPIOD_IN);
>> if (IS_ERR(info->id_gpiod)) {
>> dev_err(dev, "failed to get ID GPIO\n");
>> @@ -155,6 +158,8 @@ static int usb_extcon_remove(struct plat
>>
>> cancel_delayed_work_sync(&info->wq_detcable);
>>
>> + gpiod_set_value_cansleep(info->enable_gpiod, 0);
> Shouldn't you support either polarity?
The gpiolib does that for me -- devm_gpiod_get_optional() should read the
polarity from DT.
> Rob
MBR, Sergei
next prev parent reply other threads:[~2015-12-11 18:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-10 23:07 [PATCH] extcon-usb-gpio: add enable pin support Sergei Shtylyov
2015-12-10 23:07 ` Sergei Shtylyov
2015-12-11 3:53 ` Rob Herring
2015-12-11 3:53 ` Rob Herring
2015-12-11 18:33 ` Sergei Shtylyov [this message]
2015-12-11 18:33 ` Sergei Shtylyov
2015-12-11 4:05 ` Chanwoo Choi
2015-12-11 4:05 ` Chanwoo Choi
2015-12-11 14:44 ` Sergei Shtylyov
2015-12-11 14:44 ` Sergei Shtylyov
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=566B16EE.5080206@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.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=linux-sh@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=myungjoo.ham@samsung.com \
--cc=pawel.moll@arm.com \
--cc=robh@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.