em28xx.h (69a61642ac60e84647394b4cf0f322579701d218) em28xx.h (d3829fadc4611e96aa360b8ead5adefdf61f45ea)
1/*
2 em28xx.h - driver for Empia EM2800/EM2820/2840 USB video capture devices
3
4 Copyright (C) 2005 Markus Rechberger <mrechberger@gmail.com>
5 Ludovico Cavedon <cavedon@sssup.it>
6 Mauro Carvalho Chehab <mchehab@infradead.org>
7 Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com>
8

--- 17 unchanged lines hidden (view full) ---

26#ifndef _EM28XX_H
27#define _EM28XX_H
28
29#include <linux/workqueue.h>
30#include <linux/i2c.h>
31#include <linux/mutex.h>
32#include <linux/videodev2.h>
33
1/*
2 em28xx.h - driver for Empia EM2800/EM2820/2840 USB video capture devices
3
4 Copyright (C) 2005 Markus Rechberger <mrechberger@gmail.com>
5 Ludovico Cavedon <cavedon@sssup.it>
6 Mauro Carvalho Chehab <mchehab@infradead.org>
7 Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com>
8

--- 17 unchanged lines hidden (view full) ---

26#ifndef _EM28XX_H
27#define _EM28XX_H
28
29#include <linux/workqueue.h>
30#include <linux/i2c.h>
31#include <linux/mutex.h>
32#include <linux/videodev2.h>
33
34#include <media/videobuf-vmalloc.h>
34#include <media/videobuf2-vmalloc.h>
35#include <media/v4l2-device.h>
36#include <media/v4l2-ctrls.h>
37#include <media/v4l2-fh.h>
38#include <media/ir-kbd-i2c.h>
39#include <media/rc-core.h>
35#include <media/v4l2-device.h>
36#include <media/v4l2-ctrls.h>
37#include <media/v4l2-fh.h>
38#include <media/ir-kbd-i2c.h>
39#include <media/rc-core.h>
40#if defined(CONFIG_VIDEO_EM28XX_DVB) || defined(CONFIG_VIDEO_EM28XX_DVB_MODULE)
41#include <media/videobuf-dvb.h>
42#endif
43#include "tuner-xc2028.h"
44#include "xc5000.h"
45#include "em28xx-reg.h"
46
47/* Boards supported by driver */
48#define EM2800_BOARD_UNKNOWN 0
49#define EM2820_BOARD_UNKNOWN 1
50#define EM2820_BOARD_TERRATEC_CINERGY_250 2

--- 196 unchanged lines hidden (view full) ---

