aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb/m920x.c
diff options
context:
space:
mode:
authorAapo Tahkola <aet@rasterburn.org>2007-05-08 17:21:47 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-07-18 13:23:43 -0400
commit3847b22ab59a9110c9e7433ac75751070047280e (patch)
tree912b02bdd4dd1b69d6a821c02b6f1b71b497e3d9 /drivers/media/dvb/dvb-usb/m920x.c
parent55bbe5ea203373c07c10a9d1d5088dd013345027 (diff)
V4L/DVB (5694): M920x: fix for Dposh devices
Make sure devices manufactured by Dposh are not affected by previous hw pid filtering changes Doing so might crash it. Signed-off-by: Aapo Tahkola <aet@rasterburn.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/m920x.c')
-rw-r--r--drivers/media/dvb/dvb-usb/m920x.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/drivers/media/dvb/dvb-usb/m920x.c b/drivers/media/dvb/dvb-usb/m920x.c
index 350cdc90b9c8..1156b7df7978 100644
--- a/drivers/media/dvb/dvb-usb/m920x.c
+++ b/drivers/media/dvb/dvb-usb/m920x.c
@@ -59,7 +59,7 @@ static inline int m920x_write(struct usb_device *udev, u8 request,
59 59
60static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq) 60static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq)
61{ 61{
62 int ret = 0, i, epi; 62 int ret = 0, i, epi, flags = 0;
63 int adap_enabled[M9206_MAX_ADAPTERS] = { 0 }; 63 int adap_enabled[M9206_MAX_ADAPTERS] = { 0 };
64 64
65 /* Remote controller init. */ 65 /* Remote controller init. */
@@ -79,26 +79,32 @@ static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq)
79 deb("Initialising remote control success\n"); 79 deb("Initialising remote control success\n");
80 } 80 }
81 81
82 for (i = 0; i < d->props.num_adapters; i++) { 82 for (i = 0; i < d->props.num_adapters; i++)
83 epi = d->adapter[i].props.stream.endpoint - 0x81; 83 flags |= d->adapter[i].props.caps;
84 84
85 if (epi < 0 || epi >= M9206_MAX_ADAPTERS) { 85 /* Some devices(Dposh) might crash if we attempt touch at all. */
86 printk(KERN_INFO "m920x: Unexpected adapter endpoint!\n"); 86 if (flags & DVB_USB_ADAP_HAS_PID_FILTER) {
87 return -EINVAL; 87 for (i = 0; i < d->props.num_adapters; i++) {
88 } 88 epi = d->adapter[i].props.stream.endpoint - 0x81;
89 89
90 adap_enabled[epi] = 1; 90 if (epi < 0 || epi >= M9206_MAX_ADAPTERS) {
91 } 91 printk(KERN_INFO "m920x: Unexpected adapter endpoint!\n");
92 return -EINVAL;
93 }
92 94
93 for (i = 0; i < M9206_MAX_ADAPTERS; i++) { 95 adap_enabled[epi] = 1;
94 if (adap_enabled[i]) 96 }
95 continue;
96 97
97 if ((ret = m920x_set_filter(d, 0x81 + i, 0, 0x0)) != 0) 98 for (i = 0; i < M9206_MAX_ADAPTERS; i++) {
98 return ret; 99 if (adap_enabled[i])
100 continue;
99 101
100 if ((ret = m920x_set_filter(d, 0x81 + i, 0, 0x02f5)) != 0) 102 if ((ret = m920x_set_filter(d, 0x81 + i, 0, 0x0)) != 0)
101 return ret; 103 return ret;
104
105 if ((ret = m920x_set_filter(d, 0x81 + i, 0, 0x02f5)) != 0)
106 return ret;
107 }
102 } 108 }
103 109
104 return ret; 110 return ret;