1 /* sound/soc/s3c24xx/s3c2412-i2s.c
3 * ALSA Soc Audio Layer - S3C2412 I2S driver
5 * Copyright (c) 2006 Wolfson Microelectronics PLC.
6 * Graeme Gregory graeme.gregory@wolfsonmicro.com
7 * linux@wolfsonmicro.com
9 * Copyright (c) 2007, 2004-2005 Simtec Electronics
10 * http://armlinux.simtec.co.uk/
11 * Ben Dooks <ben@simtec.co.uk>
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of the GNU General Public License as published by the
15 * Free Software Foundation; either version 2 of the License, or (at your
16 * option) any later version.
19 #include <linux/init.h>
20 #include <linux/module.h>
21 #include <linux/device.h>
22 #include <linux/delay.h>
23 #include <linux/clk.h>
24 #include <linux/kernel.h>
27 #include <sound/core.h>
28 #include <sound/pcm.h>
29 #include <sound/pcm_params.h>
30 #include <sound/initval.h>
31 #include <sound/soc.h>
32 #include <mach/hardware.h>
34 #include <plat/regs-s3c2412-iis.h>
36 #include <mach/regs-gpio.h>
37 #include <plat/audio.h>
40 #include "s3c24xx-pcm.h"
41 #include "s3c2412-i2s.h"
43 #define S3C2412_I2S_DEBUG 0
44 #define S3C2412_I2S_DEBUG_CON 0
47 #define DBG(x...) printk(KERN_INFO x)
49 #define DBG(x...) do { } while (0)
52 static struct s3c2410_dma_client s3c2412_dma_client_out
= {
53 .name
= "I2S PCM Stereo out"
56 static struct s3c2410_dma_client s3c2412_dma_client_in
= {
57 .name
= "I2S PCM Stereo in"
60 static struct s3c24xx_pcm_dma_params s3c2412_i2s_pcm_stereo_out
= {
61 .client
= &s3c2412_dma_client_out
,
62 .channel
= DMACH_I2S_OUT
,
63 .dma_addr
= S3C2410_PA_IIS
+ S3C2412_IISTXD
,
67 static struct s3c24xx_pcm_dma_params s3c2412_i2s_pcm_stereo_in
= {
68 .client
= &s3c2412_dma_client_in
,
69 .channel
= DMACH_I2S_IN
,
70 .dma_addr
= S3C2410_PA_IIS
+ S3C2412_IISRXD
,
74 struct s3c2412_i2s_info
{
86 static struct s3c2412_i2s_info s3c2412_i2s
;
88 #define bit_set(v, b) (((v) & (b)) ? 1 : 0)
90 #if S3C2412_I2S_DEBUG_CON
91 static void dbg_showcon(const char *fn
, u32 con
)
93 printk(KERN_DEBUG
"%s: LRI=%d, TXFEMPT=%d, RXFEMPT=%d, TXFFULL=%d, RXFFULL=%d\n", fn
,
94 bit_set(con
, S3C2412_IISCON_LRINDEX
),
95 bit_set(con
, S3C2412_IISCON_TXFIFO_EMPTY
),
96 bit_set(con
, S3C2412_IISCON_RXFIFO_EMPTY
),
97 bit_set(con
, S3C2412_IISCON_TXFIFO_FULL
),
98 bit_set(con
, S3C2412_IISCON_RXFIFO_FULL
));
100 printk(KERN_DEBUG
"%s: PAUSE: TXDMA=%d, RXDMA=%d, TXCH=%d, RXCH=%d\n",
102 bit_set(con
, S3C2412_IISCON_TXDMA_PAUSE
),
103 bit_set(con
, S3C2412_IISCON_RXDMA_PAUSE
),
104 bit_set(con
, S3C2412_IISCON_TXCH_PAUSE
),
105 bit_set(con
, S3C2412_IISCON_RXCH_PAUSE
));
106 printk(KERN_DEBUG
"%s: ACTIVE: TXDMA=%d, RXDMA=%d, IIS=%d\n", fn
,
107 bit_set(con
, S3C2412_IISCON_TXDMA_ACTIVE
),
108 bit_set(con
, S3C2412_IISCON_RXDMA_ACTIVE
),
109 bit_set(con
, S3C2412_IISCON_IIS_ACTIVE
));
112 static inline void dbg_showcon(const char *fn
, u32 con
)
117 /* Turn on or off the transmission path. */
118 static void s3c2412_snd_txctrl(int on
)
120 struct s3c2412_i2s_info
*i2s
= &s3c2412_i2s
;
121 void __iomem
*regs
= i2s
->regs
;
124 DBG("%s(%d)\n", __func__
, on
);
126 fic
= readl(regs
+ S3C2412_IISFIC
);
127 con
= readl(regs
+ S3C2412_IISCON
);
128 mod
= readl(regs
+ S3C2412_IISMOD
);
130 DBG("%s: IIS: CON=%x MOD=%x FIC=%x\n", __func__
, con
, mod
, fic
);
133 con
|= S3C2412_IISCON_TXDMA_ACTIVE
| S3C2412_IISCON_IIS_ACTIVE
;
134 con
&= ~S3C2412_IISCON_TXDMA_PAUSE
;
135 con
&= ~S3C2412_IISCON_TXCH_PAUSE
;
137 switch (mod
& S3C2412_IISMOD_MODE_MASK
) {
138 case S3C2412_IISMOD_MODE_TXONLY
:
139 case S3C2412_IISMOD_MODE_TXRX
:
140 /* do nothing, we are in the right mode */
143 case S3C2412_IISMOD_MODE_RXONLY
:
144 mod
&= ~S3C2412_IISMOD_MODE_MASK
;
145 mod
|= S3C2412_IISMOD_MODE_TXRX
;
149 dev_err(i2s
->dev
, "TXEN: Invalid MODE in IISMOD\n");
152 writel(con
, regs
+ S3C2412_IISCON
);
153 writel(mod
, regs
+ S3C2412_IISMOD
);
155 /* Note, we do not have any indication that the FIFO problems
156 * tha the S3C2410/2440 had apply here, so we should be able
157 * to disable the DMA and TX without resetting the FIFOS.
160 con
|= S3C2412_IISCON_TXDMA_PAUSE
;
161 con
|= S3C2412_IISCON_TXCH_PAUSE
;
162 con
&= ~S3C2412_IISCON_TXDMA_ACTIVE
;
164 switch (mod
& S3C2412_IISMOD_MODE_MASK
) {
165 case S3C2412_IISMOD_MODE_TXRX
:
166 mod
&= ~S3C2412_IISMOD_MODE_MASK
;
167 mod
|= S3C2412_IISMOD_MODE_RXONLY
;
170 case S3C2412_IISMOD_MODE_TXONLY
:
171 mod
&= ~S3C2412_IISMOD_MODE_MASK
;
172 con
&= ~S3C2412_IISCON_IIS_ACTIVE
;
176 dev_err(i2s
->dev
, "TXDIS: Invalid MODE in IISMOD\n");
179 writel(mod
, regs
+ S3C2412_IISMOD
);
180 writel(con
, regs
+ S3C2412_IISCON
);
183 fic
= readl(regs
+ S3C2412_IISFIC
);
184 dbg_showcon(__func__
, con
);
185 DBG("%s: IIS: CON=%x MOD=%x FIC=%x\n", __func__
, con
, mod
, fic
);
188 static void s3c2412_snd_rxctrl(int on
)
190 struct s3c2412_i2s_info
*i2s
= &s3c2412_i2s
;
191 void __iomem
*regs
= i2s
->regs
;
194 DBG("%s(%d)\n", __func__
, on
);
196 fic
= readl(regs
+ S3C2412_IISFIC
);
197 con
= readl(regs
+ S3C2412_IISCON
);
198 mod
= readl(regs
+ S3C2412_IISMOD
);
200 DBG("%s: IIS: CON=%x MOD=%x FIC=%x\n", __func__
, con
, mod
, fic
);
203 con
|= S3C2412_IISCON_RXDMA_ACTIVE
| S3C2412_IISCON_IIS_ACTIVE
;
204 con
&= ~S3C2412_IISCON_RXDMA_PAUSE
;
205 con
&= ~S3C2412_IISCON_RXCH_PAUSE
;
207 switch (mod
& S3C2412_IISMOD_MODE_MASK
) {
208 case S3C2412_IISMOD_MODE_TXRX
:
209 case S3C2412_IISMOD_MODE_RXONLY
:
210 /* do nothing, we are in the right mode */
213 case S3C2412_IISMOD_MODE_TXONLY
:
214 mod
&= ~S3C2412_IISMOD_MODE_MASK
;
215 mod
|= S3C2412_IISMOD_MODE_TXRX
;
219 dev_err(i2s
->dev
, "RXEN: Invalid MODE in IISMOD\n");
222 writel(mod
, regs
+ S3C2412_IISMOD
);
223 writel(con
, regs
+ S3C2412_IISCON
);
225 /* See txctrl notes on FIFOs. */
227 con
&= ~S3C2412_IISCON_RXDMA_ACTIVE
;
228 con
|= S3C2412_IISCON_RXDMA_PAUSE
;
229 con
|= S3C2412_IISCON_RXCH_PAUSE
;
231 switch (mod
& S3C2412_IISMOD_MODE_MASK
) {
232 case S3C2412_IISMOD_MODE_RXONLY
:
233 con
&= ~S3C2412_IISCON_IIS_ACTIVE
;
234 mod
&= ~S3C2412_IISMOD_MODE_MASK
;
237 case S3C2412_IISMOD_MODE_TXRX
:
238 mod
&= ~S3C2412_IISMOD_MODE_MASK
;
239 mod
|= S3C2412_IISMOD_MODE_TXONLY
;
243 dev_err(i2s
->dev
, "RXEN: Invalid MODE in IISMOD\n");
246 writel(con
, regs
+ S3C2412_IISCON
);
247 writel(mod
, regs
+ S3C2412_IISMOD
);
250 fic
= readl(regs
+ S3C2412_IISFIC
);
251 DBG("%s: IIS: CON=%x MOD=%x FIC=%x\n", __func__
, con
, mod
, fic
);
256 * Wait for the LR signal to allow synchronisation to the L/R clock
257 * from the codec. May only be needed for slave mode.
259 static int s3c2412_snd_lrsync(void)
262 unsigned long timeout
= jiffies
+ msecs_to_jiffies(5);
264 DBG("Entered %s\n", __func__
);
267 iiscon
= readl(s3c2412_i2s
.regs
+ S3C2412_IISCON
);
268 if (iiscon
& S3C2412_IISCON_LRINDEX
)
271 if (timeout
< jiffies
) {
272 printk(KERN_ERR
"%s: timeout\n", __func__
);
281 * Check whether CPU is the master or slave
283 static inline int s3c2412_snd_is_clkmaster(void)
285 u32 iismod
= readl(s3c2412_i2s
.regs
+ S3C2412_IISMOD
);
287 DBG("Entered %s\n", __func__
);
289 iismod
&= S3C2412_IISMOD_MASTER_MASK
;
290 return !(iismod
== S3C2412_IISMOD_SLAVE
);
294 * Set S3C2412 I2S DAI format
296 static int s3c2412_i2s_set_fmt(struct snd_soc_dai
*cpu_dai
,
302 DBG("Entered %s\n", __func__
);
304 iismod
= readl(s3c2412_i2s
.regs
+ S3C2412_IISMOD
);
305 DBG("hw_params r: IISMOD: %x \n", iismod
);
307 switch (fmt
& SND_SOC_DAIFMT_MASTER_MASK
) {
308 case SND_SOC_DAIFMT_CBM_CFM
:
309 iismod
&= ~S3C2412_IISMOD_MASTER_MASK
;
310 iismod
|= S3C2412_IISMOD_SLAVE
;
312 case SND_SOC_DAIFMT_CBS_CFS
:
313 iismod
&= ~S3C2412_IISMOD_MASTER_MASK
;
314 iismod
|= S3C2412_IISMOD_MASTER_INTERNAL
;
317 DBG("unknwon master/slave format\n");
321 iismod
&= ~S3C2412_IISMOD_SDF_MASK
;
323 switch (fmt
& SND_SOC_DAIFMT_FORMAT_MASK
) {
324 case SND_SOC_DAIFMT_RIGHT_J
:
325 iismod
|= S3C2412_IISMOD_SDF_MSB
;
327 case SND_SOC_DAIFMT_LEFT_J
:
328 iismod
|= S3C2412_IISMOD_SDF_LSB
;
330 case SND_SOC_DAIFMT_I2S
:
331 iismod
|= S3C2412_IISMOD_SDF_IIS
;
334 DBG("Unknown data format\n");
338 writel(iismod
, s3c2412_i2s
.regs
+ S3C2412_IISMOD
);
339 DBG("hw_params w: IISMOD: %x \n", iismod
);
343 static int s3c2412_i2s_hw_params(struct snd_pcm_substream
*substream
,
344 struct snd_pcm_hw_params
*params
,
345 struct snd_soc_dai
*dai
)
347 struct snd_soc_pcm_runtime
*rtd
= substream
->private_data
;
350 DBG("Entered %s\n", __func__
);
352 if (substream
->stream
== SNDRV_PCM_STREAM_PLAYBACK
)
353 rtd
->dai
->cpu_dai
->dma_data
= &s3c2412_i2s_pcm_stereo_out
;
355 rtd
->dai
->cpu_dai
->dma_data
= &s3c2412_i2s_pcm_stereo_in
;
357 /* Working copies of register */
358 iismod
= readl(s3c2412_i2s
.regs
+ S3C2412_IISMOD
);
359 DBG("%s: r: IISMOD: %x\n", __func__
, iismod
);
361 switch (params_format(params
)) {
362 case SNDRV_PCM_FORMAT_S8
:
363 iismod
|= S3C2412_IISMOD_8BIT
;
365 case SNDRV_PCM_FORMAT_S16_LE
:
366 iismod
&= ~S3C2412_IISMOD_8BIT
;
370 writel(iismod
, s3c2412_i2s
.regs
+ S3C2412_IISMOD
);
371 DBG("%s: w: IISMOD: %x\n", __func__
, iismod
);
375 static int s3c2412_i2s_trigger(struct snd_pcm_substream
*substream
, int cmd
,
376 struct snd_soc_dai
*dai
)
378 int capture
= (substream
->stream
== SNDRV_PCM_STREAM_CAPTURE
);
382 DBG("Entered %s\n", __func__
);
385 case SNDRV_PCM_TRIGGER_START
:
386 /* On start, ensure that the FIFOs are cleared and reset. */
388 writel(capture
? S3C2412_IISFIC_RXFLUSH
: S3C2412_IISFIC_TXFLUSH
,
389 s3c2412_i2s
.regs
+ S3C2412_IISFIC
);
391 /* clear again, just in case */
392 writel(0x0, s3c2412_i2s
.regs
+ S3C2412_IISFIC
);
394 case SNDRV_PCM_TRIGGER_RESUME
:
395 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE
:
396 if (!s3c2412_snd_is_clkmaster()) {
397 ret
= s3c2412_snd_lrsync();
402 local_irq_save(irqs
);
405 s3c2412_snd_rxctrl(1);
407 s3c2412_snd_txctrl(1);
409 local_irq_restore(irqs
);
412 case SNDRV_PCM_TRIGGER_STOP
:
413 case SNDRV_PCM_TRIGGER_SUSPEND
:
414 case SNDRV_PCM_TRIGGER_PAUSE_PUSH
:
415 local_irq_save(irqs
);
418 s3c2412_snd_rxctrl(0);
420 s3c2412_snd_txctrl(0);
422 local_irq_restore(irqs
);
433 /* default table of all avaialable root fs divisors */
434 static unsigned int s3c2412_iis_fs
[] = { 256, 512, 384, 768, 0 };
436 int s3c2412_iis_calc_rate(struct s3c2412_rate_calc
*info
,
438 unsigned int rate
, struct clk
*clk
)
440 unsigned long clkrate
= clk_get_rate(clk
);
446 signed int deviation
= 0;
447 unsigned int best_fs
= 0;
448 unsigned int best_div
= 0;
449 unsigned int best_rate
= 0;
450 unsigned int best_deviation
= INT_MAX
;
454 fstab
= s3c2412_iis_fs
;
456 for (fs
= 0;; fs
++) {
457 fsdiv
= s3c2412_iis_fs
[fs
];
462 fsclk
= clkrate
/ fsdiv
;
465 if ((fsclk
% rate
) > (rate
/ 2))
471 actual
= clkrate
/ (fsdiv
* div
);
472 deviation
= actual
- rate
;
474 printk(KERN_DEBUG
"%dfs: div %d => result %d, deviation %d\n",
475 fsdiv
, div
, actual
, deviation
);
477 deviation
= abs(deviation
);
479 if (deviation
< best_deviation
) {
483 best_deviation
= deviation
;
490 printk(KERN_DEBUG
"best: fs=%d, div=%d, rate=%d\n",
491 best_fs
, best_div
, best_rate
);
493 info
->fs_div
= best_fs
;
494 info
->clk_div
= best_div
;
498 EXPORT_SYMBOL_GPL(s3c2412_iis_calc_rate
);
501 * Set S3C2412 Clock source
503 static int s3c2412_i2s_set_sysclk(struct snd_soc_dai
*cpu_dai
,
504 int clk_id
, unsigned int freq
, int dir
)
506 u32 iismod
= readl(s3c2412_i2s
.regs
+ S3C2412_IISMOD
);
508 DBG("%s(%p, %d, %u, %d)\n", __func__
, cpu_dai
, clk_id
,
512 case S3C2412_CLKSRC_PCLK
:
513 iismod
&= ~S3C2412_IISMOD_MASTER_MASK
;
514 iismod
|= S3C2412_IISMOD_MASTER_INTERNAL
;
516 case S3C2412_CLKSRC_I2SCLK
:
517 iismod
&= ~S3C2412_IISMOD_MASTER_MASK
;
518 iismod
|= S3C2412_IISMOD_MASTER_EXTERNAL
;
524 writel(iismod
, s3c2412_i2s
.regs
+ S3C2412_IISMOD
);
529 * Set S3C2412 Clock dividers
531 static int s3c2412_i2s_set_clkdiv(struct snd_soc_dai
*cpu_dai
,
534 struct s3c2412_i2s_info
*i2s
= &s3c2412_i2s
;
537 DBG("%s(%p, %d, %d)\n", __func__
, cpu_dai
, div_id
, div
);
540 case S3C2412_DIV_BCLK
:
541 reg
= readl(i2s
->regs
+ S3C2412_IISMOD
);
542 reg
&= ~S3C2412_IISMOD_BCLK_MASK
;
543 writel(reg
| div
, i2s
->regs
+ S3C2412_IISMOD
);
545 DBG("%s: MOD=%08x\n", __func__
, readl(i2s
->regs
+ S3C2412_IISMOD
));
548 case S3C2412_DIV_RCLK
:
550 /* convert value to bit field */
554 div
= S3C2412_IISMOD_RCLK_256FS
;
558 div
= S3C2412_IISMOD_RCLK_384FS
;
562 div
= S3C2412_IISMOD_RCLK_512FS
;
566 div
= S3C2412_IISMOD_RCLK_768FS
;
574 reg
= readl(s3c2412_i2s
.regs
+ S3C2412_IISMOD
);
575 reg
&= ~S3C2412_IISMOD_RCLK_MASK
;
576 writel(reg
| div
, i2s
->regs
+ S3C2412_IISMOD
);
577 DBG("%s: MOD=%08x\n", __func__
, readl(i2s
->regs
+ S3C2412_IISMOD
));
580 case S3C2412_DIV_PRESCALER
:
582 writel((div
<< 8) | S3C2412_IISPSR_PSREN
,
583 i2s
->regs
+ S3C2412_IISPSR
);
585 writel(0x0, i2s
->regs
+ S3C2412_IISPSR
);
587 DBG("%s: PSR=%08x\n", __func__
, readl(i2s
->regs
+ S3C2412_IISPSR
));
597 struct clk
*s3c2412_get_iisclk(void)
599 return s3c2412_i2s
.iis_clk
;
601 EXPORT_SYMBOL_GPL(s3c2412_get_iisclk
);
604 static int s3c2412_i2s_probe(struct platform_device
*pdev
,
605 struct snd_soc_dai
*dai
)
607 DBG("Entered %s\n", __func__
);
609 s3c2412_i2s
.dev
= &pdev
->dev
;
611 s3c2412_i2s
.regs
= ioremap(S3C2410_PA_IIS
, 0x100);
612 if (s3c2412_i2s
.regs
== NULL
)
615 s3c2412_i2s
.iis_pclk
= clk_get(&pdev
->dev
, "iis");
616 if (s3c2412_i2s
.iis_pclk
== NULL
) {
617 DBG("failed to get iis_clock\n");
618 iounmap(s3c2412_i2s
.regs
);
622 s3c2412_i2s
.iis_cclk
= clk_get(&pdev
->dev
, "i2sclk");
623 if (s3c2412_i2s
.iis_cclk
== NULL
) {
624 DBG("failed to get i2sclk clock\n");
625 iounmap(s3c2412_i2s
.regs
);
629 clk_set_parent(s3c2412_i2s
.iis_cclk
, clk_get(NULL
, "mpll"));
631 clk_enable(s3c2412_i2s
.iis_pclk
);
632 clk_enable(s3c2412_i2s
.iis_cclk
);
634 s3c2412_i2s
.iis_clk
= s3c2412_i2s
.iis_pclk
;
636 /* Configure the I2S pins in correct mode */
637 s3c2410_gpio_cfgpin(S3C2410_GPE0
, S3C2410_GPE0_I2SLRCK
);
638 s3c2410_gpio_cfgpin(S3C2410_GPE1
, S3C2410_GPE1_I2SSCLK
);
639 s3c2410_gpio_cfgpin(S3C2410_GPE2
, S3C2410_GPE2_CDCLK
);
640 s3c2410_gpio_cfgpin(S3C2410_GPE3
, S3C2410_GPE3_I2SSDI
);
641 s3c2410_gpio_cfgpin(S3C2410_GPE4
, S3C2410_GPE4_I2SSDO
);
643 s3c2412_snd_txctrl(0);
644 s3c2412_snd_rxctrl(0);
650 static int s3c2412_i2s_suspend(struct snd_soc_dai
*dai
)
652 struct s3c2412_i2s_info
*i2s
= &s3c2412_i2s
;
656 i2s
->suspend_iismod
= readl(i2s
->regs
+ S3C2412_IISMOD
);
657 i2s
->suspend_iiscon
= readl(i2s
->regs
+ S3C2412_IISCON
);
658 i2s
->suspend_iispsr
= readl(i2s
->regs
+ S3C2412_IISPSR
);
660 /* some basic suspend checks */
662 iismod
= readl(i2s
->regs
+ S3C2412_IISMOD
);
664 if (iismod
& S3C2412_IISCON_RXDMA_ACTIVE
)
665 pr_warning("%s: RXDMA active?\n", __func__
);
667 if (iismod
& S3C2412_IISCON_TXDMA_ACTIVE
)
668 pr_warning("%s: TXDMA active?\n", __func__
);
670 if (iismod
& S3C2412_IISCON_IIS_ACTIVE
)
671 pr_warning("%s: IIS active\n", __func__
);
677 static int s3c2412_i2s_resume(struct snd_soc_dai
*dai
)
679 struct s3c2412_i2s_info
*i2s
= &s3c2412_i2s
;
681 pr_info("dai_active %d, IISMOD %08x, IISCON %08x\n",
682 dai
->active
, i2s
->suspend_iismod
, i2s
->suspend_iiscon
);
685 writel(i2s
->suspend_iiscon
, i2s
->regs
+ S3C2412_IISCON
);
686 writel(i2s
->suspend_iismod
, i2s
->regs
+ S3C2412_IISMOD
);
687 writel(i2s
->suspend_iispsr
, i2s
->regs
+ S3C2412_IISPSR
);
689 writel(S3C2412_IISFIC_RXFLUSH
| S3C2412_IISFIC_TXFLUSH
,
690 i2s
->regs
+ S3C2412_IISFIC
);
693 writel(0x0, i2s
->regs
+ S3C2412_IISFIC
);
700 #define s3c2412_i2s_suspend NULL
701 #define s3c2412_i2s_resume NULL
702 #endif /* CONFIG_PM */
704 #define S3C2412_I2S_RATES \
705 (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 | SNDRV_PCM_RATE_16000 | \
706 SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \
707 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
709 struct snd_soc_dai s3c2412_i2s_dai
= {
710 .name
= "s3c2412-i2s",
712 .probe
= s3c2412_i2s_probe
,
713 .suspend
= s3c2412_i2s_suspend
,
714 .resume
= s3c2412_i2s_resume
,
718 .rates
= S3C2412_I2S_RATES
,
719 .formats
= SNDRV_PCM_FMTBIT_S8
| SNDRV_PCM_FMTBIT_S16_LE
,
724 .rates
= S3C2412_I2S_RATES
,
725 .formats
= SNDRV_PCM_FMTBIT_S8
| SNDRV_PCM_FMTBIT_S16_LE
,
728 .trigger
= s3c2412_i2s_trigger
,
729 .hw_params
= s3c2412_i2s_hw_params
,
730 .set_fmt
= s3c2412_i2s_set_fmt
,
731 .set_clkdiv
= s3c2412_i2s_set_clkdiv
,
732 .set_sysclk
= s3c2412_i2s_set_sysclk
,
735 EXPORT_SYMBOL_GPL(s3c2412_i2s_dai
);
737 static int __init
s3c2412_i2s_init(void)
739 return snd_soc_register_dai(&s3c2412_i2s_dai
);
741 module_init(s3c2412_i2s_init
);
743 static void __exit
s3c2412_i2s_exit(void)
745 snd_soc_unregister_dai(&s3c2412_i2s_dai
);
747 module_exit(s3c2412_i2s_exit
);
750 /* Module information */
751 MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>");
752 MODULE_DESCRIPTION("S3C2412 I2S SoC Interface");
753 MODULE_LICENSE("GPL");