aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-02-14 12:11:03 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-02-14 12:11:03 -0500
commit3689cf7fd17ea50850f9036f398bd56e08c8806d (patch)
tree18006137f618f7a2ff99417bb1029081bcc88fbf /include/linux
parent3bef9059dd8d50c011ea22ae60eaa03996bd4ad1 (diff)
parent95601d65a1aa0902f838a2919e11ee6311efe371 (diff)
Merge remote-tracking branch 'regmap/topic/async' into regmap-next
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/regmap.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index b7e95bf942c9..f9b7fbe35ab1 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -235,14 +235,21 @@ struct regmap_range_cfg {
235 unsigned int window_len; 235 unsigned int window_len;
236}; 236};
237 237
238struct regmap_async;
239
238typedef int (*regmap_hw_write)(void *context, const void *data, 240typedef int (*regmap_hw_write)(void *context, const void *data,
239 size_t count); 241 size_t count);
240typedef int (*regmap_hw_gather_write)(void *context, 242typedef int (*regmap_hw_gather_write)(void *context,
241 const void *reg, size_t reg_len, 243 const void *reg, size_t reg_len,
242 const void *val, size_t val_len); 244 const void *val, size_t val_len);
245typedef int (*regmap_hw_async_write)(void *context,
246 const void *reg, size_t reg_len,
247 const void *val, size_t val_len,
248 struct regmap_async *async);
243typedef int (*regmap_hw_read)(void *context, 249typedef int (*regmap_hw_read)(void *context,
244 const void *reg_buf, size_t reg_size, 250 const void *reg_buf, size_t reg_size,
245 void *val_buf, size_t val_size); 251 void *val_buf, size_t val_size);
252typedef struct regmap_async *(*regmap_hw_async_alloc)(void);
246typedef void (*regmap_hw_free_context)(void *context); 253typedef void (*regmap_hw_free_context)(void *context);
247 254
248/** 255/**
@@ -255,8 +262,11 @@ typedef void (*regmap_hw_free_context)(void *context);
255 * @write: Write operation. 262 * @write: Write operation.
256 * @gather_write: Write operation with split register/value, return -ENOTSUPP 263 * @gather_write: Write operation with split register/value, return -ENOTSUPP
257 * if not implemented on a given device. 264 * if not implemented on a given device.
265 * @async_write: Write operation which completes asynchronously, optional and
266 * must serialise with respect to non-async I/O.
258 * @read: Read operation. Data is returned in the buffer used to transmit 267 * @read: Read operation. Data is returned in the buffer used to transmit
259 * data. 268 * data.
269 * @async_alloc: Allocate a regmap_async() structure.
260 * @read_flag_mask: Mask to be set in the top byte of the register when doing 270 * @read_flag_mask: Mask to be set in the top byte of the register when doing
261 * a read. 271 * a read.
262 * @reg_format_endian_default: Default endianness for formatted register 272 * @reg_format_endian_default: Default endianness for formatted register
@@ -265,13 +275,16 @@ typedef void (*regmap_hw_free_context)(void *context);
265 * @val_format_endian_default: Default endianness for formatted register 275 * @val_format_endian_default: Default endianness for formatted register
266 * values. Used when the regmap_config specifies DEFAULT. If this is 276 * values. Used when the regmap_config specifies DEFAULT. If this is
267 * DEFAULT, BIG is assumed. 277 * DEFAULT, BIG is assumed.
278 * @async_size: Size of struct used for async work.
268 */ 279 */
269struct regmap_bus { 280struct regmap_bus {
270 bool fast_io; 281 bool fast_io;
271 regmap_hw_write write; 282 regmap_hw_write write;
272 regmap_hw_gather_write gather_write; 283 regmap_hw_gather_write gather_write;
284 regmap_hw_async_write async_write;
273 regmap_hw_read read; 285 regmap_hw_read read;
274 regmap_hw_free_context free_context; 286 regmap_hw_free_context free_context;
287 regmap_hw_async_alloc async_alloc;
275 u8 read_flag_mask; 288 u8 read_flag_mask;
276 enum regmap_endian reg_format_endian_default; 289 enum regmap_endian reg_format_endian_default;
277 enum regmap_endian val_format_endian_default; 290 enum regmap_endian val_format_endian_default;
@@ -310,6 +323,8 @@ int regmap_raw_write(struct regmap *map, unsigned int reg,
310 const void *val, size_t val_len); 323 const void *val, size_t val_len);
311int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val, 324int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val,
312 size_t val_count); 325 size_t val_count);
326int regmap_raw_write_async(struct regmap *map, unsigned int reg,
327 const void *val, size_t val_len);
313int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val); 328int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val);
314int regmap_raw_read(struct regmap *map, unsigned int reg, 329int regmap_raw_read(struct regmap *map, unsigned int reg,
315 void *val, size_t val_len); 330 void *val, size_t val_len);
@@ -321,6 +336,7 @@ int regmap_update_bits_check(struct regmap *map, unsigned int reg,
321 unsigned int mask, unsigned int val, 336 unsigned int mask, unsigned int val,
322 bool *change); 337 bool *change);
323int regmap_get_val_bytes(struct regmap *map); 338int regmap_get_val_bytes(struct regmap *map);
339int regmap_async_complete(struct regmap *map);
324 340
325int regcache_sync(struct regmap *map); 341int regcache_sync(struct regmap *map);
326int regcache_sync_region(struct regmap *map, unsigned int min, 342int regcache_sync_region(struct regmap *map, unsigned int min,
@@ -422,6 +438,13 @@ static inline int regmap_raw_write(struct regmap *map, unsigned int reg,
422 return -EINVAL; 438 return -EINVAL;
423} 439}
424 440
441static inline int regmap_raw_write_async(struct regmap *map, unsigned int reg,
442 const void *val, size_t val_len)
443{
444 WARN_ONCE(1, "regmap API is disabled");
445 return -EINVAL;
446}
447
425static inline int regmap_bulk_write(struct regmap *map, unsigned int reg, 448static inline int regmap_bulk_write(struct regmap *map, unsigned int reg,
426 const void *val, size_t val_count) 449 const void *val, size_t val_count)
427{ 450{
@@ -500,6 +523,11 @@ static inline void regcache_mark_dirty(struct regmap *map)
500 WARN_ONCE(1, "regmap API is disabled"); 523 WARN_ONCE(1, "regmap API is disabled");
501} 524}
502 525
526static inline void regmap_async_complete(struct regmap *map)
527{
528 WARN_ONCE(1, "regmap API is disabled");
529}
530
503static inline int regmap_register_patch(struct regmap *map, 531static inline int regmap_register_patch(struct regmap *map,
504 const struct reg_default *regs, 532 const struct reg_default *regs,
505 int num_regs) 533 int num_regs)