aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-08-23 09:02:36 -0400
committerTakashi Iwai <tiwai@suse.de>2011-08-23 09:02:36 -0400
commit5fa9b1511216282e27e048defae78c0f44c148d1 (patch)
tree08c8a7ed74350ca48fb3c0ee70074c9fa6539e8b /sound
parent188cd2b5c624880e31b49f93edd2669b51d118f4 (diff)
parent1f015f5fdc4003f3f2a7c66efdb1acf7a2d230bf (diff)
Merge branch 'fix/hda' into topic/hda
Conflicts: sound/pci/hda/patch_realtek.c
Diffstat (limited to 'sound')
-rw-r--r--sound/aoa/fabrics/layout.c2
-rw-r--r--sound/pci/hda/hda_eld.c31
-rw-r--r--sound/pci/hda/patch_cirrus.c8
-rw-r--r--sound/pci/hda/patch_conexant.c13
-rw-r--r--sound/pci/hda/patch_realtek.c30
-rw-r--r--sound/usb/mixer.c3
6 files changed, 56 insertions, 31 deletions
diff --git a/sound/aoa/fabrics/layout.c b/sound/aoa/fabrics/layout.c
index 3fd1a7e24928..552b97afbca5 100644
--- a/sound/aoa/fabrics/layout.c
+++ b/sound/aoa/fabrics/layout.c
@@ -1073,10 +1073,10 @@ static int aoa_fabric_layout_probe(struct soundbus_dev *sdev)
1073 sdev->pcmid = -1; 1073 sdev->pcmid = -1;
1074 list_del(&ldev->list); 1074 list_del(&ldev->list);
1075 layouts_list_items--; 1075 layouts_list_items--;
1076 kfree(ldev);
1076 outnodev: 1077 outnodev:
1077 of_node_put(sound); 1078 of_node_put(sound);
1078 layout_device = NULL; 1079 layout_device = NULL;
1079 kfree(ldev);
1080 return -ENODEV; 1080 return -ENODEV;
1081} 1081}
1082 1082
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c
index 28ce17d09c33..c34f730f4815 100644
--- a/sound/pci/hda/hda_eld.c
+++ b/sound/pci/hda/hda_eld.c
@@ -144,25 +144,17 @@ static int cea_sampling_frequencies[8] = {
144 SNDRV_PCM_RATE_192000, /* 7: 192000Hz */ 144 SNDRV_PCM_RATE_192000, /* 7: 192000Hz */
145}; 145};
146 146
147static unsigned char hdmi_get_eld_byte(struct hda_codec *codec, hda_nid_t nid, 147static unsigned int hdmi_get_eld_data(struct hda_codec *codec, hda_nid_t nid,
148 int byte_index) 148 int byte_index)
149{ 149{
150 unsigned int val; 150 unsigned int val;
151 151
152 val = snd_hda_codec_read(codec, nid, 0, 152 val = snd_hda_codec_read(codec, nid, 0,
153 AC_VERB_GET_HDMI_ELDD, byte_index); 153 AC_VERB_GET_HDMI_ELDD, byte_index);
154
155#ifdef BE_PARANOID 154#ifdef BE_PARANOID
156 printk(KERN_INFO "HDMI: ELD data byte %d: 0x%x\n", byte_index, val); 155 printk(KERN_INFO "HDMI: ELD data byte %d: 0x%x\n", byte_index, val);
157#endif 156#endif
158 157 return val;
159 if ((val & AC_ELDD_ELD_VALID) == 0) {
160 snd_printd(KERN_INFO "HDMI: invalid ELD data byte %d\n",
161 byte_index);
162 val = 0;
163 }
164
165 return val & AC_ELDD_ELD_DATA;
166} 158}
167 159
168#define GRAB_BITS(buf, byte, lowbit, bits) \ 160#define GRAB_BITS(buf, byte, lowbit, bits) \
@@ -344,11 +336,26 @@ int snd_hdmi_get_eld(struct hdmi_eld *eld,
344 if (!buf) 336 if (!buf)
345 return -ENOMEM; 337 return -ENOMEM;
346 338
347 for (i = 0; i < size; i++) 339 for (i = 0; i < size; i++) {
348 buf[i] = hdmi_get_eld_byte(codec, nid, i); 340 unsigned int val = hdmi_get_eld_data(codec, nid, i);
341 if (!(val & AC_ELDD_ELD_VALID)) {
342 if (!i) {
343 snd_printd(KERN_INFO
344 "HDMI: invalid ELD data\n");
345 ret = -EINVAL;
346 goto error;
347 }
348 snd_printd(KERN_INFO
349 "HDMI: invalid ELD data byte %d\n", i);
350 val = 0;
351 } else
352 val &= AC_ELDD_ELD_DATA;
353 buf[i] = val;
354 }
349 355
350 ret = hdmi_update_eld(eld, buf, size); 356 ret = hdmi_update_eld(eld, buf, size);
351 357
358error:
352 kfree(buf); 359 kfree(buf);
353 return ret; 360 return ret;
354} 361}
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
index 47d6ffc9b5b5..d6c93d92b550 100644
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -375,7 +375,7 @@ static int is_ext_mic(struct hda_codec *codec, unsigned int idx)
375static hda_nid_t get_adc(struct hda_codec *codec, hda_nid_t pin, 375static hda_nid_t get_adc(struct hda_codec *codec, hda_nid_t pin,
376 unsigned int *idxp) 376 unsigned int *idxp)
377{ 377{
378 int i; 378 int i, idx;
379 hda_nid_t nid; 379 hda_nid_t nid;
380 380
381 nid = codec->start_nid; 381 nid = codec->start_nid;
@@ -384,9 +384,11 @@ static hda_nid_t get_adc(struct hda_codec *codec, hda_nid_t pin,
384 type = get_wcaps_type(get_wcaps(codec, nid)); 384 type = get_wcaps_type(get_wcaps(codec, nid));
385 if (type != AC_WID_AUD_IN) 385 if (type != AC_WID_AUD_IN)
386 continue; 386 continue;
387 *idxp = snd_hda_get_conn_index(codec, nid, pin, false); 387 idx = snd_hda_get_conn_index(codec, nid, pin, false);
388 if (*idxp >= 0) 388 if (idx >= 0) {
389 *idxp = idx;
389 return nid; 390 return nid;
391 }
390 } 392 }
391 return 0; 393 return 0;
392} 394}
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 502fc9499453..4c462c3d6462 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -3348,6 +3348,8 @@ static hda_nid_t get_unassigned_dac(struct hda_codec *codec, hda_nid_t pin,
3348 3348
3349#define MAX_AUTO_DACS 5 3349#define MAX_AUTO_DACS 5
3350 3350
3351#define DAC_SLAVE_FLAG 0x8000 /* filled dac is a slave */
3352
3351/* fill analog DAC list from the widget tree */ 3353/* fill analog DAC list from the widget tree */
3352static int fill_cx_auto_dacs(struct hda_codec *codec, hda_nid_t *dacs) 3354static int fill_cx_auto_dacs(struct hda_codec *codec, hda_nid_t *dacs)
3353{ 3355{
@@ -3379,6 +3381,8 @@ static int fill_dacs_for_pins(struct hda_codec *codec, hda_nid_t *pins,
3379 filled[nums].pin = pins[i]; 3381 filled[nums].pin = pins[i];
3380 filled[nums].type = type; 3382 filled[nums].type = type;
3381 filled[nums].dac = get_unassigned_dac(codec, pins[i], dacs, rest); 3383 filled[nums].dac = get_unassigned_dac(codec, pins[i], dacs, rest);
3384 if (!filled[nums].dac && i > 0 && filled[0].dac)
3385 filled[nums].dac = filled[0].dac | DAC_SLAVE_FLAG;
3382 nums++; 3386 nums++;
3383 } 3387 }
3384 return nums; 3388 return nums;
@@ -3407,7 +3411,7 @@ static void cx_auto_parse_output(struct hda_codec *codec)
3407 /* fill multiout struct */ 3411 /* fill multiout struct */
3408 for (i = 0; i < nums; i++) { 3412 for (i = 0; i < nums; i++) {
3409 hda_nid_t dac = spec->dac_info[i].dac; 3413 hda_nid_t dac = spec->dac_info[i].dac;
3410 if (!dac) 3414 if (!dac || (dac & DAC_SLAVE_FLAG))
3411 continue; 3415 continue;
3412 switch (spec->dac_info[i].type) { 3416 switch (spec->dac_info[i].type) {
3413 case AUTO_PIN_LINE_OUT: 3417 case AUTO_PIN_LINE_OUT:
@@ -4035,6 +4039,8 @@ static void cx_auto_init_output(struct hda_codec *codec)
4035 nid = spec->dac_info[i].dac; 4039 nid = spec->dac_info[i].dac;
4036 if (!nid) 4040 if (!nid)
4037 nid = spec->multiout.dac_nids[0]; 4041 nid = spec->multiout.dac_nids[0];
4042 else if (nid & DAC_SLAVE_FLAG)
4043 nid &= ~DAC_SLAVE_FLAG;
4038 select_connection(codec, spec->dac_info[i].pin, nid); 4044 select_connection(codec, spec->dac_info[i].pin, nid);
4039 } 4045 }
4040 if (spec->auto_mute) { 4046 if (spec->auto_mute) {
@@ -4191,7 +4197,8 @@ static int cx_auto_build_output_controls(struct hda_codec *codec)
4191 for (i = 0; i < spec->dac_info_filled; i++) { 4197 for (i = 0; i < spec->dac_info_filled; i++) {
4192 const char *label; 4198 const char *label;
4193 int idx, type; 4199 int idx, type;
4194 if (!spec->dac_info[i].dac) 4200 hda_nid_t dac = spec->dac_info[i].dac;
4201 if (!dac || (dac & DAC_SLAVE_FLAG))
4195 continue; 4202 continue;
4196 type = spec->dac_info[i].type; 4203 type = spec->dac_info[i].type;
4197 if (type == AUTO_PIN_LINE_OUT) 4204 if (type == AUTO_PIN_LINE_OUT)
@@ -4211,7 +4218,7 @@ static int cx_auto_build_output_controls(struct hda_codec *codec)
4211 idx = num_spk++; 4218 idx = num_spk++;
4212 break; 4219 break;
4213 } 4220 }
4214 err = try_add_pb_volume(codec, spec->dac_info[i].dac, 4221 err = try_add_pb_volume(codec, dac,
4215 spec->dac_info[i].pin, 4222 spec->dac_info[i].pin,
4216 label, idx); 4223 label, idx);
4217 if (err < 0) 4224 if (err < 0)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index e0ecf5a5b097..c3e5af955620 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -578,11 +578,11 @@ static void alc_hp_automute(struct hda_codec *codec)
578{ 578{
579 struct alc_spec *spec = codec->spec; 579 struct alc_spec *spec = codec->spec;
580 580
581 if (!spec->automute)
582 return;
583 spec->jack_present = 581 spec->jack_present =
584 detect_jacks(codec, ARRAY_SIZE(spec->autocfg.hp_pins), 582 detect_jacks(codec, ARRAY_SIZE(spec->autocfg.hp_pins),
585 spec->autocfg.hp_pins); 583 spec->autocfg.hp_pins);
584 if (!spec->automute)
585 return;
586 call_update_speakers(codec); 586 call_update_speakers(codec);
587} 587}
588 588
@@ -591,11 +591,11 @@ static void alc_line_automute(struct hda_codec *codec)
591{ 591{
592 struct alc_spec *spec = codec->spec; 592 struct alc_spec *spec = codec->spec;
593 593
594 if (!spec->automute || !spec->detect_line)
595 return;
596 spec->line_jack_present = 594 spec->line_jack_present =
597 detect_jacks(codec, ARRAY_SIZE(spec->autocfg.line_out_pins), 595 detect_jacks(codec, ARRAY_SIZE(spec->autocfg.line_out_pins),
598 spec->autocfg.line_out_pins); 596 spec->autocfg.line_out_pins);
597 if (!spec->automute || !spec->detect_line)
598 return;
599 call_update_speakers(codec); 599 call_update_speakers(codec);
600} 600}
601 601
@@ -1797,6 +1797,7 @@ static const char * const alc_slave_vols[] = {
1797 "Speaker Playback Volume", 1797 "Speaker Playback Volume",
1798 "Mono Playback Volume", 1798 "Mono Playback Volume",
1799 "Line-Out Playback Volume", 1799 "Line-Out Playback Volume",
1800 "PCM Playback Volume",
1800 NULL, 1801 NULL,
1801}; 1802};
1802 1803
@@ -1811,6 +1812,7 @@ static const char * const alc_slave_sws[] = {
1811 "Mono Playback Switch", 1812 "Mono Playback Switch",
1812 "IEC958 Playback Switch", 1813 "IEC958 Playback Switch",
1813 "Line-Out Playback Switch", 1814 "Line-Out Playback Switch",
1815 "PCM Playback Switch",
1814 NULL, 1816 NULL,
1815}; 1817};
1816 1818
@@ -3221,16 +3223,22 @@ static void alc_auto_init_multi_out(struct hda_codec *codec)
3221static void alc_auto_init_extra_out(struct hda_codec *codec) 3223static void alc_auto_init_extra_out(struct hda_codec *codec)
3222{ 3224{
3223 struct alc_spec *spec = codec->spec; 3225 struct alc_spec *spec = codec->spec;
3224 hda_nid_t pin; 3226 hda_nid_t pin, dac;
3225 3227
3226 pin = spec->autocfg.hp_pins[0]; 3228 pin = spec->autocfg.hp_pins[0];
3227 if (pin) 3229 if (pin) {
3228 alc_auto_set_output_and_unmute(codec, pin, PIN_HP, 3230 dac = spec->multiout.hp_nid;
3229 spec->multiout.hp_nid); 3231 if (!dac)
3232 dac = spec->multiout.dac_nids[0];
3233 alc_auto_set_output_and_unmute(codec, pin, PIN_HP, dac);
3234 }
3230 pin = spec->autocfg.speaker_pins[0]; 3235 pin = spec->autocfg.speaker_pins[0];
3231 if (pin) 3236 if (pin) {
3232 alc_auto_set_output_and_unmute(codec, pin, PIN_OUT, 3237 dac = spec->multiout.extra_out_nid[0];
3233 spec->multiout.extra_out_nid[0]); 3238 if (!dac)
3239 dac = spec->multiout.dac_nids[0];
3240 alc_auto_set_output_and_unmute(codec, pin, PIN_OUT, dac);
3241 }
3234} 3242}
3235 3243
3236/* 3244/*
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index c04d7c71ac88..cdd19d7fe500 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -152,6 +152,7 @@ static inline void check_mapped_dB(const struct usbmix_name_map *p,
152 if (p && p->dB) { 152 if (p && p->dB) {
153 cval->dBmin = p->dB->min; 153 cval->dBmin = p->dB->min;
154 cval->dBmax = p->dB->max; 154 cval->dBmax = p->dB->max;
155 cval->initialized = 1;
155 } 156 }
156} 157}
157 158
@@ -1092,7 +1093,7 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc,
1092 " Switch" : " Volume"); 1093 " Switch" : " Volume");
1093 if (control == UAC_FU_VOLUME) { 1094 if (control == UAC_FU_VOLUME) {
1094 check_mapped_dB(map, cval); 1095 check_mapped_dB(map, cval);
1095 if (cval->dBmin < cval->dBmax) { 1096 if (cval->dBmin < cval->dBmax || !cval->initialized) {
1096 kctl->tlv.c = mixer_vol_tlv; 1097 kctl->tlv.c = mixer_vol_tlv;
1097 kctl->vd[0].access |= 1098 kctl->vd[0].access |=
1098 SNDRV_CTL_ELEM_ACCESS_TLV_READ | 1099 SNDRV_CTL_ELEM_ACCESS_TLV_READ |