]> git.baikalelectronics.ru Git - kernel.git/commit
regmap: implement register striding
authorStephen Warren <swarren@nvidia.com>
Mon, 9 Apr 2012 19:40:24 +0000 (13:40 -0600)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 13 Apr 2012 10:29:21 +0000 (11:29 +0100)
commit5320649cac1246e52b174558f6fdf5a54cb26421
treeddbfb4aaa655a1efe5cc688fe47b879d3d09e688
parentdcb799ee42116c08ea9489ea3c221fbd03af3f5c
regmap: implement register striding

regmap_config.reg_stride is introduced. All extant register addresses
are a multiple of this value. Users of serial-oriented regmap busses will
typically set this to 1. Users of the MMIO regmap bus will typically set
this based on the value size of their registers, in bytes, so 4 for a
32-bit register.

Throughout the regmap code, actual register addresses are used. Wherever
the register address is used to index some array of values, the address
is divided by the stride to determine the index, or vice-versa. Error-
checking is added to all entry-points for register address data to ensure
that register addresses actually satisfy the specified stride. The MMIO
bus ensures that the specified stride is large enough for the register
size.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/base/regmap/internal.h
drivers/base/regmap/regcache-lzo.c
drivers/base/regmap/regcache-rbtree.c
drivers/base/regmap/regcache.c
drivers/base/regmap/regmap-debugfs.c
drivers/base/regmap/regmap-irq.c
drivers/base/regmap/regmap-mmio.c
drivers/base/regmap/regmap.c
include/linux/regmap.h