Deleted (upstreamed): bcm27xx/patches-5.10/950-0669-drm-vc4-hdmi-Make-sure-the-device-is-powered-with-CE.patch [1] bcm27xx/patches-5.10/950-0672-drm-vc4-hdmi-Move-initial-register-read-after-pm_run.patch [1] gemini/patches-5.10/0003-ARM-dts-gemini-NAS4220-B-fis-index-block-with-128-Ki.patch [2] Manually rebased: bcm27xx/patches-5.10/950-0675-drm-vc4-hdmi-Drop-devm-interrupt-handler-for-CEC-int.patch Manually reverted: generic/pending-5.10/860-Revert-ASoC-mediatek-Check-for-error-clk-pointer.patch [3] [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.94&id=55b10b88ac8654fc2f31518aa349a2e643b37f18 [2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.94&id=958a8819d41420d7a74ed922a09cacc0ba3a4218 [3] https://lore.kernel.org/all/trinity-2a727d96-0335-4d03-8f30-e22a0e10112d-1643363480085@3c-app-gmx-bap33/ Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
52 lines
2.3 KiB
Diff
52 lines
2.3 KiB
Diff
From 02d6fdecb9c38de19065f6bed8d5214556fd061d Mon Sep 17 00:00:00 2001
|
|
From: Ansuel Smith <ansuelsmth@gmail.com>
|
|
Date: Thu, 4 Nov 2021 16:00:40 +0100
|
|
Subject: regmap: allow to define reg_update_bits for no bus configuration
|
|
|
|
Some device requires a special handling for reg_update_bits and can't use
|
|
the normal regmap read write logic. An example is when locking is
|
|
handled by the device and rmw operations requires to do atomic operations.
|
|
Allow to declare a dedicated function in regmap_config for
|
|
reg_update_bits in no bus configuration.
|
|
|
|
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
|
Link: https://lore.kernel.org/r/20211104150040.1260-1-ansuelsmth@gmail.com
|
|
Signed-off-by: Mark Brown <broonie@kernel.org>
|
|
---
|
|
drivers/base/regmap/regmap.c | 1 +
|
|
include/linux/regmap.h | 7 +++++++
|
|
2 files changed, 8 insertions(+)
|
|
|
|
--- a/drivers/base/regmap/regmap.c
|
|
+++ b/drivers/base/regmap/regmap.c
|
|
@@ -842,6 +842,7 @@ struct regmap *__regmap_init(struct devi
|
|
if (!bus) {
|
|
map->reg_read = config->reg_read;
|
|
map->reg_write = config->reg_write;
|
|
+ map->reg_update_bits = config->reg_update_bits;
|
|
|
|
map->defer_caching = false;
|
|
goto skip_format_initialization;
|
|
--- a/include/linux/regmap.h
|
|
+++ b/include/linux/regmap.h
|
|
@@ -289,6 +289,11 @@ typedef void (*regmap_unlock)(void *);
|
|
* read operation on a bus such as SPI, I2C, etc. Most of the
|
|
* devices do not need this.
|
|
* @reg_write: Same as above for writing.
|
|
+ * @reg_update_bits: Optional callback that if filled will be used to perform
|
|
+ * all the update_bits(rmw) operation. Should only be provided
|
|
+ * if the function require special handling with lock and reg
|
|
+ * handling and the operation cannot be represented as a simple
|
|
+ * update_bits operation on a bus such as SPI, I2C, etc.
|
|
* @fast_io: Register IO is fast. Use a spinlock instead of a mutex
|
|
* to perform locking. This field is ignored if custom lock/unlock
|
|
* functions are used (see fields lock/unlock of struct regmap_config).
|
|
@@ -366,6 +371,8 @@ struct regmap_config {
|
|
|
|
int (*reg_read)(void *context, unsigned int reg, unsigned int *val);
|
|
int (*reg_write)(void *context, unsigned int reg, unsigned int val);
|
|
+ int (*reg_update_bits)(void *context, unsigned int reg,
|
|
+ unsigned int mask, unsigned int val);
|
|
|
|
bool fast_io;
|
|
|