From patchwork Mon Jan 14 11:15:00 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: 155436 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3536144jaa; Mon, 14 Jan 2019 03:16:09 -0800 (PST) X-Google-Smtp-Source: ALg8bN7A/pL87LbbldJD6sF8e+7ge4oJ9kOIdMG/Xgrhus9TwkxzwLJQ7nw6UiR+3STTETxJfuxp X-Received: by 2002:a63:d252:: with SMTP id t18mr22487273pgi.133.1547464569597; Mon, 14 Jan 2019 03:16:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547464569; cv=none; d=google.com; s=arc-20160816; b=zxzSKM1/rnRV/b8ISsgrigqXY+XJp3QUEJ4R9kdA3sufByNlK1iB7rftvTjLe47NFm JxQJ/TqiX2U62ZNKA8xykXfySeoG/AQlATp/5TqEetWtzaDq0n1GfdY9nu1La7mgQYO0 yPIM6FN7fEuVPxruTW9jn5+N8r4rUEsSfg3AkE4l1MFIX5nzPQQb3tmBIjeUNTu2qt9s KEF20QdJQTL6E2ixJHs73qtj1REJrkrLthK1L+YtVk0FVE1NcIsHa8aV95NcSY1y+4xF 8XAS5mIvGlj3SrGXElV9dthanOijiaUAL6fBABi87jxL5hvAqkT4iMWAJkt6x/WI3f23 j4mA== 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=xnfx3fQqUUWamKKapeDSzB3wMOXThpZeDvfH+bJtPVHOV5tXbfyjd1Li3HtUzuXL1h 7c+NfCbztD1Tzw8zByz4dwhQUxtKw9jQumyGTi5vsa+YkBoFB4pXm4SvsEc6OLl2YJxa NhvSbhsLOrIIMhV6Lf/GyK9lggQnA5drTU5ax1Kxs98LGHu2brXHXraevwgLLKAXmZkC g8mFz7tFUtadcUfA2E6Xz6I5O1JmsBE0xtvcWWXvqbVNKpGtyJcSWFt9ZbBc6AGPgrUE Q2rrU0Zq3dAW2HWKXejWkMqYvJaq65cx8tu50NtI8Llg61dcJtCtNRj/enLg6uFZKe+2 XVuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ArSSHRFK; 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 j10si113827pll.179.2019.01.14.03.16.09; Mon, 14 Jan 2019 03:16:09 -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=ArSSHRFK; 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 S1726690AbfANLQI (ORCPT + 31 others); Mon, 14 Jan 2019 06:16:08 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:45280 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726467AbfANLQH (ORCPT ); Mon, 14 Jan 2019 06:16:07 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x0EBFpMX112650; Mon, 14 Jan 2019 05:15:51 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1547464551; bh=cErqiu0ARQGyKCvuDtnfQEI4ZlZ26OR+gjwxCf8dAg4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ArSSHRFKI9KTPbeQLpaDKqr2K8cmYef0dHeZAzLhnHzythg/5nWvxQMOzh09b7N97 +JhdYkZnO7rFGfWz5sbyyVjD/Sd98XA4KTVpVY4TqUlWiI3zz/Tf1mDwJO3NsKirl4 xgwly+AsGF/t+LF65kZOUEe3cYRhbWSqqVVd90CQ= Received: from DLEE101.ent.ti.com (dlee101.ent.ti.com [157.170.170.31]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x0EBFpah067081 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 14 Jan 2019 05:15:51 -0600 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 14 Jan 2019 05:15:51 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Mon, 14 Jan 2019 05:15:51 -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 x0EBFd1U011560; Mon, 14 Jan 2019 05:15:47 -0600 From: Kishon Vijay Abraham I To: Kishon Vijay Abraham I , Lorenzo Pieralisi , Gustavo Pimentel , Alan Douglas , Shawn Lin , Heiko Stuebner CC: Bjorn Helgaas , Jingoo Han , , , , , Subject: [PATCH v2 02/15] PCI: dwc: Add ->get_features() callback function in dw_pcie_ep_ops Date: Mon, 14 Jan 2019 16:45:00 +0530 Message-ID: <20190114111513.21618-3-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190114111513.21618-1-kishon@ti.com> References: <20190114111513.21618-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 {