From: Mario Kleiner <mario.kleiner.de@gmail.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH] ALSA: hda/realtek - Fix silent headphone output on MacPro 4, 1
Date: Tue, 22 Dec 2015 00:47:37 +0100 [thread overview]
Message-ID: <56788F99.5060808@gmail.com> (raw)
In-Reply-To: <s5h37uydws0.wl-tiwai@suse.de>
On 12/19/2015 09:10 PM, Takashi Iwai wrote:
> On Sat, 19 Dec 2015 05:21:57 +0100,
> Mario Kleiner wrote:
>>
>> Without this patch, internal speaker and line-out work,
>> but front headphone output jack stays silent on the
>> Mac Pro 4,1.
>>
>> This code path also gets executed on the MacPro 5,1 due
>> to identical codec SSID, but i don't know if it has any
>> positive or adverse effects there or not.
>>
>> Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
>> ---
>> sound/pci/hda/patch_realtek.c | 32 +++++++++++++++++++++++++++++++-
>> 1 file changed, 31 insertions(+), 1 deletion(-)
>>
>> diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
>> index 9bedf7c..6224bdd 100644
>> --- a/sound/pci/hda/patch_realtek.c
>> +++ b/sound/pci/hda/patch_realtek.c
>> @@ -1755,6 +1755,7 @@ enum {
>> ALC889_FIXUP_MBA11_VREF,
>> ALC889_FIXUP_MBA21_VREF,
>> ALC889_FIXUP_MP11_VREF,
>> + ALC889_FIXUP_MP41_VREF,
>> ALC882_FIXUP_INV_DMIC,
>> ALC882_FIXUP_NO_PRIMARY_HP,
>> ALC887_FIXUP_ASUS_BASS,
>> @@ -1905,6 +1906,29 @@ static void alc889_fixup_mba21_vref(struct hda_codec *codec,
>> alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
>> }
>>
>> +/* Set VREF on HP pin on Mac Pro 4,1 */
>> +static void alc889_fixup_mp41_vref(struct hda_codec *codec,
>> + const struct hda_fixup *fix, int action)
>> +{
>> + struct alc_spec *spec = codec->spec;
>> + static hda_nid_t nids[1] = { 0x19 };
>> + int i;
>> +
>> + if (action != HDA_FIXUP_ACT_INIT)
>> + return;
>> +
>> + for (i = 0; i < ARRAY_SIZE(nids); i++) {
>> + unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
>> + if (get_defcfg_device(val) != AC_JACK_HP_OUT)
>> + continue;
>> + val = snd_hda_codec_get_pin_target(codec, nids[i]);
>> + val |= AC_PINCTL_VREF_80;
>> + snd_hda_set_pin_ctl(codec, nids[i], val);
>> + spec->gen.keep_vref_in_automute = 1;
>> + break;
>> + }
>
> This looks rather like a copy of alc889_fixup_mbp_vref() but with a
> different vref level. If so, instead of copying, modify the original
> function to take the vref level instead.
>
>
> thanks,
>
> Takashi
>
Thanks for the feedback. Just sent out v2 which is simpler and works
just as well.
thanks,
-mario
>
>> +}
>> +
>> /* Don't take HP output as primary
>> * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
>> * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
>> @@ -2133,6 +2157,12 @@ static const struct hda_fixup alc882_fixups[] = {
>> .chained = true,
>> .chain_id = ALC885_FIXUP_MACPRO_GPIO,
>> },
>> + [ALC889_FIXUP_MP41_VREF] = {
>> + .type = HDA_FIXUP_FUNC,
>> + .v.func = alc889_fixup_mp41_vref,
>> + .chained = true,
>> + .chain_id = ALC885_FIXUP_MACPRO_GPIO,
>> + },
>> [ALC882_FIXUP_INV_DMIC] = {
>> .type = HDA_FIXUP_FUNC,
>> .v.func = alc_fixup_inv_dmic,
>> @@ -2215,7 +2245,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
>> SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
>> SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
>> SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
>> - SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 5,1", ALC885_FIXUP_MACPRO_GPIO),
>> + SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
>> SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
>> SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
>> SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
>> --
>> 1.9.1
>>
>>
prev parent reply other threads:[~2015-12-21 23:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-19 4:21 [PATCH] ALSA: hda/realtek - Fix silent headphone output on MacPro 4, 1 Mario Kleiner
2015-12-19 20:10 ` Takashi Iwai
2015-12-21 23:47 ` Mario Kleiner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56788F99.5060808@gmail.com \
--to=mario.kleiner.de@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.