Skip to content

Commit

Permalink
ASoC: rsnd: move rsnd_mod_is_working() to rsnd_io_is_working()
Browse files Browse the repository at this point in the history
Each Renesas sound mod (= SSI/SRC/DVC) might be called from many paths
if it supports MIXer. In such case, mod <-> io is no longer 1:1
relationship.
This patch checks module working status via io instead of mod

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Kuninori Morimoto authored and Mark Brown committed Jun 16, 2015
1 parent b65a7cc commit d5bbe7d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
4 changes: 1 addition & 3 deletions sound/soc/sh/rcar/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,8 @@ void rsnd_mod_interrupt(struct rsnd_mod *mod,
}
}

int rsnd_mod_is_working(struct rsnd_mod *mod)
int rsnd_io_is_working(struct rsnd_dai_stream *io)
{
struct rsnd_dai_stream *io = rsnd_mod_to_io(mod);

/* see rsnd_dai_stream_init/quit() */
return !!io->substream;
}
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/sh/rcar/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static void __rsnd_dmaen_complete(struct rsnd_mod *mod,
*/
spin_lock_irqsave(&priv->lock, flags);

if (rsnd_mod_is_working(mod))
if (rsnd_io_is_working(io))
elapsed = rsnd_dai_pointer_update(io, io->byte_per_period);

spin_unlock_irqrestore(&priv->lock, flags);
Expand Down
3 changes: 1 addition & 2 deletions sound/soc/sh/rcar/rsnd.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ int rsnd_mod_init(struct rsnd_priv *priv,
int id);
void rsnd_mod_quit(struct rsnd_mod *mod);
char *rsnd_mod_name(struct rsnd_mod *mod);
int rsnd_mod_is_working(struct rsnd_mod *mod);
struct dma_chan *rsnd_mod_dma_req(struct rsnd_dai_stream *io,
struct rsnd_mod *mod);
void rsnd_mod_interrupt(struct rsnd_mod *mod,
Expand Down Expand Up @@ -356,7 +355,7 @@ struct rsnd_dai_stream {
#define rsnd_io_is_play(io) (&rsnd_io_to_rdai(io)->playback == io)
#define rsnd_io_to_runtime(io) ((io)->substream ? \
(io)->substream->runtime : NULL)

int rsnd_io_is_working(struct rsnd_dai_stream *io);

struct rsnd_dai {
char name[RSND_DAI_NAME_SIZE];
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/sh/rcar/src.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ static void __rsnd_src_interrupt_gen2(struct rsnd_mod *mod,
spin_lock(&priv->lock);

/* ignore all cases if not working */
if (!rsnd_mod_is_working(mod))
if (!rsnd_io_is_working(io))
goto rsnd_src_interrupt_gen2_out;

if (rsnd_src_error_record_gen2(mod)) {
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/sh/rcar/ssi.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
spin_lock(&priv->lock);

/* ignore all cases if not working */
if (!rsnd_mod_is_working(mod))
if (!rsnd_io_is_working(io))
goto rsnd_ssi_interrupt_out;

status = rsnd_mod_read(mod, SSISR);
Expand Down

0 comments on commit d5bbe7d

Please sign in to comment.