diff options
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 | ||