linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
	"horms@verge.net.au" <horms@verge.net.au>,
	"magnus.damm@gmail.com" <magnus.damm@gmail.com>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"pawel.moll@arm.com" <pawel.moll@arm.com>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"ijc+devicetree@hellion.org.uk" <ijc+devicetree@hellion.org.uk>,
	"galak@codeaurora.org" <galak@codeaurora.org>,
	"linux@arm.linux.org.uk" <linux@arm.linux.org.uk>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-sh@vger.kernel.org" <linux-sh@vger.kernel.org>
Subject: Re: [PATCH 2/2] arm: shmobile: lager: enable HS-USB
Date: Tue, 07 Oct 2014 11:01:32 +0000	[thread overview]
Message-ID: <5433C80C.2090006@renesas.com> (raw)
In-Reply-To: <5433B665.9040302@cogentembedded.com>

Hello.

(2014/10/07 18:46), Sergei Shtylyov wrote:
> On 10/7/2014 7:25 AM, Yoshihiro Shimoda wrote:
> 
>>>>> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
>>>>> ---
>>>>>    arch/arm/boot/dts/r8a7790-lager.dts |    5 +++++
>>>>>    1 file changed, 5 insertions(+)
> 
>>>>> diff --git a/arch/arm/boot/dts/r8a7790-lager.dts b/arch/arm/boot/dts/r8a7790-lager.dts
>>>>> index 1698591..4badd0a 100644
>>>>> --- a/arch/arm/boot/dts/r8a7790-lager.dts
>>>>> +++ b/arch/arm/boot/dts/r8a7790-lager.dts
>>>>> @@ -445,3 +445,8 @@
>>>>>            };
>>>>>        };
>>>>>    };
>>>>> +
>>>>> +&hsusb {
>>>>> +    status = "okay";
>>>>> +    renesas,enable-gpio = <&gpio5 18 GPIO_ACTIVE_LOW>;
> 
>>>>      It's certainly active-high.
> 
>>> Since the current code has the following, we have to set the active_low...
>>> However, the code is unreadable, I think. So, I will modify the code.
>>>
>>>     /* check GPIO determining if USB function should be enabled */
>>>     if (priv->dparam.enable_gpio) {
>>>         gpio_request_one(priv->dparam.enable_gpio, GPIOF_IN, NULL);
>>>         ret = !gpio_get_value(priv->dparam.enable_gpio);
>>>         gpio_free(priv->dparam.enable_gpio);
>>>         if (ret) {
>>>             dev_warn(&pdev->dev,
>>>                  "USB function not selected (GPIO %d)\n",
>>>                  priv->dparam.enable_gpio);
>>>             ret = -ENOTSUPP;
>>>             goto probe_end_mod_exit;
>>>         }
>>>     }
> 
>> I am confusing about the gpio_get_value()...
>> In case of ARM, gpio_get_value() will call gpiod_get_raw_value() finally.
> 
>> gpio_get_value() in arch/arm/include/asm/gpio.h
>>   --> __gpio_get_value() in include/asm-generic/gpio.h
>>    --> gpiod_get_raw_value() in drivers/gpio/gpiolib.c
> 
>> The gpiod_get_raw_value() doesn't care of the GPIO_ACTIVE_{HIGH,LOW}.
>> So, should I add gpiod_is_active_low() or someting in the renesas_usbhs driver?
> 
>    Why do you still think it's active-low?!
> 
>> Or, Do I misunderstand something?
> 
>    Look at the above code again.

Thank you for the comment.
Finally, I understood this. I will not modify the driver and
I just change the "GPIO_ACTIVE_LOW" in the dts file to "GPIO_ACTIVE_HIGH"
because of your previous comment below:

>>     'ret' is non-zero here if gpio_get_value() returned 0, so 0 means "host"
>> and 1 means "gadget", i.e. GPIO is active-high.

Best regards,
Yoshihiro Shimoda

>> Best regards,
>> Yoshihiro Shimoda
> 
> WBR, Sergei
> 

  reply	other threads:[~2014-10-07 11:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-02  8:04 [PATCH 0/2] arm: shimobile: add HS-USB device node on r8a7790 Yoshihiro Shimoda
     [not found] ` <1412237073-1288-1-git-send-email-yoshihiro.shimoda.uh-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2014-10-02  8:04   ` [PATCH 1/2] arm: shimobile: r8a7790: add HS-USB device node Yoshihiro Shimoda
2014-10-02  9:58     ` Sergei Shtylyov
     [not found]       ` <542D21BD.8020709-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2014-10-02 11:40         ` Yoshihiro Shimoda
2014-10-02 12:08           ` Sergei Shtylyov
2014-10-02  9:59     ` Sergei Shtylyov
     [not found]       ` <542D2214.9050803-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2014-10-02 11:41         ` Yoshihiro Shimoda
     [not found]     ` <1412237073-1288-2-git-send-email-yoshihiro.shimoda.uh-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2014-10-02 22:43       ` Sergei Shtylyov
2014-10-03 14:34     ` Sergei Shtylyov
2014-10-06  0:49       ` Yoshihiro Shimoda
2014-10-02  8:04   ` [PATCH 2/2] arm: shmobile: lager: enable HS-USB Yoshihiro Shimoda
     [not found]     ` <1412237073-1288-3-git-send-email-yoshihiro.shimoda.uh-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2014-10-03 19:50       ` Sergei Shtylyov
2014-10-06  0:59         ` Yoshihiro Shimoda
2014-10-06  1:47           ` Simon Horman
2014-10-06 10:32           ` Sergei Shtylyov
     [not found]           ` <5431E984.6000203-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2014-10-07  3:25             ` Yoshihiro Shimoda
     [not found]               ` <54335D0E.6070606-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2014-10-07  7:03                 ` Yoshihiro Shimoda
2014-10-07  9:46                 ` Sergei Shtylyov
2014-10-07 11:01                   ` Yoshihiro Shimoda [this message]
2014-10-06 21:38     ` Sergei Shtylyov
     [not found]       ` <54330BC4.2050501-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2014-10-07  0:20         ` Yoshihiro Shimoda
     [not found]           ` <543331C4.90608-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2014-10-07  9:42             ` 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=5433C80C.2090006@renesas.com \
    --to=yoshihiro.shimoda.uh@renesas.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=horms@verge.net.au \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-sh@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=magnus.damm@gmail.com \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=sergei.shtylyov@cogentembedded.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;
as well as URLs for NNTP newsgroup(s).