linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] phy: ti: Add AM654 USB2 support
@ 2018-12-05 15:03 Roger Quadros
  2018-12-05 15:03 ` [PATCH 1/4] phy: ti: usb2: Fix logic on -EPROBE_DEFER Roger Quadros
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Roger Quadros @ 2018-12-05 15:03 UTC (permalink / raw)
  To: kishon
  Cc: robh+dt, nsekhar, linux-kernel, devicetree, linux-omap, Roger Quadros

Hi Kishon,

This series extends omap-usb2 PHY driver to be used
for AM654 USB2 PHY.

cheers,
-roger

Roger Quadros (4):
  phy: ti: usb2: Fix logic on -EPROBE_DEFER
  phy: ti: Don't depend on OMAP_OCP2SCP
  dt-bindings: phy: ti: Add support for AM654x USB2 PHY
  phy: ti: usb2: Add support for AM654 USB2 PHY

 Documentation/devicetree/bindings/phy/ti-phy.txt |   1 +
 drivers/phy/ti/Kconfig                           |   6 +-
 drivers/phy/ti/phy-omap-usb2.c                   | 105 ++++++++++++++---------
 3 files changed, 67 insertions(+), 45 deletions(-)

-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/4] phy: ti: usb2: Fix logic on -EPROBE_DEFER
  2018-12-05 15:03 [PATCH 0/4] phy: ti: Add AM654 USB2 support Roger Quadros
@ 2018-12-05 15:03 ` Roger Quadros
  2018-12-14  9:41   ` Roger Quadros
  2018-12-05 15:03 ` [PATCH 2/4] phy: ti: Don't depend on OMAP_OCP2SCP Roger Quadros
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Roger Quadros @ 2018-12-05 15:03 UTC (permalink / raw)
  To: kishon
  Cc: robh+dt, nsekhar, linux-kernel, devicetree, linux-omap, Roger Quadros

If clk_get() returns -EPROBE_DEFER then we should just
return instead of falling back to old clock name.

Use clk_prepare_enable() and clk_disable_unprepare() instead
of splitting up prepare/unprepare from enable/disable.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/phy/ti/phy-omap-usb2.c | 88 ++++++++++++++++++++++--------------------
 1 file changed, 47 insertions(+), 41 deletions(-)

diff --git a/drivers/phy/ti/phy-omap-usb2.c b/drivers/phy/ti/phy-omap-usb2.c
index fe909fd..418e7f1 100644
--- a/drivers/phy/ti/phy-omap-usb2.c
+++ b/drivers/phy/ti/phy-omap-usb2.c
@@ -135,9 +135,9 @@ static int omap_usb_power_on(struct phy *x)
 
 static int omap_usb2_disable_clocks(struct omap_usb *phy)
 {
-	clk_disable(phy->wkupclk);
+	clk_disable_unprepare(phy->wkupclk);
 	if (!IS_ERR(phy->optclk))
-		clk_disable(phy->optclk);
+		clk_disable_unprepare(phy->optclk);
 
 	return 0;
 }
