Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <biju.das.jz@bp.renesas.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/all/20250224131253.134199-11-biju.das.jz@bp.renesas.com

authored by

Biju Das and committed by
Thomas Gleixner
76c3b774 1a6ebcc1

+8 -4
+8 -4
drivers/irqchip/irq-renesas-rzv2h.c
··· 66 66 67 67 #define ICU_TSSR_TSSEL_PREP(tssel, n) ((tssel) << ((n) * 8)) 68 68 #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 + }) 70 74 71 75 #define ICU_TITSR_K(tint_nr) ((tint_nr) / 16) 72 76 #define ICU_TITSR_TITSEL_N(tint_nr) ((tint_nr) % 16) ··· 157 153 guard(raw_spinlock)(&priv->lock); 158 154 tssr = readl_relaxed(priv->base + priv->info->t_offs + ICU_TSSR(k)); 159 155 if (enable) 160 - tssr |= ICU_TSSR_TIEN(tssel_n); 156 + tssr |= ICU_TSSR_TIEN(tssel_n, priv->info->field_width); 161 157 else 162 - tssr &= ~ICU_TSSR_TIEN(tssel_n); 158 + tssr &= ~ICU_TSSR_TIEN(tssel_n, priv->info->field_width); 163 159 writel_relaxed(tssr, priv->base + priv->info->t_offs + ICU_TSSR(k)); 164 160 } 165 161 ··· 318 314 nr_tint = 32 / priv->info->field_width; 319 315 tssr_k = tint_nr / nr_tint; 320 316 tssel_n = tint_nr % nr_tint; 321 - tien = ICU_TSSR_TIEN(tssel_n); 317 + tien = ICU_TSSR_TIEN(tssel_n, priv->info->field_width); 322 318 323 319 titsr_k = ICU_TITSR_K(tint_nr); 324 320 titsel_n = ICU_TITSR_TITSEL_N(tint_nr);