diff options
author | Jarkko Nikula <jarkko.nikula@nokia.com> | 2008-10-09 08:57:22 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-10-12 20:17:48 -0400 |
commit | 8def464dddd61686e00e96db714a2930a08ef272 (patch) | |
tree | 6de64fb6328a99cead3e2f712a476e735f1b1cba /sound/soc/omap/omap-mcbsp.c | |
parent | 9296bb43f1a3b60ab2e9c4ff48a296cacff117a9 (diff) |
ALSA: ASoC: OMAP: Add multilink support to McBSP DAI driver
Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/soc/omap/omap-mcbsp.c')
-rw-r--r-- | sound/soc/omap/omap-mcbsp.c | 72 |
1 files changed, 42 insertions, 30 deletions
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index fb920e1b551e..d32eb4703cfe 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c | |||
@@ -381,37 +381,49 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai, | |||
381 | return err; | 381 | return err; |
382 | } | 382 | } |
383 | 383 | ||
384 | struct snd_soc_dai omap_mcbsp_dai[NUM_LINKS] = { | 384 | #define OMAP_MCBSP_DAI_BUILDER(link_id) \ |
385 | { | 385 | { \ |
386 | .name = "omap-mcbsp-dai", | 386 | .name = "omap-mcbsp-dai-(link_id)", \ |
387 | .id = 0, | 387 | .id = (link_id), \ |
388 | .type = SND_SOC_DAI_I2S, | 388 | .type = SND_SOC_DAI_I2S, \ |
389 | .playback = { | 389 | .playback = { \ |
390 | .channels_min = 2, | 390 | .channels_min = 2, \ |
391 | .channels_max = 2, | 391 | .channels_max = 2, \ |
392 | .rates = OMAP_MCBSP_RATES, | 392 | .rates = OMAP_MCBSP_RATES, \ |
393 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | 393 | .formats = SNDRV_PCM_FMTBIT_S16_LE, \ |
394 | }, | 394 | }, \ |
395 | .capture = { | 395 | .capture = { \ |
396 | .channels_min = 2, | 396 | .channels_min = 2, \ |
397 | .channels_max = 2, | 397 | .channels_max = 2, \ |
398 | .rates = OMAP_MCBSP_RATES, | 398 | .rates = OMAP_MCBSP_RATES, \ |
399 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | 399 | .formats = SNDRV_PCM_FMTBIT_S16_LE, \ |
400 | }, | 400 | }, \ |
401 | .ops = { | 401 | .ops = { \ |
402 | .startup = omap_mcbsp_dai_startup, | 402 | .startup = omap_mcbsp_dai_startup, \ |
403 | .shutdown = omap_mcbsp_dai_shutdown, | 403 | .shutdown = omap_mcbsp_dai_shutdown, \ |
404 | .trigger = omap_mcbsp_dai_trigger, | 404 | .trigger = omap_mcbsp_dai_trigger, \ |
405 | .hw_params = omap_mcbsp_dai_hw_params, | 405 | .hw_params = omap_mcbsp_dai_hw_params, \ |
406 | }, | 406 | }, \ |
407 | .dai_ops = { | 407 | .dai_ops = { \ |
408 | .set_fmt = omap_mcbsp_dai_set_dai_fmt, | 408 | .set_fmt = omap_mcbsp_dai_set_dai_fmt, \ |
409 | .set_clkdiv = omap_mcbsp_dai_set_clkdiv, | 409 | .set_clkdiv = omap_mcbsp_dai_set_clkdiv, \ |
410 | .set_sysclk = omap_mcbsp_dai_set_dai_sysclk, | 410 | .set_sysclk = omap_mcbsp_dai_set_dai_sysclk, \ |
411 | }, | 411 | }, \ |
412 | .private_data = &mcbsp_data[0].bus_id, | 412 | .private_data = &mcbsp_data[(link_id)].bus_id, \ |
413 | }, | 413 | } |
414 | |||
415 | struct snd_soc_dai omap_mcbsp_dai[] = { | ||
416 | OMAP_MCBSP_DAI_BUILDER(0), | ||
417 | OMAP_MCBSP_DAI_BUILDER(1), | ||
418 | #if NUM_LINKS >= 3 | ||
419 | OMAP_MCBSP_DAI_BUILDER(2), | ||
420 | #endif | ||
421 | #if NUM_LINKS == 5 | ||
422 | OMAP_MCBSP_DAI_BUILDER(3), | ||
423 | OMAP_MCBSP_DAI_BUILDER(4), | ||
424 | #endif | ||
414 | }; | 425 | }; |
426 | |||
415 | EXPORT_SYMBOL_GPL(omap_mcbsp_dai); | 427 | EXPORT_SYMBOL_GPL(omap_mcbsp_dai); |
416 | 428 | ||
417 | MODULE_AUTHOR("Jarkko Nikula <jarkko.nikula@nokia.com>"); | 429 | MODULE_AUTHOR("Jarkko Nikula <jarkko.nikula@nokia.com>"); |