All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] clk: imx: add 'is_prepared' clk_ops callback for pllv3 clk
  2015-11-02 18:06 ` Bai Ping
@ 2015-11-02 10:10   ` Lucas Stach
  -1 siblings, 0 replies; 10+ messages in thread
From: Lucas Stach @ 2015-11-02 10:10 UTC (permalink / raw)
  To: Bai Ping; +Cc: shawnguo, kernel, linux-kernel, linux-arm-kernel

Am Dienstag, den 03.11.2015, 02:06 +0800 schrieb Bai Ping:
> Add 'is_prepared' callback function for pllv3 type clk to make sure when
> the system is bootup, the unused clk is in a known state to match the
> prepare count info.
> 
What does this commit fix?
Is it there to ensure clocks are turned off at the disable unused clocks
phase even if they haven't been prepared even once during bootup?

Regards,
Lucas

> Signed-off-by: Bai Ping <b51503@freescale.com>
> ---
>  drivers/clk/imx/clk-pllv3.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c
> index 6addf8f..c05c43d 100644
> --- a/drivers/clk/imx/clk-pllv3.c
> +++ b/drivers/clk/imx/clk-pllv3.c
> @@ -97,6 +97,16 @@ static void clk_pllv3_unprepare(struct clk_hw *hw)
>  	writel_relaxed(val, pll->base);
>  }
>  
> +static int clk_pllv3_is_prepared(struct clk_hw *hw)
> +{
> +	struct clk_pllv3 *pll = to_clk_pllv3(hw);
> +
> +	if (readl_relaxed(pll->base) & BM_PLL_LOCK)
> +		return 1;
> +
> +	return 0;
> +}
> +
>  static unsigned long clk_pllv3_recalc_rate(struct clk_hw *hw,
>  					   unsigned long parent_rate)
>  {
> @@ -139,6 +149,7 @@ static int clk_pllv3_set_rate(struct clk_hw *hw, unsigned long rate,
>  static const struct clk_ops clk_pllv3_ops = {
>  	.prepare	= clk_pllv3_prepare,
>  	.unprepare	= clk_pllv3_unprepare,
> +	.is_prepared	= clk_pllv3_is_prepared,
>  	.recalc_rate	= clk_pllv3_recalc_rate,
>  	.round_rate	= clk_pllv3_round_rate,
>  	.set_rate	= clk_pllv3_set_rate,
> @@ -193,6 +204,7 @@ static int clk_pllv3_sys_set_rate(struct clk_hw *hw, unsigned long rate,
>  static const struct clk_ops clk_pllv3_sys_ops = {
>  	.prepare	= clk_pllv3_prepare,
>  	.unprepare	= clk_pllv3_unprepare,
> +	.is_prepared	= clk_pllv3_is_prepared,
>  	.recalc_rate	= clk_pllv3_sys_recalc_rate,
>  	.round_rate	= clk_pllv3_sys_round_rate,
>  	.set_rate	= clk_pllv3_sys_set_rate,
> @@ -265,6 +277,7 @@ static int clk_pllv3_av_set_rate(struct clk_hw *hw, unsigned long rate,
>  static const struct clk_ops clk_pllv3_av_ops = {
>  	.prepare	= clk_pllv3_prepare,
>  	.unprepare	= clk_pllv3_unprepare,
> +	.is_prepared	= clk_pllv3_is_prepared,
>  	.recalc_rate	= clk_pllv3_av_recalc_rate,
>  	.round_rate	= clk_pllv3_av_round_rate,
>  	.set_rate	= clk_pllv3_av_set_rate,
> @@ -279,6 +292,7 @@ static unsigned long clk_pllv3_enet_recalc_rate(struct clk_hw *hw,
>  static const struct clk_ops clk_pllv3_enet_ops = {
>  	.prepare	= clk_pllv3_prepare,
>  	.unprepare	= clk_pllv3_unprepare,
> +	.is_prepared	= clk_pllv3_is_prepared,
>  	.recalc_rate	= clk_pllv3_enet_recalc_rate,
>  };
>  

-- 
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |


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

* [PATCH] clk: imx: add 'is_prepared' clk_ops callback for pllv3 clk
@ 2015-11-02 10:10   ` Lucas Stach
  0 siblings, 0 replies; 10+ messages in thread
From: Lucas Stach @ 2015-11-02 10:10 UTC (permalink / raw)
  To: linux-arm-kernel

Am Dienstag, den 03.11.2015, 02:06 +0800 schrieb Bai Ping:
> Add 'is_prepared' callback function for pllv3 type clk to make sure when
> the system is bootup, the unused clk is in a known state to match the
> prepare count info.
> 
What does this commit fix?
Is it there to ensure clocks are turned off at the disable unused clocks
phase even if they haven't been prepared even once during bootup?

Regards,
Lucas

> Signed-off-by: Bai Ping <b51503@freescale.com>
> ---
>  drivers/clk/imx/clk-pllv3.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c
> index 6addf8f..c05c43d 100644
> --- a/drivers/clk/imx/clk-pllv3.c
> +++ b/drivers/clk/imx/clk-pllv3.c
> @@ -97,6 +97,16 @@ static void clk_pllv3_unprepare(struct clk_hw *hw)
>  	writel_relaxed(val, pll->base);
>  }
>  
> +static int clk_pllv3_is_prepared(struct clk_hw *hw)
> +{
> +	struct clk_pllv3 *pll = to_clk_pllv3(hw);
> +
> +	if (readl_relaxed(pll->base) & BM_PLL_LOCK)
> +		return 1;
> +
> +	return 0;
> +}
> +
>  static unsigned long clk_pllv3_recalc_rate(struct clk_hw *hw,
>  					   unsigned long parent_rate)
>  {
> @@ -139,6 +149,7 @@ static int clk_pllv3_set_rate(struct clk_hw *hw, unsigned long rate,
>  static const struct clk_ops clk_pllv3_ops = {
>  	.prepare	= clk_pllv3_prepare,
>  	.unprepare	= clk_pllv3_unprepare,
> +	.is_prepared	= clk_pllv3_is_prepared,
>  	.recalc_rate	= clk_pllv3_recalc_rate,
>  	.round_rate	= clk_pllv3_round_rate,
>  	.set_rate	= clk_pllv3_set_rate,
> @@ -193,6 +204,7 @@ static int clk_pllv3_sys_set_rate(struct clk_hw *hw, unsigned long rate,
>  static const struct clk_ops clk_pllv3_sys_ops = {
>  	.prepare	= clk_pllv3_prepare,
>  	.unprepare	= clk_pllv3_unprepare,
> +	.is_prepared	= clk_pllv3_is_prepared,
>  	.recalc_rate	= clk_pllv3_sys_recalc_rate,
>  	.round_rate	= clk_pllv3_sys_round_rate,
>  	.set_rate	= clk_pllv3_sys_set_rate,
> @@ -265,6 +277,7 @@ static int clk_pllv3_av_set_rate(struct clk_hw *hw, unsigned long rate,
>  static const struct clk_ops clk_pllv3_av_ops = {
>  	.prepare	= clk_pllv3_prepare,
>  	.unprepare	= clk_pllv3_unprepare,
> +	.is_prepared	= clk_pllv3_is_prepared,
>  	.recalc_rate	= clk_pllv3_av_recalc_rate,
>  	.round_rate	= clk_pllv3_av_round_rate,
>  	.set_rate	= clk_pllv3_av_set_rate,
> @@ -279,6 +292,7 @@ static unsigned long clk_pllv3_enet_recalc_rate(struct clk_hw *hw,
>  static const struct clk_ops clk_pllv3_enet_ops = {
>  	.prepare	= clk_pllv3_prepare,
>  	.unprepare	= clk_pllv3_unprepare,
> +	.is_prepared	= clk_pllv3_is_prepared,
>  	.recalc_rate	= clk_pllv3_enet_recalc_rate,
>  };
>  

-- 
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |

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

* [PATCH] clk: imx: add 'is_prepared' clk_ops callback for pllv3 clk
@ 2015-11-02 18:06 ` Bai Ping
  0 siblings, 0 replies; 10+ messages in thread
From: Bai Ping @ 2015-11-02 18:06 UTC (permalink / raw)
  To: shawnguo, kernel; +Cc: linux-arm-kernel, linux-kernel

Add 'is_prepared' callback function for pllv3 type clk to make sure when
the system is bootup, the unused clk is in a known state to match the
prepare count info.

Signed-off-by: Bai Ping <b51503@freescale.com>
---
 drivers/clk/imx/clk-pllv3.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c
index 6addf8f..c05c43d 100644
--- a/drivers/clk/imx/clk-pllv3.c
+++ b/drivers/clk/imx/clk-pllv3.c
@@ -97,6 +97,16 @@ static void clk_pllv3_unprepare(struct clk_hw *hw)
 	writel_relaxed(val, pll->base);
 }
 
+static int clk_pllv3_is_prepared(struct clk_hw *hw)
+{
+	struct clk_pllv3 *pll = to_clk_pllv3(hw);
+
+	if (readl_relaxed(pll->base) & BM_PLL_LOCK)
+		return 1;
+
+	return 0;
+}
+
 static unsigned long clk_pllv3_recalc_rate(struct clk_hw *hw,
 					   unsigned long parent_rate)
 {
@@ -139,6 +149,7 @@ static int clk_pllv3_set_rate(struct clk_hw *hw, unsigned long rate,
 static const struct clk_ops clk_pllv3_ops = {
 	.prepare	= clk_pllv3_prepare,
 	.unprepare	= clk_pllv3_unprepare,
+	.is_prepared	= clk_pllv3_is_prepared,
 	.recalc_rate	= clk_pllv3_recalc_rate,
 	.round_rate	= clk_pllv3_round_rate,
 	.set_rate	= clk_pllv3_set_rate,
@@ -193,6 +204,7 @@ static int clk_pllv3_sys_set_rate(struct clk_hw *hw, unsigned long rate,
 static const struct clk_ops clk_pllv3_sys_ops = {
 	.prepare	= clk_pllv3_prepare,
 	.unprepare	= clk_pllv3_unprepare,
+	.is_prepared	= clk_pllv3_is_prepared,
 	.recalc_rate	= clk_pllv3_sys_recalc_rate,
 	.round_rate	= clk_pllv3_sys_round_rate,
 	.set_rate	= clk_pllv3_sys_set_rate,
@@ -265,6 +277,7 @@ static int clk_pllv3_av_set_rate(struct clk_hw *hw, unsigned long rate,
 static const struct clk_ops clk_pllv3_av_ops = {
 	.prepare	= clk_pllv3_prepare,
 	.unprepare	= clk_pllv3_unprepare,
+	.is_prepared	= clk_pllv3_is_prepared,
 	.recalc_rate	= clk_pllv3_av_recalc_rate,
 	.round_rate	= clk_pllv3_av_round_rate,
 	.set_rate	= clk_pllv3_av_set_rate,
@@ -279,6 +292,7 @@ static unsigned long clk_pllv3_enet_recalc_rate(struct clk_hw *hw,
 static const struct clk_ops clk_pllv3_enet_ops = {
 	.prepare	= clk_pllv3_prepare,
 	.unprepare	= clk_pllv3_unprepare,
+	.is_prepared	= clk_pllv3_is_prepared,
 	.recalc_rate	= clk_pllv3_enet_recalc_rate,
 };
 
-- 
1.9.1


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

* [PATCH] clk: imx: add 'is_prepared' clk_ops callback for pllv3 clk
@ 2015-11-02 18:06 ` Bai Ping
  0 siblings, 0 replies; 10+ messages in thread
From: Bai Ping @ 2015-11-02 18:06 UTC (permalink / raw)
  To: linux-arm-kernel

Add 'is_prepared' callback function for pllv3 type clk to make sure when
the system is bootup, the unused clk is in a known state to match the
prepare count info.

Signed-off-by: Bai Ping <b51503@freescale.com>
---
 drivers/clk/imx/clk-pllv3.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c
index 6addf8f..c05c43d 100644
--- a/drivers/clk/imx/clk-pllv3.c
+++ b/drivers/clk/imx/clk-pllv3.c
@@ -97,6 +97,16 @@ static void clk_pllv3_unprepare(struct clk_hw *hw)
 	writel_relaxed(val, pll->base);
 }
 
+static int clk_pllv3_is_prepared(struct clk_hw *hw)
+{
+	struct clk_pllv3 *pll = to_clk_pllv3(hw);
+
+	if (readl_relaxed(pll->base) & BM_PLL_LOCK)
+		return 1;
+
+	return 0;
+}
+
 static unsigned long clk_pllv3_recalc_rate(struct clk_hw *hw,
 					   unsigned long parent_rate)
 {
@@ -139,6 +149,7 @@ static int clk_pllv3_set_rate(struct clk_hw *hw, unsigned long rate,
 static const struct clk_ops clk_pllv3_ops = {
 	.prepare	= clk_pllv3_prepare,
 	.unprepare	= clk_pllv3_unprepare,
+	.is_prepared	= clk_pllv3_is_prepared,
 	.recalc_rate	= clk_pllv3_recalc_rate,
 	.round_rate	= clk_pllv3_round_rate,
 	.set_rate	= clk_pllv3_set_rate,
@@ -193,6 +204,7 @@ static int clk_pllv3_sys_set_rate(struct clk_hw *hw, unsigned long rate,
 static const struct clk_ops clk_pllv3_sys_ops = {
 	.prepare	= clk_pllv3_prepare,
 	.unprepare	= clk_pllv3_unprepare,
+	.is_prepared	= clk_pllv3_is_prepared,
 	.recalc_rate	= clk_pllv3_sys_recalc_rate,
 	.round_rate	= clk_pllv3_sys_round_rate,
 	.set_rate	= clk_pllv3_sys_set_rate,
@@ -265,6 +277,7 @@ static int clk_pllv3_av_set_rate(struct clk_hw *hw, unsigned long rate,
 static const struct clk_ops clk_pllv3_av_ops = {
 	.prepare	= clk_pllv3_prepare,
 	.unprepare	= clk_pllv3_unprepare,
+	.is_prepared	= clk_pllv3_is_prepared,
 	.recalc_rate	= clk_pllv3_av_recalc_rate,
 	.round_rate	= clk_pllv3_av_round_rate,
 	.set_rate	= clk_pllv3_av_set_rate,
@@ -279,6 +292,7 @@ static unsigned long clk_pllv3_enet_recalc_rate(struct clk_hw *hw,
 static const struct clk_ops clk_pllv3_enet_ops = {
 	.prepare	= clk_pllv3_prepare,
 	.unprepare	= clk_pllv3_unprepare,
+	.is_prepared	= clk_pllv3_is_prepared,
 	.recalc_rate	= clk_pllv3_enet_recalc_rate,
 };
 
-- 
1.9.1

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

* Re: [PATCH] clk: imx: add 'is_prepared' clk_ops callback for pllv3 clk
  2015-11-02 10:10   ` Lucas Stach
@ 2015-11-10  9:59     ` Bai Ping
  -1 siblings, 0 replies; 10+ messages in thread
From: Bai Ping @ 2015-11-10  9:59 UTC (permalink / raw)
  To: Lucas Stach; +Cc: shawnguo, kernel, linux-kernel, linux-arm-kernel



On 2015/11/2 18:10, Lucas Stach wrote:
> Am Dienstag, den 03.11.2015, 02:06 +0800 schrieb Bai Ping:
>> Add 'is_prepared' callback function for pllv3 type clk to make sure when
>> the system is bootup, the unused clk is in a known state to match the
>> prepare count info.
>>
> What does this commit fix?
> Is it there to ensure clocks are turned off at the disable unused clocks
> phase even if they haven't been prepared even once during bootup?

I am sorry for replay  you so later, it seem I missed this mail before.  
yeah, this commit
just to make sure the PLLs that are not been prepared can be turned off. 
sometimes,
the bootloader may turn on the PLL(take video PLL as example) for use, 
but when the
kernel bootup, the prepare count for the PLL clock is zero, but actually 
the PLL is powered on.
so adding the "is_prepared" ops to turn off the unused PLL to save power.

BR
Jacky Bai
>
> Regards,
> Lucas
>
>> Signed-off-by: Bai Ping <b51503@freescale.com>
>> ---
>>   drivers/clk/imx/clk-pllv3.c | 14 ++++++++++++++
>>   1 file changed, 14 insertions(+)
>>
>> diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c
>> index 6addf8f..c05c43d 100644
>> --- a/drivers/clk/imx/clk-pllv3.c
>> +++ b/drivers/clk/imx/clk-pllv3.c
>> @@ -97,6 +97,16 @@ static void clk_pllv3_unprepare(struct clk_hw *hw)
>>   	writel_relaxed(val, pll->base);
>>   }
>>   
>> +static int clk_pllv3_is_prepared(struct clk_hw *hw)
>> +{
>> +	struct clk_pllv3 *pll = to_clk_pllv3(hw);
>> +
>> +	if (readl_relaxed(pll->base) & BM_PLL_LOCK)
>> +		return 1;
>> +
>> +	return 0;
>> +}
>> +
>>   static unsigned long clk_pllv3_recalc_rate(struct clk_hw *hw,
>>   					   unsigned long parent_rate)
>>   {
>> @@ -139,6 +149,7 @@ static int clk_pllv3_set_rate(struct clk_hw *hw, unsigned long rate,
>>   static const struct clk_ops clk_pllv3_ops = {
>>   	.prepare	= clk_pllv3_prepare,
>>   	.unprepare	= clk_pllv3_unprepare,
>> +	.is_prepared	= clk_pllv3_is_prepared,
>>   	.recalc_rate	= clk_pllv3_recalc_rate,
>>   	.round_rate	= clk_pllv3_round_rate,
>>   	.set_rate	= clk_pllv3_set_rate,
>> @@ -193,6 +204,7 @@ static int clk_pllv3_sys_set_rate(struct clk_hw *hw, unsigned long rate,
>>   static const struct clk_ops clk_pllv3_sys_ops = {
>>   	.prepare	= clk_pllv3_prepare,
>>   	.unprepare	= clk_pllv3_unprepare,
>> +	.is_prepared	= clk_pllv3_is_prepared,
>>   	.recalc_rate	= clk_pllv3_sys_recalc_rate,
>>   	.round_rate	= clk_pllv3_sys_round_rate,
>>   	.set_rate	= clk_pllv3_sys_set_rate,
>> @@ -265,6 +277,7 @@ static int clk_pllv3_av_set_rate(struct clk_hw *hw, unsigned long rate,
>>   static const struct clk_ops clk_pllv3_av_ops = {
>>   	.prepare	= clk_pllv3_prepare,
>>   	.unprepare	= clk_pllv3_unprepare,
>> +	.is_prepared	= clk_pllv3_is_prepared,
>>   	.recalc_rate	= clk_pllv3_av_recalc_rate,
>>   	.round_rate	= clk_pllv3_av_round_rate,
>>   	.set_rate	= clk_pllv3_av_set_rate,
>> @@ -279,6 +292,7 @@ static unsigned long clk_pllv3_enet_recalc_rate(struct clk_hw *hw,
>>   static const struct clk_ops clk_pllv3_enet_ops = {
>>   	.prepare	= clk_pllv3_prepare,
>>   	.unprepare	= clk_pllv3_unprepare,
>> +	.is_prepared	= clk_pllv3_is_prepared,
>>   	.recalc_rate	= clk_pllv3_enet_recalc_rate,
>>   };
>>   


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

* [PATCH] clk: imx: add 'is_prepared' clk_ops callback for pllv3 clk
@ 2015-11-10  9:59     ` Bai Ping
  0 siblings, 0 replies; 10+ messages in thread
From: Bai Ping @ 2015-11-10  9:59 UTC (permalink / raw)
  To: linux-arm-kernel



On 2015/11/2 18:10, Lucas Stach wrote:
> Am Dienstag, den 03.11.2015, 02:06 +0800 schrieb Bai Ping:
>> Add 'is_prepared' callback function for pllv3 type clk to make sure when
>> the system is bootup, the unused clk is in a known state to match the
>> prepare count info.
>>
> What does this commit fix?
> Is it there to ensure clocks are turned off at the disable unused clocks
> phase even if they haven't been prepared even once during bootup?

I am sorry for replay  you so later, it seem I missed this mail before.  
yeah, this commit
just to make sure the PLLs that are not been prepared can be turned off. 
sometimes,
the bootloader may turn on the PLL(take video PLL as example) for use, 
but when the
kernel bootup, the prepare count for the PLL clock is zero, but actually 
the PLL is powered on.
so adding the "is_prepared" ops to turn off the unused PLL to save power.

BR
Jacky Bai
>
> Regards,
> Lucas
>
>> Signed-off-by: Bai Ping <b51503@freescale.com>
>> ---
>>   drivers/clk/imx/clk-pllv3.c | 14 ++++++++++++++
>>   1 file changed, 14 insertions(+)
>>
>> diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c
>> index 6addf8f..c05c43d 100644
>> --- a/drivers/clk/imx/clk-pllv3.c
>> +++ b/drivers/clk/imx/clk-pllv3.c
>> @@ -97,6 +97,16 @@ static void clk_pllv3_unprepare(struct clk_hw *hw)
>>   	writel_relaxed(val, pll->base);
>>   }
>>   
>> +static int clk_pllv3_is_prepared(struct clk_hw *hw)
>> +{
>> +	struct clk_pllv3 *pll = to_clk_pllv3(hw);
>> +
>> +	if (readl_relaxed(pll->base) & BM_PLL_LOCK)
>> +		return 1;
>> +
>> +	return 0;
>> +}
>> +
>>   static unsigned long clk_pllv3_recalc_rate(struct clk_hw *hw,
>>   					   unsigned long parent_rate)
>>   {
>> @@ -139,6 +149,7 @@ static int clk_pllv3_set_rate(struct clk_hw *hw, unsigned long rate,
>>   static const struct clk_ops clk_pllv3_ops = {
>>   	.prepare	= clk_pllv3_prepare,
>>   	.unprepare	= clk_pllv3_unprepare,
>> +	.is_prepared	= clk_pllv3_is_prepared,
>>   	.recalc_rate	= clk_pllv3_recalc_rate,
>>   	.round_rate	= clk_pllv3_round_rate,
>>   	.set_rate	= clk_pllv3_set_rate,
>> @@ -193,6 +204,7 @@ static int clk_pllv3_sys_set_rate(struct clk_hw *hw, unsigned long rate,
>>   static const struct clk_ops clk_pllv3_sys_ops = {
>>   	.prepare	= clk_pllv3_prepare,
>>   	.unprepare	= clk_pllv3_unprepare,
>> +	.is_prepared	= clk_pllv3_is_prepared,
>>   	.recalc_rate	= clk_pllv3_sys_recalc_rate,
>>   	.round_rate	= clk_pllv3_sys_round_rate,
>>   	.set_rate	= clk_pllv3_sys_set_rate,
>> @@ -265,6 +277,7 @@ static int clk_pllv3_av_set_rate(struct clk_hw *hw, unsigned long rate,
>>   static const struct clk_ops clk_pllv3_av_ops = {
>>   	.prepare	= clk_pllv3_prepare,
>>   	.unprepare	= clk_pllv3_unprepare,
>> +	.is_prepared	= clk_pllv3_is_prepared,
>>   	.recalc_rate	= clk_pllv3_av_recalc_rate,
>>   	.round_rate	= clk_pllv3_av_round_rate,
>>   	.set_rate	= clk_pllv3_av_set_rate,
>> @@ -279,6 +292,7 @@ static unsigned long clk_pllv3_enet_recalc_rate(struct clk_hw *hw,
>>   static const struct clk_ops clk_pllv3_enet_ops = {
>>   	.prepare	= clk_pllv3_prepare,
>>   	.unprepare	= clk_pllv3_unprepare,
>> +	.is_prepared	= clk_pllv3_is_prepared,
>>   	.recalc_rate	= clk_pllv3_enet_recalc_rate,
>>   };
>>   

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

* Re: [PATCH] clk: imx: add 'is_prepared' clk_ops callback for pllv3 clk
  2015-11-02 18:06 ` Bai Ping
@ 2015-11-10 10:11   ` Lucas Stach
  -1 siblings, 0 replies; 10+ messages in thread
From: Lucas Stach @ 2015-11-10 10:11 UTC (permalink / raw)
  To: Bai Ping; +Cc: shawnguo, kernel, linux-kernel, linux-arm-kernel

Am Dienstag, den 03.11.2015, 02:06 +0800 schrieb Bai Ping:
> Add 'is_prepared' callback function for pllv3 type clk to make sure when
> the system is bootup, the unused clk is in a known state to match the
> prepare count info.
> 
> Signed-off-by: Bai Ping <b51503@freescale.com>

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>

> ---
>  drivers/clk/imx/clk-pllv3.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c
> index 6addf8f..c05c43d 100644
> --- a/drivers/clk/imx/clk-pllv3.c
> +++ b/drivers/clk/imx/clk-pllv3.c
> @@ -97,6 +97,16 @@ static void clk_pllv3_unprepare(struct clk_hw *hw)
>  	writel_relaxed(val, pll->base);
>  }
>  
> +static int clk_pllv3_is_prepared(struct clk_hw *hw)
> +{
> +	struct clk_pllv3 *pll = to_clk_pllv3(hw);
> +
> +	if (readl_relaxed(pll->base) & BM_PLL_LOCK)
> +		return 1;
> +
> +	return 0;
> +}
> +
>  static unsigned long clk_pllv3_recalc_rate(struct clk_hw *hw,
>  					   unsigned long parent_rate)
>  {
> @@ -139,6 +149,7 @@ static int clk_pllv3_set_rate(struct clk_hw *hw, unsigned long rate,
>  static const struct clk_ops clk_pllv3_ops = {
>  	.prepare	= clk_pllv3_prepare,
>  	.unprepare	= clk_pllv3_unprepare,
> +	.is_prepared	= clk_pllv3_is_prepared,
>  	.recalc_rate	= clk_pllv3_recalc_rate,
>  	.round_rate	= clk_pllv3_round_rate,
>  	.set_rate	= clk_pllv3_set_rate,
> @@ -193,6 +204,7 @@ static int clk_pllv3_sys_set_rate(struct clk_hw *hw, unsigned long rate,
>  static const struct clk_ops clk_pllv3_sys_ops = {
>  	.prepare	= clk_pllv3_prepare,
>  	.unprepare	= clk_pllv3_unprepare,
> +	.is_prepared	= clk_pllv3_is_prepared,
>  	.recalc_rate	= clk_pllv3_sys_recalc_rate,
>  	.round_rate	= clk_pllv3_sys_round_rate,
>  	.set_rate	= clk_pllv3_sys_set_rate,
> @@ -265,6 +277,7 @@ static int clk_pllv3_av_set_rate(struct clk_hw *hw, unsigned long rate,
>  static const struct clk_ops clk_pllv3_av_ops = {
>  	.prepare	= clk_pllv3_prepare,
>  	.unprepare	= clk_pllv3_unprepare,
> +	.is_prepared	= clk_pllv3_is_prepared,
>  	.recalc_rate	= clk_pllv3_av_recalc_rate,
>  	.round_rate	= clk_pllv3_av_round_rate,
>  	.set_rate	= clk_pllv3_av_set_rate,
> @@ -279,6 +292,7 @@ static unsigned long clk_pllv3_enet_recalc_rate(struct clk_hw *hw,
>  static const struct clk_ops clk_pllv3_enet_ops = {
>  	.prepare	= clk_pllv3_prepare,
>  	.unprepare	= clk_pllv3_unprepare,
> +	.is_prepared	= clk_pllv3_is_prepared,
>  	.recalc_rate	= clk_pllv3_enet_recalc_rate,
>  };
>  

-- 
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |


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

* [PATCH] clk: imx: add 'is_prepared' clk_ops callback for pllv3 clk
@ 2015-11-10 10:11   ` Lucas Stach
  0 siblings, 0 replies; 10+ messages in thread
From: Lucas Stach @ 2015-11-10 10:11 UTC (permalink / raw)
  To: linux-arm-kernel

Am Dienstag, den 03.11.2015, 02:06 +0800 schrieb Bai Ping:
> Add 'is_prepared' callback function for pllv3 type clk to make sure when
> the system is bootup, the unused clk is in a known state to match the
> prepare count info.
> 
> Signed-off-by: Bai Ping <b51503@freescale.com>

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>

> ---
>  drivers/clk/imx/clk-pllv3.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c
> index 6addf8f..c05c43d 100644
> --- a/drivers/clk/imx/clk-pllv3.c
> +++ b/drivers/clk/imx/clk-pllv3.c
> @@ -97,6 +97,16 @@ static void clk_pllv3_unprepare(struct clk_hw *hw)
>  	writel_relaxed(val, pll->base);
>  }
>  
> +static int clk_pllv3_is_prepared(struct clk_hw *hw)
> +{
> +	struct clk_pllv3 *pll = to_clk_pllv3(hw);
> +
> +	if (readl_relaxed(pll->base) & BM_PLL_LOCK)
> +		return 1;
> +
> +	return 0;
> +}
> +
>  static unsigned long clk_pllv3_recalc_rate(struct clk_hw *hw,
>  					   unsigned long parent_rate)
>  {
> @@ -139,6 +149,7 @@ static int clk_pllv3_set_rate(struct clk_hw *hw, unsigned long rate,
>  static const struct clk_ops clk_pllv3_ops = {
>  	.prepare	= clk_pllv3_prepare,
>  	.unprepare	= clk_pllv3_unprepare,
> +	.is_prepared	= clk_pllv3_is_prepared,
>  	.recalc_rate	= clk_pllv3_recalc_rate,
>  	.round_rate	= clk_pllv3_round_rate,
>  	.set_rate	= clk_pllv3_set_rate,
> @@ -193,6 +204,7 @@ static int clk_pllv3_sys_set_rate(struct clk_hw *hw, unsigned long rate,
>  static const struct clk_ops clk_pllv3_sys_ops = {
>  	.prepare	= clk_pllv3_prepare,
>  	.unprepare	= clk_pllv3_unprepare,
> +	.is_prepared	= clk_pllv3_is_prepared,
>  	.recalc_rate	= clk_pllv3_sys_recalc_rate,
>  	.round_rate	= clk_pllv3_sys_round_rate,
>  	.set_rate	= clk_pllv3_sys_set_rate,
> @@ -265,6 +277,7 @@ static int clk_pllv3_av_set_rate(struct clk_hw *hw, unsigned long rate,
>  static const struct clk_ops clk_pllv3_av_ops = {
>  	.prepare	= clk_pllv3_prepare,
>  	.unprepare	= clk_pllv3_unprepare,
> +	.is_prepared	= clk_pllv3_is_prepared,
>  	.recalc_rate	= clk_pllv3_av_recalc_rate,
>  	.round_rate	= clk_pllv3_av_round_rate,
>  	.set_rate	= clk_pllv3_av_set_rate,
> @@ -279,6 +292,7 @@ static unsigned long clk_pllv3_enet_recalc_rate(struct clk_hw *hw,
>  static const struct clk_ops clk_pllv3_enet_ops = {
>  	.prepare	= clk_pllv3_prepare,
>  	.unprepare	= clk_pllv3_unprepare,
> +	.is_prepared	= clk_pllv3_is_prepared,
>  	.recalc_rate	= clk_pllv3_enet_recalc_rate,
>  };
>  

-- 
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |

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

* Re: [PATCH] clk: imx: add 'is_prepared' clk_ops callback for pllv3 clk
  2015-11-02 18:06 ` Bai Ping
@ 2015-11-24  6:39   ` Shawn Guo
  -1 siblings, 0 replies; 10+ messages in thread
From: Shawn Guo @ 2015-11-24  6:39 UTC (permalink / raw)
  To: Bai Ping; +Cc: kernel, linux-kernel, linux-arm-kernel

On Tue, Nov 03, 2015 at 02:06:09AM +0800, Bai Ping wrote:
> Add 'is_prepared' callback function for pllv3 type clk to make sure when
> the system is bootup, the unused clk is in a known state to match the
> prepare count info.
> 
> Signed-off-by: Bai Ping <b51503@freescale.com>

Please resend the patch with following clk maintainers and list on copy.
Also remember to add Lucas' Reviewed-by: tag.

COMMON CLK FRAMEWORK
M:      Michael Turquette <mturquette@baylibre.com>
M:      Stephen Boyd <sboyd@codeaurora.org>
L:      linux-clk@vger.kernel.org

Shawn

> ---
>  drivers/clk/imx/clk-pllv3.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c
> index 6addf8f..c05c43d 100644
> --- a/drivers/clk/imx/clk-pllv3.c
> +++ b/drivers/clk/imx/clk-pllv3.c
> @@ -97,6 +97,16 @@ static void clk_pllv3_unprepare(struct clk_hw *hw)
>  	writel_relaxed(val, pll->base);
>  }
>  
> +static int clk_pllv3_is_prepared(struct clk_hw *hw)
> +{
> +	struct clk_pllv3 *pll = to_clk_pllv3(hw);
> +
> +	if (readl_relaxed(pll->base) & BM_PLL_LOCK)
> +		return 1;
> +
> +	return 0;
> +}
> +
>  static unsigned long clk_pllv3_recalc_rate(struct clk_hw *hw,
>  					   unsigned long parent_rate)
>  {
> @@ -139,6 +149,7 @@ static int clk_pllv3_set_rate(struct clk_hw *hw, unsigned long rate,
>  static const struct clk_ops clk_pllv3_ops = {
>  	.prepare	= clk_pllv3_prepare,
>  	.unprepare	= clk_pllv3_unprepare,
> +	.is_prepared	= clk_pllv3_is_prepared,
>  	.recalc_rate	= clk_pllv3_recalc_rate,
>  	.round_rate	= clk_pllv3_round_rate,
>  	.set_rate	= clk_pllv3_set_rate,
> @@ -193,6 +204,7 @@ static int clk_pllv3_sys_set_rate(struct clk_hw *hw, unsigned long rate,
>  static const struct clk_ops clk_pllv3_sys_ops = {
>  	.prepare	= clk_pllv3_prepare,
>  	.unprepare	= clk_pllv3_unprepare,
> +	.is_prepared	= clk_pllv3_is_prepared,
>  	.recalc_rate	= clk_pllv3_sys_recalc_rate,
>  	.round_rate	= clk_pllv3_sys_round_rate,
>  	.set_rate	= clk_pllv3_sys_set_rate,
> @@ -265,6 +277,7 @@ static int clk_pllv3_av_set_rate(struct clk_hw *hw, unsigned long rate,
>  static const struct clk_ops clk_pllv3_av_ops = {
>  	.prepare	= clk_pllv3_prepare,
>  	.unprepare	= clk_pllv3_unprepare,
> +	.is_prepared	= clk_pllv3_is_prepared,
>  	.recalc_rate	= clk_pllv3_av_recalc_rate,
>  	.round_rate	= clk_pllv3_av_round_rate,
>  	.set_rate	= clk_pllv3_av_set_rate,
> @@ -279,6 +292,7 @@ static unsigned long clk_pllv3_enet_recalc_rate(struct clk_hw *hw,
>  static const struct clk_ops clk_pllv3_enet_ops = {
>  	.prepare	= clk_pllv3_prepare,
>  	.unprepare	= clk_pllv3_unprepare,
> +	.is_prepared	= clk_pllv3_is_prepared,
>  	.recalc_rate	= clk_pllv3_enet_recalc_rate,
>  };
>  
> -- 
> 1.9.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

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

* [PATCH] clk: imx: add 'is_prepared' clk_ops callback for pllv3 clk
@ 2015-11-24  6:39   ` Shawn Guo
  0 siblings, 0 replies; 10+ messages in thread
From: Shawn Guo @ 2015-11-24  6:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 03, 2015 at 02:06:09AM +0800, Bai Ping wrote:
> Add 'is_prepared' callback function for pllv3 type clk to make sure when
> the system is bootup, the unused clk is in a known state to match the
> prepare count info.
> 
> Signed-off-by: Bai Ping <b51503@freescale.com>

Please resend the patch with following clk maintainers and list on copy.
Also remember to add Lucas' Reviewed-by: tag.

COMMON CLK FRAMEWORK
M:      Michael Turquette <mturquette@baylibre.com>
M:      Stephen Boyd <sboyd@codeaurora.org>
L:      linux-clk at vger.kernel.org

Shawn

> ---
>  drivers/clk/imx/clk-pllv3.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c
> index 6addf8f..c05c43d 100644
> --- a/drivers/clk/imx/clk-pllv3.c
> +++ b/drivers/clk/imx/clk-pllv3.c
> @@ -97,6 +97,16 @@ static void clk_pllv3_unprepare(struct clk_hw *hw)
>  	writel_relaxed(val, pll->base);
>  }
>  
> +static int clk_pllv3_is_prepared(struct clk_hw *hw)
> +{
> +	struct clk_pllv3 *pll = to_clk_pllv3(hw);
> +
> +	if (readl_relaxed(pll->base) & BM_PLL_LOCK)
> +		return 1;
> +
> +	return 0;
> +}
> +
>  static unsigned long clk_pllv3_recalc_rate(struct clk_hw *hw,
>  					   unsigned long parent_rate)
>  {
> @@ -139,6 +149,7 @@ static int clk_pllv3_set_rate(struct clk_hw *hw, unsigned long rate,
>  static const struct clk_ops clk_pllv3_ops = {
>  	.prepare	= clk_pllv3_prepare,
>  	.unprepare	= clk_pllv3_unprepare,
> +	.is_prepared	= clk_pllv3_is_prepared,
>  	.recalc_rate	= clk_pllv3_recalc_rate,
>  	.round_rate	= clk_pllv3_round_rate,
>  	.set_rate	= clk_pllv3_set_rate,
> @@ -193,6 +204,7 @@ static int clk_pllv3_sys_set_rate(struct clk_hw *hw, unsigned long rate,
>  static const struct clk_ops clk_pllv3_sys_ops = {
>  	.prepare	= clk_pllv3_prepare,
>  	.unprepare	= clk_pllv3_unprepare,
> +	.is_prepared	= clk_pllv3_is_prepared,
>  	.recalc_rate	= clk_pllv3_sys_recalc_rate,
>  	.round_rate	= clk_pllv3_sys_round_rate,
>  	.set_rate	= clk_pllv3_sys_set_rate,
> @@ -265,6 +277,7 @@ static int clk_pllv3_av_set_rate(struct clk_hw *hw, unsigned long rate,
>  static const struct clk_ops clk_pllv3_av_ops = {
>  	.prepare	= clk_pllv3_prepare,
>  	.unprepare	= clk_pllv3_unprepare,
> +	.is_prepared	= clk_pllv3_is_prepared,
>  	.recalc_rate	= clk_pllv3_av_recalc_rate,
>  	.round_rate	= clk_pllv3_av_round_rate,
>  	.set_rate	= clk_pllv3_av_set_rate,
> @@ -279,6 +292,7 @@ static unsigned long clk_pllv3_enet_recalc_rate(struct clk_hw *hw,
>  static const struct clk_ops clk_pllv3_enet_ops = {
>  	.prepare	= clk_pllv3_prepare,
>  	.unprepare	= clk_pllv3_unprepare,
> +	.is_prepared	= clk_pllv3_is_prepared,
>  	.recalc_rate	= clk_pllv3_enet_recalc_rate,
>  };
>  
> -- 
> 1.9.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

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

end of thread, other threads:[~2015-11-24  6:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-02 18:06 [PATCH] clk: imx: add 'is_prepared' clk_ops callback for pllv3 clk Bai Ping
2015-11-02 18:06 ` Bai Ping
2015-11-02 10:10 ` Lucas Stach
2015-11-02 10:10   ` Lucas Stach
2015-11-10  9:59   ` Bai Ping
2015-11-10  9:59     ` Bai Ping
2015-11-10 10:11 ` Lucas Stach
2015-11-10 10:11   ` Lucas Stach
2015-11-24  6:39 ` Shawn Guo
2015-11-24  6:39   ` Shawn Guo

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.