Commit 18694886 authored by Mark Brown's avatar Mark Brown

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: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 2e2ae66d
...@@ -33,6 +33,9 @@ struct spi_device; ...@@ -33,6 +33,9 @@ struct spi_device;
* can be read from. * can be read from.
* @volatile_register: Optional callback returning true if the register * @volatile_register: Optional callback returning true if the register
* value can't be cached. * value can't be cached.
* @precious_register: Optional callback returning true if the rgister
* should not be read outside of a call from the driver
* (eg, a clear on read interrupt status register).
*/ */
struct regmap_config { struct regmap_config {
int reg_bits; int reg_bits;
...@@ -42,6 +45,7 @@ struct regmap_config { ...@@ -42,6 +45,7 @@ struct regmap_config {
bool (*writeable_reg)(struct device *dev, unsigned int reg); bool (*writeable_reg)(struct device *dev, unsigned int reg);
bool (*readable_reg)(struct device *dev, unsigned int reg); bool (*readable_reg)(struct device *dev, unsigned int reg);
bool (*volatile_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);
}; };
typedef int (*regmap_hw_write)(struct device *dev, const void *data, typedef int (*regmap_hw_write)(struct device *dev, const void *data,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment