summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/regmap.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 60a65cd7e1a0..c878a4bf717e 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -20,9 +20,32 @@
struct i2c_client;
struct spi_device;
+/**
+ * Configuration for the register map of a device.
+ *
+ * @reg_bits: Number of bits in a register address, mandatory.
+ * @val_bits: Number of bits in a register value, mandatory.
+ *
+ * @max_register: Optional, specifies the maximum valid register index.
+ * @writeable_register: Optional callback returning true if the register
+ * can be written to.
+ * @readable_register: Optional callback returning true if the register
+ * can be read from.
+ * @volatile_register: Optional callback returning true if the register
+ * 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 {
int reg_bits;
int val_bits;
+
+ unsigned int max_register;
+ bool (*writeable_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 (*precious_reg)(struct device *dev, unsigned int reg);
};
typedef int (*regmap_hw_write)(struct device *dev, const void *data,