mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-07 08:39:48 +00:00
thunderbolt: Move setting parentage of TB16 into quirks
This commit is contained in:
parent
39a5228331
commit
926da40a88
@ -21,7 +21,6 @@
|
|||||||
#include "fu-plugin-vfuncs.h"
|
#include "fu-plugin-vfuncs.h"
|
||||||
#include "fu-device-metadata.h"
|
#include "fu-device-metadata.h"
|
||||||
#include "fu-thunderbolt-image.h"
|
#include "fu-thunderbolt-image.h"
|
||||||
#include "fu-thunderbolt-known-devices.h"
|
|
||||||
|
|
||||||
#ifndef HAVE_GUDEV_232
|
#ifndef HAVE_GUDEV_232
|
||||||
#pragma clang diagnostic push
|
#pragma clang diagnostic push
|
||||||
@ -227,23 +226,6 @@ fu_plugin_thunderbolt_is_native (GUdevDevice *udevice, gboolean *is_native, GErr
|
|||||||
error);
|
error);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
fu_plugin_thunderbolt_add_known_parents (FuDevice *device, guint16 vid, guint16 did)
|
|
||||||
{
|
|
||||||
const gchar *parent = NULL;
|
|
||||||
|
|
||||||
if (vid == THUNDERBOLT_VENDOR_DELL) {
|
|
||||||
if (did == THUNDERBOLT_DEVICE_DELL_TB16_CABLE ||
|
|
||||||
did == THUNDERBOLT_DEVICE_DELL_TB16_DOCK)
|
|
||||||
parent = PARENT_GUID_DELL_TB16;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (parent != NULL ) {
|
|
||||||
fu_device_add_parent_guid (device, parent);
|
|
||||||
g_debug ("Add known parent %s to %u:%u", parent, vid, did);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
fu_plugin_thunderbolt_add (FuPlugin *plugin, GUdevDevice *device)
|
fu_plugin_thunderbolt_add (FuPlugin *plugin, GUdevDevice *device)
|
||||||
{
|
{
|
||||||
@ -341,7 +323,6 @@ fu_plugin_thunderbolt_add (FuPlugin *plugin, GUdevDevice *device)
|
|||||||
(guint) did,
|
(guint) did,
|
||||||
is_native ? "-native" : "");
|
is_native ? "-native" : "");
|
||||||
fu_device_add_flag (dev, FWUPD_DEVICE_FLAG_UPDATABLE);
|
fu_device_add_flag (dev, FWUPD_DEVICE_FLAG_UPDATABLE);
|
||||||
fu_plugin_thunderbolt_add_known_parents (dev, vid, did);
|
|
||||||
} else {
|
} else {
|
||||||
fu_device_set_update_error (dev, "Device is in safe mode");
|
fu_device_set_update_error (dev, "Device is in safe mode");
|
||||||
}
|
}
|
||||||
@ -366,6 +347,7 @@ fu_plugin_thunderbolt_add (FuPlugin *plugin, GUdevDevice *device)
|
|||||||
fu_device_add_icon (dev, "audio-card");
|
fu_device_add_icon (dev, "audio-card");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fu_device_set_quirks (dev, fu_plugin_get_quirks (plugin));
|
||||||
vendor = g_udev_device_get_sysfs_attr (device, "vendor_name");
|
vendor = g_udev_device_get_sysfs_attr (device, "vendor_name");
|
||||||
if (vendor != NULL)
|
if (vendor != NULL)
|
||||||
fu_device_set_vendor (dev, vendor);
|
fu_device_set_vendor (dev, vendor);
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2018 Dell, Inc.
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: LGPL-2.1+
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __FU_THUNDERBOLT_KNOWN_DEVICES_H__
|
|
||||||
#define __FU_THUNDERBOLT_KNOWN_DEVICES_H__
|
|
||||||
|
|
||||||
#define THUNDERBOLT_VENDOR_DELL 0x00d4
|
|
||||||
|
|
||||||
/* Dell TB16 dock */
|
|
||||||
#define THUNDERBOLT_DEVICE_DELL_TB16_CABLE 0xb051
|
|
||||||
#define THUNDERBOLT_DEVICE_DELL_TB16_DOCK 0xb054
|
|
||||||
#define PARENT_GUID_DELL_TB16 "e7ca1f36-bf73-4574-afe6-a4ccacabf479"
|
|
||||||
|
|
||||||
#endif /* __FU_THUNDERBOLT_KNOWN_DEVICES_H__ */
|
|
@ -1,5 +1,9 @@
|
|||||||
cargs = ['-DG_LOG_DOMAIN="FuPluginThunderbolt"']
|
cargs = ['-DG_LOG_DOMAIN="FuPluginThunderbolt"']
|
||||||
|
|
||||||
|
install_data(['thunderbolt.quirk'],
|
||||||
|
install_dir: join_paths(datadir, 'fwupd', 'quirks.d')
|
||||||
|
)
|
||||||
|
|
||||||
fu_plugin_thunderbolt = shared_module('fu_plugin_thunderbolt',
|
fu_plugin_thunderbolt = shared_module('fu_plugin_thunderbolt',
|
||||||
sources : [
|
sources : [
|
||||||
'fu-plugin-thunderbolt.c',
|
'fu-plugin-thunderbolt.c',
|
||||||
|
9
plugins/thunderbolt/thunderbolt.quirk
Normal file
9
plugins/thunderbolt/thunderbolt.quirk
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# Dell TB16/TB18 cable
|
||||||
|
[Guid=TBT-00d4b051]
|
||||||
|
Plugin = thunderbolt
|
||||||
|
ParentGuid = e7ca1f36-bf73-4574-afe6-a4ccacabf479
|
||||||
|
|
||||||
|
# Dell TB16/TB18 dock
|
||||||
|
[Guid=TBT-00d4b054]
|
||||||
|
Plugin = thunderbolt
|
||||||
|
ParentGuid = e7ca1f36-bf73-4574-afe6-a4ccacabf479
|
Loading…
Reference in New Issue
Block a user