From 2753e6f8207355ab72574d48287cec187272a151 Mon Sep 17 00:00:00 2001
From: Philipp Zabel
Date: Mon, 22 Jul 2013 17:15:52 +0200
Subject: regmap: irq: Allow to acknowledge masked interrupts during
initialization
In case the hardware interrupt mask register does not prevent the chip level
irq from being asserted by the corresponding interrupt status bit, already
set interrupt bits should to be cleared once after masking them during
initialization. Add a flag to let drivers enable this behavior.
Signed-off-by: Philipp Zabel
Signed-off-by: Mark Brown
---
include/linux/regmap.h | 2 ++
1 file changed, 2 insertions(+)
(limited to 'include/linux/regmap.h')
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 75981d0b57d..34ebe777803 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -470,6 +470,7 @@ struct regmap_irq {
* @ack_base: Base ack address. If zero then the chip is clear on read.
* @wake_base: Base address for wake enables. If zero unsupported.
* @irq_reg_stride: Stride to use for chips where registers are not contiguous.
+ * @init_ack_masked: Ack all masked interrupts once during initalization.
* @runtime_pm: Hold a runtime PM lock on the device when accessing it.
*
* @num_regs: Number of registers in each control bank.
@@ -485,6 +486,7 @@ struct regmap_irq_chip {
unsigned int ack_base;
unsigned int wake_base;
unsigned int irq_reg_stride;
+ bool init_ack_masked;
unsigned int mask_invert;
unsigned int wake_invert;
bool runtime_pm;
--
cgit v1.2.3-70-g09d2
From f484f7a6bc6f0f871627cc1f83f56077a5dc6e47 Mon Sep 17 00:00:00 2001
From: Philipp Zabel
Date: Wed, 24 Jul 2013 10:26:42 +0200
Subject: regmap: irq: make flags bool and put them in a bitfield
This patch makes mask/wake_invert bool and puts all flags into a bitfield
for consistency and to save some space.
Signed-off-by: Philipp Zabel
Signed-off-by: Mark Brown
---
include/linux/regmap.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
(limited to 'include/linux/regmap.h')
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 34ebe777803..99b0f7cad75 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -486,10 +486,10 @@ struct regmap_irq_chip {
unsigned int ack_base;
unsigned int wake_base;
unsigned int irq_reg_stride;
- bool init_ack_masked;
- unsigned int mask_invert;
- unsigned int wake_invert;
- bool runtime_pm;
+ bool init_ack_masked:1;
+ bool mask_invert:1;
+ bool wake_invert:1;
+ bool runtime_pm:1;
int num_regs;
--
cgit v1.2.3-70-g09d2
From 68622bdfefb969fd7cf710545d7e758a732ab01d Mon Sep 17 00:00:00 2001
From: Philipp Zabel
Date: Wed, 24 Jul 2013 10:26:48 +0200
Subject: regmap: irq: document mask/wake_invert flags
Signed-off-by: Philipp Zabel
Signed-off-by: Mark Brown
---
include/linux/regmap.h | 2 ++
1 file changed, 2 insertions(+)
(limited to 'include/linux/regmap.h')
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 99b0f7cad75..a3c68aad238 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -471,6 +471,8 @@ struct regmap_irq {
* @wake_base: Base address for wake enables. If zero unsupported.
* @irq_reg_stride: Stride to use for chips where registers are not contiguous.
* @init_ack_masked: Ack all masked interrupts once during initalization.
+ * @mask_invert: Inverted mask register: cleared bits are masked out.
+ * @wake_invert: Inverted wake register: cleared bits are wake enabled.
* @runtime_pm: Hold a runtime PM lock on the device when accessing it.
*
* @num_regs: Number of registers in each control bank.
--
cgit v1.2.3-70-g09d2