diff options
author | Liam Girdwood <lg@opensource.wolfsonmicro.com> | 2007-02-02 11:16:02 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2007-02-09 03:03:40 -0500 |
commit | cbe83b1795feea33803dc89fce18b2b98abbcc9b (patch) | |
tree | f8c7916f57fab363f9a5a4c01fdc3c307fc26626 /sound/soc/codecs/wm9712.c | |
parent | 4422b606bc04eab01dd5cb6f8e6dd0608d65bb11 (diff) |
[ALSA] soc - ASoC 0.13 WM9712 codec driver
This patch updates the WM9712 codec driver to the new API in ASoC 0.13.
Changes:-
o Removed DAI capabilities matching code in favour of manual matching in
the machine drivers.
o Added DAI operations for codec and CPU interfaces.
o Removed config_sysclk() function and struct snd_soc_clock_info. No
longer needed as clocking is now configured manually in the machine
drivers. Also removed other clocking data from structures.
Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/soc/codecs/wm9712.c')
-rw-r--r-- | sound/soc/codecs/wm9712.c | 44 |
1 files changed, 15 insertions, 29 deletions
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c index b2d2d03b9544..92a64871bcd0 100644 --- a/sound/soc/codecs/wm9712.c +++ b/sound/soc/codecs/wm9712.c | |||
@@ -34,23 +34,6 @@ static unsigned int ac97_read(struct snd_soc_codec *codec, | |||
34 | static int ac97_write(struct snd_soc_codec *codec, | 34 | static int ac97_write(struct snd_soc_codec *codec, |
35 | unsigned int reg, unsigned int val); | 35 | unsigned int reg, unsigned int val); |
36 | 36 | ||
37 | #define AC97_DIR \ | ||
38 | (SND_SOC_DAIDIR_PLAYBACK | SND_SOC_DAIDIR_CAPTURE) | ||
39 | |||
40 | #define AC97_RATES \ | ||
41 | (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 | SNDRV_PCM_RATE_16000 | \ | ||
42 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ | ||
43 | SNDRV_PCM_RATE_48000) | ||
44 | |||
45 | /* may need to expand this */ | ||
46 | static struct snd_soc_dai_mode ac97_modes[] = { | ||
47 | { | ||
48 | .pcmfmt = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S18_3LE, | ||
49 | .pcmrate = AC97_RATES, | ||
50 | .pcmdir = AC97_DIR, | ||
51 | }, | ||
52 | }; | ||
53 | |||
54 | /* | 37 | /* |
55 | * WM9712 register cache | 38 | * WM9712 register cache |
56 | */ | 39 | */ |
@@ -554,35 +537,38 @@ static int ac97_aux_prepare(struct snd_pcm_substream *substream) | |||
554 | return ac97_write(codec, AC97_PCM_SURR_DAC_RATE, runtime->rate); | 537 | return ac97_write(codec, AC97_PCM_SURR_DAC_RATE, runtime->rate); |
555 | } | 538 | } |
556 | 539 | ||
540 | #define WM9712_AC97_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\ | ||
541 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) | ||
542 | |||
557 | struct snd_soc_codec_dai wm9712_dai[] = { | 543 | struct snd_soc_codec_dai wm9712_dai[] = { |
558 | { | 544 | { |
559 | .name = "AC97 HiFi", | 545 | .name = "AC97 HiFi", |
560 | .playback = { | 546 | .playback = { |
561 | .stream_name = "HiFi Playback", | 547 | .stream_name = "HiFi Playback", |
562 | .channels_min = 1, | 548 | .channels_min = 1, |
563 | .channels_max = 2,}, | 549 | .channels_max = 2, |
550 | .rates = WM9712_AC97_RATES, | ||
551 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | ||
564 | .capture = { | 552 | .capture = { |
565 | .stream_name = "HiFi Capture", | 553 | .stream_name = "HiFi Capture", |
566 | .channels_min = 1, | 554 | .channels_min = 1, |
567 | .channels_max = 2,}, | 555 | .channels_max = 2, |
556 | .rates = WM9712_AC97_RATES, | ||
557 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | ||
568 | .ops = { | 558 | .ops = { |
569 | .prepare = ac97_prepare,}, | 559 | .prepare = ac97_prepare,}, |
570 | .caps = { | 560 | }, |
571 | .num_modes = ARRAY_SIZE(ac97_modes), | 561 | { |
572 | .mode = ac97_modes,}, | ||
573 | }, | ||
574 | { | ||
575 | .name = "AC97 Aux", | 562 | .name = "AC97 Aux", |
576 | .playback = { | 563 | .playback = { |
577 | .stream_name = "Aux Playback", | 564 | .stream_name = "Aux Playback", |
578 | .channels_min = 1, | 565 | .channels_min = 1, |
579 | .channels_max = 1,}, | 566 | .channels_max = 1, |
567 | .rates = WM9712_AC97_RATES, | ||
568 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | ||
580 | .ops = { | 569 | .ops = { |
581 | .prepare = ac97_aux_prepare,}, | 570 | .prepare = ac97_aux_prepare,}, |
582 | .caps = { | 571 | } |
583 | .num_modes = ARRAY_SIZE(ac97_modes), | ||
584 | .mode = ac97_modes,}, | ||
585 | }, | ||
586 | }; | 572 | }; |
587 | EXPORT_SYMBOL_GPL(wm9712_dai); | 573 | EXPORT_SYMBOL_GPL(wm9712_dai); |
588 | 574 | ||