val = alc_pin_mode_min(dir);
 
        change = pinctl != alc_pin_mode_values[val];
-       if (change)
+       if (change) {
+               /* Set pin mode to that requested */
                snd_hda_codec_write(codec,nid,0,AC_VERB_SET_PIN_WIDGET_CONTROL,
                        alc_pin_mode_values[val]);
+
+               /* Also enable the retasking pin's input/output as required 
+                * for the requested pin mode.  Enum values of 2 or less are
+                * input modes.
+                *
+                * Dynamically switching the input/output buffers probably
+                * reduces noise slightly, particularly on input.  However,
+                * havingboth input and output buffers enabled
+                * simultaneously doesn't seem to be problematic.
+                */
+               if (val <= 2) {
+                       snd_hda_codec_write(codec,nid,0,AC_VERB_SET_AMP_GAIN_MUTE,
+                               AMP_OUT_MUTE);
+                       snd_hda_codec_write(codec,nid,0,AC_VERB_SET_AMP_GAIN_MUTE,
+                               AMP_IN_UNMUTE(0));
+               } else {
+                       snd_hda_codec_write(codec,nid,0,AC_VERB_SET_AMP_GAIN_MUTE,
+                               AMP_IN_MUTE(0));
+                       snd_hda_codec_write(codec,nid,0,AC_VERB_SET_AMP_GAIN_MUTE,
+                               AMP_OUT_UNMUTE);
+               }
+       }
        return change;
 }
 
 
         /* Unmute HP pin widget amp left and right (no equiv mixer ctrl) */
         {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
-        /* Unmute Line1 pin widget amp left and right (no equiv mixer ctrl) */
+        /* Unmute Line1 pin widget output buffer since it starts as an output.
+         * If the pin mode is changed by the user the pin mode control will
+         * take care of enabling the pin's input/output buffers as needed.
+         * Therefore there's no need to enable the input buffer at this
+         * stage.
+        */
         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
-        /* Unmute Line1 pin widget input for when this pin is used as input
-         * (no equiv mixer ctrl).  Having input and output unmuted doesn't
-         * seem to cause a problem.
-         */
-        {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
-       /* Unmute pin widget used for Line-in (no equiv mixer ctrl) */
+       /* Unmute input buffer of pin widget used for Line-in (no equiv 
+        * mixer ctrl)
+        */
         {0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
 
         /* Mute capture amp left and right */
        {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
        {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
 
-       /* Unmute retasking pin widget output amp left/right (no mixer ctrl) */
+       /* Unmute retasking pin widget output buffers since the default
+        * state appears to be output.  As the pin mode is changed by the
+        * user the pin mode control will take care of enabling the pin's
+        * input/output buffers as needed.
+        */
        {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
        {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
        {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
        /* Also unmute the mono-out pin widget */
        {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
 
-       /* Also unmute the retasking pin input amps.  Having the input and
-        * output amps unmuted at the same time doesn't appear to cause any
-        * trouble.
-        */
-       {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
-       {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
-       {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
-       {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
-       {0x13, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
-       {0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
-
        /* Mute capture amp left and right */
        {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
        /* Set ADC connection select to match default mixer setting - line