Commit 8def464d authored by Jarkko Nikula's avatar Jarkko Nikula Committed by Takashi Iwai

ALSA: ASoC: OMAP: Add multilink support to McBSP DAI driver

Signed-off-by: default avatarJarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 9296bb43
...@@ -381,37 +381,49 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai, ...@@ -381,37 +381,49 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
return err; return err;
} }
struct snd_soc_dai omap_mcbsp_dai[NUM_LINKS] = { #define OMAP_MCBSP_DAI_BUILDER(link_id) \
{ { \
.name = "omap-mcbsp-dai", .name = "omap-mcbsp-dai-(link_id)", \
.id = 0, .id = (link_id), \
.type = SND_SOC_DAI_I2S, .type = SND_SOC_DAI_I2S, \
.playback = { .playback = { \
.channels_min = 2, .channels_min = 2, \
.channels_max = 2, .channels_max = 2, \
.rates = OMAP_MCBSP_RATES, .rates = OMAP_MCBSP_RATES, \
.formats = SNDRV_PCM_FMTBIT_S16_LE, .formats = SNDRV_PCM_FMTBIT_S16_LE, \
}, }, \
.capture = { .capture = { \
.channels_min = 2, .channels_min = 2, \
.channels_max = 2, .channels_max = 2, \
.rates = OMAP_MCBSP_RATES, .rates = OMAP_MCBSP_RATES, \
.formats = SNDRV_PCM_FMTBIT_S16_LE, .formats = SNDRV_PCM_FMTBIT_S16_LE, \
}, }, \
.ops = { .ops = { \
.startup = omap_mcbsp_dai_startup, .startup = omap_mcbsp_dai_startup, \
.shutdown = omap_mcbsp_dai_shutdown, .shutdown = omap_mcbsp_dai_shutdown, \
.trigger = omap_mcbsp_dai_trigger, .trigger = omap_mcbsp_dai_trigger, \
.hw_params = omap_mcbsp_dai_hw_params, .hw_params = omap_mcbsp_dai_hw_params, \
}, }, \
.dai_ops = { .dai_ops = { \
.set_fmt = omap_mcbsp_dai_set_dai_fmt, .set_fmt = omap_mcbsp_dai_set_dai_fmt, \
.set_clkdiv = omap_mcbsp_dai_set_clkdiv, .set_clkdiv = omap_mcbsp_dai_set_clkdiv, \
.set_sysclk = omap_mcbsp_dai_set_dai_sysclk, .set_sysclk = omap_mcbsp_dai_set_dai_sysclk, \
}, }, \
.private_data = &mcbsp_data[0].bus_id, .private_data = &mcbsp_data[(link_id)].bus_id, \
}, }
struct snd_soc_dai omap_mcbsp_dai[] = {
OMAP_MCBSP_DAI_BUILDER(0),
OMAP_MCBSP_DAI_BUILDER(1),
#if NUM_LINKS >= 3
OMAP_MCBSP_DAI_BUILDER(2),
#endif
#if NUM_LINKS == 5
OMAP_MCBSP_DAI_BUILDER(3),
OMAP_MCBSP_DAI_BUILDER(4),
#endif
}; };
EXPORT_SYMBOL_GPL(omap_mcbsp_dai); EXPORT_SYMBOL_GPL(omap_mcbsp_dai);
MODULE_AUTHOR("Jarkko Nikula <jarkko.nikula@nokia.com>"); MODULE_AUTHOR("Jarkko Nikula <jarkko.nikula@nokia.com>");
......
...@@ -38,11 +38,17 @@ enum omap_mcbsp_div { ...@@ -38,11 +38,17 @@ enum omap_mcbsp_div {
OMAP_MCBSP_CLKGDV, /* Sample rate generator divider */ OMAP_MCBSP_CLKGDV, /* Sample rate generator divider */
}; };
/* #if defined(CONFIG_ARCH_OMAP2420)
* REVISIT: Preparation for the ASoC v2. Let the number of available links to #define NUM_LINKS 2
* be same than number of McBSP ports found in OMAP(s) we are compiling for. #endif
*/ #if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX)
#define NUM_LINKS 1 #undef NUM_LINKS
#define NUM_LINKS 3
#endif
#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP34XX)
#undef NUM_LINKS
#define NUM_LINKS 5
#endif
extern struct snd_soc_dai omap_mcbsp_dai[NUM_LINKS]; extern struct snd_soc_dai omap_mcbsp_dai[NUM_LINKS];
......
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