aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/regmap.h
diff options
context:
space:
mode:
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 8fc0bfd8edc4..d68bb402120e 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -296,6 +296,8 @@ typedef int (*regmap_hw_reg_read)(void *context, unsigned int reg,
296 unsigned int *val); 296 unsigned int *val);
297typedef int (*regmap_hw_reg_write)(void *context, unsigned int reg, 297typedef int (*regmap_hw_reg_write)(void *context, unsigned int reg,
298 unsigned int val); 298 unsigned int val);
299typedef int (*regmap_hw_reg_update_bits)(void *context, unsigned int reg,
300 unsigned int mask, unsigned int val);
299typedef struct regmap_async *(*regmap_hw_async_alloc)(void); 301typedef struct regmap_async *(*regmap_hw_async_alloc)(void);
300typedef void (*regmap_hw_free_context)(void *context); 302typedef void (*regmap_hw_free_context)(void *context);
301 303
@@ -335,6 +337,7 @@ struct regmap_bus {
335 regmap_hw_gather_write gather_write; 337 regmap_hw_gather_write gather_write;
336 regmap_hw_async_write async_write; 338 regmap_hw_async_write async_write;
337 regmap_hw_reg_write reg_write; 339 regmap_hw_reg_write reg_write;
340 regmap_hw_reg_update_bits reg_update_bits;
338 regmap_hw_read read; 341 regmap_hw_read read;
339 regmap_hw_reg_read reg_read; 342 regmap_hw_reg_read reg_read;
340 regmap_hw_free_context free_context; 343 regmap_hw_free_context free_context;
@@ -791,6 +794,9 @@ struct regmap_irq {
791 unsigned int mask; 794 unsigned int mask;
792}; 795};
793 796
797#define REGMAP_IRQ_REG(_irq, _off, _mask) \
798 [_irq] = { .reg_offset = (_off), .mask = (_mask) }
799
794/** 800/**
795 * Description of a generic regmap irq_chip. This is not intended to 801 * Description of a generic regmap irq_chip. This is not intended to
796 * handle every possible interrupt controller, but it should handle a 802 * handle every possible interrupt controller, but it should handle a
@@ -800,6 +806,8 @@ struct regmap_irq {
800 * 806 *
801 * @status_base: Base status register address. 807 * @status_base: Base status register address.
802 * @mask_base: Base mask register address. 808 * @mask_base: Base mask register address.
809 * @unmask_base: Base unmask register address. for chips who have
810 * separate mask and unmask registers
803 * @ack_base: Base ack address. If zero then the chip is clear on read. 811 * @ack_base: Base ack address. If zero then the chip is clear on read.
804 * Using zero value is possible with @use_ack bit. 812 * Using zero value is possible with @use_ack bit.
805 * @wake_base: Base address for wake enables. If zero unsupported. 813 * @wake_base: Base address for wake enables. If zero unsupported.
@@ -807,6 +815,7 @@ struct regmap_irq {
807 * @init_ack_masked: Ack all masked interrupts once during initalization. 815 * @init_ack_masked: Ack all masked interrupts once during initalization.
808 * @mask_invert: Inverted mask register: cleared bits are masked out. 816 * @mask_invert: Inverted mask register: cleared bits are masked out.
809 * @use_ack: Use @ack register even if it is zero. 817 * @use_ack: Use @ack register even if it is zero.
818 * @ack_invert: Inverted ack register: cleared bits for ack.
810 * @wake_invert: Inverted wake register: cleared bits are wake enabled. 819 * @wake_invert: Inverted wake register: cleared bits are wake enabled.
811 * @runtime_pm: Hold a runtime PM lock on the device when accessing it. 820 * @runtime_pm: Hold a runtime PM lock on the device when accessing it.
812 * 821 *
@@ -820,12 +829,14 @@ struct regmap_irq_chip {
820 829
821 unsigned int status_base; 830 unsigned int status_base;
822 unsigned int mask_base; 831 unsigned int mask_base;
832 unsigned int unmask_base;
823 unsigned int ack_base; 833 unsigned int ack_base;
824 unsigned int wake_base; 834 unsigned int wake_base;
825 unsigned int irq_reg_stride; 835 unsigned int irq_reg_stride;
826 bool init_ack_masked:1; 836 bool init_ack_masked:1;
827 bool mask_invert:1; 837 bool mask_invert:1;
828 bool use_ack:1; 838 bool use_ack:1;
839 bool ack_invert:1;
829 bool wake_invert:1; 840 bool wake_invert:1;
830 bool runtime_pm:1; 841 bool runtime_pm:1;
831 842