[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAhV-H6VT0tE-rE+3YAm-Tjz4TKxqtaQmc4Medsw_0VQEW-W3A@mail.gmail.com>
Date: Sun, 1 Feb 2026 10:33:15 +0800
From: Huacai Chen <chenhuacai@...nel.org>
To: Icenowy Zheng <zhengxingda@...as.ac.cn>
Cc: Thomas Gleixner <tglx@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>, Jiaxun Yang <jiaxun.yang@...goat.com>,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
linux-mips@...r.kernel.org
Subject: Re: [PATCH 5/8] irqchip/loongson-pch-lpc: add OF init code
Hi, Icenowy,
On Sat, Jan 31, 2026 at 5:46 PM Icenowy Zheng <zhengxingda@...as.ac.cn> wrote:
>
> As the (kernel-internally) OF-based MIPS Loongson-3 systems can also
> have PCH LPC interrupt controller, add OF-based initialization code for
> the driver.
I think Patch-3/4/5 can be combined to a single one.
Huacai
>
> Co-developed-by: Jiaxun Yang <jiaxun.yang@...goat.com>
> Signed-off-by: Jiaxun Yang <jiaxun.yang@...goat.com>
> Signed-off-by: Icenowy Zheng <zhengxingda@...as.ac.cn>
> ---
> drivers/irqchip/irq-loongson-pch-lpc.c | 28 ++++++++++++++++++++++++++
> 1 file changed, 28 insertions(+)
>
> diff --git a/drivers/irqchip/irq-loongson-pch-lpc.c b/drivers/irqchip/irq-loongson-pch-lpc.c
> index 96489e031d34e..0baa93028abf4 100644
> --- a/drivers/irqchip/irq-loongson-pch-lpc.c
> +++ b/drivers/irqchip/irq-loongson-pch-lpc.c
> @@ -13,6 +13,8 @@
> #include <linux/irqchip/chained_irq.h>
> #include <linux/irqdomain.h>
> #include <linux/kernel.h>
> +#include <linux/of_address.h>
> +#include <linux/of_irq.h>
> #include <linux/syscore_ops.h>
>
> #include "irq-loongson.h"
> @@ -257,3 +259,29 @@ int __init pch_lpc_acpi_init(struct irq_domain *parent,
> return 0;
> }
> #endif /* CONFIG_ACPI */
> +
> +#ifdef CONFIG_OF
> +static int pch_lpc_of_init(struct device_node *node,
> + struct device_node *parent)
> +{
> + int parent_irq;
> + struct fwnode_handle *irq_handle;
> + struct resource res;
> +
> + if (of_address_to_resource(node, 0, &res))
> + return -EINVAL;
> +
> + parent_irq = irq_of_parse_and_map(node, 0);
> + if (!parent_irq) {
> + pr_err("Failed to get the parent IRQ for LPC IRQs\n");
> + return -EINVAL;
> + }
> +
> + irq_handle = of_fwnode_handle(node);
> +
> + return pch_lpc_init(res.start, resource_size(&res), irq_handle,
> + parent_irq);
> +}
> +
> +IRQCHIP_DECLARE(pch_lpc, "loongson,pch-lpc-1.0", pch_lpc_of_init);
> +#endif /* CONFIG_OF */
> --
> 2.52.0
>
Powered by blists - more mailing lists