Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9e013b2d authored by Karthikeyan Mani's avatar Karthikeyan Mani Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarKarthikeyan Mani <kmani@codeaurora.org>
parent c63ec8cd
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
// 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 = {