Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2256519pxm; Fri, 4 Mar 2022 12:28:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJzgljYOaL9xmxVqDz1jeHTIZv4j8YE0If0psaxn7m9Va2LQHbG6gxZcuWHYEaNHItsLOc/2 X-Received: by 2002:a17:903:22c5:b0:151:a609:22f1 with SMTP id y5-20020a17090322c500b00151a60922f1mr190265plg.126.1646425683137; Fri, 04 Mar 2022 12:28:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646425683; cv=none; d=google.com; s=arc-20160816; b=P2okeNT/5modKtzFM7R3a3gbZdUoym0BpVJjiSbr50x4faOHeoB8HMyLQ0xExfK8Ae b6BG9a6JTxAZhbln3XCCd35p1ffzhd+zsAzzSMgy9PjZjU+uXgPUWFu46GYnHZkcAj6e 7ZcyMOmb2xf1wwVgfgHXUMx8OEFZphPn189og8FplvyHZLfTzKqxnXgoWZSi36H1l7o2 HV1zBfroi3HLM/uXgLXeUW7cMoXsKJ9p4omTN72DvCEFKpiGLHhfq/PfwvflCCWEVFEU 0KvleO52AP79qXYv+3UWmxWoVLPek2mlu2NxX0iWy4T8UWTJJwGuPcpWt5/E50eqfsBT Ff/A== 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=e7i489nr81BI4mQu8M9ZM3Ijji8GspPHt3h35GW5GP0=; b=NS6Ab2+V/cKc7vU1elRu738AT//i4zgn9t1GRMoNOUBhRb9/Z3ipwPbXql/WQ7QizY TU6tCodpo48IQDCDV9X/T97GTt2tepkGovzNMBvtcTkNw+XuOb0E43T+kVq1GeD8LadO M2dIAy+jCa+J64huvPlfztniWR5qo2oCEnVLBtR56pResJCALFWqv6oYU20b9hrB8PJq Ia8EKqc0+bUcG4/JEf5mANUYjTtvTgO1MCFg7i/MnCJm6fQzStPb9IR9mCYKF/9TS2Sj stc/6h+weUim+W1ZxP+6q8dP70Mzhc5THR8XLzz1PoabNgmvXSBj0dXQR3ZRkKmj1sn9 Ah+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=BYXBTw4T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id bj10-20020a170902850a00b001518320b38dsi5806567plb.217.2022.03.04.12.28.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 12:28:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=BYXBTw4T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 325322C031E; Fri, 4 Mar 2022 11:36:29 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240248AbiCDPJt (ORCPT + 99 others); Fri, 4 Mar 2022 10:09:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240116AbiCDPJR (ORCPT ); Fri, 4 Mar 2022 10:09:17 -0500 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10AA413EFA2; Fri, 4 Mar 2022 07:08:16 -0800 (PST) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 2248TInI019088; Fri, 4 Mar 2022 09:07:35 -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=e7i489nr81BI4mQu8M9ZM3Ijji8GspPHt3h35GW5GP0=; b=BYXBTw4Ta8eFFe2vCcYe7eWg5k+z4Rd8BQ/5jxfBa1rhQDvaDMqcE6SsnSPIqHzmthEh G8CGgUymedCR8He8BBuka6aYRQ8b6ENJc2+hO1JR03wmULXW/qjIYTwHFUwn0ezgK9sV plmezhlECnqRpTh+KRRIj/Qj7v69phQkBFC3mMWMxTEvmjWgoaWi9CieColROxQt5+40 S87XtnzSAh6rLfb8pQpCr8ZkDhKGVqxqPmyBAr1839BV5iXux3gSPdj2WQqyulsHW7U4 qpWI7eD2hKfNKbew2Tuebw7YjSWxNpT1fTOeXd8Jt9qn5EXaTvjMjO5Q3KmF4fmpnEZh lA== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3ek4j3h413-8 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 04 Mar 2022 09:07:34 -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; Fri, 4 Mar 2022 15:07:28 +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; Fri, 4 Mar 2022 15:07:28 +0000 Received: from aryzen.ad.cirrus.com (unknown [198.61.65.198]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id CC6D9B06; Fri, 4 Mar 2022 15:07:27 +0000 (UTC) From: Lucas Tanure To: Liam Girdwood , Mark Brown , Rob Herring , Jaroslav Kysela , Takashi Iwai CC: , , , , Lucas Tanure Subject: [PATCH v2 12/20] hda: cs35l41: Mute the device before shutdown Date: Fri, 4 Mar 2022 15:07:13 +0000 Message-ID: <20220304150721.3802-13-tanureal@opensource.cirrus.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220304150721.3802-1-tanureal@opensource.cirrus.com> References: <20220304150721.3802-1-tanureal@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: rhDTyV6xmcKslO4IJL9fQWLBxNaeKios X-Proofpoint-ORIG-GUID: rhDTyV6xmcKslO4IJL9fQWLBxNaeKios 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 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