Skip to content

Commit 4acdf9a

Browse files
morimotobroonie
authored andcommitted
ASoC: rsnd: setup BRGCKR/BRRA/BRRB on rsnd_adg_clk_control()
Current adg.c will configure BRGCKR/BRRA/BRRB to output clock when it start sound. OTAH, rsnd_adg_clk_enable() will enables clk_a/b/c when driver was probed. But it is strange, these should be set in the same time. This patch fixup it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87h6oqzlei.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent ab02337 commit 4acdf9a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

sound/soc/sh/rcar/adg.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,6 @@ int rsnd_adg_ssi_clk_try_start(struct rsnd_mod *ssi_mod, unsigned int rate)
358358
ckr = 0x80000000; /* BRGB output = 48kHz */
359359

360360
rsnd_mod_bset(adg_mod, BRGCKR, 0x80770000, adg->ckr | ckr);
361-
rsnd_mod_write(adg_mod, BRRA, adg->brga);
362-
rsnd_mod_write(adg_mod, BRRB, adg->brgb);
363361

364362
dev_dbg(dev, "CLKOUT is based on BRG%c (= %dHz)\n",
365363
(ckr) ? 'B' : 'A',
@@ -372,9 +370,16 @@ int rsnd_adg_ssi_clk_try_start(struct rsnd_mod *ssi_mod, unsigned int rate)
372370
void rsnd_adg_clk_control(struct rsnd_priv *priv, int enable)
373371
{
374372
struct rsnd_adg *adg = rsnd_priv_to_adg(priv);
373+
struct rsnd_mod *adg_mod = rsnd_mod_get(adg);
375374
struct clk *clk;
376375
int i;
377376

377+
if (enable) {
378+
rsnd_mod_bset(adg_mod, BRGCKR, 0x80770000, adg->ckr);
379+
rsnd_mod_write(adg_mod, BRRA, adg->brga);
380+
rsnd_mod_write(adg_mod, BRRB, adg->brgb);
381+
}
382+
378383
for_each_rsnd_clkin(clk, adg, i) {
379384
if (enable) {
380385
clk_prepare_enable(clk);

0 commit comments

Comments
 (0)