[alsa-devel] [PATCH] hda: 92HD7XXX power management support

Takashi Iwai tiwai at suse.de
Wed Jan 9 18:02:16 CET 2008


At Wed, 09 Jan 2008 11:41:00 -0500,
Matthew Ranostay wrote:
> 
> @@ -714,6 +728,8 @@ static struct snd_kcontrol_new stac92hd7
>  
>  	HDA_CODEC_MUTE("Analog Loopback 1", 0x17, 0x3, HDA_INPUT),
>  	HDA_CODEC_MUTE("Analog Loopback 2", 0x17, 0x4, HDA_INPUT),
> +
> +	HDA_CODEC_MUTE_MONO("Mono Switch", 0x14, 0x1, 0, HDA_INPUT),
>  	{ } /* end */
>  };
>  
> @@ -728,6 +744,8 @@ static struct snd_kcontrol_new stac92hd7
>  	HDA_CODEC_VOLUME_IDX("Capture Volume", 0x1, 0x1d, 0x0, HDA_OUTPUT),
>  	HDA_CODEC_MUTE_IDX("Capture Switch", 0x1, 0x1d, 0x0, HDA_OUTPUT),
>  	HDA_CODEC_VOLUME_IDX("Capture Mux Volume", 0x1, 0x1b, 0x0, HDA_OUTPUT),
> +
> +	HDA_CODEC_MUTE_MONO("Mono Switch", 0x14, 0x1, 0, HDA_INPUT),
>  	{ } /* end */
>  };

These have been already applied to HG tree.  Please update your repo
(maybe better from hg.alsa-project.org).


> @@ -2651,11 +2669,26 @@ static void enable_pin_detect(struct hda
>  static void enable_pin_detect(struct hda_codec *codec, hda_nid_t nid,
>  			      unsigned int event)
>  {
> +	int pinctl = snd_hda_codec_read(codec, nid, 0,
> +					AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
> +	if (pinctl & AC_PINCTL_IN_EN)
> +		return;
> +

Hm, what about the multi-directional pins (such as line-in/surround
shared pin)?  Maybe it's not for 92HDxxx codecs, but...


> @@ -2696,6 +2729,14 @@ static int stac92xx_init(struct hda_code
>  		for (i = 0; i < spec->num_dmics; i++)
>  			stac92xx_auto_set_pinctl(codec, spec->dmic_nids[i],
>  						 AC_PINCTL_IN_EN);
> +	if (spec->num_pwrs > 0) {

This if is unnecessary.

> @@ -3076,6 +3144,9 @@ again:
>  	spec->gpio_mask = spec->gpio_data = 0x000001;
>  	stac92xx_enable_gpio_mask(codec);
>  
> +	spec->num_pwrs = 8;
Better to use ARRAY_SIZE().

> +	spec->pwr_nids = stac92hd73xx_pwr_nids;
> +
>  	err = stac92xx_parse_auto_config(codec, 0x22, 0x24);
>  
>  	if (!err) {
> @@ -3157,6 +3228,9 @@ again:
>  	spec->num_adcs = ARRAY_SIZE(stac92hd71bxx_adc_nids);
>  	spec->num_dmics = STAC92HD71BXX_NUM_DMICS;
>  	spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids);
> +
> +	spec->num_pwrs = 3;

Ditto.


Thanks,

Takashi


More information about the Alsa-devel mailing list