summaryrefslogtreecommitdiffstats
path: root/include/linux/regmap.h
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-02-17 17:49:51 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-02-17 17:51:15 -0500
commit9cde5fcd435fd929db7b0b486efb435cdb1ddca4 (patch)
treee7749dc6c7ef6b8a3db06772f10dd0e8c02e0ddb /include/linux/regmap.h
parent028a01e601487b5991b70dba506dfe87d83543f6 (diff)
regmap: Add stub regmap calls as a build crutch for infrastructure users
Make life easier for subsystems which build infrastructure on top of the regmap API by providing stub definitions for most of the API so that users can at least build even if the regmap API is not enabled without having to add ifdefs if they don't want to. These stubs are not expected to be useful and should never actually get called, they just exist so that we can link so there are WARN_ONCE()s in the stubs. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'include/linux/regmap.h')
-rw-r--r--include/linux/regmap.h106
1 files changed, 106 insertions, 0 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index a6ed6e6e27ac..42c69e75b131 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -16,6 +16,8 @@
16#include <linux/device.h> 16#include <linux/device.h>
17#include <linux/list.h> 17#include <linux/list.h>
18 18
19#ifdef CONFIG_REGMAP
20
19struct module; 21struct module;
20struct i2c_client; 22struct i2c_client;
21struct spi_device; 23struct spi_device;
@@ -199,4 +201,108 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
199void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *data); 201void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *data);
200int regmap_irq_chip_get_base(struct regmap_irq_chip_data *data); 202int regmap_irq_chip_get_base(struct regmap_irq_chip_data *data);
201 203
204#else
205
206/*
207 * These stubs should only ever be called by generic code which has
208 * regmap based facilities, if they ever get called at runtime
209 * something is going wrong and something probably needs to select
210 * REGMAP.
211 */
212
213static inline int regmap_write(struct regmap *map, unsigned int reg,
214 unsigned int val)
215{
216 WARN_ONCE(1, "regmap API is disabled");
217 return -EINVAL;
218}
219
220static inline int regmap_raw_write(struct regmap *map, unsigned int reg,
221 const void *val, size_t val_len)
222{
223 WARN_ONCE(1, "regmap API is disabled");
224 return -EINVAL;
225}
226
227static inline int regmap_bulk_write(struct regmap *map, unsigned int reg,
228 const void *val, size_t val_count)
229{
230 WARN_ONCE(1, "regmap API is disabled");
231 return -EINVAL;
232}
233
234static inline int regmap_read(struct regmap *map, unsigned int reg,
235 unsigned int *val)
236{
237 WARN_ONCE(1, "regmap API is disabled");
238 return -EINVAL;
239}
240
241static inline int regmap_raw_read(struct regmap *map, unsigned int reg,
242 void *val, size_t val_len)
243{
244 WARN_ONCE(1, "regmap API is disabled");
245 return -EINVAL;
246}
247
248static inline int regmap_bulk_read(struct regmap *map, unsigned int reg,
249 void *val, size_t val_count)
250{
251 WARN_ONCE(1, "regmap API is disabled");
252 return -EINVAL;
253}
254
255static inline int regmap_update_bits(struct regmap *map, unsigned int reg,
256 unsigned int mask, unsigned int val)
257{
258 WARN_ONCE(1, "regmap API is disabled");
259 return -EINVAL;
260}
261
262static inline int regmap_update_bits_check(struct regmap *map,
263 unsigned int reg,
264 unsigned int mask, unsigned int val,
265 bool *change)
266{
267 WARN_ONCE(1, "regmap API is disabled");
268 return -EINVAL;
269}
270
271static inline int regmap_get_val_bytes(struct regmap *map)
272{
273 WARN_ONCE(1, "regmap API is disabled");
274 return -EINVAL;
275}
276
277static inline int regcache_sync(struct regmap *map)
278{
279 WARN_ONCE(1, "regmap API is disabled");
280 return -EINVAL;
281}
282
283static inline void regcache_cache_only(struct regmap *map, bool enable)
284{
285 WARN_ONCE(1, "regmap API is disabled");
286}
287
288static inline void regcache_cache_bypass(struct regmap *map, bool enable)
289{
290 WARN_ONCE(1, "regmap API is disabled");
291}
292
293static inline void regcache_mark_dirty(struct regmap *map)
294{
295 WARN_ONCE(1, "regmap API is disabled");
296}
297
298static inline int regmap_register_patch(struct regmap *map,
299 const struct reg_default *regs,
300 int num_regs)
301{
302 WARN_ONCE(1, "regmap API is disabled");
303 return -EINVAL;
304}
305
306#endif
307
202#endif 308#endif