Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3510946pxp; Tue, 8 Mar 2022 16:17:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJzimRsjWg5538k8gAoq/VFlF/e5PxukutHp0JYtzWhWRRTF7DjTB33b13a/y2hJPryCGEdP X-Received: by 2002:a63:dd17:0:b0:36c:33aa:6d5f with SMTP id t23-20020a63dd17000000b0036c33aa6d5fmr16284990pgg.300.1646785025818; Tue, 08 Mar 2022 16:17:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646785025; cv=none; d=google.com; s=arc-20160816; b=njtSgruzVOrGifa82CC0YDUfLsMw0r7/bgTsXxZZg3P4L7HgU1yIRvixJgc3FiQUX7 2SJqWsiCooR6FCjyNrCXrRaCIxKP8hnly7L/jD6Lv3GatrJ4vDHNs6/vGjlDsR6Dsq6n ZR7ZcjyxW2y5u65UYojKDYy3dWLKSfxVAHUvzxf7MruyyxXhrhxqAL19h7yVCp1NgGBP H0napuGrDrxa9WzvgE5/PhTSusA3m1BCogtqIGjJKh+QA/y4KUaWI1LzLIjxHI55ztNx WeXib0wEGXcp0cb4PV1BfmURfZankF5+CGGVo2B8cdcWaf4cSDVtFZp3IekxmenFrlVY TzUQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=woV8i188jeGZRIoSJZbDObRRCfFguXV5ESoXm5kp9+M=; b=z78OgyMoCmnZn5FSdIPTe/lnxb5FFpKuM/lmFBmrRLUirS5E90ELZsuXUMlN1JTyjU 3jOkmi8alj8kUgJMTxomswu6a8BQv+3KoA3dWYk9MQR408wIU5HuQ5HcecmhFLDJpS20 I7/11NVK4nX4LMtm+ywIcwzJ4y7iMmc/B/iLHAzIrZaX3851UOaTYRvDwYuRDhvtrvEa yKgOjbuSPHWlH2pdNYuWzqd4wVfdEJsYEh13Prosz4D+cDixX2yL6ZNy6gwyjpMKwjhd 4C23Re782PXG+H+6+4H26fIRZwUVgdMM5TxlzMtW4PLMmnH9Lnk7GogSi0H43O0BTE8t TwmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=FHc+Cuoy; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id rj6-20020a17090b3e8600b001beef62c01asi3881115pjb.15.2022.03.08.16.17.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 16:17:05 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=FHc+Cuoy; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 32978369D3; Tue, 8 Mar 2022 15:43:17 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348839AbiCHRUM (ORCPT + 99 others); Tue, 8 Mar 2022 12:20:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348888AbiCHRUH (ORCPT ); Tue, 8 Mar 2022 12:20:07 -0500 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 504DB53720; Tue, 8 Mar 2022 09:18:46 -0800 (PST) Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 228FxhGX010224; Tue, 8 Mar 2022 11:17:45 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=woV8i188jeGZRIoSJZbDObRRCfFguXV5ESoXm5kp9+M=; b=FHc+CuoyVD1x7Y/YWVNywrQlX/6EDKupTsZmP/68Q4Ci+n2b7Uy6WGU+6p6479Ybl1XN z/OfBh5Za7qkm65jOXVN4bFk2S/z2fgMgXPU8wYPgKwSv8oxRg1qYV5BuqujbCSYb5z/ kZ+yCC4V+nKaiph3pjsON1t/TKvcg5VmrW6puPsGN2T1E1T311HClHLgAeOid4cCc+3k gSuqH0egRgON5qLn1gnvyLN8YXJQ0iY68vxnsc7qmPVMbx2iYtrs54bT36LNP34226PD rmiPYNgpg1oGGUz1d4MrvJCFlTwXfhiMyFafbYEkxLQYJxe4gMx0wChBZuCwU/Red4T0 Zw== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3em656mh5v-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Tue, 08 Mar 2022 11:17:44 -0600 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Tue, 8 Mar 2022 17:17:34 +0000 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.1.2375.18 via Frontend Transport; Tue, 8 Mar 2022 17:17:34 +0000 Received: from aryzen.ad.cirrus.com (unknown [198.61.65.38]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 1EEA5B1A; Tue, 8 Mar 2022 17:17:34 +0000 (UTC) From: Lucas Tanure To: Liam Girdwood , Mark Brown , Rob Herring , Jaroslav Kysela , Takashi Iwai CC: , , , , Lucas Tanure Subject: [PATCH v3 08/16] hda: cs35l41: Mute the device before shutdown Date: Tue, 8 Mar 2022 17:17:22 +0000 Message-ID: <20220308171730.454587-9-tanureal@opensource.cirrus.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220308171730.454587-1-tanureal@opensource.cirrus.com> References: <20220308171730.454587-1-tanureal@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: Lh0W3F-m8hKmsd9zPBCSlR1nTKLsqA3A X-Proofpoint-GUID: Lh0W3F-m8hKmsd9zPBCSlR1nTKLsqA3A X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Mute the device before shutdown to avoid pops and clicks for all types of boost. Signed-off-by: Lucas Tanure --- sound/pci/hda/cs35l41_hda.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c index 3b9515ed871d..b3cc7db3fc42 100644 --- a/sound/pci/hda/cs35l41_hda.c +++ b/sound/pci/hda/cs35l41_hda.c @@ -28,6 +28,11 @@ static const struct reg_sequence cs35l41_hda_config[] = { { CS35L41_PWR_CTRL2, 0x00000001 }, // AMP_EN = 1 }; +static const struct reg_sequence cs35l41_hda_mute[] = { + { CS35L41_AMP_GAIN_CTRL, 0x00000000 }, // AMP_GAIN_PCM 0.5 dB + { CS35L41_AMP_DIG_VOL_CTRL, 0x0000A678 }, // AMP_VOL_PCM Mute +}; + static const struct reg_sequence cs35l41_hda_start_bst[] = { { CS35L41_PWR_CTRL2, 0x00000021 }, // BST_EN = 10, AMP_EN = 1 { CS35L41_PWR_CTRL1, 0x00000001, 3000}, // set GLOBAL_EN = 1 @@ -89,7 +94,6 @@ static const struct reg_sequence cs35l41_active_to_safe[] = { { 0x00000040, 0x00000055 }, { 0x00000040, 0x000000AA }, { 0x00007438, 0x00585941 }, - { CS35L41_AMP_DIG_VOL_CTRL, 0x0000A678 }, // AMP_VOL_PCM Mute { CS35L41_PWR_CTRL2, 0x00000000 }, // AMP_EN = 0 { CS35L41_PWR_CTRL1, 0x00000000 }, { 0x0000742C, 0x00000009, 2000 }, @@ -146,6 +150,7 @@ static void cs35l41_hda_playback_hook(struct device *dev, int action) ret = regmap_multi_reg_write(reg, reg_seq->prepare, reg_seq->num_prepare); break; case HDA_GEN_PCM_ACT_CLEANUP: + regmap_multi_reg_write(reg, cs35l41_hda_mute, ARRAY_SIZE(cs35l41_hda_mute)); if (reg_seq->cleanup) ret = regmap_multi_reg_write(reg, reg_seq->cleanup, reg_seq->num_cleanup); break; -- 2.35.1