Commit Graph

42 Commits

Author SHA1 Message Date
Richard Hughes
5b24547197 synaptics-rmi: Essentially blacklist Dell K12A
Fixes https://github.com/fwupd/fwupd/issues/2052
2020-05-14 13:14:39 +01:00
Richard Hughes
a8c6c02459 Do not conditionalize attach() and detach() on IS_BOOTLOADER
This is nice in theory, until you need to look at the bootloader status of the
parent, or of a different device entirely. Handle this in plugins for the few
cases we care about and stop setting or clearing IS_BOOTLOADER manually just to
get the vfuncs to be run.

Note: I do not think we want to use cleanup() for attaching devices not in
bootloader states -- as cleanup is only run at the end of the composite update.
2020-04-09 09:55:30 +01:00
Richard Hughes
f50ff2c27e Decouple the version format from the version itself
If we say that the version format should be the same for the `version_lowest`
and the `version_bootloader` then it does not always make sense to set it at
the same time.

Moving the `version_format` to a standalone first-class property also means it
can be typically be set in the custom device `_init()` function, which means we
don't need to worry about *changing* ther version format as set by the USB and
UDev superclass helpers.
2020-02-25 14:00:09 +00:00
Richard Hughes
04fde48e9a synaptics-rmi: Add a missing error enum value
This was spotted whilst fixing the last bug...
2020-02-07 15:16:39 +00:00
Richard Hughes
9baaacc099 synaptics-rmi: Correctly identify a checksum failure
The typo was spotted by Coverity.
2020-02-07 15:16:39 +00:00
Richard Hughes
2f85c24363 synaptics-rmi: Fix Coverity issue that is impossible to hit in reality
The guint16 was promoted to (signed) int for the multiplication, which meant
that the highest address possible was 0x7FFFFFFF not 0xFFFFFFFF. Which doesn't
really matter in reality, as all addresses are much smaller than that now.
2020-02-07 15:16:39 +00:00
Richard Hughes
47862828e1 trivial: Allow setting an ID of NULL for the FuFirmwareImage
There's no reason to prevent NULL, and doing so means the caller has to check
before setting the value. Only one subclassed type was actually doing this...
2020-01-16 11:24:55 -06:00
Richard Hughes
21eaeeff8d trivial: Fix up some typos found using codespell 2020-01-14 12:25:41 +00:00
Mario Limonciello
fc326d9ad4 trivial: synaptics-rmi: hardcode Vendor string
Right now vendor string is detected by walking up the udev chain
until a vendor is found.  On some systems this is finding incorrect
data such as `Intel Corporation` for the vendor on the touchpad.

As the plugin only supports Synaptics devices, Correct it by hardcoding
vendor to `Synaptics`.

Sample output:
```
└─Touchpad:
      Device ID:           b26933c085b020ecf84c490812458523aee710ac
      Current version:     1.5.2767034
      Bootloader Version:  54.0
      Vendor:              Synaptics (HIDRAW:0x06CB)
      GUIDs:               f4384034-9243-5334-8075-a534be913e46 ← HIDRAW\VEN_06CB&DEV_76AF&REV_00
                           424bd00e-9789-5cdf-a12a-3c81bc4676d6 ← HIDRAW\VEN_06CB&DEV_76AF
                           140f4458-951b-5bb9-85e2-879bd5b02615 ← SYNAPTICS_RMI\TM3038-003
                           b29d3c85-cd0e-503e-9c7e-f6731c1eaf2d ← SYNAPTICS_RMI\TM3038
      Device Flags:        • Internal device
                           • Updatable
```
2019-12-12 09:57:47 -06:00
Richard Hughes
0cc22a5ff6 trivial: Document the use of vendor-id in each plugin 2019-12-11 18:10:44 +00:00
Mario Limonciello
6b0e66354b Convert libfwupdprivate to a shared library libfwupdplugin 2019-11-27 11:32:43 +00:00
Richard Hughes
28e8b953d0 Revert "synaptics-rmi: Use the build ID as the version number to match the vendor tool"
This reverts commit 28ab968cbf as Synaptics
deviced that vmajor and vminor would actually be useful.
2019-11-26 08:25:45 +00:00
Richard Hughes
56ac823af9 Set the protocol per-device not per-plugin
Some plugins have devices with more than one protocol. Logically the protocol
belongs to the device, not the plugin, and in the future we could use this to
further check firmware that's about to be deployed.

This is also not exported into libfwupd (yet?) as it's remains a debug-feature
only -- protocols are not actually required for devices to be added.
2019-11-25 18:01:54 +00:00
Richard Hughes
28ab968cbf synaptics-rmi: Use the build ID as the version number to match the vendor tool 2019-11-25 17:44:25 +00:00
Mario Limonciello
6abe21efbd trivial: stop including fu-hash.h as part of fu-plugin-vfuncs.h
Explicitly include it in all "in-tree" plugins.

If headers are exported out of tree we will likely explicitly not
export this header.
2019-11-25 09:29:46 +00:00
Mario Limonciello
79ac523224 synaptics-rmi: correct an error cleaning up on probe
```
failed to close device: Bad file descriptor
```

