aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/mt9t031.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/mt9t031.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/mt9t031.c')
-rw-r--r--drivers/media/video/mt9t031.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/media/video/mt9t031.c b/drivers/media/video/mt9t031.c
index 1a9d53966d06..349d8e365530 100644
--- a/drivers/media/video/mt9t031.c
+++ b/drivers/media/video/mt9t031.c
@@ -326,14 +326,14 @@ static int mt9t031_try_fmt(struct soc_camera_device *icd,
326} 326}
327 327
328static int mt9t031_get_chip_id(struct soc_camera_device *icd, 328static int mt9t031_get_chip_id(struct soc_camera_device *icd,
329 struct v4l2_chip_ident *id) 329 struct v4l2_dbg_chip_ident *id)
330{ 330{
331 struct mt9t031 *mt9t031 = container_of(icd, struct mt9t031, icd); 331 struct mt9t031 *mt9t031 = container_of(icd, struct mt9t031, icd);
332 332
333 if (id->match_type != V4L2_CHIP_MATCH_I2C_ADDR) 333 if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
334 return -EINVAL; 334 return -EINVAL;
335 335
336 if (id->match_chip != mt9t031->client->addr) 336 if (id->match.addr != mt9t031->client->addr)
337 return -ENODEV; 337 return -ENODEV;
338 338
339 id->ident = mt9t031->model; 339 id->ident = mt9t031->model;
@@ -344,14 +344,14 @@ static int mt9t031_get_chip_id(struct soc_camera_device *icd,
344 344
345#ifdef CONFIG_VIDEO_ADV_DEBUG 345#ifdef CONFIG_VIDEO_ADV_DEBUG
346static int mt9t031_get_register(struct soc_camera_device *icd, 346static int mt9t031_get_register(struct soc_camera_device *icd,
347 struct v4l2_register *reg) 347 struct v4l2_dbg_register *reg)
348{ 348{
349 struct mt9t031 *mt9t031 = container_of(icd, struct mt9t031, icd); 349 struct mt9t031 *mt9t031 = container_of(icd, struct mt9t031, icd);
350 350
351 if (reg->match_type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) 351 if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff)
352 return -EINVAL; 352 return -EINVAL;
353 353
354 if (reg->match_chip != mt9t031->client->addr) 354 if (reg->match.addr != mt9t031->client->addr)
355 return -ENODEV; 355 return -ENODEV;
356 356
357 reg->val = reg_read(icd, reg->reg); 357 reg->val = reg_read(icd, reg->reg);
@@ -363,14 +363,14 @@ static int mt9t031_get_register(struct soc_camera_device *icd,
363} 363}
364 364
365static int mt9t031_set_register(struct soc_camera_device *icd, 365static int mt9t031_set_register(struct soc_camera_device *icd,
366 struct v4l2_register *reg) 366 struct v4l2_dbg_register *reg)
367{ 367{
368 struct mt9t031 *mt9t031 = container_of(icd, struct mt9t031, icd); 368 struct mt9t031 *mt9t031 = container_of(icd, struct mt9t031, icd);
369 369
370 if (reg->match_type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) 370 if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff)
371 return -EINVAL; 371 return -EINVAL;
372 372
373 if (reg->match_chip != mt9t031->client->addr) 373 if (reg->match.addr != mt9t031->client->addr)
374 return -ENODEV; 374 return -ENODEV;
375 375
376 if (reg_write(icd, reg->reg, reg->val) < 0) 376 if (reg_write(icd, reg->reg, reg->val) < 0)