aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm9712.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2008-04-28 09:15:28 -0400
committerTakashi Iwai <tiwai@suse.de>2008-04-29 13:01:57 -0400
commit7e48bf653c37eb32c2ba4c13f15aa154aa807e61 (patch)
tree4f1d54673f8d0480fd9f9377c6164fb0e52be437 /sound/soc/codecs/wm9712.c
parentbad7785d4a787dd32245772e7daecf80d3618de9 (diff)
[ALSA] soc - wm9712 - checkpatch fixes
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/soc/codecs/wm9712.c')
-rw-r--r--sound/soc/codecs/wm9712.c62
1 files changed, 29 insertions, 33 deletions
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c
index d2d79e182a45..76c1e2d33e7d 100644
--- a/sound/soc/codecs/wm9712.c
+++ b/sound/soc/codecs/wm9712.c
@@ -37,23 +37,23 @@ static int ac97_write(struct snd_soc_codec *codec,
37 * WM9712 register cache 37 * WM9712 register cache
38 */ 38 */
39static const u16 wm9712_reg[] = { 39static const u16 wm9712_reg[] = {
40 0x6174, 0x8000, 0x8000, 0x8000, // 6 40 0x6174, 0x8000, 0x8000, 0x8000, /* 6 */
41 0x0f0f, 0xaaa0, 0xc008, 0x6808, // e 41 0x0f0f, 0xaaa0, 0xc008, 0x6808, /* e */
42 0xe808, 0xaaa0, 0xad00, 0x8000, // 16 42 0xe808, 0xaaa0, 0xad00, 0x8000, /* 16 */
43 0xe808, 0x3000, 0x8000, 0x0000, // 1e 43 0xe808, 0x3000, 0x8000, 0x0000, /* 1e */
44 0x0000, 0x0000, 0x0000, 0x000f, // 26 44 0x0000, 0x0000, 0x0000, 0x000f, /* 26 */
45 0x0405, 0x0410, 0xbb80, 0xbb80, // 2e 45 0x0405, 0x0410, 0xbb80, 0xbb80, /* 2e */
46 0x0000, 0xbb80, 0x0000, 0x0000, // 36 46 0x0000, 0xbb80, 0x0000, 0x0000, /* 36 */
47 0x0000, 0x2000, 0x0000, 0x0000, // 3e 47 0x0000, 0x2000, 0x0000, 0x0000, /* 3e */
48 0x0000, 0x0000, 0x0000, 0x0000, // 46 48 0x0000, 0x0000, 0x0000, 0x0000, /* 46 */
49 0x0000, 0x0000, 0xf83e, 0xffff, // 4e 49 0x0000, 0x0000, 0xf83e, 0xffff, /* 4e */
50 0x0000, 0x0000, 0x0000, 0xf83e, // 56 50 0x0000, 0x0000, 0x0000, 0xf83e, /* 56 */
51 0x0008, 0x0000, 0x0000, 0x0000, // 5e 51 0x0008, 0x0000, 0x0000, 0x0000, /* 5e */
52 0xb032, 0x3e00, 0x0000, 0x0000, // 66 52 0xb032, 0x3e00, 0x0000, 0x0000, /* 66 */
53 0x0000, 0x0000, 0x0000, 0x0000, // 6e 53 0x0000, 0x0000, 0x0000, 0x0000, /* 6e */
54 0x0000, 0x0000, 0x0000, 0x0006, // 76 54 0x0000, 0x0000, 0x0000, 0x0006, /* 76 */
55 0x0001, 0x0000, 0x574d, 0x4c12, // 7e 55 0x0001, 0x0000, 0x574d, 0x4c12, /* 7e */
56 0x0000, 0x0000 // virtual hp mixers 56 0x0000, 0x0000 /* virtual hp mixers */
57}; 57};
58 58
59/* virtual HP mixers regs */ 59/* virtual HP mixers regs */
@@ -94,7 +94,7 @@ static const struct snd_kcontrol_new wm9712_snd_ac97_controls[] = {
94SOC_DOUBLE("Speaker Playback Volume", AC97_MASTER, 8, 0, 31, 1), 94SOC_DOUBLE("Speaker Playback Volume", AC97_MASTER, 8, 0, 31, 1),
95SOC_SINGLE("Speaker Playback Switch", AC97_MASTER, 15, 1, 1), 95SOC_SINGLE("Speaker Playback Switch", AC97_MASTER, 15, 1, 1),
96SOC_DOUBLE("Headphone Playback Volume", AC97_HEADPHONE, 8, 0, 31, 1), 96SOC_DOUBLE("Headphone Playback Volume", AC97_HEADPHONE, 8, 0, 31, 1),
97SOC_SINGLE("Headphone Playback Switch", AC97_HEADPHONE,15, 1, 1), 97SOC_SINGLE("Headphone Playback Switch", AC97_HEADPHONE, 15, 1, 1),
98SOC_DOUBLE("PCM Playback Volume", AC97_PCM, 8, 0, 31, 1), 98SOC_DOUBLE("PCM Playback Volume", AC97_PCM, 8, 0, 31, 1),
99 99
100SOC_SINGLE("Speaker Playback ZC Switch", AC97_MASTER, 7, 1, 0), 100SOC_SINGLE("Speaker Playback ZC Switch", AC97_MASTER, 7, 1, 0),
@@ -165,7 +165,8 @@ static int wm9712_add_controls(struct snd_soc_codec *codec)
165 165
166 for (i = 0; i < ARRAY_SIZE(wm9712_snd_ac97_controls); i++) { 166 for (i = 0; i < ARRAY_SIZE(wm9712_snd_ac97_controls); i++) {
167 err = snd_ctl_add(codec->card, 167 err = snd_ctl_add(codec->card,
168 snd_soc_cnew(&wm9712_snd_ac97_controls[i],codec, NULL)); 168 snd_soc_cnew(&wm9712_snd_ac97_controls[i],
169 codec, NULL));
169 if (err < 0) 170 if (err < 0)
170 return err; 171 return err;
171 } 172 }
@@ -363,7 +364,6 @@ static const char *audio_map[][3] = {
363 {"Left HP Mixer", "PCM Playback Switch", "Left DAC"}, 364 {"Left HP Mixer", "PCM Playback Switch", "Left DAC"},
364 {"Left HP Mixer", "Mic Sidetone Switch", "Mic PGA"}, 365 {"Left HP Mixer", "Mic Sidetone Switch", "Mic PGA"},
365 {"Left HP Mixer", NULL, "ALC Sidetone Mux"}, 366 {"Left HP Mixer", NULL, "ALC Sidetone Mux"},
366 //{"Right HP Mixer", NULL, "HP Mixer"},
367 367
368 /* Right HP mixer */ 368 /* Right HP mixer */
369 {"Right HP Mixer", "PCBeep Bypass Switch", "PCBEEP"}, 369 {"Right HP Mixer", "PCBeep Bypass Switch", "PCBEEP"},
@@ -454,15 +454,13 @@ static int wm9712_add_widgets(struct snd_soc_codec *codec)
454{ 454{
455 int i; 455 int i;
456 456
457 for(i = 0; i < ARRAY_SIZE(wm9712_dapm_widgets); i++) { 457 for (i = 0; i < ARRAY_SIZE(wm9712_dapm_widgets); i++)
458 snd_soc_dapm_new_control(codec, &wm9712_dapm_widgets[i]); 458 snd_soc_dapm_new_control(codec, &wm9712_dapm_widgets[i]);
459 }
460 459
461 /* set up audio path audio_mapnects */ 460 /* set up audio path connects */
462 for(i = 0; audio_map[i][0] != NULL; i++) { 461 for (i = 0; audio_map[i][0] != NULL; i++)
463 snd_soc_dapm_connect_input(codec, audio_map[i][0], 462 snd_soc_dapm_connect_input(codec, audio_map[i][0],
464 audio_map[i][1], audio_map[i][2]); 463 audio_map[i][1], audio_map[i][2]);
465 }
466 464
467 snd_soc_dapm_new_widgets(codec); 465 snd_soc_dapm_new_widgets(codec);
468 return 0; 466 return 0;
@@ -540,7 +538,8 @@ static int ac97_aux_prepare(struct snd_pcm_substream *substream)
540} 538}
541 539
542#define WM9712_AC97_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\ 540#define WM9712_AC97_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
543 SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) 541 SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 |\
542 SNDRV_PCM_RATE_48000)
544 543
545struct snd_soc_codec_dai wm9712_dai[] = { 544struct snd_soc_codec_dai wm9712_dai[] = {
546{ 545{
@@ -577,8 +576,6 @@ EXPORT_SYMBOL_GPL(wm9712_dai);
577 576
578static int wm9712_dapm_event(struct snd_soc_codec *codec, int event) 577static int wm9712_dapm_event(struct snd_soc_codec *codec, int event)
579{ 578{
580 u16 reg;
581
582 switch (event) { 579 switch (event) {
583 case SNDRV_CTL_POWER_D0: /* full On */ 580 case SNDRV_CTL_POWER_D0: /* full On */
584 case SNDRV_CTL_POWER_D1: /* partial On */ 581 case SNDRV_CTL_POWER_D1: /* partial On */
@@ -633,7 +630,7 @@ static int wm9712_soc_resume(struct platform_device *pdev)
633 u16 *cache = codec->reg_cache; 630 u16 *cache = codec->reg_cache;
634 631
635 ret = wm9712_reset(codec, 1); 632 ret = wm9712_reset(codec, 1);
636 if (ret < 0){ 633 if (ret < 0) {
637 printk(KERN_ERR "could not reset AC97 codec\n"); 634 printk(KERN_ERR "could not reset AC97 codec\n");
638 return ret; 635 return ret;
639 } 636 }
@@ -642,9 +639,9 @@ static int wm9712_soc_resume(struct platform_device *pdev)
642 639
643 if (ret == 0) { 640 if (ret == 0) {
644 /* Sync reg_cache with the hardware after cold reset */ 641 /* Sync reg_cache with the hardware after cold reset */
645 for (i = 2; i < ARRAY_SIZE(wm9712_reg) << 1; i+=2) { 642 for (i = 2; i < ARRAY_SIZE(wm9712_reg) << 1; i += 2) {
646 if (i == AC97_INT_PAGING || i == AC97_POWERDOWN || 643 if (i == AC97_INT_PAGING || i == AC97_POWERDOWN ||
647 (i > 0x58 && i != 0x5c)) 644 (i > 0x58 && i != 0x5c))
648 continue; 645 continue;
649 soc_ac97_ops.write(codec->ac97, i, cache[i>>1]); 646 soc_ac97_ops.write(codec->ac97, i, cache[i>>1]);
650 } 647 }
@@ -757,7 +754,6 @@ struct snd_soc_codec_device soc_codec_dev_wm9712 = {
757 .suspend = wm9712_soc_suspend, 754 .suspend = wm9712_soc_suspend,
758 .resume = wm9712_soc_resume, 755 .resume = wm9712_soc_resume,
759}; 756};
760
761EXPORT_SYMBOL_GPL(soc_codec_dev_wm9712); 757EXPORT_SYMBOL_GPL(soc_codec_dev_wm9712);
762 758
763MODULE_DESCRIPTION("ASoC WM9711/WM9712 driver"); 759MODULE_DESCRIPTION("ASoC WM9711/WM9712 driver");