Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp468827lqb; Wed, 17 Apr 2024 01:32:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUGfiyb+JUBCiU5HWpu15e6jByuAvCu0esVA+ZXnBVnFXt1OlWrhn9RdPKyUXUKPWUv4wKelTwJM8wWfEtVYC3zB+/JLsB5g6gdZdEz9Q== X-Google-Smtp-Source: AGHT+IGOQU5bn0MxlCpHisMhza7TGVblzBqPo0qBpcyB+tTHxY2HcDTyMZGLUlSwCgXBF4dIqeTE X-Received: by 2002:a05:620a:1a26:b0:78d:6902:ca8f with SMTP id bk38-20020a05620a1a2600b0078d6902ca8fmr21909268qkb.5.1713342745101; Wed, 17 Apr 2024 01:32:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713342745; cv=pass; d=google.com; s=arc-20160816; b=Jaq3QDTLiFbrEjgsbqaOvclt59DNvU4nts7fwNgQq4i5zccfjQW8I9ZQwGY9gfE0W8 vpB4Fl5iUEYVIMoqTT3kk9Nfp73D8OWdzgPwo9HkyfMxCRYMrjLQ/Yo8KZHYuiet/RjF VJ6Xf6nIKUvDIbfA4Mq50LrK0DsNxrl2z1DEQCxHUX9U/VYZUiq2Qm/BZy7R8grXW0qe Y4RtxUEn6odZ1flf2cuRse/zKvCG5Z9qKJuEeD2piTOLofi/ftfS9V2p9i0X1wG2uDKO Pr3wfqY4aMF7nEphBtPj90xO5QlyJX+MGKSS0a80ds12bzV2pq0lu5oyKXc0nqjEd51u MIeQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=Lia7Bd8T/sEBEwdl10mvE8b8BaJzWUPfBEvdUCxGSw4=; fh=zpUdbvIOZy/Y78+PtBCPVcQ5mOO50PDa0WFXt+23Kfw=; b=C761aOjbOhObCn0QD7YvKEHOr410ZGPbZ393Ef5qFUuSPR6n8O4zfmrPx6l8hJUVXF TBxoPgCeHPaJO91A1UtALRf/VHal9f6tKNm/58Aa5qgAmKBIA5kKvJJOAiPpjrgpxtf8 lesL4MNhJ3OVbuD34My9Yv6FRYsCApeJ0jNCF5EZdztvyNyCBaDUDM/26aK1qKzFx2Kk sUYW6AlQEDRR7NAN3eqwIBUbEUL+gYszj+32d29hJyxKCHQmoF6GJbpT0znxs/nwMg/t MF6U4/adl48I9f4SM/0TfLA0E8wddgULhDSpFx+6SJhFIQlVT45nc0bqgrjT3TwxGSwb XX/Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=altlinux.org); spf=pass (google.com: domain of linux-kernel+bounces-148148-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148148-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id z6-20020a05620a08c600b0078d5ef14735si14539577qkz.682.2024.04.17.01.32.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 01:32:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148148-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=altlinux.org); spf=pass (google.com: domain of linux-kernel+bounces-148148-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148148-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 12F391C209F0 for ; Wed, 17 Apr 2024 08:32:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED71212C81A; Wed, 17 Apr 2024 08:31:40 +0000 (UTC) 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 A9FB3126F38; Wed, 17 Apr 2024 08:31:38 +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=1713342700; cv=none; b=gt3DQjrUYJv0VS1k2lWPidFZQwKmXWTbXfa5z1uUBXVAjmFV+RSmJ83dHHz+NXGPXctr6I+/3MqiACx55D4Ifc4+qMw1uHwIQYnkuB00HosLVKBY3JNcbq+XaXsh3D8TDPTzzwUr20BujrNb5KIRJQSGYDVpZqh3Ca7u1o6uXB4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713342700; c=relaxed/simple; bh=Nll4vTiMI4tTo6HYM/ly+++mgvTgfUNPjO2wawAdCNo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DRfg4XqhhTJRCNraaFu+79dlUZxh2W/NEd9YdHOvGCdaIc92wHdfyb7pX9iyy/Pqxfot8XhQUG6i/1Dels4z+Br/fudNkc41iltGsSt6KeRVAz1/ga95fLSHt3Rkw23Y+fOlsnf6TNrrpgGWrurVkr3dRiUnMDJrJw4eB8rdfxI= 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 66F162F20244; Wed, 17 Apr 2024 08:31:31 +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 619E32F20246; Wed, 17 Apr 2024 08:31:18 +0000 (UTC) From: kovalev@altlinux.org To: stable@vger.kernel.org Cc: broonie@kernel.org, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, zhuning0077@gmail.com, u.kleine-koenig@pengutronix.de, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 6.1.y 3/6] ASoC: codecs: ES8326: Change Volatile Reg function Date: Wed, 17 Apr 2024 11:31:13 +0300 Message-Id: <20240417083116.608610-4-kovalev@altlinux.org> X-Mailer: git-send-email 2.33.8 In-Reply-To: <20240417083116.608610-1-kovalev@altlinux.org> References: <20240417083116.608610-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: 8bit 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 c60cb081b5a26f..04d7403bfe9064 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_routes[] = { {"HPOR", NULL, "RHPMIX"}, }; -static const struct regmap_range es8326_volatile_ranges[] = { - regmap_reg_range(ES8326_HPDET_STA, ES8326_HPDET_STA), -}; - -static const struct regmap_access_table es8326_volatile_table = { - .yes_ranges = es8326_volatile_ranges, - .n_yes_ranges = 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; + } +} static const struct regmap_config es8326_regmap_config = { .reg_bits = 8, .val_bits = 8, .max_register = 0xff, - .volatile_table = &es8326_volatile_table, + .volatile_reg = es8326_volatile_register, .cache_type = REGCACHE_RBTREE, }; -- 2.33.8