From nobody Sun Dec 28 17:32:21 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01663C10DC1 for ; Thu, 7 Dec 2023 00:00:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1441865AbjLGAAH (ORCPT ); Wed, 6 Dec 2023 19:00:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230452AbjLFX77 (ORCPT ); Wed, 6 Dec 2023 18:59:59 -0500 Received: from irl.hu (irl.hu [95.85.9.111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7372DD44 for ; Wed, 6 Dec 2023 16:00:05 -0800 (PST) Received: from fedori.lan (51b690cd.dsl.pool.telekom.hu [::ffff:81.182.144.205]) (AUTH: CRAM-MD5 soyer@irl.hu, ) by irl.hu with ESMTPSA id 00000000000716E7.0000000065710B03.00119029; Thu, 07 Dec 2023 01:00:03 +0100 From: Gergo Koteles To: Shenghao Ding , Kevin Lu , Baojun Xu , Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Mark Brown Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Gergo Koteles Subject: [PATCH 03/16] ASoC: tas2781: disable regmap regcache Date: Thu, 7 Dec 2023 00:59:44 +0100 Message-ID: <21a183b5a08cb23b193af78d4b1114cc59419272.1701906455.git.soyer@irl.hu> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mime-Autoconverted: from 8bit to 7bit by courier 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The amp has 3 level addressing (BOOK, PAGE, REG). The regcache couldn't handle it. Signed-off-by: Gergo Koteles --- sound/pci/hda/tas2781_hda_i2c.c | 17 +---------------- sound/soc/codecs/tas2781-comlib.c | 2 +- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2= c.c index 077a01521eef..d272d3d08b29 100644 --- a/sound/pci/hda/tas2781_hda_i2c.c +++ b/sound/pci/hda/tas2781_hda_i2c.c @@ -717,8 +717,6 @@ static int tas2781_runtime_suspend(struct device *dev) tas_priv->tasdevice[i].cur_conf =3D -1; } =20 - regcache_cache_only(tas_priv->regmap, true); - regcache_mark_dirty(tas_priv->regmap); =20 mutex_unlock(&tas_priv->codec_lock); =20 @@ -730,20 +728,11 @@ static int tas2781_runtime_resume(struct device *dev) struct tasdevice_priv *tas_priv =3D dev_get_drvdata(dev); unsigned long calib_data_sz =3D tas_priv->ndev * TASDEVICE_SPEAKER_CALIBRATION_SIZE; - int ret; =20 dev_dbg(tas_priv->dev, "Runtime Resume\n"); =20 mutex_lock(&tas_priv->codec_lock); =20 - regcache_cache_only(tas_priv->regmap, false); - ret =3D regcache_sync(tas_priv->regmap); - if (ret) { - dev_err(tas_priv->dev, - "Failed to restore register cache: %d\n", ret); - goto out; - } - tasdevice_prmg_load(tas_priv, tas_priv->cur_prog); =20 /* If calibrated data occurs error, dsp will still works with default @@ -752,10 +741,9 @@ static int tas2781_runtime_resume(struct device *dev) if (tas_priv->cali_data.total_sz > calib_data_sz) tas2781_apply_calib(tas_priv); =20 -out: mutex_unlock(&tas_priv->codec_lock); =20 - return ret; + return 0; } =20 static int tas2781_system_suspend(struct device *dev) @@ -770,10 +758,7 @@ static int tas2781_system_suspend(struct device *dev) return ret; =20 /* Shutdown chip before system suspend */ - regcache_cache_only(tas_priv->regmap, false); tasdevice_tuning_switch(tas_priv, 1); - regcache_cache_only(tas_priv->regmap, true); - regcache_mark_dirty(tas_priv->regmap); =20 /* * Reset GPIO may be shared, so cannot reset here. diff --git a/sound/soc/codecs/tas2781-comlib.c b/sound/soc/codecs/tas2781-c= omlib.c index ffb26e4a7e2f..933cd008e9f5 100644 --- a/sound/soc/codecs/tas2781-comlib.c +++ b/sound/soc/codecs/tas2781-comlib.c @@ -39,7 +39,7 @@ static const struct regmap_range_cfg tasdevice_ranges[] = =3D { static const struct regmap_config tasdevice_regmap =3D { .reg_bits =3D 8, .val_bits =3D 8, - .cache_type =3D REGCACHE_RBTREE, + .cache_type =3D REGCACHE_NONE, .ranges =3D tasdevice_ranges, .num_ranges =3D ARRAY_SIZE(tasdevice_ranges), .max_register =3D 256 * 128, --=20 2.43.0