From 7aa5ddffe7fbafe7ef828088ba1dbc76270300c5 Mon Sep 17 00:00:00 2001
From: Pratyush Yadav
Date: Thu, 24 Sep 2020 10:04:13 +0530
Subject: regmap: Allow left shifting register offset before access
Drivers can configure it to adjust the final read/write location.
Signed-off-by: Pratyush Yadav
Reviewed-by: Simon Glass
---
include/regmap.h | 6 ++++++
1 file changed, 6 insertions(+)
(limited to 'include')
diff --git a/include/regmap.h b/include/regmap.h
index 19474e6de12..e6c59dfbced 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];
};
--
cgit v1.2.3