Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2970826ybt; Mon, 29 Jun 2020 11:46:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlNjSjVj5PoxdmbVwJDYl5km/XlLfJLiy6B+9wiwPEaa+1YMBkUdXd0YC9HOMHkvnR8ghk X-Received: by 2002:a17:906:fa9b:: with SMTP id lt27mr14487398ejb.365.1593456419541; Mon, 29 Jun 2020 11:46:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593456419; cv=none; d=google.com; s=arc-20160816; b=lt5P7+14kglPaDzqN0fabOGmlPSDWB27aV2jcoUsYauhCu2oUn+Ov6vZ/axOg0mzjm 4fx3Qf+KTIMrqPU09C/SN3YTsbBkyeEpIjb40QB4UExs8wsqfx4Fup7MKa3u1gjvbTXV vf8Pr7xWGQ6csAPR+KLKFueIu9RDzbhg05LqKDCvR/KNrlJEaGC9rQLB/PLhsbZI2zzV RjW4jqzwvfHUqcog8JV5AJXSxKLoi1nP0PIAR7pPH5Bhl4g1wBFflH7s5ljZkf+i1oJF zPj1ZF7j/HeTNDmTkevD2rUD5ZiFBqcwkt6F+xgPZF1LNWGy35HrYodBot28hmnpohNg ueMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=0T+fKP5TySjEQOIG5l+MzVHfbjC8HuVCOoS6lZwHqUA=; b=u6XUpF3XhkNMMTNs9tHA7vEl+xFuSwKfG+6NKiwTNZ3oQmG/0aVy4u1gnY/Q9+oAPh dlJTJjoca64vNDwPOGJkA/p+/Ylrgw9coHu78vU6nwu4Wb0u1DTn7AM+gKyvD0zNG4vf wdu4S8YgvH0/HKA/Xamzg527C5SNr4NjGpf28+2T9X4SrI45uu9JSXrv0Qms91mjrhxm uztYm6bx/DHNjL99SY1aa3ud2YixLIgLDOtGkTSoYrtk45pBbHpvXQC/G4REIhiMxtSS zhnWEIrHWjOp9zIwCoCFwRYEhkeydtGYVBqq+I0u56cXsnYZ1Eee9gXu/t/12HjTFLBD 9fjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p2si204196edr.239.2020.06.29.11.46.36; Mon, 29 Jun 2020 11:46:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728145AbgF2Soh (ORCPT + 99 others); Mon, 29 Jun 2020 14:44:37 -0400 Received: from inva020.nxp.com ([92.121.34.13]:34260 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729140AbgF2SoC (ORCPT ); Mon, 29 Jun 2020 14:44:02 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id B9ADB1A10E4; Mon, 29 Jun 2020 08:54:20 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 6F80E1A01C6; Mon, 29 Jun 2020 08:54:15 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 179B8402F7; Mon, 29 Jun 2020 14:54:09 +0800 (SGT) From: Shengjiu Wang To: timur@kernel.org, nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: fsl_sai: Refine regcache usage with pm runtime Date: Mon, 29 Jun 2020 14:42:33 +0800 Message-Id: <1593412953-10897-1-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When there is dedicated power domain bound with device, after probing the power will be disabled, then registers are not accessible in fsl_sai_dai_probe(), so regcache only need to be enabled in end of probe() and regcache_mark_dirty should be moved to pm runtime resume callback function. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_sai.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index 9d436b0c5718..a22562f2df47 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -1016,6 +1016,7 @@ static int fsl_sai_probe(struct platform_device *pdev) platform_set_drvdata(pdev, sai); pm_runtime_enable(&pdev->dev); + regcache_cache_only(sai->regmap, true); ret = devm_snd_soc_register_component(&pdev->dev, &fsl_component, &fsl_sai_dai, 1); @@ -1107,7 +1108,6 @@ static int fsl_sai_runtime_suspend(struct device *dev) clk_disable_unprepare(sai->bus_clk); regcache_cache_only(sai->regmap, true); - regcache_mark_dirty(sai->regmap); return 0; } @@ -1137,6 +1137,7 @@ static int fsl_sai_runtime_resume(struct device *dev) } regcache_cache_only(sai->regmap, false); + regcache_mark_dirty(sai->regmap); regmap_write(sai->regmap, FSL_SAI_TCSR(ofs), FSL_SAI_CSR_SR); regmap_write(sai->regmap, FSL_SAI_RCSR(ofs), FSL_SAI_CSR_SR); usleep_range(1000, 2000); -- 2.21.0