aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>2012-02-13 06:24:18 -0500
committerFelipe Balbi <balbi@ti.com>2012-02-27 08:41:48 -0500
commitb96d3b08365f5a9603f50f3aadca6012f7eaffa1 (patch)
treefceda0fed3b03c96353dc8cd21a965ba986e3e09 /drivers/usb/host
parentb1c711d629358576e8896a18e74cd5f4d811d7f7 (diff)
usb: Convert all users to new usb_phy
Use the new usb_phy_* functions with transceiver operations instead of the old otg functions. Includes fixes from Sascha Hauer. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Acked-by: Li Yang <leoli@freescale.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/ehci-fsl.c2
-rw-r--r--drivers/usb/host/ehci-msm.c14
-rw-r--r--drivers/usb/host/ehci-mv.c6
-rw-r--r--drivers/usb/host/ehci-mxc.c10
-rw-r--r--drivers/usb/host/ehci-tegra.c6
-rw-r--r--drivers/usb/host/ohci-omap.c2
6 files changed, 21 insertions, 19 deletions
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index b556a72264d1..481effdc7f54 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -142,7 +142,7 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver,
142 if (pdata->operating_mode == FSL_USB2_DR_OTG) { 142 if (pdata->operating_mode == FSL_USB2_DR_OTG) {
143 struct ehci_hcd *ehci = hcd_to_ehci(hcd); 143 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
144 144
145 ehci->transceiver = otg_get_transceiver(); 145 ehci->transceiver = usb_get_transceiver();
146 dev_dbg(&pdev->dev, "hcd=0x%p ehci=0x%p, transceiver=0x%p\n", 146 dev_dbg(&pdev->dev, "hcd=0x%p ehci=0x%p, transceiver=0x%p\n",
147 hcd, ehci, ehci->transceiver); 147 hcd, ehci, ehci->transceiver);
148 148
diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
index ef7c4319c6e4..d8db5ecf5e37 100644
--- a/drivers/usb/host/ehci-msm.c
+++ b/drivers/usb/host/ehci-msm.c
@@ -32,7 +32,7 @@
32 32
33#define MSM_USB_BASE (hcd->regs) 33#define MSM_USB_BASE (hcd->regs)
34 34
35static struct usb_phy *otg; 35static struct usb_phy *phy;
36 36
37static int ehci_msm_reset(struct usb_hcd *hcd) 37static int ehci_msm_reset(struct usb_hcd *hcd)
38{ 38{
@@ -145,14 +145,14 @@ static int ehci_msm_probe(struct platform_device *pdev)
145 * powering up VBUS, mapping of registers address space and power 145 * powering up VBUS, mapping of registers address space and power
146 * management. 146 * management.
147 */ 147 */
148 otg = otg_get_transceiver(); 148 phy = usb_get_transceiver();
149 if (!otg) { 149 if (!phy) {
150 dev_err(&pdev->dev, "unable to find transceiver\n"); 150 dev_err(&pdev->dev, "unable to find transceiver\n");
151 ret = -ENODEV; 151 ret = -ENODEV;
152 goto unmap; 152 goto unmap;
153 } 153 }
154 154
155 ret = otg_set_host(otg, &hcd->self); 155 ret = otg_set_host(phy, &hcd->self);
156 if (ret < 0) { 156 if (ret < 0) {
157 dev_err(&pdev->dev, "unable to register with transceiver\n"); 157 dev_err(&pdev->dev, "unable to register with transceiver\n");
158 goto put_transceiver; 158 goto put_transceiver;
@@ -169,7 +169,7 @@ static int ehci_msm_probe(struct platform_device *pdev)
169 return 0; 169 return 0;
170 170
171put_transceiver: 171put_transceiver:
172 otg_put_transceiver(otg); 172 usb_put_transceiver(phy);
173unmap: 173unmap:
174 iounmap(hcd->regs); 174 iounmap(hcd->regs);
175put_hcd: 175put_hcd:
@@ -186,8 +186,8 @@ static int __devexit ehci_msm_remove(struct platform_device *pdev)
186 pm_runtime_disable(&pdev->dev); 186 pm_runtime_disable(&pdev->dev);
187 pm_runtime_set_suspended(&pdev->dev); 187 pm_runtime_set_suspended(&pdev->dev);
188 188
189 otg_set_host(otg, NULL); 189 otg_set_host(phy, NULL);
190 otg_put_transceiver(otg); 190 usb_put_transceiver(phy);
191 191
192 usb_put_hcd(hcd); 192 usb_put_hcd(hcd);
193 193
diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c
index 39ca79e008d9..62a63b598149 100644
--- a/drivers/usb/host/ehci-mv.c
+++ b/drivers/usb/host/ehci-mv.c
@@ -253,7 +253,7 @@ static int mv_ehci_probe(struct platform_device *pdev)
253 ehci_mv->mode = pdata->mode; 253 ehci_mv->mode = pdata->mode;
254 if (ehci_mv->mode == MV_USB_MODE_OTG) { 254 if (ehci_mv->mode == MV_USB_MODE_OTG) {
255#ifdef CONFIG_USB_OTG_UTILS 255#ifdef CONFIG_USB_OTG_UTILS
256 ehci_mv->otg = otg_get_transceiver(); 256 ehci_mv->otg = usb_get_transceiver();
257 if (!ehci_mv->otg) { 257 if (!ehci_mv->otg) {
258 dev_err(&pdev->dev, 258 dev_err(&pdev->dev,
259 "unable to find transceiver\n"); 259 "unable to find transceiver\n");
@@ -303,7 +303,7 @@ err_set_vbus:
303#ifdef CONFIG_USB_OTG_UTILS 303#ifdef CONFIG_USB_OTG_UTILS
304err_put_transceiver: 304err_put_transceiver:
305 if (ehci_mv->otg) 305 if (ehci_mv->otg)
306 otg_put_transceiver(ehci_mv->otg); 306 usb_put_transceiver(ehci_mv->otg);
307#endif 307#endif
308err_disable_clk: 308err_disable_clk:
309 mv_ehci_disable(ehci_mv); 309 mv_ehci_disable(ehci_mv);
@@ -333,7 +333,7 @@ static int mv_ehci_remove(struct platform_device *pdev)
333 333
334 if (ehci_mv->otg) { 334 if (ehci_mv->otg) {
335 otg_set_host(ehci_mv->otg, NULL); 335 otg_set_host(ehci_mv->otg, NULL);
336 otg_put_transceiver(ehci_mv->otg); 336 usb_put_transceiver(ehci_mv->otg);
337 } 337 }
338 338
339 if (ehci_mv->mode == MV_USB_MODE_HOST) { 339 if (ehci_mv->mode == MV_USB_MODE_HOST) {
diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c
index 55978fcfa4b2..b762fe0955b9 100644
--- a/drivers/usb/host/ehci-mxc.c
+++ b/drivers/usb/host/ehci-mxc.c
@@ -220,7 +220,7 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev)
220 /* Initialize the transceiver */ 220 /* Initialize the transceiver */
221 if (pdata->otg) { 221 if (pdata->otg) {
222 pdata->otg->io_priv = hcd->regs + ULPI_VIEWPORT_OFFSET; 222 pdata->otg->io_priv = hcd->regs + ULPI_VIEWPORT_OFFSET;
223 ret = otg_init(pdata->otg); 223 ret = usb_phy_init(pdata->otg);
224 if (ret) { 224 if (ret) {
225 dev_err(dev, "unable to init transceiver, probably missing\n"); 225 dev_err(dev, "unable to init transceiver, probably missing\n");
226 ret = -ENODEV; 226 ret = -ENODEV;
@@ -247,9 +247,11 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev)
247 * It's in violation of USB specs 247 * It's in violation of USB specs
248 */ 248 */
249 if (machine_is_mx51_efikamx() || machine_is_mx51_efikasb()) { 249 if (machine_is_mx51_efikamx() || machine_is_mx51_efikasb()) {
250 flags = otg_io_read(pdata->otg, ULPI_OTG_CTRL); 250 flags = usb_phy_io_read(pdata->otg,
251 ULPI_OTG_CTRL);
251 flags |= ULPI_OTG_CTRL_CHRGVBUS; 252 flags |= ULPI_OTG_CTRL_CHRGVBUS;
252 ret = otg_io_write(pdata->otg, flags, ULPI_OTG_CTRL); 253 ret = usb_phy_io_write(pdata->otg, flags,
254 ULPI_OTG_CTRL);
253 if (ret) { 255 if (ret) {
254 dev_err(dev, "unable to set CHRVBUS\n"); 256 dev_err(dev, "unable to set CHRVBUS\n");
255 goto err_add; 257 goto err_add;
@@ -297,7 +299,7 @@ static int __exit ehci_mxc_drv_remove(struct platform_device *pdev)
297 pdata->exit(pdev); 299 pdata->exit(pdev);
298 300
299 if (pdata->otg) 301 if (pdata->otg)
300 otg_shutdown(pdata->otg); 302 usb_phy_shutdown(pdata->otg);
301 303
302 usb_remove_hcd(hcd); 304 usb_remove_hcd(hcd);
303 iounmap(hcd->regs); 305 iounmap(hcd->regs);
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index 2e157144dcf6..701a0bf58623 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -733,7 +733,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
733 733
734#ifdef CONFIG_USB_OTG_UTILS 734#ifdef CONFIG_USB_OTG_UTILS
735 if (pdata->operating_mode == TEGRA_USB_OTG) { 735 if (pdata->operating_mode == TEGRA_USB_OTG) {
736 tegra->transceiver = otg_get_transceiver(); 736 tegra->transceiver = usb_get_transceiver();
737 if (tegra->transceiver) 737 if (tegra->transceiver)
738 otg_set_host(tegra->transceiver, &hcd->self); 738 otg_set_host(tegra->transceiver, &hcd->self);
739 } 739 }
@@ -751,7 +751,7 @@ fail:
751#ifdef CONFIG_USB_OTG_UTILS 751#ifdef CONFIG_USB_OTG_UTILS
752 if (tegra->transceiver) { 752 if (tegra->transceiver) {
753 otg_set_host(tegra->transceiver, NULL); 753 otg_set_host(tegra->transceiver, NULL);
754 otg_put_transceiver(tegra->transceiver); 754 usb_put_transceiver(tegra->transceiver);
755 } 755 }
756#endif 756#endif
757 tegra_usb_phy_close(tegra->phy); 757 tegra_usb_phy_close(tegra->phy);
@@ -809,7 +809,7 @@ static int tegra_ehci_remove(struct platform_device *pdev)
809#ifdef CONFIG_USB_OTG_UTILS 809#ifdef CONFIG_USB_OTG_UTILS
810 if (tegra->transceiver) { 810 if (tegra->transceiver) {
811 otg_set_host(tegra->transceiver, NULL); 811 otg_set_host(tegra->transceiver, NULL);
812 otg_put_transceiver(tegra->transceiver); 812 usb_put_transceiver(tegra->transceiver);
813 } 813 }
814#endif 814#endif
815 815
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index db3968656d21..744e25da800f 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -210,7 +210,7 @@ static int ohci_omap_init(struct usb_hcd *hcd)
210 210
211#ifdef CONFIG_USB_OTG 211#ifdef CONFIG_USB_OTG
212 if (need_transceiver) { 212 if (need_transceiver) {
213 ohci->transceiver = otg_get_transceiver(); 213 ohci->transceiver = usb_get_transceiver();
214 if (ohci->transceiver) { 214 if (ohci->transceiver) {
215 int status = otg_set_host(ohci->transceiver, 215 int status = otg_set_host(ohci->transceiver,
216 &ohci_to_hcd(ohci)->self); 216 &ohci_to_hcd(ohci)->self);