aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-01-10 04:49:13 -0500
committerTakashi Iwai <tiwai@suse.de>2011-01-10 04:49:13 -0500
commit70c673a48072ff73425b82800479e66f918b8718 (patch)
treeb8a98710f97ff69c51fa5ba158f403059fd30632
parent10528020d7323778b60c2de04754a2615a88d002 (diff)
parente03fa055bc126e536c7f65862e08a9b143138ea9 (diff)
Merge branch 'fix/hda' into topic/hda
-rw-r--r--sound/core/pcm_lib.c10
-rw-r--r--sound/oss/soundcard.c4
-rw-r--r--sound/pci/hda/hda_codec.c57
-rw-r--r--sound/pci/hda/hda_intel.c1
-rw-r--r--sound/pci/hda/patch_realtek.c57
-rw-r--r--sound/pci/hda/patch_sigmatel.c5
-rw-r--r--sound/soc/codecs/wm8580.c2
-rw-r--r--sound/soc/codecs/wm8904.c3
-rw-r--r--sound/soc/codecs/wm8955.c3
-rw-r--r--sound/soc/codecs/wm8960.c3
-rw-r--r--sound/soc/soc-dapm.c3
11 files changed, 91 insertions, 57 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index b75db8e9cc0f..11446a1506da 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -1070,8 +1070,10 @@ int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, unsigned int cond,
1070 struct snd_pcm_hw_rule *new; 1070 struct snd_pcm_hw_rule *new;
1071 unsigned int new_rules = constrs->rules_all + 16; 1071 unsigned int new_rules = constrs->rules_all + 16;
1072 new = kcalloc(new_rules, sizeof(*c), GFP_KERNEL); 1072 new = kcalloc(new_rules, sizeof(*c), GFP_KERNEL);
1073 if (!new) 1073 if (!new) {
1074 va_end(args);
1074 return -ENOMEM; 1075 return -ENOMEM;
1076 }
1075 if (constrs->rules) { 1077 if (constrs->rules) {
1076 memcpy(new, constrs->rules, 1078 memcpy(new, constrs->rules,
1077 constrs->rules_num * sizeof(*c)); 1079 constrs->rules_num * sizeof(*c));
@@ -1087,8 +1089,10 @@ int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, unsigned int cond,
1087 c->private = private; 1089 c->private = private;
1088 k = 0; 1090 k = 0;
1089 while (1) { 1091 while (1) {
1090 if (snd_BUG_ON(k >= ARRAY_SIZE(c->deps))) 1092 if (snd_BUG_ON(k >= ARRAY_SIZE(c->deps))) {
1093 va_end(args);
1091 return -EINVAL; 1094 return -EINVAL;
1095 }
1092 c->deps[k++] = dep; 1096 c->deps[k++] = dep;
1093 if (dep < 0) 1097 if (dep < 0)
1094 break; 1098 break;
@@ -1097,7 +1101,7 @@ int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, unsigned int cond,
1097 constrs->rules_num++; 1101 constrs->rules_num++;
1098 va_end(args); 1102 va_end(args);
1099 return 0; 1103 return 0;
1100} 1104}
1101 1105
1102EXPORT_SYMBOL(snd_pcm_hw_rule_add); 1106EXPORT_SYMBOL(snd_pcm_hw_rule_add);
1103 1107
diff --git a/sound/oss/soundcard.c b/sound/oss/soundcard.c
index 46c0d03dbecc..fcb14a099822 100644
--- a/sound/oss/soundcard.c
+++ b/sound/oss/soundcard.c
@@ -87,7 +87,7 @@ int *load_mixer_volumes(char *name, int *levels, int present)
87 int i, n; 87 int i, n;
88 88
89 for (i = 0; i < num_mixer_volumes; i++) { 89 for (i = 0; i < num_mixer_volumes; i++) {
90 if (strcmp(name, mixer_vols[i].name) == 0) { 90 if (strncmp(name, mixer_vols[i].name, 32) == 0) {
91 if (present) 91 if (present)
92 mixer_vols[i].num = i; 92 mixer_vols[i].num = i;
93 return mixer_vols[i].levels; 93 return mixer_vols[i].levels;
@@ -99,7 +99,7 @@ int *load_mixer_volumes(char *name, int *levels, int present)
99 } 99 }
100 n = num_mixer_volumes++; 100 n = num_mixer_volumes++;
101 101
102 strcpy(mixer_vols[n].name, name); 102 strncpy(mixer_vols[n].name, name, 32);
103 103
104 if (present) 104 if (present)
105 mixer_vols[n].num = n; 105 mixer_vols[n].num = n;
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 644e3f14f8ca..98b6d02a36c9 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -1919,6 +1919,16 @@ struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec,
1919} 1919}
1920EXPORT_SYMBOL_HDA(snd_hda_find_mixer_ctl); 1920EXPORT_SYMBOL_HDA(snd_hda_find_mixer_ctl);
1921 1921
1922static int find_empty_mixer_ctl_idx(struct hda_codec *codec, const char *name)
1923{
1924 int idx;
1925 for (idx = 0; idx < 16; idx++) { /* 16 ctlrs should be large enough */
1926 if (!_snd_hda_find_mixer_ctl(codec, name, idx))
1927 return idx;
1928 }
1929 return -EBUSY;
1930}
1931
1922/** 1932/**
1923 * snd_hda_ctl_add - Add a control element and assign to the codec 1933 * snd_hda_ctl_add - Add a control element and assign to the codec
1924 * @codec: HD-audio codec 1934 * @codec: HD-audio codec
@@ -2654,8 +2664,6 @@ static struct snd_kcontrol_new dig_mixes[] = {
2654 { } /* end */ 2664 { } /* end */
2655}; 2665};
2656 2666
2657#define SPDIF_MAX_IDX 4 /* 4 instances should be enough to probe */
2658
2659/** 2667/**
2660 * snd_hda_create_spdif_out_ctls - create Output SPDIF-related controls 2668 * snd_hda_create_spdif_out_ctls - create Output SPDIF-related controls
2661 * @codec: the HDA codec 2669 * @codec: the HDA codec
@@ -2673,12 +2681,8 @@ int snd_hda_create_spdif_out_ctls(struct hda_codec *codec, hda_nid_t nid)
2673 struct snd_kcontrol_new *dig_mix; 2681 struct snd_kcontrol_new *dig_mix;
2674 int idx; 2682 int idx;
2675 2683
2676 for (idx = 0; idx < SPDIF_MAX_IDX; idx++) { 2684 idx = find_empty_mixer_ctl_idx(codec, "IEC958 Playback Switch");
2677 if (!_snd_hda_find_mixer_ctl(codec, "IEC958 Playback Switch", 2685 if (idx < 0) {
2678 idx))
2679 break;
2680 }
2681 if (idx >= SPDIF_MAX_IDX) {
2682 printk(KERN_ERR "hda_codec: too many IEC958 outputs\n"); 2686 printk(KERN_ERR "hda_codec: too many IEC958 outputs\n");
2683 return -EBUSY; 2687 return -EBUSY;
2684 } 2688 }
@@ -2829,12 +2833,8 @@ int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid)
2829 struct snd_kcontrol_new *dig_mix; 2833 struct snd_kcontrol_new *dig_mix;
2830 int idx; 2834 int idx;
2831 2835
2832 for (idx = 0; idx < SPDIF_MAX_IDX; idx++) { 2836 idx = find_empty_mixer_ctl_idx(codec, "IEC958 Capture Switch");
2833 if (!_snd_hda_find_mixer_ctl(codec, "IEC958 Capture Switch", 2837 if (idx < 0) {
2834 idx))
2835 break;
2836 }
2837 if (idx >= SPDIF_MAX_IDX) {
2838 printk(KERN_ERR "hda_codec: too many IEC958 inputs\n"); 2838 printk(KERN_ERR "hda_codec: too many IEC958 inputs\n");
2839 return -EBUSY; 2839 return -EBUSY;
2840 } 2840 }
@@ -3808,21 +3808,32 @@ int snd_hda_add_new_ctls(struct hda_codec *codec, struct snd_kcontrol_new *knew)
3808 3808
3809 for (; knew->name; knew++) { 3809 for (; knew->name; knew++) {
3810 struct snd_kcontrol *kctl; 3810 struct snd_kcontrol *kctl;
3811 int addr = 0, idx = 0;
3811 if (knew->iface == -1) /* skip this codec private value */ 3812 if (knew->iface == -1) /* skip this codec private value */
3812 continue; 3813 continue;
3813 kctl = snd_ctl_new1(knew, codec); 3814 for (;;) {
3814 if (!kctl)
3815 return -ENOMEM;
3816 err = snd_hda_ctl_add(codec, 0, kctl);
3817 if (err < 0) {
3818 if (!codec->addr)
3819 return err;
3820 kctl = snd_ctl_new1(knew, codec); 3815 kctl = snd_ctl_new1(knew, codec);
3821 if (!kctl) 3816 if (!kctl)
3822 return -ENOMEM; 3817 return -ENOMEM;
3823 kctl->id.device = codec->addr; 3818 if (addr > 0)
3819 kctl->id.device = addr;
3820 if (idx > 0)
3821 kctl->id.index = idx;
3824 err = snd_hda_ctl_add(codec, 0, kctl); 3822 err = snd_hda_ctl_add(codec, 0, kctl);
3825 if (err < 0) 3823 if (!err)
3824 break;
3825 /* try first with another device index corresponding to
3826 * the codec addr; if it still fails (or it's the
3827 * primary codec), then try another control index
3828 */
3829 if (!addr && codec->addr)
3830 addr = codec->addr;
3831 else if (!idx && !knew->index) {
3832 idx = find_empty_mixer_ctl_idx(codec,
3833 knew->name);
3834 if (idx <= 0)
3835 return err;
3836 } else
3826 return err; 3837 return err;
3827 } 3838 }
3828 } 3839 }
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index b030c8eba21f..a1c4008af891 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2300,6 +2300,7 @@ static struct snd_pci_quirk position_fix_list[] __devinitdata = {
2300 SND_PCI_QUIRK(0x1028, 0x01cc, "Dell D820", POS_FIX_LPIB), 2300 SND_PCI_QUIRK(0x1028, 0x01cc, "Dell D820", POS_FIX_LPIB),
2301 SND_PCI_QUIRK(0x1028, 0x01de, "Dell Precision 390", POS_FIX_LPIB), 2301 SND_PCI_QUIRK(0x1028, 0x01de, "Dell Precision 390", POS_FIX_LPIB),
2302 SND_PCI_QUIRK(0x1028, 0x01f6, "Dell Latitude 131L", POS_FIX_LPIB), 2302 SND_PCI_QUIRK(0x1028, 0x01f6, "Dell Latitude 131L", POS_FIX_LPIB),
2303 SND_PCI_QUIRK(0x1028, 0x0470, "Dell Inspiron 1120", POS_FIX_LPIB),
2303 SND_PCI_QUIRK(0x103c, 0x306d, "HP dv3", POS_FIX_LPIB), 2304 SND_PCI_QUIRK(0x103c, 0x306d, "HP dv3", POS_FIX_LPIB),
2304 SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB), 2305 SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB),
2305 SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB), 2306 SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB),
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index cad88f476acc..f39efa440c0f 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -14795,6 +14795,7 @@ static int alc269_resume(struct hda_codec *codec)
14795 14795
14796enum { 14796enum {
14797 ALC269_FIXUP_SONY_VAIO, 14797 ALC269_FIXUP_SONY_VAIO,
14798 ALC275_FIX_SONY_VAIO_GPIO2,
14798 ALC269_FIXUP_DELL_M101Z, 14799 ALC269_FIXUP_DELL_M101Z,
14799 ALC269_FIXUP_SKU_IGNORE, 14800 ALC269_FIXUP_SKU_IGNORE,
14800 ALC269_FIXUP_ASUS_G73JW, 14801 ALC269_FIXUP_ASUS_G73JW,
@@ -14807,6 +14808,14 @@ static const struct alc_fixup alc269_fixups[] = {
14807 {} 14808 {}
14808 } 14809 }
14809 }, 14810 },
14811 [ALC275_FIX_SONY_VAIO_GPIO2] = {
14812 .verbs = (const struct hda_verb[]) {
14813 {0x01, AC_VERB_SET_GPIO_MASK, 0x04},
14814 {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x04},
14815 {0x01, AC_VERB_SET_GPIO_DATA, 0x00},
14816 { }
14817 }
14818 },
14810 [ALC269_FIXUP_DELL_M101Z] = { 14819 [ALC269_FIXUP_DELL_M101Z] = {
14811 .verbs = (const struct hda_verb[]) { 14820 .verbs = (const struct hda_verb[]) {
14812 /* Enables internal speaker */ 14821 /* Enables internal speaker */
@@ -14827,6 +14836,9 @@ static const struct alc_fixup alc269_fixups[] = {
14827}; 14836};
14828 14837
14829static struct snd_pci_quirk alc269_fixup_tbl[] = { 14838static struct snd_pci_quirk alc269_fixup_tbl[] = {
14839 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIX_SONY_VAIO_GPIO2),
14840 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIX_SONY_VAIO_GPIO2),
14841 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIX_SONY_VAIO_GPIO2),
14830 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), 14842 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
14831 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), 14843 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
14832 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), 14844 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
@@ -15081,28 +15093,29 @@ static int patch_alc269(struct hda_codec *codec)
15081 15093
15082 alc_auto_parse_customize_define(codec); 15094 alc_auto_parse_customize_define(codec);
15083 15095
15084 coef = alc_read_coef_idx(codec, 0); 15096 if (codec->vendor_id == 0x10ec0269) {
15085 if ((coef & 0x00f0) == 0x0010) { 15097 coef = alc_read_coef_idx(codec, 0);
15086 if (codec->bus->pci->subsystem_vendor == 0x1025 && 15098 if ((coef & 0x00f0) == 0x0010) {
15087 spec->cdefine.platform_type == 1) { 15099 if (codec->bus->pci->subsystem_vendor == 0x1025 &&
15088 alc_codec_rename(codec, "ALC271X"); 15100 spec->cdefine.platform_type == 1) {
15089 spec->codec_variant = ALC269_TYPE_ALC271X; 15101 alc_codec_rename(codec, "ALC271X");
15090 } else if ((coef & 0xf000) == 0x1000) { 15102 spec->codec_variant = ALC269_TYPE_ALC271X;
15091 spec->codec_variant = ALC269_TYPE_ALC270; 15103 } else if ((coef & 0xf000) == 0x1000) {
15092 } else if ((coef & 0xf000) == 0x2000) { 15104 spec->codec_variant = ALC269_TYPE_ALC270;
15093 alc_codec_rename(codec, "ALC259"); 15105 } else if ((coef & 0xf000) == 0x2000) {
15094 spec->codec_variant = ALC269_TYPE_ALC259; 15106 alc_codec_rename(codec, "ALC259");
15095 } else if ((coef & 0xf000) == 0x3000) { 15107 spec->codec_variant = ALC269_TYPE_ALC259;
15096 alc_codec_rename(codec, "ALC258"); 15108 } else if ((coef & 0xf000) == 0x3000) {
15097 spec->codec_variant = ALC269_TYPE_ALC258; 15109 alc_codec_rename(codec, "ALC258");
15098 } else { 15110 spec->codec_variant = ALC269_TYPE_ALC258;
15099 alc_codec_rename(codec, "ALC269VB"); 15111 } else {
15100 spec->codec_variant = ALC269_TYPE_ALC269VB; 15112 alc_codec_rename(codec, "ALC269VB");
15101 } 15113 spec->codec_variant = ALC269_TYPE_ALC269VB;
15102 } else 15114 }
15103 alc_fix_pll_init(codec, 0x20, 0x04, 15); 15115 } else
15104 15116 alc_fix_pll_init(codec, 0x20, 0x04, 15);
15105 alc269_fill_coef(codec); 15117 alc269_fill_coef(codec);
15118 }
15106 15119
15107 board_config = snd_hda_check_board_config(codec, ALC269_MODEL_LAST, 15120 board_config = snd_hda_check_board_config(codec, ALC269_MODEL_LAST,
15108 alc269_models, 15121 alc269_models,
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 8e2bb0aad0ae..6131a92f0898 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -3481,6 +3481,8 @@ static int stac92xx_auto_create_dmic_input_ctls(struct hda_codec *codec,
3481 3481
3482 label = hda_get_input_pin_label(codec, nid, 1); 3482 label = hda_get_input_pin_label(codec, nid, 1);
3483 snd_hda_add_imux_item(dimux, label, index, &type_idx); 3483 snd_hda_add_imux_item(dimux, label, index, &type_idx);
3484 if (snd_hda_get_bool_hint(codec, "separate_dmux") != 1)
3485 snd_hda_add_imux_item(imux, label, index, &type_idx);
3484 3486
3485 err = create_elem_capture_vol(codec, nid, label, type_idx, 3487 err = create_elem_capture_vol(codec, nid, label, type_idx,
3486 HDA_INPUT); 3488 HDA_INPUT);
@@ -3492,9 +3494,6 @@ static int stac92xx_auto_create_dmic_input_ctls(struct hda_codec *codec,
3492 if (err < 0) 3494 if (err < 0)
3493 return err; 3495 return err;
3494 } 3496 }
3495
3496 if (snd_hda_get_bool_hint(codec, "separate_dmux") != 1)
3497 snd_hda_add_imux_item(imux, label, index, NULL);
3498 } 3497 }
3499 3498
3500 return 0; 3499 return 0;
diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c
index 879dff2714dd..8725d4e75431 100644
--- a/sound/soc/codecs/wm8580.c
+++ b/sound/soc/codecs/wm8580.c
@@ -161,7 +161,7 @@
161static const u16 wm8580_reg[] = { 161static const u16 wm8580_reg[] = {
162 0x0121, 0x017e, 0x007d, 0x0014, /*R3*/ 162 0x0121, 0x017e, 0x007d, 0x0014, /*R3*/
163 0x0121, 0x017e, 0x007d, 0x0194, /*R7*/ 163 0x0121, 0x017e, 0x007d, 0x0194, /*R7*/
164 0x001c, 0x0002, 0x0002, 0x00c2, /*R11*/ 164 0x0010, 0x0002, 0x0002, 0x00c2, /*R11*/
165 0x0182, 0x0082, 0x000a, 0x0024, /*R15*/ 165 0x0182, 0x0082, 0x000a, 0x0024, /*R15*/
166 0x0009, 0x0000, 0x00ff, 0x0000, /*R19*/ 166 0x0009, 0x0000, 0x00ff, 0x0000, /*R19*/
167 0x00ff, 0x00ff, 0x00ff, 0x00ff, /*R23*/ 167 0x00ff, 0x00ff, 0x00ff, 0x00ff, /*R23*/
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c
index fca60a0b57b8..9001cc48ba13 100644
--- a/sound/soc/codecs/wm8904.c
+++ b/sound/soc/codecs/wm8904.c
@@ -818,7 +818,8 @@ static int wm8904_get_deemph(struct snd_kcontrol *kcontrol,
818 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 818 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
819 struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec); 819 struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec);
820 820
821 return wm8904->deemph; 821 ucontrol->value.enumerated.item[0] = wm8904->deemph;
822 return 0;
822} 823}
823 824
824static int wm8904_put_deemph(struct snd_kcontrol *kcontrol, 825static int wm8904_put_deemph(struct snd_kcontrol *kcontrol,
diff --git a/sound/soc/codecs/wm8955.c b/sound/soc/codecs/wm8955.c
index f89ad6c9a80b..9cbab8e1de01 100644
--- a/sound/soc/codecs/wm8955.c
+++ b/sound/soc/codecs/wm8955.c
@@ -380,7 +380,8 @@ static int wm8955_get_deemph(struct snd_kcontrol *kcontrol,
380 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 380 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
381 struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec); 381 struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec);
382 382
383 return wm8955->deemph; 383 ucontrol->value.enumerated.item[0] = wm8955->deemph;
384 return 0;
384} 385}
385 386
386static int wm8955_put_deemph(struct snd_kcontrol *kcontrol, 387static int wm8955_put_deemph(struct snd_kcontrol *kcontrol,
diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
index 8d5efb333c33..21986c42272f 100644
--- a/sound/soc/codecs/wm8960.c
+++ b/sound/soc/codecs/wm8960.c
@@ -138,7 +138,8 @@ static int wm8960_get_deemph(struct snd_kcontrol *kcontrol,
138 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 138 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
139 struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec); 139 struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec);
140 140
141 return wm8960->deemph; 141 ucontrol->value.enumerated.item[0] = wm8960->deemph;
142 return 0;
142} 143}
143 144
144static int wm8960_put_deemph(struct snd_kcontrol *kcontrol, 145static int wm8960_put_deemph(struct snd_kcontrol *kcontrol,
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 75ed6491222d..c721502833bc 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -944,6 +944,9 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event)
944 case SND_SOC_DAPM_STREAM_RESUME: 944 case SND_SOC_DAPM_STREAM_RESUME:
945 sys_power = 1; 945 sys_power = 1;
946 break; 946 break;
947 case SND_SOC_DAPM_STREAM_STOP:
948 sys_power = !!codec->active;
949 break;
947 case SND_SOC_DAPM_STREAM_SUSPEND: 950 case SND_SOC_DAPM_STREAM_SUSPEND:
948 sys_power = 0; 951 sys_power = 0;
949 break; 952 break;