diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2016-02-15 00:26:51 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-03-01 22:59:17 -0500 |
commit | b3fc95ad025683180628f6896d1f82d2cf5d0266 (patch) | |
tree | fd68f8f5555a01296bc1c72a2c6107514dd6567b /sound/soc | |
parent | 79e24da00b1137031245f3341828e4215b1b5b59 (diff) |
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>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/sh/rcar/gen.c | 21 | ||||
-rw-r--r-- | sound/soc/sh/rcar/rsnd.h | 2 |
2 files changed, 2 insertions, 21 deletions
diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c index 271d29adac68..46c0ba7b6414 100644 --- a/sound/soc/sh/rcar/gen.c +++ b/sound/soc/sh/rcar/gen.c | |||
@@ -104,23 +104,6 @@ void rsnd_write(struct rsnd_priv *priv, | |||
104 | if (!rsnd_is_accessible_reg(priv, gen, reg)) | 104 | if (!rsnd_is_accessible_reg(priv, gen, reg)) |
105 | return; | 105 | return; |
106 | 106 | ||
107 | regmap_fields_write(gen->regs[reg], rsnd_mod_id(mod), data); | ||
108 | |||
109 | dev_dbg(dev, "w %s[%d] - %-18s (%4d) : %08x\n", | ||
110 | rsnd_mod_name(mod), rsnd_mod_id(mod), | ||
111 | rsnd_reg_name(gen, reg), reg, data); | ||
112 | } | ||
113 | |||
114 | void rsnd_force_write(struct rsnd_priv *priv, | ||
115 | struct rsnd_mod *mod, | ||
116 | enum rsnd_reg reg, u32 data) | ||
117 | { | ||
118 | struct device *dev = rsnd_priv_to_dev(priv); | ||
119 | struct rsnd_gen *gen = rsnd_priv_to_gen(priv); | ||
120 | |||
121 | if (!rsnd_is_accessible_reg(priv, gen, reg)) | ||
122 | return; | ||
123 | |||
124 | regmap_fields_force_write(gen->regs[reg], rsnd_mod_id(mod), data); | 107 | regmap_fields_force_write(gen->regs[reg], rsnd_mod_id(mod), data); |
125 | 108 | ||
126 | dev_dbg(dev, "w %s[%d] - %-18s (%4d) : %08x\n", | 109 | dev_dbg(dev, "w %s[%d] - %-18s (%4d) : %08x\n", |
@@ -137,8 +120,8 @@ void rsnd_bset(struct rsnd_priv *priv, struct rsnd_mod *mod, | |||
137 | if (!rsnd_is_accessible_reg(priv, gen, reg)) | 120 | if (!rsnd_is_accessible_reg(priv, gen, reg)) |
138 | return; | 121 | return; |
139 | 122 | ||
140 | regmap_fields_update_bits(gen->regs[reg], rsnd_mod_id(mod), | 123 | regmap_fields_force_update_bits(gen->regs[reg], |
141 | mask, data); | 124 | rsnd_mod_id(mod), mask, data); |
142 | 125 | ||
143 | dev_dbg(dev, "b %s[%d] - %-18s (%4d) : %08x/%08x\n", | 126 | dev_dbg(dev, "b %s[%d] - %-18s (%4d) : %08x/%08x\n", |
144 | rsnd_mod_name(mod), rsnd_mod_id(mod), | 127 | rsnd_mod_name(mod), rsnd_mod_id(mod), |
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index 5f613eb42614..305cc086a0bc 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h | |||
@@ -182,8 +182,6 @@ struct rsnd_dai_stream; | |||
182 | rsnd_read(rsnd_mod_to_priv(m), m, RSND_REG_##r) | 182 | rsnd_read(rsnd_mod_to_priv(m), m, RSND_REG_##r) |
183 | #define rsnd_mod_write(m, r, d) \ | 183 | #define rsnd_mod_write(m, r, d) \ |
184 | rsnd_write(rsnd_mod_to_priv(m), m, RSND_REG_##r, d) | 184 | rsnd_write(rsnd_mod_to_priv(m), m, RSND_REG_##r, d) |
185 | #define rsnd_mod_force_write(m, r, d) \ | ||
186 | rsnd_force_write(rsnd_mod_to_priv(m), m, RSND_REG_##r, d) | ||
187 | #define rsnd_mod_bset(m, r, s, d) \ | 185 | #define rsnd_mod_bset(m, r, s, d) \ |
188 | rsnd_bset(rsnd_mod_to_priv(m), m, RSND_REG_##r, s, d) | 186 | rsnd_bset(rsnd_mod_to_priv(m), m, RSND_REG_##r, s, d) |
189 | 187 | ||