]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ALSA: hda - Rearrange INPUT_PIN_ATTR_*
authorTakashi Iwai <tiwai@suse.de>
Wed, 28 Nov 2012 17:11:59 +0000 (18:11 +0100)
committerTakashi Iwai <tiwai@suse.de>
Sat, 12 Jan 2013 07:30:48 +0000 (08:30 +0100)
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>
sound/pci/hda/hda_auto_parser.c
sound/pci/hda/hda_auto_parser.h
sound/pci/hda/patch_via.c

index d4606884f6a3aef3253ac3b0d26d30ef04088ee0..44c81d34544d503169625f54acfa99fe3dcc0ae9 100644 (file)
@@ -363,7 +363,7 @@ static const char *hda_get_input_pin_label(struct hda_codec *codec,
 {
        unsigned int def_conf;
        static const char * const mic_names[] = {
-               "Internal Mic", "Dock Mic", "Mic", "Front Mic", "Rear Mic",
+               "Internal Mic", "Dock Mic", "Mic", "Rear Mic", "Front Mic"
        };
        int attr;
 
index ff11074b6c8b6a1f2a00bd2376b051c6775ca2cb..f74807138b49d4d2dab7c90bdb540eaa1c9a4817 100644 (file)
@@ -51,8 +51,9 @@ enum {
        INPUT_PIN_ATTR_INT,     /* internal mic/line-in */
        INPUT_PIN_ATTR_DOCK,    /* docking mic/line-in */
        INPUT_PIN_ATTR_NORMAL,  /* mic/line-in jack */
-       INPUT_PIN_ATTR_FRONT,   /* mic/line-in jack in front */
        INPUT_PIN_ATTR_REAR,    /* mic/line-in jack in rear */
+       INPUT_PIN_ATTR_FRONT,   /* mic/line-in jack in front */
+       INPUT_PIN_ATTR_LAST = INPUT_PIN_ATTR_FRONT,
 };
 
 int snd_hda_get_input_pin_attr(unsigned int def_conf);
index b224b3d68184e5fca58314050dba7307a7037557..d3c852ab105e10cf4b6092dec32ece86a44bdb57 100644 (file)
@@ -1913,7 +1913,7 @@ static void mangle_smart51(struct hda_codec *codec)
        int i, j, nums, attr;
        int pins[AUTO_CFG_MAX_INS];
 
-       for (attr = INPUT_PIN_ATTR_REAR; attr >= INPUT_PIN_ATTR_NORMAL; attr--) {
+       for (attr = INPUT_PIN_ATTR_LAST; attr >= INPUT_PIN_ATTR_NORMAL; attr--) {
                nums = 0;
                for (i = 0; i < cfg->num_inputs; i++) {
                        unsigned int def;