]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
regmap: Add regmap_read_bypassed()
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Mon, 8 Apr 2024 10:18:00 +0000 (11:18 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 May 2024 10:14:26 +0000 (12:14 +0200)
commitf77180e514e083caa0532cd83d8ff4ebc54ff575
tree5e3742e375d105ebaad6395c56ab43108614829f
parent772d5729b5ff0df0d37b32db600ce635b2172f80
regmap: Add regmap_read_bypassed()

[ Upstream commit 70ee853eec5693fefd8348a2b049d9cb83362e58 ]

Add a regmap_read_bypassed() to allow reads from the hardware registers
while the regmap is in cache-only mode.

A typical use for this is to keep the cache in cache-only mode until
the hardware has reached a valid state, but one or more status registers
must be polled to determine when this state is reached.

For example, firmware download on the cs35l56 can take several seconds if
there are multiple amps sharing limited bus bandwidth. This is too long
to block in probe() so it is done as a background task. The device must
be soft-reset to reboot the firmware and during this time the registers are
not accessible, so the cache should be in cache-only. But the driver must
poll a register to detect when reboot has completed.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: 8a731fd37f8b ("ASoC: cs35l56: Move utility functions to shared file")
Link: https://msgid.link/r/20240408101803.43183-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/base/regmap/regmap.c
include/linux/regmap.h