mirror of
https://git.proxmox.com/git/fwupd
synced 2025-07-26 04:46:55 +00:00
add FPC lenfy device support
This commit is contained in:
parent
5fcfe7f0fc
commit
31f481518b
@ -6,4 +6,4 @@ Plugin = fpc
|
|||||||
Flags = moh-device,rts
|
Flags = moh-device,rts
|
||||||
[USB\VID_10A5&PID_9800]
|
[USB\VID_10A5&PID_9800]
|
||||||
Plugin = fpc
|
Plugin = fpc
|
||||||
Flags = moh-device,rts
|
Flags = moh-device,rts,lenfy
|
||||||
|
@ -21,8 +21,9 @@
|
|||||||
#define FPC_CMD_DFU_CLRSTATUS 0x04
|
#define FPC_CMD_DFU_CLRSTATUS 0x04
|
||||||
#define FPC_CMD_DFU_GET_FW_STATUS 0x09
|
#define FPC_CMD_DFU_GET_FW_STATUS 0x09
|
||||||
|
|
||||||
#define FPC_CMD_BOOT0 0x04
|
#define FPC_CMD_BOOT0 0x04
|
||||||
#define FPC_CMD_GET_STATE 0x0B
|
#define FPC_CMD_GET_STATE 0x0B
|
||||||
|
#define FPC_CMD_GET_STATE_LENFY 0x50
|
||||||
|
|
||||||
#define FPC_DEVICE_MOC_STATE_LEN 68
|
#define FPC_DEVICE_MOC_STATE_LEN 68
|
||||||
#define FPC_DEVICE_MOH_STATE_LEN 72
|
#define FPC_DEVICE_MOH_STATE_LEN 72
|
||||||
@ -59,6 +60,14 @@
|
|||||||
|
|
||||||
#define FU_FPC_DEVICE_FLAG_RTS_DEVICE (1 << 2)
|
#define FU_FPC_DEVICE_FLAG_RTS_DEVICE (1 << 2)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FU_FPC_DEVICE_FLAG_LENFY_DEVICE:
|
||||||
|
*
|
||||||
|
* Device is a LENFY MOH device
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define FU_FPC_DEVICE_FLAG_LENFY_DEVICE (1 << 3)
|
||||||
|
|
||||||
struct _FuFpcDevice {
|
struct _FuFpcDevice {
|
||||||
FuUsbDevice parent_instance;
|
FuUsbDevice parent_instance;
|
||||||
guint32 max_block_size;
|
guint32 max_block_size;
|
||||||
@ -210,6 +219,7 @@ fu_fpc_device_setup_version(FuFpcDevice *self, GError **error)
|
|||||||
FuEndianType endian_type = G_LITTLE_ENDIAN;
|
FuEndianType endian_type = G_LITTLE_ENDIAN;
|
||||||
g_autofree guint8 *data = NULL;
|
g_autofree guint8 *data = NULL;
|
||||||
g_autofree gchar *str_version = NULL;
|
g_autofree gchar *str_version = NULL;
|
||||||
|
guint32 cmd_id = FPC_CMD_GET_STATE;
|
||||||
|
|
||||||
if (fu_device_has_private_flag(FU_DEVICE(self), FU_FPC_DEVICE_FLAG_RTS_DEVICE))
|
if (fu_device_has_private_flag(FU_DEVICE(self), FU_FPC_DEVICE_FLAG_RTS_DEVICE))
|
||||||
endian_type = G_BIG_ENDIAN;
|
endian_type = G_BIG_ENDIAN;
|
||||||
@ -222,7 +232,9 @@ fu_fpc_device_setup_version(FuFpcDevice *self, GError **error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
data = g_malloc0(data_len);
|
data = g_malloc0(data_len);
|
||||||
if (!fu_fpc_device_fw_cmd(self, FPC_CMD_GET_STATE, data, data_len, TRUE, error))
|
if (fu_device_has_private_flag(FU_DEVICE(self), FU_FPC_DEVICE_FLAG_LENFY_DEVICE))
|
||||||
|
cmd_id = FPC_CMD_GET_STATE_LENFY;
|
||||||
|
if (!fu_fpc_device_fw_cmd(self, cmd_id, data, data_len, TRUE, error))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (!fu_memread_uint32_safe(data, data_len, 0, &version, endian_type, error))
|
if (!fu_memread_uint32_safe(data, data_len, 0, &version, endian_type, error))
|
||||||
@ -562,6 +574,7 @@ fu_fpc_device_init(FuFpcDevice *self)
|
|||||||
fu_device_register_private_flag(FU_DEVICE(self),
|
fu_device_register_private_flag(FU_DEVICE(self),
|
||||||
FU_FPC_DEVICE_FLAG_LEGACY_DFU,
|
FU_FPC_DEVICE_FLAG_LEGACY_DFU,
|
||||||
"legacy-dfu");
|
"legacy-dfu");
|
||||||
|
fu_device_register_private_flag(FU_DEVICE(self), FU_FPC_DEVICE_FLAG_LENFY_DEVICE, "lenfy");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user