From patchwork Tue Jun 12 15:21:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 10460579 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 50DC7601A0 for ; Tue, 12 Jun 2018 15:22:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 33D2328970 for ; Tue, 12 Jun 2018 15:22:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 61EF828930; Tue, 12 Jun 2018 15:22:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E45A289D1 for ; Tue, 12 Jun 2018 15:21:39 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 79D3F266F88; Tue, 12 Jun 2018 17:21:35 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 0752B267196; Tue, 12 Jun 2018 17:21:33 +0200 (CEST) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id F268B266E8B for ; Tue, 12 Jun 2018 17:21:30 +0200 (CEST) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 225A1ABCD; Tue, 12 Jun 2018 15:21:30 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Tue, 12 Jun 2018 17:21:18 +0200 Message-Id: <20180612152118.17720-1-tiwai@suse.de> X-Mailer: git-send-email 2.17.1 Cc: Hans de Goede , Benjamin Berg Subject: [alsa-devel] [PATCH] ALSA: hda/realtek - Add shutup hint X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The pin shutup callback seems working well on some devices while it does harm on some other devices; e.g. Lenovo laptops show often the noises at (runtime) PM with the pin shutup enabled. Currently, the only way to disable the pin shutup is to hard-code spec->shutup = alc_no_shutup; in the fixup, and this makes the debugging harder for normal users. For allowing users to test the similar effect without recompiling the kernel, this patch adds a new hint string "shutup". It's a boolean value, and by passing false to this, user can turn off the pin shutup call. For example, to turn off the shutup on Lenovo P50, create a "firmware patch" file (e.g. /lib/firmware/alsa/lenovo-p50) containing the following lines: [codec] 0x10ec0298 0x17aa222e 0 [hint] shutup = no and pass the file via patch option of snd-hda-intel module (e.g. patch=alsa/lenovo-p50). Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_realtek.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index b1eb6bd4fbd8..e5a002900292 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -793,6 +793,9 @@ static inline void alc_shutup(struct hda_codec *codec) { struct alc_spec *spec = codec->spec; + if (!snd_hda_get_bool_hint(codec, "shutup")) + return; /* disabled explicitly by hints */ + if (spec && spec->shutup) spec->shutup(codec); else