aboutsummaryrefslogtreecommitdiff
path: root/include/regmap.h
diff options
context:
space:
mode:
authorPratyush Yadav <p.yadav@ti.com>2020-09-24 10:04:13 +0530
committerTom Rini <trini@konsulko.com>2020-09-30 11:55:22 -0400
commit7aa5ddffe7fbafe7ef828088ba1dbc76270300c5 (patch)
treea0d6b807b712d780a3ea7f5ea0c5dfcd2346b925 /include/regmap.h
parent78aaedba9f1b92335a4f0ce8344f6abf7a63dccb (diff)
downloadu-boot-7aa5ddffe7fbafe7ef828088ba1dbc76270300c5.zip
u-boot-7aa5ddffe7fbafe7ef828088ba1dbc76270300c5.tar.gz
u-boot-7aa5ddffe7fbafe7ef828088ba1dbc76270300c5.tar.bz2
regmap: Allow left shifting register offset before access
Drivers can configure it to adjust the final read/write location. Signed-off-by: Pratyush Yadav <p.yadav@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/regmap.h')
-rw-r--r--include/regmap.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/regmap.h b/include/regmap.h
index 19474e6..e6c59df 100644
--- a/include/regmap.h
+++ b/include/regmap.h
@@ -82,9 +82,12 @@ struct regmap_bus;
*
* @width: Width of the read/write operations. Defaults to
* REGMAP_SIZE_32 if set to 0.
+ * @reg_offset_shift Left shift the register offset by this value before
+ * performing read or write.
*/
struct regmap_config {
enum regmap_size_t width;
+ u32 reg_offset_shift;
};
/**
@@ -92,12 +95,15 @@ struct regmap_config {
*
* @width: Width of the read/write operations. Defaults to
* REGMAP_SIZE_32 if set to 0.
+ * @reg_offset_shift Left shift the register offset by this value before
+ * performing read or write.
* @range_count: Number of ranges available within the map
* @ranges: Array of ranges
*/
struct regmap {
enum regmap_endianness_t endianness;
enum regmap_size_t width;
+ u32 reg_offset_shift;
int range_count;
struct regmap_range ranges[0];
};