Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3)  * Thunderbolt driver - quirks
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5)  * Copyright (c) 2020 Mario Limonciello <mario.limonciello@dell.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) #include "tb.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) static void quirk_force_power_link(struct tb_switch *sw)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) 	sw->quirks |= QUIRK_FORCE_POWER_LINK_CONTROLLER;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) struct tb_quirk {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) 	u16 vendor;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) 	u16 device;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) 	void (*hook)(struct tb_switch *sw);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) static const struct tb_quirk tb_quirks[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) 	/* Dell WD19TB supports self-authentication on unplug */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) 	{ 0x00d4, 0xb070, quirk_force_power_link },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)  * tb_check_quirks() - Check for quirks to apply
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)  * @sw: Thunderbolt switch
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)  * Apply any quirks for the Thunderbolt controller.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) void tb_check_quirks(struct tb_switch *sw)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) 	int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) 	for (i = 0; i < ARRAY_SIZE(tb_quirks); i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) 		const struct tb_quirk *q = &tb_quirks[i];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) 		if (sw->device == q->device && sw->vendor == q->vendor)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) 			q->hook(sw);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) }