Commit ba9c949f authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: rsnd: rename scu to src

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: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 9524be0e
......@@ -55,14 +55,18 @@ 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 */
......@@ -70,7 +74,7 @@ struct rsnd_scu_platform_info {
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 {
......@@ -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);
......
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
\ No newline at end of file
......@@ -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]
* ...
*
*
......@@ -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
......@@ -587,8 +587,8 @@ 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,
......@@ -596,14 +596,14 @@ static int rsnd_path_init(struct rsnd_priv *priv,
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;
......@@ -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,
};
......
......@@ -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,
};
......@@ -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];
......@@ -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()
......@@ -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
......
......@@ -121,7 +121,7 @@ static int rsnd_ssi_master_clk_start(struct rsnd_ssi *ssi,
1, 2, 4, 8, 16, 6, 12,
};
unsigned int main_rate;
unsigned int rate = rsnd_scu_get_ssi_rate(priv, io, runtime);
unsigned int rate = rsnd_src_get_ssi_rate(priv, io, runtime);
/*
* Find best clock, and try to start ADG
......@@ -287,7 +287,7 @@ static int rsnd_ssi_init(struct rsnd_mod *mod,
ssi->cr_own = cr;
ssi->err = -1; /* ignore 1st error */
rsnd_scu_ssi_mode_init(mod, rdai, io);
rsnd_src_ssi_mode_init(mod, rdai, io);
return 0;
}
......@@ -387,7 +387,7 @@ static int rsnd_ssi_pio_start(struct rsnd_mod *mod,
/* enable PIO IRQ */
ssi->cr_etc = UIEN | OIEN | DIEN;
rsnd_scu_enable_ssi_irq(mod, rdai, io);
rsnd_src_enable_ssi_irq(mod, rdai, io);
rsnd_ssi_hw_start(ssi, rdai, io);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment