linux-stable/sound
Srinivas Kandagatla 1da0b9899a
ASoC: soc-component: add snd_soc_component_read/write_field()
It's often the case that we would write or read a particular field
in register. With the current soc_component apis, reading a particular
field in register would involve first read the register and then
perform shift operations.

Ex:
to read from a field mask of 0xf0

	val = snd_soc_component_read(component, reg);
	field = ((val & 0xf0) >> 0x4);

This is sometimes prone to errors and code become less readable!

With this new api we could just do
	field = snd_soc_component_read_field(component, reg, 0xf0);

this makes it bit simple, easy to write and less error prone!

This also applies to writing!

There are various places in kernel which provides such field interfaces
however soc_component seems to be missing this.

This patch is inspired by FIELD_GET/FIELD_PREP macros in include/linux/bitfield.h

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210126171749.1863-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-27 13:06:51 +00:00
..
ac97 ALSA: ac97: (cosmetic) align argument names 2020-09-03 09:27:27 +02:00
aoa ALSA: aoa: i2sbus: use DECLARE_COMPLETION_ONSTACK() macro 2020-09-03 09:26:52 +02:00
arm
atmel ALSA: atmel: ac97: clarify operator precedence 2020-09-03 09:27:34 +02:00
core sound fixes for 5.11-rc1 2020-12-23 15:11:08 -08:00
drivers ALSA: aloop: Constify ops structs 2020-11-21 09:30:35 +01:00
firewire Merge branch 'topic/usb-audio-refactoring' into for-next 2020-11-24 09:13:00 +01:00
hda Auxiliary Bus support tag for 5.11-rc1 2020-12-04 20:39:45 +00:00
i2c
isa ALSA: sb: Fix fall-through warnings for Clang 2020-11-21 09:29:26 +01:00
mips hal2: convert to dma_alloc_noncoherent 2020-09-25 06:20:44 +02:00
oss
parisc
pci ALSA: hda/via: Fix runtime PM for Clevo W35xSS 2021-01-04 16:34:43 +01:00
pcmcia
ppc powerpc updates for 5.11 2020-12-17 13:34:25 -08:00
sh
soc ASoC: soc-component: add snd_soc_component_read/write_field() 2021-01-27 13:06:51 +00:00
sparc ALSA: sparc: dbri: fix repeated word 'the' 2020-10-17 09:58:35 +02:00
spi
synth
usb ALSA: usb-audio: Add quirk for RC-505 2021-01-03 08:58:39 +01:00
x86 ALSA: hda: use consistent HDAudio spelling in comments/docs 2020-09-02 19:31:32 +02:00
xen
ac97_bus.c
Kconfig
last.c
Makefile
sound_core.c