From patchwork Mon May 27 11:27:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 165204 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp7039907ili; Mon, 27 May 2019 04:27:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzUVKp/jpRCoRhQ+kWksshLVU4xOTBKg725O0WXuqzuU1iBJyzchDRjiDn4DlumrpTmPjFT X-Received: by 2002:a17:902:b949:: with SMTP id h9mr82039175pls.50.1558956451156; Mon, 27 May 2019 04:27:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558956451; cv=none; d=google.com; s=arc-20160816; b=KU86E0FAzAUMfsJ2KoyyTUsvzGXSk880TwwI5NzxpX+3cMkj2Xo6g07H0zs9xmI7zE ohxbONd+GKqSxILV+aIltDuupyliOKknpZ1Q1SU4TeVJfFX2ZDrpdtJAADg36iNP/ImS dW238hksQezQYbh08pP1H4Y/aE/+l0tR1DUFTX+Uq/ZREadIIdFD+IAhhcdzerooF/Oq 2Labr3YhIV9gl0PCNglOTgEGW+Pl6V50Etcp/HaEX184Kpcm3nAN/Qbfx97/qxfr6Zcd s2jz+GbiIZU6AKC6QXBWmbqbuAWWZObcBp2WCT6lfLHhpn3IitdXdVJESEb3NEyNTEq5 LTWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pKi5I0CJ2X5BwXo9XUNw8Vf2df15TmcuH8E+kJajjPM=; b=MvYsnVGbhx8t1Ace2mtWZw5szrTWAaV22cIQaaaN3HNxOoyBZaqKcW9tnswst0Ok6l Jv01WRHeF6rsCxxI8zZMESOaozI+Y0hItkdd2+uq5oG4vm3DlXzJ9p0QS7Qb5/Q1rN11 uZmrB9Ef32NUe+wGuVvbwCr5uGkX4dWoLk0jcjrM1tQPkH3L18CInxeu0rkfSP0djc/X 3lpbNOiCeMEXf3M9Q4toDDLj0iHkon9GHSq4T6XJpWZgze8XT8Kj3mPmtyGQ5oJ2GUDY EIxGiSF7jaxZD1Jts1rHoQPoj7j6eC90GnaogzPwrVvaF31dZKEKgMDzApmDFyCGfnMU zFIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="sim4f/+0"; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id go17si17006924plb.357.2019.05.27.04.27.30; Mon, 27 May 2019 04:27:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="sim4f/+0"; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726115AbfE0L1a (ORCPT + 9 others); Mon, 27 May 2019 07:27:30 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:35293 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726627AbfE0L1a (ORCPT ); Mon, 27 May 2019 07:27:30 -0400 Received: by mail-wr1-f65.google.com with SMTP id m3so16592444wrv.2 for ; Mon, 27 May 2019 04:27:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pKi5I0CJ2X5BwXo9XUNw8Vf2df15TmcuH8E+kJajjPM=; b=sim4f/+0M6hyPlAu9JEJF6ab6YBU9dpZnMdeKmnIMIkLoCJzRZqS+78KibKroDfuto ebgvxg/PCgDh69ige4loWXKOwSc4TIdOZ+0rnNqGW3yCwrr5TirBVl/NgllyRrTD1Zp+ uq9dIjXKWfXQNWtEgrfb3Ac8vNOCgwRvrrIsMwGpQRXInQZm7lOQjJe8TvELVv7cYcGe eMdadgQ2HizkBWsIYuyqEbKxjaku7BBqZLqU9J71DXn1TU5NbNJ6fqggyLfXuwBB5qT0 NQG0nhZEhUK+oQplf7r2ufho7xHk3Rkk4uBW2Xhp+YUaIuN2RJBWc7+zGmxFn5zfBdlj 0sBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pKi5I0CJ2X5BwXo9XUNw8Vf2df15TmcuH8E+kJajjPM=; b=apU0owNjU2RfxUrDywAFn/CHwsVdN/2xG6jPveUjbHtzdgCeAgrPtO0zRWTgfx2I5B 5xgia8Ik3m/6C/J43gY+moqsRQ+JzjHHrLibMVsItZQNs6tRtkULXsfoUYFKRpCKN6y9 jK3H5SW/xIOVyhRmBGpSpCc6N9Ib4OvhfMoo1t68qnKvDG5eAWALxOb0Jf3/C5qCmG5T To6bksLHneVTsivDoqmaQdb3WhyDBxoFIrxYOP+tNR7bUH7vpO7GCTPeMTFLWGXpjWmj 37cH4OlJ02pqlOh7fkjTdKPYoSOEXE5gDL4PUEu+lEPZVGutsusa0WrJPiqIsW5TvqQd X1wQ== X-Gm-Message-State: APjAAAVIrkVvad9L4myYoaGZF0OzHH0cDL0Lha9uaaA3bTU+nkKXVtFS cOzfE+a0RO52CBN6VXTKJAD71g== X-Received: by 2002:adf:ef8d:: with SMTP id d13mr5588247wro.60.1558956448042; Mon, 27 May 2019 04:27:28 -0700 (PDT) Received: from sudo.home ([2a01:cb1d:112:6f00:ccdd:dadc:1517:f416]) by smtp.gmail.com with ESMTPSA id l6sm9677747wmi.24.2019.05.27.04.27.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 May 2019 04:27:27 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Cc: linux-acpi@vger.kernel.org, linux-gpio@vger.kernel.org, Ard Biesheuvel , Masahisa Kojima , Linus Walleij , Marc Zyngier , Graeme Gregory , Lorenzo Pieralisi , Mika Westerberg , "Rafael J. Wysocki" , Len Brown Subject: [PATCH v3 2/4] irqchip/exiu: preparatory refactor for ACPI support Date: Mon, 27 May 2019 13:27:18 +0200 Message-Id: <20190527112720.2266-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190527112720.2266-1-ard.biesheuvel@linaro.org> References: <20190527112720.2266-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org In preparation of adding support for EXIU controller devices described via ACPI, split the DT init function in a DT specific and a generic part, where the latter will be reused for ACPI support later. Signed-off-by: Ard Biesheuvel --- drivers/irqchip/irq-sni-exiu.c | 66 +++++++++++++------- 1 file changed, 43 insertions(+), 23 deletions(-) -- 2.20.1 diff --git a/drivers/irqchip/irq-sni-exiu.c b/drivers/irqchip/irq-sni-exiu.c index 1927b2f36ff6..fef7c2437dfb 100644 --- a/drivers/irqchip/irq-sni-exiu.c +++ b/drivers/irqchip/irq-sni-exiu.c @@ -1,7 +1,7 @@ /* * Driver for Socionext External Interrupt Unit (EXIU) * - * Copyright (c) 2017 Linaro, Ltd. + * Copyright (c) 2017-2019 Linaro, Ltd. * * Based on irq-tegra.c: * Copyright (C) 2011 Google, Inc. @@ -167,35 +167,23 @@ static const struct irq_domain_ops exiu_domain_ops = { .free = irq_domain_free_irqs_common, }; -static int __init exiu_init(struct device_node *node, - struct device_node *parent) +static struct exiu_irq_data *exiu_init(const struct fwnode_handle *fwnode, + struct resource *res) { - struct irq_domain *parent_domain, *domain; struct exiu_irq_data *data; int err; - if (!parent) { - pr_err("%pOF: no parent, giving up\n", node); - return -ENODEV; - } - - parent_domain = irq_find_host(parent); - if (!parent_domain) { - pr_err("%pOF: unable to obtain parent domain\n", node); - return -ENXIO; - } - data = kzalloc(sizeof(*data), GFP_KERNEL); if (!data) - return -ENOMEM; + return ERR_PTR(-ENOMEM); - if (of_property_read_u32(node, "socionext,spi-base", &data->spi_base)) { - pr_err("%pOF: failed to parse 'spi-base' property\n", node); + if (fwnode_property_read_u32_array(fwnode, "socionext,spi-base", + &data->spi_base, 1)) { err = -ENODEV; goto out_free; } - data->base = of_iomap(node, 0); + data->base = ioremap(res->start, resource_size(res)); if (!data->base) { err = -ENODEV; goto out_free; @@ -205,11 +193,44 @@ static int __init exiu_init(struct device_node *node, writel_relaxed(0xFFFFFFFF, data->base + EIREQCLR); writel_relaxed(0xFFFFFFFF, data->base + EIMASK); + return data; + +out_free: + kfree(data); + return ERR_PTR(err); +} + +static int __init exiu_dt_init(struct device_node *node, + struct device_node *parent) +{ + struct irq_domain *parent_domain, *domain; + struct exiu_irq_data *data; + struct resource res; + + if (!parent) { + pr_err("%pOF: no parent, giving up\n", node); + return -ENODEV; + } + + parent_domain = irq_find_host(parent); + if (!parent_domain) { + pr_err("%pOF: unable to obtain parent domain\n", node); + return -ENXIO; + } + + if (of_address_to_resource(node, 0, &res)) { + pr_err("%pOF: failed to parse memory resource\n", node); + return -ENXIO; + } + + data = exiu_init(of_node_to_fwnode(node), &res); + if (IS_ERR(data)) + return PTR_ERR(data); + domain = irq_domain_add_hierarchy(parent_domain, 0, NUM_IRQS, node, &exiu_domain_ops, data); if (!domain) { pr_err("%pOF: failed to allocate domain\n", node); - err = -ENOMEM; goto out_unmap; } @@ -220,8 +241,7 @@ static int __init exiu_init(struct device_node *node, out_unmap: iounmap(data->base); -out_free: kfree(data); - return err; + return -ENOMEM; } -IRQCHIP_DECLARE(exiu, "socionext,synquacer-exiu", exiu_init); +IRQCHIP_DECLARE(exiu, "socionext,synquacer-exiu", exiu_dt_init); From patchwork Mon May 27 11:27:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 165205 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp7039919ili; Mon, 27 May 2019 04:27:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwrcsZbZ8ad7ZqU+H9IwV1G4uaH4UTgmLnf+q2IY0oU/frRODx+Y5Vge32MN24I3J1pay3j X-Received: by 2002:a62:d044:: with SMTP id p65mr113220319pfg.37.1558956452134; Mon, 27 May 2019 04:27:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558956452; cv=none; d=google.com; s=arc-20160816; b=b7OeJGrK+5a43HtTO0vbw376UrMIdUuhRBvYTjvmFIYYjugHOuDXW9+mJFXet1dViB 6mNoBQI1oJLG/30P80JebiBJ3hlQLibQD7Vy4elGrIykw6txC1r3Q6mjlU/PID0NcR1s 8u8cirzgXgv1gp/+peZoON6Mc1/8FLHZhZlVZcs1LPCsl5fr+thjiYPikmHhvoP49QZ1 isAumiNPH34UeKHJkTFRM1hHcC3A5vbyyhC6tFTe4XYyVEwdoDigNt2wixK05sSfSb0t brrVQD6VLvGMyOuF153rF8vHG4/0F1/FJuYImVWM2d6473iYGCcxbqAQBYbqH7JPpu9w Px7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9EPMw9ZDt6r9OnVuoXUM9uuIE5EfX0cbi1r9IY8+97M=; b=CIjHza0SXl1jJDtaRokmcuoW2WHUTeneTjkMjTvJTRDRjtB2kVedUsLGl7fKmc+D7t RURu3no0BOv31Tdr8M5L9fiiP7NKGM6IbTk67ONMT/rwKWx/lONE56BONAnbmnOGaL9f 7FanMg64MKddcpfOsson9NT1RIa2D5JtRHSHpg1l7kgroaQGElvcMziJbs16UuOnU93H Qnv9DZEMoEjvRlrw3qkonJa8TLc0r5ofrB0oUqwxqRvHoRTRXcoQJ3+NUtQPPi0EIyiH 0ftrpLNXsYz0oFuLWU+QrLs74bXPCAUmq55WlA2o0Olja2VjWoqbvvUCDOoZzRVHG/nB UmUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QwirmDGB; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id go17si17006924plb.357.2019.05.27.04.27.31; Mon, 27 May 2019 04:27:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QwirmDGB; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726693AbfE0L1b (ORCPT + 9 others); Mon, 27 May 2019 07:27:31 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:40212 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726678AbfE0L1b (ORCPT ); Mon, 27 May 2019 07:27:31 -0400 Received: by mail-wr1-f66.google.com with SMTP id t4so8300702wrx.7 for ; Mon, 27 May 2019 04:27:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9EPMw9ZDt6r9OnVuoXUM9uuIE5EfX0cbi1r9IY8+97M=; b=QwirmDGBiji1JuzbW6wei+YUkJRNV7UyseHQtII77EPKytrbdGHXVZVF5OqKoqqXR8 FcunUebz7zm7cad7SWqWjao8rKXcRbRL7lLb0YymFhJBvdwHRuEz6MNcp3/sFDchwtdX b3hzKBrBeeqH1cSC39RhONf4Jo+xAIJXEnDVVuE/W6Vmjnm2NISvQ2K04Yk1uws/O/CA a9MYK4Rvj2o/EYDvY/Usu2nn7U7SjpMVON931OxVcB1kfM/Zrt08+liOEFb3qPupgU7X 0HuIbbM4c08DaOq09GcdTASL6t1b8uoVK7uYJcTA3lDW4e9cG2M/y2iNDXNY4Sgq8mCs G5Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9EPMw9ZDt6r9OnVuoXUM9uuIE5EfX0cbi1r9IY8+97M=; b=Bj03WDZ7/mnIXaUEhKUGs1CJJWKP1TyjJktytlMyFvj7tyTFo22ZmsPwKM5LVo26im ugAgnd1kzypIGVfJj83vFUS2KtJqY7XKQxYht4J49HAbImIgXI+9LX7l5t2BAmQhL5Rg 8lFstYvbSDywvqXuXYh5HVq8LY1+loKZeZYU4QfdazzQ/wzmIRfeNcnCD3HUHLWgXKVM hCwFcFQMyXP23gsOOSBmklVwT0EkndXmWO5nZssIwWSTxej4LxYjk9qHefmqlj4tH+Mh D4SZWr6aQpiNyOmgQ6GwNbitl9gxdsv2rUmeafqOK82goEQ9l+lfKmVPe3B9PMu3qYvV z5ww== X-Gm-Message-State: APjAAAX+lox18Nv3R6MQE3F24W0bzw4FBs4On7vyYnnpTr72QGMqOdHf H24Mk6AyHcyBZO85mAnngJoE/Q== X-Received: by 2002:a5d:6807:: with SMTP id w7mr7222991wru.336.1558956449254; Mon, 27 May 2019 04:27:29 -0700 (PDT) Received: from sudo.home ([2a01:cb1d:112:6f00:ccdd:dadc:1517:f416]) by smtp.gmail.com with ESMTPSA id l6sm9677747wmi.24.2019.05.27.04.27.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 May 2019 04:27:28 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Cc: linux-acpi@vger.kernel.org, linux-gpio@vger.kernel.org, Ard Biesheuvel , Masahisa Kojima , Linus Walleij , Marc Zyngier , Graeme Gregory , Lorenzo Pieralisi , Mika Westerberg , "Rafael J. Wysocki" , Len Brown Subject: [PATCH v3 3/4] irqchip/exiu: implement ACPI support Date: Mon, 27 May 2019 13:27:19 +0200 Message-Id: <20190527112720.2266-4-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190527112720.2266-1-ard.biesheuvel@linaro.org> References: <20190527112720.2266-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Expose the existing EXIU hierarchical irqchip domain code to permit the interrupt controller to be used as the irqchip component of a GPIO controller on ACPI systems, or as the target of ordinary interrupt resources. Signed-off-by: Ard Biesheuvel --- drivers/irqchip/irq-sni-exiu.c | 76 +++++++++++++++++--- 1 file changed, 68 insertions(+), 8 deletions(-) -- 2.20.1 Reviewed-by: Mika Westerberg diff --git a/drivers/irqchip/irq-sni-exiu.c b/drivers/irqchip/irq-sni-exiu.c index fef7c2437dfb..30a323a2b332 100644 --- a/drivers/irqchip/irq-sni-exiu.c +++ b/drivers/irqchip/irq-sni-exiu.c @@ -20,6 +20,7 @@ #include #include #include +#include #include @@ -134,9 +135,13 @@ static int exiu_domain_translate(struct irq_domain *domain, *hwirq = fwspec->param[1] - info->spi_base; *type = fwspec->param[2] & IRQ_TYPE_SENSE_MASK; - return 0; + } else { + if (fwspec->param_count != 2) + return -EINVAL; + *hwirq = fwspec->param[0]; + *type = fwspec->param[2] & IRQ_TYPE_SENSE_MASK; } - return -EINVAL; + return 0; } static int exiu_domain_alloc(struct irq_domain *dom, unsigned int virq, @@ -147,16 +152,21 @@ static int exiu_domain_alloc(struct irq_domain *dom, unsigned int virq, struct exiu_irq_data *info = dom->host_data; irq_hw_number_t hwirq; - if (fwspec->param_count != 3) - return -EINVAL; /* Not GIC compliant */ - if (fwspec->param[0] != GIC_SPI) - return -EINVAL; /* No PPI should point to this domain */ + parent_fwspec = *fwspec; + if (is_of_node(dom->parent->fwnode)) { + if (fwspec->param_count != 3) + return -EINVAL; /* Not GIC compliant */ + if (fwspec->param[0] != GIC_SPI) + return -EINVAL; /* No PPI should point to this domain */ + hwirq = fwspec->param[1] - info->spi_base; + } else { + hwirq = fwspec->param[0]; + parent_fwspec.param[0] = hwirq + info->spi_base + 32; + } WARN_ON(nr_irqs != 1); - hwirq = fwspec->param[1] - info->spi_base; irq_domain_set_hwirq_and_chip(dom, virq, hwirq, &exiu_irq_chip, info); - parent_fwspec = *fwspec; parent_fwspec.fwnode = dom->parent->fwnode; return irq_domain_alloc_irqs_parent(dom, virq, nr_irqs, &parent_fwspec); } @@ -245,3 +255,53 @@ static int __init exiu_dt_init(struct device_node *node, return -ENOMEM; } IRQCHIP_DECLARE(exiu, "socionext,synquacer-exiu", exiu_dt_init); + +#ifdef CONFIG_ACPI +static int exiu_acpi_probe(struct platform_device *pdev) +{ + struct irq_domain *domain; + struct exiu_irq_data *data; + struct resource *res; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) { + dev_err(&pdev->dev, "failed to parse memory resource\n"); + return -ENXIO; + } + + data = exiu_init(dev_fwnode(&pdev->dev), res); + if (IS_ERR(data)) + return PTR_ERR(data); + + domain = acpi_irq_create_hierarchy(0, NUM_IRQS, dev_fwnode(&pdev->dev), + &exiu_domain_ops, data); + if (!domain) { + dev_err(&pdev->dev, "failed to create IRQ domain\n"); + goto out_unmap; + } + + dev_info(&pdev->dev, "%d interrupts forwarded\n", NUM_IRQS); + + return 0; + +out_unmap: + iounmap(data->base); + kfree(data); + return -ENOMEM; +} + +static const struct acpi_device_id exiu_acpi_ids[] = { + { "SCX0008" }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(acpi, exiu_acpi_ids); + +static struct platform_driver exiu_driver = { + .driver = { + .name = "exiu", + .acpi_match_table = exiu_acpi_ids, + }, + .probe = exiu_acpi_probe, +}; +builtin_platform_driver(exiu_driver); +#endif