2 * at91-i2s.c -- ALSA SoC I2S Audio Layer Platform driver
4 * Author: Frank Mandarino <fmandarino@endrelia.com>
5 * Endrelia Technologies Inc.
7 * Based on pxa2xx Platform drivers by
8 * Liam Girdwood <liam.girdwood@wolfsonmicro.com>
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
17 #include <linux/init.h>
18 #include <linux/module.h>
19 #include <linux/interrupt.h>
20 #include <linux/device.h>
21 #include <linux/delay.h>
22 #include <linux/clk.h>
23 #include <sound/driver.h>
24 #include <sound/core.h>
25 #include <sound/pcm.h>
26 #include <sound/initval.h>
27 #include <sound/soc.h>
29 #include <asm/arch/hardware.h>
30 #include <asm/arch/at91_pmc.h>
31 #include <asm/arch/at91_ssc.h>
32 #include <asm/arch/at91_pdc.h>
38 #define DBG(x...) printk(KERN_DEBUG "at91-i2s:" x)
43 #if defined(CONFIG_ARCH_AT91SAM9260)
44 #define NUM_SSC_DEVICES 1
46 #define NUM_SSC_DEVICES 3
51 * SSC PDC registers required by the PCM DMA engine.
53 static struct at91_pdc_regs pdc_tx_reg = {
56 .xnpr = AT91_PDC_TNPR,
57 .xncr = AT91_PDC_TNCR,
60 static struct at91_pdc_regs pdc_rx_reg = {
63 .xnpr = AT91_PDC_RNPR,
64 .xncr = AT91_PDC_RNCR,
68 * SSC & PDC status bits for transmit and receive.
70 static struct at91_ssc_mask ssc_tx_mask = {
71 .ssc_enable = AT91_SSC_TXEN,
72 .ssc_disable = AT91_SSC_TXDIS,
73 .ssc_endx = AT91_SSC_ENDTX,
74 .ssc_endbuf = AT91_SSC_TXBUFE,
75 .pdc_enable = AT91_PDC_TXTEN,
76 .pdc_disable = AT91_PDC_TXTDIS,
79 static struct at91_ssc_mask ssc_rx_mask = {
80 .ssc_enable = AT91_SSC_RXEN,
81 .ssc_disable = AT91_SSC_RXDIS,
82 .ssc_endx = AT91_SSC_ENDRX,
83 .ssc_endbuf = AT91_SSC_RXBUFF,
84 .pdc_enable = AT91_PDC_RXTEN,
85 .pdc_disable = AT91_PDC_RXTDIS,
92 static struct at91_pcm_dma_params ssc_dma_params[NUM_SSC_DEVICES][2] = {
94 .name = "SSC0/I2S PCM Stereo out",
99 .name = "SSC0/I2S PCM Stereo in",
101 .mask = &ssc_rx_mask,
103 #if NUM_SSC_DEVICES == 3
105 .name = "SSC1/I2S PCM Stereo out",
107 .mask = &ssc_tx_mask,
110 .name = "SSC1/I2S PCM Stereo in",
112 .mask = &ssc_rx_mask,
115 .name = "SSC2/I2S PCM Stereo out",
117 .mask = &ssc_tx_mask,
120 .name = "SSC1/I2S PCM Stereo in",
122 .mask = &ssc_rx_mask,
127 struct at91_ssc_state {
137 static struct at91_ssc_info {
139 struct at91_ssc_periph ssc;
140 spinlock_t lock; /* lock for dir_mask */
141 unsigned short dir_mask; /* 0=unused, 1=playback, 2=capture */
142 unsigned short initialized; /* 1=SSC has been initialized */
143 unsigned short daifmt;
144 unsigned short cmr_div;
145 unsigned short tcmr_period;
146 unsigned short rcmr_period;
147 struct at91_pcm_dma_params *dma_params[2];
148 struct at91_ssc_state ssc_state;
150 } ssc_info[NUM_SSC_DEVICES] = {
153 .lock = SPIN_LOCK_UNLOCKED,
157 #if NUM_SSC_DEVICES == 3
160 .lock = SPIN_LOCK_UNLOCKED,
166 .lock = SPIN_LOCK_UNLOCKED,
173 static unsigned int at91_i2s_sysclk;
176 * SSC interrupt handler. Passes PDC interrupts to the DMA
177 * interrupt handler in the PCM driver.
179 static irqreturn_t at91_i2s_interrupt(int irq, void *dev_id)
181 struct at91_ssc_info *ssc_p = dev_id;
182 struct at91_pcm_dma_params *dma_params;
186 ssc_sr = at91_ssc_read(ssc_p->ssc.base + AT91_SSC_SR)
187 & at91_ssc_read(ssc_p->ssc.base + AT91_SSC_IMR);
190 * Loop through the substreams attached to this SSC. If
191 * a DMA-related interrupt occurred on that substream, call
192 * the DMA interrupt handler function, if one has been
193 * registered in the dma_params structure by the PCM driver.
195 for (i = 0; i < ARRAY_SIZE(ssc_p->dma_params); i++) {
196 dma_params = ssc_p->dma_params[i];
198 if (dma_params != NULL && dma_params->dma_intr_handler != NULL &&
200 (dma_params->mask->ssc_endx | dma_params->mask->ssc_endbuf)))
202 dma_params->dma_intr_handler(ssc_sr, dma_params->substream);
209 * Startup. Only that one substream allowed in each direction.
211 static int at91_i2s_startup(struct snd_pcm_substream *substream)
213 struct snd_soc_pcm_runtime *rtd = substream->private_data;
214 struct at91_ssc_info *ssc_p = &ssc_info[rtd->dai->cpu_dai->id];
217 DBG("i2s_startup: SSC_SR=0x%08lx\n",
218 at91_ssc_read(ssc_p->ssc.base + AT91_SSC_SR));
219 dir_mask = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0x1 : 0x2;
221 spin_lock_irq(&ssc_p->lock);
222 if (ssc_p->dir_mask & dir_mask) {
223 spin_unlock_irq(&ssc_p->lock);
226 ssc_p->dir_mask |= dir_mask;
227 spin_unlock_irq(&ssc_p->lock);
233 * Shutdown. Clear DMA parameters and shutdown the SSC if there
234 * are no other substreams open.
236 static void at91_i2s_shutdown(struct snd_pcm_substream *substream)
238 struct snd_soc_pcm_runtime *rtd = substream->private_data;
239 struct at91_ssc_info *ssc_p = &ssc_info[rtd->dai->cpu_dai->id];
240 struct at91_pcm_dma_params *dma_params;
243 dir = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0 : 1;
244 dma_params = ssc_p->dma_params[dir];
246 if (dma_params != NULL) {
247 at91_ssc_write(dma_params->ssc_base + AT91_SSC_CR,
248 dma_params->mask->ssc_disable);
249 DBG("%s disabled SSC_SR=0x%08lx\n", (dir ? "receive" : "transmit"),
250 at91_ssc_read(ssc_p->ssc.base + AT91_SSC_SR));
252 dma_params->ssc_base = NULL;
253 dma_params->substream = NULL;
254 ssc_p->dma_params[dir] = NULL;
259 spin_lock_irq(&ssc_p->lock);
260 ssc_p->dir_mask &= ~dir_mask;
261 if (!ssc_p->dir_mask) {
262 /* Shutdown the SSC clock. */
263 DBG("Stopping pid %d clock\n", ssc_p->ssc.pid);
264 at91_sys_write(AT91_PMC_PCDR, 1<<ssc_p->ssc.pid);
266 if (ssc_p->initialized) {
267 free_irq(ssc_p->ssc.pid, ssc_p);
268 ssc_p->initialized = 0;
272 at91_ssc_write(ssc_p->ssc.base + AT91_SSC_CR, AT91_SSC_SWRST);
274 /* Clear the SSC dividers */
275 ssc_p->cmr_div = ssc_p->tcmr_period = ssc_p->rcmr_period = 0;
277 spin_unlock_irq(&ssc_p->lock);
281 * Record the SSC system clock rate.
283 static int at91_i2s_set_dai_sysclk(struct snd_soc_cpu_dai *cpu_dai,
284 int clk_id, unsigned int freq, int dir)
287 * The only clock supplied to the SSC is the AT91 master clock,
288 * which is only used if the SSC is generating BCLK and/or
292 case AT91_SYSCLK_MCK:
293 at91_i2s_sysclk = freq;
303 * Record the DAI format for use in hw_params().
305 static int at91_i2s_set_dai_fmt(struct snd_soc_cpu_dai *cpu_dai,
308 struct at91_ssc_info *ssc_p = &ssc_info[cpu_dai->id];
310 if ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) != SND_SOC_DAIFMT_I2S)
318 * Record SSC clock dividers for use in hw_params().
320 static int at91_i2s_set_dai_clkdiv(struct snd_soc_cpu_dai *cpu_dai,
323 struct at91_ssc_info *ssc_p = &ssc_info[cpu_dai->id];
326 case AT91SSC_CMR_DIV:
328 * The same master clock divider is used for both
329 * transmit and receive, so if a value has already
330 * been set, it must match this value.
332 if (ssc_p->cmr_div == 0)
333 ssc_p->cmr_div = div;
335 if (div != ssc_p->cmr_div)
339 case AT91SSC_TCMR_PERIOD:
340 ssc_p->tcmr_period = div;
343 case AT91SSC_RCMR_PERIOD:
344 ssc_p->rcmr_period = div;
357 static int at91_i2s_hw_params(struct snd_pcm_substream *substream,
358 struct snd_pcm_hw_params *params)
360 struct snd_soc_pcm_runtime *rtd = substream->private_data;
361 int id = rtd->dai->cpu_dai->id;
362 struct at91_ssc_info *ssc_p = &ssc_info[id];
363 struct at91_pcm_dma_params *dma_params;
364 int dir, channels, bits;
365 u32 tfmr, rfmr, tcmr, rcmr;
370 * Currently, there is only one set of dma params for
371 * each direction. If more are added, this code will
372 * have to be changed to select the proper set.
374 dir = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0 : 1;
376 dma_params = &ssc_dma_params[id][dir];
377 dma_params->ssc_base = ssc_p->ssc.base;
378 dma_params->substream = substream;
380 ssc_p->dma_params[dir] = dma_params;
383 * The cpu_dai->dma_data field is only used to communicate the
384 * appropriate DMA parameters to the pcm driver hw_params()
385 * function. It should not be used for other purposes
386 * as it is common to all substreams.
388 rtd->dai->cpu_dai->dma_data = dma_params;
390 channels = params_channels(params);
393 * The SSC only supports up to 16-bit samples in I2S format, due
394 * to the size of the Frame Mode Register FSLEN field. Also, I2S
395 * implies signed data.
398 dma_params->pdc_xfer_size = 2;
401 * Compute SSC register settings.
403 switch (ssc_p->daifmt) {
404 case SND_SOC_DAIFMT_CBS_CFS:
406 * SSC provides BCLK and LRC clocks.
408 * The SSC transmit and receive clocks are generated from the
409 * MCK divider, and the BCLK signal is output on the SSC TK line.
411 rcmr = (( ssc_p->rcmr_period << 24) & AT91_SSC_PERIOD)
412 | (( 1 << 16) & AT91_SSC_STTDLY)
413 | (( AT91_SSC_START_FALLING_RF ) & AT91_SSC_START)
414 | (( AT91_SSC_CK_RISING ) & AT91_SSC_CKI)
415 | (( AT91_SSC_CKO_NONE ) & AT91_SSC_CKO)
416 | (( AT91_SSC_CKS_DIV ) & AT91_SSC_CKS);
418 rfmr = (( AT91_SSC_FSEDGE_POSITIVE ) & AT91_SSC_FSEDGE)
419 | (( AT91_SSC_FSOS_NEGATIVE ) & AT91_SSC_FSOS)
420 | (((bits - 1) << 16) & AT91_SSC_FSLEN)
421 | (((channels - 1) << 8) & AT91_SSC_DATNB)
422 | (( 1 << 7) & AT91_SSC_MSBF)
423 | (( 0 << 5) & AT91_SSC_LOOP)
424 | (((bits - 1) << 0) & AT91_SSC_DATALEN);
426 tcmr = (( ssc_p->tcmr_period << 24) & AT91_SSC_PERIOD)
427 | (( 1 << 16) & AT91_SSC_STTDLY)
428 | (( AT91_SSC_START_FALLING_RF ) & AT91_SSC_START)
429 | (( AT91_SSC_CKI_FALLING ) & AT91_SSC_CKI)
430 | (( AT91_SSC_CKO_CONTINUOUS ) & AT91_SSC_CKO)
431 | (( AT91_SSC_CKS_DIV ) & AT91_SSC_CKS);
433 tfmr = (( AT91_SSC_FSEDGE_POSITIVE ) & AT91_SSC_FSEDGE)
434 | (( 0 << 23) & AT91_SSC_FSDEN)
435 | (( AT91_SSC_FSOS_NEGATIVE ) & AT91_SSC_FSOS)
436 | (((bits - 1) << 16) & AT91_SSC_FSLEN)
437 | (((channels - 1) << 8) & AT91_SSC_DATNB)
438 | (( 1 << 7) & AT91_SSC_MSBF)
439 | (( 0 << 5) & AT91_SSC_DATDEF)
440 | (((bits - 1) << 0) & AT91_SSC_DATALEN);
443 case SND_SOC_DAIFMT_CBM_CFM:
446 * CODEC supplies BCLK and LRC clocks.
448 * The SSC transmit clock is obtained from the BCLK signal on
449 * on the TK line, and the SSC receive clock is generated from the
452 * For single channel data, one sample is transferred on the falling
453 * edge of the LRC clock. For two channel data, one sample is
454 * transferred on both edges of the LRC clock.
456 start_event = channels == 1
457 ? AT91_SSC_START_FALLING_RF
458 : AT91_SSC_START_EDGE_RF;
460 rcmr = (( 0 << 24) & AT91_SSC_PERIOD)
461 | (( 1 << 16) & AT91_SSC_STTDLY)
462 | (( start_event ) & AT91_SSC_START)
463 | (( AT91_SSC_CK_RISING ) & AT91_SSC_CKI)
464 | (( AT91_SSC_CKO_NONE ) & AT91_SSC_CKO)
465 | (( AT91_SSC_CKS_CLOCK ) & AT91_SSC_CKS);
467 rfmr = (( AT91_SSC_FSEDGE_POSITIVE ) & AT91_SSC_FSEDGE)
468 | (( AT91_SSC_FSOS_NONE ) & AT91_SSC_FSOS)
469 | (( 0 << 16) & AT91_SSC_FSLEN)
470 | (( 0 << 8) & AT91_SSC_DATNB)
471 | (( 1 << 7) & AT91_SSC_MSBF)
472 | (( 0 << 5) & AT91_SSC_LOOP)
473 | (((bits - 1) << 0) & AT91_SSC_DATALEN);
475 tcmr = (( 0 << 24) & AT91_SSC_PERIOD)
476 | (( 1 << 16) & AT91_SSC_STTDLY)
477 | (( start_event ) & AT91_SSC_START)
478 | (( AT91_SSC_CKI_FALLING ) & AT91_SSC_CKI)
479 | (( AT91_SSC_CKO_NONE ) & AT91_SSC_CKO)
480 | (( AT91_SSC_CKS_PIN ) & AT91_SSC_CKS);
482 tfmr = (( AT91_SSC_FSEDGE_POSITIVE ) & AT91_SSC_FSEDGE)
483 | (( 0 << 23) & AT91_SSC_FSDEN)
484 | (( AT91_SSC_FSOS_NONE ) & AT91_SSC_FSOS)
485 | (( 0 << 16) & AT91_SSC_FSLEN)
486 | (( 0 << 8) & AT91_SSC_DATNB)
487 | (( 1 << 7) & AT91_SSC_MSBF)
488 | (( 0 << 5) & AT91_SSC_DATDEF)
489 | (((bits - 1) << 0) & AT91_SSC_DATALEN);
492 case SND_SOC_DAIFMT_CBS_CFM:
493 case SND_SOC_DAIFMT_CBM_CFS:
495 printk(KERN_WARNING "at91-i2s: unsupported DAI format 0x%x.\n",
500 DBG("RCMR=%08x RFMR=%08x TCMR=%08x TFMR=%08x\n", rcmr, rfmr, tcmr, tfmr);
502 if (!ssc_p->initialized) {
504 /* Enable PMC peripheral clock for this SSC */
505 DBG("Starting pid %d clock\n", ssc_p->ssc.pid);
506 at91_sys_write(AT91_PMC_PCER, 1<<ssc_p->ssc.pid);
508 /* Reset the SSC and its PDC registers */
509 at91_ssc_write(ssc_p->ssc.base + AT91_SSC_CR, AT91_SSC_SWRST);
511 at91_ssc_write(ssc_p->ssc.base + AT91_PDC_RPR, 0);
512 at91_ssc_write(ssc_p->ssc.base + AT91_PDC_RCR, 0);
513 at91_ssc_write(ssc_p->ssc.base + AT91_PDC_RNPR, 0);
514 at91_ssc_write(ssc_p->ssc.base + AT91_PDC_RNCR, 0);
515 at91_ssc_write(ssc_p->ssc.base + AT91_PDC_TPR, 0);
516 at91_ssc_write(ssc_p->ssc.base + AT91_PDC_TCR, 0);
517 at91_ssc_write(ssc_p->ssc.base + AT91_PDC_TNPR, 0);
518 at91_ssc_write(ssc_p->ssc.base + AT91_PDC_TNCR, 0);
520 if ((ret = request_irq(ssc_p->ssc.pid, at91_i2s_interrupt,
521 0, ssc_p->name, ssc_p)) < 0) {
522 printk(KERN_WARNING "at91-i2s: request_irq failure\n");
524 DBG("Stopping pid %d clock\n", ssc_p->ssc.pid);
525 at91_sys_write(AT91_PMC_PCER, 1<<ssc_p->ssc.pid);
529 ssc_p->initialized = 1;
532 /* set SSC clock mode register */
533 at91_ssc_write(ssc_p->ssc.base + AT91_SSC_CMR, ssc_p->cmr_div);
535 /* set receive clock mode and format */
536 at91_ssc_write(ssc_p->ssc.base + AT91_SSC_RCMR, rcmr);
537 at91_ssc_write(ssc_p->ssc.base + AT91_SSC_RFMR, rfmr);
539 /* set transmit clock mode and format */
540 at91_ssc_write(ssc_p->ssc.base + AT91_SSC_TCMR, tcmr);
541 at91_ssc_write(ssc_p->ssc.base + AT91_SSC_TFMR, tfmr);
543 DBG("hw_params: SSC initialized\n");
548 static int at91_i2s_prepare(struct snd_pcm_substream *substream)
550 struct snd_soc_pcm_runtime *rtd = substream->private_data;
551 struct at91_ssc_info *ssc_p = &ssc_info[rtd->dai->cpu_dai->id];
552 struct at91_pcm_dma_params *dma_params;
555 dir = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0 : 1;
556 dma_params = ssc_p->dma_params[dir];
558 at91_ssc_write(dma_params->ssc_base + AT91_SSC_CR,
559 dma_params->mask->ssc_enable);
561 DBG("%s enabled SSC_SR=0x%08lx\n", dir ? "receive" : "transmit",
562 at91_ssc_read(dma_params->ssc_base + AT91_SSC_SR));
568 static int at91_i2s_suspend(struct platform_device *pdev,
569 struct snd_soc_cpu_dai *cpu_dai)
571 struct at91_ssc_info *ssc_p;
576 ssc_p = &ssc_info[cpu_dai->id];
578 /* Save the status register before disabling transmit and receive. */
579 ssc_p->ssc_state.ssc_sr = at91_ssc_read(ssc_p->ssc.base + AT91_SSC_SR);
580 at91_ssc_write(ssc_p->ssc.base + AT91_SSC_CR,
581 AT91_SSC_TXDIS | AT91_SSC_RXDIS);
583 /* Save the current interrupt mask, then disable unmasked interrupts. */
584 ssc_p->ssc_state.ssc_imr = at91_ssc_read(ssc_p->ssc.base + AT91_SSC_IMR);
585 at91_ssc_write(ssc_p->ssc.base + AT91_SSC_IDR, ssc_p->ssc_state.ssc_imr);
587 ssc_p->ssc_state.ssc_cmr = at91_ssc_read(ssc_p->ssc.base + AT91_SSC_CMR);
588 ssc_p->ssc_state.ssc_rcmr = at91_ssc_read(ssc_p->ssc.base + AT91_SSC_RCMR);
589 ssc_p->ssc_state.ssc_rfmr = at91_ssc_read(ssc_p->ssc.base + AT91_SSC_RFMR);
590 ssc_p->ssc_state.ssc_tcmr = at91_ssc_read(ssc_p->ssc.base + AT91_SSC_TCMR);
591 ssc_p->ssc_state.ssc_tfmr = at91_ssc_read(ssc_p->ssc.base + AT91_SSC_TFMR);
596 static int at91_i2s_resume(struct platform_device *pdev,
597 struct snd_soc_cpu_dai *cpu_dai)
599 struct at91_ssc_info *ssc_p;
604 ssc_p = &ssc_info[cpu_dai->id];
606 at91_ssc_write(ssc_p->ssc.base + AT91_SSC_TFMR, ssc_p->ssc_state.ssc_tfmr);
607 at91_ssc_write(ssc_p->ssc.base + AT91_SSC_TCMR, ssc_p->ssc_state.ssc_tcmr);
608 at91_ssc_write(ssc_p->ssc.base + AT91_SSC_RFMR, ssc_p->ssc_state.ssc_rfmr);
609 at91_ssc_write(ssc_p->ssc.base + AT91_SSC_RCMR, ssc_p->ssc_state.ssc_rcmr);
610 at91_ssc_write(ssc_p->ssc.base + AT91_SSC_CMR, ssc_p->ssc_state.ssc_cmr);
612 at91_ssc_write(ssc_p->ssc.base + AT91_SSC_IER, ssc_p->ssc_state.ssc_imr);
614 at91_ssc_write(ssc_p->ssc.base + AT91_SSC_CR,
615 ((ssc_p->ssc_state.ssc_sr & AT91_SSC_RXENA) ? AT91_SSC_RXEN : 0) |
616 ((ssc_p->ssc_state.ssc_sr & AT91_SSC_TXENA) ? AT91_SSC_TXEN : 0));
622 #define at91_i2s_suspend NULL
623 #define at91_i2s_resume NULL
626 #define AT91_I2S_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
627 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\
628 SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |\
629 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |\
630 SNDRV_PCM_RATE_96000)
632 struct snd_soc_cpu_dai at91_i2s_dai[NUM_SSC_DEVICES] = {
633 { .name = "at91_ssc0/i2s",
635 .type = SND_SOC_DAI_I2S,
636 .suspend = at91_i2s_suspend,
637 .resume = at91_i2s_resume,
641 .rates = AT91_I2S_RATES,
642 .formats = SNDRV_PCM_FMTBIT_S16_LE,},
646 .rates = AT91_I2S_RATES,
647 .formats = SNDRV_PCM_FMTBIT_S16_LE,},
649 .startup = at91_i2s_startup,
650 .shutdown = at91_i2s_shutdown,
651 .prepare = at91_i2s_prepare,
652 .hw_params = at91_i2s_hw_params,},
654 .set_sysclk = at91_i2s_set_dai_sysclk,
655 .set_fmt = at91_i2s_set_dai_fmt,
656 .set_clkdiv = at91_i2s_set_dai_clkdiv,},
657 .private_data = &ssc_info[0].ssc,
659 #if NUM_SSC_DEVICES == 3
660 { .name = "at91_ssc1/i2s",
662 .type = SND_SOC_DAI_I2S,
663 .suspend = at91_i2s_suspend,
664 .resume = at91_i2s_resume,
668 .rates = AT91_I2S_RATES,
669 .formats = SNDRV_PCM_FMTBIT_S16_LE,},
673 .rates = AT91_I2S_RATES,
674 .formats = SNDRV_PCM_FMTBIT_S16_LE,},
676 .startup = at91_i2s_startup,
677 .shutdown = at91_i2s_shutdown,
678 .prepare = at91_i2s_prepare,
679 .hw_params = at91_i2s_hw_params,},
681 .set_sysclk = at91_i2s_set_dai_sysclk,
682 .set_fmt = at91_i2s_set_dai_fmt,
683 .set_clkdiv = at91_i2s_set_dai_clkdiv,},
684 .private_data = &ssc_info[1].ssc,
686 { .name = "at91_ssc2/i2s",
688 .type = SND_SOC_DAI_I2S,
689 .suspend = at91_i2s_suspend,
690 .resume = at91_i2s_resume,
694 .rates = AT91_I2S_RATES,
695 .formats = SNDRV_PCM_FMTBIT_S16_LE,},
699 .rates = AT91_I2S_RATES,
700 .formats = SNDRV_PCM_FMTBIT_S16_LE,},
702 .startup = at91_i2s_startup,
703 .shutdown = at91_i2s_shutdown,
704 .prepare = at91_i2s_prepare,
705 .hw_params = at91_i2s_hw_params,},
707 .set_sysclk = at91_i2s_set_dai_sysclk,
708 .set_fmt = at91_i2s_set_dai_fmt,
709 .set_clkdiv = at91_i2s_set_dai_clkdiv,},
710 .private_data = &ssc_info[2].ssc,
715 EXPORT_SYMBOL_GPL(at91_i2s_dai);
717 /* Module information */
718 MODULE_AUTHOR("Frank Mandarino, fmandarino@endrelia.com, www.endrelia.com");
719 MODULE_DESCRIPTION("AT91 I2S ASoC Interface");
720 MODULE_LICENSE("GPL");