Commit 184d82e1 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: rsnd: remove unnecessary ADG flags

The flag LRCLK_ASYNC / AUDIO_OUT_48 had been added to handling
special case of Salvator-X board, but it is not used on upstream.
It makes code complex today, let's remove these.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zg9y5emm.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 3e262e95
...@@ -32,7 +32,6 @@ struct rsnd_adg { ...@@ -32,7 +32,6 @@ struct rsnd_adg {
struct clk_onecell_data onecell; struct clk_onecell_data onecell;
struct rsnd_mod mod; struct rsnd_mod mod;
int clk_rate[CLKMAX]; int clk_rate[CLKMAX];
u32 flags;
u32 ckr; u32 ckr;
u32 rbga; u32 rbga;
u32 rbgb; u32 rbgb;
...@@ -41,9 +40,6 @@ struct rsnd_adg { ...@@ -41,9 +40,6 @@ struct rsnd_adg {
int rbgb_rate_for_48khz; /* RBGB */ int rbgb_rate_for_48khz; /* RBGB */
}; };
#define LRCLK_ASYNC (1 << 0)
#define AUDIO_OUT_48 (1 << 1)
#define for_each_rsnd_clk(pos, adg, i) \ #define for_each_rsnd_clk(pos, adg, i) \
for (i = 0; \ for (i = 0; \
(i < CLKMAX) && \ (i < CLKMAX) && \
...@@ -341,13 +337,8 @@ int rsnd_adg_ssi_clk_try_start(struct rsnd_mod *ssi_mod, unsigned int rate) ...@@ -341,13 +337,8 @@ int rsnd_adg_ssi_clk_try_start(struct rsnd_mod *ssi_mod, unsigned int rate)
rsnd_adg_set_ssi_clk(ssi_mod, data); rsnd_adg_set_ssi_clk(ssi_mod, data);
if (rsnd_flags_has(adg, LRCLK_ASYNC)) { if (0 == (rate % 8000))
if (rsnd_flags_has(adg, AUDIO_OUT_48)) ckr = 0x80000000; /* BRGB output = 48kHz */
ckr = 0x80000000;
} else {
if (0 == (rate % 8000))
ckr = 0x80000000;
}
rsnd_mod_bset(adg_mod, BRGCKR, 0x80770000, adg->ckr | ckr); rsnd_mod_bset(adg_mod, BRGCKR, 0x80770000, adg->ckr | ckr);
rsnd_mod_write(adg_mod, BRRA, adg->rbga); rsnd_mod_write(adg_mod, BRRA, adg->rbga);
...@@ -514,12 +505,6 @@ static int rsnd_adg_get_clkout(struct rsnd_priv *priv) ...@@ -514,12 +505,6 @@ static int rsnd_adg_get_clkout(struct rsnd_priv *priv)
req_48kHz_rate = req_rate[i]; req_48kHz_rate = req_rate[i];
} }
if (req_rate[0] % 48000 == 0)
rsnd_flags_set(adg, AUDIO_OUT_48);
if (of_get_property(np, "clkout-lr-asynchronous", NULL))
rsnd_flags_set(adg, LRCLK_ASYNC);
/* /*
* This driver is assuming that AUDIO_CLKA/AUDIO_CLKB/AUDIO_CLKC * This driver is assuming that AUDIO_CLKA/AUDIO_CLKB/AUDIO_CLKC
* have 44.1kHz or 48kHz base clocks for now. * have 44.1kHz or 48kHz base clocks for now.
...@@ -547,8 +532,7 @@ static int rsnd_adg_get_clkout(struct rsnd_priv *priv) ...@@ -547,8 +532,7 @@ static int rsnd_adg_get_clkout(struct rsnd_priv *priv)
rbga = rbgx; rbga = rbgx;
adg->rbga_rate_for_441khz = rate / div; adg->rbga_rate_for_441khz = rate / div;
ckr |= brg_table[i] << 20; ckr |= brg_table[i] << 20;
if (req_441kHz_rate && if (req_441kHz_rate)
!rsnd_flags_has(adg, AUDIO_OUT_48))
parent_clk_name = __clk_get_name(clk); parent_clk_name = __clk_get_name(clk);
} }
} }
...@@ -563,8 +547,7 @@ static int rsnd_adg_get_clkout(struct rsnd_priv *priv) ...@@ -563,8 +547,7 @@ static int rsnd_adg_get_clkout(struct rsnd_priv *priv)
rbgb = rbgx; rbgb = rbgx;
adg->rbgb_rate_for_48khz = rate / div; adg->rbgb_rate_for_48khz = rate / div;
ckr |= brg_table[i] << 16; ckr |= brg_table[i] << 16;
if (req_48kHz_rate && if (req_48kHz_rate)
rsnd_flags_has(adg, AUDIO_OUT_48))
parent_clk_name = __clk_get_name(clk); parent_clk_name = __clk_get_name(clk);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment