From: David Henningsson Date: Tue, 5 Feb 2013 11:06:02 +0000 (+0100) Subject: ALSA: hda - Fix phantom jacks on VT1708 X-Git-Tag: upstream/snapshot3+hdmi~5621^2~52 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f672f65a1c15b04e09d25701a8b5be47bad9376a;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git ALSA: hda - Fix phantom jacks on VT1708 The VT1708 has no unsol event capability, and polling is set using the "Jack Detect" alsamixer control. In order not to create phantom Jack controls, temporary enable jackpoll during build_controls. Signed-off-by: David Henningsson Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 9641c0e..e934c49 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c @@ -661,6 +661,18 @@ static int via_init(struct hda_codec *codec) return 0; } +static int vt1708_build_controls(struct hda_codec *codec) +{ + /* In order not to create "Phantom Jack" controls, + temporary enable jackpoll */ + int err; + int old_interval = codec->jackpoll_interval; + codec->jackpoll_interval = msecs_to_jiffies(100); + err = via_build_controls(codec); + codec->jackpoll_interval = old_interval; + return err; +} + static int vt1708_build_pcms(struct hda_codec *codec) { struct via_spec *spec = codec->spec; @@ -723,6 +735,7 @@ static int patch_vt1708(struct hda_codec *codec) spec->init_verbs[spec->num_iverbs++] = vt1708_init_verbs; codec->patch_ops = via_patch_ops; + codec->patch_ops.build_controls = vt1708_build_controls; codec->patch_ops.build_pcms = vt1708_build_pcms; /* clear jackpoll_interval again; it's set dynamically */