[alsa-devel] [PATCH] hda: 92HD7XXX power management support
Matthew Ranostay
mranostay at embeddedalley.com
Thu Jan 10 16:33:26 CET 2008
Takashi Iwai wrote:
> 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).
>
>
>
D'oh, forgot to do 'hg update' again :/
>> @@ -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;
>> +
>>
>
>
Moved this block is a more reasonable spot.
> Hm, what about the multi-directional pins (such as line-in/surround
> shared pin)? Maybe it's not for 92HDxxx codecs, but...
>
>
Comments in the patch should explain this.
>
>> @@ -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.
>
>
Cleaned this up, and removed the unneeded DMIC block check above it.
>> @@ -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().
>
>
Done.
>> + 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;
>>
>
>
Done.
> Ditto.
>
>
> Thanks,
>
> Takashi
>
>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 92hd7xxx_power_management.patch
Url: http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20080110/6861f2ea/attachment-0001.bat
More information about the Alsa-devel
mailing list