linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] firmware: ti_sci: allow frequency change for disabled clocks by default
@ 2020-09-07 11:03 Tero Kristo
  2020-09-07 11:56 ` Nishanth Menon
  0 siblings, 1 reply; 2+ messages in thread
From: Tero Kristo @ 2020-09-07 11:03 UTC (permalink / raw)
  To: nm, ssantosh, linux-arm-kernel; +Cc: linux-kernel

If a clock is disabled, its frequency should be allowed to change as
it is no longer in use. Add a flag towards this to the firmware clock
API handler routines.

Tested-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 drivers/firmware/ti_sci.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
index 53cee17d0115..39890665a975 100644
--- a/drivers/firmware/ti_sci.c
+++ b/drivers/firmware/ti_sci.c
@@ -1124,7 +1124,8 @@ static int ti_sci_cmd_get_clock(const struct ti_sci_handle *handle, u32 dev_id,
 static int ti_sci_cmd_idle_clock(const struct ti_sci_handle *handle,
 				 u32 dev_id, u32 clk_id)
 {
-	return ti_sci_set_clock_state(handle, dev_id, clk_id, 0,
+	return ti_sci_set_clock_state(handle, dev_id, clk_id,
+				      MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE,
 				      MSG_CLOCK_SW_STATE_UNREQ);
 }
 
@@ -1143,7 +1144,8 @@ static int ti_sci_cmd_idle_clock(const struct ti_sci_handle *handle,
 static int ti_sci_cmd_put_clock(const struct ti_sci_handle *handle,
 				u32 dev_id, u32 clk_id)
 {
-	return ti_sci_set_clock_state(handle, dev_id, clk_id, 0,
+	return ti_sci_set_clock_state(handle, dev_id, clk_id,
+				      MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE,
 				      MSG_CLOCK_SW_STATE_AUTO);
 }
 
-- 
2.17.1

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

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

* Re: [PATCH] firmware: ti_sci: allow frequency change for disabled clocks by default
  2020-09-07 11:03 [PATCH] firmware: ti_sci: allow frequency change for disabled clocks by default Tero Kristo
@ 2020-09-07 11:56 ` Nishanth Menon
  0 siblings, 0 replies; 2+ messages in thread
From: Nishanth Menon @ 2020-09-07 11:56 UTC (permalink / raw)
  To: Tero Kristo; +Cc: ssantosh, linux-arm-kernel, linux-kernel

On 14:03-20200907, Tero Kristo wrote:
> If a clock is disabled, its frequency should be allowed to change as
> it is no longer in use. Add a flag towards this to the firmware clock
> API handler routines.
> 
> Tested-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> ---
>  drivers/firmware/ti_sci.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
> index 53cee17d0115..39890665a975 100644
> --- a/drivers/firmware/ti_sci.c
> +++ b/drivers/firmware/ti_sci.c
> @@ -1124,7 +1124,8 @@ static int ti_sci_cmd_get_clock(const struct ti_sci_handle *handle, u32 dev_id,
>  static int ti_sci_cmd_idle_clock(const struct ti_sci_handle *handle,
>  				 u32 dev_id, u32 clk_id)
>  {
> -	return ti_sci_set_clock_state(handle, dev_id, clk_id, 0,
> +	return ti_sci_set_clock_state(handle, dev_id, clk_id,
> +				      MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE,
>  				      MSG_CLOCK_SW_STATE_UNREQ);
>  }
>  
> @@ -1143,7 +1144,8 @@ static int ti_sci_cmd_idle_clock(const struct ti_sci_handle *handle,
>  static int ti_sci_cmd_put_clock(const struct ti_sci_handle *handle,
>  				u32 dev_id, u32 clk_id)
>  {
> -	return ti_sci_set_clock_state(handle, dev_id, clk_id, 0,
> +	return ti_sci_set_clock_state(handle, dev_id, clk_id,
> +				      MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE,
>  				      MSG_CLOCK_SW_STATE_AUTO);
>  }
>  

Acked-by: Nishanth Menon <nm@ti.com>

-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D

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

end of thread, other threads:[~2020-09-07 12:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-07 11:03 [PATCH] firmware: ti_sci: allow frequency change for disabled clocks by default Tero Kristo
2020-09-07 11:56 ` Nishanth Menon

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).