Skip to content

Commit 76c3b77

Browse files
bijudasKAGA-KOKO
authored andcommitted
irqchip/renesas-rzv2h: Update TSSR_TIEN macro
On RZ/G3E, TIEN bit position is at 15 compared to 7 on RZ/V2H. Replace the macro ICU_TSSR_TIEN(n)->ICU_TSSR_TIEN(n, _field_width) for supporting both these SoCs. Signed-off-by: Biju Das <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 1a6ebcc commit 76c3b77

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/irqchip/irq-renesas-rzv2h.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@
6666

6767
#define ICU_TSSR_TSSEL_PREP(tssel, n) ((tssel) << ((n) * 8))
6868
#define ICU_TSSR_TSSEL_MASK(n) ICU_TSSR_TSSEL_PREP(0x7F, n)
69-
#define ICU_TSSR_TIEN(n) (BIT(7) << ((n) * 8))
69+
#define ICU_TSSR_TIEN(n, field_width) \
70+
({\
71+
typeof(field_width) (_field_width) = (field_width); \
72+
BIT((_field_width) - 1) << ((n) * (_field_width)); \
73+
})
7074

7175
#define ICU_TITSR_K(tint_nr) ((tint_nr) / 16)
7276
#define ICU_TITSR_TITSEL_N(tint_nr) ((tint_nr) % 16)
@@ -153,9 +157,9 @@ static void rzv2h_tint_irq_endisable(struct irq_data *d, bool enable)
153157
guard(raw_spinlock)(&priv->lock);
154158
tssr = readl_relaxed(priv->base + priv->info->t_offs + ICU_TSSR(k));
155159
if (enable)
156-
tssr |= ICU_TSSR_TIEN(tssel_n);
160+
tssr |= ICU_TSSR_TIEN(tssel_n, priv->info->field_width);
157161
else
158-
tssr &= ~ICU_TSSR_TIEN(tssel_n);
162+
tssr &= ~ICU_TSSR_TIEN(tssel_n, priv->info->field_width);
159163
writel_relaxed(tssr, priv->base + priv->info->t_offs + ICU_TSSR(k));
160164
}
161165

@@ -314,7 +318,7 @@ static int rzv2h_tint_set_type(struct irq_data *d, unsigned int type)
314318
nr_tint = 32 / priv->info->field_width;
315319
tssr_k = tint_nr / nr_tint;
316320
tssel_n = tint_nr % nr_tint;
317-
tien = ICU_TSSR_TIEN(tssel_n);
321+
tien = ICU_TSSR_TIEN(tssel_n, priv->info->field_width);
318322

319323
titsr_k = ICU_TITSR_K(tint_nr);
320324
titsel_n = ICU_TITSR_TITSEL_N(tint_nr);

0 commit comments

Comments
 (0)