From c81854ca21a4c158a057b7c0d47c704b717fc8ca Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 14 Mar 2020 17:23:52 -0700 Subject: android/usb: add helper to recognize chipsets known to us This will allow us to know when we can guess the driver. Signed-off-by: Dirk Hohndel --- core/serial_usb_android.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/core/serial_usb_android.cpp b/core/serial_usb_android.cpp index 764977f12..a4f060183 100644 --- a/core/serial_usb_android.cpp +++ b/core/serial_usb_android.cpp @@ -233,6 +233,21 @@ static void guessVendorProduct(android_usb_serial_device_descriptor &descriptor) } } +static bool knownChipset(int vid, int pid) +{ + if ((vid == 0x0403 && (pid == 0x6001 || pid == 0x6010 || pid == 0x6011 || pid == 0x6014 || pid == 0x6015 || pid == 0xf460 || pid == 0xf680)) || + (vid == 0xffff && pid == 0x0005) || + (vid == 0x10c4 && (pid == 0xea60 || pid == 0xea70 || pid == 0xea71 || pid == 0xea80)) || + (vid == 0x067b && pid == 0x2303) || + (vid == 0x04b8 && (pid == 0x0521 || pid == 0x0522)) || + (vid == 0x1a86 && pid == 0x7523) || + (vid == 0x0d28 && pid == 0x0204)) + return true; + + // not a known chipset + return false; +} + android_usb_serial_device_descriptor getDescriptor(QAndroidJniObject usbDevice) { QAndroidJniEnvironment env; -- cgit v1.2.3-70-g09d2