All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] usb: phy: msm: Make phy_reset clk and reset line optional.
@ 2014-07-17 20:16 Srinivas Kandagatla
  2014-07-18 10:31 ` Prakash Burla
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Srinivas Kandagatla @ 2014-07-17 20:16 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, linux-arm-msm,
	Srinivas Kandagatla

This patch makes the phy reset clk and reset line optional as this clk
is not available on boards like IFC6410 with APQ8064.

phy-reset clk is only used as argument to the mach level callbacks, so
this patch adds condition before clk_get calls so that the driver
wouldn't fail on SOCs which do not have this support.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
Hi Felipe,

With this new patch now the error message is only printed if the SOC actually supports
the phy reset clk, for SOCs like APQ8064 where there is no phy reset clock or
the callback which takes it there is no point in doing a clk_get call in the first place.


Thanks,
srini




 drivers/usb/phy/phy-msm-usb.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index c929370..aa8e2b9 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -279,11 +279,11 @@ static int msm_otg_link_clk_reset(struct msm_otg *motg, bool assert)
 
 static int msm_otg_phy_clk_reset(struct msm_otg *motg)
 {
-	int ret;
+	int ret = 0;
 
 	if (motg->pdata->phy_clk_reset)
 		ret = motg->pdata->phy_clk_reset(motg->phy_reset_clk);
-	else
+	else if (motg->phy_rst)
 		ret = reset_control_reset(motg->phy_rst);
 
 	if (ret)
@@ -1466,7 +1466,7 @@ static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg)
 
 	motg->phy_rst = devm_reset_control_get(&pdev->dev, "phy");
 	if (IS_ERR(motg->phy_rst))
-		return PTR_ERR(motg->phy_rst);
+		motg->phy_rst = NULL;
 
 	pdata->mode = of_usb_get_dr_mode(node);
 	if (pdata->mode == USB_DR_MODE_UNKNOWN)
@@ -1554,11 +1554,14 @@ static int msm_otg_probe(struct platform_device *pdev)
 	phy = &motg->phy;
 	phy->dev = &pdev->dev;
 
-	motg->phy_reset_clk = devm_clk_get(&pdev->dev,
+	if (motg->pdata->phy_clk_reset) {
+		motg->phy_reset_clk = devm_clk_get(&pdev->dev,
 					   np ? "phy" : "usb_phy_clk");
-	if (IS_ERR(motg->phy_reset_clk)) {
-		dev_err(&pdev->dev, "failed to get usb_phy_clk\n");
-		return PTR_ERR(motg->phy_reset_clk);
+
+		if (IS_ERR(motg->phy_reset_clk)) {
+			dev_err(&pdev->dev, "failed to get usb_phy_clk\n");
+			return PTR_ERR(motg->phy_reset_clk);
+		}
 	}
 
 	motg->clk = devm_clk_get(&pdev->dev, np ? "core" : "usb_hs_clk");
-- 
1.9.1

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

* Re: [PATCH v2] usb: phy: msm: Make phy_reset clk and reset line optional.
  2014-07-17 20:16 [PATCH v2] usb: phy: msm: Make phy_reset clk and reset line optional Srinivas Kandagatla
@ 2014-07-18 10:31 ` Prakash Burla
  2014-08-20 15:57   ` Felipe Balbi
  2014-08-21  6:45 ` [PATCH v3] " Srinivas Kandagatla
  2 siblings, 0 replies; 6+ messages in thread
From: Prakash Burla @ 2014-07-18 10:31 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: Felipe Balbi, Greg Kroah-Hartman, linux-usb, linux-kernel, linux-arm-msm

tested-by: Prakash Burla <prakash.burla@smartplayin.com>
This driver tested on IFC6410 with USB Driver.