fu-udev-device will open a locker automatically now.
However synaptics-rmi closes the file descriptor on it's own with `g_clear_object`.

So destroy the fd in synaptics-rmi.
2019-11-06 08:21:51 -06:00
Richard Hughes
02792c0ba3 trivial: Fix up some typos from codespell 2019-11-01 14:21:20 +00:00
Richard Hughes
bf00080d3f Move the file descriptor lifecycle into FuUdevDevice
This also means we can provide common 'safe' versions for plugins to use.
This makes a lot of plugins much simpler and we can delete a lot of code.
2019-10-31 09:21:35 -05:00
Richard Hughes
95c98a95b6 Allow fwupdtool to dump details of common firmware formats
To do this, the plugins have to register the GType(s) they are using for
firmware, along with a short 'id' that can be used in CLI scripts.
2019-10-22 12:36:15 -05:00
Richard Hughes
8653e70480 trivial: Remove G_BEGIN_DECLS from all private headers 2019-10-09 20:02:16 +01:00
Richard Hughes
731875af86 Remove FU_PLUGIN_RULE_REQUIRES_QUIRK as all the plugins now use it 2019-10-09 20:02:16 +01:00
Richard Hughes
d8a8d5e776 Set all FuUdevDevice plugins to use FU_QUIRKS_PLUGIN
This speeds up startup as we're only calling fu_plugin_udev_device_added() on
plugins that can actually handle the device.
2019-10-09 20:02:16 +01:00
Richard Hughes
8523ebebf2 synaptics-rmi: Also add the product ID as a GUID without the minor version
Firmware may be suitable for all products that match the 'major ID' and so we
should provide an extra GUID to use in this case.
2019-10-09 14:18:10 +01:00
Richard Hughes
83fe59629d synaptics-rmi: Correctly set the payload length rather than hardcoding it 2019-10-08 12:32:09 +01:00
Richard Hughes
9a5f076b6b synaptics-rmi: Write the core config correctly 2019-10-08 12:32:09 +01:00
Richard Hughes
d0fbc34704 synaptics-rmi: Decode BL7 status failures as actual errors 2019-10-08 12:32:09 +01:00
Richard Hughes
5b03566465 synaptics-rmi: Add some trivial debugging to help debug a write problem 2019-10-08 12:32:09 +01:00
Richard Hughes
d6fc172ec9 synaptics-rmi: Check the correct register when querying bootloader mode 2019-10-07 11:50:49 +01:00
Richard Hughes
2524c3fd79 synaptics-rmi: Copy the behavior of rmi4utils for BL7 detach 2019-10-05 09:07:22 +01:00
Richard Hughes
1c53c0eb86 synaptics-rmi: Simplify fu_synaptics_rmi_device_read()
We don't need a double loop here as we only ever require one READ_ADDR request.
2019-10-05 09:07:22 +01:00
Richard Hughes
08ddb2b7c4 synaptics-rmi: Set the version after ->setup has run
The build_id might be overwritten in the BL-specific setup.
2019-10-05 09:07:22 +01:00
Richard Hughes
339f823ee2 synaptics-rmi: Use the correct mask when getting the bootloader mode on BL7 2019-10-05 09:07:22 +01:00
Richard Hughes
3b8a2ea47f syanptics-rmi: The build_id is 3 bytes long, not 2 2019-10-04 17:08:21 +01:00
Richard Hughes
007140bd78 synaptics-rmi: Read the config partition the same as rmi4utils 2019-10-04 15:47:16 +01:00
Richard Hughes
4b30380e78 Provide a default implementation of common FuDevice actions
This reduces the amount of boilerplate in each plugin.

    32 files changed, 156 insertions(+), 584 deletions(-)
2019-10-04 14:57:32 +01:00
Richard Hughes
0e17281997 synaptics-rmi: Add some debugging for BL7 devices 2019-10-04 10:59:08 +01:00
Richard Hughes
c6cda8bc71 synaptics-rmi: Do as little as possible in device setup
This reduces the setup time by another 70ms and also makes the plugin simpler.
2019-10-03 15:14:10 +01:00
Richard Hughes
b8e97e56c3 synaptics-rmi: Speed up reading the PDT from 900ms to 30ms
Don't continue to scan pages after the last function.
2019-10-03 15:14:10 +01:00
Richard Hughes
eeb6c22c1e synaptics-rmi: Ignore the ATTN reports from the hardware when reading DATA
Fixes https://github.com/fwupd/fwupd/issues/1427
2019-10-03 13:10:58 +01:00
Richard Hughes
9f7a3364ae synaptics-rmi: Move the fuzzing instructions to the toplevel README 2019-10-02 16:28:28 +01:00
Richard Hughes
e87abd81a2 synaptics-rmi: Fix the packing of the partition table
The data was part of the union, not the struct. It's also binary format and
thus needs to be packed.
2019-10-02 12:28:06 +01:00
Richard Hughes
63aa6759f0 Add a plugin to update Synaptics RMI4 devices 2019-10-02 10:45:13 +01:00