static void rsnd_dma_of_name(struct rsnd_dma *dma, int is_play, char *dma_name) { struct rsnd_mod *this = rsnd_dma_to_mod(dma); struct rsnd_dai_stream *io = rsnd_mod_to_io(this); struct rsnd_mod *ssi = rsnd_io_to_mod_ssi(io); struct rsnd_mod *src = rsnd_io_to_mod_src(io); struct rsnd_mod *dvc = rsnd_io_to_mod_dvc(io); struct rsnd_mod *mod[MOD_MAX]; struct rsnd_mod *src_mod, *dst_mod; int i, index; for (i = 0; i < MOD_MAX; i++) mod[i] = NULL; /* * in play case... * * src -> dst * * mem -> SSI * mem -> SRC -> SSI * mem -> SRC -> DVC -> SSI */ mod[0] = NULL; /* for "mem" */ index = 1; for (i = 1; i < MOD_MAX; i++) { if (!src) { mod[i] = ssi; } else if (!dvc) { mod[i] = src; src = NULL; } else { mod[i] = dvc; dvc = NULL; } if (mod[i] == this) index = i; if (mod[i] == ssi) break; } if (is_play) { src_mod = mod[index - 1]; dst_mod = mod[index]; } else { src_mod = mod[index]; dst_mod = mod[index + 1]; } index = 0; index = _rsnd_dma_of_name(dma_name + index, src_mod); *(dma_name + index++) = '_'; index = _rsnd_dma_of_name(dma_name + index, dst_mod); }
static void rsnd_dma_of_name(struct rsnd_mod *mod_from, struct rsnd_mod *mod_to, char *dma_name) { int index = 0; index = _rsnd_dma_of_name(dma_name + index, mod_from); *(dma_name + index++) = '_'; index = _rsnd_dma_of_name(dma_name + index, mod_to); }