[Jaunty] SRU: Fix audio (speaker output) for HP Mini 1000
Andy Whitcroft
apw at canonical.com
Wed Aug 19 07:29:44 UTC 2009
On Fri, Aug 14, 2009 at 09:09:24AM +0100, Colin Ian King wrote:
> SRU Justification:
>
> Impact: HP Mini 1000 speakers do not work, and audio only works through
> the headphone jack.
>
> Fix: Patch attached includes correct Intel HDA audio verb table and
> mixer settings to enable speakers for the HP Mini 1000 (Audio chipset:
> IDT 92HD75B2X5, Vendor Id 0x111d7608, Subsystem Id: 0x103c361a, Revision
> Id: 0x100102).
>
> Testcase: Without the patch, no speaker output. With the patch, speakers
> work and also headphone jack plug/unplug works reliably.
>
> This has already been tested by myself on two different HP Mini 1000
> builds with BIOS revision F.10 and also by Jonathan T (see
> https://bugs.launchpad.net/ubuntu/+bug/318942/comments/184 )
>
> Attached: The patch.
> From 5c94beac854d2a45e341715e6a793d95da7e182b Mon Sep 17 00:00:00 2001
> From: Colin Ian King <colin.king at canonical.com>
> Date: Fri, 14 Aug 2009 08:49:33 +0100
> Subject: [PATCH] UBUNTU: SAUCE: HDA Intel, sigmatel: Enable speakers on HP Mini 1000
>
> BugLink: https://bugs.launchpad.net/ubuntu/+bug/318942
>
> Enable speakers on HP Mini 1000 (IDT 92HD75B2X5,
> Vendor Id 0x111d7608, Subsystem Id: 0x103c361a, Revision Id: 0x100102).
>
> Fix includes new verb table and mixer settings to enable speakers for
> the HP Mini 1000 configuration. Code was forward ported from Hardy
> LUM netbook repo with verb table/mixer settings originated from
> Matthew Ranostay <mranostay at embeddedalley.com>
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> sound/pci/hda/patch_sigmatel.c | 55 ++++++++++++++++++++++++++++++++-------
> 1 files changed, 45 insertions(+), 10 deletions(-)
>
> diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
> index 7279960..3e16775 100644
> --- a/sound/pci/hda/patch_sigmatel.c
> +++ b/sound/pci/hda/patch_sigmatel.c
> @@ -900,6 +900,18 @@ static struct hda_verb stac92hd71bxx_analog_core_init[] = {
> {}
> };
>
> +static struct hda_verb stac92hd71bxx_hp_m4_analog_core_init[] = {
> + { 0x0f, AC_VERB_SET_CONNECT_SEL, 0x2},
> + { 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, /* Speaker */
> + /* unmute dac0 input in audio mixer */
> + { 0x17, AC_VERB_SET_AMP_GAIN_MUTE, 0x701f},
> + /* unmute right and left channels for nodes 0x0a, 0xd, 0x0f */
> + { 0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
> + { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
> + { 0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
> + {}
> +};
> +
> static struct hda_verb stac925x_core_init[] = {
> /* set dac0mux for dac converter */
> { 0x06, AC_VERB_SET_CONNECT_SEL, 0x00},
> @@ -1141,6 +1153,22 @@ static struct snd_kcontrol_new stac92hd71bxx_analog_mixer[] = {
> { } /* end */
> };
>
> +static struct snd_kcontrol_new stac92hd71bxx_hp_m4_analog_mixer[] = {
> + STAC_INPUT_SOURCE(2),
> +
> + HDA_CODEC_VOLUME_IDX("Capture Volume", 0x0, 0x1c, 0x0, HDA_OUTPUT),
> + HDA_CODEC_MUTE_IDX("Capture Switch", 0x0, 0x1c, 0x0, HDA_OUTPUT),
> + HDA_CODEC_VOLUME_IDX("Capture Mux Volume", 0x0, 0x1a, 0x0, HDA_OUTPUT),
> +
> + 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("Analog Loopback 1", 0x17, 0x3, HDA_INPUT),
> + HDA_CODEC_MUTE("Analog Loopback 2", 0x17, 0x4, HDA_INPUT),
> + { } /* end */
> +};
> +
> static struct snd_kcontrol_new stac92hd71bxx_mixer[] = {
> STAC_INPUT_SOURCE(2),
> STAC_ANALOG_LOOPBACK(0xFA0, 0x7A0, 2),
> @@ -4666,15 +4694,25 @@ again:
> codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
> break;
> case 0x111d7608: /* 5 Port with Analog Mixer */
> + spec->mixer = stac92hd71bxx_analog_mixer;
> + /* disable VSW */
> + spec->init = &stac92hd71bxx_analog_core_init[HD_DISABLE_PORTF];
> +
> switch (spec->board_config) {
> case STAC_HP_M4:
> - /* Enable VREF power saving on GPIO1 detect */
> - snd_hda_codec_write_cache(codec, codec->afg, 0,
> - AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x02);
> - snd_hda_codec_write_cache(codec, codec->afg, 0,
> - AC_VERB_SET_UNSOLICITED_ENABLE,
> - (AC_USRSP_EN | STAC_VREF_EVENT | 0x01));
> - spec->gpio_mask |= 0x02;
> + if ((codec->subsystem_id == 0x103c361a) &&
> + (codec->revision_id & 0xf) == 2) {
> + spec->mixer = stac92hd71bxx_hp_m4_analog_mixer;
> + spec->init = stac92hd71bxx_hp_m4_analog_core_init;
> + } else {
> + /* Enable VREF power saving on GPIO1 detect */
> + snd_hda_codec_write_cache(codec, codec->afg, 0,
> + AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x02);
> + snd_hda_codec_write_cache(codec, codec->afg, 0,
> + AC_VERB_SET_UNSOLICITED_ENABLE,
> + (AC_USRSP_EN | STAC_VREF_EVENT | 0x01));
> + spec->gpio_mask |= 0x02;
> + }
> break;
> }
> if ((codec->revision_id & 0xf) == 0 ||
> @@ -4687,11 +4725,8 @@ again:
>
> /* no output amps */
> spec->num_pwrs = 0;
> - spec->mixer = stac92hd71bxx_analog_mixer;
> spec->dinput_mux = &spec->private_dimux;
>
> - /* disable VSW */
> - spec->init = &stac92hd71bxx_analog_core_init[HD_DISABLE_PORTF];
> stac92xx_set_config_reg(codec, 0xf, 0x40f000f0);
> break;
> case 0x111d7603: /* 6 Port with Analog Mixer */
Looks ok. Why is sound so vile.
ACK
-apw
More information about the kernel-team
mailing list