diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-12-30 05:14:19 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-01-02 14:11:52 -0500 |
commit | aecde8b53b8ee1330a5a8206200f0d6b8845a6e0 (patch) | |
tree | 53a1aef6597a9d829864c054230b312010abc3a7 /drivers/media/video/mt9v022.c | |
parent | da1b5c95e49bb564ae8c61ed135d34ed09acbb66 (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/mt9v022.c')
-rw-r--r-- | drivers/media/video/mt9v022.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/media/video/mt9v022.c b/drivers/media/video/mt9v022.c index 14a5f9c21ffa..b04c8cb1644d 100644 --- a/drivers/media/video/mt9v022.c +++ b/drivers/media/video/mt9v022.c | |||
@@ -422,14 +422,14 @@ static int mt9v022_try_fmt(struct soc_camera_device *icd, | |||
422 | } | 422 | } |
423 | 423 | ||
424 | static int mt9v022_get_chip_id(struct soc_camera_device *icd, | 424 | static int mt9v022_get_chip_id(struct soc_camera_device *icd, |
425 | struct v4l2_chip_ident *id) | 425 | struct v4l2_dbg_chip_ident *id) |
426 | { | 426 | { |
427 | struct mt9v022 *mt9v022 = container_of(icd, struct mt9v022, icd); | 427 | struct mt9v022 *mt9v022 = container_of(icd, struct mt9v022, icd); |
428 | 428 | ||
429 | if (id->match_type != V4L2_CHIP_MATCH_I2C_ADDR) | 429 | if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) |
430 | return -EINVAL; | 430 | return -EINVAL; |
431 | 431 | ||
432 | if (id->match_chip != mt9v022->client->addr) | 432 | if (id->match.addr != mt9v022->client->addr) |
433 | return -ENODEV; | 433 | return -ENODEV; |
434 | 434 | ||
435 | id->ident = mt9v022->model; | 435 | id->ident = mt9v022->model; |
@@ -440,16 +440,17 @@ static int mt9v022_get_chip_id(struct soc_camera_device *icd, | |||
440 | 440 | ||
441 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 441 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
442 | static int mt9v022_get_register(struct soc_camera_device *icd, | 442 | static int mt9v022_get_register(struct soc_camera_device *icd, |
443 | struct v4l2_register *reg) | 443 | struct v4l2_dbg_register *reg) |
444 | { | 444 | { |
445 | struct mt9v022 *mt9v022 = container_of(icd, struct mt9v022, icd); | 445 | struct mt9v022 *mt9v022 = container_of(icd, struct mt9v022, icd); |
446 | 446 | ||
447 | if (reg->match_type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) | 447 | if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) |
448 | return -EINVAL; | 448 | return -EINVAL; |
449 | 449 | ||
450 | if (reg->match_chip != mt9v022->client->addr) | 450 | if (reg->match.addr != mt9v022->client->addr) |
451 | return -ENODEV; | 451 | return -ENODEV; |
452 | 452 | ||
453 | reg->size = 2; | ||
453 | reg->val = reg_read(icd, reg->reg); | 454 | reg->val = reg_read(icd, reg->reg); |
454 | 455 | ||
455 | if (reg->val > 0xffff) | 456 | if (reg->val > 0xffff) |
@@ -459,14 +460,14 @@ static int mt9v022_get_register(struct soc_camera_device *icd, | |||
459 | } | 460 | } |
460 | 461 | ||
461 | static int mt9v022_set_register(struct soc_camera_device *icd, | 462 | static int mt9v022_set_register(struct soc_camera_device *icd, |
462 | struct v4l2_register *reg) | 463 | struct v4l2_dbg_register *reg) |
463 | { | 464 | { |
464 | struct mt9v022 *mt9v022 = container_of(icd, struct mt9v022, icd); | 465 | struct mt9v022 *mt9v022 = container_of(icd, struct mt9v022, icd); |
465 | 466 | ||
466 | if (reg->match_type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) | 467 | if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) |
467 | return -EINVAL; | 468 | return -EINVAL; |
468 | 469 | ||
469 | if (reg->match_chip != mt9v022->client->addr) | 470 | if (reg->match.addr != mt9v022->client->addr) |
470 | return -ENODEV; | 471 | return -ENODEV; |
471 | 472 | ||
472 | if (reg_write(icd, reg->reg, reg->val) < 0) | 473 | if (reg_write(icd, reg->reg, reg->val) < 0) |