summaryrefslogtreecommitdiffstats
path: root/drivers/base/regmap/regmap-i2c.c
diff options
context:
space:
mode:
authorXiubo Li <Li.Xiubo@freescale.com>2014-07-15 06:23:02 +0200
committerMark Brown <broonie@linaro.org>2014-08-16 23:56:23 +0200
commitd647c199510c2c126ac03ecbea51086e10126a40 (patch)
tree5eb1dbbd005c41474dc15d3482d48bc854e0d2f2 /drivers/base/regmap/regmap-i2c.c
parentLinux 3.17-rc1 (diff)
downloadlinux-d647c199510c2c126ac03ecbea51086e10126a40.tar.xz
linux-d647c199510c2c126ac03ecbea51086e10126a40.zip
regmap: add DT endianness binding support.
For many drivers which will support rich endianness of Devices need define DT properties by itself with the binding support. The endianness using regmap: Index Device Properties if needs bytes-swap, or just ignore it ------------------------------------------------------------- 1 BE 'big-endian' 2 LE 'little-endian' The properties include all the register values and the buffers. And these properties are very usful for the MMIO devices: Such as: a memory-mapped device, on one SoC is in BE mode, while in another SoC will be in LE mode, and the CPU will always in LE mode. For the first case, we must use cpu_to_be32/be32_to_cpu for 32-bit registers accessing, so the 'big-endian' property is needed. For the second case, we can just ignore the bytes-swap functions like cpu_to_le32/le32_to_cpu, so the 'little-endian' property could be abscent. And vice versa... Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/base/regmap/regmap-i2c.c')
-rw-r--r--drivers/base/regmap/regmap-i2c.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/base/regmap/regmap-i2c.c b/drivers/base/regmap/regmap-i2c.c
index ca193d1ef47c..053150a7f9f2 100644
--- a/drivers/base/regmap/regmap-i2c.c
+++ b/drivers/base/regmap/regmap-i2c.c
@@ -168,6 +168,8 @@ static struct regmap_bus regmap_i2c = {
.write = regmap_i2c_write,
.gather_write = regmap_i2c_gather_write,
.read = regmap_i2c_read,
+ .reg_format_endian_default = REGMAP_ENDIAN_BIG,
+ .val_format_endian_default = REGMAP_ENDIAN_BIG,
};
static const struct regmap_bus *regmap_get_i2c_bus(struct i2c_client *i2c,