From 579f72e44fb1c991352f44c20b471c3001357f68 Mon Sep 17 00:00:00 2001 From: Aidan Thornton Date: Thu, 17 Apr 2008 21:40:16 -0300 Subject: V4L/DVB (7602): em28xx: generalise URB setup code Move the URB setup and management code to em28xx-core.c and generalise it slighlty so that the DVB code can use it. Signed-off-by: Aidan Thornton Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/em28xx/em28xx.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'drivers/media/video/em28xx/em28xx.h') diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h index 3786dd819bb..151bc57bd08 100644 --- a/drivers/media/video/em28xx/em28xx.h +++ b/drivers/media/video/em28xx/em28xx.h @@ -119,6 +119,8 @@ enum em28xx_stream_state { STREAM_ON, }; +struct em28xx; + struct em28xx_usb_isoc_ctl { /* max packet size of isoc transaction */ int max_pkt_size; @@ -148,6 +150,10 @@ struct em28xx_usb_isoc_ctl { /* Stores the number of received fields */ int nfields; + + /* isoc urb callback */ + int (*isoc_copy) (struct em28xx *dev, struct urb *urb); + }; struct em28xx_fmt { @@ -279,6 +285,12 @@ enum em28xx_dev_state { DEV_MISCONFIGURED = 0x04, }; +enum em28xx_capture_mode { + EM28XX_CAPTURE_OFF = 0, + EM28XX_ANALOG_CAPTURE, + EM28XX_DIGITAL_CAPTURE, +}; + #define EM28XX_AUDIO_BUFS 5 #define EM28XX_NUM_AUDIO_PACKETS 64 #define EM28XX_AUDIO_MAX_PACKET_SIZE 196 /* static value */ @@ -452,6 +464,11 @@ int em28xx_capture_start(struct em28xx *dev, int start); int em28xx_outfmt_set_yuv422(struct em28xx *dev); int em28xx_resolution_set(struct em28xx *dev); int em28xx_set_alternate(struct em28xx *dev); +int em28xx_init_isoc(struct em28xx *dev, int max_packets, + int num_bufs, int max_pkt_size, + int (*isoc_copy) (struct em28xx *dev, struct urb *urb), + int cap_type); +void em28xx_uninit_isoc(struct em28xx *dev); /* Provided by em28xx-video.c */ int em28xx_register_extension(struct em28xx_ops *dev); -- cgit v1.2.3