From patchwork Thu Sep 21 16:28:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Binding X-Patchwork-Id: 14360 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp5450426vqi; Fri, 22 Sep 2023 03:09:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHNulvlOhbFNUHjDkqj0lLdddLgY8ogimRYQh/zys8EHnWIwIbHx59P5jZ/JVbEiCjkgsCd X-Received: by 2002:a05:6808:14d4:b0:3a8:8ab1:57ff with SMTP id f20-20020a05680814d400b003a88ab157ffmr10337270oiw.45.1695377351509; Fri, 22 Sep 2023 03:09:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695377351; cv=none; d=google.com; s=arc-20160816; b=HnKdhhO9MCuYxwd+hj/lhZZXO8X7tKUhzRqJ4+RBsJqQN0YdXQVMWtXY4K+WtyfZ4K YMGMwvyruBzxcM4ZC/IPYE0HYNecAfy6UDFZWWzSbtckyvvxNpqK+10XX1OOdZcJTsYK Mgz5aVc42Si7yX/LWhC4pA66+l4uA10V7VH/P+JpeTZkTtTXwJrVcTCgYsIwT9uba1Oc olCq1R902Vjky1nAHiMZ23SXC0DWsNTxlwxIyQYXg7jQsr2NFLBJ1uKyk4xoBYI7wfEC w2ZONOIzz97h9tR83gyN2Rl09y8JvhdbRgIt7YQOo+Qaq0TTrOULn5YqBr93YbsD/PVp yLXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=e3g90nWLjtNABPYClsTtG/D+b84N6Jv+agCdGIxC/PQ=; fh=w0YUzQ46fBcI9TSX4/vlEjRtiHb0kiqukhFXye02PR8=; b=plPYXY1B3aTE6mcBw+tQtZR20UMHXFhBz5nVWmDbPwEeonA09hhJr4/xsFHuDPZLuY 3e5DV/fygL7ek2wNzmlIamZBMfz5gcCHdbOS05gjd5FhNNo6q+B7kkUUBDRSMtZ6WYko McavbAVrvfw2Mi1wgTaIHqkG1zsQZP1BbUJA/C2GIrgwzXjLct8uINh5Qfs0pAbDnANg PDKWbxmb0Rw4HQtO+z07RoedQRDm/T8sxdksnBVrCCTr3EeKareDqHVr+n1nsTe9qe3G WkZxRsVk6W8HVQMvbSTOWqZRKb9Lf2cJLPmzRpBD2F6MJgGakYekNdt96sfmbJXq3GXv iz8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=OjnBaORp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id d19-20020a637353000000b0055b43079640si3394797pgn.707.2023.09.22.03.09.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 03:09:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=OjnBaORp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 80E4080ECF89; Thu, 21 Sep 2023 10:26:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230075AbjIUR0z (ORCPT + 29 others); Thu, 21 Sep 2023 13:26:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229884AbjIUR0o (ORCPT ); Thu, 21 Sep 2023 13:26:44 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C640E5A03A for ; Thu, 21 Sep 2023 10:21:02 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 38LFWYi4009262; Thu, 21 Sep 2023 11:28:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=PODMain02222019; bh=e 3g90nWLjtNABPYClsTtG/D+b84N6Jv+agCdGIxC/PQ=; b=OjnBaORp20nxdEDIw 1IFcyP1N+7dgbWF2zrp81Pjudw7RhyfYkzXz/WqcpFeshKRiSNKio5yxK+ei71FI bBrwEbO6iAOAglBRgvO4BOjLku+177AMmBIphmHSprkbMsi6W4UEY6rF7bCLkYr0 IJY850T2NgdprR1IeqtE4qRPXseI3J94q4E6L3W5xriH/WorOdPV6klHeaMeBWj0 vb3HIHWuSqyHgZxjfZaNb/qdZZiiZYFzG12ujmEYhNE1Hq+imYePQgrI4+U1N6cv XdbfXOdpe7XujiJr5nAap9VybszkVtl4kDzFc8VoNbH84p532SjMf2pI22NLRQB0 ERX6w== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3t58shx0ab-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 Sep 2023 11:28:58 -0500 (CDT) Received: from ediex01.ad.cirrus.com (198.61.84.80) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Thu, 21 Sep 2023 17:28:57 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.2.1118.37 via Frontend Transport; Thu, 21 Sep 2023 17:28:57 +0100 Received: from sbinding-cirrus-dsktp2.ad.cirrus.com (unknown [198.90.238.135]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id BD7CE15B9; Thu, 21 Sep 2023 16:28:56 +0000 (UTC) From: Stefan Binding To: Jaroslav Kysela , Takashi Iwai CC: , , , Stefan Binding Subject: [PATCH v5 0/4] Support mute notifications for CS35L41 HDA Date: Thu, 21 Sep 2023 17:28:45 +0100 Message-ID: <20230921162849.1988124-1-sbinding@opensource.cirrus.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Proofpoint-GUID: WjyAt0Wl6uRkGUrCaIW0-gF334ZDtVLI X-Proofpoint-ORIG-GUID: WjyAt0Wl6uRkGUrCaIW0-gF334ZDtVLI X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 21 Sep 2023 10:26:57 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777732001520204957 X-GMAIL-MSGID: 1777732001520204957 Some systems use a special keyboard shortcut to mute speaker audio. On systems using CS35L41 HDA which have this shortcut, add a mechanism which uses ACPI notifications to determine when the shortcut is pressed, and then mute the amps inside the driver. Since this is not a normal mute mechanism, it does not go through userspace. To allow userspace to be able to track this special state, add an ALSA control which tracks the state of this forced mute Changes since v2: - Fixed compile issue when CONFIG_ACPI is missing Changes since v3: - Split first patch into 3 separate patches - Ensure all acpi code is protected by check for CONFIG_ACPI in realtek driver Changes since v4: - Rebase onto for-next branch Stefan Binding (4): ALSA: hda: cs35l41: Add notification support into component binding ALSA: hda/realtek: Support ACPI Notification framework via component binding ALSA: hda: cs35l41: Support mute notifications for CS35L41 HDA ALSA: hda: cs35l41: Add read-only ALSA control for forced mute sound/pci/hda/cs35l41_hda.c | 132 ++++++++++++++++++++++++++++++---- sound/pci/hda/cs35l41_hda.h | 3 + sound/pci/hda/hda_component.h | 4 ++ sound/pci/hda/patch_realtek.c | 83 ++++++++++++++++++++- 4 files changed, 208 insertions(+), 14 deletions(-)