linux-stable/include
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
..
acpi More power management updates for 5.11-rc1 2020-12-22 14:12:10 -08:00
asm-generic local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
clocksource
crypto
drm
dt-bindings The core framework got some nice improvements this time around. We gained the 2020-12-21 10:39:37 -08:00
keys
kunit
kvm KVM: arm64: Replace KVM_ARM_PMU with HW_PERF_EVENTS 2021-01-04 16:50:16 +00:00
linux cros_ec_commands: Add EC_CODEC_I2S_RX_RESET 2021-01-19 14:09:22 +00:00
math-emu
media
memory
misc
net Networking fixes for 5.11-rc3, including fixes from netfilter, wireless 2021-01-05 12:38:56 -08:00
pcmcia
ras
rdma RDMA 5.11 pull request 2020-12-16 13:42:26 -08:00
scsi SCSI misc on 20201216 2020-12-16 13:34:31 -08:00
soc include/soc: remove headers for EZChip NPS 2021-01-05 12:59:41 -08:00
sound ASoC: soc-component: add snd_soc_component_read/write_field() 2021-01-27 13:06:51 +00:00
target
trace Merge branch 'kvm-master' into kvm-next 2021-01-07 18:06:52 -05:00
uapi block-5.11-2021-01-10 2021-01-10 12:53:08 -08:00
vdso
video
xen