aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx25840/cx25840-core.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-12-30 05:14:19 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-01-02 14:11:52 -0500
commitaecde8b53b8ee1330a5a8206200f0d6b8845a6e0 (patch)
tree53a1aef6597a9d829864c054230b312010abc3a7 /drivers/media/video/cx25840/cx25840-core.c
parentda1b5c95e49bb564ae8c61ed135d34ed09acbb66 (diff)
V4L/DVB (10141): v4l2: debugging API changed to match against driver name instead of ID.
Since the i2c driver ID will be removed in the near future we have to modify the v4l2 debugging API to use the driver name instead of driver ID. Note that this API is not used in applications other than v4l2-dbg.cpp as it is for debugging and testing only. Should anyone use the old VIDIOC_G_CHIP_IDENT, then this will be logged with a warning that it is deprecated and will be removed in 2.6.30. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx25840/cx25840-core.c')
-rw-r--r--drivers/media/video/cx25840/cx25840-core.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c
index 2ad277189da..88f2fd32bfe 100644
--- a/drivers/media/video/cx25840/cx25840-core.c
+++ b/drivers/media/video/cx25840/cx25840-core.c
@@ -1120,25 +1120,24 @@ static int cx25840_init(struct v4l2_subdev *sd, u32 val)
1120} 1120}
1121 1121
1122#ifdef CONFIG_VIDEO_ADV_DEBUG 1122#ifdef CONFIG_VIDEO_ADV_DEBUG
1123static int cx25840_g_register(struct v4l2_subdev *sd, struct v4l2_register *reg) 1123static int cx25840_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
1124{ 1124{
1125 struct i2c_client *client = v4l2_get_subdevdata(sd); 1125 struct i2c_client *client = v4l2_get_subdevdata(sd);
1126 1126
1127 if (!v4l2_chip_match_i2c_client(client, 1127 if (!v4l2_chip_match_i2c_client(client, &reg->match))
1128 reg->match_type, reg->match_chip))
1129 return -EINVAL; 1128 return -EINVAL;
1130 if (!capable(CAP_SYS_ADMIN)) 1129 if (!capable(CAP_SYS_ADMIN))
1131 return -EPERM; 1130 return -EPERM;
1131 reg->size = 1;
1132 reg->val = cx25840_read(client, reg->reg & 0x0fff); 1132 reg->val = cx25840_read(client, reg->reg & 0x0fff);
1133 return 0; 1133 return 0;
1134} 1134}
1135 1135
1136static int cx25840_s_register(struct v4l2_subdev *sd, struct v4l2_register *reg) 1136static int cx25840_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
1137{ 1137{
1138 struct i2c_client *client = v4l2_get_subdevdata(sd); 1138 struct i2c_client *client = v4l2_get_subdevdata(sd);
1139 1139
1140 if (!v4l2_chip_match_i2c_client(client, 1140 if (!v4l2_chip_match_i2c_client(client, &reg->match))
1141 reg->match_type, reg->match_chip))
1142 return -EINVAL; 1141 return -EINVAL;
1143 if (!capable(CAP_SYS_ADMIN)) 1142 if (!capable(CAP_SYS_ADMIN))
1144 return -EPERM; 1143 return -EPERM;
@@ -1362,7 +1361,7 @@ static int cx25840_reset(struct v4l2_subdev *sd, u32 val)
1362 return 0; 1361 return 0;
1363} 1362}
1364 1363
1365static int cx25840_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip) 1364static int cx25840_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
1366{ 1365{
1367 struct cx25840_state *state = to_state(sd); 1366 struct cx25840_state *state = to_state(sd);
1368 struct i2c_client *client = v4l2_get_subdevdata(sd); 1367 struct i2c_client *client = v4l2_get_subdevdata(sd);