提交 3d46e73d 编写于 作者: A Antoine Tenart 提交者: Greg Kroah-Hartman

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: NAntoine Tenart <antoine.tenart@free-electrons.com>
[Sergei: added missing 'drivers/usb/misc/lvstest.c' file, resolved rejects,
updated changelog.]
Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: NAlan Stern <stern@rowland.harvard.edu>
Acked-by: NFelipe Balbi <balbi@ti.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 a173dc44
...@@ -59,7 +59,7 @@ static int host_start(struct ci_hdrc *ci) ...@@ -59,7 +59,7 @@ static int host_start(struct ci_hdrc *ci)
hcd->has_tt = 1; hcd->has_tt = 1;
hcd->power_budget = ci->platdata->power_budget; hcd->power_budget = ci->platdata->power_budget;
hcd->phy = ci->transceiver; hcd->usb_phy = ci->transceiver;
hcd->tpl_support = ci->platdata->tpl_support; hcd->tpl_support = ci->platdata->tpl_support;
ehci = hcd_to_ehci(hcd); ehci = hcd_to_ehci(hcd);
......
...@@ -2629,7 +2629,7 @@ int usb_add_hcd(struct usb_hcd *hcd, ...@@ -2629,7 +2629,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
int retval; int retval;
struct usb_device *rhdev; struct usb_device *rhdev;
if (IS_ENABLED(CONFIG_USB_PHY) && !hcd->phy) { if (IS_ENABLED(CONFIG_USB_PHY) && !hcd->usb_phy) {
struct usb_phy *phy = usb_get_phy_dev(hcd->self.controller, 0); struct usb_phy *phy = usb_get_phy_dev(hcd->self.controller, 0);
if (IS_ERR(phy)) { if (IS_ERR(phy)) {
...@@ -2642,7 +2642,7 @@ int usb_add_hcd(struct usb_hcd *hcd, ...@@ -2642,7 +2642,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
usb_put_phy(phy); usb_put_phy(phy);
return retval; return retval;
} }
hcd->phy = phy; hcd->usb_phy = phy;
hcd->remove_phy = 1; hcd->remove_phy = 1;
} }
} }
...@@ -2790,10 +2790,10 @@ int usb_add_hcd(struct usb_hcd *hcd, ...@@ -2790,10 +2790,10 @@ int usb_add_hcd(struct usb_hcd *hcd,
err_register_bus: err_register_bus:
hcd_buffer_destroy(hcd); hcd_buffer_destroy(hcd);
err_remove_phy: err_remove_phy:
if (hcd->remove_phy && hcd->phy) { if (hcd->remove_phy && hcd->usb_phy) {
usb_phy_shutdown(hcd->phy); usb_phy_shutdown(hcd->usb_phy);
usb_put_phy(hcd->phy); usb_put_phy(hcd->usb_phy);
hcd->phy = NULL; hcd->usb_phy = NULL;
} }
return retval; return retval;
} }
...@@ -2866,10 +2866,10 @@ void usb_remove_hcd(struct usb_hcd *hcd) ...@@ -2866,10 +2866,10 @@ void usb_remove_hcd(struct usb_hcd *hcd)
usb_deregister_bus(&hcd->self); usb_deregister_bus(&hcd->self);
hcd_buffer_destroy(hcd); hcd_buffer_destroy(hcd);
if (hcd->remove_phy && hcd->phy) { if (hcd->remove_phy && hcd->usb_phy) {
usb_phy_shutdown(hcd->phy); usb_phy_shutdown(hcd->usb_phy);
usb_put_phy(hcd->phy); usb_put_phy(hcd->usb_phy);
hcd->phy = NULL; hcd->usb_phy = NULL;
} }
usb_put_invalidate_rhdev(hcd); usb_put_invalidate_rhdev(hcd);
......
...@@ -4468,8 +4468,8 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, ...@@ -4468,8 +4468,8 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
if (retval) if (retval)
goto fail; goto fail;
if (hcd->phy && !hdev->parent) if (hcd->usb_phy && !hdev->parent)
usb_phy_notify_connect(hcd->phy, udev->speed); usb_phy_notify_connect(hcd->usb_phy, udev->speed);
/* /*
* Some superspeed devices have finished the link training process * 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,9 +4627,9 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
/* Disconnect any existing devices under this port */ /* Disconnect any existing devices under this port */
if (udev) { if (udev) {
if (hcd->phy && !hdev->parent && if (hcd->usb_phy && !hdev->parent &&
!(portstatus & USB_PORT_STAT_CONNECTION)) !(portstatus & USB_PORT_STAT_CONNECTION))
usb_phy_notify_disconnect(hcd->phy, udev->speed); usb_phy_notify_disconnect(hcd->usb_phy, udev->speed);
usb_disconnect(&port_dev->child); usb_disconnect(&port_dev->child);
} }
......
...@@ -136,15 +136,15 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver, ...@@ -136,15 +136,15 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver,
if (pdata->operating_mode == FSL_USB2_DR_OTG) { if (pdata->operating_mode == FSL_USB2_DR_OTG) {
struct ehci_hcd *ehci = hcd_to_ehci(hcd); struct ehci_hcd *ehci = hcd_to_ehci(hcd);
hcd->phy = usb_get_phy(USB_PHY_TYPE_USB2); hcd->usb_phy = usb_get_phy(USB_PHY_TYPE_USB2);
dev_dbg(&pdev->dev, "hcd=0x%p ehci=0x%p, phy=0x%p\n", dev_dbg(&pdev->dev, "hcd=0x%p ehci=0x%p, phy=0x%p\n",
hcd, ehci, hcd->phy); hcd, ehci, hcd->usb_phy);
if (!IS_ERR_OR_NULL(hcd->phy)) { if (!IS_ERR_OR_NULL(hcd->usb_phy)) {
retval = otg_set_host(hcd->phy->otg, retval = otg_set_host(hcd->usb_phy->otg,
&ehci_to_hcd(ehci)->self); &ehci_to_hcd(ehci)->self);
if (retval) { if (retval) {
usb_put_phy(hcd->phy); usb_put_phy(hcd->usb_phy);
goto err2; goto err2;
} }
} else { } else {
...@@ -181,9 +181,9 @@ static void usb_hcd_fsl_remove(struct usb_hcd *hcd, ...@@ -181,9 +181,9 @@ static void usb_hcd_fsl_remove(struct usb_hcd *hcd,
{ {
struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev); struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev);
if (!IS_ERR_OR_NULL(hcd->phy)) { if (!IS_ERR_OR_NULL(hcd->usb_phy)) {
otg_set_host(hcd->phy->otg, NULL); otg_set_host(hcd->usb_phy->otg, NULL);
usb_put_phy(hcd->phy); usb_put_phy(hcd->usb_phy);
} }
usb_remove_hcd(hcd); usb_remove_hcd(hcd);
......
...@@ -922,7 +922,7 @@ int ehci_hub_control( ...@@ -922,7 +922,7 @@ int ehci_hub_control(
#ifdef CONFIG_USB_OTG #ifdef CONFIG_USB_OTG
if ((hcd->self.otg_port == (wIndex + 1)) if ((hcd->self.otg_port == (wIndex + 1))
&& hcd->self.b_hnp_enable) { && hcd->self.b_hnp_enable) {
otg_start_hnp(hcd->phy->otg); otg_start_hnp(hcd->usb_phy->otg);
break; break;
} }
#endif #endif
......
...@@ -124,7 +124,7 @@ static int ehci_msm_probe(struct platform_device *pdev) ...@@ -124,7 +124,7 @@ static int ehci_msm_probe(struct platform_device *pdev)
goto put_hcd; goto put_hcd;
} }
hcd->phy = phy; hcd->usb_phy = phy;
device_init_wakeup(&pdev->dev, 1); device_init_wakeup(&pdev->dev, 1);
/* /*
* OTG device parent of HCD takes care of putting * OTG device parent of HCD takes care of putting
...@@ -151,7 +151,7 @@ static int ehci_msm_remove(struct platform_device *pdev) ...@@ -151,7 +151,7 @@ static int ehci_msm_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev); pm_runtime_set_suspended(&pdev->dev);
otg_set_host(hcd->phy->otg, NULL); otg_set_host(hcd->usb_phy->otg, NULL);
/* FIXME: need to call usb_remove_hcd() here? */ /* FIXME: need to call usb_remove_hcd() here? */
......
...@@ -206,7 +206,7 @@ static int tegra_ehci_hub_control( ...@@ -206,7 +206,7 @@ static int tegra_ehci_hub_control(
if (tegra->port_resuming && !(temp & PORT_SUSPEND)) { if (tegra->port_resuming && !(temp & PORT_SUSPEND)) {
/* Resume completed, re-enable disconnect detection */ /* Resume completed, re-enable disconnect detection */
tegra->port_resuming = 0; tegra->port_resuming = 0;
tegra_usb_phy_postresume(hcd->phy); tegra_usb_phy_postresume(hcd->usb_phy);
} }
} }
...@@ -259,7 +259,7 @@ static int tegra_ehci_hub_control( ...@@ -259,7 +259,7 @@ static int tegra_ehci_hub_control(
goto done; goto done;
/* Disable disconnect detection during port resume */ /* Disable disconnect detection during port resume */
tegra_usb_phy_preresume(hcd->phy); tegra_usb_phy_preresume(hcd->usb_phy);
ehci->reset_done[wIndex-1] = jiffies + msecs_to_jiffies(25); ehci->reset_done[wIndex-1] = jiffies + msecs_to_jiffies(25);
...@@ -454,7 +454,7 @@ static int tegra_ehci_probe(struct platform_device *pdev) ...@@ -454,7 +454,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
err = PTR_ERR(u_phy); err = PTR_ERR(u_phy);
goto cleanup_clk_en; goto cleanup_clk_en;
} }
hcd->phy = u_phy; hcd->usb_phy = u_phy;
tegra->needs_double_reset = of_property_read_bool(pdev->dev.of_node, tegra->needs_double_reset = of_property_read_bool(pdev->dev.of_node,
"nvidia,needs-double-reset"); "nvidia,needs-double-reset");
...@@ -475,7 +475,7 @@ static int tegra_ehci_probe(struct platform_device *pdev) ...@@ -475,7 +475,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
ehci->caps = hcd->regs + 0x100; ehci->caps = hcd->regs + 0x100;
ehci->has_hostpc = soc_config->has_hostpc; ehci->has_hostpc = soc_config->has_hostpc;
err = usb_phy_init(hcd->phy); err = usb_phy_init(hcd->usb_phy);
if (err) { if (err) {
dev_err(&pdev->dev, "Failed to initialize phy\n"); dev_err(&pdev->dev, "Failed to initialize phy\n");
goto cleanup_clk_en; goto cleanup_clk_en;
...@@ -490,7 +490,7 @@ static int tegra_ehci_probe(struct platform_device *pdev) ...@@ -490,7 +490,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
} }
u_phy->otg->host = hcd_to_bus(hcd); u_phy->otg->host = hcd_to_bus(hcd);
err = usb_phy_set_suspend(hcd->phy, 0); err = usb_phy_set_suspend(hcd->usb_phy, 0);
if (err) { if (err) {
dev_err(&pdev->dev, "Failed to power on the phy\n"); dev_err(&pdev->dev, "Failed to power on the phy\n");
goto cleanup_phy; goto cleanup_phy;
...@@ -517,7 +517,7 @@ static int tegra_ehci_probe(struct platform_device *pdev) ...@@ -517,7 +517,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
cleanup_otg_set_host: cleanup_otg_set_host:
otg_set_host(u_phy->otg, NULL); otg_set_host(u_phy->otg, NULL);
cleanup_phy: cleanup_phy:
usb_phy_shutdown(hcd->phy); usb_phy_shutdown(hcd->usb_phy);
cleanup_clk_en: cleanup_clk_en:
clk_disable_unprepare(tegra->clk); clk_disable_unprepare(tegra->clk);
cleanup_hcd_create: cleanup_hcd_create:
...@@ -531,9 +531,9 @@ static int tegra_ehci_remove(struct platform_device *pdev) ...@@ -531,9 +531,9 @@ static int tegra_ehci_remove(struct platform_device *pdev)
struct tegra_ehci_hcd *tegra = struct tegra_ehci_hcd *tegra =
(struct tegra_ehci_hcd *)hcd_to_ehci(hcd)->priv; (struct tegra_ehci_hcd *)hcd_to_ehci(hcd)->priv;
otg_set_host(hcd->phy->otg, NULL); otg_set_host(hcd->usb_phy->otg, NULL);
usb_phy_shutdown(hcd->phy); usb_phy_shutdown(hcd->usb_phy);
usb_remove_hcd(hcd); usb_remove_hcd(hcd);
clk_disable_unprepare(tegra->clk); clk_disable_unprepare(tegra->clk);
......
...@@ -180,10 +180,10 @@ static void start_hnp(struct ohci_hcd *ohci) ...@@ -180,10 +180,10 @@ static void start_hnp(struct ohci_hcd *ohci)
unsigned long flags; unsigned long flags;
u32 l; u32 l;
otg_start_hnp(hcd->phy->otg); otg_start_hnp(hcd->usb_phy->otg);
local_irq_save(flags); local_irq_save(flags);
hcd->phy->state = OTG_STATE_A_SUSPEND; hcd->usb_phy->state = OTG_STATE_A_SUSPEND;
writel (RH_PS_PSS, &ohci->regs->roothub.portstatus [port]); writel (RH_PS_PSS, &ohci->regs->roothub.portstatus [port]);
l = omap_readl(OTG_CTRL); l = omap_readl(OTG_CTRL);
l &= ~OTG_A_BUSREQ; l &= ~OTG_A_BUSREQ;
...@@ -220,14 +220,14 @@ static int ohci_omap_reset(struct usb_hcd *hcd) ...@@ -220,14 +220,14 @@ static int ohci_omap_reset(struct usb_hcd *hcd)
#ifdef CONFIG_USB_OTG #ifdef CONFIG_USB_OTG
if (need_transceiver) { if (need_transceiver) {
hcd->phy = usb_get_phy(USB_PHY_TYPE_USB2); hcd->usb_phy = usb_get_phy(USB_PHY_TYPE_USB2);
if (!IS_ERR_OR_NULL(hcd->phy)) { if (!IS_ERR_OR_NULL(hcd->usb_phy)) {
int status = otg_set_host(hcd->phy->otg, int status = otg_set_host(hcd->usb_phy->otg,
&ohci_to_hcd(ohci)->self); &ohci_to_hcd(ohci)->self);
dev_dbg(hcd->self.controller, "init %s phy, status %d\n", dev_dbg(hcd->self.controller, "init %s phy, status %d\n",
hcd->phy->label, status); hcd->usb_phy->label, status);
if (status) { if (status) {
usb_put_phy(hcd->phy); usb_put_phy(hcd->usb_phy);
return status; return status;
} }
} else { } else {
...@@ -399,9 +399,9 @@ usb_hcd_omap_remove (struct usb_hcd *hcd, struct platform_device *pdev) ...@@ -399,9 +399,9 @@ usb_hcd_omap_remove (struct usb_hcd *hcd, struct platform_device *pdev)
dev_dbg(hcd->self.controller, "stopping USB Controller\n"); dev_dbg(hcd->self.controller, "stopping USB Controller\n");
usb_remove_hcd(hcd); usb_remove_hcd(hcd);
omap_ohci_clock_power(0); omap_ohci_clock_power(0);
if (!IS_ERR_OR_NULL(hcd->phy)) { if (!IS_ERR_OR_NULL(hcd->usb_phy)) {
(void) otg_set_host(hcd->phy->otg, 0); (void) otg_set_host(hcd->usb_phy->otg, 0);
usb_put_phy(hcd->phy); usb_put_phy(hcd->usb_phy);
} }
if (machine_is_omap_osk()) if (machine_is_omap_osk())
gpio_free(9); gpio_free(9);
......
...@@ -333,13 +333,13 @@ static void lvs_rh_work(struct work_struct *work) ...@@ -333,13 +333,13 @@ static void lvs_rh_work(struct work_struct *work)
USB_PORT_STAT_CONNECTION) { USB_PORT_STAT_CONNECTION) {
lvs->present = true; lvs->present = true;
lvs->portnum = i; lvs->portnum = i;
if (hcd->phy) if (hcd->usb_phy)
usb_phy_notify_connect(hcd->phy, usb_phy_notify_connect(hcd->usb_phy,
USB_SPEED_SUPER); USB_SPEED_SUPER);
} else { } else {
lvs->present = false; lvs->present = false;
if (hcd->phy) if (hcd->usb_phy)
usb_phy_notify_disconnect(hcd->phy, usb_phy_notify_disconnect(hcd->usb_phy,
USB_SPEED_SUPER); USB_SPEED_SUPER);
} }
break; break;
......
...@@ -106,7 +106,7 @@ struct usb_hcd { ...@@ -106,7 +106,7 @@ struct usb_hcd {
* OTG and some Host controllers need software interaction with phys; * OTG and some Host controllers need software interaction with phys;
* other external phys should be software-transparent * other external phys should be software-transparent
*/ */
struct usb_phy *phy; struct usb_phy *usb_phy;
/* Flags that need to be manipulated atomically because they can /* Flags that need to be manipulated atomically because they can
* change while the host controller is running. Always use * change while the host controller is running. Always use
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册