Commit Graph

38 Commits

Author SHA1 Message Date
David Chiu
98328679ab synaptics-rmi: Force the hardware into IEP mode as required 2021-03-22 07:51:06 +00:00
David Chiu
5abbb85e58 synaptics-rmi: Fix firmware update of pointing device on Lenovo ThinkPad Nano 2021-03-03 16:07:05 +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
blueue
03ed377dc6
Add a function to access private member variable to let it be modified (#2947)
* Add a function to access private member variable to let it be modified in ps2 flow.
2021-02-26 07:57:08 +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
b1e4a23597 synaptics-rmi: Read from the device in a more safe way 2021-02-10 16:29:57 +00:00
Richard Hughes
70ded56f8a synaptics-rmi: Add some support for PS2 devices
With much help from David Chiu <david.chiu@tw.synaptics.com>, many thanks.
2021-01-18 21:18:02 +00:00
Richard Hughes
a5deffb184 synaptics-rmi: Allow the device to enter a firmware mode that allows programming 2021-01-18 21:18:02 +00:00
Richard Hughes
1974adaa04 synaptics-rmi: Query the build ID and ProjectID to work around a HW bug
The build ID is set and the product ID is parsed in a different way for a PS/2 device.
2021-01-18 21:18:02 +00:00
Richard Hughes
8b1ca08332 synaptics-rmi: Write bus select zero when detaching
This has no effect for HID devices.
2021-01-18 21:18:02 +00:00
Richard Hughes
a0dd0e2be2 synaptics-rmi: Split out the HID specific parts to FuSynapticsRmiDevice 2021-01-18 21:18:02 +00:00
Richard Hughes
edc0c08065 synaptics-rmi: Support parsing and writing signed firmware
Validate the firmware signature if provided
2021-01-18 21:18:02 +00:00
Richard Hughes
643d7b16b1 synaptics-rmi: Do not assign the class vfuncs during setup
We fixed this problem in logitech-hidpp and this plugin will suffer the same bug.
2021-01-18 21:18:02 +00:00
Richard Hughes
a2798213ee synaptics-rmi: Do not set the page to the existing value 2021-01-18 21:18:02 +00:00
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
Richard Hughes
b7ca257c6d synaptics-rmi: Don't crash if calling ->to_string() before ->setup() 2020-12-01 14:15:33 +00:00
Richard Hughes
58993ac005 trivial: Fix some error prefixes 2020-11-06 09:57:03 +00:00
Richard Hughes
9a07407401 Use the FuUdevDevice ->to_string() output
Print the sysfs path for devices deriving from FuUdevDevice, which also allows
us to use FU_UDEV_DEVICE_DEBUG without monkey-patching the plugins that also
define a device_class->to_string() vfunc.
2020-09-03 16:50:41 +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
21eaeeff8d trivial: Fix up some typos found using codespell 2020-01-14 12:25:41 +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
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
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
d6fc172ec9 synaptics-rmi: Check the correct register when querying bootloader mode 2019-10-07 11:50:49 +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
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
63aa6759f0 Add a plugin to update Synaptics RMI4 devices 2019-10-02 10:45:13 +01:00