WIP FPC-III support
[linux/fpc-iii.git] / drivers / thunderbolt / quirks.c
blob57e2978a3c21ecb8e9000cc81092f70b251bb35f
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Thunderbolt driver - quirks
5 * Copyright (c) 2020 Mario Limonciello <mario.limonciello@dell.com>
6 */
8 #include "tb.h"
10 static void quirk_force_power_link(struct tb_switch *sw)
12 sw->quirks |= QUIRK_FORCE_POWER_LINK_CONTROLLER;
15 struct tb_quirk {
16 u16 vendor;
17 u16 device;
18 void (*hook)(struct tb_switch *sw);
21 static const struct tb_quirk tb_quirks[] = {
22 /* Dell WD19TB supports self-authentication on unplug */
23 { 0x00d4, 0xb070, quirk_force_power_link },
26 /**
27 * tb_check_quirks() - Check for quirks to apply
28 * @sw: Thunderbolt switch
30 * Apply any quirks for the Thunderbolt controller.
32 void tb_check_quirks(struct tb_switch *sw)
34 int i;
36 for (i = 0; i < ARRAY_SIZE(tb_quirks); i++) {
37 const struct tb_quirk *q = &tb_quirks[i];
39 if (sw->device == q->device && sw->vendor == q->vendor)
40 q->hook(sw);