From patchwork Mon Jun 25 21:06:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 10487263 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EADD26038C for ; Mon, 25 Jun 2018 21:06:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DEB58286B8 for ; Mon, 25 Jun 2018 21:06:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D39F2286BF; Mon, 25 Jun 2018 21:06:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9BA55286B8 for ; Mon, 25 Jun 2018 21:06:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CB0706E3CC; Mon, 25 Jun 2018 21:06:21 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qt0-x242.google.com (mail-qt0-x242.google.com [IPv6:2607:f8b0:400d:c0d::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 04A3B6E3C9; Mon, 25 Jun 2018 21:06:18 +0000 (UTC) Received: by mail-qt0-x242.google.com with SMTP id l10-v6so13329210qtj.0; Mon, 25 Jun 2018 14:06:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=h1ac3BXtURPu8/LCP3uD5iO6XHzXrBjaigmbjPXzUaI=; b=LRijebXHDrMjm5iPO0ZHkh4GvNFNUBIECXjaogfVO+UYxLkjL5QzdZyFetO62b9VY9 ke4njfX3qp5uh1pF29n+aDnw5TRlGaiuIfkvguIerdOVBI8rcZGT9eEwlmwJruDlzGH3 a3WS08ARxNqc+KUSbLljYeSKny3Ynpb9FlQinD9n2ylTl86BC9w6+P0n8tHK/BEMZXFC 72vbP5zX0s0564xyv0jw8rKxmGjAog41yRZWBD0SB3Cua1UhvA6n5sEeQg1oAoXSb04H cTNxVuaGLEj/+79pq1WGYnoHCWw78bMdBZLTUzTKO/OjyTLjKzfvJqcvbig/f6tfa81S mb5A== X-Gm-Message-State: APt69E3wCMG38xoSjJaUWRexy45Sc6RU+obQYmgIa0SKe3Bv87F27Eav hBJshlnC3TKVQ9nAnFcdJTcLKg== X-Google-Smtp-Source: AAOMgpdsJFM+VTb74Vut4c4qPjQG3G61F9iX31NIO5QK2WV1JQA8A+0gcL67G99qYWvGpJzQR27WOQ== X-Received: by 2002:a0c:f4ca:: with SMTP id o10-v6mr6453006qvm.101.1529960776864; Mon, 25 Jun 2018 14:06:16 -0700 (PDT) Received: from localhost.localdomain ([76.1.164.143]) by smtp.gmail.com with ESMTPSA id q13-v6sm4016108qkl.97.2018.06.25.14.06.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Jun 2018 14:06:16 -0700 (PDT) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, airlied@gmail.com, linux-pci@vger.kernel.org, bhelgaas@google.com Subject: [PATCH 1/5] pci: export pcie_get_speed_cap and pcie_get_width_cap Date: Mon, 25 Jun 2018 16:06:02 -0500 Message-Id: <20180625210606.2736-2-alexander.deucher@amd.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180625210606.2736-1-alexander.deucher@amd.com> References: <20180625210606.2736-1-alexander.deucher@amd.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP So drivers can use them. This can be used to replace duplicate code in the drm subsystem. Signed-off-by: Alex Deucher Acked-by: Bjorn Helgaas --- drivers/pci/pci.c | 2 ++ include/linux/pci.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 97acba712e4e..22adaf35b136 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -5222,6 +5222,7 @@ enum pci_bus_speed pcie_get_speed_cap(struct pci_dev *dev) return PCI_SPEED_UNKNOWN; } +EXPORT_SYMBOL(pcie_get_speed_cap); /** * pcie_get_width_cap - query for the PCI device's link width capability @@ -5240,6 +5241,7 @@ enum pcie_link_width pcie_get_width_cap(struct pci_dev *dev) return PCIE_LNK_WIDTH_UNKNOWN; } +EXPORT_SYMBOL(pcie_get_width_cap); /** * pcie_bandwidth_capable - calculate a PCI device's link bandwidth capability diff --git a/include/linux/pci.h b/include/linux/pci.h index 340029b2fb38..6e0c0803b241 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -261,6 +261,9 @@ enum pci_bus_speed { PCI_SPEED_UNKNOWN = 0xff, }; +enum pci_bus_speed pcie_get_speed_cap(struct pci_dev *dev); +enum pcie_link_width pcie_get_width_cap(struct pci_dev *dev); + struct pci_cap_saved_data { u16 cap_nr; bool cap_extended;