diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-05-08 19:21:51 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-05-08 19:21:51 +0100 |
commit | ed63ba15d7830c30077dbb33c94242be01e45a18 (patch) | |
tree | 8165313975d57f025e640d33768dbc31493ce5b7 /drivers/base | |
parent | 5015f8a5ced7039de354c1103b0912f5a64fab03 (diff) | |
parent | dd5a440a31fae6e459c0d6271dddd62825505361 (diff) | |
download | linux-ed63ba15d7830c30077dbb33c94242be01e45a18.tar.gz linux-ed63ba15d7830c30077dbb33c94242be01e45a18.tar.bz2 linux-ed63ba15d7830c30077dbb33c94242be01e45a18.zip |
Merge 6.9-rc7 into char-misc-testing
We need the char-misc changes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/regmap/regmap.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index 5cb425f6f02d..0a34dd3c4f38 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -2839,6 +2839,43 @@ int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val) EXPORT_SYMBOL_GPL(regmap_read); /** + * regmap_read_bypassed() - Read a value from a single register direct + * from the device, bypassing the cache + * + * @map: Register map to read from + * @reg: Register to be read from + * @val: Pointer to store read value + * + * A value of zero will be returned on success, a negative errno will + * be returned in error cases. + */ +int regmap_read_bypassed(struct regmap *map, unsigned int reg, unsigned int *val) +{ + int ret; + bool bypass, cache_only; + + if (!IS_ALIGNED(reg, map->reg_stride)) + return -EINVAL; + + map->lock(map->lock_arg); + + bypass = map->cache_bypass; + cache_only = map->cache_only; + map->cache_bypass = true; + map->cache_only = false; + + ret = _regmap_read(map, reg, val); + + map->cache_bypass = bypass; + map->cache_only = cache_only; + + map->unlock(map->lock_arg); + + return ret; +} +EXPORT_SYMBOL_GPL(regmap_read_bypassed); + +/** * regmap_raw_read() - Read raw data from the device * * @map: Register map to read from |