All of lore.kernel.org
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@ingics.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Prisk <linux@prisktech.co.nz>,
	Alexey Charkov <alchark@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: [RFT][PATCH 2/2] irqchip: vt8500: Support 'rising and falling edge' trigger mode
Date: Tue, 09 Jul 2013 08:33:31 +0800	[thread overview]
Message-ID: <1373330011.4223.7.camel@phoenix> (raw)
In-Reply-To: <1373329275.4223.1.camel@phoenix>

This chip supports below interrupt request trigger mode:

Destination Control Register:
BIT[5:4] Interrupt Request Trigger Mode.
        00: High level trigger
        01: Posedge trigger
        10: Negedge trigger
        11: Both posedge and negedge trigger

This patch adds support for setting 'posedge and negedge trigger' mode.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
Current code does not correctly handle the case if a driver request irq with
"IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING" flag.
I'm not sure if we have such use case in current code.

 drivers/irqchip/irq-vt8500.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/irqchip/irq-vt8500.c b/drivers/irqchip/irq-vt8500.c
index eb6d05a..e040994 100644
--- a/drivers/irqchip/irq-vt8500.c
+++ b/drivers/irqchip/irq-vt8500.c
@@ -136,6 +136,10 @@ static int vt8500_irq_set_type(struct irq_data *d, unsigned int flow_type)
 		dctr |= VT8500_TRIGGER_RISING;
 		__irq_set_handler_locked(d->irq, handle_edge_irq);
 		break;
+	case IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING:
+		dctr |= VT8500_EDGE;
+		__irq_set_handler_locked(d->irq, handle_edge_irq);
+		break;
 	}
 	writeb(dctr, base + VT8500_ICDC + d->hwirq);
 
-- 
1.8.1.2




      reply	other threads:[~2013-07-09  0:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-09  0:21 [RFT][PATCH 1/2] irqchip: vt8500: Fix implementation for irq_ack and irq_mask Axel Lin
2013-07-09  0:33 ` Axel Lin [this message]

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=1373330011.4223.7.camel@phoenix \
    --to=axel.lin@ingics.com \
    --cc=alchark@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@prisktech.co.nz \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.