diff options
Diffstat (limited to 'drivers/irqchip/irq-renesas-intc-irqpin.c')
-rw-r--r-- | drivers/irqchip/irq-renesas-intc-irqpin.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/irqchip/irq-renesas-intc-irqpin.c b/drivers/irqchip/irq-renesas-intc-irqpin.c index 82cec63a9011..3ee78f02e5d7 100644 --- a/drivers/irqchip/irq-renesas-intc-irqpin.c +++ b/drivers/irqchip/irq-renesas-intc-irqpin.c | |||
@@ -149,8 +149,9 @@ static void intc_irqpin_read_modify_write(struct intc_irqpin_priv *p, | |||
149 | static void intc_irqpin_mask_unmask_prio(struct intc_irqpin_priv *p, | 149 | static void intc_irqpin_mask_unmask_prio(struct intc_irqpin_priv *p, |
150 | int irq, int do_mask) | 150 | int irq, int do_mask) |
151 | { | 151 | { |
152 | int bitfield_width = 4; /* PRIO assumed to have fixed bitfield width */ | 152 | /* The PRIO register is assumed to be 32-bit with fixed 4-bit fields. */ |
153 | int shift = (7 - irq) * bitfield_width; /* PRIO assumed to be 32-bit */ | 153 | int bitfield_width = 4; |
154 | int shift = 32 - (irq + 1) * bitfield_width; | ||
154 | 155 | ||
155 | intc_irqpin_read_modify_write(p, INTC_IRQPIN_REG_PRIO, | 156 | intc_irqpin_read_modify_write(p, INTC_IRQPIN_REG_PRIO, |
156 | shift, bitfield_width, | 157 | shift, bitfield_width, |
@@ -159,8 +160,9 @@ static void intc_irqpin_mask_unmask_prio(struct intc_irqpin_priv *p, | |||
159 | 160 | ||
160 | static int intc_irqpin_set_sense(struct intc_irqpin_priv *p, int irq, int value) | 161 | static int intc_irqpin_set_sense(struct intc_irqpin_priv *p, int irq, int value) |
161 | { | 162 | { |
163 | /* The SENSE register is assumed to be 32-bit. */ | ||
162 | int bitfield_width = p->config.sense_bitfield_width; | 164 | int bitfield_width = p->config.sense_bitfield_width; |
163 | int shift = (7 - irq) * bitfield_width; /* SENSE assumed to be 32-bit */ | 165 | int shift = 32 - (irq + 1) * bitfield_width; |
164 | 166 | ||
165 | dev_dbg(&p->pdev->dev, "sense irq = %d, mode = %d\n", irq, value); | 167 | dev_dbg(&p->pdev->dev, "sense irq = %d, mode = %d\n", irq, value); |
166 | 168 | ||