Skip to content

Commit

Permalink
irqchip: mips-gic: Remove gic_set_polarity()
Browse files Browse the repository at this point in the history
Remove the gic_set_polarity() function in favour of using the new
change_gic_pol() accessor function which provides equivalent
functionality.

Signed-off-by: Paul Burton <[email protected]>
Acked-by: Marc Zyngier <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/17029/
Signed-off-by: Ralf Baechle <[email protected]>
  • Loading branch information
paulburton authored and ralfbaechle committed Sep 4, 2017
1 parent 87554b0 commit 80e5f9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
17 changes: 5 additions & 12 deletions drivers/irqchip/irq-mips-gic.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,6 @@ static inline void gic_update_bits(unsigned int reg, unsigned long mask,
gic_write(reg, regval);
}

static inline void gic_set_polarity(unsigned int intr, unsigned int pol)
{
gic_update_bits(GIC_REG(SHARED, GIC_SH_SET_POLARITY) +
GIC_INTR_OFS(intr), 1ul << GIC_INTR_BIT(intr),
(unsigned long)pol << GIC_INTR_BIT(intr));
}

static inline void gic_set_trigger(unsigned int intr, unsigned int trig)
{
gic_update_bits(GIC_REG(SHARED, GIC_SH_SET_TRIGGER) +
Expand Down Expand Up @@ -272,13 +265,13 @@ static int gic_set_type(struct irq_data *d, unsigned int type)
spin_lock_irqsave(&gic_lock, flags);
switch (type & IRQ_TYPE_SENSE_MASK) {
case IRQ_TYPE_EDGE_FALLING:
gic_set_polarity(irq, GIC_POL_NEG);
change_gic_pol(irq, GIC_POL_FALLING_EDGE);
gic_set_trigger(irq, GIC_TRIG_EDGE);
gic_set_dual_edge(irq, GIC_TRIG_DUAL_DISABLE);
is_edge = true;
break;
case IRQ_TYPE_EDGE_RISING:
gic_set_polarity(irq, GIC_POL_POS);
change_gic_pol(irq, GIC_POL_RISING_EDGE);
gic_set_trigger(irq, GIC_TRIG_EDGE);
gic_set_dual_edge(irq, GIC_TRIG_DUAL_DISABLE);
is_edge = true;
Expand All @@ -290,14 +283,14 @@ static int gic_set_type(struct irq_data *d, unsigned int type)
is_edge = true;
break;
case IRQ_TYPE_LEVEL_LOW:
gic_set_polarity(irq, GIC_POL_NEG);
change_gic_pol(irq, GIC_POL_ACTIVE_LOW);
gic_set_trigger(irq, GIC_TRIG_LEVEL);
gic_set_dual_edge(irq, GIC_TRIG_DUAL_DISABLE);
is_edge = false;
break;
case IRQ_TYPE_LEVEL_HIGH:
default:
gic_set_polarity(irq, GIC_POL_POS);
change_gic_pol(irq, GIC_POL_ACTIVE_HIGH);
gic_set_trigger(irq, GIC_TRIG_LEVEL);
gic_set_dual_edge(irq, GIC_TRIG_DUAL_DISABLE);
is_edge = false;
Expand Down Expand Up @@ -464,7 +457,7 @@ static void __init gic_basic_init(void)

/* Setup defaults */
for (i = 0; i < gic_shared_intrs; i++) {
gic_set_polarity(i, GIC_POL_POS);
change_gic_pol(i, GIC_POL_ACTIVE_HIGH);
gic_set_trigger(i, GIC_TRIG_LEVEL);
write_gic_rmask(BIT(i));
}
Expand Down
5 changes: 0 additions & 5 deletions include/linux/irqchip/mips-gic.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
#define GIC_MAX_INTRS 256

/* Constants */
#define GIC_POL_POS 1
#define GIC_POL_NEG 0
#define GIC_TRIG_EDGE 1
#define GIC_TRIG_LEVEL 0
#define GIC_TRIG_DUAL_ENABLE 1
Expand Down Expand Up @@ -52,9 +50,6 @@
})
#define GIC_INTR_BIT(intr) ((intr) % (mips_cm_is64 ? 64 : 32))

/* Polarity : Reset Value is always 0 */
#define GIC_SH_SET_POLARITY_OFS 0x0100

/* Triggering : Reset Value is always 0 */
#define GIC_SH_SET_TRIGGER_OFS 0x0180

Expand Down

0 comments on commit 80e5f9c

Please sign in to comment.