From 01a61e12b4602c82bde9797d0e153f3e53c95b04 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 28 Oct 2011 00:03:22 +0200 Subject: ALSA: hda - Create jack-detection kcontrols Create kcontrols for pin jack-detections, which work similarly like jack-input layer. Each control will notify when the jack is plugged or unplugged, and also user can read the value at any time via the normal control API. The control elements are created with iface=CARD, so that they won't appear in the mixer apps. So far, only the pins that enabled the jack-detection are registered. For covering all pins, the transition of the common unsol-tag handling would be needed. Stay tuned. Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_sigmatel.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sound/pci/hda/patch_sigmatel.c') diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 97c6df9db5e..90954b8269c 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -1212,6 +1212,10 @@ static int stac92xx_build_controls(struct hda_codec *codec) return err; } + err = snd_hda_jack_add_kctls(codec, &spec->autocfg); + if (err < 0) + return err; + return 0; } @@ -4473,6 +4477,8 @@ static int stac92xx_init(struct hda_codec *codec) stac_toggle_power_map(codec, nid, 0); } + snd_hda_jack_report_sync(codec); + /* sync mute LED */ if (spec->gpio_led) hda_call_check_power_status(codec, 0x01); @@ -4868,6 +4874,7 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res) return; snd_hda_jack_set_dirty(codec, event->nid); handle_unsol_event(codec, event); + snd_hda_jack_report_sync(codec); } static int hp_blike_system(u32 subsystem_id); -- cgit v1.2.3