Commit 471aa962 authored by Paul Burton's avatar Paul Burton Committed by Ralf Baechle

irqchip: mips-gic: Remove gic_set_trigger()

Remove the gic_set_trigger() function in favour of using the new
change_gic_trig() accessor function which provides equivalent
functionality.
Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
Acked-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/17030/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 80e5f9c9
...@@ -92,13 +92,6 @@ static inline void gic_update_bits(unsigned int reg, unsigned long mask, ...@@ -92,13 +92,6 @@ static inline void gic_update_bits(unsigned int reg, unsigned long mask,
gic_write(reg, regval); gic_write(reg, regval);
} }
static inline void gic_set_trigger(unsigned int intr, unsigned int trig)
{
gic_update_bits(GIC_REG(SHARED, GIC_SH_SET_TRIGGER) +
GIC_INTR_OFS(intr), 1ul << GIC_INTR_BIT(intr),
(unsigned long)trig << GIC_INTR_BIT(intr));
}
static inline void gic_set_dual_edge(unsigned int intr, unsigned int dual) static inline void gic_set_dual_edge(unsigned int intr, unsigned int dual)
{ {
gic_update_bits(GIC_REG(SHARED, GIC_SH_SET_DUAL) + GIC_INTR_OFS(intr), gic_update_bits(GIC_REG(SHARED, GIC_SH_SET_DUAL) + GIC_INTR_OFS(intr),
...@@ -266,32 +259,32 @@ static int gic_set_type(struct irq_data *d, unsigned int type) ...@@ -266,32 +259,32 @@ static int gic_set_type(struct irq_data *d, unsigned int type)
switch (type & IRQ_TYPE_SENSE_MASK) { switch (type & IRQ_TYPE_SENSE_MASK) {
case IRQ_TYPE_EDGE_FALLING: case IRQ_TYPE_EDGE_FALLING:
change_gic_pol(irq, GIC_POL_FALLING_EDGE); change_gic_pol(irq, GIC_POL_FALLING_EDGE);
gic_set_trigger(irq, GIC_TRIG_EDGE); change_gic_trig(irq, GIC_TRIG_EDGE);
gic_set_dual_edge(irq, GIC_TRIG_DUAL_DISABLE); gic_set_dual_edge(irq, GIC_TRIG_DUAL_DISABLE);
is_edge = true; is_edge = true;
break; break;
case IRQ_TYPE_EDGE_RISING: case IRQ_TYPE_EDGE_RISING:
change_gic_pol(irq, GIC_POL_RISING_EDGE); change_gic_pol(irq, GIC_POL_RISING_EDGE);
gic_set_trigger(irq, GIC_TRIG_EDGE); change_gic_trig(irq, GIC_TRIG_EDGE);
gic_set_dual_edge(irq, GIC_TRIG_DUAL_DISABLE); gic_set_dual_edge(irq, GIC_TRIG_DUAL_DISABLE);
is_edge = true; is_edge = true;
break; break;
case IRQ_TYPE_EDGE_BOTH: case IRQ_TYPE_EDGE_BOTH:
/* polarity is irrelevant in this case */ /* polarity is irrelevant in this case */
gic_set_trigger(irq, GIC_TRIG_EDGE); change_gic_trig(irq, GIC_TRIG_EDGE);
gic_set_dual_edge(irq, GIC_TRIG_DUAL_ENABLE); gic_set_dual_edge(irq, GIC_TRIG_DUAL_ENABLE);
is_edge = true; is_edge = true;
break; break;
case IRQ_TYPE_LEVEL_LOW: case IRQ_TYPE_LEVEL_LOW:
change_gic_pol(irq, GIC_POL_ACTIVE_LOW); change_gic_pol(irq, GIC_POL_ACTIVE_LOW);
gic_set_trigger(irq, GIC_TRIG_LEVEL); change_gic_trig(irq, GIC_TRIG_LEVEL);
gic_set_dual_edge(irq, GIC_TRIG_DUAL_DISABLE); gic_set_dual_edge(irq, GIC_TRIG_DUAL_DISABLE);
is_edge = false; is_edge = false;
break; break;
case IRQ_TYPE_LEVEL_HIGH: case IRQ_TYPE_LEVEL_HIGH:
default: default:
change_gic_pol(irq, GIC_POL_ACTIVE_HIGH); change_gic_pol(irq, GIC_POL_ACTIVE_HIGH);
gic_set_trigger(irq, GIC_TRIG_LEVEL); change_gic_trig(irq, GIC_TRIG_LEVEL);
gic_set_dual_edge(irq, GIC_TRIG_DUAL_DISABLE); gic_set_dual_edge(irq, GIC_TRIG_DUAL_DISABLE);
is_edge = false; is_edge = false;
break; break;
...@@ -458,7 +451,7 @@ static void __init gic_basic_init(void) ...@@ -458,7 +451,7 @@ static void __init gic_basic_init(void)
/* Setup defaults */ /* Setup defaults */
for (i = 0; i < gic_shared_intrs; i++) { for (i = 0; i < gic_shared_intrs; i++) {
change_gic_pol(i, GIC_POL_ACTIVE_HIGH); change_gic_pol(i, GIC_POL_ACTIVE_HIGH);
gic_set_trigger(i, GIC_TRIG_LEVEL); change_gic_trig(i, GIC_TRIG_LEVEL);
write_gic_rmask(BIT(i)); write_gic_rmask(BIT(i));
} }
......
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
#define GIC_MAX_INTRS 256 #define GIC_MAX_INTRS 256
/* Constants */ /* Constants */
#define GIC_TRIG_EDGE 1
#define GIC_TRIG_LEVEL 0
#define GIC_TRIG_DUAL_ENABLE 1 #define GIC_TRIG_DUAL_ENABLE 1
#define GIC_TRIG_DUAL_DISABLE 0 #define GIC_TRIG_DUAL_DISABLE 0
...@@ -50,9 +48,6 @@ ...@@ -50,9 +48,6 @@
}) })
#define GIC_INTR_BIT(intr) ((intr) % (mips_cm_is64 ? 64 : 32)) #define GIC_INTR_BIT(intr) ((intr) % (mips_cm_is64 ? 64 : 32))
/* Triggering : Reset Value is always 0 */
#define GIC_SH_SET_TRIGGER_OFS 0x0180
/* Dual edge triggering : Reset Value is always 0 */ /* Dual edge triggering : Reset Value is always 0 */
#define GIC_SH_SET_DUAL_OFS 0x0200 #define GIC_SH_SET_DUAL_OFS 0x0200
......
Markdown is supported
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