All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] ehci: msm: Replace board_prepare_usb with board_usb_init
@ 2018-05-20 19:04 Ramon Fried
  2018-05-22 23:30 ` Simon Glass
  0 siblings, 1 reply; 3+ messages in thread
From: Ramon Fried @ 2018-05-20 19:04 UTC (permalink / raw)
  To: u-boot

Use standard board_usb_init() instead of the specific board_prepare_usb.

Signed-off-by: Ramon Fried <ramon.fried@gmail.com>
---
 board/qualcomm/dragonboard410c/dragonboard410c.c |  4 ++--
 drivers/usb/host/ehci-msm.c                      | 11 ++++-------
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.c b/board/qualcomm/dragonboard410c/dragonboard410c.c
index e7ead57f0d..679eab759a 100644
--- a/board/qualcomm/dragonboard410c/dragonboard410c.c
+++ b/board/qualcomm/dragonboard410c/dragonboard410c.c
@@ -41,7 +41,7 @@ int dram_init_banksize(void)
 	return 0;
 }
 
-int board_prepare_usb(enum usb_init_type type)
+int board_usb_init(int index, enum usb_init_type init)
 {
 	static struct udevice *pmic_gpio;
 	static struct gpio_desc hub_reset, usb_sel;
@@ -90,7 +90,7 @@ int board_prepare_usb(enum usb_init_type type)
 		}
 	}
 
-	if (type == USB_INIT_HOST) {
+	if (init == USB_INIT_HOST) {
 		/* Start USB Hub */
 		dm_gpio_set_dir_flags(&hub_reset,
 				      GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE);
diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
index 17bfa7c02f..9ecd8d6732 100644
--- a/drivers/usb/host/ehci-msm.c
+++ b/drivers/usb/host/ehci-msm.c
@@ -38,11 +38,6 @@ struct msm_ehci_priv {
 	struct ulpi_viewport ulpi_vp; /* ULPI Viewport */
 };
 
-int __weak board_prepare_usb(enum usb_init_type type)
-{
-	return 0;
-}
-
 static void setup_usb_phy(struct msm_ehci_priv *priv)
 {
 	/* Select and enable external configuration with USB PHY */
@@ -102,7 +97,7 @@ static int ehci_usb_probe(struct udevice *dev)
 	hcor = (struct ehci_hcor *)((phys_addr_t)hccr +
 			HC_LENGTH(ehci_readl(&(hccr)->cr_capbase)));
 
-	ret = board_prepare_usb(USB_INIT_HOST);
+	ret = board_usb_init(0, USB_INIT_HOST);
 	if (ret < 0)
 		return ret;
 
@@ -124,7 +119,7 @@ static int ehci_usb_remove(struct udevice *dev)
 
 	reset_usb_phy(p);
 
-	ret = board_prepare_usb(USB_INIT_DEVICE); /* Board specific hook */
+	ret = board_usb_init(0, USB_INIT_DEVICE); /* Board specific hook */
 	if (ret < 0)
 		return ret;
 
@@ -150,6 +145,8 @@ static int ehci_usb_ofdata_to_platdata(struct udevice *dev)
 	if (priv->ehci == (void *)FDT_ADDR_T_NONE)
 		return -EINVAL;
 
+	dev->req_seq = 0;
+
 	/* Warning: this will not work if viewport address is > 64 bit due to
 	 * ULPI design.
 	 */
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] ehci: msm: Replace board_prepare_usb with board_usb_init
  2018-05-20 19:04 [U-Boot] [PATCH] ehci: msm: Replace board_prepare_usb with board_usb_init Ramon Fried
@ 2018-05-22 23:30 ` Simon Glass
  2018-05-24  2:01   ` Ramon Fried
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Glass @ 2018-05-22 23:30 UTC (permalink / raw)
  To: u-boot

Hi Ramon,
On 20 May 2018 at 13:04, Ramon Fried <ramon.fried@gmail.com> wrote:
> Use standard board_usb_init() instead of the specific board_prepare_usb.

You should mention why...

For any patch:
- what the problem is / motivation
- what your patch does

>
> Signed-off-by: Ramon Fried <ramon.fried@gmail.com>
> ---
>  board/qualcomm/dragonboard410c/dragonboard410c.c |  4 ++--
>  drivers/usb/host/ehci-msm.c                      | 11 ++++-------
>  2 files changed, 6 insertions(+), 9 deletions(-)
>

Regards,
Simon

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] ehci: msm: Replace board_prepare_usb with board_usb_init
  2018-05-22 23:30 ` Simon Glass
@ 2018-05-24  2:01   ` Ramon Fried
  0 siblings, 0 replies; 3+ messages in thread
From: Ramon Fried @ 2018-05-24  2:01 UTC (permalink / raw)
  To: u-boot

On Wed, May 23, 2018 at 2:30 AM, Simon Glass <sjg@chromium.org> wrote:
> Hi Ramon,
> On 20 May 2018 at 13:04, Ramon Fried <ramon.fried@gmail.com> wrote:
>> Use standard board_usb_init() instead of the specific board_prepare_usb.
>
> You should mention why...
>
> For any patch:
> - what the problem is / motivation
> - what your patch does
Sure, thanks.
I'll resend the updated patch shortly.
Thanks,
Ramon
>
>>
>> Signed-off-by: Ramon Fried <ramon.fried@gmail.com>
>> ---
>>  board/qualcomm/dragonboard410c/dragonboard410c.c |  4 ++--
>>  drivers/usb/host/ehci-msm.c                      | 11 ++++-------
>>  2 files changed, 6 insertions(+), 9 deletions(-)
>>
>
> Regards,
> Simon

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-24  2:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-20 19:04 [U-Boot] [PATCH] ehci: msm: Replace board_prepare_usb with board_usb_init Ramon Fried
2018-05-22 23:30 ` Simon Glass
2018-05-24  2:01   ` Ramon Fried

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.