All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: balbi-l0cyMroinI0@public.gmane.org
Cc: linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org,
	linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org,
	Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 4/4] usb: phy: omap-usb2: enable 960Mhz clock for omap5
Date: Wed, 19 Sep 2012 16:45:01 +0200	[thread overview]
Message-ID: <5059DA6D.4070205@pengutronix.de> (raw)
In-Reply-To: <20120919115647.GI3772-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 2753 bytes --]

On 09/19/2012 01:56 PM, Felipe Balbi wrote:
> On Wed, Sep 19, 2012 at 05:00:29PM +0530, Kishon Vijay Abraham I wrote:
>> "usb_otg_ss_refclk960m" is needed by usb2 phy present in omap5. For
>> omap4, the clk_get of this clock will fail since it does not have this
>> clock.
>>
>> Signed-off-by: Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>
>> ---
>>  Documentation/devicetree/bindings/usb/usb-phy.txt |    3 +++
>>  drivers/usb/phy/omap-usb2.c                       |   28 ++++++++++++++++++++-
>>  2 files changed, 30 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/usb/usb-phy.txt b/Documentation/devicetree/bindings/usb/usb-phy.txt
>> index 7c5fd89..d5626de 100644
>> --- a/Documentation/devicetree/bindings/usb/usb-phy.txt
>> +++ b/Documentation/devicetree/bindings/usb/usb-phy.txt
>> @@ -24,6 +24,9 @@ Required properties:
>>  add the address of control module phy power register until a driver for
>>  control module is added
>>  
>> +Optional properties:
>> + - has960mhzclk: should be added if the phy needs 960mhz clock
>> +
>>  This is usually a subnode of ocp2scp to which it is connected.
>>  
>>  usb3phy@4a084400 {
>> diff --git a/drivers/usb/phy/omap-usb2.c b/drivers/usb/phy/omap-usb2.c
>> index d36c282..d6612ba 100644
>> --- a/drivers/usb/phy/omap-usb2.c
>> +++ b/drivers/usb/phy/omap-usb2.c
>> @@ -146,6 +146,7 @@ static int __devinit omap_usb2_probe(struct platform_device *pdev)
>>  	struct omap_usb			*phy;
>>  	struct usb_otg			*otg;
>>  	struct resource			*res;
>> +	struct device_node		*np = pdev->dev.of_node;
>>  
>>  	phy = devm_kzalloc(&pdev->dev, sizeof(*phy), GFP_KERNEL);
>>  	if (!phy) {
>> @@ -190,6 +191,15 @@ static int __devinit omap_usb2_probe(struct platform_device *pdev)
>>  	}
>>  	clk_prepare(phy->wkupclk);
>>  
>> +	if (of_property_read_bool(np, "has960mhzclk")) {
>> +		phy->optclk = devm_clk_get(phy->dev, "usb_otg_ss_refclk960m");
>> +		if (IS_ERR(phy->optclk)) {
>> +			dev_err(&pdev->dev, "unable to get refclk960m\n");
>> +			return PTR_ERR(phy->optclk);
>> +		}
>> +		clk_prepare(phy->optclk);
>> +	}
> 
> instead, can't you just always try to get the clock but ignore the error
> if it fails ?

On imx we add no-op dummy clocks, so that the drivers will always find
all needed clocks. If a clk_get fails it's an error.

> If it works you can set a flag to let you know that you can use that
> optional clock.

Marc
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

[-- Attachment #2: Type: text/plain, Size: 192 bytes --]

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

WARNING: multiple messages have this Message-ID (diff)
From: mkl@pengutronix.de (Marc Kleine-Budde)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/4] usb: phy: omap-usb2: enable 960Mhz clock for omap5
Date: Wed, 19 Sep 2012 16:45:01 +0200	[thread overview]
Message-ID: <5059DA6D.4070205@pengutronix.de> (raw)
In-Reply-To: <20120919115647.GI3772@arwen.pp.htv.fi>

On 09/19/2012 01:56 PM, Felipe Balbi wrote:
> On Wed, Sep 19, 2012 at 05:00:29PM +0530, Kishon Vijay Abraham I wrote:
>> "usb_otg_ss_refclk960m" is needed by usb2 phy present in omap5. For
>> omap4, the clk_get of this clock will fail since it does not have this
>> clock.
>>
>> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
>> ---
>>  Documentation/devicetree/bindings/usb/usb-phy.txt |    3 +++
>>  drivers/usb/phy/omap-usb2.c                       |   28 ++++++++++++++++++++-
>>  2 files changed, 30 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/usb/usb-phy.txt b/Documentation/devicetree/bindings/usb/usb-phy.txt
>> index 7c5fd89..d5626de 100644
>> --- a/Documentation/devicetree/bindings/usb/usb-phy.txt
>> +++ b/Documentation/devicetree/bindings/usb/usb-phy.txt
>> @@ -24,6 +24,9 @@ Required properties:
>>  add the address of control module phy power register until a driver for
>>  control module is added
>>  
>> +Optional properties:
>> + - has960mhzclk: should be added if the phy needs 960mhz clock
>> +
>>  This is usually a subnode of ocp2scp to which it is connected.
>>  
>>  usb3phy at 4a084400 {
>> diff --git a/drivers/usb/phy/omap-usb2.c b/drivers/usb/phy/omap-usb2.c
>> index d36c282..d6612ba 100644
>> --- a/drivers/usb/phy/omap-usb2.c
>> +++ b/drivers/usb/phy/omap-usb2.c
>> @@ -146,6 +146,7 @@ static int __devinit omap_usb2_probe(struct platform_device *pdev)
>>  	struct omap_usb			*phy;
>>  	struct usb_otg			*otg;
>>  	struct resource			*res;
>> +	struct device_node		*np = pdev->dev.of_node;
>>  
>>  	phy = devm_kzalloc(&pdev->dev, sizeof(*phy), GFP_KERNEL);
>>  	if (!phy) {
>> @@ -190,6 +191,15 @@ static int __devinit omap_usb2_probe(struct platform_device *pdev)
>>  	}
>>  	clk_prepare(phy->wkupclk);
>>  
>> +	if (of_property_read_bool(np, "has960mhzclk")) {
>> +		phy->optclk = devm_clk_get(phy->dev, "usb_otg_ss_refclk960m");
>> +		if (IS_ERR(phy->optclk)) {
>> +			dev_err(&pdev->dev, "unable to get refclk960m\n");
>> +			return PTR_ERR(phy->optclk);
>> +		}
>> +		clk_prepare(phy->optclk);
>> +	}
> 
> instead, can't you just always try to get the clock but ignore the error
> if it fails ?

On imx we add no-op dummy clocks, so that the drivers will always find
all needed clocks. If a clk_get fails it's an error.

> If it works you can set a flag to let you know that you can use that
> optional clock.

Marc
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120919/e145a2fb/attachment.sig>

WARNING: multiple messages have this Message-ID (diff)
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: balbi@ti.com
Cc: Kishon Vijay Abraham I <kishon@ti.com>,
	grant.likely@secretlab.ca, rob.herring@calxeda.com,
	rob@landley.net, linux@arm.linux.org.uk,
	linux-usb@vger.kernel.org, linux-omap@vger.kernel.org,
	devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 4/4] usb: phy: omap-usb2: enable 960Mhz clock for omap5
Date: Wed, 19 Sep 2012 16:45:01 +0200	[thread overview]
Message-ID: <5059DA6D.4070205@pengutronix.de> (raw)
In-Reply-To: <20120919115647.GI3772@arwen.pp.htv.fi>

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

On 09/19/2012 01:56 PM, Felipe Balbi wrote:
> On Wed, Sep 19, 2012 at 05:00:29PM +0530, Kishon Vijay Abraham I wrote:
>> "usb_otg_ss_refclk960m" is needed by usb2 phy present in omap5. For
>> omap4, the clk_get of this clock will fail since it does not have this
>> clock.
>>
>> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
>> ---
>>  Documentation/devicetree/bindings/usb/usb-phy.txt |    3 +++
>>  drivers/usb/phy/omap-usb2.c                       |   28 ++++++++++++++++++++-
>>  2 files changed, 30 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/usb/usb-phy.txt b/Documentation/devicetree/bindings/usb/usb-phy.txt
>> index 7c5fd89..d5626de 100644
>> --- a/Documentation/devicetree/bindings/usb/usb-phy.txt
>> +++ b/Documentation/devicetree/bindings/usb/usb-phy.txt
>> @@ -24,6 +24,9 @@ Required properties:
>>  add the address of control module phy power register until a driver for
>>  control module is added
>>  
>> +Optional properties:
>> + - has960mhzclk: should be added if the phy needs 960mhz clock
>> +
>>  This is usually a subnode of ocp2scp to which it is connected.
>>  
>>  usb3phy@4a084400 {
>> diff --git a/drivers/usb/phy/omap-usb2.c b/drivers/usb/phy/omap-usb2.c
>> index d36c282..d6612ba 100644
>> --- a/drivers/usb/phy/omap-usb2.c
>> +++ b/drivers/usb/phy/omap-usb2.c
>> @@ -146,6 +146,7 @@ static int __devinit omap_usb2_probe(struct platform_device *pdev)
>>  	struct omap_usb			*phy;
>>  	struct usb_otg			*otg;
>>  	struct resource			*res;
>> +	struct device_node		*np = pdev->dev.of_node;
>>  
>>  	phy = devm_kzalloc(&pdev->dev, sizeof(*phy), GFP_KERNEL);
>>  	if (!phy) {
>> @@ -190,6 +191,15 @@ static int __devinit omap_usb2_probe(struct platform_device *pdev)
>>  	}
>>  	clk_prepare(phy->wkupclk);
>>  
>> +	if (of_property_read_bool(np, "has960mhzclk")) {
>> +		phy->optclk = devm_clk_get(phy->dev, "usb_otg_ss_refclk960m");
>> +		if (IS_ERR(phy->optclk)) {
>> +			dev_err(&pdev->dev, "unable to get refclk960m\n");
>> +			return PTR_ERR(phy->optclk);
>> +		}
>> +		clk_prepare(phy->optclk);
>> +	}
> 
> instead, can't you just always try to get the clock but ignore the error
> if it fails ?

On imx we add no-op dummy clocks, so that the drivers will always find
all needed clocks. If a clk_get fails it's an error.

> If it works you can set a flag to let you know that you can use that
> optional clock.

Marc
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

  parent reply	other threads:[~2012-09-19 14:45 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-19 11:30 [PATCH 0/4] usb: phy: add usb3 phy driver Kishon Vijay Abraham I
2012-09-19 11:30 ` Kishon Vijay Abraham I
2012-09-19 11:30 ` Kishon Vijay Abraham I
     [not found] ` <1348054229-27362-1-git-send-email-kishon-l0cyMroinI0@public.gmane.org>
2012-09-19 11:30   ` [PATCH 1/4] usb: phy: add a new driver for usb3 phy Kishon Vijay Abraham I
2012-09-19 11:30     ` Kishon Vijay Abraham I
2012-09-19 11:30     ` Kishon Vijay Abraham I
2012-09-19 14:41     ` Marc Kleine-Budde
2012-09-19 14:41       ` Marc Kleine-Budde
2012-09-21  6:08       ` ABRAHAM, KISHON VIJAY
2012-09-21  6:08         ` ABRAHAM, KISHON VIJAY
     [not found]     ` <1348054229-27362-2-git-send-email-kishon-l0cyMroinI0@public.gmane.org>
2012-10-11  0:59       ` Tony Lindgren
2012-10-11  0:59         ` Tony Lindgren
2012-10-11  0:59         ` Tony Lindgren
2012-10-12  9:08         ` kishon
2012-10-12  9:08           ` kishon
2012-10-12  9:08           ` kishon
2012-10-12 15:03           ` Tony Lindgren
2012-10-12 15:03             ` Tony Lindgren
2012-09-19 11:30   ` [PATCH 2/4] usb: dwc3: Fix gadget pullup in SS mode Kishon Vijay Abraham I
2012-09-19 11:30     ` Kishon Vijay Abraham I
2012-09-19 11:30     ` Kishon Vijay Abraham I
2012-09-19 11:53     ` Felipe Balbi
2012-09-19 11:53       ` Felipe Balbi
2012-09-19 15:02       ` Sonasath, Moiz
2012-09-19 15:02         ` Sonasath, Moiz
2012-09-19 16:04         ` Felipe Balbi
2012-09-19 16:04           ` Felipe Balbi
2012-09-19 16:50           ` Sonasath, Moiz
2012-09-19 16:50             ` Sonasath, Moiz
     [not found]             ` <CAEgRx2yXStORBknr2hoMcobMO8wFGuKr4bvzZwEQHQQcHVH76Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-19 17:24               ` Felipe Balbi
2012-09-19 17:24                 ` Felipe Balbi
2012-09-19 17:24                 ` Felipe Balbi
2012-09-19 17:29                 ` Felipe Balbi
2012-09-19 17:29                   ` Felipe Balbi
2012-09-19 11:30   ` [PATCH 3/4] usb: phy: omap-usb3: Decrease the number of transitions to recovery Kishon Vijay Abraham I
2012-09-19 11:30     ` Kishon Vijay Abraham I
2012-09-19 11:30     ` Kishon Vijay Abraham I
2012-09-19 11:55     ` Felipe Balbi
2012-09-19 11:55       ` Felipe Balbi
2012-09-19 11:30 ` [PATCH 4/4] usb: phy: omap-usb2: enable 960Mhz clock for omap5 Kishon Vijay Abraham I
2012-09-19 11:30   ` Kishon Vijay Abraham I
2012-09-19 11:30   ` Kishon Vijay Abraham I
2012-09-19 11:56   ` Felipe Balbi
2012-09-19 11:56     ` Felipe Balbi
     [not found]     ` <20120919115647.GI3772-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2012-09-19 14:45       ` Marc Kleine-Budde [this message]
2012-09-19 14:45         ` Marc Kleine-Budde
2012-09-19 14:45         ` Marc Kleine-Budde
2012-09-19 14:42         ` Felipe Balbi
2012-09-19 14:42           ` Felipe Balbi
2012-09-19 14:50           ` Marc Kleine-Budde
2012-09-19 14:50             ` Marc Kleine-Budde
2012-09-26  5:40       ` ABRAHAM, KISHON VIJAY
2012-09-26  5:40         ` ABRAHAM, KISHON VIJAY
2012-09-26  5:40         ` ABRAHAM, KISHON VIJAY
2012-09-26 18:27         ` Felipe Balbi
2012-09-26 18:27           ` Felipe Balbi
2012-09-27  5:13           ` ABRAHAM, KISHON VIJAY
2012-09-27  5:13             ` ABRAHAM, KISHON VIJAY
2012-09-27  5:13             ` Felipe Balbi
2012-09-27  5:13               ` Felipe Balbi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5059DA6D.4070205@pengutronix.de \
    --to=mkl-bicnvbalz9megne8c9+irq@public.gmane.org \
    --cc=balbi-l0cyMroinI0@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=kishon-l0cyMroinI0@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.