Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4794890rwb; Mon, 31 Jul 2023 12:18:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlEH+TCJ/G2h7LsXRBHXors0Iij7VkG9LDhPYJVw5rF8rA38u72HYsidkjA97SEFZ6VtCGAj X-Received: by 2002:a05:6a20:3d8b:b0:130:f6bc:9146 with SMTP id s11-20020a056a203d8b00b00130f6bc9146mr12405111pzi.14.1690831139057; Mon, 31 Jul 2023 12:18:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690831139; cv=none; d=google.com; s=arc-20160816; b=eeiXjN1d71nytmiLVNVdi1R1BpIw7abpiJB5wRKblHBoOAA3EAmhYyxOEru6QxaEnX 77E4A0HzcdZl6vLVUv5a9Elg6vYu6cT/Ypy7nD/zfYYQY7xcofZHUyqPRiDXHEa+nOk4 MmWu8L7osLQcrI+k38MEfFDwbX47e+zS7x5q+2mY7X8Q77t628wppl3+ROQ5rsBYiKaQ I/Ge2eoaqQXDA1S0Fa9Q9rVRZKyy5bQlCoWf28eDx9elax07Fm0jTmuuVnYbKn0Ieur2 UShP4HuK6JiAqPCrOcjgkRuGs6NClScE+m3ZttFlgtiLevam7FpY8oh4Cgj4PHFXkC5A IzIQ== 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=COsUQaN/ErqOVMioTgwxTBAOGWPa/9gsBLSsEI2cT2A=; fh=++3DPgNRpClAYl/wOqcu6GdLXzb+wGOgYMictO4+73w=; b=l7S3kxuF+ENeQ7EY0GB3YnJBKATOiji/Qt8k1smOZrHYtabHcOhPgfRP3S34KljRxw 3UGoJf8M7+2jxnObXOuhN3I7fmXetR2+jWQtzxa58gooQsltA8AFDjzJm4ODgcaKdMq1 xAeAfaRZQCQfHreRILjj7DKWMBb5O31mgwMaZxsq7Hu1sG0eUUxb90JTeRF5Idk2k6pV N81p5HuuD10Vlj1Dk0XX5OeiIm6gLMLkpS5wD3QgvaifaZZqbqL47aH0++EKOpKZSuL/ gVZOG0cKszLgdRGy6TQRpbot/cj6oN042i2Yro4Ez1/ubh0N7dGD/maULuRfzzMrAN66 ZyIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=A9dafwKH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l16-20020a056a0016d000b0066e4ceca385si5594871pfc.247.2023.07.31.12.18.46; Mon, 31 Jul 2023 12:18:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=A9dafwKH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233774AbjGaQ6t (ORCPT + 99 others); Mon, 31 Jul 2023 12:58:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233856AbjGaQ6T (ORCPT ); Mon, 31 Jul 2023 12:58:19 -0400 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 915581986 for ; Mon, 31 Jul 2023 09:57:45 -0700 (PDT) Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 36V5lNJK017071; Mon, 31 Jul 2023 11:57:33 -0500 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=COsUQaN/ErqOVMioTgwxTBAOGWPa/9gsBLSsEI2cT2A=; b= A9dafwKHWVwmWHxQyv/TdC6e8R+dzdJDt49STc7fSw2q/XQXVO0ECaFOx4SKySmm M1yozutFbDSUsLi9XxSsTGBvnctBmNoS9i3aBGhjjRsGQ3BSxDqtE6ixaZ37cBAN lk5Rdy+kXQVor6332GqARJiJ0fVEoWs8oxoDmYcG+t9GnvP9Yw3R3n9DICqS5cIZ H2NY3jgc5JRe89waXHeUuEWjbvpkqBelva0rC2bw2AtQqnKURdsyZnDg0PCz4Z4l fyPgn3AbVSYFgzIH11p7ew+bnrCKEsGFyNGLUvptymCEFjAqebh+pTcqD9G6d+cr OQ95okiKLwocbSmCvdLisQ== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3s5gk1sg45-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 31 Jul 2023 11:57:33 -0500 (CDT) 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_256_GCM_SHA384) id 15.2.1118.30; Mon, 31 Jul 2023 17:57:30 +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.30 via Frontend Transport; Mon, 31 Jul 2023 17:57:30 +0100 Received: from EDIN4L06LR3.ad.cirrus.com (EDIN4L06LR3.ad.cirrus.com [198.61.64.107]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 55A3D45D; Mon, 31 Jul 2023 16:57:30 +0000 (UTC) From: Richard Fitzgerald To: CC: , , , , Richard Fitzgerald Subject: [PATCH 2/9] ALSA: hda/cs35l56: Do not mark cache dirty after REINIT Date: Mon, 31 Jul 2023 17:57:19 +0100 Message-ID: <20230731165726.7940-3-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230731165726.7940-1-rf@opensource.cirrus.com> References: <20230731165726.7940-1-rf@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: kFB1f_oNiNMpBEAsCAcGXST23BTvhCOS X-Proofpoint-ORIG-GUID: kFB1f_oNiNMpBEAsCAcGXST23BTvhCOS X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Only call regcache_mark_dirty() in cs35l56_hda_fw_load() if the CS35L56 was SYSTEM_RESET. recache_mark_dirty() changes the behaviour of regcache_sync() to write out cache values that are not the default value, and skip cache values that are the default. AUDIO_REINIT does not reset the registers. regcache_mark_dirty() after AUDIO_REINIT could cause the regcache_sync() to sync registers incorrectly because it will assume that all registers have reset to default. Signed-off-by: Richard Fitzgerald --- sound/pci/hda/cs35l56_hda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/hda/cs35l56_hda.c b/sound/pci/hda/cs35l56_hda.c index c3acda2daeeb..fda716e0db09 100644 --- a/sound/pci/hda/cs35l56_hda.c +++ b/sound/pci/hda/cs35l56_hda.c @@ -569,6 +569,7 @@ static int cs35l56_hda_fw_load(struct cs35l56_hda *cs35l56) } else { /* Reset the device and wait for it to boot */ cs35l56_system_reset(&cs35l56->base, false); + regcache_mark_dirty(cs35l56->base.regmap); ret = cs35l56_wait_for_firmware_boot(&cs35l56->base); if (ret) goto err; @@ -579,7 +580,6 @@ static int cs35l56_hda_fw_load(struct cs35l56_hda *cs35l56) if (ret) goto err; - regcache_mark_dirty(cs35l56->base.regmap); regcache_sync(cs35l56->base.regmap); regmap_clear_bits(cs35l56->base.regmap, CS35L56_PROTECTION_STATUS, -- 2.30.2