On Fri, Jul 18, 2014 at 1:46 AM, Srinivas Kandagatla
<srinivas.kandagatla@linaro.org> wrote:
> This patch makes the phy reset clk and reset line optional as this clk
> is not available on boards like IFC6410 with APQ8064.
>
> phy-reset clk is only used as argument to the mach level callbacks, so
> this patch adds condition before clk_get calls so that the driver
> wouldn't fail on SOCs which do not have this support.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
> Hi Felipe,
>
> With this new patch now the error message is only printed if the SOC actually supports
> the phy reset clk, for SOCs like APQ8064 where there is no phy reset clock or
> the callback which takes it there is no point in doing a clk_get call in the first place.
>
>
> Thanks,
> srini
>
>
>
>
>  drivers/usb/phy/phy-msm-usb.c | 17 ++++++++++-------
>  1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
> index c929370..aa8e2b9 100644
> --- a/drivers/usb/phy/phy-msm-usb.c
> +++ b/drivers/usb/phy/phy-msm-usb.c
> @@ -279,11 +279,11 @@ static int msm_otg_link_clk_reset(struct msm_otg *motg, bool assert)
>
>  static int msm_otg_phy_clk_reset(struct msm_otg *motg)
>  {
> -       int ret;
> +       int ret = 0;
>
>         if (motg->pdata->phy_clk_reset)
>                 ret = motg->pdata->phy_clk_reset(motg->phy_reset_clk);
> -       else
> +       else if (motg->phy_rst)
>                 ret = reset_control_reset(motg->phy_rst);
>
>         if (ret)
> @@ -1466,7 +1466,7 @@ static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg)
>
>         motg->phy_rst = devm_reset_control_get(&pdev->dev, "phy");
>         if (IS_ERR(motg->phy_rst))
> -               return PTR_ERR(motg->phy_rst);
> +               motg->phy_rst = NULL;
>
>         pdata->mode = of_usb_get_dr_mode(node);
>         if (pdata->mode == USB_DR_MODE_UNKNOWN)
> @@ -1554,11 +1554,14 @@ static int msm_otg_probe(struct platform_device *pdev)
>         phy = &motg->phy;
>         phy->dev = &pdev->dev;
>
> -       motg->phy_reset_clk = devm_clk_get(&pdev->dev,
> +       if (motg->pdata->phy_clk_reset) {
> +               motg->phy_reset_clk = devm_clk_get(&pdev->dev,
>                                            np ? "phy" : "usb_phy_clk");
> -       if (IS_ERR(motg->phy_reset_clk)) {
> -               dev_err(&pdev->dev, "failed to get usb_phy_clk\n");
> -               return PTR_ERR(motg->phy_reset_clk);
> +
> +               if (IS_ERR(motg->phy_reset_clk)) {
> +                       dev_err(&pdev->dev, "failed to get usb_phy_clk\n");
> +                       return PTR_ERR(motg->phy_reset_clk);
> +               }
>         }
>
>         motg->clk = devm_clk_get(&pdev->dev, np ? "core" : "usb_hs_clk");
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [PATCH v2] usb: phy: msm: Make phy_reset clk and reset line optional.
  2014-07-17 20:16 [PATCH v2] usb: phy: msm: Make phy_reset clk and reset line optional Srinivas Kandagatla
@ 2014-08-20 15:57   ` Felipe Balbi
  2014-08-20 15:57   ` Felipe Balbi
  2014-08-21  6:45 ` [PATCH v3] " Srinivas Kandagatla
  2 siblings, 0 replies; 6+ messages in thread
From: Felipe Balbi @ 2014-08-20 15:57 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: Felipe Balbi, Greg Kroah-Hartman, linux-usb, linux-kernel, linux-arm-msm

[-- Attachment #1: Type: text/plain, Size: 835 bytes --]

On Thu, Jul 17, 2014 at 09:16:40PM +0100, Srinivas Kandagatla wrote:
> This patch makes the phy reset clk and reset line optional as this clk
> is not available on boards like IFC6410 with APQ8064.
> 
> phy-reset clk is only used as argument to the mach level callbacks, so
> this patch adds condition before clk_get calls so that the driver
> wouldn't fail on SOCs which do not have this support.
> 
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
> Hi Felipe,
> 
> With this new patch now the error message is only printed if the SOC actually supports
> the phy reset clk, for SOCs like APQ8064 where there is no phy reset clock or
> the callback which takes it there is no point in doing a clk_get call in the first place.

doesn't apply. Please rebase on top of v3.17-rc1

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH v2] usb: phy: msm: Make phy_reset clk and reset line optional.
@ 2014-08-20 15:57   ` Felipe Balbi
  0 siblings, 0 replies; 6+ messages in thread
From: Felipe Balbi @ 2014-08-20 15:57 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: Felipe Balbi, Greg Kroah-Hartman, linux-usb, linux-kernel, linux-arm-msm

[-- Attachment #1: Type: text/plain, Size: 835 bytes --]

On Thu, Jul 17, 2014 at 09:16:40PM +0100, Srinivas Kandagatla wrote:
> This patch makes the phy reset clk and reset line optional as this clk
> is not available on boards like IFC6410 with APQ8064.
> 
> phy-reset clk is only used as argument to the mach level callbacks, so
> this patch adds condition before clk_get calls so that the driver
> wouldn't fail on SOCs which do not have this support.
> 
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
> Hi Felipe,
> 
> With this new patch now the error message is only printed if the SOC actually supports
> the phy reset clk, for SOCs like APQ8064 where there is no phy reset clock or
> the callback which takes it there is no point in doing a clk_get call in the first place.

doesn't apply. Please rebase on top of v3.17-rc1

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH v2] usb: phy: msm: Make phy_reset clk and reset line optional.
  2014-08-20 15:57   ` Felipe Balbi
  (?)
@ 2014-08-21  6:31   ` Srinivas Kandagatla
  -1 siblings, 0 replies; 6+ messages in thread
From: Srinivas Kandagatla @ 2014-08-21  6:31 UTC (permalink / raw)
  To: balbi; +Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, linux-arm-msm

Thanks Felipe,

On 20/08/14 16:57, Felipe Balbi wrote:
> On Thu, Jul 17, 2014 at 09:16:40PM +0100, Srinivas Kandagatla wrote:
>> This patch makes the phy reset clk and reset line optional as this clk
>> is not available on boards like IFC6410 with APQ8064.
>>
>> phy-reset clk is only used as argument to the mach level callbacks, so
>> this patch adds condition before clk_get calls so that the driver
>> wouldn't fail on SOCs which do not have this support.
>>
>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>> ---
>> Hi Felipe,
>>
>> With this new patch now the error message is only printed if the SOC actually supports
>> the phy reset clk, for SOCs like APQ8064 where there is no phy reset clock or
>> the callback which takes it there is no point in doing a clk_get call in the first place.
>
> doesn't apply. Please rebase on top of v3.17-rc1
>
this is because a previous version of the same patch got applied.
Anyway I will rebase this patch and send v3.

thanks,
srini

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

* [PATCH v3] usb: phy: msm: Make phy_reset clk and reset line optional.
  2014-07-17 20:16 [PATCH v2] usb: phy: msm: Make phy_reset clk and reset line optional Srinivas Kandagatla
  2014-07-18 10:31 ` Prakash Burla
  2014-08-20 15:57   ` Felipe Balbi
@ 2014-08-21  6:45 ` Srinivas Kandagatla
  2 siblings, 0 replies; 6+ messages in thread
From: Srinivas Kandagatla @ 2014-08-21  6:45 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, linux-arm-msm,
	srinivas.kandagatla

This patch makes the phy reset clk and reset line optional as this clk
is not available on boards like IFC6410 with APQ8064.

phy-reset clk is only used as argument to the mach level callbacks, so
this patch adds condition before clk_get calls so that the driver
wouldn't fail on SOCs which do not have this support.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
Hi Felipe,

With this new patch now the error message is only printed if the SOC actually supports
the phy reset clk, for SOCs like APQ8064 where there is no phy reset clock or
the callback which takes it there is no point in doing a clk_get call in the first place.

Changes since v2:
	- rebased patch on top of v3.17-rc1


Thanks,
srini

 drivers/usb/phy/phy-msm-usb.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index e4108ee..7f6aa32 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -281,7 +281,7 @@ static int msm_otg_phy_clk_reset(struct msm_otg *motg)
 {
 	int ret = 0;
 
-	if (motg->pdata->phy_clk_reset && motg->phy_reset_clk)
+	if (motg->pdata->phy_clk_reset)
 		ret = motg->pdata->phy_clk_reset(motg->phy_reset_clk);
 	else if (motg->phy_rst)
 		ret = reset_control_reset(motg->phy_rst);
@@ -1554,11 +1554,14 @@ static int msm_otg_probe(struct platform_device *pdev)
 	phy = &motg->phy;
 	phy->dev = &pdev->dev;
 
-	motg->phy_reset_clk = devm_clk_get(&pdev->dev,
+	if (motg->pdata->phy_clk_reset) {
+		motg->phy_reset_clk = devm_clk_get(&pdev->dev,
 					   np ? "phy" : "usb_phy_clk");
-	if (IS_ERR(motg->phy_reset_clk)) {
-		dev_err(&pdev->dev, "failed to get usb_phy_clk\n");
-		motg->phy_reset_clk = NULL;
+
+		if (IS_ERR(motg->phy_reset_clk)) {
+			dev_err(&pdev->dev, "failed to get usb_phy_clk\n");
+			return PTR_ERR(motg->phy_reset_clk);
+		}
 	}
 
 	motg->clk = devm_clk_get(&pdev->dev, np ? "core" : "usb_hs_clk");
-- 
1.9.1

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

end of thread, other threads:[~2014-08-21  6:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-17 20:16 [PATCH v2] usb: phy: msm: Make phy_reset clk and reset line optional Srinivas Kandagatla
2014-07-18 10:31 ` Prakash Burla
2014-08-20 15:57 ` Felipe Balbi
2014-08-20 15:57   ` Felipe Balbi
2014-08-21  6:31   ` Srinivas Kandagatla
2014-08-21  6:45 ` [PATCH v3] " Srinivas Kandagatla

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.