]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/commit
regmap: introduce tables for readable/writeable/volatile/precious checks
authorDavide Ciminaghi <ciminaghi@gnudd.com>
Tue, 20 Nov 2012 14:20:30 +0000 (15:20 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 21 Nov 2012 02:10:31 +0000 (11:10 +0900)
commit76aad392f75e6ce5be3f106554e16f7ff96543e5
tree00d1ef2dad497331dca8860e7ecc9474d0bab7b5
parent3afa24f7ad0a1ab5478f1e9a6c4df1acf52171d1
regmap: introduce tables for readable/writeable/volatile/precious checks

Many of the regmap enabled drivers implementing one or more of the
readable, writeable, volatile and precious methods use the same code
pattern:

return ((reg >= X && reg <= Y) || (reg >= W && reg <= Z) || ...)

Switch to a data driven approach, using tables to describe
readable/writeable/volatile and precious registers ranges instead.
The table based check can still be overridden by passing the usual function
pointers via struct regmap_config.

Signed-off-by: Davide Ciminaghi <ciminaghi@gnudd.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/base/regmap/internal.h
drivers/base/regmap/regmap.c
include/linux/regmap.h