From cf4c775fb2dd2f7cb72b74ca68c1f699c7f0f53f Mon Sep 17 00:00:00 2001 From: Roel Kluin Date: Wed, 29 Jul 2009 11:46:59 +0200 Subject: [PATCH] --- yaml --- r: 156148 b: refs/heads/master c: c45ec06c74512265969aef40b00f320c6afb7a90 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/Documentation/sound/alsa/Procfile.txt | 5 --- trunk/sound/aoa/core/gpio-pmf.c | 4 --- trunk/sound/core/pcm_lib.c | 36 +------------------- trunk/sound/oss/aedsp16.c | 9 ++--- trunk/sound/pci/ctxfi/ctamixer.c | 14 ++++---- trunk/sound/pci/ctxfi/ctsrc.c | 7 ++-- trunk/sound/pci/hda/hda_eld.c | 4 +-- trunk/sound/pci/hda/patch_analog.c | 2 +- trunk/sound/pci/hda/patch_realtek.c | 37 +++++++++++---------- trunk/sound/pci/hda/patch_sigmatel.c | 4 +-- trunk/sound/soc/codecs/tlv320aic3x.c | 11 +----- trunk/sound/usb/Kconfig | 1 - trunk/sound/usb/caiaq/audio.c | 1 - trunk/sound/usb/caiaq/device.c | 8 +---- trunk/sound/usb/caiaq/device.h | 1 - trunk/sound/usb/usbmixer.c | 25 +++----------- 17 files changed, 49 insertions(+), 122 deletions(-) diff --git a/[refs] b/[refs] index 43dd63ff5a32..9f7e0261ae41 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d62e345f142ba271d9dab2b2e6cb5070cae94754 +refs/heads/master: c45ec06c74512265969aef40b00f320c6afb7a90 diff --git a/trunk/Documentation/sound/alsa/Procfile.txt b/trunk/Documentation/sound/alsa/Procfile.txt index 719a819f8cc2..381908d8ca42 100644 --- a/trunk/Documentation/sound/alsa/Procfile.txt +++ b/trunk/Documentation/sound/alsa/Procfile.txt @@ -101,8 +101,6 @@ card*/pcm*/xrun_debug bit 0 = Enable XRUN/jiffies debug messages bit 1 = Show stack trace at XRUN / jiffies check bit 2 = Enable additional jiffies check - bit 3 = Log hwptr update at each period interrupt - bit 4 = Log hwptr update at each snd_pcm_update_hw_ptr() When the bit 0 is set, the driver will show the messages to kernel log when an xrun is detected. The debug message is @@ -119,9 +117,6 @@ card*/pcm*/xrun_debug buggy) hardware that doesn't give smooth pointer updates. This feature is enabled via the bit 2. - Bits 3 and 4 are for logging the hwptr records. Note that - these will give flood of kernel messages. - card*/pcm*/sub*/info The general information of this PCM sub-stream. diff --git a/trunk/sound/aoa/core/gpio-pmf.c b/trunk/sound/aoa/core/gpio-pmf.c index 1dd0c28d1fb7..5ca2220eac7d 100644 --- a/trunk/sound/aoa/core/gpio-pmf.c +++ b/trunk/sound/aoa/core/gpio-pmf.c @@ -182,10 +182,6 @@ static int pmf_set_notify(struct gpio_runtime *rt, if (!old && notify) { irq_client = kzalloc(sizeof(struct pmf_irq_client), GFP_KERNEL); - if (!irq_client) { - err = -ENOMEM; - goto out_unlock; - } irq_client->data = notif; irq_client->handler = pmf_handle_notify_irq; irq_client->owner = THIS_MODULE; diff --git a/trunk/sound/core/pcm_lib.c b/trunk/sound/core/pcm_lib.c index 72cfd47af6b8..333e4dd29450 100644 --- a/trunk/sound/core/pcm_lib.c +++ b/trunk/sound/core/pcm_lib.c @@ -233,18 +233,6 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream) xrun(substream); return -EPIPE; } - if (xrun_debug(substream, 8)) { - char name[16]; - pcm_debug_name(substream, name, sizeof(name)); - snd_printd("period_update: %s: pos=0x%x/0x%x/0x%x, " - "hwptr=0x%lx, hw_base=0x%lx, hw_intr=0x%lx\n", - name, (unsigned int)pos, - (unsigned int)runtime->period_size, - (unsigned int)runtime->buffer_size, - (unsigned long)old_hw_ptr, - (unsigned long)runtime->hw_ptr_base, - (unsigned long)runtime->hw_ptr_interrupt); - } hw_base = runtime->hw_ptr_base; new_hw_ptr = hw_base + pos; hw_ptr_interrupt = runtime->hw_ptr_interrupt + runtime->period_size; @@ -256,27 +244,18 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream) delta = new_hw_ptr - hw_ptr_interrupt; } if (delta < 0) { - if (runtime->periods == 1 || new_hw_ptr < old_hw_ptr) - delta += runtime->buffer_size; + delta += runtime->buffer_size; if (delta < 0) { hw_ptr_error(substream, "Unexpected hw_pointer value " "(stream=%i, pos=%ld, intr_ptr=%ld)\n", substream->stream, (long)pos, (long)hw_ptr_interrupt); -#if 1 - /* simply skipping the hwptr update seems more - * robust in some cases, e.g. on VMware with - * inaccurate timer source - */ - return 0; /* skip this update */ -#else /* rebase to interrupt position */ hw_base = new_hw_ptr = hw_ptr_interrupt; /* align hw_base to buffer_size */ hw_base -= hw_base % runtime->buffer_size; delta = 0; -#endif } else { hw_base += runtime->buffer_size; if (hw_base >= runtime->boundary) @@ -365,19 +344,6 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream) xrun(substream); return -EPIPE; } - if (xrun_debug(substream, 16)) { - char name[16]; - pcm_debug_name(substream, name, sizeof(name)); - snd_printd("hw_update: %s: pos=0x%x/0x%x/0x%x, " - "hwptr=0x%lx, hw_base=0x%lx, hw_intr=0x%lx\n", - name, (unsigned int)pos, - (unsigned int)runtime->period_size, - (unsigned int)runtime->buffer_size, - (unsigned long)old_hw_ptr, - (unsigned long)runtime->hw_ptr_base, - (unsigned long)runtime->hw_ptr_interrupt); - } - hw_base = runtime->hw_ptr_base; new_hw_ptr = hw_base + pos; diff --git a/trunk/sound/oss/aedsp16.c b/trunk/sound/oss/aedsp16.c index 3ee9900ffd7b..35b5912cf3f8 100644 --- a/trunk/sound/oss/aedsp16.c +++ b/trunk/sound/oss/aedsp16.c @@ -325,8 +325,9 @@ /* * Size of character arrays that store name and version of sound card */ -#define CARDNAMELEN 15 /* Size of the card's name in chars */ -#define CARDVERLEN 2 /* Size of the card's version in chars */ +#define CARDNAMELEN 15 /* Size of the card's name in chars */ +#define CARDVERLEN 10 /* Size of the card's version in chars */ +#define CARDVERDIGITS 2 /* Number of digits in the version */ #if defined(CONFIG_SC6600) /* @@ -410,7 +411,7 @@ static int soft_cfg __initdata = 0; /* bitmapped config */ static int soft_cfg_mss __initdata = 0; /* bitmapped mss config */ -static int ver[CARDVERLEN] __initdata = {0, 0}; /* DSP Ver: +static int ver[CARDVERDIGITS] __initdata = {0, 0}; /* DSP Ver: hi->ver[0] lo->ver[1] */ #if defined(CONFIG_SC6600) @@ -957,7 +958,7 @@ static int __init aedsp16_dsp_version(int port) * string is finished. */ ver[len++] = ret; - } while (len < CARDVERLEN); + } while (len < CARDVERDIGITS); sprintf(DSPVersion, "%d.%d", ver[0], ver[1]); DBG(("success.\n")); diff --git a/trunk/sound/pci/ctxfi/ctamixer.c b/trunk/sound/pci/ctxfi/ctamixer.c index a7f4a671f7b7..a1db51b3ead8 100644 --- a/trunk/sound/pci/ctxfi/ctamixer.c +++ b/trunk/sound/pci/ctxfi/ctamixer.c @@ -242,12 +242,13 @@ static int get_amixer_rsc(struct amixer_mgr *mgr, /* Allocate mem for amixer resource */ amixer = kzalloc(sizeof(*amixer), GFP_KERNEL); - if (!amixer) - return -ENOMEM; + if (NULL == amixer) { + err = -ENOMEM; + return err; + } /* Check whether there are sufficient * amixer resources to meet request. */ - err = 0; spin_lock_irqsave(&mgr->mgr_lock, flags); for (i = 0; i < desc->msr; i++) { err = mgr_get_resource(&mgr->mgr, 1, &idx); @@ -396,11 +397,12 @@ static int get_sum_rsc(struct sum_mgr *mgr, /* Allocate mem for sum resource */ sum = kzalloc(sizeof(*sum), GFP_KERNEL); - if (!sum) - return -ENOMEM; + if (NULL == sum) { + err = -ENOMEM; + return err; + } /* Check whether there are sufficient sum resources to meet request. */ - err = 0; spin_lock_irqsave(&mgr->mgr_lock, flags); for (i = 0; i < desc->msr; i++) { err = mgr_get_resource(&mgr->mgr, 1, &idx); diff --git a/trunk/sound/pci/ctxfi/ctsrc.c b/trunk/sound/pci/ctxfi/ctsrc.c index df43a5cd3938..e1c145d8b702 100644 --- a/trunk/sound/pci/ctxfi/ctsrc.c +++ b/trunk/sound/pci/ctxfi/ctsrc.c @@ -724,11 +724,12 @@ static int get_srcimp_rsc(struct srcimp_mgr *mgr, /* Allocate mem for SRCIMP resource */ srcimp = kzalloc(sizeof(*srcimp), GFP_KERNEL); - if (!srcimp) - return -ENOMEM; + if (NULL == srcimp) { + err = -ENOMEM; + return err; + } /* Check whether there are sufficient SRCIMP resources. */ - err = 0; spin_lock_irqsave(&mgr->mgr_lock, flags); for (i = 0; i < desc->msr; i++) { err = mgr_get_resource(&mgr->mgr, 1, &idx); diff --git a/trunk/sound/pci/hda/hda_eld.c b/trunk/sound/pci/hda/hda_eld.c index 9446a5abea13..fcad5ec31773 100644 --- a/trunk/sound/pci/hda/hda_eld.c +++ b/trunk/sound/pci/hda/hda_eld.c @@ -508,7 +508,7 @@ static void hdmi_write_eld_info(struct snd_info_entry *entry, char name[64]; char *sname; long long val; - unsigned int n; + int n; while (!snd_info_get_line(buffer, line, sizeof(line))) { if (sscanf(line, "%s %llx", name, &val) != 2) @@ -539,7 +539,7 @@ static void hdmi_write_eld_info(struct snd_info_entry *entry, sname++; n = 10 * n + name[4] - '0'; } - if (n >= ELD_MAX_SAD) + if (n < 0 || n > 31) /* double the CEA limit */ continue; if (!strcmp(sname, "_coding_type")) e->sad[n].format = val; diff --git a/trunk/sound/pci/hda/patch_analog.c b/trunk/sound/pci/hda/patch_analog.c index 3da85caf8af1..be7d25fa7f35 100644 --- a/trunk/sound/pci/hda/patch_analog.c +++ b/trunk/sound/pci/hda/patch_analog.c @@ -3754,7 +3754,7 @@ static int ad1884a_mobile_master_sw_put(struct snd_kcontrol *kcontrol, int mute = (!ucontrol->value.integer.value[0] && !ucontrol->value.integer.value[1]); /* toggle GPIO1 according to the mute state */ - snd_hda_codec_write_cache(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, + snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, mute ? 0x02 : 0x0); return ret; } diff --git a/trunk/sound/pci/hda/patch_realtek.c b/trunk/sound/pci/hda/patch_realtek.c index b95df5d5dcc2..7e99763ca527 100644 --- a/trunk/sound/pci/hda/patch_realtek.c +++ b/trunk/sound/pci/hda/patch_realtek.c @@ -275,13 +275,13 @@ struct alc_spec { */ unsigned int num_init_verbs; - char stream_name_analog[32]; /* analog PCM stream */ + char stream_name_analog[16]; /* analog PCM stream */ struct hda_pcm_stream *stream_analog_playback; struct hda_pcm_stream *stream_analog_capture; struct hda_pcm_stream *stream_analog_alt_playback; struct hda_pcm_stream *stream_analog_alt_capture; - char stream_name_digital[32]; /* digital PCM stream */ + char stream_name_digital[16]; /* digital PCM stream */ struct hda_pcm_stream *stream_digital_playback; struct hda_pcm_stream *stream_digital_capture; @@ -10631,18 +10631,6 @@ static void alc262_lenovo_3000_unsol_event(struct hda_codec *codec, alc262_lenovo_3000_automute(codec, 1); } -static int amp_stereo_mute_update(struct hda_codec *codec, hda_nid_t nid, - int dir, int idx, long *valp) -{ - int i, change = 0; - - for (i = 0; i < 2; i++, valp++) - change |= snd_hda_codec_amp_update(codec, nid, i, dir, idx, - HDA_AMP_MUTE, - *valp ? 0 : HDA_AMP_MUTE); - return change; -} - /* bind hp and internal speaker mute (with plug check) */ static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) @@ -10651,8 +10639,13 @@ static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol, long *valp = ucontrol->value.integer.value; int change; - change = amp_stereo_mute_update(codec, 0x14, HDA_OUTPUT, 0, valp); - change |= amp_stereo_mute_update(codec, 0x1b, HDA_OUTPUT, 0, valp); + change = snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0, + HDA_AMP_MUTE, + valp ? 0 : HDA_AMP_MUTE); + change |= snd_hda_codec_amp_stereo(codec, 0x1b, HDA_OUTPUT, 0, + HDA_AMP_MUTE, + valp ? 0 : HDA_AMP_MUTE); + if (change) alc262_fujitsu_automute(codec, 0); return change; @@ -10687,7 +10680,10 @@ static int alc262_lenovo_3000_master_sw_put(struct snd_kcontrol *kcontrol, long *valp = ucontrol->value.integer.value; int change; - change = amp_stereo_mute_update(codec, 0x1b, HDA_OUTPUT, 0, valp); + change = snd_hda_codec_amp_stereo(codec, 0x1b, HDA_OUTPUT, 0, + HDA_AMP_MUTE, + valp ? 0 : HDA_AMP_MUTE); + if (change) alc262_lenovo_3000_automute(codec, 0); return change; @@ -11858,7 +11854,12 @@ static int alc268_acer_master_sw_put(struct snd_kcontrol *kcontrol, long *valp = ucontrol->value.integer.value; int change; - change = amp_stereo_mute_update(codec, 0x14, HDA_OUTPUT, 0, valp); + change = snd_hda_codec_amp_update(codec, 0x14, 0, HDA_OUTPUT, 0, + HDA_AMP_MUTE, + valp[0] ? 0 : HDA_AMP_MUTE); + change |= snd_hda_codec_amp_update(codec, 0x14, 1, HDA_OUTPUT, 0, + HDA_AMP_MUTE, + valp[1] ? 0 : HDA_AMP_MUTE); if (change) alc268_acer_automute(codec, 0); return change; diff --git a/trunk/sound/pci/hda/patch_sigmatel.c b/trunk/sound/pci/hda/patch_sigmatel.c index 5383d8cff88b..da7f9f65c047 100644 --- a/trunk/sound/pci/hda/patch_sigmatel.c +++ b/trunk/sound/pci/hda/patch_sigmatel.c @@ -1809,8 +1809,6 @@ static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = { "Dell Studio 1537", STAC_DELL_M6_DMIC), SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02a0, "Dell Studio 17", STAC_DELL_M6_DMIC), - SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02be, - "Dell Studio 1555", STAC_DELL_M6_DMIC), {} /* terminator */ }; @@ -4068,7 +4066,7 @@ static int stac92xx_add_jack(struct hda_codec *codec, jack->nid = nid; jack->type = type; - snprintf(name, sizeof(name), "%s at %s %s Jack", + sprintf(name, "%s at %s %s Jack", snd_hda_get_jack_type(def_conf), snd_hda_get_jack_connectivity(def_conf), snd_hda_get_jack_location(def_conf)); diff --git a/trunk/sound/soc/codecs/tlv320aic3x.c b/trunk/sound/soc/codecs/tlv320aic3x.c index cb0d1bf34b57..ab099f482487 100644 --- a/trunk/sound/soc/codecs/tlv320aic3x.c +++ b/trunk/sound/soc/codecs/tlv320aic3x.c @@ -767,7 +767,6 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream, int codec_clk = 0, bypass_pll = 0, fsref, last_clk = 0; u8 data, r, p, pll_q, pll_p = 1, pll_r = 1, pll_j = 1; u16 pll_d = 1; - u8 reg; /* select data word length */ data = @@ -802,16 +801,8 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream, pll_q &= 0xf; aic3x_write(codec, AIC3X_PLL_PROGA_REG, pll_q << PLLQ_SHIFT); aic3x_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_CLKDIV); - /* disable PLL if it is bypassed */ - reg = aic3x_read_reg_cache(codec, AIC3X_PLL_PROGA_REG); - aic3x_write(codec, AIC3X_PLL_PROGA_REG, reg & ~PLL_ENABLE); - - } else { + } else aic3x_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_PLLDIV); - /* enable PLL when it is used */ - reg = aic3x_read_reg_cache(codec, AIC3X_PLL_PROGA_REG); - aic3x_write(codec, AIC3X_PLL_PROGA_REG, reg | PLL_ENABLE); - } /* Route Left DAC to left channel input and * right DAC to right channel input */ diff --git a/trunk/sound/usb/Kconfig b/trunk/sound/usb/Kconfig index 73525c048e7f..523aec188ccf 100644 --- a/trunk/sound/usb/Kconfig +++ b/trunk/sound/usb/Kconfig @@ -48,7 +48,6 @@ config SND_USB_CAIAQ * Native Instruments Kore Controller * Native Instruments Kore Controller 2 * Native Instruments Audio Kontrol 1 - * Native Instruments Audio 2 DJ * Native Instruments Audio 4 DJ * Native Instruments Audio 8 DJ * Native Instruments Guitar Rig Session I/O diff --git a/trunk/sound/usb/caiaq/audio.c b/trunk/sound/usb/caiaq/audio.c index 121af0644fd9..8f9b60c5d74c 100644 --- a/trunk/sound/usb/caiaq/audio.c +++ b/trunk/sound/usb/caiaq/audio.c @@ -646,7 +646,6 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *dev) case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_GUITARRIGMOBILE): dev->samplerates |= SNDRV_PCM_RATE_192000; /* fall thru */ - case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO2DJ): case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ): case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ): dev->samplerates |= SNDRV_PCM_RATE_88200; diff --git a/trunk/sound/usb/caiaq/device.c b/trunk/sound/usb/caiaq/device.c index 83e6c1312d47..de38108f0b28 100644 --- a/trunk/sound/usb/caiaq/device.c +++ b/trunk/sound/usb/caiaq/device.c @@ -35,14 +35,13 @@ #include "input.h" MODULE_AUTHOR("Daniel Mack "); -MODULE_DESCRIPTION("caiaq USB audio, version 1.3.19"); +MODULE_DESCRIPTION("caiaq USB audio, version 1.3.18"); MODULE_LICENSE("GPL"); MODULE_SUPPORTED_DEVICE("{{Native Instruments, RigKontrol2}," "{Native Instruments, RigKontrol3}," "{Native Instruments, Kore Controller}," "{Native Instruments, Kore Controller 2}," "{Native Instruments, Audio Kontrol 1}," - "{Native Instruments, Audio 2 DJ}," "{Native Instruments, Audio 4 DJ}," "{Native Instruments, Audio 8 DJ}," "{Native Instruments, Session I/O}," @@ -122,11 +121,6 @@ static struct usb_device_id snd_usb_id_table[] = { .idVendor = USB_VID_NATIVEINSTRUMENTS, .idProduct = USB_PID_AUDIO4DJ }, - { - .match_flags = USB_DEVICE_ID_MATCH_DEVICE, - .idVendor = USB_VID_NATIVEINSTRUMENTS, - .idProduct = USB_PID_AUDIO2DJ - }, { /* terminator */ } }; diff --git a/trunk/sound/usb/caiaq/device.h b/trunk/sound/usb/caiaq/device.h index 44e3edf88bef..ece73514854e 100644 --- a/trunk/sound/usb/caiaq/device.h +++ b/trunk/sound/usb/caiaq/device.h @@ -10,7 +10,6 @@ #define USB_PID_KORECONTROLLER 0x4711 #define USB_PID_KORECONTROLLER2 0x4712 #define USB_PID_AK1 0x0815 -#define USB_PID_AUDIO2DJ 0x041c #define USB_PID_AUDIO4DJ 0x0839 #define USB_PID_AUDIO8DJ 0x1978 #define USB_PID_SESSIONIO 0x1915 diff --git a/trunk/sound/usb/usbmixer.c b/trunk/sound/usb/usbmixer.c index ec9cdf986928..4bd3a7a0edc1 100644 --- a/trunk/sound/usb/usbmixer.c +++ b/trunk/sound/usb/usbmixer.c @@ -990,35 +990,20 @@ static void build_feature_ctl(struct mixer_build *state, unsigned char *desc, break; } - /* volume control quirks */ + /* quirk for UDA1321/N101 */ + /* note that detection between firmware 2.1.1.7 (N101) and later 2.1.1.21 */ + /* is not very clear from datasheets */ + /* I hope that the min value is -15360 for newer firmware --jk */ switch (state->chip->usb_id) { case USB_ID(0x0471, 0x0101): case USB_ID(0x0471, 0x0104): case USB_ID(0x0471, 0x0105): case USB_ID(0x0672, 0x1041): - /* quirk for UDA1321/N101. - * note that detection between firmware 2.1.1.7 (N101) - * and later 2.1.1.21 is not very clear from datasheets. - * I hope that the min value is -15360 for newer firmware --jk - */ if (!strcmp(kctl->id.name, "PCM Playback Volume") && cval->min == -15616) { - snd_printk(KERN_INFO - "set volume quirk for UDA1321/N101 chip\n"); + snd_printk(KERN_INFO "using volume control quirk for the UDA1321/N101 chip\n"); cval->max = -256; } - break; - - case USB_ID(0x046d, 0x09a4): - if (!strcmp(kctl->id.name, "Mic Capture Volume")) { - snd_printk(KERN_INFO - "set volume quirk for QuickCam E3500\n"); - cval->min = 6080; - cval->max = 8768; - cval->res = 192; - } - break; - } snd_printdd(KERN_INFO "[%d] FU [%s] ch = %d, val = %d/%d/%d\n",