Skip to content

Commit

Permalink
ASoC: rsnd: rename scu to src
Browse files Browse the repository at this point in the history
R-Car sound has SCU unit which has SRC/CTU/MIX/DVC,
and current rsnd driver has scu.c and scu module.
Current scu.c has SRC support only.
My first concept was control these feature on scu.c
but, it become difficult and un-understandable now.
This patch rename scu to src

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Kuninori Morimoto authored and Mark Brown committed Mar 5, 2014
1 parent 9524be0 commit ba9c949
Show file tree
Hide file tree
Showing 6 changed files with 175 additions and 166 deletions.
18 changes: 11 additions & 7 deletions include/sound/rcar_snd.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,26 @@ struct rsnd_ssi_platform_info {
*/
#define RSND_SCU_USE_HPBIF (1 << 31) /* it needs RSND_SSI_DEPENDENT */

#define RSND_SCU(rate, _dma_id) \
#define RSND_SRC(rate, _dma_id) \
{ .flags = RSND_SCU_USE_HPBIF, .convert_rate = rate, .dma_id = _dma_id, }
#define RSND_SCU_SET(rate, _dma_id) \
#define RSND_SRC_SET(rate, _dma_id) \
{ .flags = RSND_SCU_USE_HPBIF, .convert_rate = rate, .dma_id = _dma_id, }
#define RSND_SCU_UNUSED \
#define RSND_SRC_UNUSED \
{ .flags = 0, .convert_rate = 0, .dma_id = 0, }

struct rsnd_scu_platform_info {
#define rsnd_scu_platform_info rsnd_src_platform_info
#define src_info scu_info
#define src_info_nr scu_info_nr

struct rsnd_src_platform_info {
u32 flags;
u32 convert_rate; /* sampling rate convert */
int dma_id; /* for Gen2 SCU */
};

struct rsnd_dai_path_info {
struct rsnd_ssi_platform_info *ssi;
struct rsnd_scu_platform_info *scu;
struct rsnd_src_platform_info *src;
};

struct rsnd_dai_platform_info {
Expand All @@ -93,8 +97,8 @@ struct rcar_snd_info {
u32 flags;
struct rsnd_ssi_platform_info *ssi_info;
int ssi_info_nr;
struct rsnd_scu_platform_info *scu_info;
int scu_info_nr;
struct rsnd_src_platform_info *src_info;
int src_info_nr;
struct rsnd_dai_platform_info *dai_info;
int dai_info_nr;
int (*start)(int id);
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/sh/rcar/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
snd-soc-rcar-objs := core.o gen.o scu.o adg.o ssi.o
snd-soc-rcar-objs := core.o gen.o src.o adg.o ssi.o
obj-$(CONFIG_SND_SOC_RCAR) += snd-soc-rcar.o
26 changes: 13 additions & 13 deletions sound/soc/sh/rcar/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@
* | +- ssi[2]
* | ...
* |
* | ** these control scu
* | ** these control src
* |
* +- scu
* +- src
* |
* +- scu[0]
* +- scu[1]
* +- scu[2]
* +- src[0]
* +- src[1]
* +- src[2]
* ...
*
*
Expand Down Expand Up @@ -572,7 +572,7 @@ static int rsnd_path_init(struct rsnd_priv *priv,
struct rsnd_dai_platform_info *dai_info = rdai->info;
int ret;
int ssi_id = -1;
int scu_id = -1;
int src_id = -1;

/*
* Gen1 is created by SRU/SSI, and this SRU is base module of
Expand All @@ -587,23 +587,23 @@ static int rsnd_path_init(struct rsnd_priv *priv,
if (dai_info) {
if (rsnd_is_enable_path(io, ssi))
ssi_id = rsnd_info_id(priv, io, ssi);
if (rsnd_is_enable_path(io, scu))
scu_id = rsnd_info_id(priv, io, scu);
if (rsnd_is_enable_path(io, src))
src_id = rsnd_info_id(priv, io, src);
} else {
/* get SSI's ID */
mod = rsnd_ssi_mod_get_frm_dai(priv,
rsnd_dai_id(priv, rdai),
rsnd_dai_is_play(rdai, io));
if (!mod)
return 0;
ssi_id = scu_id = rsnd_mod_id(mod);
ssi_id = src_id = rsnd_mod_id(mod);
}

ret = 0;

/* SCU */
if (scu_id >= 0) {
mod = rsnd_scu_mod_get(priv, scu_id);
/* SRC */
if (src_id >= 0) {
mod = rsnd_src_mod_get(priv, src_id);
ret = rsnd_dai_connect(mod, io);
if (ret < 0)
return ret;
Expand Down Expand Up @@ -806,7 +806,7 @@ static int rsnd_probe(struct platform_device *pdev)
struct rsnd_priv *priv) = {
rsnd_gen_probe,
rsnd_ssi_probe,
rsnd_scu_probe,
rsnd_src_probe,
rsnd_adg_probe,
rsnd_dai_probe,
};
Expand Down
24 changes: 12 additions & 12 deletions sound/soc/sh/rcar/rsnd.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void rsnd_dma_quit(struct rsnd_priv *priv,
* R-Car sound mod
*/
enum rsnd_mod_type {
RSND_MOD_SCU = 0,
RSND_MOD_SRC = 0,
RSND_MOD_SSI,
RSND_MOD_MAX,
};
Expand Down Expand Up @@ -224,7 +224,7 @@ struct rsnd_dai_stream {
int next_period_byte;
};
#define rsnd_io_to_mod_ssi(io) ((io)->mod[RSND_MOD_SSI])
#define rsnd_io_to_mod_scu(io) ((io)->mod[RSND_MOD_SCU])
#define rsnd_io_to_mod_src(io) ((io)->mod[RSND_MOD_SRC])

struct rsnd_dai {
char name[RSND_DAI_NAME_SIZE];
Expand Down Expand Up @@ -302,10 +302,10 @@ struct rsnd_priv {
void *gen;

/*
* below value will be filled on rsnd_scu_probe()
* below value will be filled on rsnd_src_probe()
*/
void *scu;
int scu_nr;
void *src;
int src_nr;

/*
* below value will be filled on rsnd_adg_probe()
Expand Down Expand Up @@ -345,22 +345,22 @@ struct rsnd_priv {
})

/*
* R-Car SCU
* R-Car SRC
*/
int rsnd_scu_probe(struct platform_device *pdev,
int rsnd_src_probe(struct platform_device *pdev,
struct rsnd_priv *priv);
struct rsnd_mod *rsnd_scu_mod_get(struct rsnd_priv *priv, int id);
unsigned int rsnd_scu_get_ssi_rate(struct rsnd_priv *priv,
struct rsnd_mod *rsnd_src_mod_get(struct rsnd_priv *priv, int id);
unsigned int rsnd_src_get_ssi_rate(struct rsnd_priv *priv,
struct rsnd_dai_stream *io,
struct snd_pcm_runtime *runtime);
int rsnd_scu_ssi_mode_init(struct rsnd_mod *ssi_mod,
int rsnd_src_ssi_mode_init(struct rsnd_mod *ssi_mod,
struct rsnd_dai *rdai,
struct rsnd_dai_stream *io);
int rsnd_scu_enable_ssi_irq(struct rsnd_mod *ssi_mod,
int rsnd_src_enable_ssi_irq(struct rsnd_mod *ssi_mod,
struct rsnd_dai *rdai,
struct rsnd_dai_stream *io);

#define rsnd_scu_nr(priv) ((priv)->scu_nr)
#define rsnd_src_nr(priv) ((priv)->src_nr)

/*
* R-Car SSI
Expand Down
Loading

0 comments on commit ba9c949

Please sign in to comment.