mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-16 17:22:01 +00:00
elantp: Only match the I2C adaptor on the correct laptop model
I2C doesn't have any specification for what is a probe and what is a more destructive action. Sending tx_buf out on the i2c bus to a generic address might not be safe in all cases. To prevent this, use a HWID to check the machine DMI value during device creation before ->probe() or ->setup() is called on the device.
This commit is contained in:
parent
ad32b0c17e
commit
32173430d4
@ -21,7 +21,6 @@ void fu_device_set_order (FuDevice *self,
|
|||||||
gint order);
|
gint order);
|
||||||
void fu_device_set_alternate (FuDevice *self,
|
void fu_device_set_alternate (FuDevice *self,
|
||||||
FuDevice *alternate);
|
FuDevice *alternate);
|
||||||
GType fu_device_get_specialized_gtype (FuDevice *self);
|
|
||||||
gboolean fu_device_ensure_id (FuDevice *self,
|
gboolean fu_device_ensure_id (FuDevice *self,
|
||||||
GError **error);
|
GError **error);
|
||||||
void fu_device_incorporate_from_component (FuDevice *device,
|
void fu_device_incorporate_from_component (FuDevice *device,
|
||||||
|
@ -267,6 +267,7 @@ void fu_device_set_quirks (FuDevice *self,
|
|||||||
FuQuirks *quirks);
|
FuQuirks *quirks);
|
||||||
FuQuirks *fu_device_get_quirks (FuDevice *self);
|
FuQuirks *fu_device_get_quirks (FuDevice *self);
|
||||||
FwupdRelease *fu_device_get_release_default (FuDevice *self);
|
FwupdRelease *fu_device_get_release_default (FuDevice *self);
|
||||||
|
GType fu_device_get_specialized_gtype (FuDevice *self);
|
||||||
gboolean fu_device_write_firmware (FuDevice *self,
|
gboolean fu_device_write_firmware (FuDevice *self,
|
||||||
GBytes *fw,
|
GBytes *fw,
|
||||||
FwupdInstallFlags flags,
|
FwupdInstallFlags flags,
|
||||||
|
@ -6,6 +6,10 @@ GType = FuElantpHidDevice
|
|||||||
Plugin = elantp
|
Plugin = elantp
|
||||||
GType = FuElantpHidDevice
|
GType = FuElantpHidDevice
|
||||||
|
|
||||||
|
# Acer Aspire V3-372T
|
||||||
|
[HwId=513cde3d-d939-59bd-a634-5c1645ebb93b]
|
||||||
|
Flags = elantp-recovery
|
||||||
|
|
||||||
# recovery device
|
# recovery device
|
||||||
[DeviceInstanceId=I2C\NAME_Synopsys-DesignWare-I2C-adapter]
|
[DeviceInstanceId=I2C\NAME_Synopsys-DesignWare-I2C-adapter]
|
||||||
Plugin = elantp
|
Plugin = elantp
|
||||||
|
@ -13,6 +13,20 @@
|
|||||||
#include "fu-elantp-hid-device.h"
|
#include "fu-elantp-hid-device.h"
|
||||||
#include "fu-elantp-i2c-device.h"
|
#include "fu-elantp-i2c-device.h"
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
fu_plugin_device_created (FuPlugin *plugin, FuDevice *dev, GError **error)
|
||||||
|
{
|
||||||
|
if (fu_device_get_specialized_gtype (dev) == FU_TYPE_ELANTP_I2C_DEVICE &&
|
||||||
|
!fu_plugin_has_custom_flag (plugin, "elantp-recovery")) {
|
||||||
|
g_set_error_literal (error,
|
||||||
|
FWUPD_ERROR,
|
||||||
|
FWUPD_ERROR_NOT_SUPPORTED,
|
||||||
|
"not required");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
fu_plugin_init (FuPlugin *plugin)
|
fu_plugin_init (FuPlugin *plugin)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user