summaryrefslogtreecommitdiffstats
path: root/include/linux/regmap.h
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2013-09-01 23:30:50 -0400
committerMark Brown <broonie@linaro.org>2013-09-17 08:46:57 -0400
commita0102375ee82db1e08324b1a21484854cf2c1677 (patch)
treec24bd05318c5bb9211c0b38867dfa9d0eb99bd8d /include/linux/regmap.h
parentfdf200290581150f7b69148abf6ca860684cbfbb (diff)
regmap: Add regmap_fields APIs
Current Linux kernel is supporting regmap_field method and it is very useful feature. It needs one regmap_filed for one register access. OTOH, there is multi port device which has many same registers in the market. The difference for each register access is only its address offset. Current API needs many regmap_field for such device, but it is not good. This patch adds new regmap_fileds API which can care about multi port/offset access via regmap. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'include/linux/regmap.h')
-rw-r--r--include/linux/regmap.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 4c8c20a7a75d..a12bea07f79e 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -425,11 +425,15 @@ bool regmap_reg_in_ranges(unsigned int reg,
425 * @reg: Offset of the register within the regmap bank 425 * @reg: Offset of the register within the regmap bank
426 * @lsb: lsb of the register field. 426 * @lsb: lsb of the register field.
427 * @reg: msb of the register field. 427 * @reg: msb of the register field.
428 * @id_size: port size if it has some ports
429 * @id_offset: address offset for each ports
428 */ 430 */
429struct reg_field { 431struct reg_field {
430 unsigned int reg; 432 unsigned int reg;
431 unsigned int lsb; 433 unsigned int lsb;
432 unsigned int msb; 434 unsigned int msb;
435 unsigned int id_size;
436 unsigned int id_offset;
433}; 437};
434 438
435#define REG_FIELD(_reg, _lsb, _msb) { \ 439#define REG_FIELD(_reg, _lsb, _msb) { \
@@ -451,6 +455,13 @@ int regmap_field_write(struct regmap_field *field, unsigned int val);
451int regmap_field_update_bits(struct regmap_field *field, 455int regmap_field_update_bits(struct regmap_field *field,
452 unsigned int mask, unsigned int val); 456 unsigned int mask, unsigned int val);
453 457
458int regmap_fields_write(struct regmap_field *field, unsigned int id,
459 unsigned int val);
460int regmap_fields_read(struct regmap_field *field, unsigned int id,
461 unsigned int *val);
462int regmap_fields_update_bits(struct regmap_field *field, unsigned int id,
463 unsigned int mask, unsigned int val);
464
454/** 465/**
455 * Description of an IRQ for the generic regmap irq_chip. 466 * Description of an IRQ for the generic regmap irq_chip.
456 * 467 *