summaryrefslogtreecommitdiffstats
path: root/usbdev.c
Commit message (Collapse)AuthorAgeFilesLines
* usbdev.c: Add missing <inttypes.h> includeEdward O'Callaghan2019-10-221-0/+1
| | | | | | | | Change-Id: Ie23612226a48d6732750f51547642da0a6257dd8 Signed-off-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/36219 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* usbdev: Only match requested USB devicesPatrick Rudolph2019-05-271-1/+1
| | | | | | | | | | | | | | Don't use a device that has the same vendor ID, but a different than requested product ID. Fixes broken dediprog detection with TOMU in use. Change-Id: I08c1c363ce2d6603e46efecc61d3910e02314fca Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/32891 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* usbdev: Refactor device discovery codeDaniel Thompson2018-08-301-58/+70
| | | | | | | | | | | | | | | | | Currently there is a lot of code shared between usb_dev_get_by_vid_pid_serial() and usb_dev_get_by_vid_pid_number(). Fix this by pulling out the conditional filtering at the heart of each loop and calling it via a function pointer. I haven't got (two) dediprog programmers to test with but I have tested both by...serial() and by...number() calls using a pair of Developerboxen and a hacked driver. Change-Id: I31ed572501e4314b9455e1b70a5e934ec96408b1 Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org> Reviewed-on: https://review.coreboot.org/27444 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* usbdev: Extract libusb1 device discovery into a separate fileDaniel Thompson2018-08-301-0/+130
Currently there is a TODO-like comment in the dediprog driver: "Might be useful for other USB devices as well". Act on this comment by collecting all the device discovery code for libusb1 devices into a separate file. Change-Id: Idfcc79371241c2c1dea97faf5e532aa971546a79 Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org> Reviewed-on: https://review.coreboot.org/27443 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>