Rework "discover" code for drivers

Check all the drivers for one that'll drive our device in
question, and prefer ones that have a discover() method that runs
successfully to a driver without such a method.

This allow drivers to both reject devices (if 2 drivers handle
the same USB IDs), or a single driver to handle variants of the
same device (through the devtype out value of the discover method).
This commit is contained in:
Bastien Nocera
2010-08-17 23:14:18 +01:00
parent 48af46a2c5
commit df4a6f53d2
3 changed files with 55 additions and 20 deletions

View File

@@ -204,7 +204,7 @@ struct fp_driver {
void *priv;
/* Device operations */
int (*discover)(const struct usb_id *usb_id, uint32_t *devtype);
int (*discover)(struct libusb_device_descriptor *dsc, uint32_t *devtype);
int (*open)(struct fp_dev *dev, unsigned long driver_data);
void (*close)(struct fp_dev *dev);
int (*enroll_start)(struct fp_dev *dev);