Attention is currently required from: ChrisEric1 CECL, Nicholas Chin.
Thomas Heijligen has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/72057 )
Change subject: Add support for VIA VL805 USB 3 XHCI flashing ......................................................................
Patch Set 11:
(1 comment)
File vl805.c:
https://review.coreboot.org/c/flashrom/+/72057/comment/fc88988c_7078d5c6 PS3, Line 38: static struct pci_dev *dev = NULL;
Here is my broken progress: https://gist.githubusercontent. […]
Yes, you have to define an custom data struct which is passed along. Have a look at this patch https://review.coreboot.org/c/flashrom/+/73037/3/asm106x.c
In line 30 is a data structure defined. This get initialized in the init function from line 138ff, transfered to the allocated data structure and then registered in line 154 together with the spi_master. The `...spi_send_command` function has access to this data. There you've done it almost right. The data gets then passed on to all internal functions of the programmer. `asm106x_wait_ready()` in case of the link above and the `vl805_setregval()` etc functions in your case.
So they will be extended to take a `struct pci_dev*` as argument instead of using the global. It will become `static void vl805_setregval(const struct pci_dev *dev, int reg, uint32_t val)`
I hope this helps you 😊