]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
[linux-2.6-omap-h63xx.git] / drivers / media / video / pvrusb2 / pvrusb2-i2c-chips-v4l2.c
index fbe6039aeb6a8a5c588c3c7f1a81b389c54f5ae0..49773764383b73eac164ba6e768f34405aa0d20f 100644 (file)
@@ -19,6 +19,7 @@
  *
  */
 
+#include <linux/kernel.h>
 #include "pvrusb2-i2c-core.h"
 #include "pvrusb2-hdw-internal.h"
 #include "pvrusb2-debug.h"
 #include "pvrusb2-audio.h"
 #include "pvrusb2-tuner.h"
 #include "pvrusb2-video-v4l.h"
-#ifdef CONFIG_VIDEO_PVRUSB2_24XXX
 #include "pvrusb2-cx2584x-v4l.h"
 #include "pvrusb2-wm8775.h"
-#endif
 
 #define trace_i2c(...) pvr2_trace(PVR2_TRACE_I2C,__VA_ARGS__)
 
 #define OP_STANDARD 0
-#define OP_BCSH 1
-#define OP_VOLUME 2
-#define OP_FREQ 3
-#define OP_AUDIORATE 4
-#define OP_SIZE 5
-#define OP_LOG 6
+#define OP_AUDIOMODE 1
+#define OP_BCSH 2
+#define OP_VOLUME 3
+#define OP_FREQ 4
+#define OP_AUDIORATE 5
+#define OP_SIZE 6
+#define OP_LOG 7
 
 static const struct pvr2_i2c_op * const ops[] = {
        [OP_STANDARD] = &pvr2_i2c_op_v4l2_standard,
+       [OP_AUDIOMODE] = &pvr2_i2c_op_v4l2_audiomode,
        [OP_BCSH] = &pvr2_i2c_op_v4l2_bcsh,
        [OP_VOLUME] = &pvr2_i2c_op_v4l2_volume,
        [OP_FREQ] = &pvr2_i2c_op_v4l2_frequency,
@@ -55,11 +56,13 @@ void pvr2_i2c_probe(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp)
        int id;
        id = cp->client->driver->id;
        cp->ctl_mask = ((1 << OP_STANDARD) |
+                       (1 << OP_AUDIOMODE) |
                        (1 << OP_BCSH) |
                        (1 << OP_VOLUME) |
                        (1 << OP_FREQ) |
                        (1 << OP_SIZE) |
                        (1 << OP_LOG));
+       cp->status_poll = pvr2_v4l2_cmd_status_poll;
 
        if (id == I2C_DRIVERID_MSP3400) {
                if (pvr2_i2c_msp3400_setup(hdw,cp)) {
@@ -71,7 +74,6 @@ void pvr2_i2c_probe(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp)
                        return;
                }
        }
-#ifdef CONFIG_VIDEO_PVRUSB2_24XXX
        if (id == I2C_DRIVERID_CX25840) {
                if (pvr2_i2c_cx2584x_v4l_setup(hdw,cp)) {
                        return;
@@ -82,7 +84,6 @@ void pvr2_i2c_probe(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp)
                        return;
                }
        }
-#endif
        if (id == I2C_DRIVERID_SAA711X) {
                if (pvr2_i2c_decoder_v4l_setup(hdw,cp)) {
                        return;
@@ -93,7 +94,8 @@ void pvr2_i2c_probe(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp)
 
 const struct pvr2_i2c_op *pvr2_i2c_get_op(unsigned int idx)
 {
-       if (idx >= sizeof(ops)/sizeof(ops[0])) return 0;
+       if (idx >= ARRAY_SIZE(ops))
+               return NULL;
        return ops[idx];
 }