diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-09-09 10:28:02 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-09-09 10:46:03 -0400 |
commit | 10a20af7c944649dc6d1ffa06bc759f5f3a16cd9 (patch) | |
tree | 322ad916b8d909e3bdc3c51eb63ccecbdd1ae16a /sound/pci/hda/patch_via.c | |
parent | 86e2959a10828dd2614e037fb2502bc833adca52 (diff) |
ALSA: hda - Improve the input source name labels
This patch improves the input-source label strings to be generated from
the pin information instead of fixed strings per AUTO_PIN_* type.
This gives more suitable labels, especially for mic and line-in pins.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_via.c')
-rw-r--r-- | sound/pci/hda/patch_via.c | 100 |
1 files changed, 42 insertions, 58 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index de5f61d1b725..d1c3f8defc48 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c | |||
@@ -2374,13 +2374,8 @@ static void create_hp_imux(struct via_spec *spec) | |||
2374 | static const char *texts[] = { "OFF", "ON", NULL}; | 2374 | static const char *texts[] = { "OFF", "ON", NULL}; |
2375 | 2375 | ||
2376 | /* for hp mode select */ | 2376 | /* for hp mode select */ |
2377 | i = 0; | 2377 | for (i = 0; texts[i]; i++) |
2378 | while (texts[i] != NULL) { | 2378 | snd_hda_add_imux_item(imux, texts[i], i, NULL); |
2379 | strcpy(imux->items[imux->num_items].label, texts[i]); | ||
2380 | imux->items[imux->num_items].index = i; | ||
2381 | imux->num_items++; | ||
2382 | i++; | ||
2383 | } | ||
2384 | 2379 | ||
2385 | spec->hp_mux = &spec->private_imux[1]; | 2380 | spec->hp_mux = &spec->private_imux[1]; |
2386 | } | 2381 | } |
@@ -2412,26 +2407,25 @@ static int vt1708_auto_create_hp_ctls(struct via_spec *spec, hda_nid_t pin) | |||
2412 | } | 2407 | } |
2413 | 2408 | ||
2414 | /* create playback/capture controls for input pins */ | 2409 | /* create playback/capture controls for input pins */ |
2415 | static int vt_auto_create_analog_input_ctls(struct via_spec *spec, | 2410 | static int vt_auto_create_analog_input_ctls(struct hda_codec *codec, |
2416 | const struct auto_pin_cfg *cfg, | 2411 | const struct auto_pin_cfg *cfg, |
2417 | hda_nid_t cap_nid, | 2412 | hda_nid_t cap_nid, |
2418 | hda_nid_t pin_idxs[], int num_idxs) | 2413 | hda_nid_t pin_idxs[], int num_idxs) |
2419 | { | 2414 | { |
2415 | struct via_spec *spec = codec->spec; | ||
2420 | struct hda_input_mux *imux = &spec->private_imux[0]; | 2416 | struct hda_input_mux *imux = &spec->private_imux[0]; |
2421 | int i, err, idx, type, type_idx = 0; | 2417 | int i, err, idx, type, type_idx = 0; |
2422 | 2418 | ||
2423 | /* for internal loopback recording select */ | 2419 | /* for internal loopback recording select */ |
2424 | for (idx = 0; idx < num_idxs; idx++) { | 2420 | for (idx = 0; idx < num_idxs; idx++) { |
2425 | if (pin_idxs[idx] == 0xff) { | 2421 | if (pin_idxs[idx] == 0xff) { |
2426 | strcpy(imux->items[imux->num_items].label, | 2422 | snd_hda_add_imux_item(imux, "Stereo Mixer", idx, NULL); |
2427 | "Stereo Mixer"); | ||
2428 | imux->items[imux->num_items].index = idx; | ||
2429 | imux->num_items++; | ||
2430 | break; | 2423 | break; |
2431 | } | 2424 | } |
2432 | } | 2425 | } |
2433 | 2426 | ||
2434 | for (i = 0; i < cfg->num_inputs; i++) { | 2427 | for (i = 0; i < cfg->num_inputs; i++) { |
2428 | const char *label; | ||
2435 | type = cfg->inputs[i].type; | 2429 | type = cfg->inputs[i].type; |
2436 | for (idx = 0; idx < num_idxs; idx++) | 2430 | for (idx = 0; idx < num_idxs; idx++) |
2437 | if (pin_idxs[idx] == cfg->inputs[i].pin) | 2431 | if (pin_idxs[idx] == cfg->inputs[i].pin) |
@@ -2442,24 +2436,21 @@ static int vt_auto_create_analog_input_ctls(struct via_spec *spec, | |||
2442 | type_idx++; | 2436 | type_idx++; |
2443 | else | 2437 | else |
2444 | type_idx = 0; | 2438 | type_idx = 0; |
2445 | err = via_new_analog_input(spec, auto_pin_cfg_labels[type], | 2439 | label = hda_get_autocfg_input_label(codec, cfg, i); |
2446 | type_idx, idx, cap_nid); | 2440 | err = via_new_analog_input(spec, label, type_idx, idx, cap_nid); |
2447 | if (err < 0) | 2441 | if (err < 0) |
2448 | return err; | 2442 | return err; |
2449 | snd_hda_get_input_pin_label(cfg, i, | 2443 | snd_hda_add_imux_item(imux, label, idx, NULL); |
2450 | imux->items[imux->num_items].label); | ||
2451 | imux->items[imux->num_items].index = idx; | ||
2452 | imux->num_items++; | ||
2453 | } | 2444 | } |
2454 | return 0; | 2445 | return 0; |
2455 | } | 2446 | } |
2456 | 2447 | ||
2457 | /* create playback/capture controls for input pins */ | 2448 | /* create playback/capture controls for input pins */ |
2458 | static int vt1708_auto_create_analog_input_ctls(struct via_spec *spec, | 2449 | static int vt1708_auto_create_analog_input_ctls(struct hda_codec *codec, |
2459 | const struct auto_pin_cfg *cfg) | 2450 | const struct auto_pin_cfg *cfg) |
2460 | { | 2451 | { |
2461 | static hda_nid_t pin_idxs[] = { 0xff, 0x24, 0x1d, 0x1e, 0x21 }; | 2452 | static hda_nid_t pin_idxs[] = { 0xff, 0x24, 0x1d, 0x1e, 0x21 }; |
2462 | return vt_auto_create_analog_input_ctls(spec, cfg, 0x17, pin_idxs, | 2453 | return vt_auto_create_analog_input_ctls(codec, cfg, 0x17, pin_idxs, |
2463 | ARRAY_SIZE(pin_idxs)); | 2454 | ARRAY_SIZE(pin_idxs)); |
2464 | } | 2455 | } |
2465 | 2456 | ||
@@ -2559,7 +2550,7 @@ static int vt1708_parse_auto_config(struct hda_codec *codec) | |||
2559 | err = vt1708_auto_create_hp_ctls(spec, spec->autocfg.hp_pins[0]); | 2550 | err = vt1708_auto_create_hp_ctls(spec, spec->autocfg.hp_pins[0]); |
2560 | if (err < 0) | 2551 | if (err < 0) |
2561 | return err; | 2552 | return err; |
2562 | err = vt1708_auto_create_analog_input_ctls(spec, &spec->autocfg); | 2553 | err = vt1708_auto_create_analog_input_ctls(codec, &spec->autocfg); |
2563 | if (err < 0) | 2554 | if (err < 0) |
2564 | return err; | 2555 | return err; |
2565 | /* add jack detect on/off control */ | 2556 | /* add jack detect on/off control */ |
@@ -3026,11 +3017,11 @@ static int vt1709_auto_create_hp_ctls(struct via_spec *spec, hda_nid_t pin) | |||
3026 | } | 3017 | } |
3027 | 3018 | ||
3028 | /* create playback/capture controls for input pins */ | 3019 | /* create playback/capture controls for input pins */ |
3029 | static int vt1709_auto_create_analog_input_ctls(struct via_spec *spec, | 3020 | static int vt1709_auto_create_analog_input_ctls(struct hda_codec *codec, |
3030 | const struct auto_pin_cfg *cfg) | 3021 | const struct auto_pin_cfg *cfg) |
3031 | { | 3022 | { |
3032 | static hda_nid_t pin_idxs[] = { 0xff, 0x23, 0x1d, 0x1e, 0x21 }; | 3023 | static hda_nid_t pin_idxs[] = { 0xff, 0x23, 0x1d, 0x1e, 0x21 }; |
3033 | return vt_auto_create_analog_input_ctls(spec, cfg, 0x18, pin_idxs, | 3024 | return vt_auto_create_analog_input_ctls(codec, cfg, 0x18, pin_idxs, |
3034 | ARRAY_SIZE(pin_idxs)); | 3025 | ARRAY_SIZE(pin_idxs)); |
3035 | } | 3026 | } |
3036 | 3027 | ||
@@ -3054,7 +3045,7 @@ static int vt1709_parse_auto_config(struct hda_codec *codec) | |||
3054 | err = vt1709_auto_create_hp_ctls(spec, spec->autocfg.hp_pins[0]); | 3045 | err = vt1709_auto_create_hp_ctls(spec, spec->autocfg.hp_pins[0]); |
3055 | if (err < 0) | 3046 | if (err < 0) |
3056 | return err; | 3047 | return err; |
3057 | err = vt1709_auto_create_analog_input_ctls(spec, &spec->autocfg); | 3048 | err = vt1709_auto_create_analog_input_ctls(codec, &spec->autocfg); |
3058 | if (err < 0) | 3049 | if (err < 0) |
3059 | return err; | 3050 | return err; |
3060 | 3051 | ||
@@ -3556,11 +3547,11 @@ static int vt1708B_auto_create_hp_ctls(struct via_spec *spec, hda_nid_t pin) | |||
3556 | } | 3547 | } |
3557 | 3548 | ||
3558 | /* create playback/capture controls for input pins */ | 3549 | /* create playback/capture controls for input pins */ |
3559 | static int vt1708B_auto_create_analog_input_ctls(struct via_spec *spec, | 3550 | static int vt1708B_auto_create_analog_input_ctls(struct hda_codec *codec, |
3560 | const struct auto_pin_cfg *cfg) | 3551 | const struct auto_pin_cfg *cfg) |
3561 | { | 3552 | { |
3562 | static hda_nid_t pin_idxs[] = { 0xff, 0x1f, 0x1a, 0x1b, 0x1e }; | 3553 | static hda_nid_t pin_idxs[] = { 0xff, 0x1f, 0x1a, 0x1b, 0x1e }; |
3563 | return vt_auto_create_analog_input_ctls(spec, cfg, 0x16, pin_idxs, | 3554 | return vt_auto_create_analog_input_ctls(codec, cfg, 0x16, pin_idxs, |
3564 | ARRAY_SIZE(pin_idxs)); | 3555 | ARRAY_SIZE(pin_idxs)); |
3565 | } | 3556 | } |
3566 | 3557 | ||
@@ -3584,7 +3575,7 @@ static int vt1708B_parse_auto_config(struct hda_codec *codec) | |||
3584 | err = vt1708B_auto_create_hp_ctls(spec, spec->autocfg.hp_pins[0]); | 3575 | err = vt1708B_auto_create_hp_ctls(spec, spec->autocfg.hp_pins[0]); |
3585 | if (err < 0) | 3576 | if (err < 0) |
3586 | return err; | 3577 | return err; |
3587 | err = vt1708B_auto_create_analog_input_ctls(spec, &spec->autocfg); | 3578 | err = vt1708B_auto_create_analog_input_ctls(codec, &spec->autocfg); |
3588 | if (err < 0) | 3579 | if (err < 0) |
3589 | return err; | 3580 | return err; |
3590 | 3581 | ||
@@ -3992,11 +3983,11 @@ static int vt1708S_auto_create_hp_ctls(struct via_spec *spec, hda_nid_t pin) | |||
3992 | } | 3983 | } |
3993 | 3984 | ||
3994 | /* create playback/capture controls for input pins */ | 3985 | /* create playback/capture controls for input pins */ |
3995 | static int vt1708S_auto_create_analog_input_ctls(struct via_spec *spec, | 3986 | static int vt1708S_auto_create_analog_input_ctls(struct hda_codec *codec, |
3996 | const struct auto_pin_cfg *cfg) | 3987 | const struct auto_pin_cfg *cfg) |
3997 | { | 3988 | { |
3998 | static hda_nid_t pin_idxs[] = { 0x1f, 0x1a, 0x1b, 0x1e, 0, 0xff }; | 3989 | static hda_nid_t pin_idxs[] = { 0x1f, 0x1a, 0x1b, 0x1e, 0, 0xff }; |
3999 | return vt_auto_create_analog_input_ctls(spec, cfg, 0x16, pin_idxs, | 3990 | return vt_auto_create_analog_input_ctls(codec, cfg, 0x16, pin_idxs, |
4000 | ARRAY_SIZE(pin_idxs)); | 3991 | ARRAY_SIZE(pin_idxs)); |
4001 | } | 3992 | } |
4002 | 3993 | ||
@@ -4045,7 +4036,7 @@ static int vt1708S_parse_auto_config(struct hda_codec *codec) | |||
4045 | err = vt1708S_auto_create_hp_ctls(spec, spec->autocfg.hp_pins[0]); | 4036 | err = vt1708S_auto_create_hp_ctls(spec, spec->autocfg.hp_pins[0]); |
4046 | if (err < 0) | 4037 | if (err < 0) |
4047 | return err; | 4038 | return err; |
4048 | err = vt1708S_auto_create_analog_input_ctls(spec, &spec->autocfg); | 4039 | err = vt1708S_auto_create_analog_input_ctls(codec, &spec->autocfg); |
4049 | if (err < 0) | 4040 | if (err < 0) |
4050 | return err; | 4041 | return err; |
4051 | 4042 | ||
@@ -4335,24 +4326,19 @@ static int vt1702_auto_create_hp_ctls(struct via_spec *spec, hda_nid_t pin) | |||
4335 | imux = &spec->private_imux[1]; | 4326 | imux = &spec->private_imux[1]; |
4336 | 4327 | ||
4337 | /* for hp mode select */ | 4328 | /* for hp mode select */ |
4338 | i = 0; | 4329 | for (i = 0; texts[i]; i++) |
4339 | while (texts[i] != NULL) { | 4330 | snd_hda_add_imux_item(imux, texts[i], i, NULL); |
4340 | strcpy(imux->items[imux->num_items].label, texts[i]); | ||
4341 | imux->items[imux->num_items].index = i; | ||
4342 | imux->num_items++; | ||
4343 | i++; | ||
4344 | } | ||
4345 | 4331 | ||
4346 | spec->hp_mux = &spec->private_imux[1]; | 4332 | spec->hp_mux = &spec->private_imux[1]; |
4347 | return 0; | 4333 | return 0; |
4348 | } | 4334 | } |
4349 | 4335 | ||
4350 | /* create playback/capture controls for input pins */ | 4336 | /* create playback/capture controls for input pins */ |
4351 | static int vt1702_auto_create_analog_input_ctls(struct via_spec *spec, | 4337 | static int vt1702_auto_create_analog_input_ctls(struct hda_codec *codec, |
4352 | const struct auto_pin_cfg *cfg) | 4338 | const struct auto_pin_cfg *cfg) |
4353 | { | 4339 | { |
4354 | static hda_nid_t pin_idxs[] = { 0x14, 0x15, 0x18, 0xff }; | 4340 | static hda_nid_t pin_idxs[] = { 0x14, 0x15, 0x18, 0xff }; |
4355 | return vt_auto_create_analog_input_ctls(spec, cfg, 0x1a, pin_idxs, | 4341 | return vt_auto_create_analog_input_ctls(codec, cfg, 0x1a, pin_idxs, |
4356 | ARRAY_SIZE(pin_idxs)); | 4342 | ARRAY_SIZE(pin_idxs)); |
4357 | } | 4343 | } |
4358 | 4344 | ||
@@ -4382,7 +4368,7 @@ static int vt1702_parse_auto_config(struct hda_codec *codec) | |||
4382 | (0x17 << AC_AMPCAP_NUM_STEPS_SHIFT) | | 4368 | (0x17 << AC_AMPCAP_NUM_STEPS_SHIFT) | |
4383 | (0x5 << AC_AMPCAP_STEP_SIZE_SHIFT) | | 4369 | (0x5 << AC_AMPCAP_STEP_SIZE_SHIFT) | |
4384 | (1 << AC_AMPCAP_MUTE_SHIFT)); | 4370 | (1 << AC_AMPCAP_MUTE_SHIFT)); |
4385 | err = vt1702_auto_create_analog_input_ctls(spec, &spec->autocfg); | 4371 | err = vt1702_auto_create_analog_input_ctls(codec, &spec->autocfg); |
4386 | if (err < 0) | 4372 | if (err < 0) |
4387 | return err; | 4373 | return err; |
4388 | 4374 | ||
@@ -4733,11 +4719,11 @@ static int vt1718S_auto_create_hp_ctls(struct via_spec *spec, hda_nid_t pin) | |||
4733 | } | 4719 | } |
4734 | 4720 | ||
4735 | /* create playback/capture controls for input pins */ | 4721 | /* create playback/capture controls for input pins */ |
4736 | static int vt1718S_auto_create_analog_input_ctls(struct via_spec *spec, | 4722 | static int vt1718S_auto_create_analog_input_ctls(struct hda_codec *codec, |
4737 | const struct auto_pin_cfg *cfg) | 4723 | const struct auto_pin_cfg *cfg) |
4738 | { | 4724 | { |
4739 | static hda_nid_t pin_idxs[] = { 0x2c, 0x2b, 0x2a, 0x29, 0, 0xff }; | 4725 | static hda_nid_t pin_idxs[] = { 0x2c, 0x2b, 0x2a, 0x29, 0, 0xff }; |
4740 | return vt_auto_create_analog_input_ctls(spec, cfg, 0x21, pin_idxs, | 4726 | return vt_auto_create_analog_input_ctls(codec, cfg, 0x21, pin_idxs, |
4741 | ARRAY_SIZE(pin_idxs)); | 4727 | ARRAY_SIZE(pin_idxs)); |
4742 | } | 4728 | } |
4743 | 4729 | ||
@@ -4762,7 +4748,7 @@ static int vt1718S_parse_auto_config(struct hda_codec *codec) | |||
4762 | err = vt1718S_auto_create_hp_ctls(spec, spec->autocfg.hp_pins[0]); | 4748 | err = vt1718S_auto_create_hp_ctls(spec, spec->autocfg.hp_pins[0]); |
4763 | if (err < 0) | 4749 | if (err < 0) |
4764 | return err; | 4750 | return err; |
4765 | err = vt1718S_auto_create_analog_input_ctls(spec, &spec->autocfg); | 4751 | err = vt1718S_auto_create_analog_input_ctls(codec, &spec->autocfg); |
4766 | if (err < 0) | 4752 | if (err < 0) |
4767 | return err; | 4753 | return err; |
4768 | 4754 | ||
@@ -5195,11 +5181,11 @@ static int vt1716S_auto_create_hp_ctls(struct via_spec *spec, hda_nid_t pin) | |||
5195 | } | 5181 | } |
5196 | 5182 | ||
5197 | /* create playback/capture controls for input pins */ | 5183 | /* create playback/capture controls for input pins */ |
5198 | static int vt1716S_auto_create_analog_input_ctls(struct via_spec *spec, | 5184 | static int vt1716S_auto_create_analog_input_ctls(struct hda_codec *codec, |
5199 | const struct auto_pin_cfg *cfg) | 5185 | const struct auto_pin_cfg *cfg) |
5200 | { | 5186 | { |
5201 | static hda_nid_t pin_idxs[] = { 0x1f, 0x1a, 0x1b, 0x1e, 0, 0xff }; | 5187 | static hda_nid_t pin_idxs[] = { 0x1f, 0x1a, 0x1b, 0x1e, 0, 0xff }; |
5202 | return vt_auto_create_analog_input_ctls(spec, cfg, 0x16, pin_idxs, | 5188 | return vt_auto_create_analog_input_ctls(codec, cfg, 0x16, pin_idxs, |
5203 | ARRAY_SIZE(pin_idxs)); | 5189 | ARRAY_SIZE(pin_idxs)); |
5204 | } | 5190 | } |
5205 | 5191 | ||
@@ -5223,7 +5209,7 @@ static int vt1716S_parse_auto_config(struct hda_codec *codec) | |||
5223 | err = vt1716S_auto_create_hp_ctls(spec, spec->autocfg.hp_pins[0]); | 5209 | err = vt1716S_auto_create_hp_ctls(spec, spec->autocfg.hp_pins[0]); |
5224 | if (err < 0) | 5210 | if (err < 0) |
5225 | return err; | 5211 | return err; |
5226 | err = vt1716S_auto_create_analog_input_ctls(spec, &spec->autocfg); | 5212 | err = vt1716S_auto_create_analog_input_ctls(codec, &spec->autocfg); |
5227 | if (err < 0) | 5213 | if (err < 0) |
5228 | return err; | 5214 | return err; |
5229 | 5215 | ||
@@ -5504,14 +5490,15 @@ static int vt2002P_auto_create_hp_ctls(struct via_spec *spec, hda_nid_t pin) | |||
5504 | } | 5490 | } |
5505 | 5491 | ||
5506 | /* create playback/capture controls for input pins */ | 5492 | /* create playback/capture controls for input pins */ |
5507 | static int vt2002P_auto_create_analog_input_ctls(struct via_spec *spec, | 5493 | static int vt2002P_auto_create_analog_input_ctls(struct hda_codec *codec, |
5508 | const struct auto_pin_cfg *cfg) | 5494 | const struct auto_pin_cfg *cfg) |
5509 | { | 5495 | { |
5496 | struct via_spec *spec = codec->spec; | ||
5510 | struct hda_input_mux *imux = &spec->private_imux[0]; | 5497 | struct hda_input_mux *imux = &spec->private_imux[0]; |
5511 | static hda_nid_t pin_idxs[] = { 0x2b, 0x2a, 0x29, 0xff }; | 5498 | static hda_nid_t pin_idxs[] = { 0x2b, 0x2a, 0x29, 0xff }; |
5512 | int err; | 5499 | int err; |
5513 | 5500 | ||
5514 | err = vt_auto_create_analog_input_ctls(spec, cfg, 0x21, pin_idxs, | 5501 | err = vt_auto_create_analog_input_ctls(codec, cfg, 0x21, pin_idxs, |
5515 | ARRAY_SIZE(pin_idxs)); | 5502 | ARRAY_SIZE(pin_idxs)); |
5516 | if (err < 0) | 5503 | if (err < 0) |
5517 | return err; | 5504 | return err; |
@@ -5521,9 +5508,7 @@ static int vt2002P_auto_create_analog_input_ctls(struct via_spec *spec, | |||
5521 | return err; | 5508 | return err; |
5522 | 5509 | ||
5523 | /* for digital mic select */ | 5510 | /* for digital mic select */ |
5524 | strcpy(imux->items[imux->num_items].label, "Digital Mic"); | 5511 | snd_hda_add_imux_item(imux, "Digital Mic", 4, NULL); |
5525 | imux->items[imux->num_items].index = 4; | ||
5526 | imux->num_items++; | ||
5527 | 5512 | ||
5528 | return 0; | 5513 | return 0; |
5529 | } | 5514 | } |
@@ -5551,7 +5536,7 @@ static int vt2002P_parse_auto_config(struct hda_codec *codec) | |||
5551 | err = vt2002P_auto_create_hp_ctls(spec, spec->autocfg.hp_pins[0]); | 5536 | err = vt2002P_auto_create_hp_ctls(spec, spec->autocfg.hp_pins[0]); |
5552 | if (err < 0) | 5537 | if (err < 0) |
5553 | return err; | 5538 | return err; |
5554 | err = vt2002P_auto_create_analog_input_ctls(spec, &spec->autocfg); | 5539 | err = vt2002P_auto_create_analog_input_ctls(codec, &spec->autocfg); |
5555 | if (err < 0) | 5540 | if (err < 0) |
5556 | return err; | 5541 | return err; |
5557 | 5542 | ||
@@ -5826,14 +5811,15 @@ static int vt1812_auto_create_hp_ctls(struct via_spec *spec, hda_nid_t pin) | |||
5826 | } | 5811 | } |
5827 | 5812 | ||
5828 | /* create playback/capture controls for input pins */ | 5813 | /* create playback/capture controls for input pins */ |
5829 | static int vt1812_auto_create_analog_input_ctls(struct via_spec *spec, | 5814 | static int vt1812_auto_create_analog_input_ctls(struct hda_codec *codec, |
5830 | const struct auto_pin_cfg *cfg) | 5815 | const struct auto_pin_cfg *cfg) |
5831 | { | 5816 | { |
5817 | struct via_spec *spec = codec->spec; | ||
5832 | struct hda_input_mux *imux = &spec->private_imux[0]; | 5818 | struct hda_input_mux *imux = &spec->private_imux[0]; |
5833 | static hda_nid_t pin_idxs[] = { 0x2b, 0x2a, 0x29, 0, 0, 0xff }; | 5819 | static hda_nid_t pin_idxs[] = { 0x2b, 0x2a, 0x29, 0, 0, 0xff }; |
5834 | int err; | 5820 | int err; |
5835 | 5821 | ||
5836 | err = vt_auto_create_analog_input_ctls(spec, cfg, 0x21, pin_idxs, | 5822 | err = vt_auto_create_analog_input_ctls(codec, cfg, 0x21, pin_idxs, |
5837 | ARRAY_SIZE(pin_idxs)); | 5823 | ARRAY_SIZE(pin_idxs)); |
5838 | if (err < 0) | 5824 | if (err < 0) |
5839 | return err; | 5825 | return err; |
@@ -5844,9 +5830,7 @@ static int vt1812_auto_create_analog_input_ctls(struct via_spec *spec, | |||
5844 | return err; | 5830 | return err; |
5845 | 5831 | ||
5846 | /* for digital mic select */ | 5832 | /* for digital mic select */ |
5847 | strcpy(imux->items[imux->num_items].label, "Digital Mic"); | 5833 | snd_hda_add_imux_item(imux, "Digital Mic", 6, NULL); |
5848 | imux->items[imux->num_items].index = 6; | ||
5849 | imux->num_items++; | ||
5850 | 5834 | ||
5851 | return 0; | 5835 | return 0; |
5852 | } | 5836 | } |
@@ -5874,7 +5858,7 @@ static int vt1812_parse_auto_config(struct hda_codec *codec) | |||
5874 | err = vt1812_auto_create_hp_ctls(spec, spec->autocfg.hp_pins[0]); | 5858 | err = vt1812_auto_create_hp_ctls(spec, spec->autocfg.hp_pins[0]); |
5875 | if (err < 0) | 5859 | if (err < 0) |
5876 | return err; | 5860 | return err; |
5877 | err = vt1812_auto_create_analog_input_ctls(spec, &spec->autocfg); | 5861 | err = vt1812_auto_create_analog_input_ctls(codec, &spec->autocfg); |
5878 | if (err < 0) | 5862 | if (err < 0) |
5879 | return err; | 5863 | return err; |
5880 | 5864 | ||