aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/sh/rcar/src.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c
index d520690409a2..1d5aedb50213 100644
--- a/sound/soc/sh/rcar/src.c
+++ b/sound/soc/sh/rcar/src.c
@@ -33,7 +33,7 @@ struct rsnd_src {
33#define rsnd_src_get(priv, id) ((struct rsnd_src *)(priv->src) + id) 33#define rsnd_src_get(priv, id) ((struct rsnd_src *)(priv->src) + id)
34#define rsnd_src_to_dma(src) ((src)->dma) 34#define rsnd_src_to_dma(src) ((src)->dma)
35#define rsnd_src_nr(priv) ((priv)->src_nr) 35#define rsnd_src_nr(priv) ((priv)->src_nr)
36#define rsnd_enable_sync_convert(src) ((src)->sen.val) 36#define rsnd_src_sync_is_enabled(mod) (rsnd_mod_to_src(mod)->sen.val)
37 37
38#define rsnd_mod_to_src(_mod) \ 38#define rsnd_mod_to_src(_mod) \
39 container_of((_mod), struct rsnd_src, mod) 39 container_of((_mod), struct rsnd_src, mod)
@@ -102,7 +102,7 @@ static u32 rsnd_src_convert_rate(struct rsnd_dai_stream *io,
102 if (!runtime) 102 if (!runtime)
103 return 0; 103 return 0;
104 104
105 if (!rsnd_enable_sync_convert(src)) 105 if (!rsnd_src_sync_is_enabled(mod))
106 return src->convert_rate; 106 return src->convert_rate;
107 107
108 convert_rate = src->sync.val; 108 convert_rate = src->sync.val;
@@ -175,7 +175,6 @@ static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io,
175 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); 175 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
176 struct device *dev = rsnd_priv_to_dev(priv); 176 struct device *dev = rsnd_priv_to_dev(priv);
177 struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); 177 struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
178 struct rsnd_src *src = rsnd_mod_to_src(mod);
179 u32 convert_rate = rsnd_src_convert_rate(io, mod); 178 u32 convert_rate = rsnd_src_convert_rate(io, mod);
180 u32 ifscr, fsrate, adinr; 179 u32 ifscr, fsrate, adinr;
181 u32 cr, route; 180 u32 cr, route;
@@ -222,7 +221,7 @@ static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io,
222 if (convert_rate) { 221 if (convert_rate) {
223 route = 0x1; 222 route = 0x1;
224 223
225 if (rsnd_enable_sync_convert(src)) { 224 if (rsnd_src_sync_is_enabled(mod)) {
226 cr |= 0x1; 225 cr |= 0x1;
227 route |= rsnd_io_is_play(io) ? 226 route |= rsnd_io_is_play(io) ?
228 (0x1 << 24) : (0x1 << 25); 227 (0x1 << 24) : (0x1 << 25);
@@ -296,9 +295,9 @@ static int rsnd_src_irq(struct rsnd_mod *mod,
296 /* 295 /*
297 * WORKAROUND 296 * WORKAROUND
298 * 297 *
299 * ignore over flow error when rsnd_enable_sync_convert() 298 * ignore over flow error when rsnd_src_sync_is_enabled()
300 */ 299 */
301 if (rsnd_enable_sync_convert(src)) 300 if (rsnd_src_sync_is_enabled(mod))
302 sys_int_val = sys_int_val & 0xffff; 301 sys_int_val = sys_int_val & 0xffff;
303 302
304 rsnd_mod_write(mod, SRC_INT_ENABLE0, int_val); 303 rsnd_mod_write(mod, SRC_INT_ENABLE0, int_val);
@@ -318,7 +317,6 @@ static void rsnd_src_status_clear(struct rsnd_mod *mod)
318 317
319static bool rsnd_src_error_occurred(struct rsnd_mod *mod) 318static bool rsnd_src_error_occurred(struct rsnd_mod *mod)
320{ 319{
321 struct rsnd_src *src = rsnd_mod_to_src(mod);
322 u32 val0, val1; 320 u32 val0, val1;
323 bool ret = false; 321 bool ret = false;
324 322
@@ -327,9 +325,9 @@ static bool rsnd_src_error_occurred(struct rsnd_mod *mod)
327 /* 325 /*
328 * WORKAROUND 326 * WORKAROUND
329 * 327 *
330 * ignore over flow error when rsnd_enable_sync_convert() 328 * ignore over flow error when rsnd_src_sync_is_enabled()
331 */ 329 */
332 if (rsnd_enable_sync_convert(src)) 330 if (rsnd_src_sync_is_enabled(mod))
333 val0 = val0 & 0xffff; 331 val0 = val0 & 0xffff;
334 332
335 if ((rsnd_mod_read(mod, SCU_SYS_STATUS0) & val0) || 333 if ((rsnd_mod_read(mod, SCU_SYS_STATUS0) & val0) ||
@@ -343,7 +341,6 @@ static int rsnd_src_start(struct rsnd_mod *mod,
343 struct rsnd_dai_stream *io, 341 struct rsnd_dai_stream *io,
344 struct rsnd_priv *priv) 342 struct rsnd_priv *priv)
345{ 343{
346 struct rsnd_src *src = rsnd_mod_to_src(mod);
347 u32 val; 344 u32 val;
348 345
349 /* 346 /*
@@ -351,7 +348,7 @@ static int rsnd_src_start(struct rsnd_mod *mod,
351 * 348 *
352 * Enable SRC output if you want to use sync convert together with DVC 349 * Enable SRC output if you want to use sync convert together with DVC
353 */ 350 */
354 val = (rsnd_io_to_mod_dvc(io) && !rsnd_enable_sync_convert(src)) ? 351 val = (rsnd_io_to_mod_dvc(io) && !rsnd_src_sync_is_enabled(mod)) ?
355 0x01 : 0x11; 352 0x01 : 0x11;
356 353
357 rsnd_mod_write(mod, SRC_CTRL, val); 354 rsnd_mod_write(mod, SRC_CTRL, val);