aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-01 11:45:33 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-01 11:45:33 -0500
commit8062d94a545457a83d5291bd62c3bfd14200bba0 (patch)
treea6a7aaaea5dff00f7415a93189720a1164ae30dd /drivers/usb/host
parent15e68a803573974409972e761d8f08f03fce5bdb (diff)
parent6e13c6505cdff9766d5268ffb8c972c1a2f996e6 (diff)
Merge tag 'xceiv-for-v3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next
USB: transceiver changes for 3.4 Here we have a big rework done by Heikki Krogerus (thanks) which splits OTG functionality away from transceivers. We have known for quite a long time that struct otg_transceiver was a bad name for the structure, considering transceiver is far from being OTG-specific (see 4e67185).
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/ehci-fsl.c6
-rw-r--r--drivers/usb/host/ehci-hub.c2
-rw-r--r--drivers/usb/host/ehci-msm.c14
-rw-r--r--drivers/usb/host/ehci-mv.c12
-rw-r--r--drivers/usb/host/ehci-mxc.c12
-rw-r--r--drivers/usb/host/ehci-tegra.c14
-rw-r--r--drivers/usb/host/ehci.h2
-rw-r--r--drivers/usb/host/ohci-omap.c8
-rw-r--r--drivers/usb/host/ohci.h2
9 files changed, 37 insertions, 35 deletions
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index 7a15c2235758..cf5666735a8f 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -142,12 +142,12 @@ 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
149 if (ehci->transceiver) { 149 if (ehci->transceiver) {
150 retval = otg_set_host(ehci->transceiver, 150 retval = otg_set_host(ehci->transceiver->otg,
151 &ehci_to_hcd(ehci)->self); 151 &ehci_to_hcd(ehci)->self);
152 if (retval) { 152 if (retval) {
153 if (ehci->transceiver) 153 if (ehci->transceiver)
@@ -194,7 +194,7 @@ static void usb_hcd_fsl_remove(struct usb_hcd *hcd,
194 struct ehci_hcd *ehci = hcd_to_ehci(hcd); 194 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
195 195
196 if (ehci->transceiver) { 196 if (ehci->transceiver) {
197 otg_set_host(ehci->transceiver, NULL); 197 otg_set_host(ehci->transceiver->otg, NULL);
198 put_device(ehci->transceiver->dev); 198 put_device(ehci->transceiver->dev);
199 } 199 }
200 200
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index 01011dd0cb5d..256fbd42e48c 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -727,7 +727,7 @@ static int ehci_hub_control (
727#ifdef CONFIG_USB_OTG 727#ifdef CONFIG_USB_OTG
728 if ((hcd->self.otg_port == (wIndex + 1)) 728 if ((hcd->self.otg_port == (wIndex + 1))
729 && hcd->self.b_hnp_enable) { 729 && hcd->self.b_hnp_enable) {
730 otg_start_hnp(ehci->transceiver); 730 otg_start_hnp(ehci->transceiver->otg);
731 break; 731 break;
732 } 732 }
733#endif 733#endif
diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
index 592d5f76803e..9803a55fd5f4 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 otg_transceiver *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->otg, &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->otg, 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 52a604fb9321..a936bbcff8f4 100644
--- a/drivers/usb/host/ehci-mv.c
+++ b/drivers/usb/host/ehci-mv.c
@@ -28,7 +28,7 @@ struct ehci_hcd_mv {
28 void __iomem *cap_regs; 28 void __iomem *cap_regs;
29 void __iomem *op_regs; 29 void __iomem *op_regs;
30 30
31 struct otg_transceiver *otg; 31 struct usb_phy *otg;
32 32
33 struct mv_usb_platform_data *pdata; 33 struct mv_usb_platform_data *pdata;
34 34
@@ -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");
@@ -261,7 +261,7 @@ static int mv_ehci_probe(struct platform_device *pdev)
261 goto err_disable_clk; 261 goto err_disable_clk;
262 } 262 }
263 263
264 retval = otg_set_host(ehci_mv->otg, &hcd->self); 264 retval = otg_set_host(ehci_mv->otg->otg, &hcd->self);
265 if (retval < 0) { 265 if (retval < 0) {
266 dev_err(&pdev->dev, 266 dev_err(&pdev->dev,
267 "unable to register with transceiver\n"); 267 "unable to register with 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);
@@ -332,8 +332,8 @@ static int mv_ehci_remove(struct platform_device *pdev)
332 usb_remove_hcd(hcd); 332 usb_remove_hcd(hcd);
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->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..a797d51ecbe8 100644
--- a/drivers/usb/host/ehci-mxc.c
+++ b/drivers/usb/host/ehci-mxc.c
@@ -220,13 +220,13 @@ 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;
227 goto err_add; 227 goto err_add;
228 } 228 }
229 ret = otg_set_vbus(pdata->otg, 1); 229 ret = otg_set_vbus(pdata->otg->otg, 1);
230 if (ret) { 230 if (ret) {
231 dev_err(dev, "unable to enable vbus on transceiver\n"); 231 dev_err(dev, "unable to enable vbus on transceiver\n");
232 goto err_add; 232 goto err_add;
@@ -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 dbc7fe8ca9e7..3de48a2d7955 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -35,7 +35,7 @@ struct tegra_ehci_hcd {
35 struct tegra_usb_phy *phy; 35 struct tegra_usb_phy *phy;
36 struct clk *clk; 36 struct clk *clk;
37 struct clk *emc_clk; 37 struct clk *emc_clk;
38 struct otg_transceiver *transceiver; 38 struct usb_phy *transceiver;
39 int host_resumed; 39 int host_resumed;
40 int bus_suspended; 40 int bus_suspended;
41 int port_resuming; 41 int port_resuming;
@@ -733,9 +733,9 @@ 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->otg, &hcd->self);
739 } 739 }
740#endif 740#endif
741 741
@@ -750,8 +750,8 @@ static int tegra_ehci_probe(struct platform_device *pdev)
750fail: 750fail:
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->otg, 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);
@@ -808,8 +808,8 @@ static int tegra_ehci_remove(struct platform_device *pdev)
808 808
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->otg, 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/ehci.h b/drivers/usb/host/ehci.h
index 0a5fda73b3f2..8f9acbc96fde 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -176,7 +176,7 @@ struct ehci_hcd { /* one per controller */
176 /* 176 /*
177 * OTG controllers and transceivers need software interaction 177 * OTG controllers and transceivers need software interaction
178 */ 178 */
179 struct otg_transceiver *transceiver; 179 struct usb_phy *transceiver;
180}; 180};
181 181
182/* convert between an HCD pointer and the corresponding EHCI_HCD */ 182/* convert between an HCD pointer and the corresponding EHCI_HCD */
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index db3968656d21..96451e41ee8a 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -171,7 +171,7 @@ static void start_hnp(struct ohci_hcd *ohci)
171 unsigned long flags; 171 unsigned long flags;
172 u32 l; 172 u32 l;
173 173
174 otg_start_hnp(ohci->transceiver); 174 otg_start_hnp(ohci->transceiver->otg);
175 175
176 local_irq_save(flags); 176 local_irq_save(flags);
177 ohci->transceiver->state = OTG_STATE_A_SUSPEND; 177 ohci->transceiver->state = OTG_STATE_A_SUSPEND;
@@ -210,9 +210,9 @@ 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->otg,
216 &ohci_to_hcd(ohci)->self); 216 &ohci_to_hcd(ohci)->self);
217 dev_dbg(hcd->self.controller, "init %s transceiver, status %d\n", 217 dev_dbg(hcd->self.controller, "init %s transceiver, status %d\n",
218 ohci->transceiver->label, status); 218 ohci->transceiver->label, status);
@@ -404,7 +404,7 @@ usb_hcd_omap_remove (struct usb_hcd *hcd, struct platform_device *pdev)
404 404
405 usb_remove_hcd(hcd); 405 usb_remove_hcd(hcd);
406 if (ohci->transceiver) { 406 if (ohci->transceiver) {
407 (void) otg_set_host(ohci->transceiver, 0); 407 (void) otg_set_host(ohci->transceiver->otg, 0);
408 put_device(ohci->transceiver->dev); 408 put_device(ohci->transceiver->dev);
409 } 409 }
410 if (machine_is_omap_osk()) 410 if (machine_is_omap_osk())
diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h
index 8ff6f7ea96fd..1b19aea25a2b 100644
--- a/drivers/usb/host/ohci.h
+++ b/drivers/usb/host/ohci.h
@@ -376,7 +376,7 @@ struct ohci_hcd {
376 * OTG controllers and transceivers need software interaction; 376 * OTG controllers and transceivers need software interaction;
377 * other external transceivers should be software-transparent 377 * other external transceivers should be software-transparent
378 */ 378 */
379 struct otg_transceiver *transceiver; 379 struct usb_phy *transceiver;
380 void (*start_hnp)(struct ohci_hcd *ohci); 380 void (*start_hnp)(struct ohci_hcd *ohci);
381 381
382 /* 382 /*