From: Igor Grinberg <grinberg@compulab.co.il>
To: "Gadiyar, Anand" <gadiyar@ti.com>
Cc: Tony Lindgren <tony@atomide.com>,
linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 3/5] omap3: cm-t3517: add support for usb host.
Date: Wed, 22 Sep 2010 10:24:53 +0200 [thread overview]
Message-ID: <4C99BD55.3070706@compulab.co.il> (raw)
In-Reply-To: <AANLkTin+canp9yrE-Jmv=n56dPFByZWU73uaRNBkruP6@mail.gmail.com>
On 09/21/10 18:26, Gadiyar, Anand wrote:
> On Tue, Sep 21, 2010 at 9:33 PM, Igor Grinberg <grinberg@compulab.co.il> wrote:
>> add support for hsusb host ports 1, 2 and on-module usb hub.
>>
>> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
>> ---
>> arch/arm/mach-omap2/board-cm-t3517.c | 50 ++++++++++++++++++++++++++++++++++
> ...
>
>> @@ -100,6 +102,47 @@ static void __init cm_t3517_init_rtc(void)
>> static inline void cm_t3517_init_rtc(void) {}
>> #endif
>>
>> +#if defined(CONFIG_USB_EHCI_HCD) || defined(CONFIG_USB_EHCI_HCD_MODULE)
> Hi Igor,
Hi
> Do we really need to make these conditional on the driver being built?
This is depends on what are we trying to achieve...
I can think of two things:
[1] Simple, clear and nice code without ifdefs
[2] Smaller kernel, a bit less resources wasted and a bit faster boot time
> The hardware is present on the board at all times, right?
Yes, it is inside the SoC, except for the usb hub.
> It should be okay to execute this code independent of whether
> the driver is built or not. The device registration can be unconditional
> and if there is no driver present, we won't probe anyway.
It is ok, but again it depends on what we are trying to achieve here.
If we want [1], then indeed we need to remove the ifdefs also inside usb-ehci.c,
so pros:
* we'll get nice and clean code,
cons:
* a bit bigger kernel,
* "floating" device without a driver,
* a bit resources wasted for this device,
* a bit slower startup time (device registration, gpio toggling, etc.).
If we want [2], then we'll have the opposite of [1] ;)
Personally, I don't mind either way... ,
but I want the code to be consistent (in this case with usb-ehci.c).
> (I see some similar logic in usb-ehci.c - probably a good idea to remove
> it as well).
...
> - Anand
>
>> +#define HSUSB1_RESET_GPIO (146)
>> +#define HSUSB2_RESET_GPIO (147)
>> +#define USB_HUB_RESET_GPIO (152)
>> +
>> +static struct ehci_hcd_omap_platform_data cm_t3517_ehci_pdata __initdata = {
>> + .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
>> + .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
>> + .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
>> +
>> + .phy_reset = true,
>> + .reset_gpio_port[0] = HSUSB1_RESET_GPIO,
>> + .reset_gpio_port[1] = HSUSB2_RESET_GPIO,
>> + .reset_gpio_port[2] = -EINVAL,
>> +};
>> +
>> +static int cm_t3517_init_usbh(void)
>> +{
>> + int err;
>> +
>> + err = gpio_request(USB_HUB_RESET_GPIO, "usb hub rst");
>> + if (err) {
>> + pr_err("CM-T3517: usb hub rst gpio request failed: %d\n", err);
>> + } else {
>> + gpio_direction_output(USB_HUB_RESET_GPIO, 0);
>> + udelay(10);
>> + gpio_set_value(USB_HUB_RESET_GPIO, 1);
>> + msleep(1);
>> + }
>> +
>> + usb_ehci_init(&cm_t3517_ehci_pdata);
>> +
>> + return 0;
>> +}
>> +#else
>> +static inline int cm_t3517_init_usbh(void)
>> +{
>> + return 0;
>> +}
>> +#endif
>> +
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
Regards,
Igor.
WARNING: multiple messages have this Message-ID (diff)
From: grinberg@compulab.co.il (Igor Grinberg)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/5] omap3: cm-t3517: add support for usb host.
Date: Wed, 22 Sep 2010 10:24:53 +0200 [thread overview]
Message-ID: <4C99BD55.3070706@compulab.co.il> (raw)
In-Reply-To: <AANLkTin+canp9yrE-Jmv=n56dPFByZWU73uaRNBkruP6@mail.gmail.com>
On 09/21/10 18:26, Gadiyar, Anand wrote:
> On Tue, Sep 21, 2010 at 9:33 PM, Igor Grinberg <grinberg@compulab.co.il> wrote:
>> add support for hsusb host ports 1, 2 and on-module usb hub.
>>
>> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
>> ---
>> arch/arm/mach-omap2/board-cm-t3517.c | 50 ++++++++++++++++++++++++++++++++++
> ...
>
>> @@ -100,6 +102,47 @@ static void __init cm_t3517_init_rtc(void)
>> static inline void cm_t3517_init_rtc(void) {}
>> #endif
>>
>> +#if defined(CONFIG_USB_EHCI_HCD) || defined(CONFIG_USB_EHCI_HCD_MODULE)
> Hi Igor,
Hi
> Do we really need to make these conditional on the driver being built?
This is depends on what are we trying to achieve...
I can think of two things:
[1] Simple, clear and nice code without ifdefs
[2] Smaller kernel, a bit less resources wasted and a bit faster boot time
> The hardware is present on the board at all times, right?
Yes, it is inside the SoC, except for the usb hub.
> It should be okay to execute this code independent of whether
> the driver is built or not. The device registration can be unconditional
> and if there is no driver present, we won't probe anyway.
It is ok, but again it depends on what we are trying to achieve here.
If we want [1], then indeed we need to remove the ifdefs also inside usb-ehci.c,
so pros:
* we'll get nice and clean code,
cons:
* a bit bigger kernel,
* "floating" device without a driver,
* a bit resources wasted for this device,
* a bit slower startup time (device registration, gpio toggling, etc.).
If we want [2], then we'll have the opposite of [1] ;)
Personally, I don't mind either way... ,
but I want the code to be consistent (in this case with usb-ehci.c).
> (I see some similar logic in usb-ehci.c - probably a good idea to remove
> it as well).
...
> - Anand
>
>> +#define HSUSB1_RESET_GPIO (146)
>> +#define HSUSB2_RESET_GPIO (147)
>> +#define USB_HUB_RESET_GPIO (152)
>> +
>> +static struct ehci_hcd_omap_platform_data cm_t3517_ehci_pdata __initdata = {
>> + .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
>> + .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
>> + .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
>> +
>> + .phy_reset = true,
>> + .reset_gpio_port[0] = HSUSB1_RESET_GPIO,
>> + .reset_gpio_port[1] = HSUSB2_RESET_GPIO,
>> + .reset_gpio_port[2] = -EINVAL,
>> +};
>> +
>> +static int cm_t3517_init_usbh(void)
>> +{
>> + int err;
>> +
>> + err = gpio_request(USB_HUB_RESET_GPIO, "usb hub rst");
>> + if (err) {
>> + pr_err("CM-T3517: usb hub rst gpio request failed: %d\n", err);
>> + } else {
>> + gpio_direction_output(USB_HUB_RESET_GPIO, 0);
>> + udelay(10);
>> + gpio_set_value(USB_HUB_RESET_GPIO, 1);
>> + msleep(1);
>> + }
>> +
>> + usb_ehci_init(&cm_t3517_ehci_pdata);
>> +
>> + return 0;
>> +}
>> +#else
>> +static inline int cm_t3517_init_usbh(void)
>> +{
>> + return 0;
>> +}
>> +#endif
>> +
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
Regards,
Igor.
next prev parent reply other threads:[~2010-09-22 8:25 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-21 16:03 [PATCH 0/5] Support for CompuLab CM-T3517 modules Igor Grinberg
2010-09-21 16:03 ` Igor Grinberg
2010-09-21 16:03 ` [PATCH 1/5] omap3: Introduce CompuLab CM-T3517 module Igor Grinberg
2010-09-21 16:03 ` Igor Grinberg
2010-09-21 16:03 ` [PATCH 2/5] omap3: cm-t3517: add support for v3020 rtc Igor Grinberg
2010-09-21 16:03 ` Igor Grinberg
2010-09-21 16:03 ` [PATCH 3/5] omap3: cm-t3517: add support for usb host Igor Grinberg
2010-09-21 16:03 ` Igor Grinberg
2010-09-21 16:26 ` Gadiyar, Anand
2010-09-21 16:26 ` Gadiyar, Anand
2010-09-22 8:24 ` Igor Grinberg [this message]
2010-09-22 8:24 ` Igor Grinberg
2010-09-27 22:28 ` Tony Lindgren
2010-09-27 22:28 ` Tony Lindgren
2010-09-21 16:03 ` [PATCH 4/5] omap3: cm-t3517: add support for NAND flash Igor Grinberg
2010-09-21 16:03 ` Igor Grinberg
2010-09-21 16:03 ` [PATCH 5/5] omap3: cm-t3517: add support for TI HECC Igor Grinberg
2010-09-21 16:03 ` Igor Grinberg
-- strict thread matches above, loose matches on Subject: below --
2010-09-16 8:54 [PATCH 0/5] Support for CompuLab CM-T3517 modules Igor Grinberg
2010-09-16 8:54 ` [PATCH 3/5] omap3: cm-t3517: add support for usb host Igor Grinberg
2010-09-16 8:54 ` Igor Grinberg
2010-09-16 9:00 ` Felipe Balbi
2010-09-16 9:00 ` Felipe Balbi
2010-09-16 9:12 ` Igor Grinberg
2010-09-16 9:12 ` Igor Grinberg
2010-09-16 17:48 ` Tony Lindgren
2010-09-16 17:48 ` Tony Lindgren
2010-09-19 9:00 ` Igor Grinberg
2010-09-19 9:00 ` Igor Grinberg
2010-09-20 6:39 ` Felipe Balbi
2010-09-20 6:39 ` Felipe Balbi
2010-09-20 14:46 ` Igor Grinberg
2010-09-20 14:46 ` Igor Grinberg
2010-09-21 7:07 ` Felipe Balbi
2010-09-21 7:07 ` Felipe Balbi
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=4C99BD55.3070706@compulab.co.il \
--to=grinberg@compulab.co.il \
--cc=gadiyar@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=tony@atomide.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 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.