diff mbox

[U-Boot,v3,7/7] ARM: OMAP5-uevm: Add usb device reset API

Message ID 1374092167-27645-8-git-send-email-dmurphy@ti.com
State Awaiting Upstream
Delegated to: Marek Vasut
Headers show

Commit Message

Dan Murphy July 17, 2013, 8:16 p.m. UTC
Add the call back to reset the LAN9730 after
the FEAT_POWER has been called.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
v3 - Added this patch to separate the patch series - http://patchwork.ozlabs.org/patch/258229/

 board/ti/omap5_uevm/evm.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Marek Vasut July 18, 2013, 4:30 a.m. UTC | #1
Dear Dan Murphy,

> Add the call back to reset the LAN9730 after
> the FEAT_POWER has been called.
> 
> Signed-off-by: Dan Murphy <dmurphy@ti.com>
> ---
> v3 - Added this patch to separate the patch series -
> http://patchwork.ozlabs.org/patch/258229/
> 
>  board/ti/omap5_uevm/evm.c |   11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/board/ti/omap5_uevm/evm.c b/board/ti/omap5_uevm/evm.c
> index 9add0fd..42253fd 100644
> --- a/board/ti/omap5_uevm/evm.c
> +++ b/board/ti/omap5_uevm/evm.c
> @@ -31,6 +31,7 @@
> 
>  #ifdef CONFIG_USB_EHCI
>  #include <usb.h>
> +#include <asm/gpio.h>
>  #include <asm/arch/ehci.h>
>  #include <asm/ehci-omap.h>
> 
> @@ -169,4 +170,14 @@ int ehci_hcd_stop(void)
>  	ret = omap_ehci_hcd_stop();
>  	return ret;
>  }
> +
> +void usb_hub_reset_devices(int port)
> +{
> +	/* The LAN9730 needs to be reset after the port power has been set. */
> +	if (port == 3) {
> +		gpio_direction_output(CONFIG_OMAP_EHCI_PHY1_RESET_GPIO, 0);
> +		udelay(10);
> +		gpio_direction_output(CONFIG_OMAP_EHCI_PHY1_RESET_GPIO, 1);
> +	}
> +}

Do you really need a config option for a board-specific GPIO used in a board 
file?

>  #endif

Best regards,
Marek Vasut
Dan Murphy July 31, 2013, 7:43 p.m. UTC | #2
Marek

On 07/17/2013 11:30 PM, Marek Vasut wrote:
> Dear Dan Murphy,
>
>> Add the call back to reset the LAN9730 after
>> the FEAT_POWER has been called.
>>
>> Signed-off-by: Dan Murphy <dmurphy@ti.com>
>> ---
>> v3 - Added this patch to separate the patch series -
>> http://patchwork.ozlabs.org/patch/258229/
>>
>>  board/ti/omap5_uevm/evm.c |   11 +++++++++++
>>  1 file changed, 11 insertions(+)
>>
>> diff --git a/board/ti/omap5_uevm/evm.c b/board/ti/omap5_uevm/evm.c
>> index 9add0fd..42253fd 100644
>> --- a/board/ti/omap5_uevm/evm.c
>> +++ b/board/ti/omap5_uevm/evm.c
>> @@ -31,6 +31,7 @@
>>
>>  #ifdef CONFIG_USB_EHCI
>>  #include <usb.h>
>> +#include <asm/gpio.h>
>>  #include <asm/arch/ehci.h>
>>  #include <asm/ehci-omap.h>
>>
>> @@ -169,4 +170,14 @@ int ehci_hcd_stop(void)
>>  	ret = omap_ehci_hcd_stop();
>>  	return ret;
>>  }
>> +
>> +void usb_hub_reset_devices(int port)
>> +{
>> +	/* The LAN9730 needs to be reset after the port power has been set. */
>> +	if (port == 3) {
>> +		gpio_direction_output(CONFIG_OMAP_EHCI_PHY1_RESET_GPIO, 0);
>> +		udelay(10);
>> +		gpio_direction_output(CONFIG_OMAP_EHCI_PHY1_RESET_GPIO, 1);
>> +	}
>> +}
> Do you really need a config option for a board-specific GPIO used in a board 
> file?

