diff options
author | Daniel Ribeiro <drwyrm@gmail.com> | 2009-06-23 12:32:11 -0300 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2009-09-17 09:46:45 +0200 |
commit | 9f7b07d6cc3ed14783c9427a5b2a69794eb2de64 (patch) | |
tree | c3793ad2c4318afa51f044f27c307017797a7d98 /drivers/mfd/ezx-pcap.c | |
parent | dfc3aa7221f50bf3d05c67b826414ab290b95c46 (diff) | |
download | linux-3.10-9f7b07d6cc3ed14783c9427a5b2a69794eb2de64.tar.gz linux-3.10-9f7b07d6cc3ed14783c9427a5b2a69794eb2de64.tar.bz2 linux-3.10-9f7b07d6cc3ed14783c9427a5b2a69794eb2de64.zip |
mfd: Introduce irq_to_pcap()
Export an irq_to_pcap function to get pcap irq number, for the keypad driver.
Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/ezx-pcap.c')
-rw-r--r-- | drivers/mfd/ezx-pcap.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/mfd/ezx-pcap.c b/drivers/mfd/ezx-pcap.c index c1de4afa89a..de7e63706ab 100644 --- a/drivers/mfd/ezx-pcap.c +++ b/drivers/mfd/ezx-pcap.c @@ -107,10 +107,11 @@ int ezx_pcap_read(struct pcap_chip *pcap, u8 reg_num, u32 *value) EXPORT_SYMBOL_GPL(ezx_pcap_read); /* IRQ */ -static inline unsigned int irq2pcap(struct pcap_chip *pcap, int irq) +int irq_to_pcap(struct pcap_chip *pcap, int irq) { - return 1 << (irq - pcap->irq_base); + return irq - pcap->irq_base; } +EXPORT_SYMBOL_GPL(irq_to_pcap); int pcap_to_irq(struct pcap_chip *pcap, int irq) { @@ -122,7 +123,7 @@ static void pcap_mask_irq(unsigned int irq) { struct pcap_chip *pcap = get_irq_chip_data(irq); - pcap->msr |= irq2pcap(pcap, irq); + pcap->msr |= 1 << irq_to_pcap(pcap, irq); queue_work(pcap->workqueue, &pcap->msr_work); } @@ -130,7 +131,7 @@ static void pcap_unmask_irq(unsigned int irq) { struct pcap_chip *pcap = get_irq_chip_data(irq); - pcap->msr &= ~irq2pcap(pcap, irq); + pcap->msr &= ~(1 << irq_to_pcap(pcap, irq)); queue_work(pcap->workqueue, &pcap->msr_work); } |