diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-27 12:45:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-27 12:45:59 -0400 |
commit | 375614422509c98a1f3dbef410206bf81775169b (patch) | |
tree | 02e65184a80446d56b6c05b76417791a3b68b234 /sound | |
parent | eeb61f719c00c626115852bbc91189dc3011a844 (diff) | |
parent | 536319afd1f25383009c0c88f6fb00104f49c178 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
ALSA: Allow to force model to intel-mac-v3 in snd_hda_intel (sigmatel).
ALSA: cs4232: fix crash during chip PNP detection
ALSA: hda - Add automatic model setting for the Acer Aspire 5920G laptop
ALSA: make snd_ac97_add_vmaster() static
ALSA: sound/pci/azt3328.h: no variables for enums
ALSA: soc - wm9712 mono mixer
ALSA: hda - Add support of ASUS Eeepc P90*
ALSA: opti9xx: no isapnp param for !CONFIG_PNP
ALSA: opti93x - Fix NULL dereference
ALSA: hda - Added support for Asus V1Sn
ALSA: ASoC: Factor PGA DAPM handling into main
ALSA: ASoC: Refactor DAPM event handler
ALSA: ALSA: ens1370: communicate PCI device to AC97
ALSA: ens1370: SRC stands for Sample Rate Converter
ALSA: hda - Align BDL position adjustment parameter
ALSA: Au1xpsc: psc not disabled when TX is idle
ALSA: add TriTech 28023 AC97 codec ID and Wolfson 9701 name.
Diffstat (limited to 'sound')
-rw-r--r-- | sound/isa/cs423x/cs4236.c | 1 | ||||
-rw-r--r-- | sound/isa/opti9xx/opti92x-ad1848.c | 6 | ||||
-rw-r--r-- | sound/pci/ac97/ac97_codec.c | 3 | ||||
-rw-r--r-- | sound/pci/ac97/ac97_patch.c | 4 | ||||
-rw-r--r-- | sound/pci/azt3328.h | 4 | ||||
-rw-r--r-- | sound/pci/ens1370.c | 3 | ||||
-rw-r--r-- | sound/pci/hda/hda_intel.c | 6 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 181 | ||||
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 14 | ||||
-rw-r--r-- | sound/soc/au1x/psc-i2s.c | 2 | ||||
-rw-r--r-- | sound/soc/codecs/wm9712.c | 10 | ||||
-rw-r--r-- | sound/soc/soc-dapm.c | 105 |
12 files changed, 259 insertions, 80 deletions
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c index dbe63db4bfd6..4d4b8ddc26ba 100644 --- a/sound/isa/cs423x/cs4236.c +++ b/sound/isa/cs423x/cs4236.c | |||
@@ -325,6 +325,7 @@ static int __devinit snd_cs423x_pnp_init_mpu(int dev, struct pnp_dev *pdev) | |||
325 | static int __devinit snd_card_cs4232_pnp(int dev, struct snd_card_cs4236 *acard, | 325 | static int __devinit snd_card_cs4232_pnp(int dev, struct snd_card_cs4236 *acard, |
326 | struct pnp_dev *pdev) | 326 | struct pnp_dev *pdev) |
327 | { | 327 | { |
328 | acard->wss = pdev; | ||
328 | if (snd_cs423x_pnp_init_wss(dev, acard->wss) < 0) | 329 | if (snd_cs423x_pnp_init_wss(dev, acard->wss) < 0) |
329 | return -EBUSY; | 330 | return -EBUSY; |
330 | cport[dev] = -1; | 331 | cport[dev] = -1; |
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c index 41c047e665ec..0797ca441a37 100644 --- a/sound/isa/opti9xx/opti92x-ad1848.c +++ b/sound/isa/opti9xx/opti92x-ad1848.c | |||
@@ -68,7 +68,9 @@ MODULE_SUPPORTED_DEVICE("{{OPTi,82C924 (AD1848)}," | |||
68 | static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ | 68 | static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ |
69 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ | 69 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ |
70 | //static int enable = SNDRV_DEFAULT_ENABLE1; /* Enable this card */ | 70 | //static int enable = SNDRV_DEFAULT_ENABLE1; /* Enable this card */ |
71 | #ifdef CONFIG_PNP | ||
71 | static int isapnp = 1; /* Enable ISA PnP detection */ | 72 | static int isapnp = 1; /* Enable ISA PnP detection */ |
73 | #endif | ||
72 | static long port = SNDRV_DEFAULT_PORT1; /* 0x530,0xe80,0xf40,0x604 */ | 74 | static long port = SNDRV_DEFAULT_PORT1; /* 0x530,0xe80,0xf40,0x604 */ |
73 | static long mpu_port = SNDRV_DEFAULT_PORT1; /* 0x300,0x310,0x320,0x330 */ | 75 | static long mpu_port = SNDRV_DEFAULT_PORT1; /* 0x300,0x310,0x320,0x330 */ |
74 | static long fm_port = SNDRV_DEFAULT_PORT1; /* 0x388 */ | 76 | static long fm_port = SNDRV_DEFAULT_PORT1; /* 0x388 */ |
@@ -85,8 +87,10 @@ module_param(id, charp, 0444); | |||
85 | MODULE_PARM_DESC(id, "ID string for opti9xx based soundcard."); | 87 | MODULE_PARM_DESC(id, "ID string for opti9xx based soundcard."); |
86 | //module_param(enable, bool, 0444); | 88 | //module_param(enable, bool, 0444); |
87 | //MODULE_PARM_DESC(enable, "Enable opti9xx soundcard."); | 89 | //MODULE_PARM_DESC(enable, "Enable opti9xx soundcard."); |
90 | #ifdef CONFIG_PNP | ||
88 | module_param(isapnp, bool, 0444); | 91 | module_param(isapnp, bool, 0444); |
89 | MODULE_PARM_DESC(isapnp, "Enable ISA PnP detection for specified soundcard."); | 92 | MODULE_PARM_DESC(isapnp, "Enable ISA PnP detection for specified soundcard."); |
93 | #endif | ||
90 | module_param(port, long, 0444); | 94 | module_param(port, long, 0444); |
91 | MODULE_PARM_DESC(port, "WSS port # for opti9xx driver."); | 95 | MODULE_PARM_DESC(port, "WSS port # for opti9xx driver."); |
92 | module_param(mpu_port, long, 0444); | 96 | module_param(mpu_port, long, 0444); |
@@ -688,7 +692,7 @@ static void snd_card_opti9xx_free(struct snd_card *card) | |||
688 | if (chip) { | 692 | if (chip) { |
689 | #ifdef OPTi93X | 693 | #ifdef OPTi93X |
690 | struct snd_cs4231 *codec = chip->codec; | 694 | struct snd_cs4231 *codec = chip->codec; |
691 | if (codec->irq > 0) { | 695 | if (codec && codec->irq > 0) { |
692 | disable_irq(codec->irq); | 696 | disable_irq(codec->irq); |
693 | free_irq(codec->irq, codec); | 697 | free_irq(codec->irq, codec); |
694 | } | 698 | } |
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c index 07364c00768a..8c49a00a5e39 100644 --- a/sound/pci/ac97/ac97_codec.c +++ b/sound/pci/ac97/ac97_codec.c | |||
@@ -161,6 +161,7 @@ static const struct ac97_codec_id snd_ac97_codec_ids[] = { | |||
161 | { 0x50534304, 0xffffffff, "UCB1400", patch_ucb1400, NULL }, | 161 | { 0x50534304, 0xffffffff, "UCB1400", patch_ucb1400, NULL }, |
162 | { 0x53494c20, 0xffffffe0, "Si3036,8", mpatch_si3036, mpatch_si3036, AC97_MODEM_PATCH }, | 162 | { 0x53494c20, 0xffffffe0, "Si3036,8", mpatch_si3036, mpatch_si3036, AC97_MODEM_PATCH }, |
163 | { 0x54524102, 0xffffffff, "TR28022", NULL, NULL }, | 163 | { 0x54524102, 0xffffffff, "TR28022", NULL, NULL }, |
164 | { 0x54524103, 0xffffffff, "TR28023", NULL, NULL }, | ||
164 | { 0x54524106, 0xffffffff, "TR28026", NULL, NULL }, | 165 | { 0x54524106, 0xffffffff, "TR28026", NULL, NULL }, |
165 | { 0x54524108, 0xffffffff, "TR28028", patch_tritech_tr28028, NULL }, // added by xin jin [07/09/99] | 166 | { 0x54524108, 0xffffffff, "TR28028", patch_tritech_tr28028, NULL }, // added by xin jin [07/09/99] |
166 | { 0x54524123, 0xffffffff, "TR28602", NULL, NULL }, // only guess --jk [TR28023 = eMicro EM28023 (new CT1297)] | 167 | { 0x54524123, 0xffffffff, "TR28602", NULL, NULL }, // only guess --jk [TR28023 = eMicro EM28023 (new CT1297)] |
@@ -169,7 +170,7 @@ static const struct ac97_codec_id snd_ac97_codec_ids[] = { | |||
169 | { 0x56494170, 0xffffffff, "VIA1617A", patch_vt1617a, NULL }, // modified VT1616 with S/PDIF | 170 | { 0x56494170, 0xffffffff, "VIA1617A", patch_vt1617a, NULL }, // modified VT1616 with S/PDIF |
170 | { 0x56494182, 0xffffffff, "VIA1618", NULL, NULL }, | 171 | { 0x56494182, 0xffffffff, "VIA1618", NULL, NULL }, |
171 | { 0x57454301, 0xffffffff, "W83971D", NULL, NULL }, | 172 | { 0x57454301, 0xffffffff, "W83971D", NULL, NULL }, |
172 | { 0x574d4c00, 0xffffffff, "WM9701A", NULL, NULL }, | 173 | { 0x574d4c00, 0xffffffff, "WM9701,WM9701A", NULL, NULL }, |
173 | { 0x574d4C03, 0xffffffff, "WM9703,WM9707,WM9708,WM9717", patch_wolfson03, NULL}, | 174 | { 0x574d4C03, 0xffffffff, "WM9703,WM9707,WM9708,WM9717", patch_wolfson03, NULL}, |
174 | { 0x574d4C04, 0xffffffff, "WM9704M,WM9704Q", patch_wolfson04, NULL}, | 175 | { 0x574d4C04, 0xffffffff, "WM9704M,WM9704Q", patch_wolfson04, NULL}, |
175 | { 0x574d4C05, 0xffffffff, "WM9705,WM9710", patch_wolfson05, NULL}, | 176 | { 0x574d4C05, 0xffffffff, "WM9705,WM9710", patch_wolfson05, NULL}, |
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c index 0746e9ccc20b..f4fbc795ee81 100644 --- a/sound/pci/ac97/ac97_patch.c +++ b/sound/pci/ac97/ac97_patch.c | |||
@@ -3381,8 +3381,8 @@ static struct snd_kcontrol *snd_ac97_find_mixer_ctl(struct snd_ac97 *ac97, | |||
3381 | } | 3381 | } |
3382 | 3382 | ||
3383 | /* create a virtual master control and add slaves */ | 3383 | /* create a virtual master control and add slaves */ |
3384 | int snd_ac97_add_vmaster(struct snd_ac97 *ac97, char *name, | 3384 | static int snd_ac97_add_vmaster(struct snd_ac97 *ac97, char *name, |
3385 | const unsigned int *tlv, const char **slaves) | 3385 | const unsigned int *tlv, const char **slaves) |
3386 | { | 3386 | { |
3387 | struct snd_kcontrol *kctl; | 3387 | struct snd_kcontrol *kctl; |
3388 | const char **s; | 3388 | const char **s; |
diff --git a/sound/pci/azt3328.h b/sound/pci/azt3328.h index 7e3e8942d073..974e05122f00 100644 --- a/sound/pci/azt3328.h +++ b/sound/pci/azt3328.h | |||
@@ -94,7 +94,7 @@ enum azf_freq_t { | |||
94 | AZF_FREQ(48000), | 94 | AZF_FREQ(48000), |
95 | AZF_FREQ(66200), | 95 | AZF_FREQ(66200), |
96 | #undef AZF_FREQ | 96 | #undef AZF_FREQ |
97 | } AZF_FREQUENCIES; | 97 | }; |
98 | 98 | ||
99 | /** recording area (see also: playback bit flag definitions) **/ | 99 | /** recording area (see also: playback bit flag definitions) **/ |
100 | #define IDX_IO_REC_FLAGS 0x20 /* ??, PU:0x0000 */ | 100 | #define IDX_IO_REC_FLAGS 0x20 /* ??, PU:0x0000 */ |
@@ -210,7 +210,7 @@ enum azf_freq_t { | |||
210 | 210 | ||
211 | enum { | 211 | enum { |
212 | AZF_GAME_LEGACY_IO_PORT = 0x200 | 212 | AZF_GAME_LEGACY_IO_PORT = 0x200 |
213 | } AZF_GAME_CONFIGS; | 213 | }; |
214 | 214 | ||
215 | #define IDX_GAME_LEGACY_COMPATIBLE 0x00 | 215 | #define IDX_GAME_LEGACY_COMPATIBLE 0x00 |
216 | /* in some operation mode, writing anything to this port | 216 | /* in some operation mode, writing anything to this port |
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c index fbf1124f7c79..9bf95367c882 100644 --- a/sound/pci/ens1370.c +++ b/sound/pci/ens1370.c | |||
@@ -522,7 +522,7 @@ static unsigned int snd_es1371_wait_src_ready(struct ensoniq * ensoniq) | |||
522 | return r; | 522 | return r; |
523 | cond_resched(); | 523 | cond_resched(); |
524 | } | 524 | } |
525 | snd_printk(KERN_ERR "wait source ready timeout 0x%lx [0x%x]\n", | 525 | snd_printk(KERN_ERR "wait src ready timeout 0x%lx [0x%x]\n", |
526 | ES_REG(ensoniq, 1371_SMPRATE), r); | 526 | ES_REG(ensoniq, 1371_SMPRATE), r); |
527 | return 0; | 527 | return 0; |
528 | } | 528 | } |
@@ -1629,6 +1629,7 @@ static int __devinit snd_ensoniq_1371_mixer(struct ensoniq *ensoniq, | |||
1629 | memset(&ac97, 0, sizeof(ac97)); | 1629 | memset(&ac97, 0, sizeof(ac97)); |
1630 | ac97.private_data = ensoniq; | 1630 | ac97.private_data = ensoniq; |
1631 | ac97.private_free = snd_ensoniq_mixer_free_ac97; | 1631 | ac97.private_free = snd_ensoniq_mixer_free_ac97; |
1632 | ac97.pci = ensoniq->pci; | ||
1632 | ac97.scaps = AC97_SCAP_AUDIO; | 1633 | ac97.scaps = AC97_SCAP_AUDIO; |
1633 | if ((err = snd_ac97_mixer(pbus, &ac97, &ensoniq->u.es1371.ac97)) < 0) | 1634 | if ((err = snd_ac97_mixer(pbus, &ac97, &ensoniq->u.es1371.ac97)) < 0) |
1634 | return err; | 1635 | return err; |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 16715a68ba5e..ef9f072b47fc 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -1047,9 +1047,13 @@ static int azx_setup_periods(struct azx *chip, | |||
1047 | pos_adj = bdl_pos_adj[chip->dev_index]; | 1047 | pos_adj = bdl_pos_adj[chip->dev_index]; |
1048 | if (pos_adj > 0) { | 1048 | if (pos_adj > 0) { |
1049 | struct snd_pcm_runtime *runtime = substream->runtime; | 1049 | struct snd_pcm_runtime *runtime = substream->runtime; |
1050 | int pos_align = pos_adj; | ||
1050 | pos_adj = (pos_adj * runtime->rate + 47999) / 48000; | 1051 | pos_adj = (pos_adj * runtime->rate + 47999) / 48000; |
1051 | if (!pos_adj) | 1052 | if (!pos_adj) |
1052 | pos_adj = 1; | 1053 | pos_adj = pos_align; |
1054 | else | ||
1055 | pos_adj = ((pos_adj + pos_align - 1) / pos_align) * | ||
1056 | pos_align; | ||
1053 | pos_adj = frames_to_bytes(runtime, pos_adj); | 1057 | pos_adj = frames_to_bytes(runtime, pos_adj); |
1054 | if (pos_adj >= period_bytes) { | 1058 | if (pos_adj >= period_bytes) { |
1055 | snd_printk(KERN_WARNING "Too big adjustment %d\n", | 1059 | snd_printk(KERN_WARNING "Too big adjustment %d\n", |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 2807bc840d26..add4e87e0b20 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -122,6 +122,8 @@ enum { | |||
122 | /* ALC269 models */ | 122 | /* ALC269 models */ |
123 | enum { | 123 | enum { |
124 | ALC269_BASIC, | 124 | ALC269_BASIC, |
125 | ALC269_ASUS_EEEPC_P703, | ||
126 | ALC269_ASUS_EEEPC_P901, | ||
125 | ALC269_AUTO, | 127 | ALC269_AUTO, |
126 | ALC269_MODEL_LAST /* last tag */ | 128 | ALC269_MODEL_LAST /* last tag */ |
127 | }; | 129 | }; |
@@ -7905,6 +7907,7 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = { | |||
7905 | SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_ACER_ASPIRE), | 7907 | SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_ACER_ASPIRE), |
7906 | SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_ACER_ASPIRE), | 7908 | SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_ACER_ASPIRE), |
7907 | SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_ACER_ASPIRE), | 7909 | SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_ACER_ASPIRE), |
7910 | SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_ACER_ASPIRE), | ||
7908 | SND_PCI_QUIRK(0x1025, 0, "Acer laptop", ALC883_ACER), /* default Acer */ | 7911 | SND_PCI_QUIRK(0x1025, 0, "Acer laptop", ALC883_ACER), /* default Acer */ |
7909 | SND_PCI_QUIRK(0x1028, 0x020d, "Dell Inspiron 530", ALC888_6ST_DELL), | 7912 | SND_PCI_QUIRK(0x1028, 0x020d, "Dell Inspiron 530", ALC888_6ST_DELL), |
7910 | SND_PCI_QUIRK(0x103c, 0x2a3d, "HP Pavillion", ALC883_6ST_DIG), | 7913 | SND_PCI_QUIRK(0x103c, 0x2a3d, "HP Pavillion", ALC883_6ST_DIG), |
@@ -10946,7 +10949,23 @@ static int patch_alc268(struct hda_codec *codec) | |||
10946 | 10949 | ||
10947 | static hda_nid_t alc269_adc_nids[1] = { | 10950 | static hda_nid_t alc269_adc_nids[1] = { |
10948 | /* ADC1 */ | 10951 | /* ADC1 */ |
10949 | 0x07, | 10952 | 0x08, |
10953 | }; | ||
10954 | |||
10955 | static struct hda_input_mux alc269_eeepc_dmic_capture_source = { | ||
10956 | .num_items = 2, | ||
10957 | .items = { | ||
10958 | { "i-Mic", 0x5 }, | ||
10959 | { "e-Mic", 0x0 }, | ||
10960 | }, | ||
10961 | }; | ||
10962 | |||
10963 | static struct hda_input_mux alc269_eeepc_amic_capture_source = { | ||
10964 | .num_items = 2, | ||
10965 | .items = { | ||
10966 | { "i-Mic", 0x1 }, | ||
10967 | { "e-Mic", 0x0 }, | ||
10968 | }, | ||
10950 | }; | 10969 | }; |
10951 | 10970 | ||
10952 | #define alc269_modes alc260_modes | 10971 | #define alc269_modes alc260_modes |
@@ -10968,10 +10987,27 @@ static struct snd_kcontrol_new alc269_base_mixer[] = { | |||
10968 | { } /* end */ | 10987 | { } /* end */ |
10969 | }; | 10988 | }; |
10970 | 10989 | ||
10990 | /* bind volumes of both NID 0x0c and 0x0d */ | ||
10991 | static struct hda_bind_ctls alc269_epc_bind_vol = { | ||
10992 | .ops = &snd_hda_bind_vol, | ||
10993 | .values = { | ||
10994 | HDA_COMPOSE_AMP_VAL(0x02, 3, 0, HDA_OUTPUT), | ||
10995 | HDA_COMPOSE_AMP_VAL(0x03, 3, 0, HDA_OUTPUT), | ||
10996 | 0 | ||
10997 | }, | ||
10998 | }; | ||
10999 | |||
11000 | static struct snd_kcontrol_new alc269_eeepc_mixer[] = { | ||
11001 | HDA_CODEC_MUTE("iSpeaker Playback Switch", 0x14, 0x0, HDA_OUTPUT), | ||
11002 | HDA_BIND_VOL("LineOut Playback Volume", &alc269_epc_bind_vol), | ||
11003 | HDA_CODEC_MUTE("LineOut Playback Switch", 0x15, 0x0, HDA_OUTPUT), | ||
11004 | { } /* end */ | ||
11005 | }; | ||
11006 | |||
10971 | /* capture mixer elements */ | 11007 | /* capture mixer elements */ |
10972 | static struct snd_kcontrol_new alc269_capture_mixer[] = { | 11008 | static struct snd_kcontrol_new alc269_capture_mixer[] = { |
10973 | HDA_CODEC_VOLUME("Capture Volume", 0x07, 0x0, HDA_INPUT), | 11009 | HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), |
10974 | HDA_CODEC_MUTE("Capture Switch", 0x07, 0x0, HDA_INPUT), | 11010 | HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), |
10975 | { | 11011 | { |
10976 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 11012 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
10977 | /* The multiple "Capture Source" controls confuse alsamixer | 11013 | /* The multiple "Capture Source" controls confuse alsamixer |
@@ -10987,6 +11023,13 @@ static struct snd_kcontrol_new alc269_capture_mixer[] = { | |||
10987 | { } /* end */ | 11023 | { } /* end */ |
10988 | }; | 11024 | }; |
10989 | 11025 | ||
11026 | /* capture mixer elements */ | ||
11027 | static struct snd_kcontrol_new alc269_epc_capture_mixer[] = { | ||
11028 | HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), | ||
11029 | HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), | ||
11030 | { } /* end */ | ||
11031 | }; | ||
11032 | |||
10990 | /* | 11033 | /* |
10991 | * generic initialization of ADC, input mixers and output mixers | 11034 | * generic initialization of ADC, input mixers and output mixers |
10992 | */ | 11035 | */ |
@@ -10994,7 +11037,7 @@ static struct hda_verb alc269_init_verbs[] = { | |||
10994 | /* | 11037 | /* |
10995 | * Unmute ADC0 and set the default input to mic-in | 11038 | * Unmute ADC0 and set the default input to mic-in |
10996 | */ | 11039 | */ |
10997 | {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | 11040 | {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, |
10998 | 11041 | ||
10999 | /* Mute input amps (PCBeep, Line In, Mic 1 & Mic 2) of the | 11042 | /* Mute input amps (PCBeep, Line In, Mic 1 & Mic 2) of the |
11000 | * analog-loopback mixer widget | 11043 | * analog-loopback mixer widget |
@@ -11057,6 +11100,98 @@ static struct hda_verb alc269_init_verbs[] = { | |||
11057 | { } | 11100 | { } |
11058 | }; | 11101 | }; |
11059 | 11102 | ||
11103 | static struct hda_verb alc269_eeepc_dmic_init_verbs[] = { | ||
11104 | {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, | ||
11105 | {0x23, AC_VERB_SET_CONNECT_SEL, 0x05}, | ||
11106 | {0x02, AC_VERB_SET_AMP_GAIN_MUTE, 0xb026 }, | ||
11107 | {0x08, AC_VERB_SET_AMP_GAIN_MUTE, (0x7019 | (0x00 << 8))}, | ||
11108 | {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, | ||
11109 | {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT}, | ||
11110 | {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, | ||
11111 | {} | ||
11112 | }; | ||
11113 | |||
11114 | static struct hda_verb alc269_eeepc_amic_init_verbs[] = { | ||
11115 | {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, | ||
11116 | {0x23, AC_VERB_SET_CONNECT_SEL, 0x01}, | ||
11117 | {0x02, AC_VERB_SET_AMP_GAIN_MUTE, 0xb026 }, | ||
11118 | {0x08, AC_VERB_SET_AMP_GAIN_MUTE, (0x701b | (0x00 << 8))}, | ||
11119 | {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT}, | ||
11120 | {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, | ||
11121 | {} | ||
11122 | }; | ||
11123 | |||
11124 | /* toggle speaker-output according to the hp-jack state */ | ||
11125 | static void alc269_speaker_automute(struct hda_codec *codec) | ||
11126 | { | ||
11127 | unsigned int present; | ||
11128 | unsigned int bits; | ||
11129 | |||
11130 | present = snd_hda_codec_read(codec, 0x15, 0, | ||
11131 | AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; | ||
11132 | bits = present ? AMP_IN_MUTE(0) : 0; | ||
11133 | snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0, | ||
11134 | AMP_IN_MUTE(0), bits); | ||
11135 | snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1, | ||
11136 | AMP_IN_MUTE(0), bits); | ||
11137 | } | ||
11138 | |||
11139 | static void alc269_eeepc_dmic_automute(struct hda_codec *codec) | ||
11140 | { | ||
11141 | unsigned int present; | ||
11142 | |||
11143 | present = snd_hda_codec_read(codec, 0x18, 0, AC_VERB_GET_PIN_SENSE, 0) | ||
11144 | & AC_PINSENSE_PRESENCE; | ||
11145 | snd_hda_codec_write(codec, 0x23, 0, AC_VERB_SET_CONNECT_SEL, | ||
11146 | present ? 0 : 5); | ||
11147 | } | ||
11148 | |||
11149 | static void alc269_eeepc_amic_automute(struct hda_codec *codec) | ||
11150 | { | ||
11151 | unsigned int present; | ||
11152 | |||
11153 | present = snd_hda_codec_read(codec, 0x18, 0, AC_VERB_GET_PIN_SENSE, 0) | ||
11154 | & AC_PINSENSE_PRESENCE; | ||
11155 | snd_hda_codec_write(codec, 0x24, 0, AC_VERB_SET_AMP_GAIN_MUTE, | ||
11156 | present ? AMP_IN_UNMUTE(0) : AMP_IN_MUTE(0)); | ||
11157 | snd_hda_codec_write(codec, 0x24, 0, AC_VERB_SET_AMP_GAIN_MUTE, | ||
11158 | present ? AMP_IN_MUTE(1) : AMP_IN_UNMUTE(1)); | ||
11159 | } | ||
11160 | |||
11161 | /* unsolicited event for HP jack sensing */ | ||
11162 | static void alc269_eeepc_dmic_unsol_event(struct hda_codec *codec, | ||
11163 | unsigned int res) | ||
11164 | { | ||
11165 | if ((res >> 26) == ALC880_HP_EVENT) | ||
11166 | alc269_speaker_automute(codec); | ||
11167 | |||
11168 | if ((res >> 26) == ALC880_MIC_EVENT) | ||
11169 | alc269_eeepc_dmic_automute(codec); | ||
11170 | } | ||
11171 | |||
11172 | static void alc269_eeepc_dmic_inithook(struct hda_codec *codec) | ||
11173 | { | ||
11174 | alc269_speaker_automute(codec); | ||
11175 | alc269_eeepc_dmic_automute(codec); | ||
11176 | } | ||
11177 | |||
11178 | /* unsolicited event for HP jack sensing */ | ||
11179 | static void alc269_eeepc_amic_unsol_event(struct hda_codec *codec, | ||
11180 | unsigned int res) | ||
11181 | { | ||
11182 | if ((res >> 26) == ALC880_HP_EVENT) | ||
11183 | alc269_speaker_automute(codec); | ||
11184 | |||
11185 | if ((res >> 26) == ALC880_MIC_EVENT) | ||
11186 | alc269_eeepc_amic_automute(codec); | ||
11187 | } | ||
11188 | |||
11189 | static void alc269_eeepc_amic_inithook(struct hda_codec *codec) | ||
11190 | { | ||
11191 | alc269_speaker_automute(codec); | ||
11192 | alc269_eeepc_amic_automute(codec); | ||
11193 | } | ||
11194 | |||
11060 | /* add playback controls from the parsed DAC table */ | 11195 | /* add playback controls from the parsed DAC table */ |
11061 | static int alc269_auto_create_multi_out_ctls(struct alc_spec *spec, | 11196 | static int alc269_auto_create_multi_out_ctls(struct alc_spec *spec, |
11062 | const struct auto_pin_cfg *cfg) | 11197 | const struct auto_pin_cfg *cfg) |
@@ -11188,6 +11323,9 @@ static int alc269_parse_auto_config(struct hda_codec *codec) | |||
11188 | if (err < 0) | 11323 | if (err < 0) |
11189 | return err; | 11324 | return err; |
11190 | 11325 | ||
11326 | spec->mixers[spec->num_mixers] = alc269_capture_mixer; | ||
11327 | spec->num_mixers++; | ||
11328 | |||
11191 | return 1; | 11329 | return 1; |
11192 | } | 11330 | } |
11193 | 11331 | ||
@@ -11215,12 +11353,16 @@ static const char *alc269_models[ALC269_MODEL_LAST] = { | |||
11215 | }; | 11353 | }; |
11216 | 11354 | ||
11217 | static struct snd_pci_quirk alc269_cfg_tbl[] = { | 11355 | static struct snd_pci_quirk alc269_cfg_tbl[] = { |
11356 | SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", | ||
11357 | ALC269_ASUS_EEEPC_P703), | ||
11358 | SND_PCI_QUIRK(0x1043, 0x831a, "ASUS Eeepc P901", | ||
11359 | ALC269_ASUS_EEEPC_P901), | ||
11218 | {} | 11360 | {} |
11219 | }; | 11361 | }; |
11220 | 11362 | ||
11221 | static struct alc_config_preset alc269_presets[] = { | 11363 | static struct alc_config_preset alc269_presets[] = { |
11222 | [ALC269_BASIC] = { | 11364 | [ALC269_BASIC] = { |
11223 | .mixers = { alc269_base_mixer }, | 11365 | .mixers = { alc269_base_mixer, alc269_capture_mixer }, |
11224 | .init_verbs = { alc269_init_verbs }, | 11366 | .init_verbs = { alc269_init_verbs }, |
11225 | .num_dacs = ARRAY_SIZE(alc269_dac_nids), | 11367 | .num_dacs = ARRAY_SIZE(alc269_dac_nids), |
11226 | .dac_nids = alc269_dac_nids, | 11368 | .dac_nids = alc269_dac_nids, |
@@ -11229,6 +11371,32 @@ static struct alc_config_preset alc269_presets[] = { | |||
11229 | .channel_mode = alc269_modes, | 11371 | .channel_mode = alc269_modes, |
11230 | .input_mux = &alc269_capture_source, | 11372 | .input_mux = &alc269_capture_source, |
11231 | }, | 11373 | }, |
11374 | [ALC269_ASUS_EEEPC_P703] = { | ||
11375 | .mixers = { alc269_eeepc_mixer, alc269_epc_capture_mixer }, | ||
11376 | .init_verbs = { alc269_init_verbs, | ||
11377 | alc269_eeepc_amic_init_verbs }, | ||
11378 | .num_dacs = ARRAY_SIZE(alc269_dac_nids), | ||
11379 | .dac_nids = alc269_dac_nids, | ||
11380 | .hp_nid = 0x03, | ||
11381 | .num_channel_mode = ARRAY_SIZE(alc269_modes), | ||
11382 | .channel_mode = alc269_modes, | ||
11383 | .input_mux = &alc269_eeepc_amic_capture_source, | ||
11384 | .unsol_event = alc269_eeepc_amic_unsol_event, | ||
11385 | .init_hook = alc269_eeepc_amic_inithook, | ||
11386 | }, | ||
11387 | [ALC269_ASUS_EEEPC_P901] = { | ||
11388 | .mixers = { alc269_eeepc_mixer, alc269_epc_capture_mixer}, | ||
11389 | .init_verbs = { alc269_init_verbs, | ||
11390 | alc269_eeepc_dmic_init_verbs }, | ||
11391 | .num_dacs = ARRAY_SIZE(alc269_dac_nids), | ||
11392 | .dac_nids = alc269_dac_nids, | ||
11393 | .hp_nid = 0x03, | ||
11394 | .num_channel_mode = ARRAY_SIZE(alc269_modes), | ||
11395 | .channel_mode = alc269_modes, | ||
11396 | .input_mux = &alc269_eeepc_dmic_capture_source, | ||
11397 | .unsol_event = alc269_eeepc_dmic_unsol_event, | ||
11398 | .init_hook = alc269_eeepc_dmic_inithook, | ||
11399 | }, | ||
11232 | }; | 11400 | }; |
11233 | 11401 | ||
11234 | static int patch_alc269(struct hda_codec *codec) | 11402 | static int patch_alc269(struct hda_codec *codec) |
@@ -11282,8 +11450,6 @@ static int patch_alc269(struct hda_codec *codec) | |||
11282 | 11450 | ||
11283 | spec->adc_nids = alc269_adc_nids; | 11451 | spec->adc_nids = alc269_adc_nids; |
11284 | spec->num_adc_nids = ARRAY_SIZE(alc269_adc_nids); | 11452 | spec->num_adc_nids = ARRAY_SIZE(alc269_adc_nids); |
11285 | spec->mixers[spec->num_mixers] = alc269_capture_mixer; | ||
11286 | spec->num_mixers++; | ||
11287 | 11453 | ||
11288 | codec->patch_ops = alc_patch_ops; | 11454 | codec->patch_ops = alc_patch_ops; |
11289 | if (board_config == ALC269_AUTO) | 11455 | if (board_config == ALC269_AUTO) |
@@ -12994,6 +13160,7 @@ static struct snd_pci_quirk alc861vd_cfg_tbl[] = { | |||
12994 | SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_HP), | 13160 | SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_HP), |
12995 | SND_PCI_QUIRK(0x1043, 0x12e2, "Asus z35m", ALC660VD_3ST), | 13161 | SND_PCI_QUIRK(0x1043, 0x12e2, "Asus z35m", ALC660VD_3ST), |
12996 | SND_PCI_QUIRK(0x1043, 0x1339, "Asus G1", ALC660VD_3ST), | 13162 | SND_PCI_QUIRK(0x1043, 0x1339, "Asus G1", ALC660VD_3ST), |
13163 | SND_PCI_QUIRK(0x1043, 0x1633, "Asus V1Sn", ALC861VD_LENOVO), | ||
12997 | SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS", ALC660VD_3ST_DIG), | 13164 | SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS", ALC660VD_3ST_DIG), |
12998 | SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST), | 13165 | SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST), |
12999 | SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba A135", ALC861VD_LENOVO), | 13166 | SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba A135", ALC861VD_LENOVO), |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 08cb77f51880..7fdafcb0015d 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -94,6 +94,9 @@ enum { | |||
94 | STAC_INTEL_MAC_V3, | 94 | STAC_INTEL_MAC_V3, |
95 | STAC_INTEL_MAC_V4, | 95 | STAC_INTEL_MAC_V4, |
96 | STAC_INTEL_MAC_V5, | 96 | STAC_INTEL_MAC_V5, |
97 | STAC_INTEL_MAC_AUTO, /* This model is selected if no module parameter | ||
98 | * is given, one of the above models will be | ||
99 | * chosen according to the subsystem id. */ | ||
97 | /* for backward compatibility */ | 100 | /* for backward compatibility */ |
98 | STAC_MACMINI, | 101 | STAC_MACMINI, |
99 | STAC_MACBOOK, | 102 | STAC_MACBOOK, |
@@ -1483,6 +1486,7 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = { | |||
1483 | [STAC_INTEL_MAC_V3] = intel_mac_v3_pin_configs, | 1486 | [STAC_INTEL_MAC_V3] = intel_mac_v3_pin_configs, |
1484 | [STAC_INTEL_MAC_V4] = intel_mac_v4_pin_configs, | 1487 | [STAC_INTEL_MAC_V4] = intel_mac_v4_pin_configs, |
1485 | [STAC_INTEL_MAC_V5] = intel_mac_v5_pin_configs, | 1488 | [STAC_INTEL_MAC_V5] = intel_mac_v5_pin_configs, |
1489 | [STAC_INTEL_MAC_AUTO] = intel_mac_v3_pin_configs, | ||
1486 | /* for backward compatibility */ | 1490 | /* for backward compatibility */ |
1487 | [STAC_MACMINI] = intel_mac_v3_pin_configs, | 1491 | [STAC_MACMINI] = intel_mac_v3_pin_configs, |
1488 | [STAC_MACBOOK] = intel_mac_v5_pin_configs, | 1492 | [STAC_MACBOOK] = intel_mac_v5_pin_configs, |
@@ -1505,6 +1509,7 @@ static const char *stac922x_models[STAC_922X_MODELS] = { | |||
1505 | [STAC_INTEL_MAC_V3] = "intel-mac-v3", | 1509 | [STAC_INTEL_MAC_V3] = "intel-mac-v3", |
1506 | [STAC_INTEL_MAC_V4] = "intel-mac-v4", | 1510 | [STAC_INTEL_MAC_V4] = "intel-mac-v4", |
1507 | [STAC_INTEL_MAC_V5] = "intel-mac-v5", | 1511 | [STAC_INTEL_MAC_V5] = "intel-mac-v5", |
1512 | [STAC_INTEL_MAC_AUTO] = "intel-mac-auto", | ||
1508 | /* for backward compatibility */ | 1513 | /* for backward compatibility */ |
1509 | [STAC_MACMINI] = "macmini", | 1514 | [STAC_MACMINI] = "macmini", |
1510 | [STAC_MACBOOK] = "macbook", | 1515 | [STAC_MACBOOK] = "macbook", |
@@ -1576,9 +1581,9 @@ static struct snd_pci_quirk stac922x_cfg_tbl[] = { | |||
1576 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0707, | 1581 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0707, |
1577 | "Intel D945P", STAC_D945GTP5), | 1582 | "Intel D945P", STAC_D945GTP5), |
1578 | /* other systems */ | 1583 | /* other systems */ |
1579 | /* Apple Mac Mini (early 2006) */ | 1584 | /* Apple Intel Mac (Mac Mini, MacBook, MacBook Pro...) */ |
1580 | SND_PCI_QUIRK(0x8384, 0x7680, | 1585 | SND_PCI_QUIRK(0x8384, 0x7680, |
1581 | "Mac Mini", STAC_INTEL_MAC_V3), | 1586 | "Mac", STAC_INTEL_MAC_AUTO), |
1582 | /* Dell systems */ | 1587 | /* Dell systems */ |
1583 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01a7, | 1588 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01a7, |
1584 | "unknown Dell", STAC_922X_DELL_D81), | 1589 | "unknown Dell", STAC_922X_DELL_D81), |
@@ -3725,7 +3730,7 @@ static int patch_stac922x(struct hda_codec *codec) | |||
3725 | spec->board_config = snd_hda_check_board_config(codec, STAC_922X_MODELS, | 3730 | spec->board_config = snd_hda_check_board_config(codec, STAC_922X_MODELS, |
3726 | stac922x_models, | 3731 | stac922x_models, |
3727 | stac922x_cfg_tbl); | 3732 | stac922x_cfg_tbl); |
3728 | if (spec->board_config == STAC_INTEL_MAC_V3) { | 3733 | if (spec->board_config == STAC_INTEL_MAC_AUTO) { |
3729 | spec->gpio_mask = spec->gpio_dir = 0x03; | 3734 | spec->gpio_mask = spec->gpio_dir = 0x03; |
3730 | spec->gpio_data = 0x03; | 3735 | spec->gpio_data = 0x03; |
3731 | /* Intel Macs have all same PCI SSID, so we need to check | 3736 | /* Intel Macs have all same PCI SSID, so we need to check |
@@ -3757,6 +3762,9 @@ static int patch_stac922x(struct hda_codec *codec) | |||
3757 | case 0x106b2200: | 3762 | case 0x106b2200: |
3758 | spec->board_config = STAC_INTEL_MAC_V5; | 3763 | spec->board_config = STAC_INTEL_MAC_V5; |
3759 | break; | 3764 | break; |
3765 | default: | ||
3766 | spec->board_config = STAC_INTEL_MAC_V3; | ||
3767 | break; | ||
3760 | } | 3768 | } |
3761 | } | 3769 | } |
3762 | 3770 | ||
diff --git a/sound/soc/au1x/psc-i2s.c b/sound/soc/au1x/psc-i2s.c index ba4b5c199f21..9384702c7ebd 100644 --- a/sound/soc/au1x/psc-i2s.c +++ b/sound/soc/au1x/psc-i2s.c | |||
@@ -231,7 +231,7 @@ static int au1xpsc_i2s_stop(struct au1xpsc_audio_data *pscdata, int stype) | |||
231 | 231 | ||
232 | /* if both TX and RX are idle, disable PSC */ | 232 | /* if both TX and RX are idle, disable PSC */ |
233 | stat = au_readl(I2S_STAT(pscdata)); | 233 | stat = au_readl(I2S_STAT(pscdata)); |
234 | if (!(stat & (PSC_I2SSTAT_RB | PSC_I2SSTAT_RB))) { | 234 | if (!(stat & (PSC_I2SSTAT_TB | PSC_I2SSTAT_RB))) { |
235 | au_writel(0, I2S_CFG(pscdata)); | 235 | au_writel(0, I2S_CFG(pscdata)); |
236 | au_sync(); | 236 | au_sync(); |
237 | au_writel(PSC_CTRL_SUSPEND, PSC_CTRL(pscdata)); | 237 | au_writel(PSC_CTRL_SUSPEND, PSC_CTRL(pscdata)); |
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c index 9fc8edd82225..1fb7f9a7aecd 100644 --- a/sound/soc/codecs/wm9712.c +++ b/sound/soc/codecs/wm9712.c | |||
@@ -427,20 +427,20 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
427 | {"HPOUTR", NULL, "Headphone PGA"}, | 427 | {"HPOUTR", NULL, "Headphone PGA"}, |
428 | {"Headphone PGA", NULL, "Right HP Mixer"}, | 428 | {"Headphone PGA", NULL, "Right HP Mixer"}, |
429 | 429 | ||
430 | /* mono hp mixer */ | 430 | /* mono mixer */ |
431 | {"Mono HP Mixer", NULL, "Left HP Mixer"}, | 431 | {"Mono Mixer", NULL, "Left HP Mixer"}, |
432 | {"Mono HP Mixer", NULL, "Right HP Mixer"}, | 432 | {"Mono Mixer", NULL, "Right HP Mixer"}, |
433 | 433 | ||
434 | /* Out3 Mux */ | 434 | /* Out3 Mux */ |
435 | {"Out3 Mux", "Left", "Left HP Mixer"}, | 435 | {"Out3 Mux", "Left", "Left HP Mixer"}, |
436 | {"Out3 Mux", "Mono", "Phone Mixer"}, | 436 | {"Out3 Mux", "Mono", "Phone Mixer"}, |
437 | {"Out3 Mux", "Left + Right", "Mono HP Mixer"}, | 437 | {"Out3 Mux", "Left + Right", "Mono Mixer"}, |
438 | {"Out 3 PGA", NULL, "Out3 Mux"}, | 438 | {"Out 3 PGA", NULL, "Out3 Mux"}, |
439 | {"OUT3", NULL, "Out 3 PGA"}, | 439 | {"OUT3", NULL, "Out 3 PGA"}, |
440 | 440 | ||
441 | /* speaker Mux */ | 441 | /* speaker Mux */ |
442 | {"Speaker Mux", "Speaker Mix", "Speaker Mixer"}, | 442 | {"Speaker Mux", "Speaker Mix", "Speaker Mixer"}, |
443 | {"Speaker Mux", "Headphone Mix", "Mono HP Mixer"}, | 443 | {"Speaker Mux", "Headphone Mix", "Mono Mixer"}, |
444 | {"Speaker PGA", NULL, "Speaker Mux"}, | 444 | {"Speaker PGA", NULL, "Speaker Mux"}, |
445 | {"LOUT2", NULL, "Speaker PGA"}, | 445 | {"LOUT2", NULL, "Speaker PGA"}, |
446 | {"ROUT2", NULL, "Speaker PGA"}, | 446 | {"ROUT2", NULL, "Speaker PGA"}, |
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 2c87061c2a6b..820347c9ae4b 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -523,24 +523,6 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event) | |||
523 | continue; | 523 | continue; |
524 | } | 524 | } |
525 | 525 | ||
526 | /* programmable gain/attenuation */ | ||
527 | if (w->id == snd_soc_dapm_pga) { | ||
528 | int on; | ||
529 | in = is_connected_input_ep(w); | ||
530 | dapm_clear_walk(w->codec); | ||
531 | out = is_connected_output_ep(w); | ||
532 | dapm_clear_walk(w->codec); | ||
533 | w->power = on = (out != 0 && in != 0) ? 1 : 0; | ||
534 | |||
535 | if (!on) | ||
536 | dapm_set_pga(w, on); /* lower volume to reduce pops */ | ||
537 | dapm_update_bits(w); | ||
538 | if (on) | ||
539 | dapm_set_pga(w, on); /* restore volume from zero */ | ||
540 | |||
541 | continue; | ||
542 | } | ||
543 | |||
544 | /* pre and post event widgets */ | 526 | /* pre and post event widgets */ |
545 | if (w->id == snd_soc_dapm_pre) { | 527 | if (w->id == snd_soc_dapm_pre) { |
546 | if (!w->event) | 528 | if (!w->event) |
@@ -586,45 +568,56 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event) | |||
586 | power_change = (w->power == power) ? 0: 1; | 568 | power_change = (w->power == power) ? 0: 1; |
587 | w->power = power; | 569 | w->power = power; |
588 | 570 | ||
571 | if (!power_change) | ||
572 | continue; | ||
573 | |||
589 | /* call any power change event handlers */ | 574 | /* call any power change event handlers */ |
590 | if (power_change) { | 575 | if (w->event) |
591 | if (w->event) { | 576 | pr_debug("power %s event for %s flags %x\n", |
592 | pr_debug("power %s event for %s flags %x\n", | 577 | w->power ? "on" : "off", |
593 | w->power ? "on" : "off", w->name, w->event_flags); | 578 | w->name, w->event_flags); |
594 | if (power) { | 579 | |
595 | /* power up event */ | 580 | /* power up pre event */ |
596 | if (w->event_flags & SND_SOC_DAPM_PRE_PMU) { | 581 | if (power && w->event && |
597 | ret = w->event(w, | 582 | (w->event_flags & SND_SOC_DAPM_PRE_PMU)) { |
598 | NULL, SND_SOC_DAPM_PRE_PMU); | 583 | ret = w->event(w, NULL, SND_SOC_DAPM_PRE_PMU); |
599 | if (ret < 0) | 584 | if (ret < 0) |
600 | return ret; | 585 | return ret; |
601 | } | 586 | } |
602 | dapm_update_bits(w); | 587 | |
603 | if (w->event_flags & SND_SOC_DAPM_POST_PMU){ | 588 | /* power down pre event */ |
604 | ret = w->event(w, | 589 | if (!power && w->event && |
605 | NULL, SND_SOC_DAPM_POST_PMU); | 590 | (w->event_flags & SND_SOC_DAPM_PRE_PMD)) { |
606 | if (ret < 0) | 591 | ret = w->event(w, NULL, SND_SOC_DAPM_PRE_PMD); |
607 | return ret; | 592 | if (ret < 0) |
608 | } | 593 | return ret; |
609 | } else { | 594 | } |
610 | /* power down event */ | 595 | |
611 | if (w->event_flags & SND_SOC_DAPM_PRE_PMD) { | 596 | /* Lower PGA volume to reduce pops */ |
612 | ret = w->event(w, | 597 | if (w->id == snd_soc_dapm_pga && !power) |
613 | NULL, SND_SOC_DAPM_PRE_PMD); | 598 | dapm_set_pga(w, power); |
614 | if (ret < 0) | 599 | |
615 | return ret; | 600 | dapm_update_bits(w); |
616 | } | 601 | |
617 | dapm_update_bits(w); | 602 | /* Raise PGA volume to reduce pops */ |
618 | if (w->event_flags & SND_SOC_DAPM_POST_PMD) { | 603 | if (w->id == snd_soc_dapm_pga && power) |
619 | ret = w->event(w, | 604 | dapm_set_pga(w, power); |
620 | NULL, SND_SOC_DAPM_POST_PMD); | 605 | |
621 | if (ret < 0) | 606 | /* power up post event */ |
622 | return ret; | 607 | if (power && w->event && |
623 | } | 608 | (w->event_flags & SND_SOC_DAPM_POST_PMU)) { |
624 | } | 609 | ret = w->event(w, |
625 | } else | 610 | NULL, SND_SOC_DAPM_POST_PMU); |
626 | /* no event handler */ | 611 | if (ret < 0) |
627 | dapm_update_bits(w); | 612 | return ret; |
613 | } | ||
614 | |||
615 | /* power down post event */ | ||
616 | if (!power && w->event && | ||
617 | (w->event_flags & SND_SOC_DAPM_POST_PMD)) { | ||
618 | ret = w->event(w, NULL, SND_SOC_DAPM_POST_PMD); | ||
619 | if (ret < 0) | ||
620 | return ret; | ||
628 | } | 621 | } |
629 | } | 622 | } |
630 | } | 623 | } |