[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230523154747.5429-1-srinivas.kandagatla@linaro.org>
Date: Tue, 23 May 2023 16:47:47 +0100
From: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
To: broonie@...nel.org
Cc: gregkh@...uxfoundation.org, rafael@...nel.org,
ckeepax@...nsource.cirrus.com, tanureal@...nsource.cirrus.com,
linux-kernel@...r.kernel.org, alsa-devel@...a-project.org,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Subject: [PATCH] regmap: sdw: check for invalid multi-register writes config
SoundWire code as it is only supports Bulk register writes and
it does not support multi-register writes.
Any drivers that set can_multi_write and use regmap_multi_reg_write() will
easily endup with programming the hardware incorrectly without any errors.
So, add this check in bus code to be able to validate the drivers config.
Fixes: 522272047dc6 ("regmap: sdw: Remove 8-bit value size restriction")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
---
drivers/base/regmap/regmap-sdw.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/base/regmap/regmap-sdw.c b/drivers/base/regmap/regmap-sdw.c
index 09899ae99fc1..159c0b740b00 100644
--- a/drivers/base/regmap/regmap-sdw.c
+++ b/drivers/base/regmap/regmap-sdw.c
@@ -59,6 +59,10 @@ static int regmap_sdw_config_check(const struct regmap_config *config)
if (config->pad_bits != 0)
return -ENOTSUPP;
+ /* Only bulk writes are supported not multi-register writes */
+ if (config->can_multi_write)
+ return -ENOTSUPP;
+
return 0;
}
--
2.21.0
Powered by blists - more mailing lists