diff options
Diffstat (limited to 'include/linux/regmap.h')
-rw-r--r-- | include/linux/regmap.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index a10380bfbeac..dc90b8c134a1 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h | |||
@@ -374,6 +374,7 @@ int regmap_reinit_cache(struct regmap *map, | |||
374 | const struct regmap_config *config); | 374 | const struct regmap_config *config); |
375 | struct regmap *dev_get_regmap(struct device *dev, const char *name); | 375 | struct regmap *dev_get_regmap(struct device *dev, const char *name); |
376 | int regmap_write(struct regmap *map, unsigned int reg, unsigned int val); | 376 | int regmap_write(struct regmap *map, unsigned int reg, unsigned int val); |
377 | int regmap_write_async(struct regmap *map, unsigned int reg, unsigned int val); | ||
377 | int regmap_raw_write(struct regmap *map, unsigned int reg, | 378 | int regmap_raw_write(struct regmap *map, unsigned int reg, |
378 | const void *val, size_t val_len); | 379 | const void *val, size_t val_len); |
379 | int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val, | 380 | int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val, |
@@ -387,9 +388,14 @@ int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val, | |||
387 | size_t val_count); | 388 | size_t val_count); |
388 | int regmap_update_bits(struct regmap *map, unsigned int reg, | 389 | int regmap_update_bits(struct regmap *map, unsigned int reg, |
389 | unsigned int mask, unsigned int val); | 390 | unsigned int mask, unsigned int val); |
391 | int regmap_update_bits_async(struct regmap *map, unsigned int reg, | ||
392 | unsigned int mask, unsigned int val); | ||
390 | int regmap_update_bits_check(struct regmap *map, unsigned int reg, | 393 | int regmap_update_bits_check(struct regmap *map, unsigned int reg, |
391 | unsigned int mask, unsigned int val, | 394 | unsigned int mask, unsigned int val, |
392 | bool *change); | 395 | bool *change); |
396 | int regmap_update_bits_check_async(struct regmap *map, unsigned int reg, | ||
397 | unsigned int mask, unsigned int val, | ||
398 | bool *change); | ||
393 | int regmap_get_val_bytes(struct regmap *map); | 399 | int regmap_get_val_bytes(struct regmap *map); |
394 | int regmap_async_complete(struct regmap *map); | 400 | int regmap_async_complete(struct regmap *map); |
395 | bool regmap_can_raw_write(struct regmap *map); | 401 | bool regmap_can_raw_write(struct regmap *map); |
@@ -425,11 +431,15 @@ bool regmap_reg_in_ranges(unsigned int reg, | |||
425 | * @reg: Offset of the register within the regmap bank | 431 | * @reg: Offset of the register within the regmap bank |
426 | * @lsb: lsb of the register field. | 432 | * @lsb: lsb of the register field. |
427 | * @reg: msb of the register field. | 433 | * @reg: msb of the register field. |
434 | * @id_size: port size if it has some ports | ||
435 | * @id_offset: address offset for each ports | ||
428 | */ | 436 | */ |
429 | struct reg_field { | 437 | struct reg_field { |
430 | unsigned int reg; | 438 | unsigned int reg; |
431 | unsigned int lsb; | 439 | unsigned int lsb; |
432 | unsigned int msb; | 440 | unsigned int msb; |
441 | unsigned int id_size; | ||
442 | unsigned int id_offset; | ||
433 | }; | 443 | }; |
434 | 444 | ||
435 | #define REG_FIELD(_reg, _lsb, _msb) { \ | 445 | #define REG_FIELD(_reg, _lsb, _msb) { \ |
@@ -448,6 +458,15 @@ void devm_regmap_field_free(struct device *dev, struct regmap_field *field); | |||
448 | 458 | ||
449 | int regmap_field_read(struct regmap_field *field, unsigned int *val); | 459 | int regmap_field_read(struct regmap_field *field, unsigned int *val); |
450 | int regmap_field_write(struct regmap_field *field, unsigned int val); | 460 | int regmap_field_write(struct regmap_field *field, unsigned int val); |
461 | int regmap_field_update_bits(struct regmap_field *field, | ||
462 | unsigned int mask, unsigned int val); | ||
463 | |||
464 | int regmap_fields_write(struct regmap_field *field, unsigned int id, | ||
465 | unsigned int val); | ||
466 | int regmap_fields_read(struct regmap_field *field, unsigned int id, | ||
467 | unsigned int *val); | ||
468 | int regmap_fields_update_bits(struct regmap_field *field, unsigned int id, | ||
469 | unsigned int mask, unsigned int val); | ||
451 | 470 | ||
452 | /** | 471 | /** |
453 | * Description of an IRQ for the generic regmap irq_chip. | 472 | * Description of an IRQ for the generic regmap irq_chip. |
@@ -527,6 +546,13 @@ static inline int regmap_write(struct regmap *map, unsigned int reg, | |||
527 | return -EINVAL; | 546 | return -EINVAL; |
528 | } | 547 | } |
529 | 548 | ||
549 | static inline int regmap_write_async(struct regmap *map, unsigned int reg, | ||
550 | unsigned int val) | ||
551 | { | ||
552 | WARN_ONCE(1, "regmap API is disabled"); | ||
553 | return -EINVAL; | ||
554 | } | ||
555 | |||
530 | static inline int regmap_raw_write(struct regmap *map, unsigned int reg, | 556 | static inline int regmap_raw_write(struct regmap *map, unsigned int reg, |
531 | const void *val, size_t val_len) | 557 | const void *val, size_t val_len) |
532 | { | 558 | { |
@@ -576,6 +602,14 @@ static inline int regmap_update_bits(struct regmap *map, unsigned int reg, | |||
576 | return -EINVAL; | 602 | return -EINVAL; |
577 | } | 603 | } |
578 | 604 | ||
605 | static inline int regmap_update_bits_async(struct regmap *map, | ||
606 | unsigned int reg, | ||
607 | unsigned int mask, unsigned int val) | ||
608 | { | ||
609 | WARN_ONCE(1, "regmap API is disabled"); | ||
610 | return -EINVAL; | ||
611 | } | ||
612 | |||
579 | static inline int regmap_update_bits_check(struct regmap *map, | 613 | static inline int regmap_update_bits_check(struct regmap *map, |
580 | unsigned int reg, | 614 | unsigned int reg, |
581 | unsigned int mask, unsigned int val, | 615 | unsigned int mask, unsigned int val, |
@@ -585,6 +619,16 @@ static inline int regmap_update_bits_check(struct regmap *map, | |||
585 | return -EINVAL; | 619 | return -EINVAL; |
586 | } | 620 | } |
587 | 621 | ||
622 | static inline int regmap_update_bits_check_async(struct regmap *map, | ||
623 | unsigned int reg, | ||
624 | unsigned int mask, | ||
625 | unsigned int val, | ||
626 | bool *change) | ||
627 | { | ||
628 | WARN_ONCE(1, "regmap API is disabled"); | ||
629 | return -EINVAL; | ||
630 | } | ||
631 | |||
588 | static inline int regmap_get_val_bytes(struct regmap *map) | 632 | static inline int regmap_get_val_bytes(struct regmap *map) |
589 | { | 633 | { |
590 | WARN_ONCE(1, "regmap API is disabled"); | 634 | WARN_ONCE(1, "regmap API is disabled"); |