diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-08-08 02:40:22 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-08-08 02:47:05 -0400 |
commit | 18694886bddb2d4d905535a0149aeef3b5f9c936 (patch) | |
tree | b18fb8477f049f1ad7b06022bf59a50f0201143d | |
parent | 2e2ae66df37a14c9b33889b243b0ae1352ada1dd (diff) |
regmap: Add precious registers to the driver interface
Some devices are sensitive to reads on their registers, especially for
things like clear on read interrupt status registers. Avoid creating
problems with these with things like debugfs by allowing drivers to tell
the core about them. If a register is marked as precious then the core
will not internally generate any reads of it.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | include/linux/regmap.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index aef2b36a8ccf..c878a4bf717e 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h | |||
@@ -33,6 +33,9 @@ struct spi_device; | |||
33 | * can be read from. | 33 | * can be read from. |
34 | * @volatile_register: Optional callback returning true if the register | 34 | * @volatile_register: Optional callback returning true if the register |
35 | * value can't be cached. | 35 | * value can't be cached. |
36 | * @precious_register: Optional callback returning true if the rgister | ||
37 | * should not be read outside of a call from the driver | ||
38 | * (eg, a clear on read interrupt status register). | ||
36 | */ | 39 | */ |
37 | struct regmap_config { | 40 | struct regmap_config { |
38 | int reg_bits; | 41 | int reg_bits; |
@@ -42,6 +45,7 @@ struct regmap_config { | |||
42 | bool (*writeable_reg)(struct device *dev, unsigned int reg); | 45 | bool (*writeable_reg)(struct device *dev, unsigned int reg); |
43 | bool (*readable_reg)(struct device *dev, unsigned int reg); | 46 | bool (*readable_reg)(struct device *dev, unsigned int reg); |
44 | bool (*volatile_reg)(struct device *dev, unsigned int reg); | 47 | bool (*volatile_reg)(struct device *dev, unsigned int reg); |
48 | bool (*precious_reg)(struct device *dev, unsigned int reg); | ||
45 | }; | 49 | }; |
46 | 50 | ||
47 | typedef int (*regmap_hw_write)(struct device *dev, const void *data, | 51 | typedef int (*regmap_hw_write)(struct device *dev, const void *data, |