fwupd/plugins/vli/fu-vli-pd-common.c
Richard Hughes 5c9b1fcc81 Only include the start year in the copyright header
The end year is legally and functionally redundant, and more importantly causes
cherry-pick conflicts when trying to maintain old branches. Use git for history.
2021-01-07 14:48:16 +00:00

30 lines
756 B
C

/*
* Copyright (C) 2017 VIA Corporation
* Copyright (C) 2019 Richard Hughes <richard@hughsie.com>
*
* SPDX-License-Identifier: LGPL-2.1+
*/
#include "config.h"
#include "fu-vli-pd-common.h"
FuVliDeviceKind
fu_vli_pd_common_guess_device_kind (guint32 fwver)
{
guint32 tmp = (fwver & 0x0f000000) >> 24;
if (tmp == 0x01 || tmp == 0x02 || tmp == 0x03)
return FU_VLI_DEVICE_KIND_VL100;
if (tmp == 0x04 || tmp == 0x05 || tmp == 0x06)
return FU_VLI_DEVICE_KIND_VL101;
if (tmp == 0x07 || tmp == 0x08)
return FU_VLI_DEVICE_KIND_VL102;
if (tmp == 0x09 || tmp == 0x0a)
return FU_VLI_DEVICE_KIND_VL103;
if (tmp == 0x0b)
return FU_VLI_DEVICE_KIND_VL104;
if (tmp == 0x0c)
return FU_VLI_DEVICE_KIND_VL105;
return FU_VLI_DEVICE_KIND_UNKNOWN;
}