diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/core/pcm_lib.c | 39 | ||||
-rw-r--r-- | sound/pci/ali5451/ali5451.c | 18 | ||||
-rw-r--r-- | sound/pci/hda/patch_analog.c | 6 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 15 | ||||
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 6 | ||||
-rw-r--r-- | sound/pci/vx222/vx222_ops.c | 4 |
6 files changed, 45 insertions, 43 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 72cfd47af6b8..9db60d831bb2 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c | |||
@@ -943,47 +943,24 @@ static int snd_interval_ratden(struct snd_interval *i, | |||
943 | int snd_interval_list(struct snd_interval *i, unsigned int count, unsigned int *list, unsigned int mask) | 943 | int snd_interval_list(struct snd_interval *i, unsigned int count, unsigned int *list, unsigned int mask) |
944 | { | 944 | { |
945 | unsigned int k; | 945 | unsigned int k; |
946 | int changed = 0; | 946 | struct snd_interval list_range; |
947 | 947 | ||
948 | if (!count) { | 948 | if (!count) { |
949 | i->empty = 1; | 949 | i->empty = 1; |
950 | return -EINVAL; | 950 | return -EINVAL; |
951 | } | 951 | } |
952 | snd_interval_any(&list_range); | ||
953 | list_range.min = UINT_MAX; | ||
954 | list_range.max = 0; | ||
952 | for (k = 0; k < count; k++) { | 955 | for (k = 0; k < count; k++) { |
953 | if (mask && !(mask & (1 << k))) | 956 | if (mask && !(mask & (1 << k))) |
954 | continue; | 957 | continue; |
955 | if (i->min == list[k] && !i->openmin) | 958 | if (!snd_interval_test(i, list[k])) |
956 | goto _l1; | ||
957 | if (i->min < list[k]) { | ||
958 | i->min = list[k]; | ||
959 | i->openmin = 0; | ||
960 | changed = 1; | ||
961 | goto _l1; | ||
962 | } | ||
963 | } | ||
964 | i->empty = 1; | ||
965 | return -EINVAL; | ||
966 | _l1: | ||
967 | for (k = count; k-- > 0;) { | ||
968 | if (mask && !(mask & (1 << k))) | ||
969 | continue; | 959 | continue; |
970 | if (i->max == list[k] && !i->openmax) | 960 | list_range.min = min(list_range.min, list[k]); |
971 | goto _l2; | 961 | list_range.max = max(list_range.max, list[k]); |
972 | if (i->max > list[k]) { | ||
973 | i->max = list[k]; | ||
974 | i->openmax = 0; | ||
975 | changed = 1; | ||
976 | goto _l2; | ||
977 | } | ||
978 | } | 962 | } |
979 | i->empty = 1; | 963 | return snd_interval_refine(i, &list_range); |
980 | return -EINVAL; | ||
981 | _l2: | ||
982 | if (snd_interval_checkempty(i)) { | ||
983 | i->empty = 1; | ||
984 | return -EINVAL; | ||
985 | } | ||
986 | return changed; | ||
987 | } | 964 | } |
988 | 965 | ||
989 | EXPORT_SYMBOL(snd_interval_list); | 966 | EXPORT_SYMBOL(snd_interval_list); |
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c index c551006e2920..76d76c08339b 100644 --- a/sound/pci/ali5451/ali5451.c +++ b/sound/pci/ali5451/ali5451.c | |||
@@ -310,12 +310,16 @@ static int snd_ali_codec_ready(struct snd_ali *codec, | |||
310 | unsigned int res; | 310 | unsigned int res; |
311 | 311 | ||
312 | end_time = jiffies + msecs_to_jiffies(250); | 312 | end_time = jiffies + msecs_to_jiffies(250); |
313 | do { | 313 | |
314 | for (;;) { | ||
314 | res = snd_ali_5451_peek(codec,port); | 315 | res = snd_ali_5451_peek(codec,port); |
315 | if (!(res & 0x8000)) | 316 | if (!(res & 0x8000)) |
316 | return 0; | 317 | return 0; |
318 | if (!time_after_eq(end_time, jiffies)) | ||
319 | break; | ||
317 | schedule_timeout_uninterruptible(1); | 320 | schedule_timeout_uninterruptible(1); |
318 | } while (time_after_eq(end_time, jiffies)); | 321 | } |
322 | |||
319 | snd_ali_5451_poke(codec, port, res & ~0x8000); | 323 | snd_ali_5451_poke(codec, port, res & ~0x8000); |
320 | snd_printdd("ali_codec_ready: codec is not ready.\n "); | 324 | snd_printdd("ali_codec_ready: codec is not ready.\n "); |
321 | return -EIO; | 325 | return -EIO; |
@@ -327,15 +331,17 @@ static int snd_ali_stimer_ready(struct snd_ali *codec) | |||
327 | unsigned long dwChk1,dwChk2; | 331 | unsigned long dwChk1,dwChk2; |
328 | 332 | ||
329 | dwChk1 = snd_ali_5451_peek(codec, ALI_STIMER); | 333 | dwChk1 = snd_ali_5451_peek(codec, ALI_STIMER); |
330 | dwChk2 = snd_ali_5451_peek(codec, ALI_STIMER); | ||
331 | |||
332 | end_time = jiffies + msecs_to_jiffies(250); | 334 | end_time = jiffies + msecs_to_jiffies(250); |
333 | do { | 335 | |
336 | for (;;) { | ||
334 | dwChk2 = snd_ali_5451_peek(codec, ALI_STIMER); | 337 | dwChk2 = snd_ali_5451_peek(codec, ALI_STIMER); |
335 | if (dwChk2 != dwChk1) | 338 | if (dwChk2 != dwChk1) |
336 | return 0; | 339 | return 0; |
340 | if (!time_after_eq(end_time, jiffies)) | ||
341 | break; | ||
337 | schedule_timeout_uninterruptible(1); | 342 | schedule_timeout_uninterruptible(1); |
338 | } while (time_after_eq(end_time, jiffies)); | 343 | } |
344 | |||
339 | snd_printk(KERN_ERR "ali_stimer_read: stimer is not ready.\n"); | 345 | snd_printk(KERN_ERR "ali_stimer_read: stimer is not ready.\n"); |
340 | return -EIO; | 346 | return -EIO; |
341 | } | 347 | } |
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 3da85caf8af1..403588c6e3f6 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -3835,9 +3835,11 @@ static struct hda_verb ad1884a_laptop_verbs[] = { | |||
3835 | /* Port-F (int speaker) mixer - route only from analog mixer */ | 3835 | /* Port-F (int speaker) mixer - route only from analog mixer */ |
3836 | {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | 3836 | {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, |
3837 | {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, | 3837 | {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, |
3838 | /* Port-F pin */ | 3838 | /* Port-F (int speaker) pin */ |
3839 | {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, | 3839 | {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, |
3840 | {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | 3840 | {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, |
3841 | /* required for compaq 6530s/6531s speaker output */ | ||
3842 | {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | ||
3841 | /* Port-C pin - internal mic-in */ | 3843 | /* Port-C pin - internal mic-in */ |
3842 | {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, | 3844 | {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, |
3843 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, 0x7002}, /* raise mic as default */ | 3845 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, 0x7002}, /* raise mic as default */ |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index fea976793ae5..6f683e451f2b 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -12521,8 +12521,6 @@ static struct snd_pci_quirk alc268_cfg_tbl[] = { | |||
12521 | ALC268_TOSHIBA), | 12521 | ALC268_TOSHIBA), |
12522 | SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST), | 12522 | SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST), |
12523 | SND_PCI_QUIRK(0x1170, 0x0040, "ZEPTO", ALC268_ZEPTO), | 12523 | SND_PCI_QUIRK(0x1170, 0x0040, "ZEPTO", ALC268_ZEPTO), |
12524 | SND_PCI_QUIRK_MASK(0x1179, 0xff00, 0xff00, "TOSHIBA A/Lx05", | ||
12525 | ALC268_TOSHIBA), | ||
12526 | SND_PCI_QUIRK(0x14c0, 0x0025, "COMPAL IFL90/JFL-92", ALC268_TOSHIBA), | 12524 | SND_PCI_QUIRK(0x14c0, 0x0025, "COMPAL IFL90/JFL-92", ALC268_TOSHIBA), |
12527 | SND_PCI_QUIRK(0x152d, 0x0763, "Diverse (CPR2000)", ALC268_ACER), | 12525 | SND_PCI_QUIRK(0x152d, 0x0763, "Diverse (CPR2000)", ALC268_ACER), |
12528 | SND_PCI_QUIRK(0x152d, 0x0771, "Quanta IL1", ALC267_QUANTA_IL1), | 12526 | SND_PCI_QUIRK(0x152d, 0x0771, "Quanta IL1", ALC267_QUANTA_IL1), |
@@ -12530,6 +12528,15 @@ static struct snd_pci_quirk alc268_cfg_tbl[] = { | |||
12530 | {} | 12528 | {} |
12531 | }; | 12529 | }; |
12532 | 12530 | ||
12531 | /* Toshiba laptops have no unique PCI SSID but only codec SSID */ | ||
12532 | static struct snd_pci_quirk alc268_ssid_cfg_tbl[] = { | ||
12533 | SND_PCI_QUIRK(0x1179, 0xff0a, "TOSHIBA X-200", ALC268_AUTO), | ||
12534 | SND_PCI_QUIRK(0x1179, 0xff0e, "TOSHIBA X-200 HDMI", ALC268_AUTO), | ||
12535 | SND_PCI_QUIRK_MASK(0x1179, 0xff00, 0xff00, "TOSHIBA A/Lx05", | ||
12536 | ALC268_TOSHIBA), | ||
12537 | {} | ||
12538 | }; | ||
12539 | |||
12533 | static struct alc_config_preset alc268_presets[] = { | 12540 | static struct alc_config_preset alc268_presets[] = { |
12534 | [ALC267_QUANTA_IL1] = { | 12541 | [ALC267_QUANTA_IL1] = { |
12535 | .mixers = { alc267_quanta_il1_mixer, alc268_beep_mixer }, | 12542 | .mixers = { alc267_quanta_il1_mixer, alc268_beep_mixer }, |
@@ -12696,6 +12703,10 @@ static int patch_alc268(struct hda_codec *codec) | |||
12696 | alc268_models, | 12703 | alc268_models, |
12697 | alc268_cfg_tbl); | 12704 | alc268_cfg_tbl); |
12698 | 12705 | ||
12706 | if (board_config < 0 || board_config >= ALC268_MODEL_LAST) | ||
12707 | board_config = snd_hda_check_board_codec_sid_config(codec, | ||
12708 | ALC882_MODEL_LAST, alc268_models, alc268_ssid_cfg_tbl); | ||
12709 | |||
12699 | if (board_config < 0 || board_config >= ALC268_MODEL_LAST) { | 12710 | if (board_config < 0 || board_config >= ALC268_MODEL_LAST) { |
12700 | printk(KERN_INFO "hda_codec: Unknown model for %s, " | 12711 | printk(KERN_INFO "hda_codec: Unknown model for %s, " |
12701 | "trying auto-probe from BIOS...\n", codec->chip_name); | 12712 | "trying auto-probe from BIOS...\n", codec->chip_name); |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 456ef6ac12e4..6990cfcb6a38 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -76,6 +76,7 @@ enum { | |||
76 | STAC_92HD73XX_AUTO, | 76 | STAC_92HD73XX_AUTO, |
77 | STAC_92HD73XX_NO_JD, /* no jack-detection */ | 77 | STAC_92HD73XX_NO_JD, /* no jack-detection */ |
78 | STAC_92HD73XX_REF, | 78 | STAC_92HD73XX_REF, |
79 | STAC_92HD73XX_INTEL, | ||
79 | STAC_DELL_M6_AMIC, | 80 | STAC_DELL_M6_AMIC, |
80 | STAC_DELL_M6_DMIC, | 81 | STAC_DELL_M6_DMIC, |
81 | STAC_DELL_M6_BOTH, | 82 | STAC_DELL_M6_BOTH, |
@@ -1777,6 +1778,7 @@ static const char *stac92hd73xx_models[STAC_92HD73XX_MODELS] = { | |||
1777 | [STAC_92HD73XX_AUTO] = "auto", | 1778 | [STAC_92HD73XX_AUTO] = "auto", |
1778 | [STAC_92HD73XX_NO_JD] = "no-jd", | 1779 | [STAC_92HD73XX_NO_JD] = "no-jd", |
1779 | [STAC_92HD73XX_REF] = "ref", | 1780 | [STAC_92HD73XX_REF] = "ref", |
1781 | [STAC_92HD73XX_INTEL] = "intel", | ||
1780 | [STAC_DELL_M6_AMIC] = "dell-m6-amic", | 1782 | [STAC_DELL_M6_AMIC] = "dell-m6-amic", |
1781 | [STAC_DELL_M6_DMIC] = "dell-m6-dmic", | 1783 | [STAC_DELL_M6_DMIC] = "dell-m6-dmic", |
1782 | [STAC_DELL_M6_BOTH] = "dell-m6", | 1784 | [STAC_DELL_M6_BOTH] = "dell-m6", |
@@ -1789,6 +1791,10 @@ static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = { | |||
1789 | "DFI LanParty", STAC_92HD73XX_REF), | 1791 | "DFI LanParty", STAC_92HD73XX_REF), |
1790 | SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, | 1792 | SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, |
1791 | "DFI LanParty", STAC_92HD73XX_REF), | 1793 | "DFI LanParty", STAC_92HD73XX_REF), |
1794 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5002, | ||
1795 | "Intel DG45ID", STAC_92HD73XX_INTEL), | ||
1796 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5003, | ||
1797 | "Intel DG45FC", STAC_92HD73XX_INTEL), | ||
1792 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0254, | 1798 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0254, |
1793 | "Dell Studio 1535", STAC_DELL_M6_DMIC), | 1799 | "Dell Studio 1535", STAC_DELL_M6_DMIC), |
1794 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0255, | 1800 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0255, |
diff --git a/sound/pci/vx222/vx222_ops.c b/sound/pci/vx222/vx222_ops.c index 6416d3f0c7be..a69e774d0b13 100644 --- a/sound/pci/vx222/vx222_ops.c +++ b/sound/pci/vx222/vx222_ops.c | |||
@@ -885,10 +885,10 @@ static int vx_input_level_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem | |||
885 | struct vx_core *_chip = snd_kcontrol_chip(kcontrol); | 885 | struct vx_core *_chip = snd_kcontrol_chip(kcontrol); |
886 | struct snd_vx222 *chip = (struct snd_vx222 *)_chip; | 886 | struct snd_vx222 *chip = (struct snd_vx222 *)_chip; |
887 | if (ucontrol->value.integer.value[0] < 0 || | 887 | if (ucontrol->value.integer.value[0] < 0 || |
888 | ucontrol->value.integer.value[0] < MIC_LEVEL_MAX) | 888 | ucontrol->value.integer.value[0] > MIC_LEVEL_MAX) |
889 | return -EINVAL; | 889 | return -EINVAL; |
890 | if (ucontrol->value.integer.value[1] < 0 || | 890 | if (ucontrol->value.integer.value[1] < 0 || |
891 | ucontrol->value.integer.value[1] < MIC_LEVEL_MAX) | 891 | ucontrol->value.integer.value[1] > MIC_LEVEL_MAX) |
892 | return -EINVAL; | 892 | return -EINVAL; |
893 | mutex_lock(&_chip->mixer_mutex); | 893 | mutex_lock(&_chip->mixer_mutex); |
894 | if (chip->input_level[0] != ucontrol->value.integer.value[0] || | 894 | if (chip->input_level[0] != ucontrol->value.integer.value[0] || |