irqchip/gicv2/3: add gic_retrigger
authorHuibin Hong <huibin.hong@rock-chips.com>
Mon, 21 Nov 2016 09:47:06 +0000 (17:47 +0800)
committerchenjh <chenjh@rock-chips.com>
Wed, 5 Apr 2017 11:02:25 +0000 (19:02 +0800)
Change-Id: Ic87d4936317fb598c04e3ccc56a850c0c9e4e6ba
Signed-off-by: chenjh <chenjh@rock-chips.com>
drivers/irqchip/irq-gic-v3.c
drivers/irqchip/irq-gic.c

index dff17ae..3d1514a 100644 (file)
@@ -216,6 +216,15 @@ static void gic_unmask_irq(struct irq_data *d)
        gic_poke_irq(d, GICD_ISENABLER);
 }
 
+#ifdef CONFIG_ARCH_ROCKCHIP
+static int gic_retrigger(struct irq_data *d)
+{
+       gic_poke_irq(d, GICD_ISPENDR);
+       /* the genirq layer expects 0 if we can't retrigger in hardware */
+       return 0;
+}
+#endif
+
 static int gic_irq_set_irqchip_state(struct irq_data *d,
                                     enum irqchip_irq_state which, bool val)
 {
@@ -697,6 +706,9 @@ static struct irq_chip gic_chip = {
        .irq_unmask             = gic_unmask_irq,
        .irq_eoi                = gic_eoi_irq,
        .irq_set_type           = gic_set_type,
+#ifdef CONFIG_ARCH_ROCKCHIP
+       .irq_retrigger          = gic_retrigger,
+#endif
        .irq_set_affinity       = gic_set_affinity,
        .irq_get_irqchip_state  = gic_irq_get_irqchip_state,
        .irq_set_irqchip_state  = gic_irq_set_irqchip_state,
@@ -708,6 +720,9 @@ static struct irq_chip gic_eoimode1_chip = {
        .irq_mask               = gic_eoimode1_mask_irq,
        .irq_unmask             = gic_unmask_irq,
        .irq_eoi                = gic_eoimode1_eoi_irq,
+#ifdef CONFIG_ARCH_ROCKCHIP
+       .irq_retrigger          = gic_retrigger,
+#endif
        .irq_set_type           = gic_set_type,
        .irq_set_affinity       = gic_set_affinity,
        .irq_get_irqchip_state  = gic_irq_get_irqchip_state,
index 7851e78..d422377 100644 (file)
@@ -205,6 +205,15 @@ static void gic_unmask_irq(struct irq_data *d)
        gic_poke_irq(d, GIC_DIST_ENABLE_SET);
 }
 
+#ifdef CONFIG_ARCH_ROCKCHIP
+static int gic_retrigger(struct irq_data *d)
+{
+       gic_poke_irq(d, GIC_DIST_PENDING_SET);
+       /* the genirq layer expects 0 if we can't retrigger in hardware */
+       return 0;
+}
+#endif
+
 static void gic_eoi_irq(struct irq_data *d)
 {
        writel_relaxed(gic_irq(d), gic_cpu_base(d) + GIC_CPU_EOI);
@@ -396,6 +405,9 @@ static struct irq_chip gic_chip = {
        .irq_unmask             = gic_unmask_irq,
        .irq_eoi                = gic_eoi_irq,
        .irq_set_type           = gic_set_type,
+#ifdef CONFIG_ARCH_ROCKCHIP
+       .irq_retrigger          = gic_retrigger,
+#endif
 #ifdef CONFIG_SMP
        .irq_set_affinity       = gic_set_affinity,
 #endif
@@ -412,6 +424,9 @@ static struct irq_chip gic_eoimode1_chip = {
        .irq_unmask             = gic_unmask_irq,
        .irq_eoi                = gic_eoimode1_eoi_irq,
        .irq_set_type           = gic_set_type,
+#ifdef CONFIG_ARCH_ROCKCHIP
+       .irq_retrigger          = gic_retrigger,
+#endif
 #ifdef CONFIG_SMP
        .irq_set_affinity       = gic_set_affinity,
 #endif