From nobody Sat Apr 4 01:51:12 2026 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 8E88B3815ED for ; Sun, 22 Mar 2026 12:24:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182278; cv=none; b=HQcs5bXfNiQ/fXOewOz/Xm67wnuXTB7+5L4eshnJIZqX9+lGx91NLajFpl1Zznljq1ROWsft+5BmW+mo5nGgwc2+hInC1jTLEmhHZpNbq4qMPwCvsb/B5pKwSvrW52h8mptRVZK6m4xXyhOnx2azq/iDjTxAKrRhKq4KK0upQes= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182278; c=relaxed/simple; bh=A6dcZYR8tOrf2hf1QYqYL8J0rqVv72XxMlr7n+txYo8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iYtR2fd6M93CtuW0TPsL5+Dc57a1rWPXeHr2E63p1LrG9/fhqVDcOPQgIChJsJqDFXe6WsSHJvOMTAXauJHjSvM7RVNp6FznvrJQ/1u02S3DdBdBahGUhMK85p5dBs/5d+Fis2NgB939O3Ks0EkOkvES/WDZqQcvQsJ/a6Po2Hs= 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=BtsPWxXi; arc=none smtp.client-ip=209.85.221.43 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="BtsPWxXi" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-43b3d9d0695so3038264f8f.0 for ; Sun, 22 Mar 2026 05:24:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1774182275; x=1774787075; 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=zZxWtjoYjjjElcS1OQSWjkckUK+HZvQbITD74pYofro=; b=BtsPWxXi98uzMiKzJ9zt7FY9LDUvOgv0l26Y1CYTuZNCIJPsMLYHTi0fU2JcmiP0eu eLFObjtEsvXvMUl1AzafsASFS5V3IHjFGTuabvPfOHbRcMpofpo6tWjOFspGVwKm8IEb ybERBXSEtRQ37V7cYEZ7B5jrJiVJsqBlSJ6mhtz4/taFnmUqxhNX96Eclf5/qztBRQw/ d8Krc8mAAhyMGOLeO/0X/gQqtrQOvR0AlCzK6lemIlS+yq8K68sPUMEpFAIPJ8xY40bP yRphSruaX4A0w6KXEey/Czf2AMw/sOdfyLYHIdYSlvsm6yyCzyBgXRHiUfLRjLxaz+LF ESvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774182275; x=1774787075; 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=zZxWtjoYjjjElcS1OQSWjkckUK+HZvQbITD74pYofro=; b=Rn2+Yca1zI0VWF+MKujR23lsj3R5p7+BO5MqM27oUP9kg6CkIYW9CrAubimswTnQpN SlUOtpg1jOJKiqv7vR2crLxEG4YjzTmLKmDA3rT0IlpFo6itB3HXtY8tL3Uxo64uXyk8 wW0V7hkKC+pXwoG7tJX/1UmAl5COfA61FBSpwqdMjhx0CkWHc8/Oj7tydZZnSY8T6Rf8 +SqlzGJ3BTB/Vv1ZjtGISrFiGK070SoiUtEANT6MdZRHgZo8bnbLg51r10lz3UbjU9nu u6zLQcDaqW0cMoH7XQIpCCqH/dPDcLP6u8bpF0VdfEWwwo8PljpyTwxJgZqKapuPTWWW DHiA== X-Forwarded-Encrypted: i=1; AJvYcCWHE394tBUuuxim9cQstPfcNoAgnBJWtvCjwe33s/MSYf12ewD9lzAo9W0mvlQBjCVnrqMj7V8gLZm/N1o=@vger.kernel.org X-Gm-Message-State: AOJu0Yz/T/9Vk39LjgxJtgZSA/qP+bnOIMnV2ZDzbAxs00NH8j2VwPx7 DzTUEQ0+EyuKspJYxUcmqhJqeBIb2R8oCY9Y+FV2Brb0F4fmUxfswRyF X-Gm-Gg: ATEYQzxGQfGzupXRj8DlGrxhbiCNA6sBTdcbFWbJhC6UbQ1LEggsIwp4AN0hlAbJkxP C8lFp5fCJiKhM3ipYBMfZTmq9wZvUSTEvvABI1eXLvwhPueENqZuyMWOe9NZ6pL+vOmjYqCZLQf ET1UC8kCw2HMm9z5sBuDeJOn3EYb04+FK6dVoOcmF6yBTEsyMKt8f6rtt9ZA1SER2AKPvHi9Lm6 Vt+CPgnPDf9fNGkgByhwSyjc5Tv7b37T+6+oxkdnCO7M/cpeVQ4zXzpGzRHZU4GjJBZj/vO8X+E 1Vw/7Ejz3XJmb/xVZwt5cjb5OYpzDYSoJISvHdml/+DClffvj17g2wa2tN8qu5+7fNwiLXu7z/c dcfoRLxABixD/7+QM9w34WqY1ZnGAL4tsmAv9xkLP1De4Gq+YjqrjdhZj28KJxkUtoUi9ePlTrx 8/etlAYEmFnS2dYChRFVeG6sJl74JX68bAlg9XTGtgHl6nd2jN X-Received: by 2002:a05:6000:1861:b0:43b:4703:9dd5 with SMTP id ffacd0b85a97d-43b64272ae1mr14892339f8f.18.1774182274924; Sun, 22 Mar 2026 05:24:34 -0700 (PDT) Received: from localhost.localdomain ([2a00:23c4:a758:8a01:1bdc:7f84:18bc:1e56]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43b64703343sm21072695f8f.19.2026.03.22.05.24.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2026 05:24:34 -0700 (PDT) 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 v6 12/15] irqchip/renesas-rzg2l: Drop IRQC_TINT_START macro Date: Sun, 22 Mar 2026 12:23:55 +0000 Message-ID: <20260322122421.132474-13-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260322122421.132474-1-biju.das.jz@bp.renesas.com> References: <20260322122421.132474-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 IRQC_TINT_START value is different for RZ/G3L and RZ/G2L SoC. Add tint_start variable in struct rzg2l_hw_info to handle this difference and drop the macro IRQC_TINT_START. While at it, update the variable type of titseln, tssr_offset, tssr_index, index, and sense to unsigned int, in rzg2l_tint_set_edge() as these variables are used only for calculation. Signed-off-by: Biju Das --- v5->v6 * Updated the variable type of titseln, tssr_offset, tssr_index, index, and sense to unsigned int, in rzg2l_tint_set_edge() as these variables are used only for calculation. * Updated commit description. v4->v5: * Dropped the hw_irq range check involving info.tint_start v3->v4: * Updated commit description 'this differences->this difference'. * Updated tint_start variable type from u8-> unsigned int. v2->v3: * No change v1->v2: * No change --- drivers/irqchip/irq-renesas-rzg2l.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-rene= sas-rzg2l.c index 5a21bca91e4e..922d9dfeddcd 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -22,7 +22,6 @@ =20 #define IRQC_IRQ_START 1 #define IRQC_IRQ_COUNT 8 -#define IRQC_TINT_START (IRQC_IRQ_START + IRQC_IRQ_COUNT) #define IRQC_TINT_COUNT 32 =20 #define ISCR 0x10 @@ -69,9 +68,11 @@ struct rzg2l_irqc_reg_cache { =20 /** * struct rzg2l_hw_info - Interrupt Control Unit controller hardware info = structure. + * @tint_start: Start of TINT interrupts * @num_irq: Total Number of interrupts */ struct rzg2l_hw_info { + unsigned int tint_start; unsigned int num_irq; }; =20 @@ -125,7 +126,7 @@ static void rzg2l_clear_irq_int(struct rzg2l_irqc_priv = *priv, unsigned int hwirq =20 static void rzg2l_clear_tint_int(struct rzg2l_irqc_priv *priv, unsigned in= t hwirq) { - u32 bit =3D BIT(hwirq - IRQC_TINT_START); + u32 bit =3D BIT(hwirq - priv->info.tint_start); u32 reg; =20 reg =3D readl_relaxed(priv->base + TSCR); @@ -180,7 +181,7 @@ static void rzfive_irqc_unmask_irq_interrupt(struct rzg= 2l_irqc_priv *priv, static void rzfive_irqc_mask_tint_interrupt(struct rzg2l_irqc_priv *priv, unsigned int hwirq) { - u32 bit =3D BIT(hwirq - IRQC_TINT_START); + u32 bit =3D BIT(hwirq - priv->info.tint_start); =20 writel_relaxed(readl_relaxed(priv->base + TMSK) | bit, priv->base + TMSK); } @@ -188,7 +189,7 @@ static void rzfive_irqc_mask_tint_interrupt(struct rzg2= l_irqc_priv *priv, static void rzfive_irqc_unmask_tint_interrupt(struct rzg2l_irqc_priv *priv, unsigned int hwirq) { - u32 bit =3D BIT(hwirq - IRQC_TINT_START); + u32 bit =3D BIT(hwirq - priv->info.tint_start); =20 writel_relaxed(readl_relaxed(priv->base + TMSK) & ~bit, priv->base + TMSK= ); } @@ -253,7 +254,7 @@ static void rzfive_tint_endisable(struct irq_data *d, b= ool enable) { struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); unsigned int hwirq =3D irqd_to_hwirq(d); - unsigned int offset =3D hwirq - IRQC_TINT_START; + unsigned int offset =3D hwirq - priv->info.tint_start; unsigned int tssr_offset =3D TSSR_OFFSET(offset); unsigned int tssr_index =3D TSSR_INDEX(offset); u32 reg; @@ -299,7 +300,7 @@ static void rzg2l_tint_irq_endisable(struct irq_data *d= , bool enable) { struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); unsigned int hw_irq =3D irqd_to_hwirq(d); - unsigned int offset =3D hw_irq - IRQC_TINT_START; + unsigned int offset =3D hw_irq - priv->info.tint_start; unsigned int tssr_offset =3D TSSR_OFFSET(offset); unsigned int tssr_index =3D TSSR_INDEX(offset); u32 reg; @@ -388,10 +389,10 @@ static int rzg2l_tint_set_edge(struct irq_data *d, un= signed int type) { struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); unsigned int hwirq =3D irqd_to_hwirq(d); - u32 titseln =3D hwirq - IRQC_TINT_START; - u32 tssr_offset =3D TSSR_OFFSET(titseln); - u8 tssr_index =3D TSSR_INDEX(titseln); - u8 index, sense; + unsigned int titseln =3D hwirq - priv->info.tint_start; + unsigned int tssr_offset =3D TSSR_OFFSET(titseln); + unsigned int tssr_index =3D TSSR_INDEX(titseln); + unsigned int index, sense; u32 reg, tssr; =20 switch (type & IRQ_TYPE_SENSE_MASK) { @@ -682,6 +683,7 @@ 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, }; =20 --=20 2.43.0