From patchwork Mon Jul 12 06:11:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 473850 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D89A7C07E9B for ; Mon, 12 Jul 2021 07:23:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BEA0F6143E for ; Mon, 12 Jul 2021 07:23:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243859AbhGLH0h (ORCPT ); Mon, 12 Jul 2021 03:26:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:35324 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345089AbhGLHYw (ORCPT ); Mon, 12 Jul 2021 03:24:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CF8076112D; Mon, 12 Jul 2021 07:21:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626074510; bh=FcoA/rpXFQqGVm2CKUVo4beaIA44KbbY/dfV7nSVcd0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ftwO5leWGWLQoR6ow9tuCKnyaz/dDsJixicq6FL5wbTMLGjlth2thx4ORazNM73pH o0ItcNfWNW9CR7vXkfiaShQr0OMERutcBHy88aO2f8JiPaQmUyyz5kpq9haLh+UIs5 yHdVH06bP4AXA4sKSzRnH7IiWO7kqrZPeGExGIjY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bard Liao , Pierre-Louis Bossart , Mark Brown , Sasha Levin Subject: [PATCH 5.12 604/700] ASoC: rt5682-sdw: set regcache_cache_only false before reading RT5682_DEVICE_ID Date: Mon, 12 Jul 2021 08:11:27 +0200 Message-Id: <20210712061040.165551519@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060924.797321836@linuxfoundation.org> References: <20210712060924.797321836@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Bard Liao [ Upstream commit c0372bc873dd29f325ee908351e0bd5b08d4d608 ] RT5682_DEVICE_ID is a volatile register, we can not read it in cache only mode. Fixes: 03f6fc6de919 ("ASoC: rt5682: Add the soundwire support") Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210607222239.582139-14-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/rt5682-sdw.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/rt5682-sdw.c b/sound/soc/codecs/rt5682-sdw.c index 2b0f02e6c977..b4649b599eaa 100644 --- a/sound/soc/codecs/rt5682-sdw.c +++ b/sound/soc/codecs/rt5682-sdw.c @@ -400,6 +400,11 @@ static int rt5682_io_init(struct device *dev, struct sdw_slave *slave) pm_runtime_get_noresume(&slave->dev); + if (rt5682->first_hw_init) { + regcache_cache_only(rt5682->regmap, false); + regcache_cache_bypass(rt5682->regmap, true); + } + while (loop > 0) { regmap_read(rt5682->regmap, RT5682_DEVICE_ID, &val); if (val == DEVICE_ID) @@ -415,11 +420,6 @@ static int rt5682_io_init(struct device *dev, struct sdw_slave *slave) goto err_nodev; } - if (rt5682->first_hw_init) { - regcache_cache_only(rt5682->regmap, false); - regcache_cache_bypass(rt5682->regmap, true); - } - rt5682_calibrate(rt5682); if (rt5682->first_hw_init) {