Skip to contentSkip to conversation

usb: phy: rcar-gen2: register using usb_add_phy_dev()

PATCH In review Ulrich Hecht 2 participants 2 messages Nov 20, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 8/9 usb: phy: rcar-gen2: register using usb_add_phy_dev()

Allows binding of PCI USB host controllers to this phy.

---
 drivers/usb/phy/phy-rcar-gen2-usb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/phy/phy-rcar-gen2-usb.c +2 -1
index a99a695..25fdd91 100644
@@ -212,8 +212,9 @@ static int rcar_gen2_usb_phy_probe(struct platform_device *pdev)
 	priv->phy.init = rcar_gen2_usb_phy_init;
 	priv->phy.shutdown = rcar_gen2_usb_phy_shutdown;
 	priv->phy.set_suspend = rcar_gen2_usb_phy_set_suspend;
+	priv->phy.type = USB_PHY_TYPE_USB2;
 
-	retval = usb_add_phy(&priv->phy, USB_PHY_TYPE_USB2);
+	retval = usb_add_phy_dev(&priv->phy);
 	if (retval < 0) {
 		dev_err(dev, "Failed to add USB phy\n");
 		return retval;
Signature · 1 line
1.8.4
#1 lore raw
Quoted 12 lines · Ulrich Hecht

Allows binding of PCI USB host controllers to this phy.

---
  drivers/usb/phy/phy-rcar-gen2-usb.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/phy/phy-rcar-gen2-usb.c +0 -0
index a99a695..25fdd91 100644

drivers/usb/phy/phy-rcar-gen2-usb.c static int rcar_gen2_usb_phy_probe(struct platform_device *pdev) · line 215

Quoted 4 lines
drivers/usb/phy/phy-rcar-gen2-usb.c +1 -0
@@ -212,8 +212,9 @@ static int rcar_gen2_usb_phy_probe(struct platform_device *pdev)
  	priv->phy.init = rcar_gen2_usb_phy_init;
  	priv->phy.shutdown = rcar_gen2_usb_phy_shutdown;
  	priv->phy.set_suspend = rcar_gen2_usb_phy_set_suspend;
+	priv->phy.type = USB_PHY_TYPE_USB2;

The above line is not really needed.
I think we should switch to usb_bind_phy and bind USB phy to the renesas_usbhs device instead. In this case usbhs device probe will be deferred unless usb phy is available.

drivers/usb/phy/phy-rcar-gen2-usb.c static int rcar_gen2_usb_phy_probe(struct platform_device *pdev)

Quoted 7 lines
drivers/usb/phy/phy-rcar-gen2-usb.c +1 -1
-	retval = usb_add_phy(&priv->phy, USB_PHY_TYPE_USB2);
+	retval = usb_add_phy_dev(&priv->phy);
  	if (retval < 0) {
  		dev_err(dev, "Failed to add USB phy\n");
  		return retval;
 

Thanks,
Val.