From nobody Wed Dec 24 08:05:38 2025 Received: from air.basealt.ru (air.basealt.ru [194.107.17.39]) (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 A8E6F605B4; Tue, 30 Jan 2024 09:47:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.107.17.39 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706608046; cv=none; b=heEHMNZc1ryKXrLcCYJLrrQfzXsqqxEg6QI5b6Ay6X5XLVTuKEND5tOGEKqPP31VrlfA36ZJ+OsLUJateBZOHe5DGL/po+0On4VxDcN7x6l/x0ZpprvCKDuFlRFceU34UG0mILMeiVT9geOD7WByGPI4WWLPgm+wKqQ1ysafY0k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706608046; c=relaxed/simple; bh=vklX8QdJvVdaDTo9uEek4zgLDUE4n5/BjuBqUcTksoc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=LsAYlu/am6mC3nXK/t5J0H5Yx+1dOavs2DMygy40fCo/d2ldbPTyjBMme6hf8uKc4reFCZF9+ucakaB+VDYIXm/0FPxdIYMlW4hqotD4kv3JRGIW4bEYxCTo/mVnzTrH/aOexqIcqp61HOOvSw7iU3ITgH9fIW+JxbYUA2hHxFA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=altlinux.org; spf=pass smtp.mailfrom=altlinux.org; arc=none smtp.client-ip=194.107.17.39 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=altlinux.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=altlinux.org Received: by air.basealt.ru (Postfix, from userid 490) id C2EA52F2023D; Tue, 30 Jan 2024 09:47:22 +0000 (UTC) X-Spam-Level: Received: from altlinux.malta.altlinux.ru (obninsk.basealt.ru [217.15.195.17]) by air.basealt.ru (Postfix) with ESMTPSA id 158A22F20248; Tue, 30 Jan 2024 09:47:15 +0000 (UTC) From: kovalev@altlinux.org To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, u.kleine-koenig@pengutronix.de, a.firago@yadro.com, sashal@kernel.org, zhuning0077@gmail.com, tiwai@suse.com, perex@perex.cz, broonie@kernel.org, lgirdwood@gmail.com, kovalev@altlinux.org Subject: [PATCH 6.1.y 4/7] ASoC: codecs: ES8326: Change Volatile Reg function Date: Tue, 30 Jan 2024 12:47:05 +0300 Message-Id: <20240130094708.290485-5-kovalev@altlinux.org> X-Mailer: git-send-email 2.33.8 In-Reply-To: <20240130094708.290485-1-kovalev@altlinux.org> References: <20240130094708.290485-1-kovalev@altlinux.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Zhu Ning Commit f1230a27c14b4d05e1d6af02be55c617b53728a4 upstream. The new calibration and headphone detection function require reading new volatile registers. Add them in the volatile register function. Signed-off-by: Zhu Ning Link: https://lore.kernel.org/r/20230717033223.42506-2-zhuning0077@gmail.com Signed-off-by: Mark Brown Signed-off-by: Vasiliy Kovalev --- sound/soc/codecs/es8326.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/sound/soc/codecs/es8326.c b/sound/soc/codecs/es8326.c index e953c0157ba03f..7cfe535e0b6da4 100644 --- a/sound/soc/codecs/es8326.c +++ b/sound/soc/codecs/es8326.c @@ -158,20 +158,25 @@ static const struct snd_soc_dapm_route es8326_dapm_ro= utes[] =3D { {"HPOR", NULL, "RHPMIX"}, }; =20 -static const struct regmap_range es8326_volatile_ranges[] =3D { - regmap_reg_range(ES8326_HPDET_STA, ES8326_HPDET_STA), -}; - -static const struct regmap_access_table es8326_volatile_table =3D { - .yes_ranges =3D es8326_volatile_ranges, - .n_yes_ranges =3D ARRAY_SIZE(es8326_volatile_ranges), -}; +static bool es8326_volatile_register(struct device *dev, unsigned int reg) +{ + switch (reg) { + case ES8326_HPL_OFFSET_INI: + case ES8326_HPR_OFFSET_INI: + case ES8326_HPDET_STA: + case ES8326_CTIA_OMTP_STA: + case ES8326_CSM_MUTE_STA: + return true; + default: + return false; + } +} =20 static const struct regmap_config es8326_regmap_config =3D { .reg_bits =3D 8, .val_bits =3D 8, .max_register =3D 0xff, - .volatile_table =3D &es8326_volatile_table, + .volatile_reg =3D es8326_volatile_register, .cache_type =3D REGCACHE_RBTREE, }; =20 --=20 2.33.8