diff mbox series

[v3] ARM: OMAP1: Prepare for conversion of OMAP1 clocks to CCF

Message ID 20220402195155.141364-1-jmkrzyszt@gmail.com
State New
Headers show
Series [v3] ARM: OMAP1: Prepare for conversion of OMAP1 clocks to CCF | expand

Commit Message

Janusz Krzysztofik April 2, 2022, 7:51 p.m. UTC
In preparation for conversion of OMAP1 clocks to common clock framework,
identify arch/arm/mach-omap1 local users of those clocks and update them
to call clk_prepare_enable/clk_disable_unprepare() instead of just
clk_enable/disable(), as required by CCF implementation of clock API.

Users which reside under /drivers will be updated via separate patches,
split out from v2 and already submitted.

Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
---
 arch/arm/mach-omap1/mcbsp.c    | 8 ++++----
 arch/arm/mach-omap1/ocpi.c     | 4 ++--
 arch/arm/mach-omap1/serial.c   | 6 +++---
 arch/arm/mach-omap1/timer32k.c | 2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)

Comments

Arnd Bergmann April 5, 2022, 9:39 a.m. UTC | #1
On Sat, Apr 2, 2022 at 9:51 PM Janusz Krzysztofik <jmkrzyszt@gmail.com> wrote:
>
> In preparation for conversion of OMAP1 clocks to common clock framework,
> identify arch/arm/mach-omap1 local users of those clocks and update them
> to call clk_prepare_enable/clk_disable_unprepare() instead of just
> clk_enable/disable(), as required by CCF implementation of clock API.
>
> Users which reside under /drivers will be updated via separate patches,
> split out from v2 and already submitted.
>
> Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
> ---
>  arch/arm/mach-omap1/mcbsp.c    | 8 ++++----
>  arch/arm/mach-omap1/ocpi.c     | 4 ++--
>  arch/arm/mach-omap1/serial.c   | 6 +++---
>  arch/arm/mach-omap1/timer32k.c | 2 +-
>  4 files changed, 10 insertions(+), 10 deletions(-)

This all looks good to me. I have now rebased my omap1 multiplatform series
on the latest kernel and integrated some of your new work, see [1].

I have also finished up the multiplatform conversion for all other ARMv4T
and ARMv5 platforms and sent them out, hopefully we are getting into the
endgame with this.

Are you able to test your CCF patches in combination with my series?
It would be great if we could get this all working in time for 5.19.

         Arnd

[1] https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git/log/?h=omap1-multiplatform-5.18
Janusz Krzysztofik April 9, 2022, 12:05 p.m. UTC | #2
On Tuesday, 5 April 2022 11:39:05 CEST Arnd Bergmann wrote:
> On Sat, Apr 2, 2022 at 9:51 PM Janusz Krzysztofik <jmkrzyszt@gmail.com> wrote:
> >
> > In preparation for conversion of OMAP1 clocks to common clock framework,
> > identify arch/arm/mach-omap1 local users of those clocks and update them
> > to call clk_prepare_enable/clk_disable_unprepare() instead of just
> > clk_enable/disable(), as required by CCF implementation of clock API.
> >
> > Users which reside under /drivers will be updated via separate patches,
> > split out from v2 and already submitted.
> >
> > Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
> > ---
> >  arch/arm/mach-omap1/mcbsp.c    | 8 ++++----
> >  arch/arm/mach-omap1/ocpi.c     | 4 ++--
> >  arch/arm/mach-omap1/serial.c   | 6 +++---
> >  arch/arm/mach-omap1/timer32k.c | 2 +-
> >  4 files changed, 10 insertions(+), 10 deletions(-)
> 
> This all looks good to me. I have now rebased my omap1 multiplatform series
> on the latest kernel and integrated some of your new work, see [1].
> 
> I have also finished up the multiplatform conversion for all other ARMv4T
> and ARMv5 platforms and sent them out, hopefully we are getting into the
> endgame with this.
> 
> Are you able to test your CCF patches in combination with my series?
> It would be great if we could get this all working in time for 5.19.
> 
>          Arnd
> 
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git/log/?h=omap1-multiplatform-5.18

