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/mt9m001.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/mt9m001.c')
-rw-r--r-- | drivers/media/video/mt9m001.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/media/video/mt9m001.c b/drivers/media/video/mt9m001.c index 1a1a12453672..c1bf75ef2741 100644 --- a/drivers/media/video/mt9m001.c +++ b/drivers/media/video/mt9m001.c | |||
@@ -343,14 +343,14 @@ static int mt9m001_try_fmt(struct soc_camera_device *icd, | |||
343 | } | 343 | } |
344 | 344 | ||
345 | static int mt9m001_get_chip_id(struct soc_camera_device *icd, | 345 | static int mt9m001_get_chip_id(struct soc_camera_device *icd, |
346 | struct v4l2_chip_ident *id) | 346 | struct v4l2_dbg_chip_ident *id) |
347 | { | 347 | { |
348 | struct mt9m001 *mt9m001 = container_of(icd, struct mt9m001, icd); | 348 | struct mt9m001 *mt9m001 = container_of(icd, struct mt9m001, icd); |
349 | 349 | ||
350 | if (id->match_type != V4L2_CHIP_MATCH_I2C_ADDR) | 350 | if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) |
351 | return -EINVAL; | 351 | return -EINVAL; |
352 | 352 | ||
353 | if (id->match_chip != mt9m001->client->addr) | 353 | if (id->match.addr != mt9m001->client->addr) |
354 | return -ENODEV; | 354 | return -ENODEV; |
355 | 355 | ||
356 | id->ident = mt9m001->model; | 356 | id->ident = mt9m001->model; |
@@ -361,16 +361,17 @@ static int mt9m001_get_chip_id(struct soc_camera_device *icd, | |||
361 | 361 | ||
362 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 362 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
363 | static int mt9m001_get_register(struct soc_camera_device *icd, | 363 | static int mt9m001_get_register(struct soc_camera_device *icd, |
364 | struct v4l2_register *reg) | 364 | struct v4l2_dbg_register *reg) |
365 | { | 365 | { |
366 | struct mt9m001 *mt9m001 = container_of(icd, struct mt9m001, icd); | 366 | struct mt9m001 *mt9m001 = container_of(icd, struct mt9m001, icd); |
367 | 367 | ||
368 | if (reg->match_type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) | 368 | if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) |
369 | return -EINVAL; | 369 | return -EINVAL; |
370 | 370 | ||
371 | if (reg->match_chip != mt9m001->client->addr) | 371 | if (reg->match.addr != mt9m001->client->addr) |
372 | return -ENODEV; | 372 | return -ENODEV; |
373 | 373 | ||
374 | reg->size = 2; | ||
374 | reg->val = reg_read(icd, reg->reg); | 375 | reg->val = reg_read(icd, reg->reg); |
375 | 376 | ||
376 | if (reg->val > 0xffff) | 377 | if (reg->val > 0xffff) |
@@ -380,14 +381,14 @@ static int mt9m001_get_register(struct soc_camera_device *icd, | |||
380 | } | 381 | } |
381 | 382 | ||
382 | static int mt9m001_set_register(struct soc_camera_device *icd, | 383 | static int mt9m001_set_register(struct soc_camera_device *icd, |
383 | struct v4l2_register *reg) | 384 | struct v4l2_dbg_register *reg) |
384 | { | 385 | { |
385 | struct mt9m001 *mt9m001 = container_of(icd, struct mt9m001, icd); | 386 | struct mt9m001 *mt9m001 = container_of(icd, struct mt9m001, icd); |
386 | 387 | ||
387 | if (reg->match_type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) | 388 | if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) |
388 | return -EINVAL; | 389 | return -EINVAL; |
389 | 390 | ||
390 | if (reg->match_chip != mt9m001->client->addr) | 391 | if (reg->match.addr != mt9m001->client->addr) |
391 | return -ENODEV; | 392 | return -ENODEV; |
392 | 393 | ||
393 | if (reg_write(icd, reg->reg, reg->val) < 0) | 394 | if (reg_write(icd, reg->reg, reg->val) < 0) |