diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2020-03-14 17:23:52 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-03-16 07:58:20 -0700 |
commit | c81854ca21a4c158a057b7c0d47c704b717fc8ca (patch) | |
tree | 6c9138705ee3931e300d67f4f701e33f5bd7efab | |
parent | c2077992ff6e896e6b68df3d8b539a912b0fc325 (diff) | |
download | subsurface-c81854ca21a4c158a057b7c0d47c704b717fc8ca.tar.gz |
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 <dirk@hohndel.org>
-rw-r--r-- | core/serial_usb_android.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
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; |