2 * pxa-ssp.c -- ALSA Soc Audio Layer
4 * Copyright 2005,2008 Wolfson Microelectronics PLC.
5 * Author: Liam Girdwood
6 * Mark Brown <broonie@opensource.wolfsonmicro.com>
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
14 * o Test network mode for > 16bit sample size
17 #include <linux/init.h>
18 #include <linux/module.h>
19 #include <linux/slab.h>
20 #include <linux/platform_device.h>
21 #include <linux/clk.h>
23 #include <linux/pxa2xx_ssp.h>
27 #include <sound/core.h>
28 #include <sound/pcm.h>
29 #include <sound/initval.h>
30 #include <sound/pcm_params.h>
31 #include <sound/soc.h>
32 #include <sound/pxa2xx-lib.h>
34 #include <mach/hardware.h>
36 #include <mach/audio.h>
38 #include "../../arm/pxa2xx-pcm.h"
42 * SSP audio private data
45 struct ssp_device
*ssp
;
56 static void dump_registers(struct ssp_device
*ssp
)
58 dev_dbg(&ssp
->pdev
->dev
, "SSCR0 0x%08x SSCR1 0x%08x SSTO 0x%08x\n",
59 pxa_ssp_read_reg(ssp
, SSCR0
), pxa_ssp_read_reg(ssp
, SSCR1
),
60 pxa_ssp_read_reg(ssp
, SSTO
));
62 dev_dbg(&ssp
->pdev
->dev
, "SSPSP 0x%08x SSSR 0x%08x SSACD 0x%08x\n",
63 pxa_ssp_read_reg(ssp
, SSPSP
), pxa_ssp_read_reg(ssp
, SSSR
),
64 pxa_ssp_read_reg(ssp
, SSACD
));
67 static void pxa_ssp_enable(struct ssp_device
*ssp
)
71 sscr0
= __raw_readl(ssp
->mmio_base
+ SSCR0
) | SSCR0_SSE
;
72 __raw_writel(sscr0
, ssp
->mmio_base
+ SSCR0
);
75 static void pxa_ssp_disable(struct ssp_device
*ssp
)
79 sscr0
= __raw_readl(ssp
->mmio_base
+ SSCR0
) & ~SSCR0_SSE
;
80 __raw_writel(sscr0
, ssp
->mmio_base
+ SSCR0
);
83 struct pxa2xx_pcm_dma_data
{
84 struct pxa2xx_pcm_dma_params params
;
88 static struct pxa2xx_pcm_dma_params
*
89 pxa_ssp_get_dma_params(struct ssp_device
*ssp
, int width4
, int out
)
91 struct pxa2xx_pcm_dma_data
*dma
;
93 dma
= kzalloc(sizeof(struct pxa2xx_pcm_dma_data
), GFP_KERNEL
);
97 snprintf(dma
->name
, 20, "SSP%d PCM %s %s", ssp
->port_id
,
98 width4
? "32-bit" : "16-bit", out
? "out" : "in");
100 dma
->params
.name
= dma
->name
;
101 dma
->params
.drcmr
= &DRCMR(out
? ssp
->drcmr_tx
: ssp
->drcmr_rx
);
102 dma
->params
.dcmd
= (out
? (DCMD_INCSRCADDR
| DCMD_FLOWTRG
) :
103 (DCMD_INCTRGADDR
| DCMD_FLOWSRC
)) |
104 (width4
? DCMD_WIDTH4
: DCMD_WIDTH2
) | DCMD_BURST16
;
105 dma
->params
.dev_addr
= ssp
->phys_base
+ SSDR
;
110 static int pxa_ssp_startup(struct snd_pcm_substream
*substream
,
111 struct snd_soc_dai
*cpu_dai
)
113 struct ssp_priv
*priv
= snd_soc_dai_get_drvdata(cpu_dai
);
114 struct ssp_device
*ssp
= priv
->ssp
;
117 if (!cpu_dai
->active
) {
118 clk_enable(ssp
->clk
);
119 pxa_ssp_disable(ssp
);
122 kfree(snd_soc_dai_get_dma_data(cpu_dai
, substream
));
123 snd_soc_dai_set_dma_data(cpu_dai
, substream
, NULL
);
128 static void pxa_ssp_shutdown(struct snd_pcm_substream
*substream
,
129 struct snd_soc_dai
*cpu_dai
)
131 struct ssp_priv
*priv
= snd_soc_dai_get_drvdata(cpu_dai
);
132 struct ssp_device
*ssp
= priv
->ssp
;
134 if (!cpu_dai
->active
) {
135 pxa_ssp_disable(ssp
);
136 clk_disable(ssp
->clk
);
139 kfree(snd_soc_dai_get_dma_data(cpu_dai
, substream
));
140 snd_soc_dai_set_dma_data(cpu_dai
, substream
, NULL
);
145 static int pxa_ssp_suspend(struct snd_soc_dai
*cpu_dai
)
147 struct ssp_priv
*priv
= snd_soc_dai_get_drvdata(cpu_dai
);
148 struct ssp_device
*ssp
= priv
->ssp
;
150 if (!cpu_dai
->active
)
151 clk_enable(ssp
->clk
);
153 priv
->cr0
= __raw_readl(ssp
->mmio_base
+ SSCR0
);
154 priv
->cr1
= __raw_readl(ssp
->mmio_base
+ SSCR1
);
155 priv
->to
= __raw_readl(ssp
->mmio_base
+ SSTO
);
156 priv
->psp
= __raw_readl(ssp
->mmio_base
+ SSPSP
);
158 pxa_ssp_disable(ssp
);
159 clk_disable(ssp
->clk
);
163 static int pxa_ssp_resume(struct snd_soc_dai
*cpu_dai
)
165 struct ssp_priv
*priv
= snd_soc_dai_get_drvdata(cpu_dai
);
166 struct ssp_device
*ssp
= priv
->ssp
;
167 uint32_t sssr
= SSSR_ROR
| SSSR_TUR
| SSSR_BCE
;
169 clk_enable(ssp
->clk
);
171 __raw_writel(sssr
, ssp
->mmio_base
+ SSSR
);
172 __raw_writel(priv
->cr0
& ~SSCR0_SSE
, ssp
->mmio_base
+ SSCR0
);
173 __raw_writel(priv
->cr1
, ssp
->mmio_base
+ SSCR1
);
174 __raw_writel(priv
->to
, ssp
->mmio_base
+ SSTO
);
175 __raw_writel(priv
->psp
, ssp
->mmio_base
+ SSPSP
);
180 clk_disable(ssp
->clk
);
186 #define pxa_ssp_suspend NULL
187 #define pxa_ssp_resume NULL
191 * ssp_set_clkdiv - set SSP clock divider
192 * @div: serial clock rate divider
194 static void pxa_ssp_set_scr(struct ssp_device
*ssp
, u32 div
)
196 u32 sscr0
= pxa_ssp_read_reg(ssp
, SSCR0
);
198 if (cpu_is_pxa25x() && ssp
->type
== PXA25x_SSP
) {
199 sscr0
&= ~0x0000ff00;
200 sscr0
|= ((div
- 2)/2) << 8; /* 2..512 */
202 sscr0
&= ~0x000fff00;
203 sscr0
|= (div
- 1) << 8; /* 1..4096 */
205 pxa_ssp_write_reg(ssp
, SSCR0
, sscr0
);
209 * pxa_ssp_get_clkdiv - get SSP clock divider
211 static u32
pxa_ssp_get_scr(struct ssp_device
*ssp
)
213 u32 sscr0
= pxa_ssp_read_reg(ssp
, SSCR0
);
216 if (cpu_is_pxa25x() && ssp
->type
== PXA25x_SSP
)
217 div
= ((sscr0
>> 8) & 0xff) * 2 + 2;
219 div
= ((sscr0
>> 8) & 0xfff) + 1;
224 * Set the SSP ports SYSCLK.
226 static int pxa_ssp_set_dai_sysclk(struct snd_soc_dai
*cpu_dai
,
227 int clk_id
, unsigned int freq
, int dir
)
229 struct ssp_priv
*priv
= snd_soc_dai_get_drvdata(cpu_dai
);
230 struct ssp_device
*ssp
= priv
->ssp
;
233 u32 sscr0
= pxa_ssp_read_reg(ssp
, SSCR0
) &
234 ~(SSCR0_ECS
| SSCR0_NCS
| SSCR0_MOD
| SSCR0_ACS
);
236 dev_dbg(&ssp
->pdev
->dev
,
237 "pxa_ssp_set_dai_sysclk id: %d, clk_id %d, freq %u\n",
238 cpu_dai
->id
, clk_id
, freq
);
241 case PXA_SSP_CLK_NET_PLL
:
244 case PXA_SSP_CLK_PLL
:
245 /* Internal PLL is fixed */
247 priv
->sysclk
= 1843200;
249 priv
->sysclk
= 13000000;
251 case PXA_SSP_CLK_EXT
:
255 case PXA_SSP_CLK_NET
:
257 sscr0
|= SSCR0_NCS
| SSCR0_MOD
;
259 case PXA_SSP_CLK_AUDIO
:
261 pxa_ssp_set_scr(ssp
, 1);
268 /* The SSP clock must be disabled when changing SSP clock mode
269 * on PXA2xx. On PXA3xx it must be enabled when doing so. */
270 if (!cpu_is_pxa3xx())
271 clk_disable(ssp
->clk
);
272 val
= pxa_ssp_read_reg(ssp
, SSCR0
) | sscr0
;
273 pxa_ssp_write_reg(ssp
, SSCR0
, val
);
274 if (!cpu_is_pxa3xx())
275 clk_enable(ssp
->clk
);
281 * Set the SSP clock dividers.
283 static int pxa_ssp_set_dai_clkdiv(struct snd_soc_dai
*cpu_dai
,
286 struct ssp_priv
*priv
= snd_soc_dai_get_drvdata(cpu_dai
);
287 struct ssp_device
*ssp
= priv
->ssp
;
291 case PXA_SSP_AUDIO_DIV_ACDS
:
292 val
= (pxa_ssp_read_reg(ssp
, SSACD
) & ~0x7) | SSACD_ACDS(div
);
293 pxa_ssp_write_reg(ssp
, SSACD
, val
);
295 case PXA_SSP_AUDIO_DIV_SCDB
:
296 val
= pxa_ssp_read_reg(ssp
, SSACD
);
298 #if defined(CONFIG_PXA3xx)
303 case PXA_SSP_CLK_SCDB_1
:
306 case PXA_SSP_CLK_SCDB_4
:
308 #if defined(CONFIG_PXA3xx)
309 case PXA_SSP_CLK_SCDB_8
:
319 pxa_ssp_write_reg(ssp
, SSACD
, val
);
321 case PXA_SSP_DIV_SCR
:
322 pxa_ssp_set_scr(ssp
, div
);
332 * Configure the PLL frequency pxa27x and (afaik - pxa320 only)
334 static int pxa_ssp_set_dai_pll(struct snd_soc_dai
*cpu_dai
, int pll_id
,
335 int source
, unsigned int freq_in
, unsigned int freq_out
)
337 struct ssp_priv
*priv
= snd_soc_dai_get_drvdata(cpu_dai
);
338 struct ssp_device
*ssp
= priv
->ssp
;
339 u32 ssacd
= pxa_ssp_read_reg(ssp
, SSACD
) & ~0x70;
341 #if defined(CONFIG_PXA3xx)
343 pxa_ssp_write_reg(ssp
, SSACDD
, 0);
370 /* PXA3xx has a clock ditherer which can be used to generate
371 * a wider range of frequencies - calculate a value for it.
373 if (cpu_is_pxa3xx()) {
377 do_div(tmp
, freq_out
);
380 val
= (val
<< 16) | 64;
381 pxa_ssp_write_reg(ssp
, SSACDD
, val
);
385 dev_dbg(&ssp
->pdev
->dev
,
386 "Using SSACDD %x to supply %uHz\n",
395 pxa_ssp_write_reg(ssp
, SSACD
, ssacd
);
401 * Set the active slots in TDM/Network mode
403 static int pxa_ssp_set_dai_tdm_slot(struct snd_soc_dai
*cpu_dai
,
404 unsigned int tx_mask
, unsigned int rx_mask
, int slots
, int slot_width
)
406 struct ssp_priv
*priv
= snd_soc_dai_get_drvdata(cpu_dai
);
407 struct ssp_device
*ssp
= priv
->ssp
;
410 sscr0
= pxa_ssp_read_reg(ssp
, SSCR0
);
411 sscr0
&= ~(SSCR0_MOD
| SSCR0_SlotsPerFrm(8) | SSCR0_EDSS
| SSCR0_DSS
);
415 sscr0
|= SSCR0_EDSS
| SSCR0_DataSize(slot_width
- 16);
417 sscr0
|= SSCR0_DataSize(slot_width
);
420 /* enable network mode */
423 /* set number of active slots */
424 sscr0
|= SSCR0_SlotsPerFrm(slots
);
426 /* set active slot mask */
427 pxa_ssp_write_reg(ssp
, SSTSA
, tx_mask
);
428 pxa_ssp_write_reg(ssp
, SSRSA
, rx_mask
);
430 pxa_ssp_write_reg(ssp
, SSCR0
, sscr0
);
436 * Tristate the SSP DAI lines
438 static int pxa_ssp_set_dai_tristate(struct snd_soc_dai
*cpu_dai
,
441 struct ssp_priv
*priv
= snd_soc_dai_get_drvdata(cpu_dai
);
442 struct ssp_device
*ssp
= priv
->ssp
;
445 sscr1
= pxa_ssp_read_reg(ssp
, SSCR1
);
450 pxa_ssp_write_reg(ssp
, SSCR1
, sscr1
);
456 * Set up the SSP DAI format.
457 * The SSP Port must be inactive before calling this function as the
458 * physical interface format is changed.
460 static int pxa_ssp_set_dai_fmt(struct snd_soc_dai
*cpu_dai
,
463 struct ssp_priv
*priv
= snd_soc_dai_get_drvdata(cpu_dai
);
464 struct ssp_device
*ssp
= priv
->ssp
;
465 u32 sscr0
, sscr1
, sspsp
, scfr
;
467 /* check if we need to change anything at all */
468 if (priv
->dai_fmt
== fmt
)
471 /* we can only change the settings if the port is not in use */
472 if (pxa_ssp_read_reg(ssp
, SSCR0
) & SSCR0_SSE
) {
473 dev_err(&ssp
->pdev
->dev
,
474 "can't change hardware dai format: stream is in use");
478 /* reset port settings */
479 sscr0
= pxa_ssp_read_reg(ssp
, SSCR0
) &
480 ~(SSCR0_ECS
| SSCR0_NCS
| SSCR0_MOD
| SSCR0_ACS
);
481 sscr1
= SSCR1_RxTresh(8) | SSCR1_TxTresh(7);
484 switch (fmt
& SND_SOC_DAIFMT_MASTER_MASK
) {
485 case SND_SOC_DAIFMT_CBM_CFM
:
486 sscr1
|= SSCR1_SCLKDIR
| SSCR1_SFRMDIR
| SSCR1_SCFR
;
488 case SND_SOC_DAIFMT_CBM_CFS
:
489 sscr1
|= SSCR1_SCLKDIR
| SSCR1_SCFR
;
491 case SND_SOC_DAIFMT_CBS_CFS
:
497 switch (fmt
& SND_SOC_DAIFMT_INV_MASK
) {
498 case SND_SOC_DAIFMT_NB_NF
:
499 sspsp
|= SSPSP_SFRMP
;
501 case SND_SOC_DAIFMT_NB_IF
:
503 case SND_SOC_DAIFMT_IB_IF
:
504 sspsp
|= SSPSP_SCMODE(2);
506 case SND_SOC_DAIFMT_IB_NF
:
507 sspsp
|= SSPSP_SCMODE(2) | SSPSP_SFRMP
;
513 switch (fmt
& SND_SOC_DAIFMT_FORMAT_MASK
) {
514 case SND_SOC_DAIFMT_I2S
:
516 sscr1
|= SSCR1_RWOT
| SSCR1_TRAIL
;
517 /* See hw_params() */
520 case SND_SOC_DAIFMT_DSP_A
:
522 case SND_SOC_DAIFMT_DSP_B
:
523 sscr0
|= SSCR0_MOD
| SSCR0_PSP
;
524 sscr1
|= SSCR1_TRAIL
| SSCR1_RWOT
;
531 pxa_ssp_write_reg(ssp
, SSCR0
, sscr0
);
532 pxa_ssp_write_reg(ssp
, SSCR1
, sscr1
);
533 pxa_ssp_write_reg(ssp
, SSPSP
, sspsp
);
535 switch (fmt
& SND_SOC_DAIFMT_MASTER_MASK
) {
536 case SND_SOC_DAIFMT_CBM_CFM
:
537 case SND_SOC_DAIFMT_CBM_CFS
:
538 scfr
= pxa_ssp_read_reg(ssp
, SSCR1
) | SSCR1_SCFR
;
539 pxa_ssp_write_reg(ssp
, SSCR1
, scfr
);
541 while (pxa_ssp_read_reg(ssp
, SSSR
) & SSSR_BSY
)
548 /* Since we are configuring the timings for the format by hand
549 * we have to defer some things until hw_params() where we
550 * know parameters like the sample size.
558 * Set the SSP audio DMA parameters and sample size.
559 * Can be called multiple times by oss emulation.
561 static int pxa_ssp_hw_params(struct snd_pcm_substream
*substream
,
562 struct snd_pcm_hw_params
*params
,
563 struct snd_soc_dai
*cpu_dai
)
565 struct ssp_priv
*priv
= snd_soc_dai_get_drvdata(cpu_dai
);
566 struct ssp_device
*ssp
= priv
->ssp
;
567 int chn
= params_channels(params
);
570 int width
= snd_pcm_format_physical_width(params_format(params
));
571 int ttsa
= pxa_ssp_read_reg(ssp
, SSTSA
) & 0xf;
572 struct pxa2xx_pcm_dma_params
*dma_data
;
574 dma_data
= snd_soc_dai_get_dma_data(cpu_dai
, substream
);
576 /* generate correct DMA params */
579 /* Network mode with one active slot (ttsa == 1) can be used
580 * to force 16-bit frame width on the wire (for S16_LE), even
581 * with two channels. Use 16-bit DMA transfers for this case.
583 dma_data
= pxa_ssp_get_dma_params(ssp
,
584 ((chn
== 2) && (ttsa
!= 1)) || (width
== 32),
585 substream
->stream
== SNDRV_PCM_STREAM_PLAYBACK
);
587 snd_soc_dai_set_dma_data(cpu_dai
, substream
, dma_data
);
589 /* we can only change the settings if the port is not in use */
590 if (pxa_ssp_read_reg(ssp
, SSCR0
) & SSCR0_SSE
)
593 /* clear selected SSP bits */
594 sscr0
= pxa_ssp_read_reg(ssp
, SSCR0
) & ~(SSCR0_DSS
| SSCR0_EDSS
);
597 switch (params_format(params
)) {
598 case SNDRV_PCM_FORMAT_S16_LE
:
601 sscr0
|= SSCR0_FPCKE
;
603 sscr0
|= SSCR0_DataSize(16);
605 case SNDRV_PCM_FORMAT_S24_LE
:
606 sscr0
|= (SSCR0_EDSS
| SSCR0_DataSize(8));
608 case SNDRV_PCM_FORMAT_S32_LE
:
609 sscr0
|= (SSCR0_EDSS
| SSCR0_DataSize(16));
612 pxa_ssp_write_reg(ssp
, SSCR0
, sscr0
);
614 switch (priv
->dai_fmt
& SND_SOC_DAIFMT_FORMAT_MASK
) {
615 case SND_SOC_DAIFMT_I2S
:
616 sspsp
= pxa_ssp_read_reg(ssp
, SSPSP
);
618 if ((pxa_ssp_get_scr(ssp
) == 4) && (width
== 16)) {
619 /* This is a special case where the bitclk is 64fs
620 * and we're not dealing with 2*32 bits of audio
623 * The SSP values used for that are all found out by
624 * trying and failing a lot; some of the registers
625 * needed for that mode are only available on PXA3xx.
629 if (!cpu_is_pxa3xx())
632 sspsp
|= SSPSP_SFRMWDTH(width
* 2);
633 sspsp
|= SSPSP_SFRMDLY(width
* 4);
634 sspsp
|= SSPSP_EDMYSTOP(3);
635 sspsp
|= SSPSP_DMYSTOP(3);
636 sspsp
|= SSPSP_DMYSTRT(1);
641 /* The frame width is the width the LRCLK is
642 * asserted for; the delay is expressed in
643 * half cycle units. We need the extra cycle
644 * because the data starts clocking out one BCLK
645 * after LRCLK changes polarity.
647 sspsp
|= SSPSP_SFRMWDTH(width
+ 1);
648 sspsp
|= SSPSP_SFRMDLY((width
+ 1) * 2);
649 sspsp
|= SSPSP_DMYSTRT(1);
652 pxa_ssp_write_reg(ssp
, SSPSP
, sspsp
);
658 /* When we use a network mode, we always require TDM slots
659 * - complain loudly and fail if they've not been set up yet.
661 if ((sscr0
& SSCR0_MOD
) && !ttsa
) {
662 dev_err(&ssp
->pdev
->dev
, "No TDM timeslot configured\n");
671 static int pxa_ssp_trigger(struct snd_pcm_substream
*substream
, int cmd
,
672 struct snd_soc_dai
*cpu_dai
)
675 struct ssp_priv
*priv
= snd_soc_dai_get_drvdata(cpu_dai
);
676 struct ssp_device
*ssp
= priv
->ssp
;
680 case SNDRV_PCM_TRIGGER_RESUME
:
683 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE
:
684 val
= pxa_ssp_read_reg(ssp
, SSCR1
);
685 if (substream
->stream
== SNDRV_PCM_STREAM_PLAYBACK
)
689 pxa_ssp_write_reg(ssp
, SSCR1
, val
);
690 val
= pxa_ssp_read_reg(ssp
, SSSR
);
691 pxa_ssp_write_reg(ssp
, SSSR
, val
);
693 case SNDRV_PCM_TRIGGER_START
:
694 val
= pxa_ssp_read_reg(ssp
, SSCR1
);
695 if (substream
->stream
== SNDRV_PCM_STREAM_PLAYBACK
)
699 pxa_ssp_write_reg(ssp
, SSCR1
, val
);
702 case SNDRV_PCM_TRIGGER_STOP
:
703 val
= pxa_ssp_read_reg(ssp
, SSCR1
);
704 if (substream
->stream
== SNDRV_PCM_STREAM_PLAYBACK
)
708 pxa_ssp_write_reg(ssp
, SSCR1
, val
);
710 case SNDRV_PCM_TRIGGER_SUSPEND
:
711 pxa_ssp_disable(ssp
);
713 case SNDRV_PCM_TRIGGER_PAUSE_PUSH
:
714 val
= pxa_ssp_read_reg(ssp
, SSCR1
);
715 if (substream
->stream
== SNDRV_PCM_STREAM_PLAYBACK
)
719 pxa_ssp_write_reg(ssp
, SSCR1
, val
);
731 static int pxa_ssp_probe(struct snd_soc_dai
*dai
)
733 struct ssp_priv
*priv
;
736 priv
= kzalloc(sizeof(struct ssp_priv
), GFP_KERNEL
);
740 priv
->ssp
= pxa_ssp_request(dai
->id
+ 1, "SoC audio");
741 if (priv
->ssp
== NULL
) {
746 priv
->dai_fmt
= (unsigned int) -1;
747 snd_soc_dai_set_drvdata(dai
, priv
);
756 static int pxa_ssp_remove(struct snd_soc_dai
*dai
)
758 struct ssp_priv
*priv
= snd_soc_dai_get_drvdata(dai
);
760 pxa_ssp_free(priv
->ssp
);
765 #define PXA_SSP_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
766 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | \
767 SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | \
768 SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
770 #define PXA_SSP_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\
771 SNDRV_PCM_FMTBIT_S24_LE | \
772 SNDRV_PCM_FMTBIT_S32_LE)
774 static struct snd_soc_dai_ops pxa_ssp_dai_ops
= {
775 .startup
= pxa_ssp_startup
,
776 .shutdown
= pxa_ssp_shutdown
,
777 .trigger
= pxa_ssp_trigger
,
778 .hw_params
= pxa_ssp_hw_params
,
779 .set_sysclk
= pxa_ssp_set_dai_sysclk
,
780 .set_clkdiv
= pxa_ssp_set_dai_clkdiv
,
781 .set_pll
= pxa_ssp_set_dai_pll
,
782 .set_fmt
= pxa_ssp_set_dai_fmt
,
783 .set_tdm_slot
= pxa_ssp_set_dai_tdm_slot
,
784 .set_tristate
= pxa_ssp_set_dai_tristate
,
787 static struct snd_soc_dai_driver pxa_ssp_dai
= {
788 .probe
= pxa_ssp_probe
,
789 .remove
= pxa_ssp_remove
,
790 .suspend
= pxa_ssp_suspend
,
791 .resume
= pxa_ssp_resume
,
795 .rates
= PXA_SSP_RATES
,
796 .formats
= PXA_SSP_FORMATS
,
801 .rates
= PXA_SSP_RATES
,
802 .formats
= PXA_SSP_FORMATS
,
804 .ops
= &pxa_ssp_dai_ops
,
807 static __devinit
int asoc_ssp_probe(struct platform_device
*pdev
)
809 return snd_soc_register_dai(&pdev
->dev
, &pxa_ssp_dai
);
812 static int __devexit
asoc_ssp_remove(struct platform_device
*pdev
)
814 snd_soc_unregister_dai(&pdev
->dev
);
818 static struct platform_driver asoc_ssp_driver
= {
820 .name
= "pxa-ssp-dai",
821 .owner
= THIS_MODULE
,
824 .probe
= asoc_ssp_probe
,
825 .remove
= __devexit_p(asoc_ssp_remove
),
828 static int __init
pxa_ssp_init(void)
830 return platform_driver_register(&asoc_ssp_driver
);
832 module_init(pxa_ssp_init
);
834 static void __exit
pxa_ssp_exit(void)
836 platform_driver_unregister(&asoc_ssp_driver
);
838 module_exit(pxa_ssp_exit
);
840 /* Module information */
841 MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
842 MODULE_DESCRIPTION("PXA SSP/PCM SoC Interface");
843 MODULE_LICENSE("GPL");