diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-12-10 22:39:30 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-12-10 22:39:30 -0500 |
commit | db760fbecd3d609098ef4121d7988ff2a5db15d1 (patch) | |
tree | ff4d9bc553848e796f0b099343d7f640acf4fbcb /include/linux/regmap.h | |
parent | 4d348e6e0a35cd1b40196a463f1159ae5d582770 (diff) | |
parent | 0d4529c534c1c664f25088eb5f5b4d7ce0ee2510 (diff) |
Merge remote-tracking branch 'regmap/topic/lock' into regmap-next
Diffstat (limited to 'include/linux/regmap.h')
-rw-r--r-- | include/linux/regmap.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 41e9e4e17657..fedf7ba74590 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h | |||
@@ -54,6 +54,9 @@ enum regmap_endian { | |||
54 | REGMAP_ENDIAN_NATIVE, | 54 | REGMAP_ENDIAN_NATIVE, |
55 | }; | 55 | }; |
56 | 56 | ||
57 | typedef void (*regmap_lock)(void *); | ||
58 | typedef void (*regmap_unlock)(void *); | ||
59 | |||
57 | /** | 60 | /** |
58 | * Configuration for the register map of a device. | 61 | * Configuration for the register map of a device. |
59 | * | 62 | * |
@@ -76,6 +79,12 @@ enum regmap_endian { | |||
76 | * @precious_reg: Optional callback returning true if the rgister | 79 | * @precious_reg: Optional callback returning true if the rgister |
77 | * should not be read outside of a call from the driver | 80 | * should not be read outside of a call from the driver |
78 | * (eg, a clear on read interrupt status register). | 81 | * (eg, a clear on read interrupt status register). |
82 | * @lock: Optional lock callback (overrides regmap's default lock | ||
83 | * function, based on spinlock or mutex). | ||
84 | * @unlock: As above for unlocking. | ||
85 | * @lock_arg: this field is passed as the only argument of lock/unlock | ||
86 | * functions (ignored in case regular lock/unlock functions | ||
87 | * are not overridden). | ||
79 | * | 88 | * |
80 | * @max_register: Optional, specifies the maximum valid register index. | 89 | * @max_register: Optional, specifies the maximum valid register index. |
81 | * @reg_defaults: Power on reset values for registers (for use with | 90 | * @reg_defaults: Power on reset values for registers (for use with |
@@ -117,6 +126,9 @@ struct regmap_config { | |||
117 | bool (*readable_reg)(struct device *dev, unsigned int reg); | 126 | bool (*readable_reg)(struct device *dev, unsigned int reg); |
118 | bool (*volatile_reg)(struct device *dev, unsigned int reg); | 127 | bool (*volatile_reg)(struct device *dev, unsigned int reg); |
119 | bool (*precious_reg)(struct device *dev, unsigned int reg); | 128 | bool (*precious_reg)(struct device *dev, unsigned int reg); |
129 | regmap_lock lock; | ||
130 | regmap_unlock unlock; | ||
131 | void *lock_arg; | ||
120 | 132 | ||
121 | unsigned int max_register; | 133 | unsigned int max_register; |
122 | const struct reg_default *reg_defaults; | 134 | const struct reg_default *reg_defaults; |
@@ -186,7 +198,9 @@ typedef void (*regmap_hw_free_context)(void *context); | |||
186 | * Description of a hardware bus for the register map infrastructure. | 198 | * Description of a hardware bus for the register map infrastructure. |
187 | * | 199 | * |
188 | * @fast_io: Register IO is fast. Use a spinlock instead of a mutex | 200 | * @fast_io: Register IO is fast. Use a spinlock instead of a mutex |
189 | * to perform locking. | 201 | * to perform locking. This field is ignored if custom lock/unlock |
202 | * functions are used (see fields lock/unlock of | ||
203 | * struct regmap_config). | ||
190 | * @write: Write operation. | 204 | * @write: Write operation. |
191 | * @gather_write: Write operation with split register/value, return -ENOTSUPP | 205 | * @gather_write: Write operation with split register/value, return -ENOTSUPP |
192 | * if not implemented on a given device. | 206 | * if not implemented on a given device. |