Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp232283pxb; Mon, 13 Sep 2021 17:52:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxB6C3DHZt9Tuu0+Ay0yG9/HUxhY+0Tfe+uaaK7H0DXYxbvBxFJDS1R53deiGT9AuyoTFL5 X-Received: by 2002:a05:6402:4415:: with SMTP id y21mr16183803eda.79.1631580721392; Mon, 13 Sep 2021 17:52:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631580721; cv=none; d=google.com; s=arc-20160816; b=V/sx+ozvfS8/91ggyV/Ci+KxYVhFOE1vRanILWI/OjAbPknWKrJPSdJ+aY5cSMKZv0 4/Iw5iKkCvmzehb2LhFj6uAzNIOsGAwGEARYgw3C7mQnpEO+cu/Su3/Nl7jqG2tKDIKj QhivZr0t7DZn3D0jGS+5yV/IjBTtkjCBHu9bcWgcP4uZ5P+t/jVfh7okWKJUmfA8+59P eHJpEc8a/1Bg0+mBo5p5Gx0HwUSWZxyhOTdUNB3DwS4ADZnSuJqNEgMpB3/581Bwwklr rBh0ISoiYCBjV0zMbYiu3slHRxpfPj76W8VDJLfLosH8q5pYNTro5uXTBNI5uUk0Nz9c J74w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Ibq9fB0PGWRciQVvNgbZMdc7wsuJgZEcTZlZGLpwvv0=; b=Ulk3RhQGcPwwB4xuOlahhIrCpvAq0SbMxjr1Ubv22Y+EOjKUVP/VtnPU5oLFibctVf cGm2t7/uDoc68KaUCwpKCTZrXeaNXB/BvzyTD3Px1LJe9KXneQdgMK3UiyPU9Ownz+s1 en/V0YcyWJFn0M0AjLxdcze6OVPvHSUKu2PcA42zDdnyOwDV/zg/ZtEyG+WjfBfHfH8I oHlFzrdCqH9aUCj9QUnFMkshg7FFIEY3gDOSLjRZkwLfC90AQBq4RsuOsS9mZ7cYn0aO jxCgixD4YeAUvS8jSxh/KBLLKPMEZifglqfHoYgFXl2a6DVk6ic5rpV/nSPQd5XUGL0N K7YA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s21si9435068edd.522.2021.09.13.17.51.38; Mon, 13 Sep 2021 17:52:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239919AbhIMS10 (ORCPT + 99 others); Mon, 13 Sep 2021 14:27:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:59626 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235943AbhIMS1T (ORCPT ); Mon, 13 Sep 2021 14:27:19 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AD5EC610CF; Mon, 13 Sep 2021 18:26:03 +0000 (UTC) Received: from [198.52.44.129] (helo=wait-a-minute.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mPqeY-00AYPD-0T; Mon, 13 Sep 2021 19:26:02 +0100 From: Marc Zyngier To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Cc: Bjorn Helgaas , Rob Herring , Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Alyssa Rosenzweig , Stan Skowronek , Mark Kettenis , Sven Peter , Hector Martin , Robin Murphy , kernel-team@android.com Subject: [PATCH v3 01/10] irqdomain: Make of_phandle_args_to_fwspec generally available Date: Mon, 13 Sep 2021 19:25:41 +0100 Message-Id: <20210913182550.264165-2-maz@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210913182550.264165-1-maz@kernel.org> References: <20210913182550.264165-1-maz@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 198.52.44.129 X-SA-Exim-Rcpt-To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, bhelgaas@google.com, robh+dt@kernel.org, lorenzo.pieralisi@arm.com, kw@linux.com, alyssa@rosenzweig.io, stan@corellium.com, kettenis@openbsd.org, sven@svenpeter.dev, marcan@marcan.st, Robin.Murphy@arm.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org of_phandle_args_to_fwspec() can be generally useful to code extracting a DT of_phandle and using an irq_fwspec to use the hierarchical irqdomain API. Make it visible the the rest of the kernel, including modules. Signed-off-by: Marc Zyngier --- include/linux/irqdomain.h | 4 ++++ kernel/irq/irqdomain.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index 23e4ee523576..cfd442316f39 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h @@ -64,6 +64,10 @@ struct irq_fwspec { u32 param[IRQ_DOMAIN_IRQ_SPEC_PARAMS]; }; +/* Conversion function from of_phandle_args fields to fwspec */ +void of_phandle_args_to_fwspec(struct device_node *np, const u32 *args, + unsigned int count, struct irq_fwspec *fwspec); + /* * Should several domains have the same device node, but serve * different purposes (for example one domain is for PCI/MSI, and the diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 19e83e9b723c..5a698c1f6cc6 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -744,9 +744,8 @@ static int irq_domain_translate(struct irq_domain *d, return 0; } -static void of_phandle_args_to_fwspec(struct device_node *np, const u32 *args, - unsigned int count, - struct irq_fwspec *fwspec) +void of_phandle_args_to_fwspec(struct device_node *np, const u32 *args, + unsigned int count, struct irq_fwspec *fwspec) { int i; @@ -756,6 +755,7 @@ static void of_phandle_args_to_fwspec(struct device_node *np, const u32 *args, for (i = 0; i < count; i++) fwspec->param[i] = args[i]; } +EXPORT_SYMBOL_GPL(of_phandle_args_to_fwspec); unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec) { -- 2.30.2