ehci-mv.c (4d68c05ce11f4cdf6a6392f3a18dc6a985b4d0c4) | ehci-mv.c (b96d3b08365f5a9603f50f3aadca6012f7eaffa1) |
---|---|
1/* 2 * Copyright (C) 2011 Marvell International Ltd. All rights reserved. 3 * Author: Chao Xie <chao.xie@marvell.com> 4 * Neil Zhang <zhangwm@marvell.com> 5 * 6 * This program is free software; you can redistribute it and/or modify it 7 * under the terms of the GNU General Public License as published by the 8 * Free Software Foundation; either version 2 of the License, or (at your --- 14 unchanged lines hidden (view full) --- 23 24 /* Which mode does this ehci running OTG/Host ? */ 25 int mode; 26 27 void __iomem *phy_regs; 28 void __iomem *cap_regs; 29 void __iomem *op_regs; 30 | 1/* 2 * Copyright (C) 2011 Marvell International Ltd. All rights reserved. 3 * Author: Chao Xie <chao.xie@marvell.com> 4 * Neil Zhang <zhangwm@marvell.com> 5 * 6 * This program is free software; you can redistribute it and/or modify it 7 * under the terms of the GNU General Public License as published by the 8 * Free Software Foundation; either version 2 of the License, or (at your --- 14 unchanged lines hidden (view full) --- 23 24 /* Which mode does this ehci running OTG/Host ? */ 25 int mode; 26 27 void __iomem *phy_regs; 28 void __iomem *cap_regs; 29 void __iomem *op_regs; 30 |
31 struct otg_transceiver *otg; | 31 struct usb_phy *otg; |
32 33 struct mv_usb_platform_data *pdata; 34 35 /* clock source and total clock number */ 36 unsigned int clknum; 37 struct clk *clk[0]; 38}; 39 --- 208 unchanged lines hidden (view full) --- 248 ehci = hcd_to_ehci(hcd); 249 ehci->caps = (struct ehci_caps *) ehci_mv->cap_regs; 250 ehci->regs = (struct ehci_regs *) ehci_mv->op_regs; 251 ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params); 252 253 ehci_mv->mode = pdata->mode; 254 if (ehci_mv->mode == MV_USB_MODE_OTG) { 255#ifdef CONFIG_USB_OTG_UTILS | 32 33 struct mv_usb_platform_data *pdata; 34 35 /* clock source and total clock number */ 36 unsigned int clknum; 37 struct clk *clk[0]; 38}; 39 --- 208 unchanged lines hidden (view full) --- 248 ehci = hcd_to_ehci(hcd); 249 ehci->caps = (struct ehci_caps *) ehci_mv->cap_regs; 250 ehci->regs = (struct ehci_regs *) ehci_mv->op_regs; 251 ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params); 252 253 ehci_mv->mode = pdata->mode; 254 if (ehci_mv->mode == MV_USB_MODE_OTG) { 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) { 258 dev_err(&pdev->dev, 259 "unable to find transceiver\n"); 260 retval = -ENODEV; 261 goto err_disable_clk; 262 } 263 264 retval = otg_set_host(ehci_mv->otg, &hcd->self); --- 33 unchanged lines hidden (view full) --- 298 return 0; 299 300err_set_vbus: 301 if (pdata->set_vbus) 302 pdata->set_vbus(0); 303#ifdef CONFIG_USB_OTG_UTILS 304err_put_transceiver: 305 if (ehci_mv->otg) | 257 if (!ehci_mv->otg) { 258 dev_err(&pdev->dev, 259 "unable to find transceiver\n"); 260 retval = -ENODEV; 261 goto err_disable_clk; 262 } 263 264 retval = otg_set_host(ehci_mv->otg, &hcd->self); --- 33 unchanged lines hidden (view full) --- 298 return 0; 299 300err_set_vbus: 301 if (pdata->set_vbus) 302 pdata->set_vbus(0); 303#ifdef CONFIG_USB_OTG_UTILS 304err_put_transceiver: 305 if (ehci_mv->otg) |
306 otg_put_transceiver(ehci_mv->otg); | 306 usb_put_transceiver(ehci_mv->otg); |
307#endif 308err_disable_clk: 309 mv_ehci_disable(ehci_mv); 310err_iounmap_capreg: 311 iounmap(ehci_mv->cap_regs); 312err_iounmap_phyreg: 313 iounmap(ehci_mv->phy_regs); 314err_put_clk: --- 13 unchanged lines hidden (view full) --- 328 struct usb_hcd *hcd = ehci_mv->hcd; 329 int clk_i; 330 331 if (hcd->rh_registered) 332 usb_remove_hcd(hcd); 333 334 if (ehci_mv->otg) { 335 otg_set_host(ehci_mv->otg, NULL); | 307#endif 308err_disable_clk: 309 mv_ehci_disable(ehci_mv); 310err_iounmap_capreg: 311 iounmap(ehci_mv->cap_regs); 312err_iounmap_phyreg: 313 iounmap(ehci_mv->phy_regs); 314err_put_clk: --- 13 unchanged lines hidden (view full) --- 328 struct usb_hcd *hcd = ehci_mv->hcd; 329 int clk_i; 330 331 if (hcd->rh_registered) 332 usb_remove_hcd(hcd); 333 334 if (ehci_mv->otg) { 335 otg_set_host(ehci_mv->otg, NULL); |
336 otg_put_transceiver(ehci_mv->otg); | 336 usb_put_transceiver(ehci_mv->otg); |
337 } 338 339 if (ehci_mv->mode == MV_USB_MODE_HOST) { 340 if (ehci_mv->pdata->set_vbus) 341 ehci_mv->pdata->set_vbus(0); 342 343 mv_ehci_disable(ehci_mv); 344 } --- 47 unchanged lines hidden --- | 337 } 338 339 if (ehci_mv->mode == MV_USB_MODE_HOST) { 340 if (ehci_mv->pdata->set_vbus) 341 ehci_mv->pdata->set_vbus(0); 342 343 mv_ehci_disable(ehci_mv); 344 } --- 47 unchanged lines hidden --- |