lkml.org 
[lkml]   [2016]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC 2/8] usb: ehci-msm: call usb_phy_init instead of open-coding it
Date
While looking at the phy-msm-usb driver, I noticed that its registers
are also accessed by teh ehci-msm driver, basically duplicating part
of the logic that is already present in the phy driver.

This removes the duplicate code from the ehci driver and instead
calls the usb_phy_init() function.

I did not test this change, so please review the patch carefully
and wait for a positive test result before applying.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/usb/host/ehci-msm.c | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
index d3afc89d00f5..4a9f31f77c46 100644
--- a/drivers/usb/host/ehci-msm.c
+++ b/drivers/usb/host/ehci-msm.c
@@ -30,15 +30,12 @@
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/usb/otg.h>
-#include <linux/usb/msm_hsusb_hw.h>
#include <linux/usb.h>
#include <linux/usb/hcd.h>
#include <linux/acpi.h>

#include "ehci.h"

-#define MSM_USB_BASE (hcd->regs)
-
#define DRIVER_DESC "Qualcomm On-Chip EHCI Host Controller"

static const char hcd_name[] = "ehci-msm";
@@ -49,24 +46,13 @@ static int ehci_msm_reset(struct usb_hcd *hcd)
struct ehci_hcd *ehci = hcd_to_ehci(hcd);
int retval;

- ehci->caps = USB_CAPLENGTH;
+ ehci->caps = hcd->regs + 0x100;
hcd->has_tt = 1;

retval = ehci_setup(hcd);
if (retval)
return retval;

- /* select ULPI phy and clear other status/control bits in PORTSC */
- writel(PORTSC_PTS_ULPI, USB_PORTSC);
- /* bursts of unspecified length. */
- writel(0, USB_AHBBURST);
- /* Use the AHB transactor, allow posted data writes */
- writel(0x8, USB_AHBMODE);
- /* Disable streaming mode and select host mode */
- writel(0x13, USB_USBMODE);
- /* Disable ULPI_TX_PKT_EN_CLR_FIX which is valid only for HSIC */
- writel(readl(USB_GENCONFIG_2) & ~ULPI_TX_PKT_EN_CLR_FIX, USB_GENCONFIG_2);
-
return 0;
}

@@ -144,6 +130,7 @@ static int ehci_msm_probe(struct platform_device *pdev)
pm_runtime_no_callbacks(&pdev->dev);
pm_runtime_enable(&pdev->dev);
} else {
+ usb_phy_init(phy);
ret = usb_add_hcd(hcd, hcd->irq, IRQF_SHARED);
if (ret)
goto put_hcd;
--
2.7.0
\
 
 \ /
  Last update: 2016-05-18 23:41    [W:0.125 / U:0.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site