summaryrefslogtreecommitdiff
path: root/drivers/base/regmap/internal.h
diff options
context:
space:
mode:
authorDavide Ciminaghi <ciminaghi@gnudd.com>2012-11-20 14:20:30 (GMT)
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-11-21 02:10:31 (GMT)
commit76aad392f75e6ce5be3f106554e16f7ff96543e5 (patch)
tree00d1ef2dad497331dca8860e7ecc9474d0bab7b5 /drivers/base/regmap/internal.h
parent3afa24f7ad0a1ab5478f1e9a6c4df1acf52171d1 (diff)
downloadlinux-76aad392f75e6ce5be3f106554e16f7ff96543e5.tar.xz
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>
Diffstat (limited to 'drivers/base/regmap/internal.h')
-rw-r--r--drivers/base/regmap/internal.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/base/regmap/internal.h b/drivers/base/regmap/internal.h
index 2cd01b5..288e135 100644
--- a/drivers/base/regmap/internal.h
+++ b/drivers/base/regmap/internal.h
@@ -55,6 +55,10 @@ struct regmap {
bool (*readable_reg)(struct device *dev, unsigned int reg);
bool (*volatile_reg)(struct device *dev, unsigned int reg);
bool (*precious_reg)(struct device *dev, unsigned int reg);
+ const struct regmap_access_table *wr_table;
+ const struct regmap_access_table *rd_table;
+ const struct regmap_access_table *volatile_table;
+ const struct regmap_access_table *precious_table;
u8 read_flag_mask;
u8 write_flag_mask;