diff options
author | Dmytro Prokopchuk <dmytro.prokopchuk@globallogic.com> | 2018-09-21 00:59:59 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-09-21 13:03:54 -0400 |
commit | 624d1a7cd8991e33dad96ab4629a52c412540e65 (patch) | |
tree | d3df916e4d21553cd9b577808eb72c7c3a9f5a00 | |
parent | c78d42c7fbd6f2a27a665bcd1ab60c9df617f7c9 (diff) |
ASoC: rsnd: fixup SSI clock during suspend/resume modes
Prepare <-> Cleanup functions pair has balanced calls.
But in case of suspend mode no call to rsnd_soc_dai_shutdown()
function, so cleanup isn't called. OTOH during resume mode
function rsnd_soc_dai_prepare() is called, but calling
rsnd_ssi_prepare() is skipped (rsnd_status_update() returns zero,
bacause was not cleanup before).
We need to call rsnd_ssi_prepare(), because it enables SSI clocks
by calling rsnd_ssi_master_clk_start().
This patch allows to call prepare/cleanup functions always.
Signed-off-by: Dmytro Prokopchuk <dmytro.prokopchuk@globallogic.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
[kuninori: adjusted to upstream]
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/sh/rcar/dma.c | 7 | ||||
-rw-r--r-- | sound/soc/sh/rcar/rsnd.h | 14 |
2 files changed, 10 insertions, 11 deletions
diff --git a/sound/soc/sh/rcar/dma.c b/sound/soc/sh/rcar/dma.c index 0bbc4b0ea2c6..6d1947515dc8 100644 --- a/sound/soc/sh/rcar/dma.c +++ b/sound/soc/sh/rcar/dma.c | |||
@@ -134,10 +134,9 @@ static int rsnd_dmaen_prepare(struct rsnd_mod *mod, | |||
134 | struct rsnd_dmaen *dmaen = rsnd_dma_to_dmaen(dma); | 134 | struct rsnd_dmaen *dmaen = rsnd_dma_to_dmaen(dma); |
135 | struct device *dev = rsnd_priv_to_dev(priv); | 135 | struct device *dev = rsnd_priv_to_dev(priv); |
136 | 136 | ||
137 | if (dmaen->chan) { | 137 | /* maybe suspended */ |
138 | dev_err(dev, "it already has dma channel\n"); | 138 | if (dmaen->chan) |
139 | return -EIO; | 139 | return 0; |
140 | } | ||
141 | 140 | ||
142 | /* | 141 | /* |
143 | * DMAEngine request uses mutex lock. | 142 | * DMAEngine request uses mutex lock. |
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index e857311ee5c1..4464d1d0a042 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h | |||
@@ -318,9 +318,8 @@ struct rsnd_mod { | |||
318 | /* | 318 | /* |
319 | * status | 319 | * status |
320 | * | 320 | * |
321 | * 0xH0000CBA | 321 | * 0xH0000CB0 |
322 | * | 322 | * |
323 | * A 0: prepare 1: cleanup | ||
324 | * B 0: init 1: quit | 323 | * B 0: init 1: quit |
325 | * C 0: start 1: stop | 324 | * C 0: start 1: stop |
326 | * | 325 | * |
@@ -331,9 +330,8 @@ struct rsnd_mod { | |||
331 | * H 0: hw_params | 330 | * H 0: hw_params |
332 | * H 0: pointer | 331 | * H 0: pointer |
333 | * H 0: prepare | 332 | * H 0: prepare |
333 | * H 0: cleanup | ||
334 | */ | 334 | */ |
335 | #define __rsnd_mod_shift_prepare 0 | ||
336 | #define __rsnd_mod_shift_cleanup 0 | ||
337 | #define __rsnd_mod_shift_init 4 | 335 | #define __rsnd_mod_shift_init 4 |
338 | #define __rsnd_mod_shift_quit 4 | 336 | #define __rsnd_mod_shift_quit 4 |
339 | #define __rsnd_mod_shift_start 8 | 337 | #define __rsnd_mod_shift_start 8 |
@@ -345,11 +343,13 @@ struct rsnd_mod { | |||
345 | #define __rsnd_mod_shift_fallback 28 /* always called */ | 343 | #define __rsnd_mod_shift_fallback 28 /* always called */ |
346 | #define __rsnd_mod_shift_hw_params 28 /* always called */ | 344 | #define __rsnd_mod_shift_hw_params 28 /* always called */ |
347 | #define __rsnd_mod_shift_pointer 28 /* always called */ | 345 | #define __rsnd_mod_shift_pointer 28 /* always called */ |
346 | #define __rsnd_mod_shift_prepare 28 /* always called */ | ||
347 | #define __rsnd_mod_shift_cleanup 28 /* always called */ | ||
348 | 348 | ||
349 | #define __rsnd_mod_add_probe 0 | 349 | #define __rsnd_mod_add_probe 0 |
350 | #define __rsnd_mod_add_remove 0 | 350 | #define __rsnd_mod_add_remove 0 |
351 | #define __rsnd_mod_add_prepare 1 | 351 | #define __rsnd_mod_add_prepare 0 |
352 | #define __rsnd_mod_add_cleanup -1 | 352 | #define __rsnd_mod_add_cleanup 0 |
353 | #define __rsnd_mod_add_init 1 | 353 | #define __rsnd_mod_add_init 1 |
354 | #define __rsnd_mod_add_quit -1 | 354 | #define __rsnd_mod_add_quit -1 |
355 | #define __rsnd_mod_add_start 1 | 355 | #define __rsnd_mod_add_start 1 |
@@ -363,7 +363,7 @@ struct rsnd_mod { | |||
363 | #define __rsnd_mod_call_probe 0 | 363 | #define __rsnd_mod_call_probe 0 |
364 | #define __rsnd_mod_call_remove 0 | 364 | #define __rsnd_mod_call_remove 0 |
365 | #define __rsnd_mod_call_prepare 0 | 365 | #define __rsnd_mod_call_prepare 0 |
366 | #define __rsnd_mod_call_cleanup 1 | 366 | #define __rsnd_mod_call_cleanup 0 |
367 | #define __rsnd_mod_call_init 0 | 367 | #define __rsnd_mod_call_init 0 |
368 | #define __rsnd_mod_call_quit 1 | 368 | #define __rsnd_mod_call_quit 1 |
369 | #define __rsnd_mod_call_start 0 | 369 | #define __rsnd_mod_call_start 0 |