Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 193273
b: refs/heads/master
c: 5266874
h: refs/heads/master
i:
  193271: 0ddd816
v: v3
  • Loading branch information
Takashi Iwai committed Mar 26, 2010
1 parent 828146a commit ba37a3b
Show file tree
Hide file tree
Showing 6 changed files with 155 additions and 42 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: 079e683ebd882655b6d6e0b17989e51bae2d77d6
refs/heads/master: 5266874b09c8a9de744813dd0f7387f02e8191bf
3 changes: 2 additions & 1 deletion trunk/sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -4218,7 +4218,8 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
break;
case AC_JACK_MIC_IN: {
int preferred, alt;
if (loc == AC_JACK_LOC_FRONT) {
if (loc == AC_JACK_LOC_FRONT ||
(loc & 0x30) == AC_JACK_LOC_INTERNAL) {
preferred = AUTO_PIN_FRONT_MIC;
alt = AUTO_PIN_MIC;
} else {
Expand Down
15 changes: 15 additions & 0 deletions trunk/sound/pci/hda/patch_conexant.c
Original file line number Diff line number Diff line change
Expand Up @@ -1591,6 +1591,21 @@ static int patch_cxt5047(struct hda_codec *codec)
#endif
}
spec->vmaster_nid = 0x13;

switch (codec->subsystem_id >> 16) {
case 0x103c:
/* HP laptops have really bad sound over 0 dB on NID 0x10.
* Fix max PCM level to 0 dB (originally it has 0x1e steps
* with 0 dB offset 0x17)
*/
snd_hda_override_amp_caps(codec, 0x10, HDA_INPUT,
(0x17 << AC_AMPCAP_OFFSET_SHIFT) |
(0x17 << AC_AMPCAP_NUM_STEPS_SHIFT) |
(0x05 << AC_AMPCAP_STEP_SIZE_SHIFT) |
(1 << AC_AMPCAP_MUTE_SHIFT));
break;
}

return 0;
}

Expand Down
15 changes: 9 additions & 6 deletions trunk/sound/pci/hda/patch_nvhdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,6 @@ static int patch_nvhdmi_2ch(struct hda_codec *codec)
* patch entries
*/
static struct hda_codec_preset snd_hda_preset_nvhdmi[] = {
{ .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi_2ch },
{ .id = 0x10de8001, .name = "MCP73 HDMI", .patch = patch_nvhdmi_2ch },
{ .id = 0x10de0002, .name = "MCP77/78 HDMI",
.patch = patch_nvhdmi_8ch_7x },
{ .id = 0x10de0003, .name = "MCP77/78 HDMI",
Expand All @@ -550,12 +548,16 @@ static struct hda_codec_preset snd_hda_preset_nvhdmi[] = {
.patch = patch_nvhdmi_8ch_7x },
{ .id = 0x10de0007, .name = "MCP79/7A HDMI",
.patch = patch_nvhdmi_8ch_7x },
{ .id = 0x10de000c, .name = "MCP89 HDMI",
{ .id = 0x10de000a, .name = "GT220 HDMI",
.patch = patch_nvhdmi_8ch_89 },
{ .id = 0x10de000b, .name = "GT21x HDMI",
.patch = patch_nvhdmi_8ch_89 },
{ .id = 0x10de000c, .name = "MCP89 HDMI",
.patch = patch_nvhdmi_8ch_89 },
{ .id = 0x10de000d, .name = "GT240 HDMI",
.patch = patch_nvhdmi_8ch_89 },
{ .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi_2ch },
{ .id = 0x10de8001, .name = "MCP73 HDMI", .patch = patch_nvhdmi_2ch },
{} /* terminator */
};

Expand All @@ -564,11 +566,12 @@ MODULE_ALIAS("snd-hda-codec-id:10de0003");
MODULE_ALIAS("snd-hda-codec-id:10de0005");
MODULE_ALIAS("snd-hda-codec-id:10de0006");
MODULE_ALIAS("snd-hda-codec-id:10de0007");
MODULE_ALIAS("snd-hda-codec-id:10de0067");
MODULE_ALIAS("snd-hda-codec-id:10de8001");
MODULE_ALIAS("snd-hda-codec-id:10de000c");
MODULE_ALIAS("snd-hda-codec-id:10de000a");
MODULE_ALIAS("snd-hda-codec-id:10de000b");
MODULE_ALIAS("snd-hda-codec-id:10de000c");
MODULE_ALIAS("snd-hda-codec-id:10de000d");
MODULE_ALIAS("snd-hda-codec-id:10de0067");
MODULE_ALIAS("snd-hda-codec-id:10de8001");

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("NVIDIA HDMI HD-audio codec");
Expand Down
160 changes: 126 additions & 34 deletions trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,18 @@ struct alc_mic_route {

#define MUX_IDX_UNDEF ((unsigned char)-1)

struct alc_customize_define {
unsigned int sku_cfg;
unsigned char port_connectivity;
unsigned char check_sum;
unsigned char customization;
unsigned char external_amp;
unsigned int enable_pcbeep:1;
unsigned int platform_type:1;
unsigned int swap:1;
unsigned int override:1;
};

struct alc_spec {
/* codec parameterization */
struct snd_kcontrol_new *mixers[5]; /* mixer arrays */
Expand Down Expand Up @@ -332,6 +344,7 @@ struct alc_spec {

/* dynamic controls, init_verbs and input_mux */
struct auto_pin_cfg autocfg;
struct alc_customize_define cdefine;
struct snd_array kctls;
struct hda_input_mux private_imux[3];
hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS];
Expand Down Expand Up @@ -1247,6 +1260,62 @@ static void alc_init_auto_mic(struct hda_codec *codec)
spec->unsol_event = alc_sku_unsol_event;
}

static int alc_auto_parse_customize_define(struct hda_codec *codec)
{
unsigned int ass, tmp, i;
unsigned nid = 0;
struct alc_spec *spec = codec->spec;

ass = codec->subsystem_id & 0xffff;
if (ass != codec->bus->pci->subsystem_device && (ass & 1))
goto do_sku;

nid = 0x1d;
if (codec->vendor_id == 0x10ec0260)
nid = 0x17;
ass = snd_hda_codec_get_pincfg(codec, nid);

if (!(ass & 1)) {
printk(KERN_INFO "hda_codec: %s: SKU not ready 0x%08x\n",
codec->chip_name, ass);
return -1;
}

/* check sum */
tmp = 0;
for (i = 1; i < 16; i++) {
if ((ass >> i) & 1)
tmp++;
}
if (((ass >> 16) & 0xf) != tmp)
return -1;

spec->cdefine.port_connectivity = ass >> 30;
spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
spec->cdefine.check_sum = (ass >> 16) & 0xf;
spec->cdefine.customization = ass >> 8;
do_sku:
spec->cdefine.sku_cfg = ass;
spec->cdefine.external_amp = (ass & 0x38) >> 3;
spec->cdefine.platform_type = (ass & 0x4) >> 2;
spec->cdefine.swap = (ass & 0x2) >> 1;
spec->cdefine.override = ass & 0x1;

snd_printd("SKU: Nid=0x%x sku_cfg=0x%08x\n",
nid, spec->cdefine.sku_cfg);
snd_printd("SKU: port_connectivity=0x%x\n",
spec->cdefine.port_connectivity);
snd_printd("SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
snd_printd("SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
snd_printd("SKU: customization=0x%08x\n", spec->cdefine.customization);
snd_printd("SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
snd_printd("SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
snd_printd("SKU: swap=0x%x\n", spec->cdefine.swap);
snd_printd("SKU: override=0x%x\n", spec->cdefine.override);

return 0;
}

/* check subsystem ID and set up device-specific initialization;
* return 1 if initialized, 0 if invalid SSID
*/
Expand Down Expand Up @@ -2532,8 +2601,6 @@ static int alc_build_controls(struct hda_codec *codec)
return err;
}

alc_free_kctls(codec); /* no longer needed */

/* assign Capture Source enums to NID */
kctl = snd_hda_find_mixer_ctl(codec, "Capture Source");
if (!kctl)
Expand Down Expand Up @@ -2602,6 +2669,9 @@ static int alc_build_controls(struct hda_codec *codec)
}
}
}

alc_free_kctls(codec); /* no longer needed */

return 0;
}

Expand Down Expand Up @@ -3779,6 +3849,17 @@ static struct hda_codec_ops alc_patch_ops = {
.reboot_notify = alc_shutup,
};

/* replace the codec chip_name with the given string */
static int alc_codec_rename(struct hda_codec *codec, const char *name)
{
kfree(codec->chip_name);
codec->chip_name = kstrdup(name, GFP_KERNEL);
if (!codec->chip_name) {
alc_free(codec);
return -ENOMEM;
}
return 0;
}

/*
* Test configuration for debugging
Expand Down Expand Up @@ -10042,8 +10123,11 @@ static void alc882_auto_set_output_and_unmute(struct hda_codec *codec,
alc_set_pin_output(codec, nid, pin_type);
if (spec->multiout.dac_nids[dac_idx] == 0x25)
idx = 4;
else
else {
if (spec->multiout.num_dacs >= dac_idx)
return;
idx = spec->multiout.dac_nids[dac_idx] - 2;
}
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CONNECT_SEL, idx);

}
Expand Down Expand Up @@ -10267,6 +10351,8 @@ static int patch_alc882(struct hda_codec *codec)

codec->spec = spec;

alc_auto_parse_customize_define(codec);

switch (codec->vendor_id) {
case 0x10ec0882:
case 0x10ec0885:
Expand Down Expand Up @@ -10362,7 +10448,9 @@ static int patch_alc882(struct hda_codec *codec)
}

set_capture_mixer(codec);
set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);

if (spec->cdefine.enable_pcbeep)
set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);

spec->vmaster_nid = 0x0c;

Expand Down Expand Up @@ -12146,6 +12234,7 @@ static int patch_alc262(struct hda_codec *codec)
snd_hda_codec_write(codec, 0x1a, 0, AC_VERB_SET_PROC_COEF, tmp | 0x80);
}
#endif
alc_auto_parse_customize_define(codec);

alc_fix_pll_init(codec, 0x20, 0x0a, 10);

Expand Down Expand Up @@ -12224,7 +12313,7 @@ static int patch_alc262(struct hda_codec *codec)
}
if (!spec->cap_mixer && !spec->no_analog)
set_capture_mixer(codec);
if (!spec->no_analog)
if (!spec->no_analog && spec->cdefine.enable_pcbeep)
set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);

spec->vmaster_nid = 0x0c;
Expand Down Expand Up @@ -14094,17 +14183,17 @@ static int patch_alc269(struct hda_codec *codec)

codec->spec = spec;

alc_fix_pll_init(codec, 0x20, 0x04, 15);
alc_auto_parse_customize_define(codec);

if ((alc_read_coef_idx(codec, 0) & 0x00f0) == 0x0010){
kfree(codec->chip_name);
codec->chip_name = kstrdup("ALC259", GFP_KERNEL);
if (!codec->chip_name) {
alc_free(codec);
return -ENOMEM;
}
if (codec->bus->pci->subsystem_vendor == 0x1025 &&
spec->cdefine.platform_type == 1)
alc_codec_rename(codec, "ALC271X");
else
alc_codec_rename(codec, "ALC259");
is_alc269vb = 1;
}
} else
alc_fix_pll_init(codec, 0x20, 0x04, 15);

board_config = snd_hda_check_board_config(codec, ALC269_MODEL_LAST,
alc269_models,
Expand Down Expand Up @@ -14164,7 +14253,8 @@ static int patch_alc269(struct hda_codec *codec)

if (!spec->cap_mixer)
set_capture_mixer(codec);
set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
if (spec->cdefine.enable_pcbeep)
set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);

spec->vmaster_nid = 0x02;

Expand Down Expand Up @@ -18314,16 +18404,16 @@ static int patch_alc662(struct hda_codec *codec)

codec->spec = spec;

alc_auto_parse_customize_define(codec);

alc_fix_pll_init(codec, 0x20, 0x04, 15);

if (alc_read_coef_idx(codec, 0)==0x8020){
kfree(codec->chip_name);
codec->chip_name = kstrdup("ALC661", GFP_KERNEL);
if (!codec->chip_name) {
alc_free(codec);
return -ENOMEM;
}
}
if (alc_read_coef_idx(codec, 0) == 0x8020)
alc_codec_rename(codec, "ALC661");
else if ((alc_read_coef_idx(codec, 0) & (1 << 14)) &&
codec->bus->pci->subsystem_vendor == 0x1025 &&
spec->cdefine.platform_type == 1)
alc_codec_rename(codec, "ALC272X");

board_config = snd_hda_check_board_config(codec, ALC662_MODEL_LAST,
alc662_models,
Expand Down Expand Up @@ -18373,18 +18463,20 @@ static int patch_alc662(struct hda_codec *codec)
if (!spec->cap_mixer)
set_capture_mixer(codec);

switch (codec->vendor_id) {
case 0x10ec0662:
set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
break;
case 0x10ec0272:
case 0x10ec0663:
case 0x10ec0665:
set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
break;
case 0x10ec0273:
set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
break;
if (spec->cdefine.enable_pcbeep) {
switch (codec->vendor_id) {
case 0x10ec0662:
set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
break;
case 0x10ec0272:
case 0x10ec0663:
case 0x10ec0665:
set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
break;
case 0x10ec0273:
set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
break;
}
}
spec->vmaster_nid = 0x02;

Expand Down
2 changes: 2 additions & 0 deletions trunk/sound/pci/hda/patch_sigmatel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1730,6 +1730,8 @@ static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = {
"HP HDX", STAC_HP_HDX), /* HDX16 */
SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3620,
"HP dv6", STAC_HP_DV5),
SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3061,
"HP dv6", STAC_HP_DV5), /* HP dv6-1110ax */
SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x7010,
"HP", STAC_HP_DV5),
SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233,
Expand Down

0 comments on commit ba37a3b

Please sign in to comment.