diff options
Diffstat (limited to 'include/linux/regmap.h')
-rw-r--r-- | include/linux/regmap.h | 52 |
1 files changed, 51 insertions, 1 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 32043a9749e6..946868c67cd6 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h | |||
@@ -25,7 +25,7 @@ enum regcache_type { | |||
25 | REGCACHE_NONE, | 25 | REGCACHE_NONE, |
26 | REGCACHE_INDEXED, | 26 | REGCACHE_INDEXED, |
27 | REGCACHE_RBTREE, | 27 | REGCACHE_RBTREE, |
28 | REGCACHE_LZO | 28 | REGCACHE_COMPRESSED |
29 | }; | 29 | }; |
30 | 30 | ||
31 | /** | 31 | /** |
@@ -129,6 +129,8 @@ struct regmap *regmap_init_spi(struct spi_device *dev, | |||
129 | const struct regmap_config *config); | 129 | const struct regmap_config *config); |
130 | 130 | ||
131 | void regmap_exit(struct regmap *map); | 131 | void regmap_exit(struct regmap *map); |
132 | int regmap_reinit_cache(struct regmap *map, | ||
133 | const struct regmap_config *config); | ||
132 | int regmap_write(struct regmap *map, unsigned int reg, unsigned int val); | 134 | int regmap_write(struct regmap *map, unsigned int reg, unsigned int val); |
133 | int regmap_raw_write(struct regmap *map, unsigned int reg, | 135 | int regmap_raw_write(struct regmap *map, unsigned int reg, |
134 | const void *val, size_t val_len); | 136 | const void *val, size_t val_len); |
@@ -145,4 +147,52 @@ void regcache_cache_only(struct regmap *map, bool enable); | |||
145 | void regcache_cache_bypass(struct regmap *map, bool enable); | 147 | void regcache_cache_bypass(struct regmap *map, bool enable); |
146 | void regcache_mark_dirty(struct regmap *map); | 148 | void regcache_mark_dirty(struct regmap *map); |
147 | 149 | ||
150 | /** | ||
151 | * Description of an IRQ for the generic regmap irq_chip. | ||
152 | * | ||
153 | * @reg_offset: Offset of the status/mask register within the bank | ||
154 | * @mask: Mask used to flag/control the register. | ||
155 | */ | ||
156 | struct regmap_irq { | ||
157 | unsigned int reg_offset; | ||
158 | unsigned int mask; | ||
159 | }; | ||
160 | |||
161 | /** | ||
162 | * Description of a generic regmap irq_chip. This is not intended to | ||
163 | * handle every possible interrupt controller, but it should handle a | ||
164 | * substantial proportion of those that are found in the wild. | ||
165 | * | ||
166 | * @name: Descriptive name for IRQ controller. | ||
167 | * | ||
168 | * @status_base: Base status register address. | ||
169 | * @mask_base: Base mask register address. | ||
170 | * @ack_base: Base ack address. If zero then the chip is clear on read. | ||
171 | * | ||
172 | * @num_regs: Number of registers in each control bank. | ||
173 | * @irqs: Descriptors for individual IRQs. Interrupt numbers are | ||
174 | * assigned based on the index in the array of the interrupt. | ||
175 | * @num_irqs: Number of descriptors. | ||
176 | */ | ||
177 | struct regmap_irq_chip { | ||
178 | const char *name; | ||
179 | |||
180 | unsigned int status_base; | ||
181 | unsigned int mask_base; | ||
182 | unsigned int ack_base; | ||
183 | |||
184 | int num_regs; | ||
185 | |||
186 | const struct regmap_irq *irqs; | ||
187 | int num_irqs; | ||
188 | }; | ||
189 | |||
190 | struct regmap_irq_chip_data; | ||
191 | |||
192 | int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags, | ||
193 | int irq_base, struct regmap_irq_chip *chip, | ||
194 | struct regmap_irq_chip_data **data); | ||
195 | void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *data); | ||
196 | int regmap_irq_chip_get_base(struct regmap_irq_chip_data *data); | ||
197 | |||
148 | #endif | 198 | #endif |