Skip to content

Commit eb23d23

Browse files
bijudasKAGA-KOKO
authored andcommitted
irqchip/renesas-rzv2h: Add max_tssel to struct rzv2h_hw_info
The number of GPIO interrupts on RZ/G3E for TINT selection is 141 compared to 86 on RZ/V2H. Rename the macro ICU_PB5_TINT->ICU_RZV2H_TSSEL_MAX_VAL to hold this difference for RZ/V2H. Add max_tssel to struct rzv2h_hw_info and replace the hardcoded constants in the code. Signed-off-by: Biju Das <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Fabrizio Castro <[email protected]> Reviewed-by: Tommaso Merciai <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 0a9d6ef commit eb23d23

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/irqchip/irq-renesas-rzv2h.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,16 @@
7878

7979
#define ICU_TINT_EXTRACT_HWIRQ(x) FIELD_GET(GENMASK(15, 0), (x))
8080
#define ICU_TINT_EXTRACT_GPIOINT(x) FIELD_GET(GENMASK(31, 16), (x))
81-
#define ICU_PB5_TINT 0x55
81+
#define ICU_RZV2H_TSSEL_MAX_VAL 0x55
8282

8383
/**
8484
* struct rzv2h_hw_info - Interrupt Control Unit controller hardware info structure.
8585
* @t_offs: TINT offset
86+
* @max_tssel: TSSEL max value
8687
*/
8788
struct rzv2h_hw_info {
8889
u16 t_offs;
90+
u8 max_tssel;
8991
};
9092

9193
/**
@@ -298,13 +300,12 @@ static int rzv2h_tint_set_type(struct irq_data *d, unsigned int type)
298300
return -EINVAL;
299301
}
300302

303+
priv = irq_data_to_priv(d);
301304
tint = (u32)(uintptr_t)irq_data_get_irq_chip_data(d);
302-
if (tint > ICU_PB5_TINT)
305+
if (tint > priv->info->max_tssel)
303306
return -EINVAL;
304307

305-
priv = irq_data_to_priv(d);
306308
hwirq = irqd_to_hwirq(d);
307-
308309
tint_nr = hwirq - ICU_TINT_START;
309310

310311
tssr_k = ICU_TSSR_K(tint_nr);
@@ -517,6 +518,7 @@ static int rzv2h_icu_init_common(struct device_node *node, struct device_node *p
517518

518519
static const struct rzv2h_hw_info rzv2h_hw_params = {
519520
.t_offs = 0,
521+
.max_tssel = ICU_RZV2H_TSSEL_MAX_VAL,
520522
};
521523

522524
static int rzv2h_icu_init(struct device_node *node, struct device_node *parent)

0 commit comments

Comments
 (0)