[PATCH] Alternate setting 1 must be selected for interface 0 on the model that I received. Else the rest is identical.

Hans Petter Selasky
2011-05-23T14:38:51Z

[-- Attachment #1: Type: text/plain, Size: 6 bytes --]

--HPS

[-- Attachment #2: dvb-usb-0016.patch --]
[-- Type: text/x-patch, Size: 1280 bytes --]

From 3cf61d6a77b22f58471188cd0e7e3dc6c3a29b0b Mon Sep 17 00:00:00 2001
From: Hans Petter Selasky <hselasky@c2i.net>
Date: Mon, 23 May 2011 16:36:55 +0200
Subject: [PATCH] Alternate setting 1 must be selected for interface 0 on the model that I received. Else the rest is identical.

Signed-off-by: Hans Petter Selasky <hselasky@c2i.net>
---
drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
index cbe2f0d..38a7d03 100644
--- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@ -971,6 +971,14 @@ static int ttusb_stop_feed(struct dvb_demux_feed *dvbdmxfeed)

static int ttusb_setup_interfaces(struct ttusb *ttusb)
{
+ /*
+ * Try to select alternate setting 1 for first interface. If
+ * that does not work, restore to alternate setting 0.
+ */
+ if (usb_set_interface(ttusb->dev, 0, 1) < 0)
+ usb_set_interface(ttusb->dev, 0, 0);
+
+ /* Select alternate setting 1 for second interface. */
usb_set_interface(ttusb->dev, 1, 1);

ttusb->bulk_out_pipe = usb_sndbulkpipe(ttusb->dev, 1);
--
1.7.1.1