Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2866978rwb; Mon, 19 Sep 2022 11:08:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7BumkOgnST+VPeSC0wI2Nmw3/yFvIouYb6yWbD22B/ytIRfXlrGYwET3TmgX58D48yu6Qz X-Received: by 2002:a05:6a00:1c98:b0:540:d461:f9d8 with SMTP id y24-20020a056a001c9800b00540d461f9d8mr19368728pfw.29.1663610926033; Mon, 19 Sep 2022 11:08:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663610926; cv=none; d=google.com; s=arc-20160816; b=dCbQIioC/EFOYkarI4I/6gRk2VSWhMlXEoe4debnvVuWIrC8N1gtms6OW4Gr2MlorQ 41aMNb9MMCOkdhl59FgDH0CLikr23flbstXyi7GfTpT7oU2yBpQqrOF5qcSdfokXS+Lb vTkV3idx5XpM28FAQOFqW1LFSKEIRHX6sBHLNlzIPRYI6yxb2639rqZjKsa83B3+kLIy l1Lph7iWtC0cbKQcf/L6AVYZhnV2jYqfCCltLzlpW2ZVeRtvMdlHGj/2Pm2+BV7QL3NY Fbq19uO3TSgvYjUXMSuAPsUqD4Z6O3In75uDhTt1cLXOMJVhzJCFkQJ4CSg8VFo8uqdj 3mjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:dkim-signature:from; bh=d7mgKUnVCfrgkyGqmQzUJTvvGo3IZOIgUBZZ0DNTb8Q=; b=DztWH/WEf+J0U2KiWKxAIJFKYLcIbIghKyrQlxi8NuU/rOYIMtDGSc/3Cmg4ZdCj5V 65/eqAd1JqClgmxdy1FjYyHRC/PuQbKy3xmWeKvDTOHVPNv98cfo40eHulD/VtjUcWnk 2jqrMwrDtfKVSB0WbWBO3GRAHPyhBNiIMFpHmul2EjdzY2oB3n9J4NJ9qbBH4djScDGd /JHD6as4Vfc8DhttxFFIkg6mZx6UyxfXuEbaFJhDUPjOUzKWTyvEIfJg1t3ecVCRSXDb eiFiwbOdZEgB8IjPIT+62l7Tph29MgymPEJj1SyMYcVS1uliz3gy8MN1jACBqpknZSlZ 4x0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cutebit.org header.s=mail header.b=Xg+liSKc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cutebit.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c17-20020a170902d49100b001782d9fbbd4si30231248plg.277.2022.09.19.11.08.34; Mon, 19 Sep 2022 11:08:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cutebit.org header.s=mail header.b=Xg+liSKc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cutebit.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231265AbiISRfZ (ORCPT + 99 others); Mon, 19 Sep 2022 13:35:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231132AbiISRfS (ORCPT ); Mon, 19 Sep 2022 13:35:18 -0400 Received: from hutie.ust.cz (unknown [IPv6:2a03:3b40:fe:f0::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 297E337F9D for ; Mon, 19 Sep 2022 10:35:02 -0700 (PDT) From: =?UTF-8?q?Martin=20Povi=C5=A1er?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cutebit.org; s=mail; t=1663608899; bh=d7mgKUnVCfrgkyGqmQzUJTvvGo3IZOIgUBZZ0DNTb8Q=; h=From:To:Cc:Subject:Date; b=Xg+liSKcnXx0197eHUxd/Uj9XdbE8M9EHtbSry38u4R02iAoyBeA5XNucQRba4liV /aV6rfGgdN7z8d5XnKEeYFYpihTrHzybfRvEWGDt/7QjtLFfp5QY2ZLZpw8y7T5BJB iS/9Urv3RPVoBaPfM4Z4IMotfYuLqGvFKt0mqDNo= To: Liam Girdwood , Mark Brown Cc: navada@ti.com, Charles Keepax , Stephen Kitt , Dan Murphy , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Martin=20Povi=C5=A1er?= Subject: [PATCH] ASoC: tas2770: Reinit regcache on reset Date: Mon, 19 Sep 2022 19:34:53 +0200 Message-Id: <20220919173453.84292-1-povik+lin@cutebit.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_FAIL,SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On probe of the ASoC component, the device is reset but the regcache is retained. This means the regcache gets out of sync if the codec is rebound to a sound card for a second time. Fix it by reinitializing the regcache to defaults after the device is reset. Fixes: b0bcbe615756 ("ASoC: tas2770: Fix calling reset in probe") Signed-off-by: Martin PoviĊĦer --- sound/soc/codecs/tas2770.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/codecs/tas2770.c b/sound/soc/codecs/tas2770.c index bb653b664146..b6765235a4b3 100644 --- a/sound/soc/codecs/tas2770.c +++ b/sound/soc/codecs/tas2770.c @@ -495,6 +495,8 @@ static struct snd_soc_dai_driver tas2770_dai_driver[] = { }, }; +static const struct regmap_config tas2770_i2c_regmap; + static int tas2770_codec_probe(struct snd_soc_component *component) { struct tas2770_priv *tas2770 = @@ -508,6 +510,7 @@ static int tas2770_codec_probe(struct snd_soc_component *component) } tas2770_reset(tas2770); + regmap_reinit_cache(tas2770->regmap, &tas2770_i2c_regmap); return 0; } -- 2.33.0