Commit 79058c4b authored by Linus Torvalds's avatar Linus Torvalds

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: sound/aoa/fabrics/layout.c: remove unneeded kfree
  ALSA: hda - Fix error check from snd_hda_get_conn_index() in patch_cirrus.c
  ALSA: hda - Don't spew too many ELD errors
  ALSA: usb-audio - Fix missing mixer dB information
  ALSA: hda - Add "PCM" volume to vmaster slave list
  ALSA: hda - Fix duplicated capture-volume creation for ALC268 models
  ALSA: ac97: Add HP Compaq dc5100 SFF(PT003AW) to Headphone Jack Sense whitelist
  ALSA: snd_usb_caiaq: track submitted output urbs
parents 47c08f31 de75577c
...@@ -1073,10 +1073,10 @@ static int aoa_fabric_layout_probe(struct soundbus_dev *sdev) ...@@ -1073,10 +1073,10 @@ static int aoa_fabric_layout_probe(struct soundbus_dev *sdev)
sdev->pcmid = -1; sdev->pcmid = -1;
list_del(&ldev->list); list_del(&ldev->list);
layouts_list_items--; layouts_list_items--;
kfree(ldev);
outnodev: outnodev:
of_node_put(sound); of_node_put(sound);
layout_device = NULL; layout_device = NULL;
kfree(ldev);
return -ENODEV; return -ENODEV;
} }
......
...@@ -1909,6 +1909,7 @@ static unsigned int ad1981_jacks_whitelist[] = { ...@@ -1909,6 +1909,7 @@ static unsigned int ad1981_jacks_whitelist[] = {
0x103c0944, /* HP nc6220 */ 0x103c0944, /* HP nc6220 */
0x103c0934, /* HP nc8220 */ 0x103c0934, /* HP nc8220 */
0x103c006d, /* HP nx9105 */ 0x103c006d, /* HP nx9105 */
0x103c300d, /* HP Compaq dc5100 SFF(PT003AW) */
0x17340088, /* FSC Scenic-W */ 0x17340088, /* FSC Scenic-W */
0 /* end */ 0 /* end */
}; };
......
...@@ -476,8 +476,8 @@ static const struct snd_pci_quirk alc268_ssid_cfg_tbl[] = { ...@@ -476,8 +476,8 @@ static const struct snd_pci_quirk alc268_ssid_cfg_tbl[] = {
static const struct alc_config_preset alc268_presets[] = { static const struct alc_config_preset alc268_presets[] = {
[ALC267_QUANTA_IL1] = { [ALC267_QUANTA_IL1] = {
.mixers = { alc267_quanta_il1_mixer, alc268_beep_mixer, .mixers = { alc267_quanta_il1_mixer, alc268_beep_mixer },
alc268_capture_nosrc_mixer }, .cap_mixer = alc268_capture_nosrc_mixer,
.init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs, .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
alc267_quanta_il1_verbs }, alc267_quanta_il1_verbs },
.num_dacs = ARRAY_SIZE(alc268_dac_nids), .num_dacs = ARRAY_SIZE(alc268_dac_nids),
...@@ -492,8 +492,8 @@ static const struct alc_config_preset alc268_presets[] = { ...@@ -492,8 +492,8 @@ static const struct alc_config_preset alc268_presets[] = {
.init_hook = alc_inithook, .init_hook = alc_inithook,
}, },
[ALC268_3ST] = { [ALC268_3ST] = {
.mixers = { alc268_base_mixer, alc268_capture_alt_mixer, .mixers = { alc268_base_mixer, alc268_beep_mixer },
alc268_beep_mixer }, .cap_mixer = alc268_capture_alt_mixer,
.init_verbs = { alc268_base_init_verbs }, .init_verbs = { alc268_base_init_verbs },
.num_dacs = ARRAY_SIZE(alc268_dac_nids), .num_dacs = ARRAY_SIZE(alc268_dac_nids),
.dac_nids = alc268_dac_nids, .dac_nids = alc268_dac_nids,
...@@ -507,8 +507,8 @@ static const struct alc_config_preset alc268_presets[] = { ...@@ -507,8 +507,8 @@ static const struct alc_config_preset alc268_presets[] = {
.input_mux = &alc268_capture_source, .input_mux = &alc268_capture_source,
}, },
[ALC268_TOSHIBA] = { [ALC268_TOSHIBA] = {
.mixers = { alc268_toshiba_mixer, alc268_capture_alt_mixer, .mixers = { alc268_toshiba_mixer, alc268_beep_mixer },
alc268_beep_mixer }, .cap_mixer = alc268_capture_alt_mixer,
.init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs, .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
alc268_toshiba_verbs }, alc268_toshiba_verbs },
.num_dacs = ARRAY_SIZE(alc268_dac_nids), .num_dacs = ARRAY_SIZE(alc268_dac_nids),
...@@ -525,8 +525,8 @@ static const struct alc_config_preset alc268_presets[] = { ...@@ -525,8 +525,8 @@ static const struct alc_config_preset alc268_presets[] = {
.init_hook = alc_inithook, .init_hook = alc_inithook,
}, },
[ALC268_ACER] = { [ALC268_ACER] = {
.mixers = { alc268_acer_mixer, alc268_capture_alt_mixer, .mixers = { alc268_acer_mixer, alc268_beep_mixer },
alc268_beep_mixer }, .cap_mixer = alc268_capture_alt_mixer,
.init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs, .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
alc268_acer_verbs }, alc268_acer_verbs },
.num_dacs = ARRAY_SIZE(alc268_dac_nids), .num_dacs = ARRAY_SIZE(alc268_dac_nids),
...@@ -543,8 +543,8 @@ static const struct alc_config_preset alc268_presets[] = { ...@@ -543,8 +543,8 @@ static const struct alc_config_preset alc268_presets[] = {
.init_hook = alc_inithook, .init_hook = alc_inithook,
}, },
[ALC268_ACER_DMIC] = { [ALC268_ACER_DMIC] = {
.mixers = { alc268_acer_dmic_mixer, alc268_capture_alt_mixer, .mixers = { alc268_acer_dmic_mixer, alc268_beep_mixer },
alc268_beep_mixer }, .cap_mixer = alc268_capture_alt_mixer,
.init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs, .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
alc268_acer_verbs }, alc268_acer_verbs },
.num_dacs = ARRAY_SIZE(alc268_dac_nids), .num_dacs = ARRAY_SIZE(alc268_dac_nids),
...@@ -561,9 +561,8 @@ static const struct alc_config_preset alc268_presets[] = { ...@@ -561,9 +561,8 @@ static const struct alc_config_preset alc268_presets[] = {
.init_hook = alc_inithook, .init_hook = alc_inithook,
}, },
[ALC268_ACER_ASPIRE_ONE] = { [ALC268_ACER_ASPIRE_ONE] = {
.mixers = { alc268_acer_aspire_one_mixer, .mixers = { alc268_acer_aspire_one_mixer, alc268_beep_mixer},
alc268_beep_mixer, .cap_mixer = alc268_capture_nosrc_mixer,
alc268_capture_nosrc_mixer },
.init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs, .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
alc268_acer_aspire_one_verbs }, alc268_acer_aspire_one_verbs },
.num_dacs = ARRAY_SIZE(alc268_dac_nids), .num_dacs = ARRAY_SIZE(alc268_dac_nids),
...@@ -579,8 +578,8 @@ static const struct alc_config_preset alc268_presets[] = { ...@@ -579,8 +578,8 @@ static const struct alc_config_preset alc268_presets[] = {
.init_hook = alc_inithook, .init_hook = alc_inithook,
}, },
[ALC268_DELL] = { [ALC268_DELL] = {
.mixers = { alc268_dell_mixer, alc268_beep_mixer, .mixers = { alc268_dell_mixer, alc268_beep_mixer},
alc268_capture_nosrc_mixer }, .cap_mixer = alc268_capture_nosrc_mixer,
.init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs, .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
alc268_dell_verbs }, alc268_dell_verbs },
.num_dacs = ARRAY_SIZE(alc268_dac_nids), .num_dacs = ARRAY_SIZE(alc268_dac_nids),
...@@ -596,8 +595,8 @@ static const struct alc_config_preset alc268_presets[] = { ...@@ -596,8 +595,8 @@ static const struct alc_config_preset alc268_presets[] = {
.init_hook = alc_inithook, .init_hook = alc_inithook,
}, },
[ALC268_ZEPTO] = { [ALC268_ZEPTO] = {
.mixers = { alc268_base_mixer, alc268_capture_alt_mixer, .mixers = { alc268_base_mixer, alc268_beep_mixer },
alc268_beep_mixer }, .cap_mixer = alc268_capture_alt_mixer,
.init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs, .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
alc268_toshiba_verbs }, alc268_toshiba_verbs },
.num_dacs = ARRAY_SIZE(alc268_dac_nids), .num_dacs = ARRAY_SIZE(alc268_dac_nids),
...@@ -616,7 +615,8 @@ static const struct alc_config_preset alc268_presets[] = { ...@@ -616,7 +615,8 @@ static const struct alc_config_preset alc268_presets[] = {
}, },
#ifdef CONFIG_SND_DEBUG #ifdef CONFIG_SND_DEBUG
[ALC268_TEST] = { [ALC268_TEST] = {
.mixers = { alc268_test_mixer, alc268_capture_mixer }, .mixers = { alc268_test_mixer },
.cap_mixer = alc268_capture_mixer,
.init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs, .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
alc268_volume_init_verbs, alc268_volume_init_verbs,
alc268_beep_init_verbs }, alc268_beep_init_verbs },
......
...@@ -144,25 +144,17 @@ static int cea_sampling_frequencies[8] = { ...@@ -144,25 +144,17 @@ static int cea_sampling_frequencies[8] = {
SNDRV_PCM_RATE_192000, /* 7: 192000Hz */ 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) int byte_index)
{ {
unsigned int val; unsigned int val;
val = snd_hda_codec_read(codec, nid, 0, val = snd_hda_codec_read(codec, nid, 0,
AC_VERB_GET_HDMI_ELDD, byte_index); AC_VERB_GET_HDMI_ELDD, byte_index);
#ifdef BE_PARANOID #ifdef BE_PARANOID
printk(KERN_INFO "HDMI: ELD data byte %d: 0x%x\n", byte_index, val); printk(KERN_INFO "HDMI: ELD data byte %d: 0x%x\n", byte_index, val);
#endif #endif
return val;
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;
} }
#define GRAB_BITS(buf, byte, lowbit, bits) \ #define GRAB_BITS(buf, byte, lowbit, bits) \
...@@ -344,11 +336,26 @@ int snd_hdmi_get_eld(struct hdmi_eld *eld, ...@@ -344,11 +336,26 @@ int snd_hdmi_get_eld(struct hdmi_eld *eld,
if (!buf) if (!buf)
return -ENOMEM; return -ENOMEM;
for (i = 0; i < size; i++) for (i = 0; i < size; i++) {
buf[i] = hdmi_get_eld_byte(codec, nid, 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); ret = hdmi_update_eld(eld, buf, size);
error:
kfree(buf); kfree(buf);
return ret; return ret;
} }
......
...@@ -375,7 +375,7 @@ static int is_ext_mic(struct hda_codec *codec, unsigned int idx) ...@@ -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, static hda_nid_t get_adc(struct hda_codec *codec, hda_nid_t pin,
unsigned int *idxp) unsigned int *idxp)
{ {
int i; int i, idx;
hda_nid_t nid; hda_nid_t nid;
nid = codec->start_nid; nid = codec->start_nid;
...@@ -384,9 +384,11 @@ static hda_nid_t get_adc(struct hda_codec *codec, hda_nid_t pin, ...@@ -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)); type = get_wcaps_type(get_wcaps(codec, nid));
if (type != AC_WID_AUD_IN) if (type != AC_WID_AUD_IN)
continue; continue;
*idxp = snd_hda_get_conn_index(codec, nid, pin, false); idx = snd_hda_get_conn_index(codec, nid, pin, false);
if (*idxp >= 0) if (idx >= 0) {
*idxp = idx;
return nid; return nid;
}
} }
return 0; return 0;
} }
......
...@@ -1784,6 +1784,7 @@ static const char * const alc_slave_vols[] = { ...@@ -1784,6 +1784,7 @@ static const char * const alc_slave_vols[] = {
"Speaker Playback Volume", "Speaker Playback Volume",
"Mono Playback Volume", "Mono Playback Volume",
"Line-Out Playback Volume", "Line-Out Playback Volume",
"PCM Playback Volume",
NULL, NULL,
}; };
...@@ -1798,6 +1799,7 @@ static const char * const alc_slave_sws[] = { ...@@ -1798,6 +1799,7 @@ static const char * const alc_slave_sws[] = {
"Mono Playback Switch", "Mono Playback Switch",
"IEC958 Playback Switch", "IEC958 Playback Switch",
"Line-Out Playback Switch", "Line-Out Playback Switch",
"PCM Playback Switch",
NULL, NULL,
}; };
......
...@@ -139,8 +139,12 @@ static void stream_stop(struct snd_usb_caiaqdev *dev) ...@@ -139,8 +139,12 @@ static void stream_stop(struct snd_usb_caiaqdev *dev)
for (i = 0; i < N_URBS; i++) { for (i = 0; i < N_URBS; i++) {
usb_kill_urb(dev->data_urbs_in[i]); usb_kill_urb(dev->data_urbs_in[i]);
usb_kill_urb(dev->data_urbs_out[i]);
if (test_bit(i, &dev->outurb_active_mask))
usb_kill_urb(dev->data_urbs_out[i]);
} }
dev->outurb_active_mask = 0;
} }
static int snd_usb_caiaq_substream_open(struct snd_pcm_substream *substream) static int snd_usb_caiaq_substream_open(struct snd_pcm_substream *substream)
...@@ -612,8 +616,8 @@ static void read_completed(struct urb *urb) ...@@ -612,8 +616,8 @@ static void read_completed(struct urb *urb)
{ {
struct snd_usb_caiaq_cb_info *info = urb->context; struct snd_usb_caiaq_cb_info *info = urb->context;
struct snd_usb_caiaqdev *dev; struct snd_usb_caiaqdev *dev;
struct urb *out; struct urb *out = NULL;
int frame, len, send_it = 0, outframe = 0; int i, frame, len, send_it = 0, outframe = 0;
size_t offset = 0; size_t offset = 0;
if (urb->status || !info) if (urb->status || !info)
...@@ -624,7 +628,17 @@ static void read_completed(struct urb *urb) ...@@ -624,7 +628,17 @@ static void read_completed(struct urb *urb)
if (!dev->streaming) if (!dev->streaming)
return; return;
out = dev->data_urbs_out[info->index]; /* find an unused output urb that is unused */
for (i = 0; i < N_URBS; i++)
if (test_and_set_bit(i, &dev->outurb_active_mask) == 0) {
out = dev->data_urbs_out[i];
break;
}
if (!out) {
log("Unable to find an output urb to use\n");
goto requeue;
}
/* read the recently received packet and send back one which has /* read the recently received packet and send back one which has
* the same layout */ * the same layout */
...@@ -655,8 +669,12 @@ static void read_completed(struct urb *urb) ...@@ -655,8 +669,12 @@ static void read_completed(struct urb *urb)
out->number_of_packets = outframe; out->number_of_packets = outframe;
out->transfer_flags = URB_ISO_ASAP; out->transfer_flags = URB_ISO_ASAP;
usb_submit_urb(out, GFP_ATOMIC); usb_submit_urb(out, GFP_ATOMIC);
} else {
struct snd_usb_caiaq_cb_info *oinfo = out->context;
clear_bit(oinfo->index, &dev->outurb_active_mask);
} }
requeue:
/* re-submit inbound urb */ /* re-submit inbound urb */
for (frame = 0; frame < FRAMES_PER_URB; frame++) { for (frame = 0; frame < FRAMES_PER_URB; frame++) {
urb->iso_frame_desc[frame].offset = BYTES_PER_FRAME * frame; urb->iso_frame_desc[frame].offset = BYTES_PER_FRAME * frame;
...@@ -678,6 +696,8 @@ static void write_completed(struct urb *urb) ...@@ -678,6 +696,8 @@ static void write_completed(struct urb *urb)
dev->output_running = 1; dev->output_running = 1;
wake_up(&dev->prepare_wait_queue); wake_up(&dev->prepare_wait_queue);
} }
clear_bit(info->index, &dev->outurb_active_mask);
} }
static struct urb **alloc_urbs(struct snd_usb_caiaqdev *dev, int dir, int *ret) static struct urb **alloc_urbs(struct snd_usb_caiaqdev *dev, int dir, int *ret)
...@@ -829,6 +849,9 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *dev) ...@@ -829,6 +849,9 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *dev)
if (!dev->data_cb_info) if (!dev->data_cb_info)
return -ENOMEM; return -ENOMEM;
dev->outurb_active_mask = 0;
BUILD_BUG_ON(N_URBS > (sizeof(dev->outurb_active_mask) * 8));
for (i = 0; i < N_URBS; i++) { for (i = 0; i < N_URBS; i++) {
dev->data_cb_info[i].dev = dev; dev->data_cb_info[i].dev = dev;
dev->data_cb_info[i].index = i; dev->data_cb_info[i].index = i;
......
...@@ -96,6 +96,7 @@ struct snd_usb_caiaqdev { ...@@ -96,6 +96,7 @@ struct snd_usb_caiaqdev {
int input_panic, output_panic, warned; int input_panic, output_panic, warned;
char *audio_in_buf, *audio_out_buf; char *audio_in_buf, *audio_out_buf;
unsigned int samplerates, bpp; unsigned int samplerates, bpp;
unsigned long outurb_active_mask;
struct snd_pcm_substream *sub_playback[MAX_STREAMS]; struct snd_pcm_substream *sub_playback[MAX_STREAMS];
struct snd_pcm_substream *sub_capture[MAX_STREAMS]; struct snd_pcm_substream *sub_capture[MAX_STREAMS];
......
...@@ -152,6 +152,7 @@ static inline void check_mapped_dB(const struct usbmix_name_map *p, ...@@ -152,6 +152,7 @@ static inline void check_mapped_dB(const struct usbmix_name_map *p,
if (p && p->dB) { if (p && p->dB) {
cval->dBmin = p->dB->min; cval->dBmin = p->dB->min;
cval->dBmax = p->dB->max; cval->dBmax = p->dB->max;
cval->initialized = 1;
} }
} }
...@@ -1092,7 +1093,7 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc, ...@@ -1092,7 +1093,7 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc,
" Switch" : " Volume"); " Switch" : " Volume");
if (control == UAC_FU_VOLUME) { if (control == UAC_FU_VOLUME) {
check_mapped_dB(map, cval); check_mapped_dB(map, cval);
if (cval->dBmin < cval->dBmax) { if (cval->dBmin < cval->dBmax || !cval->initialized) {
kctl->tlv.c = mixer_vol_tlv; kctl->tlv.c = mixer_vol_tlv;
kctl->vd[0].access |= kctl->vd[0].access |=
SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_TLV_READ |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment