aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-11-28 12:11:59 -0500
committerTakashi Iwai <tiwai@suse.de>2013-01-12 02:30:48 -0500
commit5ec16d12c896b6ea710ac74e68e2f431c80d1c62 (patch)
tree5bc2ac2a521e384af768b75ff751d4b09bedec2b /sound
parent7e35dd3d6b7eeeb46f8b82a552fefb7cce3f7580 (diff)
ALSA: hda - Rearrange INPUT_PIN_ATTR_*
Put INPUT_PIN_ATTR_FRONT after INPUT_PIN_ATTR_REAR, and define INPUT_PIN_ATTR_LAST to point to the last element. This is a preliminary work for cleaning up Realtek auto-mic parser. In the auto-mic implementation, the front panel is preferred over the rear panel. By arranging the attr definitions like in this commit, we can simply use sort() for figuring out the priority order. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_auto_parser.c2
-rw-r--r--sound/pci/hda/hda_auto_parser.h3
-rw-r--r--sound/pci/hda/patch_via.c2
3 files changed, 4 insertions, 3 deletions
diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c
index d4606884f6a3..44c81d34544d 100644
--- a/sound/pci/hda/hda_auto_parser.c
+++ b/sound/pci/hda/hda_auto_parser.c
@@ -363,7 +363,7 @@ static const char *hda_get_input_pin_label(struct hda_codec *codec,
363{ 363{
364 unsigned int def_conf; 364 unsigned int def_conf;
365 static const char * const mic_names[] = { 365 static const char * const mic_names[] = {
366 "Internal Mic", "Dock Mic", "Mic", "Front Mic", "Rear Mic", 366 "Internal Mic", "Dock Mic", "Mic", "Rear Mic", "Front Mic"
367 }; 367 };
368 int attr; 368 int attr;
369 369
diff --git a/sound/pci/hda/hda_auto_parser.h b/sound/pci/hda/hda_auto_parser.h
index ff11074b6c8b..f74807138b49 100644
--- a/sound/pci/hda/hda_auto_parser.h
+++ b/sound/pci/hda/hda_auto_parser.h
@@ -51,8 +51,9 @@ enum {
51 INPUT_PIN_ATTR_INT, /* internal mic/line-in */ 51 INPUT_PIN_ATTR_INT, /* internal mic/line-in */
52 INPUT_PIN_ATTR_DOCK, /* docking mic/line-in */ 52 INPUT_PIN_ATTR_DOCK, /* docking mic/line-in */
53 INPUT_PIN_ATTR_NORMAL, /* mic/line-in jack */ 53 INPUT_PIN_ATTR_NORMAL, /* mic/line-in jack */
54 INPUT_PIN_ATTR_FRONT, /* mic/line-in jack in front */
55 INPUT_PIN_ATTR_REAR, /* mic/line-in jack in rear */ 54 INPUT_PIN_ATTR_REAR, /* mic/line-in jack in rear */
55 INPUT_PIN_ATTR_FRONT, /* mic/line-in jack in front */
56 INPUT_PIN_ATTR_LAST = INPUT_PIN_ATTR_FRONT,
56}; 57};
57 58
58int snd_hda_get_input_pin_attr(unsigned int def_conf); 59int snd_hda_get_input_pin_attr(unsigned int def_conf);
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index b224b3d68184..d3c852ab105e 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -1913,7 +1913,7 @@ static void mangle_smart51(struct hda_codec *codec)
1913 int i, j, nums, attr; 1913 int i, j, nums, attr;
1914 int pins[AUTO_CFG_MAX_INS]; 1914 int pins[AUTO_CFG_MAX_INS];
1915 1915
1916 for (attr = INPUT_PIN_ATTR_REAR; attr >= INPUT_PIN_ATTR_NORMAL; attr--) { 1916 for (attr = INPUT_PIN_ATTR_LAST; attr >= INPUT_PIN_ATTR_NORMAL; attr--) {
1917 nums = 0; 1917 nums = 0;
1918 for (i = 0; i < cfg->num_inputs; i++) { 1918 for (i = 0; i < cfg->num_inputs; i++) {
1919 unsigned int def; 1919 unsigned int def;