Commit Graph

18 Commits

Author SHA1 Message Date
Mario Limonciello
55de39c077 trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
Richard Hughes
d4bd5cca5a Standardize some of the device summary text
This is supposed to be 'Sentence case' with no trailing fullstop.
2021-07-09 07:07:07 +01:00
Mario Limonciello
73cdf067ed trivial: fixup includes for a variety of plugins 2021-06-14 10:12:45 +01:00
Richard Hughes
1981c63d58 Remove FuFirmwareImage and just use FuFirmware instead
This allows us to 'nest' firmware formats, and removes a ton of duplication.

The aim here is to deprecate FuFirmwareImage -- it's almost always acting
as a 'child' FuFirmware instance, and even copies most of the vfuncs to allow
custom types. If I'm struggling to work out what should be a FuFirmware and
what should be a FuFirmwareImage then a plugin author has no hope.

For simple payloads we were adding bytes into an image and then the image into
a firmware. This gets really messy when most plugins are treating the FuFirmware
*as* the binary firmware file.

The GBytes saved in the FuFirmware would be considered the payload with the
aim of not using FuFirmwareImage in the single-image case.
2021-03-09 21:14:12 +00:00
Richard Hughes
2659ba596e elantp: Require a reboot for i2c recovery write
ChromeOS reboots the i2c adapter but it's probably safer to just reboot:
648c32ee9b/etphidiap/scripts/chromeos-etphidiap-touch-firmware-update-legacy.sh (198)
2021-03-03 15:56:18 +00:00
Richard Hughes
0772c46e9f elantp: Only call ->detach() when writing a firmware blob
The detach is actually destructive (!) and cannot be reattached unless actually
writing a new firmware image.
2021-03-03 15:56:18 +00:00
Richard Hughes
6db5522eaf elantp: Fix a regression when recovering the device in i2c mode
This was broken in 6188be1dd4, again mea culpa.
2021-03-03 13:24:52 +00:00
Richard Hughes
b3f9841924 Support more than one protocol for a given device
Devices may want to support more than one protocol, and for some devices
(e.g. Unifying peripherals stuck in bootloader mode) you might not even be able
to query for the correct protocol anyway.
2021-03-01 16:14:36 +00:00
Richard Hughes
2e1245728f Call the superclass directly from subclassed devices
This allows a device subclass to call the parent method after doing an initial
action, or even deliberately not call the *generic* parent method at all.

It also simplifies the plugins; you no longer have to remember what the plugin
is deriving from and accidentally clobber the wrong superclass method.
2021-02-18 16:18:34 +00:00
Richard Hughes
6188be1dd4 elantp: Read from the device in a more safe way 2021-02-10 16:29:57 +00:00
Richard Hughes
d99f86023f trivial: Add getters to FuChunk
At the moment FuChunks are sometimes mutable, and sometimes immutable, and it's
all a bit too low level for comfort.

Before we can do any kind of optimisation or verification we need plugins to
stop reading directly from the C structure. The aim here is to make FuChunk
optionally mutable without making assumptions about the memory model, and also
to be able to introspect it for the docs.
2021-01-28 16:42:54 +00:00
Richard Hughes
eddaed0c11 Allow specifying more than one VendorID for a device
Asking the user for the UID mapping isn't working very well, as it requires lots
of manual handholding. It also doesn't work very well when the device vendor
does not actually have a PCI ID or if the vendor has split into two entities.

Just use the OUI address as an additional VendorID and match any of the device
IDs against any of the metadata-supplied values.
2021-01-04 22:30:20 +00:00
Jingle Wu
3460e0a5ed elantp: Modify the correct input for the iap reg.
1. Modify the correct input for the iap reg (byte -> word).
2. Add new HWID for ThinkPad X1 Carbon Gen 9.
2020-10-23 08:56:48 +01:00
Mario Limonciello
b15f4ab4b1 elantp: Trivial whitespace fixes 2020-10-21 16:54:13 +01:00
Richard Hughes
0357881c42 elantp: Implement the ->reload action to get the new firmware version 2020-10-16 10:06:45 +01:00
Richard Hughes
1f6a1520fb elantp: Fix three impossible to hit bugs spotted by Coverity
If somehow chk->data_sz is bigger than blksz then we would write past the end
of the allocated buffer.
2020-10-14 15:11:31 +01:00
jingle.wu
4f2cb4598c elantp: Modify firmware update flow
1. Check FW in bootloader mode, need send reset command to firmware.
 2. IAP Type register parameter is defind as how many bytes/page to be written.
 3. Write IAP Type function in detach function.
 4. Remove IAP Type function in setup function.
 5. Modify page format for i2c-device
 6. Modify firmware bin file size.
 7. Modify firmware update flow when the firmware in bootloader mode.
 8. Add another instance ID which corresponds to the IC type & module ID
   * `ELANTP\ICTYPE_09&MOD_1234`
 9. Add Lenovo ThinkPad X1 nano gen1 to elantp.quick
10. Add recovry device - lenovo thinkpad x1 nanao gen 1
11. Add elan touchpad device - vid:04f3 pid:314f
12. Set the firmware version when the firmware is incorrect.
2020-10-08 10:43:06 -05:00
Richard Hughes
ad32b0c17e elaptp: Allow recovery when the HID firmware fails to load 2020-09-14 16:19:45 +01:00