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.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 4d9a1a04647b..18394343f489 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -788,10 +788,16 @@ int regmap_fields_update_bits(struct regmap_field *field, unsigned int id,
788 * 788 *
789 * @reg_offset: Offset of the status/mask register within the bank 789 * @reg_offset: Offset of the status/mask register within the bank
790 * @mask: Mask used to flag/control the register. 790 * @mask: Mask used to flag/control the register.
791 * @type_reg_offset: Offset register for the irq type setting.
792 * @type_rising_mask: Mask bit to configure RISING type irq.
793 * @type_falling_mask: Mask bit to configure FALLING type irq.
791 */ 794 */
792struct regmap_irq { 795struct regmap_irq {
793 unsigned int reg_offset; 796 unsigned int reg_offset;
794 unsigned int mask; 797 unsigned int mask;
798 unsigned int type_reg_offset;
799 unsigned int type_rising_mask;
800 unsigned int type_falling_mask;
795}; 801};
796 802
797#define REGMAP_IRQ_REG(_irq, _off, _mask) \ 803#define REGMAP_IRQ_REG(_irq, _off, _mask) \
@@ -811,18 +817,23 @@ struct regmap_irq {
811 * @ack_base: Base ack address. If zero then the chip is clear on read. 817 * @ack_base: Base ack address. If zero then the chip is clear on read.
812 * Using zero value is possible with @use_ack bit. 818 * Using zero value is possible with @use_ack bit.
813 * @wake_base: Base address for wake enables. If zero unsupported. 819 * @wake_base: Base address for wake enables. If zero unsupported.
820 * @type_base: Base address for irq type. If zero unsupported.
814 * @irq_reg_stride: Stride to use for chips where registers are not contiguous. 821 * @irq_reg_stride: Stride to use for chips where registers are not contiguous.
815 * @init_ack_masked: Ack all masked interrupts once during initalization. 822 * @init_ack_masked: Ack all masked interrupts once during initalization.
816 * @mask_invert: Inverted mask register: cleared bits are masked out. 823 * @mask_invert: Inverted mask register: cleared bits are masked out.
817 * @use_ack: Use @ack register even if it is zero. 824 * @use_ack: Use @ack register even if it is zero.
818 * @ack_invert: Inverted ack register: cleared bits for ack. 825 * @ack_invert: Inverted ack register: cleared bits for ack.
819 * @wake_invert: Inverted wake register: cleared bits are wake enabled. 826 * @wake_invert: Inverted wake register: cleared bits are wake enabled.
827 * @type_invert: Invert the type flags.
820 * @runtime_pm: Hold a runtime PM lock on the device when accessing it. 828 * @runtime_pm: Hold a runtime PM lock on the device when accessing it.
821 * 829 *
822 * @num_regs: Number of registers in each control bank. 830 * @num_regs: Number of registers in each control bank.
823 * @irqs: Descriptors for individual IRQs. Interrupt numbers are 831 * @irqs: Descriptors for individual IRQs. Interrupt numbers are
824 * assigned based on the index in the array of the interrupt. 832 * assigned based on the index in the array of the interrupt.
825 * @num_irqs: Number of descriptors. 833 * @num_irqs: Number of descriptors.
834 * @num_type_reg: Number of type registers.
835 * @type_reg_stride: Stride to use for chips where type registers are not
836 * contiguous.
826 */ 837 */
827struct regmap_irq_chip { 838struct regmap_irq_chip {
828 const char *name; 839 const char *name;
@@ -832,6 +843,7 @@ struct regmap_irq_chip {
832 unsigned int unmask_base; 843 unsigned int unmask_base;
833 unsigned int ack_base; 844 unsigned int ack_base;
834 unsigned int wake_base; 845 unsigned int wake_base;
846 unsigned int type_base;
835 unsigned int irq_reg_stride; 847 unsigned int irq_reg_stride;
836 bool init_ack_masked:1; 848 bool init_ack_masked:1;
837 bool mask_invert:1; 849 bool mask_invert:1;
@@ -839,11 +851,15 @@ struct regmap_irq_chip {
839 bool ack_invert:1; 851 bool ack_invert:1;
840 bool wake_invert:1; 852 bool wake_invert:1;
841 bool runtime_pm:1; 853 bool runtime_pm:1;
854 bool type_invert:1;
842 855
843 int num_regs; 856 int num_regs;
844 857
845 const struct regmap_irq *irqs; 858 const struct regmap_irq *irqs;
846 int num_irqs; 859 int num_irqs;
860
861 int num_type_reg;
862 unsigned int type_reg_stride;
847}; 863};
848 864
849struct regmap_irq_chip_data; 865struct regmap_irq_chip_data;