Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2456550rdh; Wed, 27 Sep 2023 03:18:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFgr82qzu+lnB7o9tbpTmfXvKvhCWvdAcpGx8fXMZ0TVSKARRSPY1sRrQn4+XzzhOzYfrN+ X-Received: by 2002:a05:6e02:d0e:b0:34f:4b5d:1b4 with SMTP id g14-20020a056e020d0e00b0034f4b5d01b4mr1541741ilj.19.1695809910386; Wed, 27 Sep 2023 03:18:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695809910; cv=none; d=google.com; s=arc-20160816; b=w/5l1f/om1c865ACAV8IkiDRPsvWWGolgl5+MTTmt+PBfoKJyZz3LqY/5U1ZlVTsCW NBozBZSLeush9FCBxIvEM8BkmGFA5RVx9VwRiZE6rLk91YNi3vt6RETKmhJiykq+wgdI IPDyc0jK5i792wzblOgZzu95eaHqZtcY7tQAEgqcP1+Q2ac1FHRKsQW7JIDKgrqUU3vu RhINLiyF1kr/nAwiDHuhKPo4gRPJEC00QBnR7p4qdwLhwfvIbjkHtbMIP+MtKUmKtgxQ uBNlu0qduk+oPMgAOKHaBXE8/nxWOno9KcOnw1kOlqr+IFP8dlM1QkLlduMUOGY3b1Ym PR5Q== 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=HWmSEg1xjkincynPtnAYsDahUCeqtKGdSvCf9lNA5Xk=; fh=KH/9o+8UBz/NoIGu0llUr0msPOhSsaa+/ATeWBANkvM=; b=0fasRiQbo2QBi6pwBCFYLaQAQNxPhNBkVtyVqlVYwMPvsxaJ0/Wk+QMsWqc+GgfpYj xW1UBDXZZBFLb1tf+G4YfqoGH7O7QjiLV4vZTCyTMHH/suhXT3Pwn/IyE4OX4JBRL1o8 /DtF+8YjB+k22lqGIwGtL560jueQXHAnBnPHp2170eooWfrgqbgUtGz2kHA5SAPc84XT +YGuaCWXunJ/cuP+7yj0wNBJZtHdlGw2ciJXtMnPdhHrDPdU5KGqqps6eit8CyoekkX1 z07DooEu3H1YKjsU6cIr267ksBMO5/do3BiiZspX2wNVeWnAm9k/3b7rL9qFY7ZeK+xF gFbw== 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:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id v184-20020a6389c1000000b00578a44df6c1si15532442pgd.640.2023.09.27.03.18.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 03:18:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 04F3C81489FA; Wed, 27 Sep 2023 03:10:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231426AbjI0KJN (ORCPT + 99 others); Wed, 27 Sep 2023 06:09:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231158AbjI0KIV (ORCPT ); Wed, 27 Sep 2023 06:08:21 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 909CBF3; Wed, 27 Sep 2023 03:08:20 -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 fd01.gateway.ufhost.com (Postfix) with ESMTP id C966424E06F; Wed, 27 Sep 2023 18:08:18 +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; Wed, 27 Sep 2023 18:08:19 +0800 Received: from ubuntu.localdomain (113.72.144.128) by EXMBX171.cuchost.com (172.16.6.91) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 27 Sep 2023 18:08:17 +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: , , , , Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Mason Huo , Leyfoon Tan , Kevin Xie , Minda Chen Subject: [PATCH v7 14/19] PCI: microchip: Add event IRQ domain ops to struct plda_event Date: Wed, 27 Sep 2023 18:07:57 +0800 Message-ID: <20230927100802.46620-15-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230927100802.46620-1-minda.chen@starfivetech.com> References: <20230927100802.46620-1-minda.chen@starfivetech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [113.72.144.128] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Wed, 27 Sep 2023 03:10:18 -0700 (PDT) For register different event domain ops, Add domain_ops pointer to struct plda_event. 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