Skip to content

Commit 95856d1

Browse files
Srinivas-Kandagatlabroonie
authored andcommitted
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: 5222720 ("regmap: sdw: Remove 8-bit value size restriction") Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20230523154747.5429-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 3981514 commit 95856d1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/base/regmap/regmap-sdw.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ static int regmap_sdw_config_check(const struct regmap_config *config)
5959
if (config->pad_bits != 0)
6060
return -ENOTSUPP;
6161

62+
/* Only bulk writes are supported not multi-register writes */
63+
if (config->can_multi_write)
64+
return -ENOTSUPP;
65+
6266
return 0;
6367
}
6468

0 commit comments

Comments
 (0)