summaryrefslogtreecommitdiffstats
path: root/include/regmap.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-03-24 13:19:34 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-04-14 09:13:19 +0200
commitef46f2db0001d4d5b66ddd34346aa36625dbf452 (patch)
tree2a87a67f0e577ceb3e23668b51893789218d1e6a /include/regmap.h
parentd32a774ebbe8465c84e279a577d458890ef326e7 (diff)
downloadbarebox-ef46f2db0001d4d5b66ddd34346aa36625dbf452.tar.gz
barebox-ef46f2db0001d4d5b66ddd34346aa36625dbf452.tar.xz
regmap-mmio: Add big endian support
Add support for parsing the big-endian device tree property. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/regmap.h')
-rw-r--r--include/regmap.h28
1 files changed, 13 insertions, 15 deletions
diff --git a/include/regmap.h b/include/regmap.h
index 3bcd9fe038..4172c00bd2 100644
--- a/include/regmap.h
+++ b/include/regmap.h
@@ -2,6 +2,14 @@
#ifndef __REGMAP_H
#define __REGMAP_H
+enum regmap_endian {
+ /* Unspecified -> 0 -> Backwards compatible default */
+ REGMAP_ENDIAN_DEFAULT = 0,
+ REGMAP_ENDIAN_BIG,
+ REGMAP_ENDIAN_LITTLE,
+ REGMAP_ENDIAN_NATIVE,
+};
+
/**
* Configuration for the register map of a device.
*
@@ -26,6 +34,9 @@ struct regmap_config {
int val_bits;
unsigned int max_register;
+
+ enum regmap_endian reg_format_endian;
+ enum regmap_endian val_format_endian;
};
typedef int (*regmap_hw_reg_read)(void *context, unsigned int reg,
@@ -36,6 +47,8 @@ typedef int (*regmap_hw_reg_write)(void *context, unsigned int reg,
struct regmap_bus {
regmap_hw_reg_write reg_write;
regmap_hw_reg_read reg_read;
+ enum regmap_endian reg_format_endian_default;
+ enum regmap_endian val_format_endian_default;
};
struct device_d;
@@ -49,21 +62,6 @@ struct regmap *regmap_init(struct device_d *dev,
struct clk;
/**
- * of_regmap_init_mmio_clk() - Initialise register map with register clock
- *
- * @np: Device node that will be interacted with
- * @clk_id: register clock consumer ID
- * @regs: Pointer to memory-mapped IO region
- * @config: Configuration for register map
- *
- * The return value will be an ERR_PTR() on error or a valid pointer to
- * a struct regmap.
- */
-struct regmap *of_regmap_init_mmio_clk(struct device_node *np, const char *clk_id,
- void __iomem *regs,
- const struct regmap_config *config);
-
-/**
* regmap_init_mmio_clk() - Initialise register map with register clock
*
* @dev: Device that will be interacted with