From: Janusz Krzysztofik <jmkrzyszt@gmail.com>
To: "Mark Brown" <broonie@kernel.org>,
"Péter Ujfalusi" <peter.ujfalusi@gmail.com>
Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org,
Liam Girdwood <lgirdwood@gmail.com>
Subject: Re: [PATCH] ASoC: ti: osk5912: Make it CCF clk API compatible
Date: Thu, 07 Apr 2022 00:18:45 +0200 [thread overview]
Message-ID: <1908101.usQuhbGJ8B@dell> (raw)
In-Reply-To: <1fa386d7-2222-f12d-8a8f-c7be29b1c6d2@gmail.com>
Hi Peter,
On Wednesday, 6 April 2022 21:57:34 CEST Péter Ujfalusi wrote:
> Hi Janusz,
>
> On 02/04/2022 15:01, Janusz Krzysztofik wrote:
> > The driver, OMAP1 specific, now omits clk_prepare/unprepare() steps, not
> > supported by OMAP1 custom implementation of clock API. However, non-CCF
> > stubs of those functions exist for use on such platforms until converted
> > to CCF.
> >
> > Update the driver to be compatible with CCF implementation of clock API.
> >
> > Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
> > ---
> > sound/soc/ti/osk5912.c | 9 ++++++++-
> > 1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/sound/soc/ti/osk5912.c b/sound/soc/ti/osk5912.c
> > index 40e29dda7e7a..22da3b335e81 100644
> > --- a/sound/soc/ti/osk5912.c
> > +++ b/sound/soc/ti/osk5912.c
> > @@ -134,6 +134,10 @@ static int __init osk_soc_init(void)
> > goto err2;
> > }
> >
> > + err = clk_prepare(tlv320aic23_mclk);
>
> would not make sense to change the clk_enable() to clk_prepare_enable()
> in osk_startup() and the clk_disable() to clk_disable_unprepare() in
> osk_shutdown() instead leaving the clock in prepared state as long as
> the driver is loaded?
OK, I can see the clk_prepare_enable() approach is more common than
separate clk_prepare() across the kernel code, and I have no arguments
against it in our case. I'll submit v2 soon.
Thanks,
Janusz
>
> > + if (err)
> > + goto err3;
> > +
> > /*
> > * Configure 12 MHz output on MCLK.
> > */
> > @@ -142,7 +146,7 @@ static int __init osk_soc_init(void)
> > if (clk_set_rate(tlv320aic23_mclk, CODEC_CLOCK)) {
> > printk(KERN_ERR "Cannot set MCLK for AIC23 CODEC\n");
> > err = -ECANCELED;
> > - goto err3;
> > + goto err4;
> > }
> > }
> >
> > @@ -151,6 +155,8 @@ static int __init osk_soc_init(void)
> >
> > return 0;
> >
> > +err4:
> > + clk_unprepare(tlv320aic23_mclk);
> > err3:
> > clk_put(tlv320aic23_mclk);
> > err2:
> > @@ -164,6 +170,7 @@ static int __init osk_soc_init(void)
> >
> > static void __exit osk_soc_exit(void)
> > {
> > + clk_unprepare(tlv320aic23_mclk);
> > clk_put(tlv320aic23_mclk);
> > platform_device_unregister(osk_snd_device);
> > }
>
>
WARNING: multiple messages have this Message-ID (diff)
From: Janusz Krzysztofik <jmkrzyszt@gmail.com>
To: "Mark Brown" <broonie@kernel.org>,
"Péter Ujfalusi" <peter.ujfalusi@gmail.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
alsa-devel@alsa-project.org, linux-omap@vger.kernel.org
Subject: Re: [PATCH] ASoC: ti: osk5912: Make it CCF clk API compatible
Date: Thu, 07 Apr 2022 00:18:45 +0200 [thread overview]
Message-ID: <1908101.usQuhbGJ8B@dell> (raw)
In-Reply-To: <1fa386d7-2222-f12d-8a8f-c7be29b1c6d2@gmail.com>
Hi Peter,
On Wednesday, 6 April 2022 21:57:34 CEST Péter Ujfalusi wrote:
> Hi Janusz,
>
> On 02/04/2022 15:01, Janusz Krzysztofik wrote:
> > The driver, OMAP1 specific, now omits clk_prepare/unprepare() steps, not
> > supported by OMAP1 custom implementation of clock API. However, non-CCF
> > stubs of those functions exist for use on such platforms until converted
> > to CCF.
> >
> > Update the driver to be compatible with CCF implementation of clock API.
> >
> > Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
> > ---
> > sound/soc/ti/osk5912.c | 9 ++++++++-
> > 1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/sound/soc/ti/osk5912.c b/sound/soc/ti/osk5912.c
> > index 40e29dda7e7a..22da3b335e81 100644
> > --- a/sound/soc/ti/osk5912.c
> > +++ b/sound/soc/ti/osk5912.c
> > @@ -134,6 +134,10 @@ static int __init osk_soc_init(void)
> > goto err2;
> > }
> >
> > + err = clk_prepare(tlv320aic23_mclk);
>
> would not make sense to change the clk_enable() to clk_prepare_enable()
> in osk_startup() and the clk_disable() to clk_disable_unprepare() in
> osk_shutdown() instead leaving the clock in prepared state as long as
> the driver is loaded?
OK, I can see the clk_prepare_enable() approach is more common than
separate clk_prepare() across the kernel code, and I have no arguments
against it in our case. I'll submit v2 soon.
Thanks,
Janusz
>
> > + if (err)
> > + goto err3;
> > +
> > /*
> > * Configure 12 MHz output on MCLK.
> > */
> > @@ -142,7 +146,7 @@ static int __init osk_soc_init(void)
> > if (clk_set_rate(tlv320aic23_mclk, CODEC_CLOCK)) {
> > printk(KERN_ERR "Cannot set MCLK for AIC23 CODEC\n");
> > err = -ECANCELED;
> > - goto err3;
> > + goto err4;
> > }
> > }
> >
> > @@ -151,6 +155,8 @@ static int __init osk_soc_init(void)
> >
> > return 0;
> >
> > +err4:
> > + clk_unprepare(tlv320aic23_mclk);
> > err3:
> > clk_put(tlv320aic23_mclk);
> > err2:
> > @@ -164,6 +170,7 @@ static int __init osk_soc_init(void)
> >
> > static void __exit osk_soc_exit(void)
> > {
> > + clk_unprepare(tlv320aic23_mclk);
> > clk_put(tlv320aic23_mclk);
> > platform_device_unregister(osk_snd_device);
> > }
>
>
next prev parent reply other threads:[~2022-04-06 22:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-02 12:01 [PATCH] ASoC: ti: osk5912: Make it CCF clk API compatible Janusz Krzysztofik
2022-04-02 12:01 ` Janusz Krzysztofik
2022-04-06 19:57 ` Péter Ujfalusi
2022-04-06 19:57 ` Péter Ujfalusi
2022-04-06 22:18 ` Janusz Krzysztofik [this message]
2022-04-06 22:18 ` Janusz Krzysztofik
2022-04-07 19:12 ` [PATCH v2] " Janusz Krzysztofik
2022-04-07 19:12 ` Janusz Krzysztofik
2022-04-12 18:16 ` Péter Ujfalusi
2022-04-12 18:16 ` Péter Ujfalusi
2022-04-12 22:26 ` Mark Brown
2022-04-12 22:26 ` Mark Brown
2022-04-12 22:26 ` [PATCH] " Mark Brown
2022-04-12 22:26 ` Mark Brown
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=1908101.usQuhbGJ8B@dell \
--to=jmkrzyszt@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-omap@vger.kernel.org \
--cc=peter.ujfalusi@gmail.com \
/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.