From 4605664bd94ed94ab65a00bc7c749704304cfd40 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sun, 31 Jan 2010 21:06:10 -0300 Subject: V4L/DVB: dvb-usb: enable specifying a separate generic bulk ctrl response endpoint Some DVB USB devices use a separate endpoint for responses to control messages sent with bulk transfers via the generic_bulk_ctrl_endpoint. When generic_bulk_ctrl_endpoint_response is set, it will be used instead of the generic_bulk_ctrl_endpoint when reading usb responses in the dvb_usb_generic_rw helper function. Signed-off-by: Michael Krufky Reviewed-by: Patrick Boettcher Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-usb/dvb-usb-urb.c | 2 ++ drivers/media/dvb/dvb-usb/dvb-usb.h | 7 +++++++ 2 files changed, 9 insertions(+) (limited to 'drivers/media') diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-urb.c b/drivers/media/dvb/dvb-usb/dvb-usb-urb.c index 6fe71c6745e..bb46ba6a357 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-urb.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-urb.c @@ -42,6 +42,8 @@ int dvb_usb_generic_rw(struct dvb_usb_device *d, u8 *wbuf, u16 wlen, u8 *rbuf, msleep(delay_ms); ret = usb_bulk_msg(d->udev,usb_rcvbulkpipe(d->udev, + d->props.generic_bulk_ctrl_endpoint_response ? + d->props.generic_bulk_ctrl_endpoint_response : d->props.generic_bulk_ctrl_endpoint),rbuf,rlen,&actlen, 2000); diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h b/drivers/media/dvb/dvb-usb/dvb-usb.h index 0143aef19ec..4a9f676087b 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb.h @@ -198,6 +198,12 @@ struct dvb_usb_adapter_properties { * is non-zero, one can use dvb_usb_generic_rw and dvb_usb_generic_write- * helper functions. * + * @generic_bulk_ctrl_endpoint_response: some DVB USB devices use a separate + * endpoint for responses to control messages sent with bulk transfers via + * the generic_bulk_ctrl_endpoint. When this is non-zero, this will be used + * instead of the generic_bulk_ctrl_endpoint when reading usb responses in + * the dvb_usb_generic_rw helper function. + * * @num_device_descs: number of struct dvb_usb_device_description in @devices * @devices: array of struct dvb_usb_device_description compatibles with these * properties. @@ -239,6 +245,7 @@ struct dvb_usb_device_properties { struct i2c_algorithm *i2c_algo; int generic_bulk_ctrl_endpoint; + int generic_bulk_ctrl_endpoint_response; int num_device_descs; struct dvb_usb_device_description devices[12]; -- cgit v1.2.3-70-g09d2