247 u32 fourcc; /* v4l2 format id */
248 int depth;
249 int reg;
250};
251
252/* buffer for one video frame */
253struct em28xx_buffer {
254 /* common v4l buffer stuff -- must be first */
40#include "tuner-xc2028.h"
41#include "xc5000.h"
42#include "em28xx-reg.h"
43
44/* Boards supported by driver */
45#define EM2800_BOARD_UNKNOWN 0
46#define EM2820_BOARD_UNKNOWN 1
47#define EM2820_BOARD_TERRATEC_CINERGY_250 2

--- 196 unchanged lines hidden (view full) ---

244 u32 fourcc; /* v4l2 format id */
245 int depth;
246 int reg;
247};
248
249/* buffer for one video frame */
250struct em28xx_buffer {
251 /* common v4l buffer stuff -- must be first */
255 struct videobuf_buffer vb;
252 struct vb2_buffer vb;
253 struct list_head list;
256
254
255 void *mem;
256 unsigned int length;
257 int top_field;
258
259 /* counter to control buffer fill */
260 unsigned int pos;
261 /* NOTE; in interlaced mode, this value is reset to zero at
262 * the start of each new field (not frame !) */
263
264 /* pointer to vmalloc memory address in vb */

--- 210 unchanged lines hidden (view full) ---

475 spinlock_t slock;
476};
477
478struct em28xx;
479
480struct em28xx_fh {
481 struct v4l2_fh fh;
482 struct em28xx *dev;
257 int top_field;
258
259 /* counter to control buffer fill */
260 unsigned int pos;
261 /* NOTE; in interlaced mode, this value is reset to zero at
262 * the start of each new field (not frame !) */
263
264 /* pointer to vmalloc memory address in vb */

--- 210 unchanged lines hidden (view full) ---

475 spinlock_t slock;
476};
477
478struct em28xx;
479
480struct em28xx_fh {
481 struct v4l2_fh fh;
482 struct em28xx *dev;
483 int radio;
484 unsigned int resources;
485
483
486 struct videobuf_queue vb_vidq;
487 struct videobuf_queue vb_vbiq;
488
489 enum v4l2_buf_type type;
490};
491
492/* main device struct */
493struct em28xx {
494 /* generic device properties */
495 char name[30]; /* name (including minor) of the device */
496 int model; /* index in the device_data struct */

--- 43 unchanged lines hidden (view full) ---

540 int tuner_type; /* type of the tuner */
541 int tuner_addr; /* tuner address */
542 int tda9887_conf;
543 /* i2c i/o */
544 struct i2c_adapter i2c_adap;
545 struct i2c_client i2c_client;
546 /* video for linux */
547 int users; /* user count for exclusive use */
484 enum v4l2_buf_type type;
485};
486
487/* main device struct */
488struct em28xx {
489 /* generic device properties */
490 char name[30]; /* name (including minor) of the device */
491 int model; /* index in the device_data struct */

--- 43 unchanged lines hidden (view full) ---

535 int tuner_type; /* type of the tuner */
536 int tuner_addr; /* tuner address */
537 int tda9887_conf;
538 /* i2c i/o */
539 struct i2c_adapter i2c_adap;
540 struct i2c_client i2c_client;
541 /* video for linux */
542 int users; /* user count for exclusive use */
543 int streaming_users; /* Number of actively streaming users */
548 struct video_device *vdev; /* video for linux device struct */
549 v4l2_std_id norm; /* selected tv norm */
550 int ctl_freq; /* selected frequency */
551 unsigned int ctl_input; /* selected input */
552 unsigned int ctl_ainput;/* selected audio input */
553 unsigned int ctl_aoutput;/* selected audio output */
554 int mute;
555 int volume;

--- 26 unchanged lines hidden (view full) ---

582 /* locks */
583 struct mutex lock;
584 struct mutex ctrl_urb_lock; /* protects urb_buf */
585 /* spinlock_t queue_lock; */
586 struct list_head inqueue, outqueue;
587 struct video_device *vbi_dev;
588 struct video_device *radio_dev;
589
544 struct video_device *vdev; /* video for linux device struct */
545 v4l2_std_id norm; /* selected tv norm */
546 int ctl_freq; /* selected frequency */
547 unsigned int ctl_input; /* selected input */
548 unsigned int ctl_ainput;/* selected audio input */
549 unsigned int ctl_aoutput;/* selected audio output */
550 int mute;
551 int volume;

--- 26 unchanged lines hidden (view full) ---

578 /* locks */
579 struct mutex lock;
580 struct mutex ctrl_urb_lock; /* protects urb_buf */
581 /* spinlock_t queue_lock; */
582 struct list_head inqueue, outqueue;
583 struct video_device *vbi_dev;
584 struct video_device *radio_dev;
585
586 /* Videobuf2 */
587 struct vb2_queue vb_vidq;
588 struct vb2_queue vb_vbiq;
589 struct mutex vb_queue_lock;
590 struct mutex vb_vbi_queue_lock;
591
590 /* resources in use */
591 unsigned int resources;
592
593 unsigned char eedata[256];
594
595 /* Isoc control struct */
596 struct em28xx_dmaqueue vidq;
597 struct em28xx_dmaqueue vbiq;
598 struct em28xx_usb_ctl usb_ctl;
599 spinlock_t slock;
600
592 /* resources in use */
593 unsigned int resources;
594
595 unsigned char eedata[256];
596
597 /* Isoc control struct */
598 struct em28xx_dmaqueue vidq;
599 struct em28xx_dmaqueue vbiq;
600 struct em28xx_usb_ctl usb_ctl;
601 spinlock_t slock;
602
603 unsigned int field_count;
604 unsigned int vbi_field_count;
605
601 /* usb transfer */
602 struct usb_device *udev; /* the usb device */
603 u8 analog_ep_isoc; /* address of isoc endpoint for analog */
604 u8 analog_ep_bulk; /* address of bulk endpoint for analog */
605 u8 dvb_ep_isoc; /* address of isoc endpoint for DVB */
606 u8 dvb_ep_bulk; /* address of bulk endpoint for DVC */
607 int alt; /* alternate setting */
608 int max_pkt_size; /* max packet size of the selected ep at alt */

--- 95 unchanged lines hidden (view full) ---

704int em28xx_gpio_set(struct em28xx *dev, struct em28xx_reg_seq *gpio);
705void em28xx_wake_i2c(struct em28xx *dev);
706int em28xx_register_extension(struct em28xx_ops *dev);
707void em28xx_unregister_extension(struct em28xx_ops *dev);
708void em28xx_init_extension(struct em28xx *dev);
709void em28xx_close_extension(struct em28xx *dev);
710
711/* Provided by em28xx-video.c */
606 /* usb transfer */
607 struct usb_device *udev; /* the usb device */
608 u8 analog_ep_isoc; /* address of isoc endpoint for analog */
609 u8 analog_ep_bulk; /* address of bulk endpoint for analog */
610 u8 dvb_ep_isoc; /* address of isoc endpoint for DVB */
611 u8 dvb_ep_bulk; /* address of bulk endpoint for DVC */
612 int alt; /* alternate setting */
613 int max_pkt_size; /* max packet size of the selected ep at alt */

--- 95 unchanged lines hidden (view full) ---

709int em28xx_gpio_set(struct em28xx *dev, struct em28xx_reg_seq *gpio);
710void em28xx_wake_i2c(struct em28xx *dev);
711int em28xx_register_extension(struct em28xx_ops *dev);
712void em28xx_unregister_extension(struct em28xx_ops *dev);
713void em28xx_init_extension(struct em28xx *dev);
714void em28xx_close_extension(struct em28xx *dev);
715
716/* Provided by em28xx-video.c */
717int em28xx_vb2_setup(struct em28xx *dev);
712int em28xx_register_analog_devices(struct em28xx *dev);
713void em28xx_release_analog_resources(struct em28xx *dev);
714void em28xx_ctrl_notify(struct v4l2_ctrl *ctrl, void *priv);
718int em28xx_register_analog_devices(struct em28xx *dev);
719void em28xx_release_analog_resources(struct em28xx *dev);
720void em28xx_ctrl_notify(struct v4l2_ctrl *ctrl, void *priv);
721int em28xx_start_analog_streaming(struct vb2_queue *vq, unsigned int count);
722int em28xx_stop_vbi_streaming(struct vb2_queue *vq);
715extern const struct v4l2_ctrl_ops em28xx_ctrl_ops;
716
717/* Provided by em28xx-cards.c */
718extern int em2800_variant_detect(struct usb_device *udev, int model);
719extern struct em28xx_board em28xx_boards[];
720extern struct usb_device_id em28xx_id_table[];
721extern const unsigned int em28xx_bcount;
722int em28xx_tuner_callback(void *ptr, int component, int command, int arg);
723void em28xx_release_resources(struct em28xx *dev);
724
725/* Provided by em28xx-vbi.c */
723extern const struct v4l2_ctrl_ops em28xx_ctrl_ops;
724
725/* Provided by em28xx-cards.c */
726extern int em2800_variant_detect(struct usb_device *udev, int model);
727extern struct em28xx_board em28xx_boards[];
728extern struct usb_device_id em28xx_id_table[];
729extern const unsigned int em28xx_bcount;
730int em28xx_tuner_callback(void *ptr, int component, int command, int arg);
731void em28xx_release_resources(struct em28xx *dev);
732
733/* Provided by em28xx-vbi.c */
726extern struct videobuf_queue_ops em28xx_vbi_qops;
734extern struct vb2_ops em28xx_vbi_qops;
727
728/* printk macros */
729
730#define em28xx_err(fmt, arg...) do {\
731 printk(KERN_ERR fmt , ##arg); } while (0)
732
733#define em28xx_errdev(fmt, arg...) do {\
734 printk(KERN_ERR "%s: "fmt,\

--- 104 unchanged lines hidden ---
735
736/* printk macros */
737
738#define em28xx_err(fmt, arg...) do {\
739 printk(KERN_ERR fmt , ##arg); } while (0)
740
741#define em28xx_errdev(fmt, arg...) do {\
742 printk(KERN_ERR "%s: "fmt,\

--- 104 unchanged lines hidden ---