Skip to content
Commit fa917052 authored by Milo Kim's avatar Milo Kim Committed by Lee Jones
Browse files

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: default avatarMilo Kim <woogyom.kim@gmail.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 6d2c2b9f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment