From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Samuel Ortiz <sameo@linux.intel.com>
Cc: linux-kernel@vger.kernel.org,
patches@opensource.wolfsonmicro.com,
Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: [PATCH 03/15] mfd: arizona: Basic support for edge triggered IRQs
Date: Mon, 1 Apr 2013 18:28:00 +0100 [thread overview]
Message-ID: <1364837292-30191-3-git-send-email-broonie@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1364837292-30191-1-git-send-email-broonie@opensource.wolfsonmicro.com>
Allow the user to configure edge triggered IRQs, though we do not yet
fully handle new interrupts occurring while an interrupt is being handled.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
arch/arm/mach-s3c64xx/mach-crag6410-module.c | 4 ++--
drivers/mfd/arizona-irq.c | 12 +++++++-----
include/linux/mfd/arizona/pdata.h | 3 ++-
3 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410-module.c b/arch/arm/mach-s3c64xx/mach-crag6410-module.c
index bf3d1c0..40b0e75 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410-module.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410-module.c
@@ -208,7 +208,7 @@ static const struct i2c_board_info wm1277_devs[] = {
static struct arizona_pdata wm5102_reva_pdata = {
.ldoena = S3C64XX_GPN(7),
.gpio_base = CODEC_GPIO_BASE,
- .irq_active_high = true,
+ .irq_flags = IRQF_TRIGGER_HIGH,
.micd_pol_gpio = CODEC_GPIO_BASE + 4,
.gpio_defaults = {
[2] = 0x10000, /* AIF3TXLRCLK */
@@ -237,7 +237,7 @@ static struct spi_board_info wm5102_reva_spi_devs[] = {
static struct arizona_pdata wm5102_pdata = {
.ldoena = S3C64XX_GPN(7),
.gpio_base = CODEC_GPIO_BASE,
- .irq_active_high = true,
+ .irq_flags = IRQF_TRIGGER_HIGH,
.micd_pol_gpio = CODEC_GPIO_BASE + 2,
.gpio_defaults = {
[2] = 0x10000, /* AIF3TXLRCLK */
diff --git a/drivers/mfd/arizona-irq.c b/drivers/mfd/arizona-irq.c
index 0aa39e2..aa25468 100644
--- a/drivers/mfd/arizona-irq.c
+++ b/drivers/mfd/arizona-irq.c
@@ -195,7 +195,11 @@ int arizona_irq_init(struct arizona *arizona)
/* Disable all wake sources by default */
regmap_write(arizona->regmap, ARIZONA_WAKE_CONTROL, 0);
- if (arizona->pdata.irq_active_high) {
+ if (!arizona->pdata.irq_flags)
+ arizona->pdata.irq_flags = IRQF_TRIGGER_LOW;
+
+ if (arizona->pdata.irq_flags & (IRQF_TRIGGER_HIGH |
+ IRQF_TRIGGER_RISING)) {
ret = regmap_update_bits(arizona->regmap, ARIZONA_IRQ_CTRL_1,
ARIZONA_IRQ_POL, 0);
if (ret != 0) {
@@ -203,12 +207,10 @@ int arizona_irq_init(struct arizona *arizona)
ret);
goto err;
}
-
- flags |= IRQF_TRIGGER_HIGH;
- } else {
- flags |= IRQF_TRIGGER_LOW;
}
+ flags |= arizona->pdata.irq_flags;
+
/* Allocate a virtual IRQ domain to distribute to the regmap domains */
arizona->virq = irq_domain_add_linear(NULL, 2, &arizona_domain_ops,
arizona);
diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h
index 455c51d..84fefed 100644
--- a/include/linux/mfd/arizona/pdata.h
+++ b/include/linux/mfd/arizona/pdata.h
@@ -99,7 +99,8 @@ struct arizona_pdata {
/** If a direct 32kHz clock is provided on an MCLK specify it here */
int clk32k_src;
- bool irq_active_high; /** IRQ polarity */
+ /** Mode for primary IRQ (defaults to active low) */
+ unsigned int irq_flags;
/* Base GPIO */
int gpio_base;
--
1.7.10.4
next prev parent reply other threads:[~2013-04-01 17:31 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-01 17:27 [PATCH 0/15] arizona updates for v3.10 Mark Brown
2013-04-01 17:27 ` [PATCH 01/15] mfd: arizona: Disable all wake sources by default Mark Brown
2013-04-01 17:27 ` [PATCH 02/15] mfd: arizona: Clarify error message for failed primary IRQ request Mark Brown
2013-04-01 17:28 ` Mark Brown [this message]
2013-04-01 17:28 ` [PATCH 04/15] mfd: arizona: Allow GPIO to be specified for IRQ line Mark Brown
2013-04-01 17:28 ` [PATCH 05/15] mfd: arizona: Try to use interrupt flags from interrupt controller Mark Brown
2013-04-01 17:28 ` [PATCH 06/15] mfd: arizona: Support configuring MICBIASes into bypass mode Mark Brown
2013-04-01 17:28 ` [PATCH 07/15] mfd: wm5102: Update patch for latest evaluation Mark Brown
2013-04-01 17:28 ` [PATCH 08/15] mfd: arizona: Fully support the use of MCLK1 as the 32kHz clock source Mark Brown
2013-04-01 17:28 ` [PATCH 09/15] mfd: arizona: Unconditionally enable 32kHz clock Mark Brown
2013-04-01 17:28 ` [PATCH 10/15] mfd: wm5102: Only use the lowest three bits of device revision Mark Brown
2013-04-01 17:28 ` [PATCH 11/15] mfd: wm5102: Manually apply register patch Mark Brown
2013-04-01 17:28 ` [PATCH 12/15] mfd: arizona: Factor out register polling Mark Brown
2013-04-01 17:28 ` [PATCH 13/15] mfd: arizona: Add a hardware patch mechanism Mark Brown
2013-04-01 17:28 ` [PATCH 14/15] mfd: wm5102: Deactivate standard boot sequence Mark Brown
2013-04-01 17:28 ` [PATCH 15/15] mfd: wm5102: Update defaults to match patch Mark Brown
2013-04-03 18:04 ` [PATCH 0/15] arizona updates for v3.10 Mark Brown
2013-04-03 18:05 ` [PATCH 1/3] mfd: arizona: Hold device in reset while ramping supplies Mark Brown
2013-04-03 18:05 ` [PATCH 2/3] mfd: arizona: Wait for internal clocks to startup after reset Mark Brown
2013-04-03 18:05 ` [PATCH 3/3] mfd: wm5102: Don't wait for boot when boot sequencer is disabled Mark Brown
2013-04-08 9:25 ` [PATCH 0/15] arizona updates for v3.10 Samuel Ortiz
2013-04-08 9:38 ` Samuel Ortiz
2013-04-08 10:04 ` Mark Brown
2013-04-08 10:19 ` Mark Brown
2013-04-08 14:31 ` Samuel Ortiz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1364837292-30191-3-git-send-email-broonie@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.wolfsonmicro.com \
--cc=sameo@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome