mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
irqchip/renesas-rzg2l: Replace rzg2l_irqc_irq_{enable,disable} with TINT-specific handlers
rzg2l_irqc_irq_disable() and rzg2l_irqc_irq_enable() are used by both the IRQ and TINT chips, but only perform TINT-specific work via rzg2l_tint_irq_endisable(), guarded by a hw_irq range check. Since the IRQ chip does not require this extra enable/disable handling, replace its callbacks with the generic irq_chip_disable_parent() and irq_chip_enable_parent() directly. While at it, simplify rzfive_irqc_irq_enable() by replacing raw_spin_lock locking/unlocking with guard() and update the variable types of offset, tssr_offset, and tssr_index to unsigned int, as these variables are used only for calculation. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Link: https://patch.msgid.link/20260325192451.172562-9-biju.das.jz@bp.renesas.com
This commit is contained in:
parent
d196aeb35e
commit
83ed8efca0
|
|
@ -259,33 +259,29 @@ static void rzfive_irqc_irq_enable(struct irq_data *d)
|
|||
|
||||
static void rzg2l_tint_irq_endisable(struct irq_data *d, bool enable)
|
||||
{
|
||||
struct rzg2l_irqc_priv *priv = irq_data_to_priv(d);
|
||||
unsigned int hw_irq = irqd_to_hwirq(d);
|
||||
unsigned int offset = hw_irq - IRQC_TINT_START;
|
||||
unsigned int tssr_offset = TSSR_OFFSET(offset);
|
||||
unsigned int tssr_index = TSSR_INDEX(offset);
|
||||
u32 reg;
|
||||
|
||||
if (hw_irq >= IRQC_TINT_START && hw_irq < IRQC_NUM_IRQ) {
|
||||
struct rzg2l_irqc_priv *priv = irq_data_to_priv(d);
|
||||
u32 offset = hw_irq - IRQC_TINT_START;
|
||||
u32 tssr_offset = TSSR_OFFSET(offset);
|
||||
u8 tssr_index = TSSR_INDEX(offset);
|
||||
u32 reg;
|
||||
|
||||
raw_spin_lock(&priv->lock);
|
||||
reg = readl_relaxed(priv->base + TSSR(tssr_index));
|
||||
if (enable)
|
||||
reg |= TIEN << TSSEL_SHIFT(tssr_offset);
|
||||
else
|
||||
reg &= ~(TIEN << TSSEL_SHIFT(tssr_offset));
|
||||
writel_relaxed(reg, priv->base + TSSR(tssr_index));
|
||||
raw_spin_unlock(&priv->lock);
|
||||
}
|
||||
guard(raw_spinlock)(&priv->lock);
|
||||
reg = readl_relaxed(priv->base + TSSR(tssr_index));
|
||||
if (enable)
|
||||
reg |= TIEN << TSSEL_SHIFT(tssr_offset);
|
||||
else
|
||||
reg &= ~(TIEN << TSSEL_SHIFT(tssr_offset));
|
||||
writel_relaxed(reg, priv->base + TSSR(tssr_index));
|
||||
}
|
||||
|
||||
static void rzg2l_irqc_irq_disable(struct irq_data *d)
|
||||
static void rzg2l_irqc_tint_disable(struct irq_data *d)
|
||||
{
|
||||
irq_chip_disable_parent(d);
|
||||
rzg2l_tint_irq_endisable(d, false);
|
||||
}
|
||||
|
||||
static void rzg2l_irqc_irq_enable(struct irq_data *d)
|
||||
static void rzg2l_irqc_tint_enable(struct irq_data *d)
|
||||
{
|
||||
rzg2l_tint_irq_endisable(d, true);
|
||||
irq_chip_enable_parent(d);
|
||||
|
|
@ -454,8 +450,8 @@ static const struct irq_chip rzg2l_irqc_irq_chip = {
|
|||
.irq_eoi = rzg2l_irqc_irq_eoi,
|
||||
.irq_mask = irq_chip_mask_parent,
|
||||
.irq_unmask = irq_chip_unmask_parent,
|
||||
.irq_disable = rzg2l_irqc_irq_disable,
|
||||
.irq_enable = rzg2l_irqc_irq_enable,
|
||||
.irq_disable = irq_chip_disable_parent,
|
||||
.irq_enable = irq_chip_enable_parent,
|
||||
.irq_get_irqchip_state = irq_chip_get_parent_state,
|
||||
.irq_set_irqchip_state = irq_chip_set_parent_state,
|
||||
.irq_retrigger = irq_chip_retrigger_hierarchy,
|
||||
|
|
@ -471,8 +467,8 @@ static const struct irq_chip rzg2l_irqc_tint_chip = {
|
|||
.irq_eoi = rzg2l_irqc_tint_eoi,
|
||||
.irq_mask = irq_chip_mask_parent,
|
||||
.irq_unmask = irq_chip_unmask_parent,
|
||||
.irq_disable = rzg2l_irqc_irq_disable,
|
||||
.irq_enable = rzg2l_irqc_irq_enable,
|
||||
.irq_disable = rzg2l_irqc_tint_disable,
|
||||
.irq_enable = rzg2l_irqc_tint_enable,
|
||||
.irq_get_irqchip_state = irq_chip_get_parent_state,
|
||||
.irq_set_irqchip_state = irq_chip_set_parent_state,
|
||||
.irq_retrigger = irq_chip_retrigger_hierarchy,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user