ASoC: rsnd: rsnd_write() / rsnd_bset() uses regmap _force_ function
Some R-Car sound requests picky register access which needs *force* register write. Some status register needs to set 1 to clear status, but we might read 1 from its register. In such case, current regmap does nothing and driver will be forever loop To reduce code complexity, this patch uses regmap _force_ function for all register access. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
79e24da00b
commit
b3fc95ad02
|
@ -101,23 +101,6 @@ void rsnd_write(struct rsnd_priv *priv,
|
||||||
struct device *dev = rsnd_priv_to_dev(priv);
|
struct device *dev = rsnd_priv_to_dev(priv);
|
||||||
struct rsnd_gen *gen = rsnd_priv_to_gen(priv);
|
struct rsnd_gen *gen = rsnd_priv_to_gen(priv);
|
||||||
|
|
||||||
if (!rsnd_is_accessible_reg(priv, gen, reg))
|
|
||||||
return;
|
|
||||||
|
|
||||||
regmap_fields_write(gen->regs[reg], rsnd_mod_id(mod), data);
|
|
||||||
|
|
||||||
dev_dbg(dev, "w %s[%d] - %-18s (%4d) : %08x\n",
|
|
||||||
rsnd_mod_name(mod), rsnd_mod_id(mod),
|
|
||||||
rsnd_reg_name(gen, reg), reg, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
void rsnd_force_write(struct rsnd_priv *priv,
|
|
||||||
struct rsnd_mod *mod,
|
|
||||||
enum rsnd_reg reg, u32 data)
|
|
||||||
{
|
|
||||||
struct device *dev = rsnd_priv_to_dev(priv);
|
|
||||||
struct rsnd_gen *gen = rsnd_priv_to_gen(priv);
|
|
||||||
|
|
||||||
if (!rsnd_is_accessible_reg(priv, gen, reg))
|
if (!rsnd_is_accessible_reg(priv, gen, reg))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -137,8 +120,8 @@ void rsnd_bset(struct rsnd_priv *priv, struct rsnd_mod *mod,
|
||||||
if (!rsnd_is_accessible_reg(priv, gen, reg))
|
if (!rsnd_is_accessible_reg(priv, gen, reg))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
regmap_fields_update_bits(gen->regs[reg], rsnd_mod_id(mod),
|
regmap_fields_force_update_bits(gen->regs[reg],
|
||||||
mask, data);
|
rsnd_mod_id(mod), mask, data);
|
||||||
|
|
||||||
dev_dbg(dev, "b %s[%d] - %-18s (%4d) : %08x/%08x\n",
|
dev_dbg(dev, "b %s[%d] - %-18s (%4d) : %08x/%08x\n",
|
||||||
rsnd_mod_name(mod), rsnd_mod_id(mod),
|
rsnd_mod_name(mod), rsnd_mod_id(mod),
|
||||||
|
|
|
@ -182,8 +182,6 @@ struct rsnd_dai_stream;
|
||||||
rsnd_read(rsnd_mod_to_priv(m), m, RSND_REG_##r)
|
rsnd_read(rsnd_mod_to_priv(m), m, RSND_REG_##r)
|
||||||
#define rsnd_mod_write(m, r, d) \
|
#define rsnd_mod_write(m, r, d) \
|
||||||
rsnd_write(rsnd_mod_to_priv(m), m, RSND_REG_##r, d)
|
rsnd_write(rsnd_mod_to_priv(m), m, RSND_REG_##r, d)
|
||||||
#define rsnd_mod_force_write(m, r, d) \
|
|
||||||
rsnd_force_write(rsnd_mod_to_priv(m), m, RSND_REG_##r, d)
|
|
||||||
#define rsnd_mod_bset(m, r, s, d) \
|
#define rsnd_mod_bset(m, r, s, d) \
|
||||||
rsnd_bset(rsnd_mod_to_priv(m), m, RSND_REG_##r, s, d)
|
rsnd_bset(rsnd_mod_to_priv(m), m, RSND_REG_##r, s, d)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue