aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mfd/tps65217.h
diff options
context:
space:
mode:
authorMilo Kim <woogyom.kim@gmail.com>2016-11-15 22:02:14 +0900
committerLee Jones <lee.jones@linaro.org>2016-11-29 08:21:40 +0000
commitfa9170522b362aefb4fef58b5cbff45dbefec258 (patch)
treef36863519908576ba602394f3fe4ae22195a6ab6 /include/linux/mfd/tps65217.h
parentmfd: tps65217: Update register interrupt mask bits instead of writing operation (diff)
downloadlinux-dev-fa9170522b362aefb4fef58b5cbff45dbefec258.tar.xz
linux-dev-fa9170522b362aefb4fef58b5cbff45dbefec258.zip
mfd: tps65217: Make an interrupt handler simpler
Rework the IRQ handler by using HW IRQ number and status bit. Each HW IRQ number is matched with TPS65217 register layout[*]. (USB IRQ number is 0, AC is 1, Push button is 2) When an interrupt is enabled, mask bit should be cleared (unmasked). If an interrupt is disabled, then mask bit should be set (masked). This mask value is updated into the TPS65217 register in irq_sync_unlock(). Mask bit and interrupt status bit can be handled with HW IRQ number. Eventually, additional IRQ data, 'tps65217_irqs[]' and the function, 'irq_to_tps65217_irq()' are not necessary. [*] TPS65217 interrupt register layout Bit7 6 5 4 3 2 1 0 ---------------------------------------------- | x | PBM | ACM | USBM | x | PBI | ACI | USBI PBM: Push button status change interrupt mask ACM: AC interrupt mask USBM: USB power status change interrupt mask PBI: Push button status change interrupt ACI: AC power status change interrupt USBI: USB power status change interrupt x: Not used Signed-off-by: Milo Kim <woogyom.kim@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'include/linux/mfd/tps65217.h')
-rw-r--r--include/linux/mfd/tps65217.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/mfd/tps65217.h b/include/linux/mfd/tps65217.h
index dfa9f0d0ae2b..20d9dd3d74f1 100644
--- a/include/linux/mfd/tps65217.h
+++ b/include/linux/mfd/tps65217.h
@@ -79,6 +79,7 @@
#define TPS65217_INT_PBI BIT(2)
#define TPS65217_INT_ACI BIT(1)
#define TPS65217_INT_USBI BIT(0)
+#define TPS65217_INT_SHIFT 4
#define TPS65217_INT_MASK (TPS65217_INT_PBM | TPS65217_INT_ACM | \
TPS65217_INT_USBM)