diff options
-rw-r--r-- | sound/pci/Kconfig | 1 | ||||
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 14 |
2 files changed, 14 insertions, 1 deletions
diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig index 7003711f4fc..7e408908b75 100644 --- a/sound/pci/Kconfig +++ b/sound/pci/Kconfig | |||
@@ -501,6 +501,7 @@ config SND_HDA_INTEL | |||
501 | tristate "Intel HD Audio" | 501 | tristate "Intel HD Audio" |
502 | select SND_PCM | 502 | select SND_PCM |
503 | select SND_VMASTER | 503 | select SND_VMASTER |
504 | select SND_JACK if INPUT=y || INPUT=SND | ||
504 | help | 505 | help |
505 | Say Y here to include support for Intel "High Definition | 506 | Say Y here to include support for Intel "High Definition |
506 | Audio" (Azalia) motherboard devices. | 507 | Audio" (Azalia) motherboard devices. |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index a2ac7205d45..ec88ba88148 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/pci.h> | 30 | #include <linux/pci.h> |
31 | #include <sound/core.h> | 31 | #include <sound/core.h> |
32 | #include <sound/asoundef.h> | 32 | #include <sound/asoundef.h> |
33 | #include <sound/jack.h> | ||
33 | #include "hda_codec.h" | 34 | #include "hda_codec.h" |
34 | #include "hda_local.h" | 35 | #include "hda_local.h" |
35 | #include "hda_patch.h" | 36 | #include "hda_patch.h" |
@@ -216,6 +217,9 @@ struct sigmatel_spec { | |||
216 | 217 | ||
217 | struct hda_pcm pcm_rec[2]; /* PCM information */ | 218 | struct hda_pcm pcm_rec[2]; /* PCM information */ |
218 | 219 | ||
220 | /* jack detection */ | ||
221 | struct snd_jack *jack; | ||
222 | |||
219 | /* dynamic controls and input_mux */ | 223 | /* dynamic controls and input_mux */ |
220 | struct auto_pin_cfg autocfg; | 224 | struct auto_pin_cfg autocfg; |
221 | unsigned int num_kctl_alloc, num_kctl_used; | 225 | unsigned int num_kctl_alloc, num_kctl_used; |
@@ -3617,7 +3621,7 @@ static int stac92xx_init(struct hda_codec *codec) | |||
3617 | { | 3621 | { |
3618 | struct sigmatel_spec *spec = codec->spec; | 3622 | struct sigmatel_spec *spec = codec->spec; |
3619 | struct auto_pin_cfg *cfg = &spec->autocfg; | 3623 | struct auto_pin_cfg *cfg = &spec->autocfg; |
3620 | int i; | 3624 | int i, err; |
3621 | 3625 | ||
3622 | snd_hda_sequence_write(codec, spec->init); | 3626 | snd_hda_sequence_write(codec, spec->init); |
3623 | 3627 | ||
@@ -3639,6 +3643,12 @@ static int stac92xx_init(struct hda_codec *codec) | |||
3639 | stac92xx_auto_set_pinctl(codec, spec->autocfg.line_out_pins[0], | 3643 | stac92xx_auto_set_pinctl(codec, spec->autocfg.line_out_pins[0], |
3640 | AC_PINCTL_OUT_EN); | 3644 | AC_PINCTL_OUT_EN); |
3641 | stac92xx_auto_init_hp_out(codec); | 3645 | stac92xx_auto_init_hp_out(codec); |
3646 | /* jack detection */ | ||
3647 | err = snd_jack_new(codec->bus->card, | ||
3648 | "Headphone Jack", | ||
3649 | SND_JACK_HEADPHONE, &spec->jack); | ||
3650 | if (err < 0) | ||
3651 | return err; | ||
3642 | /* fake event to set up pins */ | 3652 | /* fake event to set up pins */ |
3643 | codec->patch_ops.unsol_event(codec, STAC_HP_EVENT << 26); | 3653 | codec->patch_ops.unsol_event(codec, STAC_HP_EVENT << 26); |
3644 | } else { | 3654 | } else { |
@@ -3796,6 +3806,8 @@ static void stac92xx_hp_detect(struct hda_codec *codec, unsigned int res) | |||
3796 | break; | 3806 | break; |
3797 | presence = get_hp_pin_presence(codec, cfg->hp_pins[i]); | 3807 | presence = get_hp_pin_presence(codec, cfg->hp_pins[i]); |
3798 | } | 3808 | } |
3809 | snd_jack_report(spec->jack, | ||
3810 | presence ? SND_JACK_HEADPHONE : 0); | ||
3799 | 3811 | ||
3800 | if (presence) { | 3812 | if (presence) { |
3801 | /* disable lineouts, enable hp */ | 3813 | /* disable lineouts, enable hp */ |