aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-01-07 12:22:49 -0500
committerTakashi Iwai <tiwai@suse.de>2014-01-08 03:57:41 -0500
commit58c57cfa0d0a2ff9191bf6210666ce81e1b2f6c2 (patch)
treeb041776aa047198416407a7165e9159687bd3a76 /sound/pci/hda
parent929559be6d2c494e25bb58b730da4a78c1459e7b (diff)
ALSA: hda - Minor code optimization for patch_realtek.c
No functional change. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r--sound/pci/hda/patch_realtek.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 6a705a81de35..74b496b0d179 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -469,9 +469,7 @@ static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
469 * 7 ~ 0 : Assembly ID 469 * 7 ~ 0 : Assembly ID
470 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36 470 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
471 */ 471 */
472static int alc_subsystem_id(struct hda_codec *codec, 472static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
473 hda_nid_t porta, hda_nid_t porte,
474 hda_nid_t portd, hda_nid_t porti)
475{ 473{
476 unsigned int ass, tmp, i; 474 unsigned int ass, tmp, i;
477 unsigned nid; 475 unsigned nid;
@@ -561,14 +559,7 @@ do_sku:
561 spec->gen.autocfg.line_out_type == AUTO_PIN_HP_OUT)) { 559 spec->gen.autocfg.line_out_type == AUTO_PIN_HP_OUT)) {
562 hda_nid_t nid; 560 hda_nid_t nid;
563 tmp = (ass >> 11) & 0x3; /* HP to chassis */ 561 tmp = (ass >> 11) & 0x3; /* HP to chassis */
564 if (tmp == 0) 562 nid = ports[tmp];
565 nid = porta;
566 else if (tmp == 1)
567 nid = porte;
568 else if (tmp == 2)
569 nid = portd;
570 else if (tmp == 3)
571 nid = porti;
572 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins, 563 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
573 spec->gen.autocfg.line_outs)) 564 spec->gen.autocfg.line_outs))
574 return 1; 565 return 1;
@@ -581,7 +572,7 @@ do_sku:
581 * ports contains an array of 4 pin NIDs for port-A, E, D and I */ 572 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
582static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports) 573static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
583{ 574{
584 if (!alc_subsystem_id(codec, ports[0], ports[1], ports[2], ports[3])) { 575 if (!alc_subsystem_id(codec, ports)) {
585 struct alc_spec *spec = codec->spec; 576 struct alc_spec *spec = codec->spec;
586 snd_printd("realtek: " 577 snd_printd("realtek: "
587 "Enable default setup for auto mode as fallback\n"); 578 "Enable default setup for auto mode as fallback\n");