Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp804793yba; Wed, 3 Apr 2019 20:59:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxUO2PLczNHhRhYN4k+Q4URUd2z+fw9PRPWUDFn3VaJOcQYeKVmtnzLMvKguKE2M0iLrQJn X-Received: by 2002:a63:ce50:: with SMTP id r16mr402592pgi.89.1554350362418; Wed, 03 Apr 2019 20:59:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554350362; cv=none; d=google.com; s=arc-20160816; b=qI/ZbIdXBiQ5CmgKKPMG/V2Mv+zqthDZS7UWV86/Va/WjR3AjBr1prPOHyDbU6arXR i6Hspk92HpuHyY3rEyskQoNRtqT+LLV2vIGAjZKnx0OGNUfV7LqIbb6qWNQlikPw1Idu k20oCHXehXx1s7IhrF9BnV9t6xIceboTVyXdtdE47fvXU5Egm3ONFr2BnWT/S6hTH5Ux NZAdEQtbZpND2ayKbzokNELpCD5xEFAy3D3MiXfzwty0KtYBkaz+48MrPiGvAtDwdlwW 3NZBKZ7cfvmomWILv1cqA08Q3awTqenx8kZ3HDPbRnGBki5Vdj4LaHMB/GW1zzEQxOCQ JG1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=LZYDK/917zmsIrovjrF+Ag69Sf6fqCbTrZgvRbkjgPY=; b=HL6PkczUh7RjBm7eFiFTik6kXMqAl0p428slnoxK6Y6VvUL6SrE5MKJTSp5MNjK8Mj YfgblXGJvqRkyaE4WrSIjvsK6SCqp+ju0U4a3H/jFUfrMOVQQRwlY1rJZDhCgg8eiX8s h5SPDZZZKSn69W4aGoAMyQbFfTmfLpfyZc9Aziu74uuyFOVOrd4myKO4gjbojY4peSTY lghfWbgiE+rXcsiuqDR2vrbppzkSLFOw70QEhHGp5bhx/9inKbWhvx0RWpXOigrmcNBk b86gE0UOrETWPzQlmL5kmZViuRGOFharfDoR1vM9briCplFNqk9DKUaqoJrvr6pvEOYl 77sw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t64si15240904pgc.65.2019.04.03.20.59.07; Wed, 03 Apr 2019 20:59:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729012AbfDDD5R (ORCPT + 99 others); Wed, 3 Apr 2019 23:57:17 -0400 Received: from regular1.263xmail.com ([211.150.70.196]:33054 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728870AbfDDD5Q (ORCPT ); Wed, 3 Apr 2019 23:57:16 -0400 Received: from sugar.zhang?rock-chips.com (unknown [192.168.167.70]) by regular1.263xmail.com (Postfix) with ESMTP id 4827A755; Thu, 4 Apr 2019 11:57:14 +0800 (CST) X-263anti-spam: KSV:0;BIG:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ADDR-CHECKED4: 1 X-ABS-CHECKED: 1 X-SKE-CHECKED: 1 X-ANTISPAM-LEVEL: 2 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P5380T140554337773312S1554350230917190_; Thu, 04 Apr 2019 11:57:13 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <1692031030d50d4299684085f0c8431a> X-RL-SENDER: sugar.zhang@rock-chips.com X-SENDER: zxg@rock-chips.com X-LOGIN-NAME: sugar.zhang@rock-chips.com X-FST-TO: heiko@sntech.de X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 From: Sugar Zhang To: heiko@sntech.de, broonie@kernel.org Cc: Liam Girdwood , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Sugar Zhang Subject: [PATCH v1 11/12] ASoC: rockchip: pdm: Mark RXFIFO_DATA as volatile and precious Date: Thu, 4 Apr 2019 11:57:08 +0800 Message-Id: <1554350228-24440-1-git-send-email-sugar.zhang@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554298856-59028-1-git-send-email-sugar.zhang@rock-chips.com> References: <1554298856-59028-1-git-send-email-sugar.zhang@rock-chips.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch marks RXFIFO_DATA as precious to avoid being read outside a call from the driver, such as regmap debugfs Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_pdm.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c index 955cdc2..e89beeb 100644 --- a/sound/soc/rockchip/rockchip_pdm.c +++ b/sound/soc/rockchip/rockchip_pdm.c @@ -415,6 +415,7 @@ static bool rockchip_pdm_rd_reg(struct device *dev, unsigned int reg) case PDM_INT_CLR: case PDM_INT_ST: case PDM_DATA_VALID: + case PDM_RXFIFO_DATA: case PDM_VERSION: return true; default: @@ -429,6 +430,17 @@ static bool rockchip_pdm_volatile_reg(struct device *dev, unsigned int reg) case PDM_FIFO_CTRL: case PDM_INT_CLR: case PDM_INT_ST: + case PDM_RXFIFO_DATA: + return true; + default: + return false; + } +} + +static bool rockchip_pdm_precious_reg(struct device *dev, unsigned int reg) +{ + switch (reg) { + case PDM_RXFIFO_DATA: return true; default: return false; @@ -451,6 +463,7 @@ static const struct regmap_config rockchip_pdm_regmap_config = { .writeable_reg = rockchip_pdm_wr_reg, .readable_reg = rockchip_pdm_rd_reg, .volatile_reg = rockchip_pdm_volatile_reg, + .precious_reg = rockchip_pdm_precious_reg, .cache_type = REGCACHE_FLAT, }; -- 2.7.4