Loading sound/core/pcm_lib.c +7 −3 Original line number Diff line number Diff line Loading @@ -1070,8 +1070,10 @@ int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, unsigned int cond, struct snd_pcm_hw_rule *new; unsigned int new_rules = constrs->rules_all + 16; new = kcalloc(new_rules, sizeof(*c), GFP_KERNEL); if (!new) if (!new) { va_end(args); return -ENOMEM; } if (constrs->rules) { memcpy(new, constrs->rules, constrs->rules_num * sizeof(*c)); Loading @@ -1087,8 +1089,10 @@ int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, unsigned int cond, c->private = private; k = 0; while (1) { if (snd_BUG_ON(k >= ARRAY_SIZE(c->deps))) if (snd_BUG_ON(k >= ARRAY_SIZE(c->deps))) { va_end(args); return -EINVAL; } c->deps[k++] = dep; if (dep < 0) break; Loading sound/oss/soundcard.c +2 −2 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ int *load_mixer_volumes(char *name, int *levels, int present) int i, n; for (i = 0; i < num_mixer_volumes; i++) { if (strcmp(name, mixer_vols[i].name) == 0) { if (strncmp(name, mixer_vols[i].name, 32) == 0) { if (present) mixer_vols[i].num = i; return mixer_vols[i].levels; Loading @@ -99,7 +99,7 @@ int *load_mixer_volumes(char *name, int *levels, int present) } n = num_mixer_volumes++; strcpy(mixer_vols[n].name, name); strncpy(mixer_vols[n].name, name, 32); if (present) mixer_vols[n].num = n; Loading sound/pci/hda/hda_codec.c +34 −23 Original line number Diff line number Diff line Loading @@ -1919,6 +1919,16 @@ struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec, } EXPORT_SYMBOL_HDA(snd_hda_find_mixer_ctl); static int find_empty_mixer_ctl_idx(struct hda_codec *codec, const char *name) { int idx; for (idx = 0; idx < 16; idx++) { /* 16 ctlrs should be large enough */ if (!_snd_hda_find_mixer_ctl(codec, name, idx)) return idx; } return -EBUSY; } /** * snd_hda_ctl_add - Add a control element and assign to the codec * @codec: HD-audio codec Loading Loading @@ -2654,8 +2664,6 @@ static struct snd_kcontrol_new dig_mixes[] = { { } /* end */ }; #define SPDIF_MAX_IDX 4 /* 4 instances should be enough to probe */ /** * snd_hda_create_spdif_out_ctls - create Output SPDIF-related controls * @codec: the HDA codec Loading @@ -2673,12 +2681,8 @@ int snd_hda_create_spdif_out_ctls(struct hda_codec *codec, hda_nid_t nid) struct snd_kcontrol_new *dig_mix; int idx; for (idx = 0; idx < SPDIF_MAX_IDX; idx++) { if (!_snd_hda_find_mixer_ctl(codec, "IEC958 Playback Switch", idx)) break; } if (idx >= SPDIF_MAX_IDX) { idx = find_empty_mixer_ctl_idx(codec, "IEC958 Playback Switch"); if (idx < 0) { printk(KERN_ERR "hda_codec: too many IEC958 outputs\n"); return -EBUSY; } Loading Loading @@ -2829,12 +2833,8 @@ int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid) struct snd_kcontrol_new *dig_mix; int idx; for (idx = 0; idx < SPDIF_MAX_IDX; idx++) { if (!_snd_hda_find_mixer_ctl(codec, "IEC958 Capture Switch", idx)) break; } if (idx >= SPDIF_MAX_IDX) { idx = find_empty_mixer_ctl_idx(codec, "IEC958 Capture Switch"); if (idx < 0) { printk(KERN_ERR "hda_codec: too many IEC958 inputs\n"); return -EBUSY; } Loading Loading @@ -3808,21 +3808,32 @@ int snd_hda_add_new_ctls(struct hda_codec *codec, struct snd_kcontrol_new *knew) for (; knew->name; knew++) { struct snd_kcontrol *kctl; int addr = 0, idx = 0; if (knew->iface == -1) /* skip this codec private value */ continue; for (;;) { kctl = snd_ctl_new1(knew, codec); if (!kctl) return -ENOMEM; if (addr > 0) kctl->id.device = addr; if (idx > 0) kctl->id.index = idx; err = snd_hda_ctl_add(codec, 0, kctl); if (err < 0) { if (!codec->addr) if (!err) break; /* try first with another device index corresponding to * the codec addr; if it still fails (or it's the * primary codec), then try another control index */ if (!addr && codec->addr) addr = codec->addr; else if (!idx && !knew->index) { idx = find_empty_mixer_ctl_idx(codec, knew->name); if (idx <= 0) return err; kctl = snd_ctl_new1(knew, codec); if (!kctl) return -ENOMEM; kctl->id.device = codec->addr; err = snd_hda_ctl_add(codec, 0, kctl); if (err < 0) } else return err; } } Loading sound/pci/hda/hda_intel.c +1 −0 Original line number Diff line number Diff line Loading @@ -2300,6 +2300,7 @@ static struct snd_pci_quirk position_fix_list[] __devinitdata = { SND_PCI_QUIRK(0x1028, 0x01cc, "Dell D820", POS_FIX_LPIB), SND_PCI_QUIRK(0x1028, 0x01de, "Dell Precision 390", POS_FIX_LPIB), SND_PCI_QUIRK(0x1028, 0x01f6, "Dell Latitude 131L", POS_FIX_LPIB), SND_PCI_QUIRK(0x1028, 0x0470, "Dell Inspiron 1120", POS_FIX_LPIB), SND_PCI_QUIRK(0x103c, 0x306d, "HP dv3", POS_FIX_LPIB), SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB), SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB), Loading sound/pci/hda/patch_realtek.c +35 −22 Original line number Diff line number Diff line Loading @@ -14795,6 +14795,7 @@ static int alc269_resume(struct hda_codec *codec) enum { ALC269_FIXUP_SONY_VAIO, ALC275_FIX_SONY_VAIO_GPIO2, ALC269_FIXUP_DELL_M101Z, ALC269_FIXUP_SKU_IGNORE, ALC269_FIXUP_ASUS_G73JW, Loading @@ -14807,6 +14808,14 @@ static const struct alc_fixup alc269_fixups[] = { {} } }, [ALC275_FIX_SONY_VAIO_GPIO2] = { .verbs = (const struct hda_verb[]) { {0x01, AC_VERB_SET_GPIO_MASK, 0x04}, {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x04}, {0x01, AC_VERB_SET_GPIO_DATA, 0x00}, { } } }, [ALC269_FIXUP_DELL_M101Z] = { .verbs = (const struct hda_verb[]) { /* Enables internal speaker */ Loading @@ -14827,6 +14836,9 @@ static const struct alc_fixup alc269_fixups[] = { }; static struct snd_pci_quirk alc269_fixup_tbl[] = { SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIX_SONY_VAIO_GPIO2), SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIX_SONY_VAIO_GPIO2), SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIX_SONY_VAIO_GPIO2), SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), Loading Loading @@ -15081,6 +15093,7 @@ static int patch_alc269(struct hda_codec *codec) alc_auto_parse_customize_define(codec); if (codec->vendor_id == 0x10ec0269) { coef = alc_read_coef_idx(codec, 0); if ((coef & 0x00f0) == 0x0010) { if (codec->bus->pci->subsystem_vendor == 0x1025 && Loading @@ -15101,8 +15114,8 @@ static int patch_alc269(struct hda_codec *codec) } } else alc_fix_pll_init(codec, 0x20, 0x04, 15); alc269_fill_coef(codec); } board_config = snd_hda_check_board_config(codec, ALC269_MODEL_LAST, alc269_models, Loading Loading
sound/core/pcm_lib.c +7 −3 Original line number Diff line number Diff line Loading @@ -1070,8 +1070,10 @@ int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, unsigned int cond, struct snd_pcm_hw_rule *new; unsigned int new_rules = constrs->rules_all + 16; new = kcalloc(new_rules, sizeof(*c), GFP_KERNEL); if (!new) if (!new) { va_end(args); return -ENOMEM; } if (constrs->rules) { memcpy(new, constrs->rules, constrs->rules_num * sizeof(*c)); Loading @@ -1087,8 +1089,10 @@ int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, unsigned int cond, c->private = private; k = 0; while (1) { if (snd_BUG_ON(k >= ARRAY_SIZE(c->deps))) if (snd_BUG_ON(k >= ARRAY_SIZE(c->deps))) { va_end(args); return -EINVAL; } c->deps[k++] = dep; if (dep < 0) break; Loading
sound/oss/soundcard.c +2 −2 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ int *load_mixer_volumes(char *name, int *levels, int present) int i, n; for (i = 0; i < num_mixer_volumes; i++) { if (strcmp(name, mixer_vols[i].name) == 0) { if (strncmp(name, mixer_vols[i].name, 32) == 0) { if (present) mixer_vols[i].num = i; return mixer_vols[i].levels; Loading @@ -99,7 +99,7 @@ int *load_mixer_volumes(char *name, int *levels, int present) } n = num_mixer_volumes++; strcpy(mixer_vols[n].name, name); strncpy(mixer_vols[n].name, name, 32); if (present) mixer_vols[n].num = n; Loading
sound/pci/hda/hda_codec.c +34 −23 Original line number Diff line number Diff line Loading @@ -1919,6 +1919,16 @@ struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec, } EXPORT_SYMBOL_HDA(snd_hda_find_mixer_ctl); static int find_empty_mixer_ctl_idx(struct hda_codec *codec, const char *name) { int idx; for (idx = 0; idx < 16; idx++) { /* 16 ctlrs should be large enough */ if (!_snd_hda_find_mixer_ctl(codec, name, idx)) return idx; } return -EBUSY; } /** * snd_hda_ctl_add - Add a control element and assign to the codec * @codec: HD-audio codec Loading Loading @@ -2654,8 +2664,6 @@ static struct snd_kcontrol_new dig_mixes[] = { { } /* end */ }; #define SPDIF_MAX_IDX 4 /* 4 instances should be enough to probe */ /** * snd_hda_create_spdif_out_ctls - create Output SPDIF-related controls * @codec: the HDA codec Loading @@ -2673,12 +2681,8 @@ int snd_hda_create_spdif_out_ctls(struct hda_codec *codec, hda_nid_t nid) struct snd_kcontrol_new *dig_mix; int idx; for (idx = 0; idx < SPDIF_MAX_IDX; idx++) { if (!_snd_hda_find_mixer_ctl(codec, "IEC958 Playback Switch", idx)) break; } if (idx >= SPDIF_MAX_IDX) { idx = find_empty_mixer_ctl_idx(codec, "IEC958 Playback Switch"); if (idx < 0) { printk(KERN_ERR "hda_codec: too many IEC958 outputs\n"); return -EBUSY; } Loading Loading @@ -2829,12 +2833,8 @@ int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid) struct snd_kcontrol_new *dig_mix; int idx; for (idx = 0; idx < SPDIF_MAX_IDX; idx++) { if (!_snd_hda_find_mixer_ctl(codec, "IEC958 Capture Switch", idx)) break; } if (idx >= SPDIF_MAX_IDX) { idx = find_empty_mixer_ctl_idx(codec, "IEC958 Capture Switch"); if (idx < 0) { printk(KERN_ERR "hda_codec: too many IEC958 inputs\n"); return -EBUSY; } Loading Loading @@ -3808,21 +3808,32 @@ int snd_hda_add_new_ctls(struct hda_codec *codec, struct snd_kcontrol_new *knew) for (; knew->name; knew++) { struct snd_kcontrol *kctl; int addr = 0, idx = 0; if (knew->iface == -1) /* skip this codec private value */ continue; for (;;) { kctl = snd_ctl_new1(knew, codec); if (!kctl) return -ENOMEM; if (addr > 0) kctl->id.device = addr; if (idx > 0) kctl->id.index = idx; err = snd_hda_ctl_add(codec, 0, kctl); if (err < 0) { if (!codec->addr) if (!err) break; /* try first with another device index corresponding to * the codec addr; if it still fails (or it's the * primary codec), then try another control index */ if (!addr && codec->addr) addr = codec->addr; else if (!idx && !knew->index) { idx = find_empty_mixer_ctl_idx(codec, knew->name); if (idx <= 0) return err; kctl = snd_ctl_new1(knew, codec); if (!kctl) return -ENOMEM; kctl->id.device = codec->addr; err = snd_hda_ctl_add(codec, 0, kctl); if (err < 0) } else return err; } } Loading
sound/pci/hda/hda_intel.c +1 −0 Original line number Diff line number Diff line Loading @@ -2300,6 +2300,7 @@ static struct snd_pci_quirk position_fix_list[] __devinitdata = { SND_PCI_QUIRK(0x1028, 0x01cc, "Dell D820", POS_FIX_LPIB), SND_PCI_QUIRK(0x1028, 0x01de, "Dell Precision 390", POS_FIX_LPIB), SND_PCI_QUIRK(0x1028, 0x01f6, "Dell Latitude 131L", POS_FIX_LPIB), SND_PCI_QUIRK(0x1028, 0x0470, "Dell Inspiron 1120", POS_FIX_LPIB), SND_PCI_QUIRK(0x103c, 0x306d, "HP dv3", POS_FIX_LPIB), SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB), SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB), Loading
sound/pci/hda/patch_realtek.c +35 −22 Original line number Diff line number Diff line Loading @@ -14795,6 +14795,7 @@ static int alc269_resume(struct hda_codec *codec) enum { ALC269_FIXUP_SONY_VAIO, ALC275_FIX_SONY_VAIO_GPIO2, ALC269_FIXUP_DELL_M101Z, ALC269_FIXUP_SKU_IGNORE, ALC269_FIXUP_ASUS_G73JW, Loading @@ -14807,6 +14808,14 @@ static const struct alc_fixup alc269_fixups[] = { {} } }, [ALC275_FIX_SONY_VAIO_GPIO2] = { .verbs = (const struct hda_verb[]) { {0x01, AC_VERB_SET_GPIO_MASK, 0x04}, {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x04}, {0x01, AC_VERB_SET_GPIO_DATA, 0x00}, { } } }, [ALC269_FIXUP_DELL_M101Z] = { .verbs = (const struct hda_verb[]) { /* Enables internal speaker */ Loading @@ -14827,6 +14836,9 @@ static const struct alc_fixup alc269_fixups[] = { }; static struct snd_pci_quirk alc269_fixup_tbl[] = { SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIX_SONY_VAIO_GPIO2), SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIX_SONY_VAIO_GPIO2), SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIX_SONY_VAIO_GPIO2), SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), Loading Loading @@ -15081,6 +15093,7 @@ static int patch_alc269(struct hda_codec *codec) alc_auto_parse_customize_define(codec); if (codec->vendor_id == 0x10ec0269) { coef = alc_read_coef_idx(codec, 0); if ((coef & 0x00f0) == 0x0010) { if (codec->bus->pci->subsystem_vendor == 0x1025 && Loading @@ -15101,8 +15114,8 @@ static int patch_alc269(struct hda_codec *codec) } } else alc_fix_pll_init(codec, 0x20, 0x04, 15); alc269_fill_coef(codec); } board_config = snd_hda_check_board_config(codec, ALC269_MODEL_LAST, alc269_models, Loading