aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-01-15 11:13:31 -0500
committerTakashi Iwai <tiwai@suse.de>2013-01-15 11:13:31 -0500
commita0c041cb6f74f9734d9a3af1061a718b3879a255 (patch)
treeaa632ac5030fc65ca27137cdce77c0b3e21f651f /sound/pci
parent15e4ba666ca6c2fcc00184cef56fb971a20e8e04 (diff)
ALSA: hda/ca0132 - Use snd_hda_set_pin_ctl() helper again
The recent update of ca0132 driver replaced the pinctl setup to the direct write via snd_hda_codec_write() again. This should be covered by snd_hda_set_pin_ctl() to be safer. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_ca0132.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
index 0d2c2f83ca7d..467c9a18819b 100644
--- a/sound/pci/hda/patch_ca0132.c
+++ b/sound/pci/hda/patch_ca0132.c
@@ -3158,15 +3158,13 @@ static int ca0132_select_out(struct hda_codec *codec)
3158 /* disable headphone node */ 3158 /* disable headphone node */
3159 pin_ctl = snd_hda_codec_read(codec, spec->out_pins[1], 0, 3159 pin_ctl = snd_hda_codec_read(codec, spec->out_pins[1], 0,
3160 AC_VERB_GET_PIN_WIDGET_CONTROL, 0); 3160 AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
3161 snd_hda_codec_write(codec, spec->out_pins[1], 0, 3161 snd_hda_set_pin_ctl(codec, spec->out_pins[1],
3162 AC_VERB_SET_PIN_WIDGET_CONTROL, 3162 pin_ctl & ~PIN_HP);
3163 pin_ctl & 0xBF);
3164 /* enable speaker node */ 3163 /* enable speaker node */
3165 pin_ctl = snd_hda_codec_read(codec, spec->out_pins[0], 0, 3164 pin_ctl = snd_hda_codec_read(codec, spec->out_pins[0], 0,
3166 AC_VERB_GET_PIN_WIDGET_CONTROL, 0); 3165 AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
3167 snd_hda_codec_write(codec, spec->out_pins[0], 0, 3166 snd_hda_set_pin_ctl(codec, spec->out_pins[0],
3168 AC_VERB_SET_PIN_WIDGET_CONTROL, 3167 pin_ctl | PIN_OUT);
3169 pin_ctl | 0x40);
3170 } else { 3168 } else {
3171 snd_printdd(KERN_INFO "ca0132_select_out hp\n"); 3169 snd_printdd(KERN_INFO "ca0132_select_out hp\n");
3172 /*headphone out config*/ 3170 /*headphone out config*/
@@ -3193,15 +3191,13 @@ static int ca0132_select_out(struct hda_codec *codec)
3193 /* disable speaker*/ 3191 /* disable speaker*/
3194 pin_ctl = snd_hda_codec_read(codec, spec->out_pins[0], 0, 3192 pin_ctl = snd_hda_codec_read(codec, spec->out_pins[0], 0,
3195 AC_VERB_GET_PIN_WIDGET_CONTROL, 0); 3193 AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
3196 snd_hda_codec_write(codec, spec->out_pins[0], 0, 3194 snd_hda_set_pin_ctl(codec, spec->out_pins[0],
3197 AC_VERB_SET_PIN_WIDGET_CONTROL, 3195 pin_ctl & ~PIN_HP);
3198 pin_ctl & 0xBF);
3199 /* enable headphone*/ 3196 /* enable headphone*/
3200 pin_ctl = snd_hda_codec_read(codec, spec->out_pins[1], 0, 3197 pin_ctl = snd_hda_codec_read(codec, spec->out_pins[1], 0,
3201 AC_VERB_GET_PIN_WIDGET_CONTROL, 0); 3198 AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
3202 snd_hda_codec_write(codec, spec->out_pins[1], 0, 3199 snd_hda_set_pin_ctl(codec, spec->out_pins[1],
3203 AC_VERB_SET_PIN_WIDGET_CONTROL, 3200 pin_ctl | PIN_HP);
3204 pin_ctl | 0x40);
3205 } 3201 }
3206 3202
3207exit: 3203exit:
@@ -4065,8 +4061,7 @@ static int ca0132_build_pcms(struct hda_codec *codec)
4065static void init_output(struct hda_codec *codec, hda_nid_t pin, hda_nid_t dac) 4061static void init_output(struct hda_codec *codec, hda_nid_t pin, hda_nid_t dac)
4066{ 4062{
4067 if (pin) { 4063 if (pin) {
4068 snd_hda_codec_write(codec, pin, 0, 4064 snd_hda_set_pin_ctl(codec, pin, PIN_HP);
4069 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
4070 if (get_wcaps(codec, pin) & AC_WCAP_OUT_AMP) 4065 if (get_wcaps(codec, pin) & AC_WCAP_OUT_AMP)
4071 snd_hda_codec_write(codec, pin, 0, 4066 snd_hda_codec_write(codec, pin, 0,
4072 AC_VERB_SET_AMP_GAIN_MUTE, 4067 AC_VERB_SET_AMP_GAIN_MUTE,
@@ -4080,8 +4075,7 @@ static void init_output(struct hda_codec *codec, hda_nid_t pin, hda_nid_t dac)
4080static void init_input(struct hda_codec *codec, hda_nid_t pin, hda_nid_t adc) 4075static void init_input(struct hda_codec *codec, hda_nid_t pin, hda_nid_t adc)
4081{ 4076{
4082 if (pin) { 4077 if (pin) {
4083 snd_hda_codec_write(codec, pin, 0, 4078 snd_hda_set_pin_ctl(codec, pin, PIN_VREF80);
4084 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80);
4085 if (get_wcaps(codec, pin) & AC_WCAP_IN_AMP) 4079 if (get_wcaps(codec, pin) & AC_WCAP_IN_AMP)
4086 snd_hda_codec_write(codec, pin, 0, 4080 snd_hda_codec_write(codec, pin, 0,
4087 AC_VERB_SET_AMP_GAIN_MUTE, 4081 AC_VERB_SET_AMP_GAIN_MUTE,