usb: isp1760: Move PORT1 configuration to core code
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 20 Jan 2015 22:56:00 +0000 (00:56 +0200)
committerFelipe Balbi <balbi@ti.com>
Tue, 27 Jan 2015 15:39:30 +0000 (09:39 -0600)
Configuring the mode of operation of port 1 doesn't belong to the HCD
code, as it's related to the soon to come UDC support. Move the
configuration to core code.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/host/isp1760-core.c
drivers/usb/host/isp1760-hcd.c

index e840a1d3676b1696bea4c71269c3da4c91c3b869..1cba3e08898a67e8e23aeaeb3f38988cdf5961b7 100644 (file)
@@ -67,6 +67,14 @@ static void isp1760_init_core(struct isp1760_device *isp)
        isp1760_write32(isp->regs, HC_HW_MODE_CTRL, hwmode);
        isp1760_write32(isp->regs, HC_HW_MODE_CTRL, hwmode);
 
+       /*
+        * PORT 1 Control register of the ISP1760 is the OTG control register on
+        * ISP1761. Since there is no OTG or device controller support in this
+        * driver, we use port 1 as a "normal" USB host port on both chips.
+        */
+       isp1760_write32(isp->regs, HC_PORT1_CTRL, PORT1_POWER | PORT1_INIT2);
+       usleep_range(10000, 11000);
+
        dev_info(isp->dev, "bus width: %u, oc: %s\n",
                 isp->devflags & ISP1760_FLAG_BUS_WIDTH_16 ? 16 : 32,
                 isp->devflags & ISP1760_FLAG_ANALOG_OC ? "analog" : "digital");
index 5309d7324485092fe42be38bbbca3e953a94d21a..568446c9ce8d99d21a6f3588b99304ab66c7b91e 100644 (file)
@@ -503,15 +503,6 @@ static int isp1760_hc_setup(struct usb_hcd *hcd)
 
        reg_write32(hcd->regs, HC_INTERRUPT_ENABLE, INTERRUPT_ENABLE_MASK);
 
-       /*
-        * PORT 1 Control register of the ISP1760 is the OTG control
-        * register on ISP1761. Since there is no OTG or device controller
-        * support in this driver, we use port 1 as a "normal" USB host port on
-        * both chips.
-        */
-       reg_write32(hcd->regs, HC_PORT1_CTRL, PORT1_POWER | PORT1_INIT2);
-       mdelay(10);
-
        priv->hcs_params = reg_read32(hcd->regs, HC_HCSPARAMS);
 
        return priv_init(hcd);