Skip to content

Commit 624d1a7

Browse files
Dmytro Prokopchukbroonie
authored andcommitted
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>
1 parent c78d42c commit 624d1a7

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

sound/soc/sh/rcar/dma.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,9 @@ static int rsnd_dmaen_prepare(struct rsnd_mod *mod,
134134
struct rsnd_dmaen *dmaen = rsnd_dma_to_dmaen(dma);
135135
struct device *dev = rsnd_priv_to_dev(priv);
136136

137-
if (dmaen->chan) {
138-
dev_err(dev, "it already has dma channel\n");
139-
return -EIO;
140-
}
137+
/* maybe suspended */
138+
if (dmaen->chan)
139+
return 0;
141140

142141
/*
143142
* DMAEngine request uses mutex lock.

sound/soc/sh/rcar/rsnd.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,8 @@ struct rsnd_mod {
318318
/*
319319
* status
320320
*
321-
* 0xH0000CBA
321+
* 0xH0000CB0
322322
*
323-
* A 0: prepare 1: cleanup
324323
* B 0: init 1: quit
325324
* C 0: start 1: stop
326325
*
@@ -331,9 +330,8 @@ struct rsnd_mod {
331330
* H 0: hw_params
332331
* H 0: pointer
333332
* H 0: prepare
333+
* H 0: cleanup
334334
*/
335-
#define __rsnd_mod_shift_prepare 0
336-
#define __rsnd_mod_shift_cleanup 0
337335
#define __rsnd_mod_shift_init 4
338336
#define __rsnd_mod_shift_quit 4
339337
#define __rsnd_mod_shift_start 8
@@ -345,11 +343,13 @@ struct rsnd_mod {
345343
#define __rsnd_mod_shift_fallback 28 /* always called */
346344
#define __rsnd_mod_shift_hw_params 28 /* always called */
347345
#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 */
348348

349349
#define __rsnd_mod_add_probe 0
350350
#define __rsnd_mod_add_remove 0
351-
#define __rsnd_mod_add_prepare 1
352-
#define __rsnd_mod_add_cleanup -1
351+
#define __rsnd_mod_add_prepare 0
352+
#define __rsnd_mod_add_cleanup 0
353353
#define __rsnd_mod_add_init 1
354354
#define __rsnd_mod_add_quit -1
355355
#define __rsnd_mod_add_start 1
@@ -363,7 +363,7 @@ struct rsnd_mod {
363363
#define __rsnd_mod_call_probe 0
364364
#define __rsnd_mod_call_remove 0
365365
#define __rsnd_mod_call_prepare 0
366-
#define __rsnd_mod_call_cleanup 1
366+
#define __rsnd_mod_call_cleanup 0
367367
#define __rsnd_mod_call_init 0
368368
#define __rsnd_mod_call_quit 1
369369
#define __rsnd_mod_call_start 0

0 commit comments

Comments
 (0)