Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 270351
b: refs/heads/master
c: 5fa9b15
h: refs/heads/master
i:
  270349: 6ae4710
  270347: ac5eb4c
  270343: 280072c
  270335: 472def9
v: v3
  • Loading branch information
Takashi Iwai committed Aug 23, 2011
1 parent f3bb9a5 commit b9d7a77
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 32 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 188cd2b5c624880e31b49f93edd2669b51d118f4
refs/heads/master: 5fa9b1511216282e27e048defae78c0f44c148d1
2 changes: 1 addition & 1 deletion trunk/sound/aoa/fabrics/layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -1073,10 +1073,10 @@ static int aoa_fabric_layout_probe(struct soundbus_dev *sdev)
sdev->pcmid = -1;
list_del(&ldev->list);
layouts_list_items--;
kfree(ldev);
outnodev:
of_node_put(sound);
layout_device = NULL;
kfree(ldev);
return -ENODEV;
}

Expand Down
31 changes: 19 additions & 12 deletions trunk/sound/pci/hda/hda_eld.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,25 +144,17 @@ static int cea_sampling_frequencies[8] = {
SNDRV_PCM_RATE_192000, /* 7: 192000Hz */
};

static unsigned char hdmi_get_eld_byte(struct hda_codec *codec, hda_nid_t nid,
static unsigned int hdmi_get_eld_data(struct hda_codec *codec, hda_nid_t nid,
int byte_index)
{
unsigned int val;

val = snd_hda_codec_read(codec, nid, 0,
AC_VERB_GET_HDMI_ELDD, byte_index);

#ifdef BE_PARANOID
printk(KERN_INFO "HDMI: ELD data byte %d: 0x%x\n", byte_index, val);
#endif

if ((val & AC_ELDD_ELD_VALID) == 0) {
snd_printd(KERN_INFO "HDMI: invalid ELD data byte %d\n",
byte_index);
val = 0;
}

return val & AC_ELDD_ELD_DATA;
return val;
}

#define GRAB_BITS(buf, byte, lowbit, bits) \
Expand Down Expand Up @@ -344,11 +336,26 @@ int snd_hdmi_get_eld(struct hdmi_eld *eld,
if (!buf)
return -ENOMEM;

for (i = 0; i < size; i++)
buf[i] = hdmi_get_eld_byte(codec, nid, i);
for (i = 0; i < size; i++) {
unsigned int val = hdmi_get_eld_data(codec, nid, i);
if (!(val & AC_ELDD_ELD_VALID)) {
if (!i) {
snd_printd(KERN_INFO
"HDMI: invalid ELD data\n");
ret = -EINVAL;
goto error;
}
snd_printd(KERN_INFO
"HDMI: invalid ELD data byte %d\n", i);
val = 0;
} else
val &= AC_ELDD_ELD_DATA;
buf[i] = val;
}

ret = hdmi_update_eld(eld, buf, size);

error:
kfree(buf);
return ret;
}
Expand Down
8 changes: 5 additions & 3 deletions trunk/sound/pci/hda/patch_cirrus.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ static int is_ext_mic(struct hda_codec *codec, unsigned int idx)
static hda_nid_t get_adc(struct hda_codec *codec, hda_nid_t pin,
unsigned int *idxp)
{
int i;
int i, idx;
hda_nid_t nid;

nid = codec->start_nid;
Expand All @@ -384,9 +384,11 @@ static hda_nid_t get_adc(struct hda_codec *codec, hda_nid_t pin,
type = get_wcaps_type(get_wcaps(codec, nid));
if (type != AC_WID_AUD_IN)
continue;
*idxp = snd_hda_get_conn_index(codec, nid, pin, false);
if (*idxp >= 0)
idx = snd_hda_get_conn_index(codec, nid, pin, false);
if (idx >= 0) {
*idxp = idx;
return nid;
}
}
return 0;
}
Expand Down
13 changes: 10 additions & 3 deletions trunk/sound/pci/hda/patch_conexant.c
Original file line number Diff line number Diff line change
Expand Up @@ -3348,6 +3348,8 @@ static hda_nid_t get_unassigned_dac(struct hda_codec *codec, hda_nid_t pin,

#define MAX_AUTO_DACS 5

#define DAC_SLAVE_FLAG 0x8000 /* filled dac is a slave */

/* fill analog DAC list from the widget tree */
static int fill_cx_auto_dacs(struct hda_codec *codec, hda_nid_t *dacs)
{
Expand Down Expand Up @@ -3379,6 +3381,8 @@ static int fill_dacs_for_pins(struct hda_codec *codec, hda_nid_t *pins,
filled[nums].pin = pins[i];
filled[nums].type = type;
filled[nums].dac = get_unassigned_dac(codec, pins[i], dacs, rest);
if (!filled[nums].dac && i > 0 && filled[0].dac)
filled[nums].dac = filled[0].dac | DAC_SLAVE_FLAG;
nums++;
}
return nums;
Expand Down Expand Up @@ -3407,7 +3411,7 @@ static void cx_auto_parse_output(struct hda_codec *codec)
/* fill multiout struct */
for (i = 0; i < nums; i++) {
hda_nid_t dac = spec->dac_info[i].dac;
if (!dac)
if (!dac || (dac & DAC_SLAVE_FLAG))
continue;
switch (spec->dac_info[i].type) {
case AUTO_PIN_LINE_OUT:
Expand Down Expand Up @@ -4035,6 +4039,8 @@ static void cx_auto_init_output(struct hda_codec *codec)
nid = spec->dac_info[i].dac;
if (!nid)
nid = spec->multiout.dac_nids[0];
else if (nid & DAC_SLAVE_FLAG)
nid &= ~DAC_SLAVE_FLAG;
select_connection(codec, spec->dac_info[i].pin, nid);
}
if (spec->auto_mute) {
Expand Down Expand Up @@ -4191,7 +4197,8 @@ static int cx_auto_build_output_controls(struct hda_codec *codec)
for (i = 0; i < spec->dac_info_filled; i++) {
const char *label;
int idx, type;
if (!spec->dac_info[i].dac)
hda_nid_t dac = spec->dac_info[i].dac;
if (!dac || (dac & DAC_SLAVE_FLAG))
continue;
type = spec->dac_info[i].type;
if (type == AUTO_PIN_LINE_OUT)
Expand All @@ -4211,7 +4218,7 @@ static int cx_auto_build_output_controls(struct hda_codec *codec)
idx = num_spk++;
break;
}
err = try_add_pb_volume(codec, spec->dac_info[i].dac,
err = try_add_pb_volume(codec, dac,
spec->dac_info[i].pin,
label, idx);
if (err < 0)
Expand Down
30 changes: 19 additions & 11 deletions trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,11 +578,11 @@ static void alc_hp_automute(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;

if (!spec->automute)
return;
spec->jack_present =
detect_jacks(codec, ARRAY_SIZE(spec->autocfg.hp_pins),
spec->autocfg.hp_pins);
if (!spec->automute)
return;
call_update_speakers(codec);
}

Expand All @@ -591,11 +591,11 @@ static void alc_line_automute(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;

if (!spec->automute || !spec->detect_line)
return;
spec->line_jack_present =
detect_jacks(codec, ARRAY_SIZE(spec->autocfg.line_out_pins),
spec->autocfg.line_out_pins);
if (!spec->automute || !spec->detect_line)
return;
call_update_speakers(codec);
}

Expand Down Expand Up @@ -1797,6 +1797,7 @@ static const char * const alc_slave_vols[] = {
"Speaker Playback Volume",
"Mono Playback Volume",
"Line-Out Playback Volume",
"PCM Playback Volume",
NULL,
};

Expand All @@ -1811,6 +1812,7 @@ static const char * const alc_slave_sws[] = {
"Mono Playback Switch",
"IEC958 Playback Switch",
"Line-Out Playback Switch",
"PCM Playback Switch",
NULL,
};

Expand Down Expand Up @@ -3221,16 +3223,22 @@ static void alc_auto_init_multi_out(struct hda_codec *codec)
static void alc_auto_init_extra_out(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
hda_nid_t pin;
hda_nid_t pin, dac;

pin = spec->autocfg.hp_pins[0];
if (pin)
alc_auto_set_output_and_unmute(codec, pin, PIN_HP,
spec->multiout.hp_nid);
if (pin) {
dac = spec->multiout.hp_nid;
if (!dac)
dac = spec->multiout.dac_nids[0];
alc_auto_set_output_and_unmute(codec, pin, PIN_HP, dac);
}
pin = spec->autocfg.speaker_pins[0];
if (pin)
alc_auto_set_output_and_unmute(codec, pin, PIN_OUT,
spec->multiout.extra_out_nid[0]);
if (pin) {
dac = spec->multiout.extra_out_nid[0];
if (!dac)
dac = spec->multiout.dac_nids[0];
alc_auto_set_output_and_unmute(codec, pin, PIN_OUT, dac);
}
}

/*
Expand Down
3 changes: 2 additions & 1 deletion trunk/sound/usb/mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ static inline void check_mapped_dB(const struct usbmix_name_map *p,
if (p && p->dB) {
cval->dBmin = p->dB->min;
cval->dBmax = p->dB->max;
cval->initialized = 1;
}
}

Expand Down Expand Up @@ -1092,7 +1093,7 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc,
" Switch" : " Volume");
if (control == UAC_FU_VOLUME) {
check_mapped_dB(map, cval);
if (cval->dBmin < cval->dBmax) {
if (cval->dBmin < cval->dBmax || !cval->initialized) {
kctl->tlv.c = mixer_vol_tlv;
kctl->vd[0].access |=
SNDRV_CTL_ELEM_ACCESS_TLV_READ |
Expand Down

0 comments on commit b9d7a77

Please sign in to comment.