From: Sugar Zhang Date: Thu, 4 Apr 2019 03:57:08 +0000 (+0800) Subject: ASoC: rockchip: pdm: Mark RXFIFO_DATA as volatile and precious X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=b126fc07328749269021ac53173f9afdd6947248;p=openwrt%2Fstaging%2Fblogic.git ASoC: rockchip: pdm: Mark RXFIFO_DATA as volatile and precious 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 Signed-off-by: Mark Brown --- diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c index 068453596470..6c0f242db5ef 100644 --- a/sound/soc/rockchip/rockchip_pdm.c +++ b/sound/soc/rockchip/rockchip_pdm.c @@ -417,6 +417,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: @@ -431,6 +432,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; @@ -453,6 +465,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, };