From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Katsuhiro Suzuki <katsuhiro@katsuster.net>
Cc: Mark Brown <broonie@kernel.org>,
David Yang <yangxiaohua@everest-semi.com>,
Daniel Drake <drake@endlessm.com>,
Hans de Goede <hdegoede@redhat.com>,
ALSA Development Mailing List <alsa-devel@alsa-project.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 2/4] ASoC: es8316: add clock control of MCLK
Date: Wed, 4 Sep 2019 17:37:26 +0300 [thread overview]
Message-ID: <CAHp75Vcm0yus5GpZEttdr_C07gmQXeNJ16gb_TFLUTvGkc164w@mail.gmail.com> (raw)
In-Reply-To: <20190903165322.20791-2-katsuhiro@katsuster.net>
On Tue, Sep 3, 2019 at 7:54 PM Katsuhiro Suzuki <katsuhiro@katsuster.net> wrote:
>
> This patch introduce clock property for MCLK master freq control.
> Driver will set rate of MCLK master if set_sysclk is called and
> changing sysclk by board driver.
>
> Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
> + if (es8316->mclk) {
You don't need this if clock has been requested as optional
(clk_get_optional() or so).
> + ret = clk_set_rate(es8316->mclk, freq);
> + if (ret)
> + return ret;
> + }
> + es8316->mclk = devm_clk_get(component->dev, "mclk");
> + if (PTR_ERR(es8316->mclk) == -EPROBE_DEFER)
> + return -EPROBE_DEFER;
> + if (IS_ERR(es8316->mclk)) {
> + dev_err(component->dev, "clock is invalid, ignored\n");
> + es8316->mclk = NULL;
> + }
devm_clk_get_optional()
> + if (es8316->mclk) {
Ditto as above.
> + ret = clk_prepare_enable(es8316->mclk);
> + if (ret) {
> + dev_err(component->dev, "unable to enable clock\n");
> + return ret;
> + }
> + }
> + if (es8316->mclk)
Ditto.
> + clk_disable_unprepare(es8316->mclk);
> +}
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2019-09-04 14:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-03 16:53 [PATCH v3 1/4] ASoC: es8316: judge PCM rate at later timing Katsuhiro Suzuki
2019-09-03 16:53 ` [PATCH v3 2/4] ASoC: es8316: add clock control of MCLK Katsuhiro Suzuki
2019-09-03 18:00 ` Applied "ASoC: es8316: add clock control of MCLK" to the asoc tree Mark Brown
2019-09-04 14:37 ` Andy Shevchenko [this message]
2019-09-04 15:46 ` [PATCH v3 2/4] ASoC: es8316: add clock control of MCLK Katsuhiro Suzuki
2019-09-03 16:53 ` [PATCH v3 3/4] ASoC: es8316: support fixed clock rate Katsuhiro Suzuki
2019-09-03 17:29 ` Mark Brown
2019-09-03 16:53 ` [PATCH v3 4/4] ASoC: es8316: add DT-bindings Katsuhiro Suzuki
2019-09-03 18:00 ` Applied "ASoC: es8316: add DT-bindings" to the asoc tree Mark Brown
2019-09-03 17:48 ` [PATCH v3 1/4] ASoC: es8316: judge PCM rate at later timing Mark Brown
2019-09-04 15:06 ` Katsuhiro Suzuki
2019-09-04 15:30 ` Mark Brown
2019-09-04 15:55 ` Katsuhiro Suzuki
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=CAHp75Vcm0yus5GpZEttdr_C07gmQXeNJ16gb_TFLUTvGkc164w@mail.gmail.com \
--to=andy.shevchenko@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=drake@endlessm.com \
--cc=hdegoede@redhat.com \
--cc=katsuhiro@katsuster.net \
--cc=linux-kernel@vger.kernel.org \
--cc=yangxiaohua@everest-semi.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 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).