diff options
author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2019-01-09 17:42:12 +0300 |
---|---|---|
committer | Mika Westerberg <mika.westerberg@linux.intel.com> | 2019-04-18 11:18:51 +0300 |
commit | a9be55824a10653d0247de12dc6b9a741ce3fc98 (patch) | |
tree | a2d8b835041d68b65e0222331d36021d8ed55727 /drivers/thunderbolt/lc.c | |
parent | ffd003b2f8cba8dde0f7259e2207d63f75691096 (diff) | |
download | linux-a9be55824a10653d0247de12dc6b9a741ce3fc98.tar.xz |
thunderbolt: Move LC specific functionality into a separate file
We will be adding more link controller functionality in subsequent
patches and it does not make sense to keep all that in switch.c, so
separate LC functionality into its own file.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/lc.c')
-rw-r--r-- | drivers/thunderbolt/lc.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/thunderbolt/lc.c b/drivers/thunderbolt/lc.c new file mode 100644 index 000000000000..2134a55ed837 --- /dev/null +++ b/drivers/thunderbolt/lc.c @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Thunderbolt link controller support + * + * Copyright (C) 2019, Intel Corporation + * Author: Mika Westerberg <mika.westerberg@linux.intel.com> + */ + +#include "tb.h" + +/** + * tb_lc_read_uuid() - Read switch UUID from link controller common register + * @sw: Switch whose UUID is read + * @uuid: UUID is placed here + */ +int tb_lc_read_uuid(struct tb_switch *sw, u32 *uuid) +{ + if (!sw->cap_lc) + return -EINVAL; + return tb_sw_read(sw, uuid, TB_CFG_SWITCH, sw->cap_lc + TB_LC_FUSE, 4); +} |