aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mfd/ezx-pcap.c9
-rw-r--r--include/linux/mfd/ezx-pcap.h1
2 files changed, 6 insertions, 4 deletions
diff --git a/drivers/mfd/ezx-pcap.c b/drivers/mfd/ezx-pcap.c
index c1de4afa89a6..de7e63706abb 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)
107EXPORT_SYMBOL_GPL(ezx_pcap_read); 107EXPORT_SYMBOL_GPL(ezx_pcap_read);
108 108
109/* IRQ */ 109/* IRQ */
110static inline unsigned int irq2pcap(struct pcap_chip *pcap, int irq) 110int irq_to_pcap(struct pcap_chip *pcap, int irq)
111{ 111{
112 return 1 << (irq - pcap->irq_base); 112 return irq - pcap->irq_base;
113} 113}
114EXPORT_SYMBOL_GPL(irq_to_pcap);
114 115
115int pcap_to_irq(struct pcap_chip *pcap, int irq) 116int pcap_to_irq(struct pcap_chip *pcap, int irq)
116{ 117{
@@ -122,7 +123,7 @@ static void pcap_mask_irq(unsigned int irq)
122{ 123{
123 struct pcap_chip *pcap = get_irq_chip_data(irq); 124 struct pcap_chip *pcap = get_irq_chip_data(irq);
124 125
125 pcap->msr |= irq2pcap(pcap, irq); 126 pcap->msr |= 1 << irq_to_pcap(pcap, irq);
126 queue_work(pcap->workqueue, &pcap->msr_work); 127 queue_work(pcap->workqueue, &pcap->msr_work);
127} 128}
128 129
@@ -130,7 +131,7 @@ static void pcap_unmask_irq(unsigned int irq)
130{ 131{
131 struct pcap_chip *pcap = get_irq_chip_data(irq); 132 struct pcap_chip *pcap = get_irq_chip_data(irq);
132 133
133 pcap->msr &= ~irq2pcap(pcap, irq); 134 pcap->msr &= ~(1 << irq_to_pcap(pcap, irq));
134 queue_work(pcap->workqueue, &pcap->msr_work); 135 queue_work(pcap->workqueue, &pcap->msr_work);
135} 136}
136 137
diff --git a/include/linux/mfd/ezx-pcap.h b/include/linux/mfd/ezx-pcap.h
index c12c3c0932bf..6296b4935a1e 100644
--- a/include/linux/mfd/ezx-pcap.h
+++ b/include/linux/mfd/ezx-pcap.h
@@ -26,6 +26,7 @@ struct pcap_chip;
26int ezx_pcap_write(struct pcap_chip *, u8, u32); 26int ezx_pcap_write(struct pcap_chip *, u8, u32);
27int ezx_pcap_read(struct pcap_chip *, u8, u32 *); 27int ezx_pcap_read(struct pcap_chip *, u8, u32 *);
28int pcap_to_irq(struct pcap_chip *, int); 28int pcap_to_irq(struct pcap_chip *, int);
29int irq_to_pcap(struct pcap_chip *, int);
29int pcap_adc_async(struct pcap_chip *, u8, u32, u8[], void *, void *); 30int pcap_adc_async(struct pcap_chip *, u8, u32, u8[], void *, void *);
30int pcap_adc_sync(struct pcap_chip *, u8, u32, u8[], u16[]); 31int pcap_adc_sync(struct pcap_chip *, u8, u32, u8[], u16[]);
31 32