Sorry I missed addressing this comment.

I am not adding a config option but I am re-using the CONFIG option that already exists.
I did not want to define the GPIO number twice.

This CONFIG option is also used in the ehci-omap.c file.

Dan

>
>>  #endif
> Best regards,
> Marek Vasut
Marek Vasut July 31, 2013, 8:18 p.m. UTC | #3
Dear Dan Murphy,

> Marek
> 
> On 07/17/2013 11:30 PM, Marek Vasut wrote:
> > Dear Dan Murphy,
> > 
> >> Add the call back to reset the LAN9730 after
> >> the FEAT_POWER has been called.
> >> 
> >> Signed-off-by: Dan Murphy <dmurphy@ti.com>
> >> ---
> >> v3 - Added this patch to separate the patch series -
> >> http://patchwork.ozlabs.org/patch/258229/
> >> 
> >>  board/ti/omap5_uevm/evm.c |   11 +++++++++++
> >>  1 file changed, 11 insertions(+)
> >> 
> >> diff --git a/board/ti/omap5_uevm/evm.c b/board/ti/omap5_uevm/evm.c
> >> index 9add0fd..42253fd 100644
> >> --- a/board/ti/omap5_uevm/evm.c
> >> +++ b/board/ti/omap5_uevm/evm.c
> >> @@ -31,6 +31,7 @@
> >> 
> >>  #ifdef CONFIG_USB_EHCI
> >>  #include <usb.h>
> >> 
> >> +#include <asm/gpio.h>
> >> 
> >>  #include <asm/arch/ehci.h>
> >>  #include <asm/ehci-omap.h>
> >> 
> >> @@ -169,4 +170,14 @@ int ehci_hcd_stop(void)
> >> 
> >>  	ret = omap_ehci_hcd_stop();
> >>  	return ret;
> >>  
> >>  }
> >> 
> >> +
> >> +void usb_hub_reset_devices(int port)
> >> +{
> >> +	/* The LAN9730 needs to be reset after the port power has been set. */
> >> +	if (port == 3) {
> >> +		gpio_direction_output(CONFIG_OMAP_EHCI_PHY1_RESET_GPIO, 0);
> >> +		udelay(10);
> >> +		gpio_direction_output(CONFIG_OMAP_EHCI_PHY1_RESET_GPIO, 1);
> >> +	}
> >> +}
> > 
> > Do you really need a config option for a board-specific GPIO used in a
> > board file?
> 
> Sorry I missed addressing this comment.
> 
> I am not adding a config option but I am re-using the CONFIG option that
> already exists. I did not want to define the GPIO number twice.
> 
> This CONFIG option is also used in the ehci-omap.c file.

OK. I can't say I'm happy about it being called CONFIG_ tho, maybe this can be 
fixed (in later patch).

Best regards,
Marek Vasut
diff mbox

Patch

diff --git a/board/ti/omap5_uevm/evm.c b/board/ti/omap5_uevm/evm.c
index 9add0fd..42253fd 100644
--- a/board/ti/omap5_uevm/evm.c
+++ b/board/ti/omap5_uevm/evm.c
@@ -31,6 +31,7 @@ 
 
 #ifdef CONFIG_USB_EHCI
 #include <usb.h>
+#include <asm/gpio.h>
 #include <asm/arch/ehci.h>
 #include <asm/ehci-omap.h>
 
@@ -169,4 +170,14 @@  int ehci_hcd_stop(void)
 	ret = omap_ehci_hcd_stop();
 	return ret;
 }
+
+void usb_hub_reset_devices(int port)
+{
+	/* The LAN9730 needs to be reset after the port power has been set. */
+	if (port == 3) {
+		gpio_direction_output(CONFIG_OMAP_EHCI_PHY1_RESET_GPIO, 0);
+		udelay(10);
+		gpio_direction_output(CONFIG_OMAP_EHCI_PHY1_RESET_GPIO, 1);
+	}
+}
 #endif