From 73561989dd485560e4c62b46a9af31f9fce1bc4e Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Tue, 17 Aug 2010 23:41:23 +0100 Subject: [PATCH] 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 --- libfprint/drivers/upeke2.c | 5 ++++- libfprint/drivers/upeksonly.c | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/libfprint/drivers/upeke2.c b/libfprint/drivers/upeke2.c index 5c7129a..3a7c2d8 100644 --- a/libfprint/drivers/upeke2.c +++ b/libfprint/drivers/upeke2.c @@ -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; } diff --git a/libfprint/drivers/upeksonly.c b/libfprint/drivers/upeksonly.c index f41a6be..08c2ba4 100644 --- a/libfprint/drivers/upeksonly.c +++ b/libfprint/drivers/upeksonly.c @@ -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,