alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ALSA: hda - Fix phantom jacks on VT1708
@ 2013-02-05 11:02 David Henningsson
  0 siblings, 0 replies; 4+ messages in thread
From: David Henningsson @ 2013-02-05 11:02 UTC (permalink / raw)
  To: alsa-devel, tiwai; +Cc: David Henningsson

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 <david.henningsson@canonical.com>
---
 sound/pci/hda/patch_via.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index 9641c0e..d46c448 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -661,6 +661,17 @@ 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 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 +734,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 */
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 1/2] ALSA: hda - Fix phantom jacks on VT1708
@ 2013-02-05 11:06 David Henningsson
  2013-02-05 11:06 ` [PATCH 2/2] ALSA: hda - detect jacks on VT1708 even when no streams are active David Henningsson
  2013-02-05 11:27 ` [PATCH 1/2] ALSA: hda - Fix phantom jacks on VT1708 Takashi Iwai
  0 siblings, 2 replies; 4+ messages in thread
From: David Henningsson @ 2013-02-05 11:06 UTC (permalink / raw)
  To: tiwai, alsa-devel; +Cc: David Henningsson

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 <david.henningsson@canonical.com>
---
 sound/pci/hda/patch_via.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

Sorry, the previous version of this patch the "int err" got lost.

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 */
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] ALSA: hda - detect jacks on VT1708 even when no streams are active
  2013-02-05 11:06 [PATCH 1/2] ALSA: hda - Fix phantom jacks on VT1708 David Henningsson
@ 2013-02-05 11:06 ` David Henningsson
  2013-02-05 11:27 ` [PATCH 1/2] ALSA: hda - Fix phantom jacks on VT1708 Takashi Iwai
  1 sibling, 0 replies; 4+ messages in thread
From: David Henningsson @ 2013-02-05 11:06 UTC (permalink / raw)
  To: tiwai, alsa-devel; +Cc: David Henningsson

These days, GUIs such as Gnome sound settings want to be able to
show the correct jack status even when no streams are currently
running. I doubt this gives any measurable difference in power,
but if it does, the "Jack Detect" control can still be used to
turn polling off.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
---
 sound/pci/hda/patch_via.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index e934c49..ca7d962 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -217,8 +217,7 @@ static void vt1708_update_hp_work(struct hda_codec *codec)
 	struct via_spec *spec = codec->spec;
 	if (spec->codec_type != VT1708 || !spec->gen.autocfg.hp_outs)
 		return;
-	if (spec->vt1708_jack_detect &&
-	    (spec->gen.active_streams || hp_detect_with_aa(codec))) {
+	if (spec->vt1708_jack_detect) {
 		if (!spec->hp_work_active) {
 			codec->jackpoll_interval = msecs_to_jiffies(100);
 			snd_hda_codec_write(codec, 0x1, 0, 0xf81, 0);
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] ALSA: hda - Fix phantom jacks on VT1708
  2013-02-05 11:06 [PATCH 1/2] ALSA: hda - Fix phantom jacks on VT1708 David Henningsson
  2013-02-05 11:06 ` [PATCH 2/2] ALSA: hda - detect jacks on VT1708 even when no streams are active David Henningsson
@ 2013-02-05 11:27 ` Takashi Iwai
  1 sibling, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2013-02-05 11:27 UTC (permalink / raw)
  To: David Henningsson; +Cc: alsa-devel

At Tue,  5 Feb 2013 12:06:02 +0100,
David Henningsson wrote:
> 
> 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 <david.henningsson@canonical.com>

Applied both now.  Thanks.


Takashi

> ---
>  sound/pci/hda/patch_via.c |   13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> Sorry, the previous version of this patch the "int err" got lost.
> 
> 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 */
> -- 
> 1.7.9.5
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-02-05 11:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-05 11:06 [PATCH 1/2] ALSA: hda - Fix phantom jacks on VT1708 David Henningsson
2013-02-05 11:06 ` [PATCH 2/2] ALSA: hda - detect jacks on VT1708 even when no streams are active David Henningsson
2013-02-05 11:27 ` [PATCH 1/2] ALSA: hda - Fix phantom jacks on VT1708 Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2013-02-05 11:02 David Henningsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).