Implement discover() methods for upeke2 and upeksonly

upeksonly handles revision 1 devices, upeke2 revision 2 devices.

https://bugzilla.redhat.com/show_bug.cgi?id=504399
This commit is contained in:
Bastien Nocera 2010-08-17 23:41:23 +01:00
parent df4a6f53d2
commit 73561989dd
2 changed files with 14 additions and 1 deletions

View file

@ -846,7 +846,10 @@ static struct fpi_ssm *deinitsm_new(struct fp_dev *dev)
static int discover(struct libusb_device_descriptor *dsc, uint32_t *devtype)
{
/* FIXME: Detect whether dsc represents a device that we can handle */
/* Revision 2 is what we're interested in */
if (dsc->bcdDevice == 2)
return 1;
return 0;
}

View file

@ -1011,6 +1011,15 @@ static void dev_deinit(struct fp_img_dev *dev)
fpi_imgdev_close_complete(dev);
}
static int dev_discover(struct libusb_device_descriptor *dsc, uint32_t *devtype)
{
/* Revision 1 is what we're interested in */
if (dsc->bcdDevice == 1)
return 1;
return 0;
}
static const struct usb_id id_table[] = {
{ .vendor = 0x147e, .product = 0x2016 },
{ 0, 0, 0, },
@ -1023,6 +1032,7 @@ struct fp_img_driver upeksonly_driver = {
.full_name = "UPEK TouchStrip Sensor-Only",
.id_table = id_table,
.scan_type = FP_SCAN_TYPE_SWIPE,
.discover = dev_discover,
},
.flags = 0,
.img_width = IMG_WIDTH,