From patchwork Fri Aug 7 10:25:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kunihiko Hayashi X-Patchwork-Id: 247551 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp2312729ilo; Fri, 7 Aug 2020 03:25:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3MmmPS/SBtjuMbFvBdCGCMr7zUMmHwRwmeUffS2HoSlYsQTcOrqkYKmH/d7/kJHYlFHqa X-Received: by 2002:a17:906:1f8e:: with SMTP id t14mr8746582ejr.336.1596795952491; Fri, 07 Aug 2020 03:25:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596795952; cv=none; d=google.com; s=arc-20160816; b=J0R1JemPL5cez46CepCqB2Hy3FUZLuQ3AFVcB/WtvCUkTZ3AVKBwj3M6DKVmuR5QhU 7yzvlKBXPWTjK6LSo6WItywEs/yMT7Kbygj/9RZqpiYZJruosleg2vz9csqgcafOoaEt QEprMbRre+JFnrOFBjvEObDcGAIWv3CTrHUWvuOE2lR2Yh0CAI/fCXSymIewDu3VGrgL PSfhhsGhK5+mcmKKy8CaUZz4hYPdXPWkZVv++L8d6TRc1pQfjN9MZmRds1p5kivLYfjJ SGE3FWjIRxenUldAebMDTKFRFMWX7BjmcksA8TeWGH6hQ6Jz4NixcHzYhyAteHgkx6fx Ghgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=Tx9tjHFfZ920uEvJ+N3RWMCOvuuZtYdQQ/bhHTpcOwo=; b=liXeC2pbu+jc5Eb0AVc0G0zb8FgDAdLWyrG7UlfNs/RMctcvwSfCBcNqIV9FWvNdNa 8uqKF2IxQmonjpS4VTrDLX5IjWb8Hgat4nH5KM8J1xgYveqpM4QjKFSn9x0Pgs5n27Dk JQlvlo7BK8nQzAmYlIh+TaUEOPH0rjWl2u0ESmQbTIxMKt0yq7CXeU04Q8ZGTQiHnRjQ HjQflzExxjy9HaBT3+gp4PGY3dHI/5R0uG27TL3iCyE47Ishtk54Ld8PJQ8L2nyDazyp 19wU52WCg2gFr5sH0HEWJ0v7cwM4EB22fFb+IyDr2IaDiSB8Wev3qcXV2H8pT8/23Ao9 fX+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e17si5733132edc.382.2020.08.07.03.25.52; Fri, 07 Aug 2020 03:25:52 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-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 devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728194AbgHGKZc (ORCPT + 6 others); Fri, 7 Aug 2020 06:25:32 -0400 Received: from mx.socionext.com ([202.248.49.38]:31570 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726940AbgHGKZa (ORCPT ); Fri, 7 Aug 2020 06:25:30 -0400 Received: from unknown (HELO kinkan-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 07 Aug 2020 19:25:28 +0900 Received: from mail.mfilter.local (m-filter-1 [10.213.24.61]) by kinkan-ex.css.socionext.com (Postfix) with ESMTP id 04FBB180BB5; Fri, 7 Aug 2020 19:25:29 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Fri, 7 Aug 2020 19:25:29 +0900 Received: from plum.e01.socionext.com (unknown [10.213.132.32]) by kinkan.css.socionext.com (Postfix) with ESMTP id A7F441A0507; Fri, 7 Aug 2020 19:25:28 +0900 (JST) From: Kunihiko Hayashi To: Lorenzo Pieralisi , Bjorn Helgaas , Jingoo Han , Gustavo Pimentel , Rob Herring , Masahiro Yamada , Marc Zyngier Cc: linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Masami Hiramatsu , Jassi Brar , Kunihiko Hayashi Subject: [PATCH v6 1/6] PCI: portdrv: Add pcie_port_service_get_irq() function Date: Fri, 7 Aug 2020 19:25:17 +0900 Message-Id: <1596795922-705-2-git-send-email-hayashi.kunihiko@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1596795922-705-1-git-send-email-hayashi.kunihiko@socionext.com> References: <1596795922-705-1-git-send-email-hayashi.kunihiko@socionext.com> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add pcie_port_service_get_irq() that returns the virtual IRQ number for specified portdrv service. Cc: Lorenzo Pieralisi Signed-off-by: Kunihiko Hayashi --- drivers/pci/pcie/portdrv.h | 1 + drivers/pci/pcie/portdrv_core.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) -- 2.7.4 diff --git a/drivers/pci/pcie/portdrv.h b/drivers/pci/pcie/portdrv.h index af7cf23..e256456 100644 --- a/drivers/pci/pcie/portdrv.h +++ b/drivers/pci/pcie/portdrv.h @@ -150,4 +150,5 @@ static inline void pcie_pme_interrupt_enable(struct pci_dev *dev, bool en) {} #endif /* !CONFIG_PCIE_PME */ struct device *pcie_port_find_device(struct pci_dev *dev, u32 service); +int pcie_port_service_get_irq(struct pci_dev *dev, u32 service); #endif /* _PORTDRV_H_ */ diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index 50a9522..f92daf8 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c @@ -480,6 +480,22 @@ struct device *pcie_port_find_device(struct pci_dev *dev, } EXPORT_SYMBOL_GPL(pcie_port_find_device); +/* + * pcie_port_service_get_irq - get irq of the service + * @dev: PCI Express port the service is associated with + * @service: For the service to find + * + * Get irq number associated with given service on a pci_dev + */ +int pcie_port_service_get_irq(struct pci_dev *dev, u32 service) +{ + struct pcie_device *pciedev; + + pciedev = to_pcie_device(pcie_port_find_device(dev, service)); + + return pciedev->irq; +} + /** * pcie_port_device_remove - unregister PCI Express port service devices * @dev: PCI Express port the service devices to unregister are associated with