From ff66a70c746b9faa1aa61030d47bf8293968c3e9 Mon Sep 17 00:00:00 2001 From: Antony Pavlov Date: Thu, 22 May 2014 09:19:11 +0400 Subject: [PATCH 1/3] usb: remove unimplemented usb_get_dev_index() declaration We do not have usb_get_dev_index() function, so remove this declaration. Signed-off-by: Antony Pavlov Signed-off-by: Sascha Hauer --- include/usb/usb.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/usb/usb.h b/include/usb/usb.h index 821724e54..2f58faa0c 100644 --- a/include/usb/usb.h +++ b/include/usb/usb.h @@ -226,7 +226,6 @@ int usb_host_detect(struct usb_host *host, int force); int usb_set_protocol(struct usb_device *dev, int ifnum, int protocol); int usb_set_idle(struct usb_device *dev, int ifnum, int duration, int report_id); -struct usb_device *usb_get_dev_index(int index); int usb_control_msg(struct usb_device *dev, unsigned int pipe, unsigned char request, unsigned char requesttype, unsigned short value, unsigned short index, From 12e8ad39b1743bc6156f7640dcf1bec5ac4d5cc8 Mon Sep 17 00:00:00 2001 From: Antony Pavlov Date: Thu, 22 May 2014 09:19:12 +0400 Subject: [PATCH 2/3] usb: drop unused USB_UHCI_*_ID macros Signed-off-by: Antony Pavlov Signed-off-by: Sascha Hauer --- include/usb/usb.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/usb/usb.h b/include/usb/usb.h index 2f58faa0c..1a369d2ee 100644 --- a/include/usb/usb.h +++ b/include/usb/usb.h @@ -219,10 +219,6 @@ int usb_register_host(struct usb_host *); int usb_host_detect(struct usb_host *host, int force); -/* Defines */ -#define USB_UHCI_VEND_ID 0x8086 -#define USB_UHCI_DEV_ID 0x7112 - int usb_set_protocol(struct usb_device *dev, int ifnum, int protocol); int usb_set_idle(struct usb_device *dev, int ifnum, int duration, int report_id); From d963d61c2cfd174225c73b89508a6b876c06ca4b Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Thu, 22 May 2014 09:09:51 +0200 Subject: [PATCH 3/3] usb: chipidea i.MX: relax phy_type requirements Some USB ports only have one possiblitly for the phy_type and the type is not specified in the devicetree in this case. Rely on the reset default instead of failing. Signed-off-by: Sascha Hauer --- drivers/usb/imx/chipidea-imx.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/usb/imx/chipidea-imx.c b/drivers/usb/imx/chipidea-imx.c index a7ad7343d..9b6829b8f 100644 --- a/drivers/usb/imx/chipidea-imx.c +++ b/drivers/usb/imx/chipidea-imx.c @@ -33,6 +33,7 @@ struct imx_chipidea { unsigned long flags; enum imx_usb_mode mode; int portno; + enum usb_phy_interface phymode; }; static int imx_chipidea_port_init(void *drvdata) @@ -80,7 +81,6 @@ static int imx_chipidea_probe_dt(struct imx_chipidea *ci) { struct of_phandle_args out_args; enum usb_dr_mode mode; - enum usb_phy_interface phymode; if (of_parse_phandle_with_args(ci->dev->device_node, "fsl,usbmisc", "#index-cells", 0, &out_args)) @@ -101,8 +101,8 @@ static int imx_chipidea_probe_dt(struct imx_chipidea *ci) break; } - phymode = of_usb_get_phy_mode(ci->dev->device_node, NULL); - switch (phymode) { + ci->phymode = of_usb_get_phy_mode(ci->dev->device_node, NULL); + switch (ci->phymode) { case USBPHY_INTERFACE_MODE_UTMI: ci->flags = MXC_EHCI_MODE_UTMI_8BIT; break; @@ -119,8 +119,7 @@ static int imx_chipidea_probe_dt(struct imx_chipidea *ci) ci->flags = MXC_EHCI_MODE_HSIC; break; default: - dev_err(ci->dev, "no or invalid phy mode setting\n"); - return -EINVAL; + dev_dbg(ci->dev, "no phy_type setting. Relying on reset default\n"); } if (of_find_property(ci->dev->device_node, @@ -168,10 +167,12 @@ static int imx_chipidea_probe(struct device_d *dev) if ((ci->flags & MXC_EHCI_PORTSC_MASK) == MXC_EHCI_MODE_HSIC) imx_chipidea_port_init(ci); - portsc = readl(base + 0x184); - portsc &= ~MXC_EHCI_PORTSC_MASK; - portsc |= ci->flags & MXC_EHCI_PORTSC_MASK; - writel(portsc, base + 0x184); + if (ci->phymode != USBPHY_INTERFACE_MODE_UNKNOWN) { + portsc = readl(base + 0x184); + portsc &= ~MXC_EHCI_PORTSC_MASK; + portsc |= ci->flags & MXC_EHCI_PORTSC_MASK; + writel(portsc, base + 0x184); + } ci->data.hccr = base + 0x100; ci->data.hcor = base + 0x140;