Commit Graph

10 Commits

Author SHA1 Message Date
Richard Hughes
431dbee65a Lower the GUsb dep to allow compiling on RHEL-8
This is something that I keep being asked to do...
2021-09-24 06:50:59 -05:00
Richard Hughes
40cd18fa97 Allow using a per-device global percentage completion
It's actually quite hard to build a front-end for fwupd at the moment
as you're never sure when the progress bar is going to zip back to 0%
and start all over again. Some plugins go 0..100% for write, others
go 0..100% for erase, then again for write, then *again* for verify.

By creating a helper object we can easily split up the progress of the
specific task, e.g. write_firmware().

We can encode at the plugin level "the erase takes 50% of the time, the
write takes 40% and the read takes 10%". This means we can have a
progressbar which goes up just once at a consistent speed.
2021-09-13 14:28:15 +01:00
Mario Limonciello
55de39c077 trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
Mario Limonciello
798d1ed3ee trivial: update markdown for pre-commit style 2021-07-18 14:42:47 -05:00
Richard Hughes
bf72d393fd Split up FuUsbDevice into ->open() and ->setup()
Before this change calling FuUsbDevice->open() opened the device, and
also unconditionally added various GUIDs and InstanceIDs which we
normally do in setup.
Then fu_device_setup() would call the FuSubclass->setup() vfunc which
would have no way of either opting out of the FuUsbDevice->setup()-like
behaviour, or controlling if the parent class ->setup is run before or
after the subclass setup.

Split up FuUsbDevice->open() into clear ->open() and ->setup() phases
and add the parent class calls where appropriate.

This means that ->setup() now behaves the same as all the other vfuncs.
2021-06-17 16:21:41 +01:00
Mario Limonciello
73cdf067ed trivial: fixup includes for a variety of plugins 2021-06-14 10:12:45 +01:00
Lars Wendler
2427b87379 analogix plugin requires gusb
Otherwise the following build error happens:

  ../fwupd-1.6.0/plugins/analogix/fu-analogix-device.c:54:10: error: ‘G_USB_DEVICE_DIRECTION_HOST_TO_DEVICE’ undeclared (first use in this function)
     54 |          G_USB_DEVICE_DIRECTION_HOST_TO_DEVICE,
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../fwupd-1.6.0/plugins/analogix/fu-analogix-device.c:54:10: note: each undeclared identifier is reported only once for each function it appears in
  ../fwupd-1.6.0/plugins/analogix/fu-analogix-device.c:55:10: error: ‘G_USB_DEVICE_REQUEST_TYPE_VENDOR’ undeclared (first use in this function)
     55 |          G_USB_DEVICE_REQUEST_TYPE_VENDOR,
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../fwupd-1.6.0/plugins/analogix/fu-analogix-device.c:56:10: error: ‘G_USB_DEVICE_RECIPIENT_DEVICE’ undeclared (first use in this function)
     56 |          G_USB_DEVICE_RECIPIENT_DEVICE,
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../fwupd-1.6.0/plugins/analogix/fu-analogix-device.c: In function ‘fu_analogix_device_receive’:
  ../fwupd-1.6.0/plugins/analogix/fu-analogix-device.c:96:10: error: ‘G_USB_DEVICE_DIRECTION_DEVICE_TO_HOST’ undeclared (first use in this function)
     96 |          G_USB_DEVICE_DIRECTION_DEVICE_TO_HOST,
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../fwupd-1.6.0/plugins/analogix/fu-analogix-device.c:97:10: error: ‘G_USB_DEVICE_REQUEST_TYPE_VENDOR’ undeclared (first use in this function)
     97 |          G_USB_DEVICE_REQUEST_TYPE_VENDOR,
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../fwupd-1.6.0/plugins/analogix/fu-analogix-device.c:98:10: error: ‘G_USB_DEVICE_RECIPIENT_DEVICE’ undeclared (first use in this function)
     98 |          G_USB_DEVICE_RECIPIENT_DEVICE,
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  and more...
2021-05-20 10:18:05 +01:00
Richard Hughes
faa35e430b Show a warning if the device has no GType and the plugin has no default
This also renames a symbol to make it clear that you can call it more than once.

Fixes https://github.com/fwupd/fwupd/issues/3148
2021-04-15 16:52:56 +01:00
Analogix
b518c536c7
analogic: Fix various trivial problems to enable successful device update
* Changed CUSTOM Define firmware size. 
* Extended time for transferring data time out.

Co-authored-by: xtcui <xtcui@analogix.corp-partner.google.com>
2021-04-13 08:39:18 +01:00
xtcui
0f7f7f2cb5 Add support for some Analogix hardware
With much help from:

 * Ricardo Cañuelo <ricardo.canuelo@collabora.com>
 * Richard Hughes <richard@hughsie.com>
2021-04-12 11:00:54 +01:00