diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/regmap.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 02d84e24b7c2..eebea9b5f43e 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h | |||
@@ -23,6 +23,7 @@ struct irq_domain; | |||
23 | struct spi_device; | 23 | struct spi_device; |
24 | struct regmap; | 24 | struct regmap; |
25 | struct regmap_range_cfg; | 25 | struct regmap_range_cfg; |
26 | struct regmap_field; | ||
26 | 27 | ||
27 | /* An enum of all the supported cache types */ | 28 | /* An enum of all the supported cache types */ |
28 | enum regcache_type { | 29 | enum regcache_type { |
@@ -412,6 +413,36 @@ bool regmap_reg_in_ranges(unsigned int reg, | |||
412 | unsigned int nranges); | 413 | unsigned int nranges); |
413 | 414 | ||
414 | /** | 415 | /** |
416 | * Description of an register field | ||
417 | * | ||
418 | * @reg: Offset of the register within the regmap bank | ||
419 | * @lsb: lsb of the register field. | ||
420 | * @reg: msb of the register field. | ||
421 | */ | ||
422 | struct reg_field { | ||
423 | unsigned int reg; | ||
424 | unsigned int lsb; | ||
425 | unsigned int msb; | ||
426 | }; | ||
427 | |||
428 | #define REG_FIELD(_reg, _lsb, _msb) { \ | ||
429 | .reg = _reg, \ | ||
430 | .lsb = _lsb, \ | ||
431 | .msb = _msb, \ | ||
432 | } | ||
433 | |||
434 | struct regmap_field *regmap_field_alloc(struct regmap *regmap, | ||
435 | struct reg_field reg_field); | ||
436 | void regmap_field_free(struct regmap_field *field); | ||
437 | |||
438 | struct regmap_field *devm_regmap_field_alloc(struct device *dev, | ||
439 | struct regmap *regmap, struct reg_field reg_field); | ||
440 | void devm_regmap_field_free(struct device *dev, struct regmap_field *field); | ||
441 | |||
442 | int regmap_field_read(struct regmap_field *field, unsigned int *val); | ||
443 | int regmap_field_write(struct regmap_field *field, unsigned int val); | ||
444 | |||
445 | /** | ||
415 | * Description of an IRQ for the generic regmap irq_chip. | 446 | * Description of an IRQ for the generic regmap irq_chip. |
416 | * | 447 | * |
417 | * @reg_offset: Offset of the status/mask register within the bank | 448 | * @reg_offset: Offset of the status/mask register within the bank |