27 #include <linux/slab.h>
32 #include <linux/bitops.h>
41 #define VT8500_ICPC_IRQ 0x20
42 #define VT8500_ICPC_FIQ 0x24
43 #define VT8500_ICDC 0x40
44 #define VT8500_ICIS 0x80
47 #define ICPC_MASK 0x3F
48 #define ICPC_ROTATE BIT(6)
53 #define ICDC_DSS0 0x02
54 #define ICDC_DSS1 0x03
55 #define ICDC_DSS2 0x04
56 #define ICDC_DSS3 0x05
57 #define ICDC_DSS4 0x06
58 #define ICDC_DSS5 0x07
60 #define VT8500_INT_DISABLE 0
61 #define VT8500_INT_ENABLE BIT(3)
63 #define VT8500_TRIGGER_HIGH 0
64 #define VT8500_TRIGGER_RISING BIT(5)
65 #define VT8500_TRIGGER_FALLING BIT(6)
66 #define VT8500_EDGE ( VT8500_TRIGGER_RISING \
67 | VT8500_TRIGGER_FALLING)
75 static void vt8500_irq_mask(
struct irq_data *
d)
85 + (d->
hwirq < 32 ? 0 : 4);
88 status |= (1 << (d->
hwirq & 0x1f));
98 static void vt8500_irq_unmask(
struct irq_data *
d)
110 static int vt8500_irq_set_type(
struct irq_data *d,
unsigned int flow_type)
141 static struct irq_chip vt8500_irq_chip = {
143 .irq_ack = vt8500_irq_mask,
144 .irq_mask = vt8500_irq_mask,
145 .irq_unmask = vt8500_irq_unmask,
146 .irq_set_type = vt8500_irq_set_type,
157 for (i = 0; i < 64; i++) {
164 static int vt8500_irq_map(
struct irq_domain *
h,
unsigned int virq,
174 .map = vt8500_irq_map,
189 &vt8500_irq_domain_ops, priv);
190 if (!vt8500_irq_domain)
191 pr_err(
"%s: Unable to add wmt irq domain!\n", __func__);
195 vt8500_init_irq_hw(priv->
base);
197 pr_info(
"Added IRQ Controller @ %x [virq_base = %d]\n",
204 pr_err(
"%s: Incorrect IRQ map for slave controller\n",
209 for (i = 0; i < 8; i++) {
214 pr_info(
"vt8500-irq: Enabled slave->parent interrupts\n");