summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMario Six <mario.six@gdsys.cc>2018-10-15 09:24:14 +0200
committerSimon Glass <sjg@chromium.org>2018-11-14 09:16:27 -0800
commit9b77fe3b80b038af7114f7dae4934773bb026f8e (patch)
tree81d0fa83f731c7e56df5b93955e58a1bb0d7592f /include
parent45ef7f55c79f67be8bf0b4e6de549269c1fd4971 (diff)
regmap: Add endianness support
Add support for switching the endianness of regmap accesses via the "little-endian", "big-endian", and "native-endian" boolean properties in the device tree. The default endianness is native endianness. Signed-off-by: Mario Six <mario.six@gdsys.cc> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/regmap.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/regmap.h b/include/regmap.h
index 3b7eea5f49..98860c2732 100644
--- a/include/regmap.h
+++ b/include/regmap.h
@@ -23,6 +23,19 @@ enum regmap_size_t {
};
/**
+ * enum regmap_endianness_t - Endianness for regmap reads and writes
+ *
+ * @REGMAP_NATIVE_ENDIAN: Native endian read/write accesses
+ * @REGMAP_LITTLE_ENDIAN: Little endian read/write accesses
+ * @REGMAP_BIG_ENDIAN: Big endian read/write accesses
+ */
+enum regmap_endianness_t {
+ REGMAP_NATIVE_ENDIAN,
+ REGMAP_LITTLE_ENDIAN,
+ REGMAP_BIG_ENDIAN,
+};
+
+/**
* struct regmap_range - a register map range
*
* @start: Start address
@@ -40,6 +53,7 @@ struct regmap_range {
* @ranges: Array of ranges
*/
struct regmap {
+ enum regmap_endianness_t endianness;
int range_count;
struct regmap_range ranges[0];
};