From patchwork Tue Feb 25 14:33:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Patchwork-Id: 13990080 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 452A926D5A0; Tue, 25 Feb 2025 14:35:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740494118; cv=none; b=rqtReiNftMxd9eNv2VgnPa+gXckETsZIg0Yb8QPJ8Yo7WzEqpWAxF4phYLJvUUzihMmdxMwhqFLBDy8eqNA/npI99LCA6NnQI/GZh53wPuHA65XCWnTeDIyTtOVEBM6tiM5Bxt+7N9xRMYX6CHsjlAwS6HlnIUtogr076JU2NQ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740494118; c=relaxed/simple; bh=75CPx/W8hj86reRTn/xz1CjoIDFFQn6l8ybKVRcg3Og=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Y5PvPRDwtuuxUPm3jXU1EIjxMzXJxX9lPGdPACKkGaqjeAfAF1926rmFw2c8+bQaCp5GbW4dGL9kzhyX2kd3IEf8GNux7c5T0pwcpVyxAbFg42VHutgRWE38X0jWG2dQSpy3UTadc13Wneg71qGaamyqgddtvV4H9Aycnptoec0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=kviw7DnX; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="kviw7DnX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1740494114; bh=75CPx/W8hj86reRTn/xz1CjoIDFFQn6l8ybKVRcg3Og=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=kviw7DnX2ELsWI9A1nNID19qHwdc0ciFFQAwgHraUjm47PUm3QxozPxTJkQdEeI+F iGjxWIe3zFUX7eUpbJmULEkgtRgDOxPB53A6hmHREBSiOoyxTkmL3c10IoMH0mZh5Y 85H4Aal9N1yNqVLb7KcNpu8ncEexJt7yAlkT8lfBPcCHOg3OvDFRAUv2At5gWtR1r8 irTBYrtPpO+Lx/a0GfRrGSsvGo2iSblOMX6QCPrEJxJkDpfvHcJmJ8KHqYMD/mOis5 wOTBy1MxlgjK9Ghhhvbm63dHmtyhgbboIMsu2Pqy95e/p/HE/CORyJuVDqdD0sw9ib IV4XPaDjhx8zA== Received: from [192.168.0.47] (unknown [IPv6:2804:14c:1a9:53ee::1004]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by bali.collaboradmins.com (Postfix) with ESMTPSA id 7147517E0DD7; Tue, 25 Feb 2025 15:35:10 +0100 (CET) From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= Date: Tue, 25 Feb 2025 11:33:49 -0300 Subject: [PATCH v2 3/8] ASoC: mediatek: mt8188: Treat DMIC_GAINx_CUR as non-volatile Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250225-genio700-dmic-v2-3-3076f5b50ef7@collabora.com> References: <20250225-genio700-dmic-v2-0-3076f5b50ef7@collabora.com> In-Reply-To: <20250225-genio700-dmic-v2-0-3076f5b50ef7@collabora.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Matthias Brugger , AngeloGioacchino Del Regno , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Trevor Wu Cc: kernel@collabora.com, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Mailer: b4 0.14.2 The DMIC_GAINx_CUR registers contain the current (as in present) gain of each DMIC. During capture, this gain will ramp up until a target value is reached, and therefore the register is volatile since it is updated automatically by hardware. However, after capture the register's value returns to the value that was written to it. So reading these registers returns the current gain, and writing configures the initial gain for every capture. From an audio configuration perspective, reading the instantaneous gain is not really useful. Instead, reading back the initial gain that was configured is the desired behavior. For that reason, consider the DMIC_GAINx_CUR registers as non-volatile, so the regmap's cache can be used to retrieve the values, rather than requiring pm runtime resuming the device. Signed-off-by: NĂ­colas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno --- sound/soc/mediatek/mt8188/mt8188-afe-pcm.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c b/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c index 73e5c63aeec8783905d656af225c42cd95069049..d36520c6272dd8c8302bc3f59da33f82f273f366 100644 --- a/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c +++ b/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c @@ -2855,10 +2855,6 @@ static bool mt8188_is_volatile_reg(struct device *dev, unsigned int reg) case AFE_DMIC3_SRC_DEBUG_MON0: case AFE_DMIC3_UL_SRC_MON0: case AFE_DMIC3_UL_SRC_MON1: - case DMIC_GAIN1_CUR: - case DMIC_GAIN2_CUR: - case DMIC_GAIN3_CUR: - case DMIC_GAIN4_CUR: case ETDM_IN1_MONITOR: case ETDM_IN2_MONITOR: case ETDM_OUT1_MONITOR: