From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7D48237A149; Mon, 5 May 2025 23:01:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746486108; cv=none; b=c4Er0FPU9dYM0OHhwoZ3BrJVwda+l/MJTYD6XdgiSLl+GKnJx1owH0nlin4Vpc0o6fsTdqP1kjVGhAwg/3YqgeD9ubyFbcfoqybL5HqB51fZdyzHMuf6x0yPYjQSZ56ic/X4bTiNd2Ec2nDp2wZAFFCtuB4z7pPPyqEzIeszCgY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746486108; c=relaxed/simple; bh=iSlVQTHxznhyZriy9klA7JYkiL+Pny2monEMr8EZjXg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=EvyLXHT/6bXtPDbaAGUhmYxtHnjyLJOzkdGVnuU+xAbDFzcakwO1rMgJ50BAlvlQwn4zbTxDf8fTTseFxU5fAEH/xiYXkqnz4UAWmFS+PES64DeYXI/2YbyBZgzNmxhPq1VGCODYTq1Tkwl0fZCnUol8FzGkj4IZwa3QDUe4Qm4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jJow+52F; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jJow+52F" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA375C4CEED; Mon, 5 May 2025 23:01:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1746486107; bh=iSlVQTHxznhyZriy9klA7JYkiL+Pny2monEMr8EZjXg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jJow+52Fr5D1kVhwWjO3soJgKKVuuLhdy9DeJEiWY4u8/pqwzIWsvXU6g4pNJClel 1fBCwM99LhpB/IE53NRH5rALTvnHiG+KPH8XfgmjidvWmoqfrEBKwfngihkJ0p3pcE oWW6aGSKsGBA55Mdx7UZoWD6sY6uEts1Gmi28/PIOv17tIqwyYvy9nvR5T3Y1KIIZO 268a9Hsl0IOi4lRQCwraJD1EzC+GI2QhAcXX/1pWL3rrScKEfCG1SIPuW7ZTYhkoSQ 4aH+/pDqpsy4JFwGYofIO2ZxM7aOWNTS85wZZmN/5fgQz9ZfPyPER6QkwLznPfBhRi SuhiblCY5sPEQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= , AngeloGioacchino Del Regno , Mark Brown , Sasha Levin , lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, matthias.bgg@gmail.com, Parker.Yang@mediatek.com, yr.yang@mediatek.com, krzysztof.kozlowski@linaro.org, linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH AUTOSEL 6.6 157/294] ASoC: mediatek: mt8188: Treat DMIC_GAINx_CUR as non-volatile Date: Mon, 5 May 2025 18:54:17 -0400 Message-Id: <20250505225634.2688578-157-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250505225634.2688578-1-sashal@kernel.org> References: <20250505225634.2688578-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.6.89 Content-Transfer-Encoding: 8bit From: NĂ­colas F. R. A. Prado [ Upstream commit 7d87bde21c73731ddaf15e572020f80999c38ee3 ] 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 Link: https://patch.msgid.link/20250225-genio700-dmic-v2-3-3076f5b50ef7@collabora.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- 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 11f30b183520f..4a304bffef8ba 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: -- 2.39.5