Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d46e73d authored by Antoine Tenart's avatar Antoine Tenart Committed by Greg Kroah-Hartman
Browse files

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: default avatarAntoine Tenart <antoine.tenart@free-electrons.com>
[Sergei: added missing 'drivers/usb/misc/lvstest.c' file, resolved rejects,
updated changelog.]
Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Acked-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a173dc44
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ static int host_start(struct ci_hdrc *ci)
	hcd->has_tt = 1;

	hcd->power_budget = ci->platdata->power_budget;
	hcd->phy = ci->transceiver;
	hcd->usb_phy = ci->transceiver;
	hcd->tpl_support = ci->platdata->tpl_support;

	ehci = hcd_to_ehci(hcd);
+10 −10
Original line number Diff line number Diff line
@@ -2629,7 +2629,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
	int retval;
	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);

		if (IS_ERR(phy)) {
@@ -2642,7 +2642,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
				usb_put_phy(phy);
				return retval;
			}
			hcd->phy = phy;
			hcd->usb_phy = phy;
			hcd->remove_phy = 1;
		}
	}
@@ -2790,10 +2790,10 @@ err_allocate_root_hub:
err_register_bus:
	hcd_buffer_destroy(hcd);
err_remove_phy:
	if (hcd->remove_phy && hcd->phy) {
		usb_phy_shutdown(hcd->phy);
		usb_put_phy(hcd->phy);
		hcd->phy = NULL;
	if (hcd->remove_phy && hcd->usb_phy) {
		usb_phy_shutdown(hcd->usb_phy);
		usb_put_phy(hcd->usb_phy);
		hcd->usb_phy = NULL;
	}
	return retval;
}
@@ -2866,10 +2866,10 @@ void usb_remove_hcd(struct usb_hcd *hcd)

	usb_deregister_bus(&hcd->self);
	hcd_buffer_destroy(hcd);
	if (hcd->remove_phy && hcd->phy) {
		usb_phy_shutdown(hcd->phy);
		usb_put_phy(hcd->phy);
		hcd->phy = NULL;
	if (hcd->remove_phy && hcd->usb_phy) {
		usb_phy_shutdown(hcd->usb_phy);
		usb_put_phy(hcd->usb_phy);
		hcd->usb_phy = NULL;
	}

	usb_put_invalidate_rhdev(hcd);
+4 −4
Original line number Diff line number Diff line
@@ -4468,8 +4468,8 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
	if (retval)
		goto fail;

	if (hcd->phy && !hdev->parent)
		usb_phy_notify_connect(hcd->phy, udev->speed);
	if (hcd->usb_phy && !hdev->parent)
		usb_phy_notify_connect(hcd->usb_phy, udev->speed);

	/*
	 * 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,

	/* Disconnect any existing devices under this port */
	if (udev) {
		if (hcd->phy && !hdev->parent &&
		if (hcd->usb_phy && !hdev->parent &&
				!(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);
	}

+8 −8
Original line number Diff line number Diff line
@@ -136,15 +136,15 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver,
	if (pdata->operating_mode == FSL_USB2_DR_OTG) {
		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",
			hcd, ehci, hcd->phy);
			hcd, ehci, hcd->usb_phy);

		if (!IS_ERR_OR_NULL(hcd->phy)) {
			retval = otg_set_host(hcd->phy->otg,
		if (!IS_ERR_OR_NULL(hcd->usb_phy)) {
			retval = otg_set_host(hcd->usb_phy->otg,
					      &ehci_to_hcd(ehci)->self);
			if (retval) {
				usb_put_phy(hcd->phy);
				usb_put_phy(hcd->usb_phy);
				goto err2;
			}
		} else {
@@ -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);

	if (!IS_ERR_OR_NULL(hcd->phy)) {
		otg_set_host(hcd->phy->otg, NULL);
		usb_put_phy(hcd->phy);
	if (!IS_ERR_OR_NULL(hcd->usb_phy)) {
		otg_set_host(hcd->usb_phy->otg, NULL);
		usb_put_phy(hcd->usb_phy);
	}

	usb_remove_hcd(hcd);
+1 −1
Original line number Diff line number Diff line
@@ -922,7 +922,7 @@ int ehci_hub_control(
#ifdef CONFIG_USB_OTG
			if ((hcd->self.otg_port == (wIndex + 1))
			    && hcd->self.b_hnp_enable) {
				otg_start_hnp(hcd->phy->otg);
				otg_start_hnp(hcd->usb_phy->otg);
				break;
			}
#endif
Loading