Commit 5c6901d9 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: rsnd: ADG initial setup on rsnd_adg_ssi_clk_init()

ADG is special IP since it doesn't have MSTP. And now, ADG has common
mod base register access. We can now setup ADG initial setting when
probe timing. It is needed if sound card is based on AUIDO_CLK which
is used as Master clock.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent f1df1229
...@@ -25,7 +25,6 @@ struct rsnd_adg { ...@@ -25,7 +25,6 @@ struct rsnd_adg {
int rbga_rate_for_441khz_div_6; /* RBGA */ int rbga_rate_for_441khz_div_6; /* RBGA */
int rbgb_rate_for_48khz_div_6; /* RBGB */ int rbgb_rate_for_48khz_div_6; /* RBGB */
u32 ckr;
}; };
#define for_each_rsnd_clk(pos, adg, i) \ #define for_each_rsnd_clk(pos, adg, i) \
...@@ -323,7 +322,6 @@ int rsnd_adg_ssi_clk_try_start(struct rsnd_mod *mod, unsigned int rate) ...@@ -323,7 +322,6 @@ int rsnd_adg_ssi_clk_try_start(struct rsnd_mod *mod, unsigned int rate)
{ {
struct rsnd_priv *priv = rsnd_mod_to_priv(mod); struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
struct rsnd_adg *adg = rsnd_priv_to_adg(priv); struct rsnd_adg *adg = rsnd_priv_to_adg(priv);
struct rsnd_mod *adg_mod = rsnd_mod_get(adg);
struct device *dev = rsnd_priv_to_dev(priv); struct device *dev = rsnd_priv_to_dev(priv);
struct clk *clk; struct clk *clk;
int i; int i;
...@@ -366,11 +364,6 @@ int rsnd_adg_ssi_clk_try_start(struct rsnd_mod *mod, unsigned int rate) ...@@ -366,11 +364,6 @@ int rsnd_adg_ssi_clk_try_start(struct rsnd_mod *mod, unsigned int rate)
found_clock: found_clock:
/* see rsnd_adg_ssi_clk_init() */
rsnd_mod_bset(adg_mod, SSICKR, 0x00FF0000, adg->ckr);
rsnd_mod_write(adg_mod, BRRA, 0x00000002); /* 1/6 */
rsnd_mod_write(adg_mod, BRRB, 0x00000002); /* 1/6 */
/* /*
* This "mod" = "ssi" here. * This "mod" = "ssi" here.
* we can get "ssi id" from mod * we can get "ssi id" from mod
...@@ -386,6 +379,7 @@ int rsnd_adg_ssi_clk_try_start(struct rsnd_mod *mod, unsigned int rate) ...@@ -386,6 +379,7 @@ int rsnd_adg_ssi_clk_try_start(struct rsnd_mod *mod, unsigned int rate)
static void rsnd_adg_ssi_clk_init(struct rsnd_priv *priv, struct rsnd_adg *adg) static void rsnd_adg_ssi_clk_init(struct rsnd_priv *priv, struct rsnd_adg *adg)
{ {
struct clk *clk; struct clk *clk;
struct rsnd_mod *adg_mod = rsnd_mod_get(adg);
unsigned long rate; unsigned long rate;
u32 ckr; u32 ckr;
int i; int i;
...@@ -405,6 +399,7 @@ static void rsnd_adg_ssi_clk_init(struct rsnd_priv *priv, struct rsnd_adg *adg) ...@@ -405,6 +399,7 @@ static void rsnd_adg_ssi_clk_init(struct rsnd_priv *priv, struct rsnd_adg *adg)
* and, BRGB outputs 48.0kHz base parent clock 1/32 here. * and, BRGB outputs 48.0kHz base parent clock 1/32 here.
* see * see
* rsnd_adg_ssi_clk_try_start() * rsnd_adg_ssi_clk_try_start()
* rsnd_ssi_master_clk_start()
*/ */
ckr = 0; ckr = 0;
adg->rbga_rate_for_441khz_div_6 = 0; adg->rbga_rate_for_441khz_div_6 = 0;
...@@ -428,7 +423,9 @@ static void rsnd_adg_ssi_clk_init(struct rsnd_priv *priv, struct rsnd_adg *adg) ...@@ -428,7 +423,9 @@ static void rsnd_adg_ssi_clk_init(struct rsnd_priv *priv, struct rsnd_adg *adg)
} }
} }
adg->ckr = ckr; rsnd_mod_bset(adg_mod, SSICKR, 0x00FF0000, ckr);
rsnd_mod_write(adg_mod, BRRA, 0x00000002); /* 1/6 */
rsnd_mod_write(adg_mod, BRRB, 0x00000002); /* 1/6 */
} }
int rsnd_adg_probe(struct platform_device *pdev, int rsnd_adg_probe(struct platform_device *pdev,
......
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