@@ -146,14 +146,14 @@ static int omap_usb2_enable_clocks(struct omap_usb *phy)
 {
 	int ret;
 
-	ret = clk_enable(phy->wkupclk);
+	ret = clk_prepare_enable(phy->wkupclk);
 	if (ret < 0) {
 		dev_err(phy->dev, "Failed to enable wkupclk %d\n", ret);
 		goto err0;
 	}
 
 	if (!IS_ERR(phy->optclk)) {
-		ret = clk_enable(phy->optclk);
+		ret = clk_prepare_enable(phy->optclk);
 		if (ret < 0) {
 			dev_err(phy->dev, "Failed to enable optclk %d\n", ret);
 			goto err1;
@@ -346,63 +346,72 @@ static int omap_usb2_probe(struct platform_device *pdev)
 		}
 	}
 
-	otg->set_host		= omap_usb_set_host;
-	otg->set_peripheral	= omap_usb_set_peripheral;
-	if (phy_data->flags & OMAP_USB2_HAS_SET_VBUS)
-		otg->set_vbus		= omap_usb_set_vbus;
-	if (phy_data->flags & OMAP_USB2_HAS_START_SRP)
-		otg->start_srp		= omap_usb_start_srp;
-	otg->usb_phy		= &phy->phy;
-
-	platform_set_drvdata(pdev, phy);
-	pm_runtime_enable(phy->dev);
-
-	generic_phy = devm_phy_create(phy->dev, NULL, &ops);
-	if (IS_ERR(generic_phy)) {
-		pm_runtime_disable(phy->dev);
-		return PTR_ERR(generic_phy);
-	}
-
-	phy_set_drvdata(generic_phy, phy);
-	omap_usb_power_off(generic_phy);
-
-	phy_provider = devm_of_phy_provider_register(phy->dev,
-			of_phy_simple_xlate);
-	if (IS_ERR(phy_provider)) {
-		pm_runtime_disable(phy->dev);
-		return PTR_ERR(phy_provider);
-	}
 
 	phy->wkupclk = devm_clk_get(phy->dev, "wkupclk");
 	if (IS_ERR(phy->wkupclk)) {
-		dev_warn(&pdev->dev, "unable to get wkupclk, trying old name\n");
+		if (PTR_ERR(phy->wkupclk) == -EPROBE_DEFER)
+			return -EPROBE_DEFER;
+
+		dev_warn(&pdev->dev, "unable to get wkupclk %ld, trying old name\n",
+			 PTR_ERR(phy->wkupclk));
 		phy->wkupclk = devm_clk_get(phy->dev, "usb_phy_cm_clk32k");
+
 		if (IS_ERR(phy->wkupclk)) {
-			dev_err(&pdev->dev, "unable to get usb_phy_cm_clk32k\n");
-			pm_runtime_disable(phy->dev);
+			if (PTR_ERR(phy->wkupclk) != -EPROBE_DEFER)
+				dev_err(&pdev->dev, "unable to get usb_phy_cm_clk32k\n");
 			return PTR_ERR(phy->wkupclk);
 		} else {
 			dev_warn(&pdev->dev,
 				 "found usb_phy_cm_clk32k, please fix DTS\n");
 		}
 	}
-	clk_prepare(phy->wkupclk);
 
 	phy->optclk = devm_clk_get(phy->dev, "refclk");
 	if (IS_ERR(phy->optclk)) {
+		if (PTR_ERR(phy->optclk) == -EPROBE_DEFER)
+			return -EPROBE_DEFER;
+
 		dev_dbg(&pdev->dev, "unable to get refclk, trying old name\n");
 		phy->optclk = devm_clk_get(phy->dev, "usb_otg_ss_refclk960m");
+
 		if (IS_ERR(phy->optclk)) {
-			dev_dbg(&pdev->dev,
-				"unable to get usb_otg_ss_refclk960m\n");
+			if (PTR_ERR(phy->optclk) != -EPROBE_DEFER) {
+				dev_dbg(&pdev->dev,
+					"unable to get usb_otg_ss_refclk960m\n");
+			}
 		} else {
 			dev_warn(&pdev->dev,
 				 "found usb_otg_ss_refclk960m, please fix DTS\n");
 		}
 	}
 
-	if (!IS_ERR(phy->optclk))
-		clk_prepare(phy->optclk);
+	otg->set_host = omap_usb_set_host;
+	otg->set_peripheral = omap_usb_set_peripheral;
+	if (phy_data->flags & OMAP_USB2_HAS_SET_VBUS)
+		otg->set_vbus = omap_usb_set_vbus;
+	if (phy_data->flags & OMAP_USB2_HAS_START_SRP)
+		otg->start_srp = omap_usb_start_srp;
+	otg->usb_phy = &phy->phy;
+
+	platform_set_drvdata(pdev, phy);
+	pm_runtime_enable(phy->dev);
+
+	generic_phy = devm_phy_create(phy->dev, NULL, &ops);
+	if (IS_ERR(generic_phy)) {
+		pm_runtime_disable(phy->dev);
+		return PTR_ERR(generic_phy);
+	}
+
+	phy_set_drvdata(generic_phy, phy);
+	omap_usb_power_off(generic_phy);
+
+	phy_provider = devm_of_phy_provider_register(phy->dev,
+						     of_phy_simple_xlate);
+	if (IS_ERR(phy_provider)) {
+		pm_runtime_disable(phy->dev);
+		return PTR_ERR(phy_provider);
+	}
+
 
 	usb_add_phy_dev(&phy->phy);
 
@@ -413,9 +422,6 @@ static int omap_usb2_remove(struct platform_device *pdev)
 {
 	struct omap_usb	*phy = platform_get_drvdata(pdev);
 
-	clk_unprepare(phy->wkupclk);
-	if (!IS_ERR(phy->optclk))
-		clk_unprepare(phy->optclk);
 	usb_remove_phy(&phy->phy);
 	pm_runtime_disable(phy->dev);
 
-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/4] phy: ti: Don't depend on OMAP_OCP2SCP
  2018-12-05 15:03 [PATCH 0/4] phy: ti: Add AM654 USB2 support Roger Quadros
  2018-12-05 15:03 ` [PATCH 1/4] phy: ti: usb2: Fix logic on -EPROBE_DEFER Roger Quadros
@ 2018-12-05 15:03 ` Roger Quadros
  2018-12-05 15:03 ` [PATCH 3/4] dt-bindings: phy: ti: Add support for AM654x USB2 PHY Roger Quadros
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Roger Quadros @ 2018-12-05 15:03 UTC (permalink / raw)
  To: kishon
  Cc: robh+dt, nsekhar, linux-kernel, devicetree, linux-omap, Roger Quadros

TI_PIPE3 and OMAP_USB2 don't depend on OMAP_OCP2SCP
for build.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
---
 drivers/phy/ti/Kconfig | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/phy/ti/Kconfig b/drivers/phy/ti/Kconfig
index 2050356..4fdbe06 100644
--- a/drivers/phy/ti/Kconfig
+++ b/drivers/phy/ti/Kconfig
@@ -38,7 +38,6 @@ config OMAP_USB2
 	select GENERIC_PHY
 	select USB_PHY
 	select OMAP_CONTROL_PHY
-	depends on OMAP_OCP2SCP
 	help
 	  Enable this to support the transceiver that is part of SOC. This
 	  driver takes care of all the PHY functionality apart from comparator.
@@ -50,7 +49,6 @@ config TI_PIPE3
 	depends on ARCH_OMAP2PLUS || COMPILE_TEST
 	select GENERIC_PHY
 	select OMAP_CONTROL_PHY
-	depends on OMAP_OCP2SCP
 	help
 	  Enable this to support the PIPE3 PHY that is part of TI SOCs. This
 	  driver takes care of all the PHY functionality apart from comparator.
-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/4] dt-bindings: phy: ti: Add support for AM654x USB2 PHY
  2018-12-05 15:03 [PATCH 0/4] phy: ti: Add AM654 USB2 support Roger Quadros
  2018-12-05 15:03 ` [PATCH 1/4] phy: ti: usb2: Fix logic on -EPROBE_DEFER Roger Quadros
  2018-12-05 15:03 ` [PATCH 2/4] phy: ti: Don't depend on OMAP_OCP2SCP Roger Quadros
@ 2018-12-05 15:03 ` Roger Quadros
  2018-12-19 20:37   ` Rob Herring
  2018-12-05 15:03 ` [PATCH 4/4] phy: ti: usb2: Add support for AM654 " Roger Quadros
  2019-01-09  9:14 ` [PATCH 0/4] phy: ti: Add AM654 USB2 support Roger Quadros
  4 siblings, 1 reply; 10+ messages in thread
From: Roger Quadros @ 2018-12-05 15:03 UTC (permalink / raw)
  To: kishon
  Cc: robh+dt, nsekhar, linux-kernel, devicetree, linux-omap, Roger Quadros

Add support for USB2 PHY on AM654x SoC.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
---
 Documentation/devicetree/bindings/phy/ti-phy.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/phy/ti-phy.txt b/Documentation/devicetree/bindings/phy/ti-phy.txt
index 57dfda8..8f93c3b 100644
--- a/Documentation/devicetree/bindings/phy/ti-phy.txt
+++ b/Documentation/devicetree/bindings/phy/ti-phy.txt
@@ -35,6 +35,7 @@ Required properties:
 	       DRA7x
 	       Should be "ti,dra7x-usb2-phy2" for the 2nd instance of USB2 PHY
 	       in DRA7x
+	       Should be "ti,am654-usb2" for the USB2 PHYs on AM654.
  - reg : Address and length of the register set for the device.
  - #phy-cells: determine the number of cells that should be given in the
    phandle while referencing this phy.
-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/4] phy: ti: usb2: Add support for AM654 USB2 PHY
  2018-12-05 15:03 [PATCH 0/4] phy: ti: Add AM654 USB2 support Roger Quadros
                   ` (2 preceding siblings ...)
  2018-12-05 15:03 ` [PATCH 3/4] dt-bindings: phy: ti: Add support for AM654x USB2 PHY Roger Quadros
@ 2018-12-05 15:03 ` Roger Quadros
  2019-01-09  9:14 ` [PATCH 0/4] phy: ti: Add AM654 USB2 support Roger Quadros
  4 siblings, 0 replies; 10+ messages in thread
From: Roger Quadros @ 2018-12-05 15:03 UTC (permalink / raw)
  To: kishon
  Cc: robh+dt, nsekhar, linux-kernel, devicetree, linux-omap, Roger Quadros

Add support for the USB2 PHY on the AM654 SoC.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
---
 drivers/phy/ti/Kconfig         |  4 ++--
 drivers/phy/ti/phy-omap-usb2.c | 17 +++++++++++++++++
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/ti/Kconfig b/drivers/phy/ti/Kconfig
index 4fdbe06..a55959b 100644
--- a/drivers/phy/ti/Kconfig
+++ b/drivers/phy/ti/Kconfig
@@ -33,11 +33,11 @@ config OMAP_CONTROL_PHY
 
 config OMAP_USB2
 	tristate "OMAP USB2 PHY Driver"
-	depends on ARCH_OMAP2PLUS
+	depends on ARCH_OMAP2PLUS || ARCH_K3
 	depends on USB_SUPPORT
 	select GENERIC_PHY
 	select USB_PHY
-	select OMAP_CONTROL_PHY
+	select OMAP_CONTROL_PHY if ARCH_OMAP2PLUS
 	help
 	  Enable this to support the transceiver that is part of SOC. This
 	  driver takes care of all the PHY functionality apart from comparator.
diff --git a/drivers/phy/ti/phy-omap-usb2.c b/drivers/phy/ti/phy-omap-usb2.c
index 418e7f1..e871f29 100644
--- a/drivers/phy/ti/phy-omap-usb2.c
+++ b/drivers/phy/ti/phy-omap-usb2.c
@@ -36,6 +36,10 @@
 #define USB2PHY_DISCON_BYP_LATCH (1 << 31)
 #define USB2PHY_ANA_CONFIG1 0x4c
 
+#define AM654_USB2_OTG_PD		BIT(8)
+#define AM654_USB2_VBUS_DET_EN		BIT(5)
+#define AM654_USB2_VBUSVALID_DET_EN	BIT(4)
+
 /**
  * omap_usb2_set_comparator - links the comparator present in the sytem with
  *	this phy
@@ -245,6 +249,15 @@ static const struct usb_phy_data am437x_usb2_data = {
 	.power_off = AM437X_USB2_PHY_PD | AM437X_USB2_OTG_PD,
 };
 
+static const struct usb_phy_data am654_usb2_data = {
+	.label = "am654_usb2",
+	.flags = OMAP_USB2_CALIBRATE_FALSE_DISCONNECT,
+	.mask = AM654_USB2_OTG_PD | AM654_USB2_VBUS_DET_EN |
+		AM654_USB2_VBUSVALID_DET_EN,
+	.power_on = AM654_USB2_VBUS_DET_EN | AM654_USB2_VBUSVALID_DET_EN,
+	.power_off = AM654_USB2_OTG_PD,
+};
+
 static const struct of_device_id omap_usb2_id_table[] = {
 	{
 		.compatible = "ti,omap-usb2",
@@ -266,6 +279,10 @@ static const struct of_device_id omap_usb2_id_table[] = {
 		.compatible = "ti,am437x-usb2",
 		.data = &am437x_usb2_data,
 	},
+	{
+		.compatible = "ti,am654-usb2",
+		.data = &am654_usb2_data,
+	},
 	{},
 };
 MODULE_DEVICE_TABLE(of, omap_usb2_id_table);
-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/4] phy: ti: usb2: Fix logic on -EPROBE_DEFER
  2018-12-05 15:03 ` [PATCH 1/4] phy: ti: usb2: Fix logic on -EPROBE_DEFER Roger Quadros
@ 2018-12-14  9:41   ` Roger Quadros
  2018-12-14 17:23     ` Tony Lindgren
  0 siblings, 1 reply; 10+ messages in thread
From: Roger Quadros @ 2018-12-14  9:41 UTC (permalink / raw)
  To: kishon, Tony Lindgren
  Cc: robh+dt, nsekhar, linux-kernel, devicetree, linux-omap

Kishon,

On 05/12/18 17:03, Roger Quadros wrote:
> If clk_get() returns -EPROBE_DEFER then we should just
> return instead of falling back to old clock name.
> 
> Use clk_prepare_enable() and clk_disable_unprepare() instead
> of splitting up prepare/unprepare from enable/disable.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

I think you should pick this one for -next independently of the rest
of the series as Tony's ti-sysc patches might cause this issue to trigger
due to re-ordering of devices.


cheers,
-roger

> ---
>  drivers/phy/ti/phy-omap-usb2.c | 88 ++++++++++++++++++++++--------------------
>  1 file changed, 47 insertions(+), 41 deletions(-)
> 
> diff --git a/drivers/phy/ti/phy-omap-usb2.c b/drivers/phy/ti/phy-omap-usb2.c
> index fe909fd..418e7f1 100644
> --- a/drivers/phy/ti/phy-omap-usb2.c
> +++ b/drivers/phy/ti/phy-omap-usb2.c
> @@ -135,9 +135,9 @@ static int omap_usb_power_on(struct phy *x)
>  
>  static int omap_usb2_disable_clocks(struct omap_usb *phy)
>  {
> -	clk_disable(phy->wkupclk);
> +	clk_disable_unprepare(phy->wkupclk);
>  	if (!IS_ERR(phy->optclk))
> -		clk_disable(phy->optclk);
> +		clk_disable_unprepare(phy->optclk);
>  
>  	return 0;
>  }
> @@ -146,14 +146,14 @@ static int omap_usb2_enable_clocks(struct omap_usb *phy)
>  {
>  	int ret;
>  
> -	ret = clk_enable(phy->wkupclk);
> +	ret = clk_prepare_enable(phy->wkupclk);
>  	if (ret < 0) {
>  		dev_err(phy->dev, "Failed to enable wkupclk %d\n", ret);
>  		goto err0;
>  	}
>  
>  	if (!IS_ERR(phy->optclk)) {
> -		ret = clk_enable(phy->optclk);
> +		ret = clk_prepare_enable(phy->optclk);
>  		if (ret < 0) {
>  			dev_err(phy->dev, "Failed to enable optclk %d\n", ret);
>  			goto err1;
> @@ -346,63 +346,72 @@ static int omap_usb2_probe(struct platform_device *pdev)
>  		}
>  	}
>  
> -	otg->set_host		= omap_usb_set_host;
> -	otg->set_peripheral	= omap_usb_set_peripheral;
> -	if (phy_data->flags & OMAP_USB2_HAS_SET_VBUS)
> -		otg->set_vbus		= omap_usb_set_vbus;
> -	if (phy_data->flags & OMAP_USB2_HAS_START_SRP)
> -		otg->start_srp		= omap_usb_start_srp;
> -	otg->usb_phy		= &phy->phy;
> -
> -	platform_set_drvdata(pdev, phy);
> -	pm_runtime_enable(phy->dev);
> -
> -	generic_phy = devm_phy_create(phy->dev, NULL, &ops);
> -	if (IS_ERR(generic_phy)) {
> -		pm_runtime_disable(phy->dev);
> -		return PTR_ERR(generic_phy);
> -	}
> -
> -	phy_set_drvdata(generic_phy, phy);
> -	omap_usb_power_off(generic_phy);
> -
> -	phy_provider = devm_of_phy_provider_register(phy->dev,
> -			of_phy_simple_xlate);
> -	if (IS_ERR(phy_provider)) {
> -		pm_runtime_disable(phy->dev);
> -		return PTR_ERR(phy_provider);
> -	}
>  
>  	phy->wkupclk = devm_clk_get(phy->dev, "wkupclk");
>  	if (IS_ERR(phy->wkupclk)) {
> -		dev_warn(&pdev->dev, "unable to get wkupclk, trying old name\n");
> +		if (PTR_ERR(phy->wkupclk) == -EPROBE_DEFER)
> +			return -EPROBE_DEFER;
> +
> +		dev_warn(&pdev->dev, "unable to get wkupclk %ld, trying old name\n",
> +			 PTR_ERR(phy->wkupclk));
>  		phy->wkupclk = devm_clk_get(phy->dev, "usb_phy_cm_clk32k");
> +
>  		if (IS_ERR(phy->wkupclk)) {
> -			dev_err(&pdev->dev, "unable to get usb_phy_cm_clk32k\n");
> -			pm_runtime_disable(phy->dev);
> +			if (PTR_ERR(phy->wkupclk) != -EPROBE_DEFER)
> +				dev_err(&pdev->dev, "unable to get usb_phy_cm_clk32k\n");
>  			return PTR_ERR(phy->wkupclk);
>  		} else {
>  			dev_warn(&pdev->dev,
>  				 "found usb_phy_cm_clk32k, please fix DTS\n");
>  		}
>  	}
> -	clk_prepare(phy->wkupclk);
>  
>  	phy->optclk = devm_clk_get(phy->dev, "refclk");
>  	if (IS_ERR(phy->optclk)) {
> +		if (PTR_ERR(phy->optclk) == -EPROBE_DEFER)
> +			return -EPROBE_DEFER;
> +
>  		dev_dbg(&pdev->dev, "unable to get refclk, trying old name\n");
>  		phy->optclk = devm_clk_get(phy->dev, "usb_otg_ss_refclk960m");
> +
>  		if (IS_ERR(phy->optclk)) {
> -			dev_dbg(&pdev->dev,
> -				"unable to get usb_otg_ss_refclk960m\n");
> +			if (PTR_ERR(phy->optclk) != -EPROBE_DEFER) {
> +				dev_dbg(&pdev->dev,
> +					"unable to get usb_otg_ss_refclk960m\n");
> +			}
>  		} else {
>  			dev_warn(&pdev->dev,
>  				 "found usb_otg_ss_refclk960m, please fix DTS\n");
>  		}
>  	}
>  
> -	if (!IS_ERR(phy->optclk))
> -		clk_prepare(phy->optclk);
> +	otg->set_host = omap_usb_set_host;
> +	otg->set_peripheral = omap_usb_set_peripheral;
> +	if (phy_data->flags & OMAP_USB2_HAS_SET_VBUS)
> +		otg->set_vbus = omap_usb_set_vbus;
> +	if (phy_data->flags & OMAP_USB2_HAS_START_SRP)
> +		otg->start_srp = omap_usb_start_srp;
> +	otg->usb_phy = &phy->phy;
> +
> +	platform_set_drvdata(pdev, phy);
> +	pm_runtime_enable(phy->dev);
> +
> +	generic_phy = devm_phy_create(phy->dev, NULL, &ops);
> +	if (IS_ERR(generic_phy)) {
> +		pm_runtime_disable(phy->dev);
> +		return PTR_ERR(generic_phy);
> +	}
> +
> +	phy_set_drvdata(generic_phy, phy);
> +	omap_usb_power_off(generic_phy);
> +
> +	phy_provider = devm_of_phy_provider_register(phy->dev,
> +						     of_phy_simple_xlate);
> +	if (IS_ERR(phy_provider)) {
> +		pm_runtime_disable(phy->dev);
> +		return PTR_ERR(phy_provider);
> +	}
> +
>  
>  	usb_add_phy_dev(&phy->phy);
>  
> @@ -413,9 +422,6 @@ static int omap_usb2_remove(struct platform_device *pdev)
>  {
>  	struct omap_usb	*phy = platform_get_drvdata(pdev);
>  
> -	clk_unprepare(phy->wkupclk);
> -	if (!IS_ERR(phy->optclk))
> -		clk_unprepare(phy->optclk);
>  	usb_remove_phy(&phy->phy);
>  	pm_runtime_disable(phy->dev);
>  
> 

-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/4] phy: ti: usb2: Fix logic on -EPROBE_DEFER
  2018-12-14  9:41   ` Roger Quadros
@ 2018-12-14 17:23     ` Tony Lindgren
  0 siblings, 0 replies; 10+ messages in thread
From: Tony Lindgren @ 2018-12-14 17:23 UTC (permalink / raw)
  To: Roger Quadros
  Cc: kishon, robh+dt, nsekhar, linux-kernel, devicetree, linux-omap

* Roger Quadros <rogerq@ti.com> [181214 09:42]:
> Kishon,
> 
> On 05/12/18 17:03, Roger Quadros wrote:
> > If clk_get() returns -EPROBE_DEFER then we should just
> > return instead of falling back to old clock name.
> > 
> > Use clk_prepare_enable() and clk_disable_unprepare() instead
> > of splitting up prepare/unprepare from enable/disable.
> > 
> > Signed-off-by: Roger Quadros <rogerq@ti.com>
> 
> I think you should pick this one for -next independently of the rest
> of the series as Tony's ti-sysc patches might cause this issue to trigger
> due to re-ordering of devices.

Yes good idea. FYI, the reason why we can start seeing deferred
probe happen for some new devices with the ti-sysc changes is
because we group the devices by the l4 interconnect and probe
the interconnect instances separately.

Regards,

TOny

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/4] dt-bindings: phy: ti: Add support for AM654x USB2 PHY
  2018-12-05 15:03 ` [PATCH 3/4] dt-bindings: phy: ti: Add support for AM654x USB2 PHY Roger Quadros
@ 2018-12-19 20:37   ` Rob Herring
  0 siblings, 0 replies; 10+ messages in thread
From: Rob Herring @ 2018-12-19 20:37 UTC (permalink / raw)
  To: Roger Quadros
  Cc: kishon, robh+dt, nsekhar, linux-kernel, devicetree, linux-omap,
	Roger Quadros

On Wed, 5 Dec 2018 17:03:25 +0200, Roger Quadros wrote:
> Add support for USB2 PHY on AM654x SoC.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>
> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
> ---
>  Documentation/devicetree/bindings/phy/ti-phy.txt | 1 +
>  1 file changed, 1 insertion(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/4] phy: ti: Add AM654 USB2 support
  2018-12-05 15:03 [PATCH 0/4] phy: ti: Add AM654 USB2 support Roger Quadros
                   ` (3 preceding siblings ...)
  2018-12-05 15:03 ` [PATCH 4/4] phy: ti: usb2: Add support for AM654 " Roger Quadros
@ 2019-01-09  9:14 ` Roger Quadros
  2019-01-16  8:32   ` Kishon Vijay Abraham I
  4 siblings, 1 reply; 10+ messages in thread
From: Roger Quadros @ 2019-01-09  9:14 UTC (permalink / raw)
  To: kishon; +Cc: robh+dt, nsekhar, linux-kernel, devicetree, linux-omap

Hi Kishon,

On 05/12/18 17:03, Roger Quadros wrote:
> Hi Kishon,
> 
> This series extends omap-usb2 PHY driver to be used
> for AM654 USB2 PHY.

Any comments on this series? If it looks fine, could you please
queue this for -next. Thanks.

cheers,
-roger

> 
> cheers,
> -roger
> 
> Roger Quadros (4):
>   phy: ti: usb2: Fix logic on -EPROBE_DEFER
>   phy: ti: Don't depend on OMAP_OCP2SCP
>   dt-bindings: phy: ti: Add support for AM654x USB2 PHY
>   phy: ti: usb2: Add support for AM654 USB2 PHY
> 
>  Documentation/devicetree/bindings/phy/ti-phy.txt |   1 +
>  drivers/phy/ti/Kconfig                           |   6 +-
>  drivers/phy/ti/phy-omap-usb2.c                   | 105 ++++++++++++++---------
>  3 files changed, 67 insertions(+), 45 deletions(-)
> 

-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/4] phy: ti: Add AM654 USB2 support
  2019-01-09  9:14 ` [PATCH 0/4] phy: ti: Add AM654 USB2 support Roger Quadros
@ 2019-01-16  8:32   ` Kishon Vijay Abraham I
  0 siblings, 0 replies; 10+ messages in thread
From: Kishon Vijay Abraham I @ 2019-01-16  8:32 UTC (permalink / raw)
  To: Roger Quadros; +Cc: robh+dt, nsekhar, linux-kernel, devicetree, linux-omap



On 09/01/19 2:44 PM, Roger Quadros wrote:
> Hi Kishon,
> 
> On 05/12/18 17:03, Roger Quadros wrote:
>> Hi Kishon,
>>
>> This series extends omap-usb2 PHY driver to be used
>> for AM654 USB2 PHY.
> 
> Any comments on this series? If it looks fine, could you please
> queue this for -next. Thanks.

Sorry for the delay. Merged now to -next.

Thanks
Kishon
> 
> cheers,
> -roger
> 
>>
>> cheers,
>> -roger
>>
>> Roger Quadros (4):
>>   phy: ti: usb2: Fix logic on -EPROBE_DEFER
>>   phy: ti: Don't depend on OMAP_OCP2SCP
>>   dt-bindings: phy: ti: Add support for AM654x USB2 PHY
>>   phy: ti: usb2: Add support for AM654 USB2 PHY
>>
>>  Documentation/devicetree/bindings/phy/ti-phy.txt |   1 +
>>  drivers/phy/ti/Kconfig                           |   6 +-
>>  drivers/phy/ti/phy-omap-usb2.c                   | 105 ++++++++++++++---------
>>  3 files changed, 67 insertions(+), 45 deletions(-)
>>
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-01-16  8:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-05 15:03 [PATCH 0/4] phy: ti: Add AM654 USB2 support Roger Quadros
2018-12-05 15:03 ` [PATCH 1/4] phy: ti: usb2: Fix logic on -EPROBE_DEFER Roger Quadros
2018-12-14  9:41   ` Roger Quadros
2018-12-14 17:23     ` Tony Lindgren
2018-12-05 15:03 ` [PATCH 2/4] phy: ti: Don't depend on OMAP_OCP2SCP Roger Quadros
2018-12-05 15:03 ` [PATCH 3/4] dt-bindings: phy: ti: Add support for AM654x USB2 PHY Roger Quadros
2018-12-19 20:37   ` Rob Herring
2018-12-05 15:03 ` [PATCH 4/4] phy: ti: usb2: Add support for AM654 " Roger Quadros
2019-01-09  9:14 ` [PATCH 0/4] phy: ti: Add AM654 USB2 support Roger Quadros
2019-01-16  8:32   ` Kishon Vijay Abraham I

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).