]> www.infradead.org Git - users/jedix/linux-maple.git/commit
regmap: sdw-mbq: Add support for further MBQ register sizes
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Tue, 7 Jan 2025 15:44:05 +0000 (15:44 +0000)
committerMark Brown <broonie@kernel.org>
Tue, 7 Jan 2025 20:20:59 +0000 (20:20 +0000)
commitfdd9ef3dce98e035d21c17fac587cb6e3c7706fd
treea007cf66eaa3c2a3187308d2c77e0e50dec9ea72
parentb21468e83b787ab31aa9df8f429d2ca61def0cc9
regmap: sdw-mbq: Add support for further MBQ register sizes

SoundWire MBQ register maps typically contain a variety of register
sizes, which doesn't map ideally to the regmap abstraction which
expects register maps to have a consistent size. Currently the MBQ
register map only allows 16-bit registers to be defined, however
this leads to complex CODEC driver implementations with an 8-bit
register map and a 16-bit MBQ, every control will then have a custom
get and put handler that allows them to access different register
maps. Further more 32-bit MBQ quantities are not currently supported.

Add support for additional MBQ sizes and to avoid the complexity
of multiple register maps treat the val_size as a maximum size for
the register map. Within the regmap use an ancillary callback to
determine how many bytes to actually read/write to the hardware for
a specific register. In the case that no callback is defined the
behaviour defaults back to the existing behaviour of a fixed size
register map.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250107154408.814455-4-ckeepax@opensource.cirrus.com
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regmap-sdw-mbq.c
include/linux/regmap.h