Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3847b22a authored by Aapo Tahkola's avatar Aapo Tahkola Committed by Mauro Carvalho Chehab
Browse files

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: default avatarAapo Tahkola <aet@rasterburn.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 55bbe5ea
Loading
Loading
Loading
Loading
+22 −16
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ static inline int m920x_write(struct usb_device *udev, u8 request,

static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq)
{
	int ret = 0, i, epi;
	int ret = 0, i, epi, flags = 0;
	int adap_enabled[M9206_MAX_ADAPTERS] = { 0 };

	/* Remote controller init. */
@@ -79,6 +79,11 @@ static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq)
		deb("Initialising remote control success\n");
	}

	for (i = 0; i < d->props.num_adapters; i++)
		flags |= d->adapter[i].props.caps;

	/* Some devices(Dposh) might crash if we attempt touch at all. */
	if (flags & DVB_USB_ADAP_HAS_PID_FILTER) {
		for (i = 0; i < d->props.num_adapters; i++) {
			epi = d->adapter[i].props.stream.endpoint - 0x81;

@@ -100,6 +105,7 @@ static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq)
			if ((ret = m920x_set_filter(d, 0x81 + i, 0, 0x02f5)) != 0)
				return ret;
		}
	}

	return ret;
}