1 // SPDX-License-Identifier: GPL-2.0
3 * Thunderbolt driver - quirks
5 * Copyright (c) 2020 Mario Limonciello <mario.limonciello@dell.com>
10 static void quirk_force_power_link(struct tb_switch
*sw
)
12 sw
->quirks
|= QUIRK_FORCE_POWER_LINK_CONTROLLER
;
15 static void quirk_dp_credit_allocation(struct tb_switch
*sw
)
17 if (sw
->credit_allocation
&& sw
->min_dp_main_credits
== 56) {
18 sw
->min_dp_main_credits
= 18;
19 tb_sw_dbg(sw
, "quirked DP main: %u\n", sw
->min_dp_main_credits
);
28 void (*hook
)(struct tb_switch
*sw
);
31 static const struct tb_quirk tb_quirks
[] = {
32 /* Dell WD19TB supports self-authentication on unplug */
33 { 0x0000, 0x0000, 0x00d4, 0xb070, quirk_force_power_link
},
34 { 0x0000, 0x0000, 0x00d4, 0xb071, quirk_force_power_link
},
36 * Intel Goshen Ridge NVM 27 and before report wrong number of
39 { 0x8087, 0x0b26, 0x0000, 0x0000, quirk_dp_credit_allocation
},
43 * tb_check_quirks() - Check for quirks to apply
44 * @sw: Thunderbolt switch
46 * Apply any quirks for the Thunderbolt controller.
48 void tb_check_quirks(struct tb_switch
*sw
)
52 for (i
= 0; i
< ARRAY_SIZE(tb_quirks
); i
++) {
53 const struct tb_quirk
*q
= &tb_quirks
[i
];
55 if (q
->hw_vendor_id
&& q
->hw_vendor_id
!= sw
->config
.vendor_id
)
57 if (q
->hw_device_id
&& q
->hw_device_id
!= sw
->config
.device_id
)
59 if (q
->vendor
&& q
->vendor
!= sw
->vendor
)
61 if (q
->device
&& q
->device
!= sw
->device
)