Commit 19c1eac2 authored by Antoine Tenart's avatar Antoine Tenart Committed by Felipe Balbi
Browse files

usb: rename phy to usb_phy in OTG



This patch prepares the introduction of the generic PHY support in the
USB OTG common functions. The USB PHY member of the OTG structure is
renamed to 'usb_phy' and modifications are done in all drivers accessing
it. Renaming this pointer will allow to keep the compatibility for USB
PHY drivers.

Signed-off-by: default avatarAntoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent e47d9254
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ EXPORT_SYMBOL_GPL(omap_usb2_set_comparator);

static int omap_usb_set_vbus(struct usb_otg *otg, bool enabled)
{
	struct omap_usb *phy = phy_to_omapusb(otg->phy);
	struct omap_usb *phy = phy_to_omapusb(otg->usb_phy);

	if (!phy->comparator)
		return -ENODEV;
@@ -70,7 +70,7 @@ static int omap_usb_set_vbus(struct usb_otg *otg, bool enabled)

static int omap_usb_start_srp(struct usb_otg *otg)
{
	struct omap_usb *phy = phy_to_omapusb(otg->phy);
	struct omap_usb *phy = phy_to_omapusb(otg->usb_phy);

	if (!phy->comparator)
		return -ENODEV;
@@ -251,7 +251,7 @@ static int omap_usb2_probe(struct platform_device *pdev)
		otg->set_vbus		= omap_usb_set_vbus;
	if (phy_data->flags & OMAP_USB2_HAS_START_SRP)
		otg->start_srp		= omap_usb_start_srp;
	otg->phy		= &phy->phy;
	otg->usb_phy		= &phy->phy;

	platform_set_drvdata(pdev, phy);

+1 −1
Original line number Diff line number Diff line
@@ -788,7 +788,7 @@ int ci_hdrc_otg_fsm_init(struct ci_hdrc *ci)
		return -ENOMEM;
	}

	otg->phy = ci->transceiver;
	otg->usb_phy = ci->transceiver;
	otg->gadget = &ci->gadget;
	ci->fsm.otg = otg;
	ci->transceiver->otg = ci->fsm.otg;
+3 −3
Original line number Diff line number Diff line
@@ -1056,7 +1056,7 @@ static int ab8500_usb_set_peripheral(struct usb_otg *otg,
	if (!otg)
		return -ENODEV;

	ab = phy_to_ab(otg->phy);
	ab = phy_to_ab(otg->usb_phy);

	ab->phy.otg->gadget = gadget;

@@ -1080,7 +1080,7 @@ static int ab8500_usb_set_host(struct usb_otg *otg, struct usb_bus *host)
	if (!otg)
		return -ENODEV;

	ab = phy_to_ab(otg->phy);
	ab = phy_to_ab(otg->usb_phy);

	ab->phy.otg->host = host;

@@ -1382,7 +1382,7 @@ static int ab8500_usb_probe(struct platform_device *pdev)
	ab->phy.set_power	= ab8500_usb_set_power;
	ab->phy.otg->state	= OTG_STATE_UNDEFINED;

	otg->phy		= &ab->phy;
	otg->usb_phy		= &ab->phy;
	otg->set_host		= ab8500_usb_set_host;
	otg->set_peripheral	= ab8500_usb_set_peripheral;

+7 −6
Original line number Diff line number Diff line
@@ -499,7 +499,8 @@ int fsl_otg_start_host(struct otg_fsm *fsm, int on)
{
	struct usb_otg *otg = fsm->otg;
	struct device *dev;
	struct fsl_otg *otg_dev = container_of(otg->phy, struct fsl_otg, phy);
	struct fsl_otg *otg_dev =
		container_of(otg->usb_phy, struct fsl_otg, phy);
	u32 retval = 0;

	if (!otg->host)
@@ -594,7 +595,7 @@ static int fsl_otg_set_host(struct usb_otg *otg, struct usb_bus *host)
	if (!otg)
		return -ENODEV;

	otg_dev = container_of(otg->phy, struct fsl_otg, phy);
	otg_dev = container_of(otg->usb_phy, struct fsl_otg, phy);
	if (otg_dev != fsl_otg_dev)
		return -ENODEV;

@@ -644,7 +645,7 @@ static int fsl_otg_set_peripheral(struct usb_otg *otg,
	if (!otg)
		return -ENODEV;

	otg_dev = container_of(otg->phy, struct fsl_otg, phy);
	otg_dev = container_of(otg->usb_phy, struct fsl_otg, phy);
	VDBG("otg_dev 0x%x\n", (int)otg_dev);
	VDBG("fsl_otg_dev 0x%x\n", (int)fsl_otg_dev);
	if (otg_dev != fsl_otg_dev)
@@ -717,7 +718,7 @@ static int fsl_otg_start_srp(struct usb_otg *otg)
	if (!otg || otg.state != OTG_STATE_B_IDLE)
		return -ENODEV;

	otg_dev = container_of(otg->phy, struct fsl_otg, phy);
	otg_dev = container_of(otg->usb_phy, struct fsl_otg, phy);
	if (otg_dev != fsl_otg_dev)
		return -ENODEV;

@@ -735,7 +736,7 @@ static int fsl_otg_start_hnp(struct usb_otg *otg)
	if (!otg)
		return -ENODEV;

	otg_dev = container_of(otg->phy, struct fsl_otg, phy);
	otg_dev = container_of(otg->usb_phy, struct fsl_otg, phy);
	if (otg_dev != fsl_otg_dev)
		return -ENODEV;

@@ -857,7 +858,7 @@ static int fsl_otg_conf(struct platform_device *pdev)
	fsl_otg_tc->phy.dev = &pdev->dev;
	fsl_otg_tc->phy.set_power = fsl_otg_set_power;

	fsl_otg_tc->phy.otg->phy = &fsl_otg_tc->phy;
	fsl_otg_tc->phy.otg->usb_phy = &fsl_otg_tc->phy;
	fsl_otg_tc->phy.otg->set_host = fsl_otg_set_host;
	fsl_otg_tc->phy.otg->set_peripheral = fsl_otg_set_peripheral;
	fsl_otg_tc->phy.otg->start_hnp = fsl_otg_start_hnp;
+1 −1
Original line number Diff line number Diff line
@@ -228,7 +228,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
	nop->phy.type		= type;

	nop->phy.otg->state		= OTG_STATE_UNDEFINED;
	nop->phy.otg->phy		= &nop->phy;
	nop->phy.otg->usb_phy		= &nop->phy;
	nop->phy.otg->set_host		= nop_set_host;
	nop->phy.otg->set_peripheral	= nop_set_peripheral;

Loading