aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_sigmatel.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-10-27 18:03:22 -0400
committerTakashi Iwai <tiwai@suse.de>2011-11-16 05:12:17 -0500
commit01a61e12b4602c82bde9797d0e153f3e53c95b04 (patch)
tree04f817cb8cec2bae3edcc9a873aea1b674b146ad /sound/pci/hda/patch_sigmatel.c
parent1835a0f9a2121ce3198dab67507d4d3e960cc09e (diff)
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 <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r--sound/pci/hda/patch_sigmatel.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 97c6df9db5e9..90954b8269c3 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)
1212 return err; 1212 return err;
1213 } 1213 }
1214 1214
1215 err = snd_hda_jack_add_kctls(codec, &spec->autocfg);
1216 if (err < 0)
1217 return err;
1218
1215 return 0; 1219 return 0;
1216} 1220}
1217 1221
@@ -4473,6 +4477,8 @@ static int stac92xx_init(struct hda_codec *codec)
4473 stac_toggle_power_map(codec, nid, 0); 4477 stac_toggle_power_map(codec, nid, 0);
4474 } 4478 }
4475 4479
4480 snd_hda_jack_report_sync(codec);
4481
4476 /* sync mute LED */ 4482 /* sync mute LED */
4477 if (spec->gpio_led) 4483 if (spec->gpio_led)
4478 hda_call_check_power_status(codec, 0x01); 4484 hda_call_check_power_status(codec, 0x01);
@@ -4868,6 +4874,7 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res)
4868 return; 4874 return;
4869 snd_hda_jack_set_dirty(codec, event->nid); 4875 snd_hda_jack_set_dirty(codec, event->nid);
4870 handle_unsol_event(codec, event); 4876 handle_unsol_event(codec, event);
4877 snd_hda_jack_report_sync(codec);
4871} 4878}
4872 4879
4873static int hp_blike_system(u32 subsystem_id); 4880static int hp_blike_system(u32 subsystem_id);