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

ASoC: ti: merge DAI call back functions into ops

ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ttt9b0vw.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 624fee45
...@@ -601,16 +601,6 @@ static void davinci_i2s_shutdown(struct snd_pcm_substream *substream, ...@@ -601,16 +601,6 @@ static void davinci_i2s_shutdown(struct snd_pcm_substream *substream,
#define DAVINCI_I2S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ #define DAVINCI_I2S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \
SNDRV_PCM_FMTBIT_S32_LE) SNDRV_PCM_FMTBIT_S32_LE)
static const struct snd_soc_dai_ops davinci_i2s_dai_ops = {
.shutdown = davinci_i2s_shutdown,
.prepare = davinci_i2s_prepare,
.trigger = davinci_i2s_trigger,
.hw_params = davinci_i2s_hw_params,
.set_fmt = davinci_i2s_set_dai_fmt,
.set_clkdiv = davinci_i2s_dai_set_clkdiv,
};
static int davinci_i2s_dai_probe(struct snd_soc_dai *dai) static int davinci_i2s_dai_probe(struct snd_soc_dai *dai)
{ {
struct davinci_mcbsp_dev *dev = snd_soc_dai_get_drvdata(dai); struct davinci_mcbsp_dev *dev = snd_soc_dai_get_drvdata(dai);
...@@ -622,8 +612,18 @@ static int davinci_i2s_dai_probe(struct snd_soc_dai *dai) ...@@ -622,8 +612,18 @@ static int davinci_i2s_dai_probe(struct snd_soc_dai *dai)
return 0; return 0;
} }
static const struct snd_soc_dai_ops davinci_i2s_dai_ops = {
.probe = davinci_i2s_dai_probe,
.shutdown = davinci_i2s_shutdown,
.prepare = davinci_i2s_prepare,
.trigger = davinci_i2s_trigger,
.hw_params = davinci_i2s_hw_params,
.set_fmt = davinci_i2s_set_dai_fmt,
.set_clkdiv = davinci_i2s_dai_set_clkdiv,
};
static struct snd_soc_dai_driver davinci_i2s_dai = { static struct snd_soc_dai_driver davinci_i2s_dai = {
.probe = davinci_i2s_dai_probe,
.playback = { .playback = {
.channels_min = 2, .channels_min = 2,
.channels_max = 2, .channels_max = 2,
......
...@@ -1616,18 +1616,6 @@ static void davinci_mcasp_shutdown(struct snd_pcm_substream *substream, ...@@ -1616,18 +1616,6 @@ static void davinci_mcasp_shutdown(struct snd_pcm_substream *substream,
} }
} }
static const struct snd_soc_dai_ops davinci_mcasp_dai_ops = {
.startup = davinci_mcasp_startup,
.shutdown = davinci_mcasp_shutdown,
.trigger = davinci_mcasp_trigger,
.delay = davinci_mcasp_delay,
.hw_params = davinci_mcasp_hw_params,
.set_fmt = davinci_mcasp_set_dai_fmt,
.set_clkdiv = davinci_mcasp_set_clkdiv,
.set_sysclk = davinci_mcasp_set_sysclk,
.set_tdm_slot = davinci_mcasp_set_tdm_slot,
};
static int davinci_mcasp_iec958_info(struct snd_kcontrol *kcontrol, static int davinci_mcasp_iec958_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) struct snd_ctl_elem_info *uinfo)
{ {
...@@ -1716,6 +1704,19 @@ static int davinci_mcasp_dai_probe(struct snd_soc_dai *dai) ...@@ -1716,6 +1704,19 @@ static int davinci_mcasp_dai_probe(struct snd_soc_dai *dai)
return 0; return 0;
} }
static const struct snd_soc_dai_ops davinci_mcasp_dai_ops = {
.probe = davinci_mcasp_dai_probe,
.startup = davinci_mcasp_startup,
.shutdown = davinci_mcasp_shutdown,
.trigger = davinci_mcasp_trigger,
.delay = davinci_mcasp_delay,
.hw_params = davinci_mcasp_hw_params,
.set_fmt = davinci_mcasp_set_dai_fmt,
.set_clkdiv = davinci_mcasp_set_clkdiv,
.set_sysclk = davinci_mcasp_set_sysclk,
.set_tdm_slot = davinci_mcasp_set_tdm_slot,
};
#define DAVINCI_MCASP_RATES SNDRV_PCM_RATE_8000_192000 #define DAVINCI_MCASP_RATES SNDRV_PCM_RATE_8000_192000
#define DAVINCI_MCASP_PCM_FMTS (SNDRV_PCM_FMTBIT_S8 | \ #define DAVINCI_MCASP_PCM_FMTS (SNDRV_PCM_FMTBIT_S8 | \
...@@ -1732,7 +1733,6 @@ static int davinci_mcasp_dai_probe(struct snd_soc_dai *dai) ...@@ -1732,7 +1733,6 @@ static int davinci_mcasp_dai_probe(struct snd_soc_dai *dai)
static struct snd_soc_dai_driver davinci_mcasp_dai[] = { static struct snd_soc_dai_driver davinci_mcasp_dai[] = {
{ {
.name = "davinci-mcasp.0", .name = "davinci-mcasp.0",
.probe = davinci_mcasp_dai_probe,
.playback = { .playback = {
.stream_name = "IIS Playback", .stream_name = "IIS Playback",
.channels_min = 1, .channels_min = 1,
...@@ -1753,7 +1753,6 @@ static struct snd_soc_dai_driver davinci_mcasp_dai[] = { ...@@ -1753,7 +1753,6 @@ static struct snd_soc_dai_driver davinci_mcasp_dai[] = {
}, },
{ {
.name = "davinci-mcasp.1", .name = "davinci-mcasp.1",
.probe = davinci_mcasp_dai_probe,
.playback = { .playback = {
.stream_name = "DIT Playback", .stream_name = "DIT Playback",
.channels_min = 1, .channels_min = 1,
......
...@@ -401,15 +401,6 @@ static int omap_dmic_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id, ...@@ -401,15 +401,6 @@ static int omap_dmic_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id,
return -EINVAL; return -EINVAL;
} }
static const struct snd_soc_dai_ops omap_dmic_dai_ops = {
.startup = omap_dmic_dai_startup,
.shutdown = omap_dmic_dai_shutdown,
.hw_params = omap_dmic_dai_hw_params,
.prepare = omap_dmic_dai_prepare,
.trigger = omap_dmic_dai_trigger,
.set_sysclk = omap_dmic_set_dai_sysclk,
};
static int omap_dmic_probe(struct snd_soc_dai *dai) static int omap_dmic_probe(struct snd_soc_dai *dai)
{ {
struct omap_dmic *dmic = snd_soc_dai_get_drvdata(dai); struct omap_dmic *dmic = snd_soc_dai_get_drvdata(dai);
...@@ -438,10 +429,19 @@ static int omap_dmic_remove(struct snd_soc_dai *dai) ...@@ -438,10 +429,19 @@ static int omap_dmic_remove(struct snd_soc_dai *dai)
return 0; return 0;
} }
static const struct snd_soc_dai_ops omap_dmic_dai_ops = {
.probe = omap_dmic_probe,
.remove = omap_dmic_remove,
.startup = omap_dmic_dai_startup,
.shutdown = omap_dmic_dai_shutdown,
.hw_params = omap_dmic_dai_hw_params,
.prepare = omap_dmic_dai_prepare,
.trigger = omap_dmic_dai_trigger,
.set_sysclk = omap_dmic_set_dai_sysclk,
};
static struct snd_soc_dai_driver omap_dmic_dai = { static struct snd_soc_dai_driver omap_dmic_dai = {
.name = "omap-dmic", .name = "omap-dmic",
.probe = omap_dmic_probe,
.remove = omap_dmic_remove,
.capture = { .capture = {
.channels_min = 2, .channels_min = 2,
.channels_max = 6, .channels_max = 6,
......
...@@ -1254,18 +1254,6 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai, ...@@ -1254,18 +1254,6 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
return err; return err;
} }
static const struct snd_soc_dai_ops mcbsp_dai_ops = {
.startup = omap_mcbsp_dai_startup,
.shutdown = omap_mcbsp_dai_shutdown,
.prepare = omap_mcbsp_dai_prepare,
.trigger = omap_mcbsp_dai_trigger,
.delay = omap_mcbsp_dai_delay,
.hw_params = omap_mcbsp_dai_hw_params,
.set_fmt = omap_mcbsp_dai_set_dai_fmt,
.set_clkdiv = omap_mcbsp_dai_set_clkdiv,
.set_sysclk = omap_mcbsp_dai_set_dai_sysclk,
};
static int omap_mcbsp_probe(struct snd_soc_dai *dai) static int omap_mcbsp_probe(struct snd_soc_dai *dai)
{ {
struct omap_mcbsp *mcbsp = snd_soc_dai_get_drvdata(dai); struct omap_mcbsp *mcbsp = snd_soc_dai_get_drvdata(dai);
...@@ -1288,9 +1276,21 @@ static int omap_mcbsp_remove(struct snd_soc_dai *dai) ...@@ -1288,9 +1276,21 @@ static int omap_mcbsp_remove(struct snd_soc_dai *dai)
return 0; return 0;
} }
static const struct snd_soc_dai_ops mcbsp_dai_ops = {
.probe = omap_mcbsp_probe,
.remove = omap_mcbsp_remove,
.startup = omap_mcbsp_dai_startup,
.shutdown = omap_mcbsp_dai_shutdown,
.prepare = omap_mcbsp_dai_prepare,
.trigger = omap_mcbsp_dai_trigger,
.delay = omap_mcbsp_dai_delay,
.hw_params = omap_mcbsp_dai_hw_params,
.set_fmt = omap_mcbsp_dai_set_dai_fmt,
.set_clkdiv = omap_mcbsp_dai_set_clkdiv,
.set_sysclk = omap_mcbsp_dai_set_dai_sysclk,
};
static struct snd_soc_dai_driver omap_mcbsp_dai = { static struct snd_soc_dai_driver omap_mcbsp_dai = {
.probe = omap_mcbsp_probe,
.remove = omap_mcbsp_remove,
.playback = { .playback = {
.channels_min = 1, .channels_min = 1,
.channels_max = 16, .channels_max = 16,
......
...@@ -404,13 +404,6 @@ static int omap_mcpdm_prepare(struct snd_pcm_substream *substream, ...@@ -404,13 +404,6 @@ static int omap_mcpdm_prepare(struct snd_pcm_substream *substream,
return 0; return 0;
} }
static const struct snd_soc_dai_ops omap_mcpdm_dai_ops = {
.startup = omap_mcpdm_dai_startup,
.shutdown = omap_mcpdm_dai_shutdown,
.hw_params = omap_mcpdm_dai_hw_params,
.prepare = omap_mcpdm_prepare,
};
static int omap_mcpdm_probe(struct snd_soc_dai *dai) static int omap_mcpdm_probe(struct snd_soc_dai *dai)
{ {
struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai);
...@@ -457,6 +450,17 @@ static int omap_mcpdm_remove(struct snd_soc_dai *dai) ...@@ -457,6 +450,17 @@ static int omap_mcpdm_remove(struct snd_soc_dai *dai)
return 0; return 0;
} }
static const struct snd_soc_dai_ops omap_mcpdm_dai_ops = {
.probe = omap_mcpdm_probe,
.remove = omap_mcpdm_remove,
.startup = omap_mcpdm_dai_startup,
.shutdown = omap_mcpdm_dai_shutdown,
.hw_params = omap_mcpdm_dai_hw_params,
.prepare = omap_mcpdm_prepare,
.probe_order = SND_SOC_COMP_ORDER_LATE,
.remove_order = SND_SOC_COMP_ORDER_EARLY,
};
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
static int omap_mcpdm_suspend(struct snd_soc_component *component) static int omap_mcpdm_suspend(struct snd_soc_component *component)
{ {
...@@ -502,10 +506,6 @@ static int omap_mcpdm_resume(struct snd_soc_component *component) ...@@ -502,10 +506,6 @@ static int omap_mcpdm_resume(struct snd_soc_component *component)
#define OMAP_MCPDM_FORMATS SNDRV_PCM_FMTBIT_S32_LE #define OMAP_MCPDM_FORMATS SNDRV_PCM_FMTBIT_S32_LE
static struct snd_soc_dai_driver omap_mcpdm_dai = { static struct snd_soc_dai_driver omap_mcpdm_dai = {
.probe = omap_mcpdm_probe,
.remove = omap_mcpdm_remove,
.probe_order = SND_SOC_COMP_ORDER_LATE,
.remove_order = SND_SOC_COMP_ORDER_EARLY,
.playback = { .playback = {
.channels_min = 1, .channels_min = 1,
.channels_max = 5, .channels_max = 5,
......
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