Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4473397rdb; Fri, 15 Sep 2023 03:28:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGEqYLdvqfh2WYlhHzBcCipU5VfrKKdbJqxcmOfgkqdPog60+kvtumjiJ0OyNMJq81Eg+N0 X-Received: by 2002:a05:6358:5287:b0:139:d5d5:7a8f with SMTP id g7-20020a056358528700b00139d5d57a8fmr1601893rwa.30.1694773739401; Fri, 15 Sep 2023 03:28:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694773739; cv=none; d=google.com; s=arc-20160816; b=tWOpcJuuZnbpUGidajIUQNOfhWU8P/GPnULKu5ivegWLdA/c0mXmi3zODQUEZb1mky JSyk5YOkRxAIta7BofWlMOztAjnTMXD3/gT/N59VI68cStmEPQkd6F181RdN/EMjAtCW FTh9alOQ/Jx5QhkRsofJsikN6vo0EZ8pwqBswGLgCHae/f9j8Zq9CU9Af0wcsYEAmVlB TvXltTmlL4eCryOlyB5G80AS1a0InnDEpZLw9n2NzWSKAI9AaB4Z4AtHwz8CwC8a8VcS WSCKICdJbOc9/Cf37ri1t8eKR8KP2jFT85DW6eWDGeh9q3e5IE049CfiXQp5ERRibL5y vUNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=Kl/6H0WR0rVrMB435zhEUSxaD+3pbPYBSfqowvhwSOU=; fh=y8d0C5dLtGb8zs8KQUIJy2R9+5DBPV29N8a8eZxYvuU=; b=ag35OQrpTZDWnu3hmaxrpMMcDWzfCCdcLHjXEUmpmfSaenK4HpP+dqj/SAhBnuFUGF p34O8UbroBFP+b+tful0+8KNRaCNLxQRL/Cw2FYWfj+JivNtLd5Ht36dqe6oxzFzzMzX 1TYirVW2w5yM3JMAxyyC4XzjyEiy19pycAv3q98JFsUcqFlrmgaZpn63blhSIZPssT5D b88sgeNXJXL6x4bH8MtxfXvbNG5DZs93erp1iZb/HLk7lm/FuDxkTHyuSU68bF0GQf5g zkmfz2eSSVWhlj6EEEOajSo7ljcZ64YduXEPnXTyHKKPvbO5DMkb+wKUezv1jCjUTYI6 x0BQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id a11-20020a65640b000000b00577f7c8db80si2935835pgv.372.2023.09.15.03.28.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 03:28:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 39E6A80FE963; Fri, 15 Sep 2023 03:24:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234407AbjIOKXm (ORCPT + 99 others); Fri, 15 Sep 2023 06:23:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234333AbjIOKXE (ORCPT ); Fri, 15 Sep 2023 06:23:04 -0400 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 986411FE5; Fri, 15 Sep 2023 03:22:59 -0700 (PDT) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id 700D524E248; Fri, 15 Sep 2023 18:22:58 +0800 (CST) Received: from EXMBX171.cuchost.com (172.16.6.91) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 15 Sep 2023 18:22:58 +0800 Received: from ubuntu.localdomain (113.72.144.67) by EXMBX171.cuchost.com (172.16.6.91) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 15 Sep 2023 18:22:56 +0800 From: Minda Chen To: Daire McNamara , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Bjorn Helgaas , Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Emil Renner Berthing CC: , , , , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Mason Huo , Leyfoon Tan , Kevin Xie , Minda Chen Subject: [PATCH v6 14/19] PCI: microchip: Add event IRQ domain ops to plda_event struct Date: Fri, 15 Sep 2023 18:22:38 +0800 Message-ID: <20230915102243.59775-15-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230915102243.59775-1-minda.chen@starfivetech.com> References: <20230915102243.59775-1-minda.chen@starfivetech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [113.72.144.67] X-ClientProxiedBy: EXCAS062.cuchost.com (172.16.6.22) To EXMBX171.cuchost.com (172.16.6.91) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Fri, 15 Sep 2023 03:24:11 -0700 (PDT) For register different event domain ops, Add domain_ops pointer to plda_event struct. Signed-off-by: Minda Chen --- drivers/pci/controller/plda/pcie-microchip-host.c | 12 +++++++++--- drivers/pci/controller/plda/pcie-plda.h | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/plda/pcie-microchip-host.c b/drivers/pci/controller/plda/pcie-microchip-host.c index 875bdb03ce22..49e09d24eb8f 100644 --- a/drivers/pci/controller/plda/pcie-microchip-host.c +++ b/drivers/pci/controller/plda/pcie-microchip-host.c @@ -810,13 +810,15 @@ static const struct plda_event_ops mc_event_ops = { }; static const struct plda_event mc_event = { + .domain_ops = &mc_event_domain_ops, .event_ops = &mc_event_ops, .request_event_irq = mc_request_event_irq, .intx_event = EVENT_LOCAL_PM_MSI_INT_INTX, .msi_event = EVENT_LOCAL_PM_MSI_INT_MSI, }; -static int plda_pcie_init_irq_domains(struct plda_pcie_rp *port) +static int plda_pcie_init_irq_domains(struct plda_pcie_rp *port, + const struct irq_domain_ops *ops) { struct device *dev = port->dev; struct device_node *node = dev->of_node; @@ -830,7 +832,8 @@ static int plda_pcie_init_irq_domains(struct plda_pcie_rp *port) } port->event_domain = irq_domain_add_linear(pcie_intc_node, port->num_events, - &mc_event_domain_ops, port); + ops, port); + if (!port->event_domain) { dev_err(dev, "failed to get event domain\n"); of_node_put(pcie_intc_node); @@ -923,13 +926,16 @@ static int plda_init_interrupts(struct platform_device *pdev, int irq; int i, intx_irq, msi_irq, event_irq; int ret; + const struct irq_domain_ops *irq_dom_ops; if (!event->event_ops || !event->event_ops->get_events) { dev_err(dev, "no get events ops\n"); return -EINVAL; } - ret = plda_pcie_init_irq_domains(port); + irq_dom_ops = event->domain_ops ? event->domain_ops : &mc_event_domain_ops; + + ret = plda_pcie_init_irq_domains(port, irq_dom_ops); if (ret) { dev_err(dev, "failed creating IRQ domains\n"); return ret; diff --git a/drivers/pci/controller/plda/pcie-plda.h b/drivers/pci/controller/plda/pcie-plda.h index 48d7bc471137..122084a3318a 100644 --- a/drivers/pci/controller/plda/pcie-plda.h +++ b/drivers/pci/controller/plda/pcie-plda.h @@ -155,6 +155,7 @@ struct plda_pcie_rp { }; struct plda_event { + const struct irq_domain_ops *domain_ops; const struct plda_event_ops *event_ops; int (*request_event_irq)(struct plda_pcie_rp *pcie, int event_irq, int event); -- 2.17.1