summaryrefslogtreecommitdiffstats
path: root/include/linux/regmap.h
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-11-20 21:09:46 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-11-20 21:09:46 -0500
commit3afa24f7ad0a1ab5478f1e9a6c4df1acf52171d1 (patch)
treed8a4bebef173659a9f1605fec1c7eab06a016583 /include/linux/regmap.h
parent869e4a5f5848f6308cc5651d4bdc3e545d676b98 (diff)
parent0d4529c534c1c664f25088eb5f5b4d7ce0ee2510 (diff)
Merge branch 'topic/lock' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap into regmap-table
Diffstat (limited to 'include/linux/regmap.h')
-rw-r--r--include/linux/regmap.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 9f228d7f7ac4..0e819e3cebce 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -53,6 +53,9 @@ enum regmap_endian {
53 REGMAP_ENDIAN_NATIVE, 53 REGMAP_ENDIAN_NATIVE,
54}; 54};
55 55
56typedef void (*regmap_lock)(void *);
57typedef void (*regmap_unlock)(void *);
58
56/** 59/**
57 * Configuration for the register map of a device. 60 * Configuration for the register map of a device.
58 * 61 *
@@ -75,6 +78,12 @@ enum regmap_endian {
75 * @precious_reg: Optional callback returning true if the rgister 78 * @precious_reg: Optional callback returning true if the rgister
76 * should not be read outside of a call from the driver 79 * should not be read outside of a call from the driver
77 * (eg, a clear on read interrupt status register). 80 * (eg, a clear on read interrupt status register).
81 * @lock: Optional lock callback (overrides regmap's default lock
82 * function, based on spinlock or mutex).
83 * @unlock: As above for unlocking.
84 * @lock_arg: this field is passed as the only argument of lock/unlock
85 * functions (ignored in case regular lock/unlock functions
86 * are not overridden).
78 * 87 *
79 * @max_register: Optional, specifies the maximum valid register index. 88 * @max_register: Optional, specifies the maximum valid register index.
80 * @reg_defaults: Power on reset values for registers (for use with 89 * @reg_defaults: Power on reset values for registers (for use with
@@ -116,6 +125,9 @@ struct regmap_config {
116 bool (*readable_reg)(struct device *dev, unsigned int reg); 125 bool (*readable_reg)(struct device *dev, unsigned int reg);
117 bool (*volatile_reg)(struct device *dev, unsigned int reg); 126 bool (*volatile_reg)(struct device *dev, unsigned int reg);
118 bool (*precious_reg)(struct device *dev, unsigned int reg); 127 bool (*precious_reg)(struct device *dev, unsigned int reg);
128 regmap_lock lock;
129 regmap_unlock unlock;
130 void *lock_arg;
119 131
120 unsigned int max_register; 132 unsigned int max_register;
121 const struct reg_default *reg_defaults; 133 const struct reg_default *reg_defaults;
@@ -185,7 +197,9 @@ typedef void (*regmap_hw_free_context)(void *context);
185 * Description of a hardware bus for the register map infrastructure. 197 * Description of a hardware bus for the register map infrastructure.
186 * 198 *
187 * @fast_io: Register IO is fast. Use a spinlock instead of a mutex 199 * @fast_io: Register IO is fast. Use a spinlock instead of a mutex
188 * to perform locking. 200 * to perform locking. This field is ignored if custom lock/unlock
201 * functions are used (see fields lock/unlock of
202 * struct regmap_config).
189 * @write: Write operation. 203 * @write: Write operation.
190 * @gather_write: Write operation with split register/value, return -ENOTSUPP 204 * @gather_write: Write operation with split register/value, return -ENOTSUPP
191 * if not implemented on a given device. 205 * if not implemented on a given device.