summaryrefslogtreecommitdiffstats
path: root/drivers/thunderbolt
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2017-06-06 08:25:11 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-06-09 05:42:43 -0400
commit5e2781bcb1e876d314832489ff8177ef917d9b45 (patch)
tree4b8fafd66843c3f426811c0cbc8ae91882056b91 /drivers/thunderbolt
parentd7f781bfdbf4eb7c5706c9974b8bf6d3c82e69c1 (diff)
thunderbolt: Add new Thunderbolt PCI IDs
Add Intel Win Ridge (Thunderbolt 2) and Alpine Ridge (Thunderbolt 3) controller PCI IDs to the list of supported devices. This code is based on the work done by Amir Levy and Michael Jamet. Signed-off-by: Michael Jamet <michael.jamet@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Yehezkel Bernat <yehezkel.bernat@intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Andreas Noever <andreas.noever@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/thunderbolt')
-rw-r--r--drivers/thunderbolt/nhi.c11
-rw-r--r--drivers/thunderbolt/nhi.h17
-rw-r--r--drivers/thunderbolt/switch.c19
3 files changed, 42 insertions, 5 deletions
diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c
index c1113a3c4128..fa4c2745dba2 100644
--- a/drivers/thunderbolt/nhi.c
+++ b/drivers/thunderbolt/nhi.c
@@ -787,6 +787,17 @@ static struct pci_device_id nhi_ids[] = {
787 .device = PCI_DEVICE_ID_INTEL_FALCON_RIDGE_4C_NHI, 787 .device = PCI_DEVICE_ID_INTEL_FALCON_RIDGE_4C_NHI,
788 .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, 788 .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID,
789 }, 789 },
790
791 /* Thunderbolt 3 */
792 { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_2C_NHI) },
793 { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_4C_NHI) },
794 { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_USBONLY_NHI) },
795 { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_LP_NHI) },
796 { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_LP_USBONLY_NHI) },
797 { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_2C_NHI) },
798 { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_4C_NHI) },
799 { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_USBONLY_NHI) },
800
790 { 0,} 801 { 0,}
791}; 802};
792 803
diff --git a/drivers/thunderbolt/nhi.h b/drivers/thunderbolt/nhi.h
index 630f44140530..8bd9b4e5a0b1 100644
--- a/drivers/thunderbolt/nhi.h
+++ b/drivers/thunderbolt/nhi.h
@@ -143,4 +143,21 @@ static inline int ring_tx(struct tb_ring *ring, struct ring_frame *frame)
143 return __ring_enqueue(ring, frame); 143 return __ring_enqueue(ring, frame);
144} 144}
145 145
146/*
147 * PCI IDs used in this driver from Win Ridge forward. There is no
148 * need for the PCI quirk anymore as we will use ICM also on Apple
149 * hardware.
150 */
151#define PCI_DEVICE_ID_INTEL_WIN_RIDGE_2C_NHI 0x157d
152#define PCI_DEVICE_ID_INTEL_WIN_RIDGE_2C_BRIDGE 0x157e
153#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_LP_NHI 0x15bf
154#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_LP_BRIDGE 0x15c0
155#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_4C_NHI 0x15d2
156#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_4C_BRIDGE 0x15d3
157#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_2C_NHI 0x15d9
158#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_2C_BRIDGE 0x15da
159#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_LP_USBONLY_NHI 0x15dc
160#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_USBONLY_NHI 0x15dd
161#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_USBONLY_NHI 0x15de
162
146#endif 163#endif
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index 11f16a141686..1497518aceff 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -491,13 +491,22 @@ int tb_switch_configure(struct tb_switch *sw)
491 tb_sw_warn(sw, "unknown switch vendor id %#x\n", 491 tb_sw_warn(sw, "unknown switch vendor id %#x\n",
492 sw->config.vendor_id); 492 sw->config.vendor_id);
493 493
494 if (sw->config.device_id != PCI_DEVICE_ID_INTEL_LIGHT_RIDGE && 494 switch (sw->config.device_id) {
495 sw->config.device_id != PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_4C && 495 case PCI_DEVICE_ID_INTEL_LIGHT_RIDGE:
496 sw->config.device_id != PCI_DEVICE_ID_INTEL_PORT_RIDGE && 496 case PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_4C:
497 sw->config.device_id != PCI_DEVICE_ID_INTEL_FALCON_RIDGE_2C_BRIDGE && 497 case PCI_DEVICE_ID_INTEL_PORT_RIDGE:
498 sw->config.device_id != PCI_DEVICE_ID_INTEL_FALCON_RIDGE_4C_BRIDGE) 498 case PCI_DEVICE_ID_INTEL_FALCON_RIDGE_2C_BRIDGE:
499 case PCI_DEVICE_ID_INTEL_FALCON_RIDGE_4C_BRIDGE:
500 case PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_2C_BRIDGE:
501 case PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_4C_BRIDGE:
502 case PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_2C_BRIDGE:
503 case PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_4C_BRIDGE:
504 break;
505
506 default:
499 tb_sw_warn(sw, "unsupported switch device id %#x\n", 507 tb_sw_warn(sw, "unsupported switch device id %#x\n",
500 sw->config.device_id); 508 sw->config.device_id);
509 }
501 510
502 sw->config.enabled = 1; 511 sw->config.enabled = 1;
503 512