From ca54d2e82573c1440b4e32208496dd4f79b01059 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 8 Mar 2009 10:56:19 +0100 Subject: w9968cf: add v4l2_device. From: Hans Verkuil Priority: normal Signed-off-by: Hans Verkuil --- linux/drivers/media/video/w9968cf.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'linux/drivers/media/video/w9968cf.h') diff --git a/linux/drivers/media/video/w9968cf.h b/linux/drivers/media/video/w9968cf.h index 62c26b1ed..184f96311 100644 --- a/linux/drivers/media/video/w9968cf.h +++ b/linux/drivers/media/video/w9968cf.h @@ -33,6 +33,7 @@ #include #include +#include #include #include "compat.h" @@ -196,10 +197,9 @@ enum w9968cf_vpp_flag { /* Main device driver structure */ struct w9968cf_device { - struct device dev; /* device structure */ - enum w9968cf_model_id id; /* private device identifier */ + struct v4l2_device v4l2_dev; struct video_device* v4ldev; /* -> V4L structure */ struct list_head v4llist; /* entry of the list of V4L cameras */ @@ -292,14 +292,14 @@ struct w9968cf_device { if ( ((specific_debug) && (debug == (level))) || \ ((!specific_debug) && (debug >= (level))) ) { \ if ((level) == 1) \ - dev_err(&cam->dev, fmt "\n", ## args); \ + v4l2_err(&cam->v4l2_dev, fmt "\n", ## args); \ else if ((level) == 2 || (level) == 3) \ - dev_info(&cam->dev, fmt "\n", ## args); \ + v4l2_info(&cam->v4l2_dev, fmt "\n", ## args); \ else if ((level) == 4) \ - dev_warn(&cam->dev, fmt "\n", ## args); \ + v4l2_warn(&cam->v4l2_dev, fmt "\n", ## args); \ else if ((level) >= 5) \ - dev_info(&cam->dev, "[%s:%d] " fmt "\n", \ - __func__, __LINE__ , ## args); \ + v4l2_info(&cam->v4l2_dev, "[%s:%d] " fmt "\n", \ + __func__, __LINE__ , ## args); \ } \ } /* For generic kernel (not device specific) messages */ @@ -322,7 +322,7 @@ struct w9968cf_device { #undef PDBG #define PDBG(fmt, args...) \ -dev_info(&cam->dev, "[%s:%d] " fmt "\n", __func__, __LINE__ , ## args); +v4l2_info(&cam->v4l2_dev, "[%s:%d] " fmt "\n", __func__, __LINE__ , ## args); #undef PDBGG #define PDBGG(fmt, args...) do {;} while(0); /* nothing: it's a placeholder */ -- cgit v1.2.3 From 74a6094f9f289036473f782e306a3bdd2d41ce34 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 8 Mar 2009 14:19:44 +0100 Subject: w9968cf/ovcamchip: convert to v4l2_subdev. From: Hans Verkuil Priority: normal Signed-off-by: Hans Verkuil --- linux/drivers/media/video/w9968cf.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'linux/drivers/media/video/w9968cf.h') diff --git a/linux/drivers/media/video/w9968cf.h b/linux/drivers/media/video/w9968cf.h index 184f96311..989d414d6 100644 --- a/linux/drivers/media/video/w9968cf.h +++ b/linux/drivers/media/video/w9968cf.h @@ -44,7 +44,6 @@ * Default values * ****************************************************************************/ -#define W9968CF_OVMOD_LOAD 1 /* automatic 'ovcamchip' module loading */ #define W9968CF_VPPMOD_LOAD 1 /* automatic 'w9968cf-vpp' module loading */ /* Comment/uncomment the following line to enable/disable debugging messages */ @@ -266,7 +265,7 @@ struct w9968cf_device { /* I2C interface to kernel */ struct i2c_adapter i2c_adapter; - struct i2c_client* sensor_client; + struct v4l2_subdev *sensor_sd; /* Locks */ struct mutex dev_mutex, /* for probe, disconnect,open and close */ @@ -278,6 +277,11 @@ struct w9968cf_device { char command[16]; /* name of the program holding the device */ }; +static inline struct w9968cf_device *to_cam(struct v4l2_device *v4l2_dev) +{ + return container_of(v4l2_dev, struct w9968cf_device, v4l2_dev); +} + /**************************************************************************** * Macros for debugging * -- cgit v1.2.3