فهرست منبع

asoc: codecs: wcd938x: Fix volatile register function

Fix the volatile register function to return false
if the registers are not volatile so that the reads
will happen from cache and this improves read timing.

Change-Id: I73149be3855be09a71ad61a6f3143038a7ba029b
Signed-off-by: Karthikeyan Mani <[email protected]>
Karthikeyan Mani 5 سال پیش
والد
کامیت
9e013b2d5a
1فایلهای تغییر یافته به همراه5 افزوده شده و 3 حذف شده
  1. 5 3
      asoc/codecs/wcd938x/wcd938x-regmap.c

+ 5 - 3
asoc/codecs/wcd938x/wcd938x-regmap.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/regmap.h>
@@ -494,8 +494,10 @@ static bool wcd938x_volatile_register(struct device *dev, unsigned int reg)
 {
 	if(reg <= WCD938X_BASE_ADDRESS)
 		return 0;
-	return (wcd938x_reg_access[WCD938X_REG(reg)] & RD_REG)
-		& ~(wcd938x_reg_access[WCD938X_REG(reg)] & WR_REG);
+	if ((wcd938x_reg_access[WCD938X_REG(reg)] & RD_REG)
+		&& !(wcd938x_reg_access[WCD938X_REG(reg)] & WR_REG))
+		return true;
+	return false;
 }
 
 struct regmap_config wcd938x_regmap_config = {