From nobody Tue Apr 7 20:30:24 2026 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 84745439001 for ; Fri, 27 Feb 2026 14:03:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772201009; cv=none; b=UekKnJncIUA0J2AM+kvCaZiqyhdMxgAA1Mh9xB+V3NBOxbaSwV2gaI+pqEz7r8XnquK56406sc4tfbTTfOOSS9/pfC6i48TX5WOkZPf/Fh2XBQ6nUWtmTnmp+IyJSxWh4SOtQX5Pdfs0sgTL3K+uude1e3xtBr8esh1FYiSyGfo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772201009; c=relaxed/simple; bh=TZ0Nhq9pboAkoeLu9YpOxbUkj3FPRhIy0on5upn3npE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XFQ3fTf97xBjJG3B40m7qZuSCxo4LGpXVB1mA9qOFLbs8qyNHsvAoTxpiFDB0QfXNnStmbyKNzXvKrGSymOIqpKi/YnMIC1poXSAJmLAF/EtRk63dJev/0/pGDeQ4lHQ9KoGq+9zB5jjV4ulT80L/EwD9JVaG9BY4ZqcE766fI0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=B+PFeZdS; arc=none smtp.client-ip=209.85.221.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="B+PFeZdS" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-4398f8e2837so1804342f8f.1 for ; Fri, 27 Feb 2026 06:03:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772201006; x=1772805806; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CtfwJFU2C3F6SuqP8t7kDFFN/csxu26OVZQtc7hGK+U=; b=B+PFeZdSZmqb+lrLGF+w/6NVmgEDhhHhqiOt+JmocmVsC9xpSvstC/0k7p65hq2zRy gLs5Lv5mmRr1SDQef1A1CEvgCr2ieZm7VqX2RjxgLGrgS/W3BeiP/rRyJznkjMJyrNMZ LY2xMARLKWLU6LrL0PoyBKMijiicnU6Jsy25WGpZJj+dNBAex3l1fHArQ/rrn9j8XycF HMsGFJ4c5y/SnfTY0kjS6BP0hUDl/Mlb54uBD8t5uGS1ucHJ+eFXsi1U2p+hXzPY57J7 ZExQEjVyhN5yRzRS4OlHYH2UegYtm/C77VRNIJFwrK40IYpqsPWcw0K0R4+lFeWqlZZR Go0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772201006; x=1772805806; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=CtfwJFU2C3F6SuqP8t7kDFFN/csxu26OVZQtc7hGK+U=; b=feromJL5D+5eoXghF0csPZOCIBijL8pk5TtXQ0n4K9BTE15AW7sHW+6wlJZ039QwYl YtVlDEXJFhIJLyPr5Qxpe/OYeC7eeT9tRvMXLJ8TInrJNsitZ/GyN8dmPXt3z/C19iML AVJGLo9bmi607op+ySs7K8UVBbRjlR7gPAI161SZNunUJI0rcg955yBEJpzcQ9R8yXNU LOBP6OyYmQwXA8/80HoCnVrXvYCvifYk8MP32YE5UCaGRuMy56NtQmR4hZqs9Rp8DdVJ b4pMNl6Rc5o34pFlcCc/jqpYV6iQ9r7bEkMjsnFygfCjJF+Z7HSXFI4LpL0vh1CGSZyh Ry+A== X-Forwarded-Encrypted: i=1; AJvYcCVUv2VcQqGzEr/t8xkWCHhQ8V1h1oLJ+nxw3DFvEyQ5X+mJG8vG4ZAD8lActCTTt/7L2jng45zYgUmHdPc=@vger.kernel.org X-Gm-Message-State: AOJu0YzIgNMk5xTg4vJVcj8Lwp3nrUEuT2fLTead4IuVqGfdSa++S5M2 TOc7q0B4IrML8fJbEmPYHh6gKL8JwaAK5uBgmHlhQlGD6mxI+Rw8TgJiDNEkXXJG X-Gm-Gg: ATEYQzwXGwrXgCAKni2Fdi8fp7iUvZvcXyo2whwyvDNzGMl4JNCccMNWcvqHHXJaMVB SYlgvCF8FcU1fqhXyUiqDHXg3Y6KlosnMHpK44zh4QUKFMOUDvPDis1GTmOq4iEQ5lvO28Nr2Ln xAM7U7RRh2KqhvWYBNXbepymhtAr9H0ThvHzD0N2MVf4xcvfI0fxwo3Z/BcLZQr/iGC44qHCxjc gyGlvR6jtFCxoH2Xhc4Foq02OnT0Q5mb8tKoMeVff3sthC/F00uP7mVJgf3vBy1onUL8Jdf1PlZ cvu4F+Ac9RWMVm+UpVSUSVb5/LbahwLLYShe3YmH/C+q6W1QhxgPlRvwFmW4hN2neqmWlOqui1P /I/FZE+/kuo/NXCuPOr8SYmyu+ZZxTCCu5i18qD8QtNy3zNk4/31gYH26nBzM6l2c0HgKp+yMNz 6NDrV3bjP/ZW2VcW59Z2SwjhRyf0TAeIyaXZcuKdu5cA== X-Received: by 2002:a05:6000:290a:b0:439:98b8:6479 with SMTP id ffacd0b85a97d-4399de2c1femr4802368f8f.45.1772201005620; Fri, 27 Feb 2026 06:03:25 -0800 (PST) Received: from biju.lan ([2a00:23c4:a758:8a01:4d8b:fefb:26cf:1906]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4399c60feeesm7658811f8f.1.2026.02.27.06.03.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Feb 2026 06:03:24 -0800 (PST) From: Biju X-Google-Original-From: Biju To: Thomas Gleixner Cc: Biju Das , linux-kernel@vger.kernel.org, Geert Uytterhoeven , Prabhakar Mahadev Lad , Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH v4 6/9] irqchip/renesas-rzg2l: Drop IRQC_IRQ_COUNT macro Date: Fri, 27 Feb 2026 14:03:06 +0000 Message-ID: <20260227140316.308106-7-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260227140316.308106-1-biju.das.jz@bp.renesas.com> References: <20260227140316.308106-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das The total number of external interrupts in RZ/G2L and RZ/G3L SoC are different. The RZ/G3L has 16 external interrupts whereas RZ/G2L has only 8 external interrupts. Add irq_count variable in struct rzg2l_hw_info to handle these differences and drop the macro IRQC_IRQ_COUNT. Signed-off-by: Biju Das --- v3->v4: * Updated commit description IRQs->interrupts. * Updated variable type of irq_count from u8->unsigned int. v2->v3: * No change v1->v2: * No change --- drivers/irqchip/irq-renesas-rzg2l.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-rene= sas-rzg2l.c index 6bd20aedbcea..5e30dc2328e0 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -21,7 +21,6 @@ #include =20 #define IRQC_IRQ_START 1 -#define IRQC_IRQ_COUNT 8 #define IRQC_TINT_COUNT 32 =20 #define ISCR 0x10 @@ -68,10 +67,12 @@ struct rzg2l_irqc_reg_cache { =20 /** * struct rzg2l_hw_info - Interrupt Control Unit controller hardware info = structure. + * @irq_count: Number of IRQC interrupts * @tint_start: Start of TINT interrupts * @num_irq: Total Number of interrupts */ struct rzg2l_hw_info { + unsigned int irq_count; unsigned int tint_start; unsigned int num_irq; }; @@ -144,7 +145,7 @@ static void rzg2l_irqc_eoi(struct irq_data *d) unsigned int hw_irq =3D irqd_to_hwirq(d); =20 raw_spin_lock(&priv->lock); - if (hw_irq >=3D IRQC_IRQ_START && hw_irq <=3D IRQC_IRQ_COUNT) + if (hw_irq >=3D IRQC_IRQ_START && hw_irq <=3D priv->info.irq_count) rzg2l_clear_irq_int(priv, hw_irq); else if (hw_irq >=3D priv->info.tint_start && hw_irq < priv->info.num_irq) rzg2l_clear_tint_int(priv, hw_irq); @@ -190,7 +191,7 @@ static void rzfive_irqc_mask(struct irq_data *d) unsigned int hwirq =3D irqd_to_hwirq(d); =20 raw_spin_lock(&priv->lock); - if (hwirq >=3D IRQC_IRQ_START && hwirq <=3D IRQC_IRQ_COUNT) + if (hwirq >=3D IRQC_IRQ_START && hwirq <=3D priv->info.irq_count) rzfive_irqc_mask_irq_interrupt(priv, hwirq); else if (hwirq >=3D priv->info.tint_start && hwirq < priv->info.num_irq) rzfive_irqc_mask_tint_interrupt(priv, hwirq); @@ -204,7 +205,7 @@ static void rzfive_irqc_unmask(struct irq_data *d) unsigned int hwirq =3D irqd_to_hwirq(d); =20 raw_spin_lock(&priv->lock); - if (hwirq >=3D IRQC_IRQ_START && hwirq <=3D IRQC_IRQ_COUNT) + if (hwirq >=3D IRQC_IRQ_START && hwirq <=3D priv->info.irq_count) rzfive_irqc_unmask_irq_interrupt(priv, hwirq); else if (hwirq >=3D priv->info.tint_start && hwirq < priv->info.num_irq) rzfive_irqc_unmask_tint_interrupt(priv, hwirq); @@ -400,7 +401,7 @@ static int rzg2l_irqc_set_type(struct irq_data *d, unsi= gned int type) unsigned int hw_irq =3D irqd_to_hwirq(d); int ret =3D -EINVAL; =20 - if (hw_irq >=3D IRQC_IRQ_START && hw_irq <=3D IRQC_IRQ_COUNT) + if (hw_irq >=3D IRQC_IRQ_START && hw_irq <=3D priv->info.irq_count) ret =3D rzg2l_irq_set_type(d, type); else if (hw_irq >=3D priv->info.tint_start && hw_irq < priv->info.num_irq) ret =3D rzg2l_tint_set_edge(d, type); @@ -500,7 +501,7 @@ static int rzg2l_irqc_alloc(struct irq_domain *domain, = unsigned int virq, * from 16-31 bits. TINT from the pinctrl driver needs to be programmed * in IRQC registers to enable a given gpio pin as interrupt. */ - if (hwirq > IRQC_IRQ_COUNT) { + if (hwirq > priv->info.irq_count) { tint =3D TINT_EXTRACT_GPIOINT(hwirq); hwirq =3D TINT_EXTRACT_HWIRQ(hwirq); =20 @@ -607,8 +608,9 @@ static int rzg2l_irqc_common_probe(struct platform_devi= ce *pdev, struct device_n } =20 static const struct rzg2l_hw_info rzg2l_hw_params =3D { - .tint_start =3D IRQC_IRQ_START + IRQC_IRQ_COUNT, - .num_irq =3D IRQC_IRQ_START + IRQC_IRQ_COUNT + IRQC_TINT_COUNT, + .irq_count =3D 8, + .tint_start =3D IRQC_IRQ_START + 8, + .num_irq =3D IRQC_IRQ_START + 8 + IRQC_TINT_COUNT, }; =20 static int rzg2l_irqc_probe(struct platform_device *pdev, struct device_no= de *parent) --=20 2.43.0