From patchwork Fri Dec 8 21:14:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 176048 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5724995vqy; Fri, 8 Dec 2023 13:16:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IHQjjWKdCfDpeXDcrDX2ZYzcFC7ysYZRL9jPe+bGVJQHgl1LFSavI5rlGiqzlQohWRqudEP X-Received: by 2002:a05:6e02:1aa3:b0:35d:59a2:2c0 with SMTP id l3-20020a056e021aa300b0035d59a202c0mr904864ilv.96.1702070193670; Fri, 08 Dec 2023 13:16:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702070193; cv=none; d=google.com; s=arc-20160816; b=DGtYASy6sAhjdpI40YPRm0gkbQ/ZogD6A8wJTMXzLgnwndInnm8x4GTmedysXEb7oo c24LgM/XKJcZ75E28LNaZEIY8TEp6P/N77lTp04fRwyNj7IcjEFz/tojHc5DR64BRxCJ Oh3OBH5G1ayIjWxBx/ztcEi0sOXkWNZA6BASP2bua/ZO1n4GcDeNIK2sHyexdj6XxaJz N8ABGkKsgE4WT4REibgZlaJth8rStqVl85LdER5J+knWCkP6VB3z2nZ06jy9zGmHiijn Tqnkt6HBflmdfgtXOEeCG9P7nb/el6Qs17cNg2zcBphTdJQh3vgSe9qQzkWanMTUVZ4c 6S+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=a8Pf5zO7FcVfeZDzY1vNXqYaEeP+fdEf7I5lD/3dNCU=; fh=I2NWj4QewUsJB8D1FIavcvdqna0ckJ8Bw6HOcWrZ4cM=; b=MJ/oZMDyckIeHI2tsVMsthzzOtW+me21RvtG+mq6kBs6IwZ65b6yGjzyK4ef3YbXBY qZLRApJVdaa5ToGh6CyguqxsuLSCTFY2cB/BSvBp093bE/muJvP0pJDflT5cQOJv5nb1 RJXj0rFYWGBWh53ciwva0fnUMzeR/Q7NIW5nq4nf/j3Ts0XZ2paTcgJfm8FSBSeodiMe ArcpLJOhMi1Os4+u5Pa39vWXGuej8ESgOOJMwl7tDo2vz+ptGNClyz7XwT1N2iBdEN9G 6VqupUziGhfClgSO34S7m0pqyHhCPTJEFYahNTObDeMGiyvQS2ZshraIvtXC1hA6yJkh 8SNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=LTfh0+4r; dkim=neutral (no key) header.i=@linutronix.de header.b=LgZjjMB4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id e6-20020a654786000000b005c663eae379si1994999pgs.269.2023.12.08.13.16.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 13:16:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=LTfh0+4r; dkim=neutral (no key) header.i=@linutronix.de header.b=LgZjjMB4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 9BC798269F14; Fri, 8 Dec 2023 13:15:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235981AbjLHVO4 (ORCPT + 99 others); Fri, 8 Dec 2023 16:14:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1574769AbjLHVOi (ORCPT ); Fri, 8 Dec 2023 16:14:38 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC14E193; Fri, 8 Dec 2023 13:14:44 -0800 (PST) Date: Fri, 08 Dec 2023 21:14:40 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1702070081; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=a8Pf5zO7FcVfeZDzY1vNXqYaEeP+fdEf7I5lD/3dNCU=; b=LTfh0+4r5Y/KIbfY3o5zhjGD5mGoxvNHwJlEsqjWQzbsnrE7MIrZqcu9jClmaepYNjszX4 9bR09yL38+8RFoY+FDLir98aPrErCjUizoos2z6KRNqdTK16LLIAok5iWE2nP0Xxu9yDxJ r5LOlqq3a70AzFyX5GhORnfO70MC9fv8YeGX+E5wyc0wPg+QeV0enbj9F4CK4UcgCoWjU+ pRTml/cS2QJ+c6vty33IGwWgfVccq4IpQB2E5+FGxROdgN1fJl5sm4f4aZ2sGVN0LLEjWO 3ANDPdygw4j+P7uwmVTQ6Mm5ylnqIyF65YvpF2IIuKvJ/t/UWVgMSceTL8K3eA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1702070081; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=a8Pf5zO7FcVfeZDzY1vNXqYaEeP+fdEf7I5lD/3dNCU=; b=LgZjjMB4vKdDDYuZ+En50aKmuakDrz1iZ2fWpDj6E2OSgqRaK/znaaGkIRbrVpPGtqkzY2 COejtJRoScxk7KAQ== From: "tip-bot2 for Claudiu Beznea" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/core] irqchip/renesas-rzg2l: Add macro to retrieve TITSR register offset based on register's index Cc: Claudiu Beznea , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org In-Reply-To: <20231120111820.87398-7-claudiu.beznea.uj@bp.renesas.com> References: <20231120111820.87398-7-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 Message-ID: <170207008094.398.12496922746207673405.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 08 Dec 2023 13:15:07 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783169247245157163 X-GMAIL-MSGID: 1784749954971365158 The following commit has been merged into the irq/core branch of tip: Commit-ID: 6789991d1049f194eb976d4b346b5def9cfc708a Gitweb: https://git.kernel.org/tip/6789991d1049f194eb976d4b346b5def9cfc708a Author: Claudiu Beznea AuthorDate: Mon, 20 Nov 2023 13:18:17 +02:00 Committer: Thomas Gleixner CommitterDate: Fri, 08 Dec 2023 22:06:35 +01:00 irqchip/renesas-rzg2l: Add macro to retrieve TITSR register offset based on register's index There are 2 TITSR registers available on the IA55 interrupt controller. Add a macro that retrieves the TITSR register offset based on it's index. This macro is useful in when adding suspend/resume support so both TITSR registers can be accessed in a for loop. Signed-off-by: Claudiu Beznea Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20231120111820.87398-7-claudiu.beznea.uj@bp.renesas.com --- drivers/irqchip/irq-renesas-rzg2l.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-renesas-rzg2l.c index d450417..34add75 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -28,8 +28,7 @@ #define ISCR 0x10 #define IITSR 0x14 #define TSCR 0x20 -#define TITSR0 0x24 -#define TITSR1 0x28 +#define TITSR(n) (0x24 + (n) * 4) #define TITSR0_MAX_INT 16 #define TITSEL_WIDTH 0x2 #define TSSR(n) (0x30 + ((n) * 4)) @@ -200,8 +199,7 @@ static int rzg2l_tint_set_edge(struct irq_data *d, unsigned int type) struct rzg2l_irqc_priv *priv = irq_data_to_priv(d); unsigned int hwirq = irqd_to_hwirq(d); u32 titseln = hwirq - IRQC_TINT_START; - u32 offset; - u8 sense; + u8 index, sense; u32 reg; switch (type & IRQ_TYPE_SENSE_MASK) { @@ -217,17 +215,17 @@ static int rzg2l_tint_set_edge(struct irq_data *d, unsigned int type) return -EINVAL; } - offset = TITSR0; + index = 0; if (titseln >= TITSR0_MAX_INT) { titseln -= TITSR0_MAX_INT; - offset = TITSR1; + index = 1; } raw_spin_lock(&priv->lock); - reg = readl_relaxed(priv->base + offset); + reg = readl_relaxed(priv->base + TITSR(index)); reg &= ~(IRQ_MASK << (titseln * TITSEL_WIDTH)); reg |= sense << (titseln * TITSEL_WIDTH); - writel_relaxed(reg, priv->base + offset); + writel_relaxed(reg, priv->base + TITSR(index)); raw_spin_unlock(&priv->lock); return 0;