]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/media/video/cx25840/cx25840-core.h
V4L/DVB (13088): cx25840: Convert chip/core family checks to static inline functions
[net-next-2.6.git] / drivers / media / video / cx25840 / cx25840-core.h
index 814b565369949e86a36776f3c2fe0755c75d5399..55345444417f19cf5426779537dff104b36d0d7f 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <linux/videodev2.h>
 #include <media/v4l2-device.h>
+#include <media/v4l2-chip-ident.h>
 #include <linux/i2c.h>
 
 /* ENABLE_PVR150_WORKAROUND activates a workaround for a hardware bug that is
@@ -48,9 +49,6 @@ struct cx25840_state {
        int vbi_line_offset;
        u32 id;
        u32 rev;
-       int is_cx25836;
-       int is_cx23885;
-       int is_cx231xx;
        int is_initialized;
        wait_queue_head_t fw_wait;    /* wake up when the fw load is finished */
        struct work_struct fw_work;   /* work entry for fw load */
@@ -61,6 +59,24 @@ static inline struct cx25840_state *to_state(struct v4l2_subdev *sd)
        return container_of(sd, struct cx25840_state, sd);
 }
 
+static inline bool is_cx2583x(struct cx25840_state *state)
+{
+       return state->id == V4L2_IDENT_CX25836 ||
+              state->id == V4L2_IDENT_CX25837;
+}
+
+static inline bool is_cx231xx(struct cx25840_state *state)
+{
+       return state->id == V4L2_IDENT_CX2310X_AV;
+}
+
+static inline bool is_cx2388x(struct cx25840_state *state)
+{
+       return state->id == V4L2_IDENT_CX23885_AV ||
+              state->id == V4L2_IDENT_CX23887_AV ||
+              state->id == V4L2_IDENT_CX23888_AV;
+}
+
 /* ----------------------------------------------------------------------- */
 /* cx25850-core.c                                                         */
 int cx25840_write(struct i2c_client *client, u16 addr, u8 value);