From patchwork Mon Jan 7 06:41:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 154854 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3171023ljp; Sun, 6 Jan 2019 22:43:30 -0800 (PST) X-Google-Smtp-Source: ALg8bN75If7FmSI3S4cGQa1nnG9r3WsBEx38YEoz1g7gxJDN1ylJBQKwWysWHuzMjwFn0eb4W0u+ X-Received: by 2002:a17:902:6a8c:: with SMTP id n12mr60541364plk.85.1546843410380; Sun, 06 Jan 2019 22:43:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546843410; cv=none; d=google.com; s=arc-20160816; b=ALIw7K4MUtBkgQyN+tsSQNWgjAlUAwoSKURyPyTuzZ63wOvGKH851YsrNjqmXq59bE bC4iIwaHdxxqtyDQmmT+5gX67nIRst7LNnqmIXGgUU4QulS9qJbVyZvvH9YyxUgF6GbW NyXnpuQ83X0bMV7tVGw6x8aHpK8PEqMOVQXC3XNHBJDLbC3NjTnvvmBOKR7OWSSKSygS IaI8nWfl4MCDHgWnFpGuDghrV4zQVZCbS+DOPNVCwLeOoawpwqkhrNDv7Rv7VN0/o9GO xTIj4bKZJjqoXhaUCkTSFrls9WF+cWAXPmA3fqj7tQ7lmf/GDAC251AcKWD0lIYIgeV4 Saww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=cErqiu0ARQGyKCvuDtnfQEI4ZlZ26OR+gjwxCf8dAg4=; b=rZu6YomkKkfWEcKryS4kvQlWc89yN1T4cIs8lxezMsZ2z0eXDKGLYb6tdyADCEGqBp NPE4jPiWQmV8BtkkPZ4hC5biLgRu2/SZnHHGnPRPVW+qgblLvpvNyy0uL5blNw6QuEQE cOKyPwVNoLdjYDNKCwLCEQVUWyXwuzh4VvW9YNvG4kRGv7elkV6fPcBNXjtLFNDiIXk4 knfY+zq0TrncgDy10co+e/XtyShusQeJ2gfNal3j+mLN+PNogqtoIc+CdZpNCuiM+coY sXEr5HwIP4Q/SUvPOtDaiR1aHhad7YzbNaCohK43q7K8ZNHuI4AoOGq1hdXwunLhIYp/ LucA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=mNkGRDzs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i13si10886644pgi.260.2019.01.06.22.43.30; Sun, 06 Jan 2019 22:43:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@ti.com header.s=ti-com-17Q1 header.b=mNkGRDzs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726540AbfAGGn2 (ORCPT + 31 others); Mon, 7 Jan 2019 01:43:28 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:38890 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725771AbfAGGnZ (ORCPT ); Mon, 7 Jan 2019 01:43:25 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x076gulx055152; Mon, 7 Jan 2019 00:42:56 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1546843376; bh=cErqiu0ARQGyKCvuDtnfQEI4ZlZ26OR+gjwxCf8dAg4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=mNkGRDzsJSoQ8ZeDWejeSfoGil7FdYS/sbmTF5HMpMiq0JIwEEjfCLA8B/GQouHAb hvLC+qB8thQvP+dvoNtDwrv82N2tvcXWsqQcCU5nn+1NmHjBU3J1Jzz2aqtDfYj2C6 XKVPlKuQfBJYdjOmOuFFNwMN95DTydqsAXv+27dk= Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x076guv2048373 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 7 Jan 2019 00:42:56 -0600 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 7 Jan 2019 00:42:56 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Mon, 7 Jan 2019 00:42:56 -0600 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id x076gfnx002672; Mon, 7 Jan 2019 00:42:51 -0600 From: Kishon Vijay Abraham I To: Lorenzo Pieralisi , Bjorn Helgaas , Gustavo Pimentel , Alan Douglas , Shawn Lin CC: Jingoo Han , Heiko Stuebner , Cyrille Pitchen , Jia-Ju Bai , , , , , , Subject: [PATCH 02/15] PCI: dwc: Add ->get_features() callback function in dw_pcie_ep_ops Date: Mon, 7 Jan 2019 12:11:35 +0530 Message-ID: <20190107064148.10152-3-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190107064148.10152-1-kishon@ti.com> References: <20190107064148.10152-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Each platform using Designware PCIe core can support different set of endpoint features. Add a new callback function ->get_features() in dw_pcie_ep_ops so that each platform using Designware PCIe core can advertise its supported features to the endpoint function driver. Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/controller/dwc/pcie-designware-ep.c | 12 ++++++++++++ drivers/pci/controller/dwc/pcie-designware.h | 1 + 2 files changed, 13 insertions(+) -- 2.17.1 diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c index a543c45c7224..7a2925a16ab8 100644 --- a/drivers/pci/controller/dwc/pcie-designware-ep.c +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c @@ -355,6 +355,17 @@ static int dw_pcie_ep_start(struct pci_epc *epc) return pci->ops->start_link(pci); } +static const struct pci_epc_features* +dw_pcie_ep_get_features(struct pci_epc *epc, u8 func_no) +{ + struct dw_pcie_ep *ep = epc_get_drvdata(epc); + + if (!ep->ops->get_features) + return NULL; + + return ep->ops->get_features(ep); +} + static const struct pci_epc_ops epc_ops = { .write_header = dw_pcie_ep_write_header, .set_bar = dw_pcie_ep_set_bar, @@ -368,6 +379,7 @@ static const struct pci_epc_ops epc_ops = { .raise_irq = dw_pcie_ep_raise_irq, .start = dw_pcie_ep_start, .stop = dw_pcie_ep_stop, + .get_features = dw_pcie_ep_get_features, }; int dw_pcie_ep_raise_legacy_irq(struct dw_pcie_ep *ep, u8 func_no) diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h index 9943d8c68335..1f56e6ae34ff 100644 --- a/drivers/pci/controller/dwc/pcie-designware.h +++ b/drivers/pci/controller/dwc/pcie-designware.h @@ -192,6 +192,7 @@ struct dw_pcie_ep_ops { void (*ep_init)(struct dw_pcie_ep *ep); int (*raise_irq)(struct dw_pcie_ep *ep, u8 func_no, enum pci_epc_irq_type type, u16 interrupt_num); + const struct pci_epc_features* (*get_features)(struct dw_pcie_ep *ep); }; struct dw_pcie_ep {