From patchwork Wed Mar 14 10:29:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Leitner X-Patchwork-Id: 885668 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=g0hl1n.net Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 401TCv2qFwz9sVP for ; Wed, 14 Mar 2018 21:55:55 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751394AbeCNKzw (ORCPT ); Wed, 14 Mar 2018 06:55:52 -0400 Received: from relay02.alfahosting-server.de ([109.237.142.238]:47029 "EHLO relay02.alfahosting-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751559AbeCNKzv (ORCPT ); Wed, 14 Mar 2018 06:55:51 -0400 Received: by relay01.alfahosting-server.de (Postfix, from userid 1001) id EE80732C7830; Wed, 14 Mar 2018 11:29:57 +0100 (CET) X-Spam-DCC: : X-Spam-Level: X-Spam-Status: No, score=-1000.0 required=7.0 tests=BAYES_50, D_SENT_WITH_SASL autolearn=disabled version=3.2.5 Received: from alfa3028.alfahosting-server.de (alfa3028.alfahosting-server.de [109.237.138.38]) by relay01.alfahosting-server.de (Postfix) with ESMTPS id A0D6B32C7A00; Wed, 14 Mar 2018 11:29:51 +0100 (CET) Received: from localhost.localdomain (unknown [91.230.2.244]) (Authenticated sender: yes) by alfa3028.alfahosting-server.de (Postfix) with ESMTPA id 52002430CEE7; Wed, 14 Mar 2018 11:29:51 +0100 (CET) From: Richard Leitner To: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Cc: gregkh@linuxfoundation.org, mathias.nyman@intel.com, bhelgaas@google.com, richard.leitner@skidata.com Subject: [PATCH 3/3] usb: host: pci: replace hardcoded renesas PCI IDs Date: Wed, 14 Mar 2018 11:29:33 +0100 Message-Id: <20180314102933.21367-4-dev@g0hl1n.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180314102933.21367-1-dev@g0hl1n.net> References: <20180314102933.21367-1-dev@g0hl1n.net> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Richard Leitner Introduce Renesas uPD72020{1,2} PCI device IDs in pci_ids.h and replace the harcoded values with them. Signed-off-by: Richard Leitner --- drivers/usb/host/pci-quirks.c | 6 ++++-- drivers/usb/host/xhci-pci.c | 4 ++-- include/linux/pci_ids.h | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index 39d163729b89..5e1ad523622e 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c @@ -1170,7 +1170,8 @@ static void quirk_usb_handoff_xhci(struct pci_dev *pdev) /* Auto handoff never worked for these devices. Force it and continue */ if ((pdev->vendor == PCI_VENDOR_ID_TI && pdev->device == PCI_DEVICE_ID_TI_TUSB73X0) || - (pdev->vendor == PCI_VENDOR_ID_RENESAS && pdev->device == 0x0014)) { + (pdev->vendor == PCI_VENDOR_ID_RENESAS && + pdev->device == PCI_DEVICE_ID_RENESAS_UPD720201)) { val = (val | XHCI_HC_OS_OWNED) & ~XHCI_HC_BIOS_OWNED; writel(val, base + ext_cap_offset); } @@ -1282,7 +1283,8 @@ bool usb_xhci_needs_pci_reset(struct pci_dev *pdev) * quirk, or the system will be in a rather bad state. */ if (pdev->vendor == PCI_VENDOR_ID_RENESAS && - (pdev->device == 0x0014 || pdev->device == 0x0015)) + (pdev->device == PCI_DEVICE_ID_RENESAS_UPD720201 || + pdev->device == PCI_DEVICE_ID_RENESAS_UPD720202)) return true; return false; diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index a5bfd890190c..a453e4c35ac7 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c @@ -189,10 +189,10 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) xhci->quirks |= XHCI_BROKEN_STREAMS; } if (pdev->vendor == PCI_VENDOR_ID_RENESAS && - pdev->device == 0x0014) + pdev->device == PCI_DEVICE_ID_RENESAS_UPD720201) xhci->quirks |= XHCI_TRUST_TX_LENGTH; if (pdev->vendor == PCI_VENDOR_ID_RENESAS && - pdev->device == 0x0015) + pdev->device == PCI_DEVICE_ID_RENESAS_UPD720202) xhci->quirks |= XHCI_RESET_ON_RESUME; if (pdev->vendor == PCI_VENDOR_ID_VIA) xhci->quirks |= XHCI_RESET_ON_RESUME; diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index d23a97868dee..eb52f0e9b651 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -2427,6 +2427,8 @@ #define PCI_DEVICE_ID_RENESAS_SH7763 0x0004 #define PCI_DEVICE_ID_RENESAS_SH7785 0x0007 #define PCI_DEVICE_ID_RENESAS_SH7786 0x0010 +#define PCI_DEVICE_ID_RENESAS_UPD720201 0x0014 +#define PCI_DEVICE_ID_RENESAS_UPD720202 0x0015 #define PCI_VENDOR_ID_SOLARFLARE 0x1924 #define PCI_DEVICE_ID_SOLARFLARE_SFC4000A_0 0x0703