]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/media/video/cx18/cx18-driver.h
Merge branch 'master' into tk71
[mv-sheeva.git] / drivers / media / video / cx18 / cx18-driver.h
index 9bc51a99376bc22231e7c97977d26261de4974b4..f736679d25178a5e78ae815f24ca006779f66eaa 100644 (file)
@@ -84,7 +84,9 @@
 #define CX18_CARD_TOSHIBA_QOSMIO_DVBT 5 /* Toshiba Qosmio Interal DVB-T/Analog*/
 #define CX18_CARD_LEADTEK_PVR2100     6 /* Leadtek WinFast PVR2100 */
 #define CX18_CARD_LEADTEK_DVR3100H    7 /* Leadtek WinFast DVR3100 H */
-#define CX18_CARD_LAST                       7
+#define CX18_CARD_GOTVIEW_PCI_DVD3    8 /* GoTView PCI DVD3 Hybrid */
+#define CX18_CARD_HVR_1600_S5H1411    9 /* Hauppauge HVR 1600 s5h1411/tda18271*/
+#define CX18_CARD_LAST               9
 
 #define CX18_ENC_STREAM_TYPE_MPG  0
 #define CX18_ENC_STREAM_TYPE_TS   1
 #define CX18_PCI_ID_CONEXANT           0x14f1
 #define CX18_PCI_ID_TOSHIBA            0x1179
 #define CX18_PCI_ID_LEADTEK            0x107D
+#define CX18_PCI_ID_GOTVIEW            0x5854
 
 /* ======================================================================== */
 /* ========================== START USER SETTABLE DMA VARIABLES =========== */
@@ -323,7 +326,10 @@ struct cx18_queue {
        spinlock_t lock;
 };
 
+struct cx18_stream; /* forward reference */
+
 struct cx18_dvb {
+       struct cx18_stream *stream;
        struct dmx_frontend hw_frontend;
        struct dmx_frontend mem_frontend;
        struct dmxdev dmxdev;
@@ -363,9 +369,10 @@ struct cx18_in_work_order {
 #define CX18_INVALID_TASK_HANDLE 0xffffffff
 
 struct cx18_stream {
-       /* These first four fields are always set, even if the stream
+       /* These first five fields are always set, even if the stream
           is not actually created. */
        struct video_device *video_dev; /* NULL when stream not created */
+       struct cx18_dvb *dvb;           /* DVB / Digital Transport */
        struct cx18 *cx;                /* for ease of use */
        const char *name;               /* name of the stream */
        int type;                       /* stream type */
@@ -395,9 +402,6 @@ struct cx18_stream {
        struct cx18_queue q_idle;       /* idle - not in rotation */
 
        struct work_struct out_work_order;
-
-       /* DVB / Digital Transport */
-       struct cx18_dvb dvb;
 };
 
 struct cx18_open_id {
@@ -614,9 +618,6 @@ struct cx18 {
        struct cx18_in_work_order in_work_order[CX18_MAX_IN_WORK_ORDERS];
        char epu_debug_str[256]; /* CX18_EPU_DEBUG is rare: use shared space */
 
-       struct workqueue_struct *out_work_queue;
-       char out_workq_name[12]; /* "cx18-NN-out" */
-
        /* i2c */
        struct i2c_adapter i2c_adap[2];
        struct i2c_algo_bit_data i2c_algo[2];
@@ -674,18 +675,25 @@ static inline int cx18_raw_vbi(const struct cx18 *cx)
 
 /* Call the specified callback for all subdevs with a grp_id bit matching the
  * mask in hw (if 0, then match them all). Ignore any errors. */
-#define cx18_call_hw(cx, hw, o, f, args...) \
-       __v4l2_device_call_subdevs(&(cx)->v4l2_dev, \
-                                  !(hw) || (sd->grp_id & (hw)), o, f , ##args)
+#define cx18_call_hw(cx, hw, o, f, args...)                            \
+       do {                                                            \
+               struct v4l2_subdev *__sd;                               \
+               __v4l2_device_call_subdevs_p(&(cx)->v4l2_dev, __sd,     \
+                       !(hw) || (__sd->grp_id & (hw)), o, f , ##args); \
+       } while (0)
 
 #define cx18_call_all(cx, o, f, args...) cx18_call_hw(cx, 0, o, f , ##args)
 
 /* Call the specified callback for all subdevs with a grp_id bit matching the
  * mask in hw (if 0, then match them all). If the callback returns an error
  * other than 0 or -ENOIOCTLCMD, then return with that error code. */
-#define cx18_call_hw_err(cx, hw, o, f, args...) \
-       __v4l2_device_call_subdevs_until_err( \
-                  &(cx)->v4l2_dev, !(hw) || (sd->grp_id & (hw)), o, f , ##args)
+#define cx18_call_hw_err(cx, hw, o, f, args...)                                \
+({                                                                     \
+       struct v4l2_subdev *__sd;                                       \
+       __v4l2_device_call_subdevs_until_err_p(&(cx)->v4l2_dev,         \
+                       __sd, !(hw) || (__sd->grp_id & (hw)), o, f,     \
+                       ##args);                                        \
+})
 
 #define cx18_call_all_err(cx, o, f, args...) \
        cx18_call_hw_err(cx, 0, o, f , ##args)