regmap: Use pad_bits and reg_bits when determining register format.
authorMarc Reilly <marc@cpdesign.com.au>
Fri, 16 Mar 2012 01:11:43 +0000 (12:11 +1100)
committerSimone Willett <swillett@nvidia.com>
Sun, 15 Apr 2012 21:06:57 +0000 (14:06 -0700)
commit7261876e490b84820e62750e75fe59ad1069098c
tree9bcacbbc27b06a10285c06ba23affd6a7e565fa8
parent13e02a6fe4d6a67423f1ac6acb470a28773bcfa5
regmap: Use pad_bits and reg_bits when determining register format.

This change combines any padding bits into the register address bits when
determining register format handlers to use the next byte-divisible
register size.
A reg_shift member is introduced to the regmap struct to enable fixup
of the reg format.
Format handlers now take an extra parameter specifying the number of
bits to shift the value by.

Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
(cherry picked from commit d939fb9a78b4743bc4bc3cc415894ed42050c5cc)

Change-Id: I80921cfa4dd6aea5e7038927a313baeb347689e2
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/96499
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
drivers/base/regmap/internal.h
drivers/base/regmap/regmap.c