]> git.karo-electronics.de Git - karo-tx-linux.git/commit
regmap: add DT endianness binding support.
authorXiubo Li <Li.Xiubo@freescale.com>
Tue, 15 Jul 2014 04:23:02 +0000 (12:23 +0800)
committerMark Brown <broonie@linaro.org>
Sat, 16 Aug 2014 21:56:23 +0000 (16:56 -0500)
commitd647c199510c2c126ac03ecbea51086e10126a40
tree5eb1dbbd005c41474dc15d3482d48bc854e0d2f2
parent7d1311b93e58ed55f3a31cc8f94c4b8fe988a2b9
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>
drivers/base/regmap/regmap-i2c.c
drivers/base/regmap/regmap-spi.c
drivers/base/regmap/regmap.c