Your branch with my CCF patches on top of it works for me on my OMAP1510 
based Amstrad Delta with the below fix:

diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c
index 8cafe7819e13..292fcb0a24fc 100644
--- a/drivers/video/fbdev/omap/omapfb_main.c
+++ b/drivers/video/fbdev/omap/omapfb_main.c
@@ -1623,7 +1623,7 @@ static int omapfb_do_probe(struct platform_device *pdev,
 
 	init_state = 0;
 
-	if (pdev->num_resources != 1) {
+	if (pdev->num_resources != 2) {
 		dev_err(&pdev->dev, "probed for an unknown device\n");
 		r = -ENODEV;
 		goto cleanup;

Amstrad Delta uses internal LCD controller, then the second IRQ (for sossi) 
is not needed, but your patch "fbdev: omap: pass irqs as resource" adds 
both to the array of omapfb resources and sets pdev->num_resources = 2.

Thanks,
Janusz
Arnd Bergmann April 9, 2022, 5:23 p.m. UTC | #3
On Sat, Apr 9, 2022 at 2:05 PM Janusz Krzysztofik <jmkrzyszt@gmail.com> wrote:
> On Tuesday, 5 April 2022 11:39:05 CEST Arnd Bergmann wrote:
> > This all looks good to me. I have now rebased my omap1 multiplatform series
> > on the latest kernel and integrated some of your new work, see [1].
> >
> > I have also finished up the multiplatform conversion for all other ARMv4T
> > and ARMv5 platforms and sent them out, hopefully we are getting into the
> > endgame with this.
> >
> > Are you able to test your CCF patches in combination with my series?
> > It would be great if we could get this all working in time for 5.19.
> >
> > [1] https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git/log/?h=omap1-multiplatform-5.18
>
> Your branch with my CCF patches on top of it works for me on my OMAP1510
> based Amstrad Delta with the below fix:
>
> diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c
> index 8cafe7819e13..292fcb0a24fc 100644
> --- a/drivers/video/fbdev/omap/omapfb_main.c
> +++ b/drivers/video/fbdev/omap/omapfb_main.c
> @@ -1623,7 +1623,7 @@ static int omapfb_do_probe(struct platform_device *pdev,
>
>         init_state = 0;
>
> -       if (pdev->num_resources != 1) {
> +       if (pdev->num_resources != 2) {
>                 dev_err(&pdev->dev, "probed for an unknown device\n");
>                 r = -ENODEV;
>                 goto cleanup;
>
> Amstrad Delta uses internal LCD controller, then the second IRQ (for sossi)
> is not needed, but your patch "fbdev: omap: pass irqs as resource" adds
> both to the array of omapfb resources and sets pdev->num_resources = 2.

Thanks a lot for testing, I folded your fixup into the corresponding
patch now and uploaded the new branch. Can you also send me latest
version of the patches you added on top so I can make them part of the
series before the final patch?

I would then send the complete series for another (possibly last)
round of review and try to get it merged for 5.19 if there are no other
concerns.

I have already merged the (comparatively simple) multiplatform conversion
changes for s3c24xx, ep93xx, ixp4xx and iop into the soc tree, they should
show up in the linux-next on Monday.

        Arnd
diff mbox series

Patch

diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c
index f36c34f47f11..3ec2badff6af 100644
--- a/arch/arm/mach-omap1/mcbsp.c
+++ b/arch/arm/mach-omap1/mcbsp.c
@@ -44,8 +44,8 @@  static void omap1_mcbsp_request(unsigned int id)
 			api_clk = clk_get(NULL, "api_ck");
 			dsp_clk = clk_get(NULL, "dsp_ck");
 			if (!IS_ERR(api_clk) && !IS_ERR(dsp_clk)) {
-				clk_enable(api_clk);
-				clk_enable(dsp_clk);
+				clk_prepare_enable(api_clk);
+				clk_prepare_enable(dsp_clk);
 
 				/*
 				 * DSP external peripheral reset
@@ -63,11 +63,11 @@  static void omap1_mcbsp_free(unsigned int id)
 	if (id == 0 || id == 2) {
 		if (--dsp_use == 0) {
 			if (!IS_ERR(api_clk)) {
-				clk_disable(api_clk);
+				clk_disable_unprepare(api_clk);
 				clk_put(api_clk);
 			}
 			if (!IS_ERR(dsp_clk)) {
-				clk_disable(dsp_clk);
+				clk_disable_unprepare(dsp_clk);
 				clk_put(dsp_clk);
 			}
 		}
diff --git a/arch/arm/mach-omap1/ocpi.c b/arch/arm/mach-omap1/ocpi.c
index 380ea2de58c1..03cc48024fd6 100644
--- a/arch/arm/mach-omap1/ocpi.c
+++ b/arch/arm/mach-omap1/ocpi.c
@@ -73,7 +73,7 @@  static int __init omap_ocpi_init(void)
 	if (IS_ERR(ocpi_ck))
 		return PTR_ERR(ocpi_ck);
 
-	clk_enable(ocpi_ck);
+	clk_prepare_enable(ocpi_ck);
 	ocpi_enable();
 	pr_info("OMAP OCPI interconnect driver loaded\n");
 
@@ -87,7 +87,7 @@  static void __exit omap_ocpi_exit(void)
 	if (!cpu_is_omap16xx())
 		return;
 
-	clk_disable(ocpi_ck);
+	clk_disable_unprepare(ocpi_ck);
 	clk_put(ocpi_ck);
 }
 
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c
index 9eb591fbfd89..5f591a836ab5 100644
--- a/arch/arm/mach-omap1/serial.c
+++ b/arch/arm/mach-omap1/serial.c
@@ -141,7 +141,7 @@  void __init omap_serial_init(void)
 			if (IS_ERR(uart1_ck))
 				printk("Could not get uart1_ck\n");
 			else {
-				clk_enable(uart1_ck);
+				clk_prepare_enable(uart1_ck);
 				if (cpu_is_omap15xx())
 					clk_set_rate(uart1_ck, 12000000);
 			}
@@ -151,7 +151,7 @@  void __init omap_serial_init(void)
 			if (IS_ERR(uart2_ck))
 				printk("Could not get uart2_ck\n");
 			else {
-				clk_enable(uart2_ck);
+				clk_prepare_enable(uart2_ck);
 				if (cpu_is_omap15xx())
 					clk_set_rate(uart2_ck, 12000000);
 				else
@@ -163,7 +163,7 @@  void __init omap_serial_init(void)
 			if (IS_ERR(uart3_ck))
 				printk("Could not get uart3_ck\n");
 			else {
-				clk_enable(uart3_ck);
+				clk_prepare_enable(uart3_ck);
 				if (cpu_is_omap15xx())
 					clk_set_rate(uart3_ck, 12000000);
 			}
diff --git a/arch/arm/mach-omap1/timer32k.c b/arch/arm/mach-omap1/timer32k.c
index 780fdf03c3ce..049c7b7f28c4 100644
--- a/arch/arm/mach-omap1/timer32k.c
+++ b/arch/arm/mach-omap1/timer32k.c
@@ -180,7 +180,7 @@  int __init omap_32k_timer_init(void)
 
 		sync32k_ick = clk_get(NULL, "omap_32ksync_ick");
 		if (!IS_ERR(sync32k_ick))
-			clk_enable(sync32k_ick);
+			clk_prepare_enable(sync32k_ick);
 
 		ret = omap_init_clocksource_32k(base);
 	}