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: 10487255 X-Patchwork-Delegate: bhelgaas@google.com 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 B17AD60230 for ; Mon, 25 Jun 2018 21:06:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A373F286A8 for ; Mon, 25 Jun 2018 21:06:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98427286BD; Mon, 25 Jun 2018 21:06:19 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20B35286B8 for ; Mon, 25 Jun 2018 21:06:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751641AbeFYVGS (ORCPT ); Mon, 25 Jun 2018 17:06:18 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:42004 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751347AbeFYVGR (ORCPT ); Mon, 25 Jun 2018 17:06:17 -0400 Received: by mail-qt0-f196.google.com with SMTP id y31-v6so13304020qty.9 for ; Mon, 25 Jun 2018 14:06:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=h1ac3BXtURPu8/LCP3uD5iO6XHzXrBjaigmbjPXzUaI=; b=RKoRHpBVJ8fKKwTBc2/g4UHpR5tRSOsN77FNSGN4rXn1lDXf6K3SEZ6RFwIlRIEa9N EMYRp8LL5loFp4OAcO7zsSSyqA4YWIJkKDXXz2nqkLI/Fs/PJPyaf4ZkPknCjDQIUxkC qywYKG3bs2DKv7gtrYVhEtLUASCZdm6Nd+4nVtjtQ/rv5Y7iUQbY8kZNdyRpxTFnOB3H ZoZjQaiMJFgZIl4hyeCcjuP7fOXdoQFpHWWzwbI0flXIQBJRicL9NYXHiDp+uZhBmZZZ ISIWnNY0Ja9Afk1UGLljol8gbnxlMRJPRT7W+YG5u/m2Zq5Ud63v0kazLeu7w0eXnoFU Gd+A== 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=JIlqX5I7fpbwO/ppda0Vr0Hl8TV5t8V8NWdHUudFZy1sXS7icoD29L66xSti/Mb9xk BY6o6tvh08oBXtVqVRzb0+07P7b5fYiMBJEIo6QiXNMr/8jtPha2I0sjxurJ+UF0QOkN TfxzdRZ4yFDiB37Odf05WxPKlqqjYlzs23HDD/AvlHwLER7xO77Sw8tM2BkjE8YwAqu9 fb1oB3SEGS/rJsjKeVHYjEEgAkxGMEJVQXTYH1xXGIkhKUtyb+bUpSHDI23Yz2NLofFz WPemls8B4jjgmw2VnP4yU6XXu7WSfZ2WFfKT1EIfAQZOgpqpGmfP9x+gQM1flInr9CWy fXAg== X-Gm-Message-State: APt69E1nrowCsAIMQZVIpAvJAblNjSn2eRJvO7un+Oqm4h2Th4/MSJWV h0VoCchyVD/vtF4Gf76lusM= 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 Cc: Alex Deucher 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> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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;