aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Tenart <antoine.tenart@free-electrons.com>2014-09-24 15:05:50 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-09-29 11:52:59 -0400
commit3d46e73dfdb840f460e5b06416965d132570ec33 (patch)
tree65d51ef3123588de224bc928b6afc5af39879196
parenta173dc447d2980bb7cb9618a6b59cf135ea01e80 (diff)
usb: rename phy to usb_phy in HCD
The USB PHY member of the HCD structure is renamed to 'usb_phy' and modifications are done in all drivers accessing it. This is in preparation to adding the generic PHY support. Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com> [Sergei: added missing 'drivers/usb/misc/lvstest.c' file, resolved rejects, updated changelog.] Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/chipidea/host.c2
-rw-r--r--drivers/usb/core/hcd.c20
-rw-r--r--drivers/usb/core/hub.c8
-rw-r--r--drivers/usb/host/ehci-fsl.c16
-rw-r--r--drivers/usb/host/ehci-hub.c2
-rw-r--r--drivers/usb/host/ehci-msm.c4
-rw-r--r--drivers/usb/host/ehci-tegra.c16
-rw-r--r--drivers/usb/host/ohci-omap.c20
-rw-r--r--drivers/usb/misc/lvstest.c8
-rw-r--r--include/linux/usb/hcd.h2
10 files changed, 49 insertions, 49 deletions
diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c
index 0d6b24cb2270..ebde7b6ce687 100644
--- a/drivers/usb/chipidea/host.c
+++ b/drivers/usb/chipidea/host.c
@@ -59,7 +59,7 @@ static int host_start(struct ci_hdrc *ci)
59 hcd->has_tt = 1; 59 hcd->has_tt = 1;
60 60
61 hcd->power_budget = ci->platdata->power_budget; 61 hcd->power_budget = ci->platdata->power_budget;
62 hcd->phy = ci->transceiver; 62 hcd->usb_phy = ci->transceiver;
63 hcd->tpl_support = ci->platdata->tpl_support; 63 hcd->tpl_support = ci->platdata->tpl_support;
64 64
65 ehci = hcd_to_ehci(hcd); 65 ehci = hcd_to_ehci(hcd);
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index bcb96ff207ba..2c56252b9ff8 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -2629,7 +2629,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
2629 int retval; 2629 int retval;
2630 struct usb_device *rhdev; 2630 struct usb_device *rhdev;
2631 2631
2632 if (IS_ENABLED(CONFIG_USB_PHY) && !hcd->phy) { 2632 if (IS_ENABLED(CONFIG_USB_PHY) && !hcd->usb_phy) {
2633 struct usb_phy *phy = usb_get_phy_dev(hcd->self.controller, 0); 2633 struct usb_phy *phy = usb_get_phy_dev(hcd->self.controller, 0);
2634 2634
2635 if (IS_ERR(phy)) { 2635 if (IS_ERR(phy)) {
@@ -2642,7 +2642,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
2642 usb_put_phy(phy); 2642 usb_put_phy(phy);
2643 return retval; 2643 return retval;
2644 } 2644 }
2645 hcd->phy = phy; 2645 hcd->usb_phy = phy;
2646 hcd->remove_phy = 1; 2646 hcd->remove_phy = 1;
2647 } 2647 }
2648 } 2648 }
@@ -2790,10 +2790,10 @@ err_allocate_root_hub:
2790err_register_bus: 2790err_register_bus:
2791 hcd_buffer_destroy(hcd); 2791 hcd_buffer_destroy(hcd);
2792err_remove_phy: 2792err_remove_phy:
2793 if (hcd->remove_phy && hcd->phy) { 2793 if (hcd->remove_phy && hcd->usb_phy) {
2794 usb_phy_shutdown(hcd->phy); 2794 usb_phy_shutdown(hcd->usb_phy);
2795 usb_put_phy(hcd->phy); 2795 usb_put_phy(hcd->usb_phy);
2796 hcd->phy = NULL; 2796 hcd->usb_phy = NULL;
2797 } 2797 }
2798 return retval; 2798 return retval;
2799} 2799}
@@ -2866,10 +2866,10 @@ void usb_remove_hcd(struct usb_hcd *hcd)
2866 2866
2867 usb_deregister_bus(&hcd->self); 2867 usb_deregister_bus(&hcd->self);
2868 hcd_buffer_destroy(hcd); 2868 hcd_buffer_destroy(hcd);
2869 if (hcd->remove_phy && hcd->phy) { 2869 if (hcd->remove_phy && hcd->usb_phy) {
2870 usb_phy_shutdown(hcd->phy); 2870 usb_phy_shutdown(hcd->usb_phy);
2871 usb_put_phy(hcd->phy); 2871 usb_put_phy(hcd->usb_phy);
2872 hcd->phy = NULL; 2872 hcd->usb_phy = NULL;
2873 } 2873 }
2874 2874
2875 usb_put_invalidate_rhdev(hcd); 2875 usb_put_invalidate_rhdev(hcd);
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 1d21b2c21f9b..11e80ac31324 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -4468,8 +4468,8 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
4468 if (retval) 4468 if (retval)
4469 goto fail; 4469 goto fail;
4470 4470
4471 if (hcd->phy && !hdev->parent) 4471 if (hcd->usb_phy && !hdev->parent)
4472 usb_phy_notify_connect(hcd->phy, udev->speed); 4472 usb_phy_notify_connect(hcd->usb_phy, udev->speed);
4473 4473
4474 /* 4474 /*
4475 * Some superspeed devices have finished the link training process 4475 * Some superspeed devices have finished the link training process
@@ -4627,9 +4627,9 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
4627 4627
4628 /* Disconnect any existing devices under this port */ 4628 /* Disconnect any existing devices under this port */
4629 if (udev) { 4629 if (udev) {
4630 if (hcd->phy && !hdev->parent && 4630 if (hcd->usb_phy && !hdev->parent &&
4631 !(portstatus & USB_PORT_STAT_CONNECTION)) 4631 !(portstatus & USB_PORT_STAT_CONNECTION))
4632 usb_phy_notify_disconnect(hcd->phy, udev->speed); 4632 usb_phy_notify_disconnect(hcd->usb_phy, udev->speed);
4633 usb_disconnect(&port_dev->child); 4633 usb_disconnect(&port_dev->child);
4634 } 4634 }
4635 4635
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index 3d84b6a41dae..2d2ae8db439e 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -136,15 +136,15 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver,
136 if (pdata->operating_mode == FSL_USB2_DR_OTG) { 136 if (pdata->operating_mode == FSL_USB2_DR_OTG) {
137 struct ehci_hcd *ehci = hcd_to_ehci(hcd); 137 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
138 138
139 hcd->phy = usb_get_phy(USB_PHY_TYPE_USB2); 139 hcd->usb_phy = usb_get_phy(USB_PHY_TYPE_USB2);
140 dev_dbg(&pdev->dev, "hcd=0x%p ehci=0x%p, phy=0x%p\n", 140 dev_dbg(&pdev->dev, "hcd=0x%p ehci=0x%p, phy=0x%p\n",
141 hcd, ehci, hcd->phy); 141 hcd, ehci, hcd->usb_phy);
142 142
143 if (!IS_ERR_OR_NULL(hcd->phy)) { 143 if (!IS_ERR_OR_NULL(hcd->usb_phy)) {
144 retval = otg_set_host(hcd->phy->otg, 144 retval = otg_set_host(hcd->usb_phy->otg,
145 &ehci_to_hcd(ehci)->self); 145 &ehci_to_hcd(ehci)->self);
146 if (retval) { 146 if (retval) {
147 usb_put_phy(hcd->phy); 147 usb_put_phy(hcd->usb_phy);
148 goto err2; 148 goto err2;
149 } 149 }
150 } else { 150 } else {
@@ -181,9 +181,9 @@ static void usb_hcd_fsl_remove(struct usb_hcd *hcd,
181{ 181{
182 struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev); 182 struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev);
183 183
184 if (!IS_ERR_OR_NULL(hcd->phy)) { 184 if (!IS_ERR_OR_NULL(hcd->usb_phy)) {
185 otg_set_host(hcd->phy->otg, NULL); 185 otg_set_host(hcd->usb_phy->otg, NULL);
186 usb_put_phy(hcd->phy); 186 usb_put_phy(hcd->usb_phy);
187 } 187 }
188 188
189 usb_remove_hcd(hcd); 189 usb_remove_hcd(hcd);
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index 7ccb3ccf8e86..5728829cf6ef 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -922,7 +922,7 @@ int ehci_hub_control(
922#ifdef CONFIG_USB_OTG 922#ifdef CONFIG_USB_OTG
923 if ((hcd->self.otg_port == (wIndex + 1)) 923 if ((hcd->self.otg_port == (wIndex + 1))
924 && hcd->self.b_hnp_enable) { 924 && hcd->self.b_hnp_enable) {
925 otg_start_hnp(hcd->phy->otg); 925 otg_start_hnp(hcd->usb_phy->otg);
926 break; 926 break;
927 } 927 }
928#endif 928#endif
diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
index 934b39d5e44a..9dc2118ae808 100644
--- a/drivers/usb/host/ehci-msm.c
+++ b/drivers/usb/host/ehci-msm.c
@@ -124,7 +124,7 @@ static int ehci_msm_probe(struct platform_device *pdev)
124 goto put_hcd; 124 goto put_hcd;
125 } 125 }
126 126
127 hcd->phy = phy; 127 hcd->usb_phy = phy;
128 device_init_wakeup(&pdev->dev, 1); 128 device_init_wakeup(&pdev->dev, 1);
129 /* 129 /*
130 * OTG device parent of HCD takes care of putting 130 * OTG device parent of HCD takes care of putting
@@ -151,7 +151,7 @@ static int ehci_msm_remove(struct platform_device *pdev)
151 pm_runtime_disable(&pdev->dev); 151 pm_runtime_disable(&pdev->dev);
152 pm_runtime_set_suspended(&pdev->dev); 152 pm_runtime_set_suspended(&pdev->dev);
153 153
154 otg_set_host(hcd->phy->otg, NULL); 154 otg_set_host(hcd->usb_phy->otg, NULL);
155 155
156 /* FIXME: need to call usb_remove_hcd() here? */ 156 /* FIXME: need to call usb_remove_hcd() here? */
157 157
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index 7aafb05e7a40..aaa01971efe9 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -206,7 +206,7 @@ static int tegra_ehci_hub_control(
206 if (tegra->port_resuming && !(temp & PORT_SUSPEND)) { 206 if (tegra->port_resuming && !(temp & PORT_SUSPEND)) {
207 /* Resume completed, re-enable disconnect detection */ 207 /* Resume completed, re-enable disconnect detection */
208 tegra->port_resuming = 0; 208 tegra->port_resuming = 0;
209 tegra_usb_phy_postresume(hcd->phy); 209 tegra_usb_phy_postresume(hcd->usb_phy);
210 } 210 }
211 } 211 }
212 212
@@ -259,7 +259,7 @@ static int tegra_ehci_hub_control(
259 goto done; 259 goto done;
260 260
261 /* Disable disconnect detection during port resume */ 261 /* Disable disconnect detection during port resume */
262 tegra_usb_phy_preresume(hcd->phy); 262 tegra_usb_phy_preresume(hcd->usb_phy);
263 263
264 ehci->reset_done[wIndex-1] = jiffies + msecs_to_jiffies(25); 264 ehci->reset_done[wIndex-1] = jiffies + msecs_to_jiffies(25);
265 265
@@ -454,7 +454,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
454 err = PTR_ERR(u_phy); 454 err = PTR_ERR(u_phy);
455 goto cleanup_clk_en; 455 goto cleanup_clk_en;
456 } 456 }
457 hcd->phy = u_phy; 457 hcd->usb_phy = u_phy;
458 458
459 tegra->needs_double_reset = of_property_read_bool(pdev->dev.of_node, 459 tegra->needs_double_reset = of_property_read_bool(pdev->dev.of_node,
460 "nvidia,needs-double-reset"); 460 "nvidia,needs-double-reset");
@@ -475,7 +475,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
475 ehci->caps = hcd->regs + 0x100; 475 ehci->caps = hcd->regs + 0x100;
476 ehci->has_hostpc = soc_config->has_hostpc; 476 ehci->has_hostpc = soc_config->has_hostpc;
477 477
478 err = usb_phy_init(hcd->phy); 478 err = usb_phy_init(hcd->usb_phy);
479 if (err) { 479 if (err) {
480 dev_err(&pdev->dev, "Failed to initialize phy\n"); 480 dev_err(&pdev->dev, "Failed to initialize phy\n");
481 goto cleanup_clk_en; 481 goto cleanup_clk_en;
@@ -490,7 +490,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
490 } 490 }
491 u_phy->otg->host = hcd_to_bus(hcd); 491 u_phy->otg->host = hcd_to_bus(hcd);
492 492
493 err = usb_phy_set_suspend(hcd->phy, 0); 493 err = usb_phy_set_suspend(hcd->usb_phy, 0);
494 if (err) { 494 if (err) {
495 dev_err(&pdev->dev, "Failed to power on the phy\n"); 495 dev_err(&pdev->dev, "Failed to power on the phy\n");
496 goto cleanup_phy; 496 goto cleanup_phy;
@@ -517,7 +517,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
517cleanup_otg_set_host: 517cleanup_otg_set_host:
518 otg_set_host(u_phy->otg, NULL); 518 otg_set_host(u_phy->otg, NULL);
519cleanup_phy: 519cleanup_phy:
520 usb_phy_shutdown(hcd->phy); 520 usb_phy_shutdown(hcd->usb_phy);
521cleanup_clk_en: 521cleanup_clk_en:
522 clk_disable_unprepare(tegra->clk); 522 clk_disable_unprepare(tegra->clk);
523cleanup_hcd_create: 523cleanup_hcd_create:
@@ -531,9 +531,9 @@ static int tegra_ehci_remove(struct platform_device *pdev)
531 struct tegra_ehci_hcd *tegra = 531 struct tegra_ehci_hcd *tegra =
532 (struct tegra_ehci_hcd *)hcd_to_ehci(hcd)->priv; 532 (struct tegra_ehci_hcd *)hcd_to_ehci(hcd)->priv;
533 533
534 otg_set_host(hcd->phy->otg, NULL); 534 otg_set_host(hcd->usb_phy->otg, NULL);
535 535
536 usb_phy_shutdown(hcd->phy); 536 usb_phy_shutdown(hcd->usb_phy);
537 usb_remove_hcd(hcd); 537 usb_remove_hcd(hcd);
538 538
539 clk_disable_unprepare(tegra->clk); 539 clk_disable_unprepare(tegra->clk);
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index de9428362503..0231606d47c2 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -180,10 +180,10 @@ static void start_hnp(struct ohci_hcd *ohci)
180 unsigned long flags; 180 unsigned long flags;
181 u32 l; 181 u32 l;
182 182
183 otg_start_hnp(hcd->phy->otg); 183 otg_start_hnp(hcd->usb_phy->otg);
184 184
185 local_irq_save(flags); 185 local_irq_save(flags);
186 hcd->phy->state = OTG_STATE_A_SUSPEND; 186 hcd->usb_phy->state = OTG_STATE_A_SUSPEND;
187 writel (RH_PS_PSS, &ohci->regs->roothub.portstatus [port]); 187 writel (RH_PS_PSS, &ohci->regs->roothub.portstatus [port]);
188 l = omap_readl(OTG_CTRL); 188 l = omap_readl(OTG_CTRL);
189 l &= ~OTG_A_BUSREQ; 189 l &= ~OTG_A_BUSREQ;
@@ -220,14 +220,14 @@ static int ohci_omap_reset(struct usb_hcd *hcd)
220 220
221#ifdef CONFIG_USB_OTG 221#ifdef CONFIG_USB_OTG
222 if (need_transceiver) { 222 if (need_transceiver) {
223 hcd->phy = usb_get_phy(USB_PHY_TYPE_USB2); 223 hcd->usb_phy = usb_get_phy(USB_PHY_TYPE_USB2);
224 if (!IS_ERR_OR_NULL(hcd->phy)) { 224 if (!IS_ERR_OR_NULL(hcd->usb_phy)) {
225 int status = otg_set_host(hcd->phy->otg, 225 int status = otg_set_host(hcd->usb_phy->otg,
226 &ohci_to_hcd(ohci)->self); 226 &ohci_to_hcd(ohci)->self);
227 dev_dbg(hcd->self.controller, "init %s phy, status %d\n", 227 dev_dbg(hcd->self.controller, "init %s phy, status %d\n",
228 hcd->phy->label, status); 228 hcd->usb_phy->label, status);
229 if (status) { 229 if (status) {
230 usb_put_phy(hcd->phy); 230 usb_put_phy(hcd->usb_phy);
231 return status; 231 return status;
232 } 232 }
233 } else { 233 } else {
@@ -399,9 +399,9 @@ usb_hcd_omap_remove (struct usb_hcd *hcd, struct platform_device *pdev)
399 dev_dbg(hcd->self.controller, "stopping USB Controller\n"); 399 dev_dbg(hcd->self.controller, "stopping USB Controller\n");
400 usb_remove_hcd(hcd); 400 usb_remove_hcd(hcd);
401 omap_ohci_clock_power(0); 401 omap_ohci_clock_power(0);
402 if (!IS_ERR_OR_NULL(hcd->phy)) { 402 if (!IS_ERR_OR_NULL(hcd->usb_phy)) {
403 (void) otg_set_host(hcd->phy->otg, 0); 403 (void) otg_set_host(hcd->usb_phy->otg, 0);
404 usb_put_phy(hcd->phy); 404 usb_put_phy(hcd->usb_phy);
405 } 405 }
406 if (machine_is_omap_osk()) 406 if (machine_is_omap_osk())
407 gpio_free(9); 407 gpio_free(9);
diff --git a/drivers/usb/misc/lvstest.c b/drivers/usb/misc/lvstest.c
index 7d589c156fb1..62cb8cd08403 100644
--- a/drivers/usb/misc/lvstest.c
+++ b/drivers/usb/misc/lvstest.c
@@ -333,13 +333,13 @@ static void lvs_rh_work(struct work_struct *work)
333 USB_PORT_STAT_CONNECTION) { 333 USB_PORT_STAT_CONNECTION) {
334 lvs->present = true; 334 lvs->present = true;
335 lvs->portnum = i; 335 lvs->portnum = i;
336 if (hcd->phy) 336 if (hcd->usb_phy)
337 usb_phy_notify_connect(hcd->phy, 337 usb_phy_notify_connect(hcd->usb_phy,
338 USB_SPEED_SUPER); 338 USB_SPEED_SUPER);
339 } else { 339 } else {
340 lvs->present = false; 340 lvs->present = false;
341 if (hcd->phy) 341 if (hcd->usb_phy)
342 usb_phy_notify_disconnect(hcd->phy, 342 usb_phy_notify_disconnect(hcd->usb_phy,
343 USB_SPEED_SUPER); 343 USB_SPEED_SUPER);
344 } 344 }
345 break; 345 break;
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index a48c89e96988..788059a108e5 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -106,7 +106,7 @@ struct usb_hcd {
106 * OTG and some Host controllers need software interaction with phys; 106 * OTG and some Host controllers need software interaction with phys;
107 * other external phys should be software-transparent 107 * other external phys should be software-transparent
108 */ 108 */
109 struct usb_phy *phy; 109 struct usb_phy *usb_phy;
110 110
111 /* Flags that need to be manipulated atomically because they can 111 /* Flags that need to be manipulated atomically because they can
112 * change while the host controller is running. Always use 112 * change while the host controller is running. Always use