All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add VREF powerdown sequence for another board
@ 2009-04-06 13:30 Matthew Ranostay
  2009-04-07  2:44 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Matthew Ranostay @ 2009-04-06 13:30 UTC (permalink / raw)
  To: alsa-devel; +Cc: Takashi Iwai

Add powerdown sequence for VREF using a shared jack when the headphone is present and
the microphone isn't on.

Signed-off-by: Matthew Ranostay <mranostay@embeddedalley.com>
---
 sound/pci/hda/patch_sigmatel.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index b5e108a..a6fc257 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -4413,6 +4413,22 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res)
 		if (spec->num_pwrs > 0)
 			stac92xx_pin_sense(codec, event->nid);
 		stac92xx_report_jack(codec, event->nid);
+
+		switch (codec->subsystem_id) {
+		case 0x103c308f:
+			if (event->nid == 0xb) {
+				int pin = AC_PINCTL_IN_EN;
+
+				if (get_pin_presence(codec, 0xa)
+						&& get_pin_presence(codec, 0xb))
+					pin |= AC_PINCTL_VREF_80;
+				if (!get_pin_presence(codec, 0xb))
+					pin |= AC_PINCTL_VREF_80;
+
+				/* toggle VREF state based on mic + hp pin status */
+				stac92xx_auto_set_pinctl(codec, 0x0a, pin);
+			}
+		}
 		break;
 	case STAC_VREF_EVENT:
 		data = snd_hda_codec_read(codec, codec->afg, 0,
-- 
1.5.6.3

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

* Re: [PATCH] Add VREF powerdown sequence for another board
  2009-04-06 13:30 [PATCH] Add VREF powerdown sequence for another board Matthew Ranostay
@ 2009-04-07  2:44 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2009-04-07  2:44 UTC (permalink / raw)
  To: Matthew Ranostay; +Cc: alsa-devel

At Mon, 06 Apr 2009 09:30:46 -0400,
Matthew Ranostay wrote:
> 
> Add powerdown sequence for VREF using a shared jack when the headphone is present and
> the microphone isn't on.
> 
> Signed-off-by: Matthew Ranostay <mranostay@embeddedalley.com>

Applied now.  Thanks.

Takashi

> ---
>  sound/pci/hda/patch_sigmatel.c |   16 ++++++++++++++++
>  1 files changed, 16 insertions(+), 0 deletions(-)
> 
> diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
> index b5e108a..a6fc257 100644
> --- a/sound/pci/hda/patch_sigmatel.c
> +++ b/sound/pci/hda/patch_sigmatel.c
> @@ -4413,6 +4413,22 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res)
>  		if (spec->num_pwrs > 0)
>  			stac92xx_pin_sense(codec, event->nid);
>  		stac92xx_report_jack(codec, event->nid);
> +
> +		switch (codec->subsystem_id) {
> +		case 0x103c308f:
> +			if (event->nid == 0xb) {
> +				int pin = AC_PINCTL_IN_EN;
> +
> +				if (get_pin_presence(codec, 0xa)
> +						&& get_pin_presence(codec, 0xb))
> +					pin |= AC_PINCTL_VREF_80;
> +				if (!get_pin_presence(codec, 0xb))
> +					pin |= AC_PINCTL_VREF_80;
> +
> +				/* toggle VREF state based on mic + hp pin status */
> +				stac92xx_auto_set_pinctl(codec, 0x0a, pin);
> +			}
> +		}
>  		break;
>  	case STAC_VREF_EVENT:
>  		data = snd_hda_codec_read(codec, codec->afg, 0,
> -- 
> 1.5.6.3
> 

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

end of thread, other threads:[~2009-04-07  2:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-06 13:30 [PATCH] Add VREF powerdown sequence for another board Matthew Ranostay
2009-04-07  2:44 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.