From a9f3771eb6ad4f9afb98d346dc6c54a1812d6e73 Mon Sep 17 00:00:00 2001 From: Steve Markgraf Date: Sun, 19 Jan 2020 16:45:20 +0100 Subject: lib: use interface 0 altsetting 1 instead of interface 1 This makes osmo-fl2k work again with Linux 5.5.0-rc6 or later, as the FL2000 shares the endpoints for interface 0 and 1, which is forbidden by the USB spec and the Kernel will not ignore this anymore. See: https://marc.info/?l=linux-usb&m=157944230213296&w=2 --- src/libosmo-fl2k.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libosmo-fl2k.c b/src/libosmo-fl2k.c index 7e1a008..7478893 100644 --- a/src/libosmo-fl2k.c +++ b/src/libosmo-fl2k.c @@ -2,7 +2,7 @@ * osmo-fl2k, turns FL2000-based USB 3.0 to VGA adapters into * low cost DACs * - * Copyright (C) 2016-2018 by Steve Markgraf + * Copyright (C) 2016-2020 by Steve Markgraf * * SPDX-License-Identifier: GPL-2.0+ * @@ -444,10 +444,10 @@ int fl2k_open(fl2k_dev_t **out_dev, uint32_t index) fprintf(stderr, "usb_claim_interface 0 error %d\n", r); goto err; } - r = libusb_claim_interface(dev->devh, 1); + r = libusb_set_interface_alt_setting(dev->devh, 0, 1); if (r < 0) { - fprintf(stderr, "usb_claim_interface 1 error %d\n", r); + fprintf(stderr, "Error enabling IF 0 altsetting 1: %d\n", r); goto err; } -- cgit v1.2.3