diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2013-05-29 05:59:51 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-06-17 07:52:10 -0400 |
commit | e12771100c93e101a7a8b302b6c5d57cff7b1551 (patch) | |
tree | a831f1d64d92142e5ce4cbcdfcd5a6f623db04e9 | |
parent | 6be89daa03a4c99b0d22a59a660b225a592ed0a9 (diff) |
[media] media/i2c: remove g_chip_ident op
This is no longer needed since the core now handles this through DBG_G_CHIP_INFO.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
47 files changed, 73 insertions, 671 deletions
diff --git a/drivers/media/i2c/ad9389b.c b/drivers/media/i2c/ad9389b.c index ade1fec7e040..ba4364dfae66 100644 --- a/drivers/media/i2c/ad9389b.c +++ b/drivers/media/i2c/ad9389b.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #include <linux/workqueue.h> | 32 | #include <linux/workqueue.h> |
33 | #include <linux/v4l2-dv-timings.h> | 33 | #include <linux/v4l2-dv-timings.h> |
34 | #include <media/v4l2-device.h> | 34 | #include <media/v4l2-device.h> |
35 | #include <media/v4l2-chip-ident.h> | ||
36 | #include <media/v4l2-common.h> | 35 | #include <media/v4l2-common.h> |
37 | #include <media/v4l2-ctrls.h> | 36 | #include <media/v4l2-ctrls.h> |
38 | #include <media/ad9389b.h> | 37 | #include <media/ad9389b.h> |
@@ -343,10 +342,6 @@ static const struct v4l2_ctrl_ops ad9389b_ctrl_ops = { | |||
343 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 342 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
344 | static int ad9389b_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) | 343 | static int ad9389b_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) |
345 | { | 344 | { |
346 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
347 | |||
348 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
349 | return -EINVAL; | ||
350 | reg->val = ad9389b_rd(sd, reg->reg & 0xff); | 345 | reg->val = ad9389b_rd(sd, reg->reg & 0xff); |
351 | reg->size = 1; | 346 | reg->size = 1; |
352 | return 0; | 347 | return 0; |
@@ -354,22 +349,11 @@ static int ad9389b_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register * | |||
354 | 349 | ||
355 | static int ad9389b_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) | 350 | static int ad9389b_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) |
356 | { | 351 | { |
357 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
358 | |||
359 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
360 | return -EINVAL; | ||
361 | ad9389b_wr(sd, reg->reg & 0xff, reg->val & 0xff); | 352 | ad9389b_wr(sd, reg->reg & 0xff, reg->val & 0xff); |
362 | return 0; | 353 | return 0; |
363 | } | 354 | } |
364 | #endif | 355 | #endif |
365 | 356 | ||
366 | static int ad9389b_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
367 | { | ||
368 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
369 | |||
370 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_AD9389B, 0); | ||
371 | } | ||
372 | |||
373 | static int ad9389b_log_status(struct v4l2_subdev *sd) | 357 | static int ad9389b_log_status(struct v4l2_subdev *sd) |
374 | { | 358 | { |
375 | struct ad9389b_state *state = get_ad9389b_state(sd); | 359 | struct ad9389b_state *state = get_ad9389b_state(sd); |
@@ -596,7 +580,6 @@ static int ad9389b_isr(struct v4l2_subdev *sd, u32 status, bool *handled) | |||
596 | 580 | ||
597 | static const struct v4l2_subdev_core_ops ad9389b_core_ops = { | 581 | static const struct v4l2_subdev_core_ops ad9389b_core_ops = { |
598 | .log_status = ad9389b_log_status, | 582 | .log_status = ad9389b_log_status, |
599 | .g_chip_ident = ad9389b_g_chip_ident, | ||
600 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 583 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
601 | .g_register = ad9389b_g_register, | 584 | .g_register = ad9389b_g_register, |
602 | .s_register = ad9389b_s_register, | 585 | .s_register = ad9389b_s_register, |
@@ -1303,8 +1286,8 @@ static int ad9389b_remove(struct i2c_client *client) | |||
1303 | /* ----------------------------------------------------------------------- */ | 1286 | /* ----------------------------------------------------------------------- */ |
1304 | 1287 | ||
1305 | static struct i2c_device_id ad9389b_id[] = { | 1288 | static struct i2c_device_id ad9389b_id[] = { |
1306 | { "ad9389b", V4L2_IDENT_AD9389B }, | 1289 | { "ad9389b", 0 }, |
1307 | { "ad9889b", V4L2_IDENT_AD9389B }, | 1290 | { "ad9889b", 0 }, |
1308 | { } | 1291 | { } |
1309 | }; | 1292 | }; |
1310 | MODULE_DEVICE_TABLE(i2c, ad9389b_id); | 1293 | MODULE_DEVICE_TABLE(i2c, ad9389b_id); |
diff --git a/drivers/media/i2c/adv7170.c b/drivers/media/i2c/adv7170.c index d07689d44354..04bb29720aaf 100644 --- a/drivers/media/i2c/adv7170.c +++ b/drivers/media/i2c/adv7170.c | |||
@@ -36,7 +36,6 @@ | |||
36 | #include <linux/i2c.h> | 36 | #include <linux/i2c.h> |
37 | #include <linux/videodev2.h> | 37 | #include <linux/videodev2.h> |
38 | #include <media/v4l2-device.h> | 38 | #include <media/v4l2-device.h> |
39 | #include <media/v4l2-chip-ident.h> | ||
40 | 39 | ||
41 | MODULE_DESCRIPTION("Analog Devices ADV7170 video encoder driver"); | 40 | MODULE_DESCRIPTION("Analog Devices ADV7170 video encoder driver"); |
42 | MODULE_AUTHOR("Maxim Yevtyushkin"); | 41 | MODULE_AUTHOR("Maxim Yevtyushkin"); |
@@ -317,19 +316,8 @@ static int adv7170_s_fmt(struct v4l2_subdev *sd, | |||
317 | return ret; | 316 | return ret; |
318 | } | 317 | } |
319 | 318 | ||
320 | static int adv7170_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
321 | { | ||
322 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
323 | |||
324 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_ADV7170, 0); | ||
325 | } | ||
326 | |||
327 | /* ----------------------------------------------------------------------- */ | 319 | /* ----------------------------------------------------------------------- */ |
328 | 320 | ||
329 | static const struct v4l2_subdev_core_ops adv7170_core_ops = { | ||
330 | .g_chip_ident = adv7170_g_chip_ident, | ||
331 | }; | ||
332 | |||
333 | static const struct v4l2_subdev_video_ops adv7170_video_ops = { | 321 | static const struct v4l2_subdev_video_ops adv7170_video_ops = { |
334 | .s_std_output = adv7170_s_std_output, | 322 | .s_std_output = adv7170_s_std_output, |
335 | .s_routing = adv7170_s_routing, | 323 | .s_routing = adv7170_s_routing, |
@@ -339,7 +327,6 @@ static const struct v4l2_subdev_video_ops adv7170_video_ops = { | |||
339 | }; | 327 | }; |
340 | 328 | ||
341 | static const struct v4l2_subdev_ops adv7170_ops = { | 329 | static const struct v4l2_subdev_ops adv7170_ops = { |
342 | .core = &adv7170_core_ops, | ||
343 | .video = &adv7170_video_ops, | 330 | .video = &adv7170_video_ops, |
344 | }; | 331 | }; |
345 | 332 | ||
diff --git a/drivers/media/i2c/adv7175.c b/drivers/media/i2c/adv7175.c index eaefa50b8d28..b88f3b3d5ed9 100644 --- a/drivers/media/i2c/adv7175.c +++ b/drivers/media/i2c/adv7175.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #include <linux/i2c.h> | 32 | #include <linux/i2c.h> |
33 | #include <linux/videodev2.h> | 33 | #include <linux/videodev2.h> |
34 | #include <media/v4l2-device.h> | 34 | #include <media/v4l2-device.h> |
35 | #include <media/v4l2-chip-ident.h> | ||
36 | 35 | ||
37 | MODULE_DESCRIPTION("Analog Devices ADV7175 video encoder driver"); | 36 | MODULE_DESCRIPTION("Analog Devices ADV7175 video encoder driver"); |
38 | MODULE_AUTHOR("Dave Perks"); | 37 | MODULE_AUTHOR("Dave Perks"); |
@@ -355,13 +354,6 @@ static int adv7175_s_fmt(struct v4l2_subdev *sd, | |||
355 | return ret; | 354 | return ret; |
356 | } | 355 | } |
357 | 356 | ||
358 | static int adv7175_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
359 | { | ||
360 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
361 | |||
362 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_ADV7175, 0); | ||
363 | } | ||
364 | |||
365 | static int adv7175_s_power(struct v4l2_subdev *sd, int on) | 357 | static int adv7175_s_power(struct v4l2_subdev *sd, int on) |
366 | { | 358 | { |
367 | if (on) | 359 | if (on) |
@@ -375,7 +367,6 @@ static int adv7175_s_power(struct v4l2_subdev *sd, int on) | |||
375 | /* ----------------------------------------------------------------------- */ | 367 | /* ----------------------------------------------------------------------- */ |
376 | 368 | ||
377 | static const struct v4l2_subdev_core_ops adv7175_core_ops = { | 369 | static const struct v4l2_subdev_core_ops adv7175_core_ops = { |
378 | .g_chip_ident = adv7175_g_chip_ident, | ||
379 | .init = adv7175_init, | 370 | .init = adv7175_init, |
380 | .s_power = adv7175_s_power, | 371 | .s_power = adv7175_s_power, |
381 | }; | 372 | }; |
diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c index 11f13a83a64b..d7d99f1c69e4 100644 --- a/drivers/media/i2c/adv7180.c +++ b/drivers/media/i2c/adv7180.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <linux/videodev2.h> | 29 | #include <linux/videodev2.h> |
30 | #include <media/v4l2-device.h> | 30 | #include <media/v4l2-device.h> |
31 | #include <media/v4l2-ctrls.h> | 31 | #include <media/v4l2-ctrls.h> |
32 | #include <media/v4l2-chip-ident.h> | ||
33 | #include <linux/mutex.h> | 32 | #include <linux/mutex.h> |
34 | 33 | ||
35 | #define ADV7180_INPUT_CONTROL_REG 0x00 | 34 | #define ADV7180_INPUT_CONTROL_REG 0x00 |
@@ -274,14 +273,6 @@ static int adv7180_g_input_status(struct v4l2_subdev *sd, u32 *status) | |||
274 | return ret; | 273 | return ret; |
275 | } | 274 | } |
276 | 275 | ||
277 | static int adv7180_g_chip_ident(struct v4l2_subdev *sd, | ||
278 | struct v4l2_dbg_chip_ident *chip) | ||
279 | { | ||
280 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
281 | |||
282 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_ADV7180, 0); | ||
283 | } | ||
284 | |||
285 | static int adv7180_s_std(struct v4l2_subdev *sd, v4l2_std_id std) | 276 | static int adv7180_s_std(struct v4l2_subdev *sd, v4l2_std_id std) |
286 | { | 277 | { |
287 | struct adv7180_state *state = to_state(sd); | 278 | struct adv7180_state *state = to_state(sd); |
@@ -450,7 +441,6 @@ static const struct v4l2_subdev_video_ops adv7180_video_ops = { | |||
450 | }; | 441 | }; |
451 | 442 | ||
452 | static const struct v4l2_subdev_core_ops adv7180_core_ops = { | 443 | static const struct v4l2_subdev_core_ops adv7180_core_ops = { |
453 | .g_chip_ident = adv7180_g_chip_ident, | ||
454 | .s_std = adv7180_s_std, | 444 | .s_std = adv7180_s_std, |
455 | }; | 445 | }; |
456 | 446 | ||
diff --git a/drivers/media/i2c/adv7183.c b/drivers/media/i2c/adv7183.c index 7c48e22b41a2..980815d37bb1 100644 --- a/drivers/media/i2c/adv7183.c +++ b/drivers/media/i2c/adv7183.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include <linux/videodev2.h> | 28 | #include <linux/videodev2.h> |
29 | 29 | ||
30 | #include <media/adv7183.h> | 30 | #include <media/adv7183.h> |
31 | #include <media/v4l2-chip-ident.h> | ||
32 | #include <media/v4l2-ctrls.h> | 31 | #include <media/v4l2-ctrls.h> |
33 | #include <media/v4l2-device.h> | 32 | #include <media/v4l2-device.h> |
34 | 33 | ||
@@ -481,25 +480,9 @@ static int adv7183_s_stream(struct v4l2_subdev *sd, int enable) | |||
481 | return 0; | 480 | return 0; |
482 | } | 481 | } |
483 | 482 | ||
484 | static int adv7183_g_chip_ident(struct v4l2_subdev *sd, | ||
485 | struct v4l2_dbg_chip_ident *chip) | ||
486 | { | ||
487 | int rev; | ||
488 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
489 | |||
490 | /* 0x11 for adv7183, 0x13 for adv7183b */ | ||
491 | rev = adv7183_read(sd, ADV7183_IDENT); | ||
492 | |||
493 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_ADV7183, rev); | ||
494 | } | ||
495 | |||
496 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 483 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
497 | static int adv7183_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) | 484 | static int adv7183_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) |
498 | { | 485 | { |
499 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
500 | |||
501 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
502 | return -EINVAL; | ||
503 | reg->val = adv7183_read(sd, reg->reg & 0xff); | 486 | reg->val = adv7183_read(sd, reg->reg & 0xff); |
504 | reg->size = 1; | 487 | reg->size = 1; |
505 | return 0; | 488 | return 0; |
@@ -507,10 +490,6 @@ static int adv7183_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register * | |||
507 | 490 | ||
508 | static int adv7183_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) | 491 | static int adv7183_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) |
509 | { | 492 | { |
510 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
511 | |||
512 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
513 | return -EINVAL; | ||
514 | adv7183_write(sd, reg->reg & 0xff, reg->val & 0xff); | 493 | adv7183_write(sd, reg->reg & 0xff, reg->val & 0xff); |
515 | return 0; | 494 | return 0; |
516 | } | 495 | } |
@@ -525,7 +504,6 @@ static const struct v4l2_subdev_core_ops adv7183_core_ops = { | |||
525 | .g_std = adv7183_g_std, | 504 | .g_std = adv7183_g_std, |
526 | .s_std = adv7183_s_std, | 505 | .s_std = adv7183_s_std, |
527 | .reset = adv7183_reset, | 506 | .reset = adv7183_reset, |
528 | .g_chip_ident = adv7183_g_chip_ident, | ||
529 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 507 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
530 | .g_register = adv7183_g_register, | 508 | .g_register = adv7183_g_register, |
531 | .s_register = adv7183_s_register, | 509 | .s_register = adv7183_s_register, |
diff --git a/drivers/media/i2c/adv7343.c b/drivers/media/i2c/adv7343.c index 9fc2b985df0e..7606218ec4a7 100644 --- a/drivers/media/i2c/adv7343.c +++ b/drivers/media/i2c/adv7343.c | |||
@@ -28,7 +28,6 @@ | |||
28 | 28 | ||
29 | #include <media/adv7343.h> | 29 | #include <media/adv7343.h> |
30 | #include <media/v4l2-device.h> | 30 | #include <media/v4l2-device.h> |
31 | #include <media/v4l2-chip-ident.h> | ||
32 | #include <media/v4l2-ctrls.h> | 31 | #include <media/v4l2-ctrls.h> |
33 | 32 | ||
34 | #include "adv7343_regs.h" | 33 | #include "adv7343_regs.h" |
@@ -311,21 +310,12 @@ static int adv7343_s_ctrl(struct v4l2_ctrl *ctrl) | |||
311 | return -EINVAL; | 310 | return -EINVAL; |
312 | } | 311 | } |
313 | 312 | ||
314 | static int adv7343_g_chip_ident(struct v4l2_subdev *sd, | ||
315 | struct v4l2_dbg_chip_ident *chip) | ||
316 | { | ||
317 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
318 | |||
319 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_ADV7343, 0); | ||
320 | } | ||
321 | |||
322 | static const struct v4l2_ctrl_ops adv7343_ctrl_ops = { | 313 | static const struct v4l2_ctrl_ops adv7343_ctrl_ops = { |
323 | .s_ctrl = adv7343_s_ctrl, | 314 | .s_ctrl = adv7343_s_ctrl, |
324 | }; | 315 | }; |
325 | 316 | ||
326 | static const struct v4l2_subdev_core_ops adv7343_core_ops = { | 317 | static const struct v4l2_subdev_core_ops adv7343_core_ops = { |
327 | .log_status = adv7343_log_status, | 318 | .log_status = adv7343_log_status, |
328 | .g_chip_ident = adv7343_g_chip_ident, | ||
329 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, | 319 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, |
330 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, | 320 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, |
331 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, | 321 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, |
diff --git a/drivers/media/i2c/adv7393.c b/drivers/media/i2c/adv7393.c index ec505098598a..558f19154eb9 100644 --- a/drivers/media/i2c/adv7393.c +++ b/drivers/media/i2c/adv7393.c | |||
@@ -33,7 +33,6 @@ | |||
33 | 33 | ||
34 | #include <media/adv7393.h> | 34 | #include <media/adv7393.h> |
35 | #include <media/v4l2-device.h> | 35 | #include <media/v4l2-device.h> |
36 | #include <media/v4l2-chip-ident.h> | ||
37 | #include <media/v4l2-ctrls.h> | 36 | #include <media/v4l2-ctrls.h> |
38 | 37 | ||
39 | #include "adv7393_regs.h" | 38 | #include "adv7393_regs.h" |
@@ -301,21 +300,12 @@ static int adv7393_s_ctrl(struct v4l2_ctrl *ctrl) | |||
301 | return -EINVAL; | 300 | return -EINVAL; |
302 | } | 301 | } |
303 | 302 | ||
304 | static int adv7393_g_chip_ident(struct v4l2_subdev *sd, | ||
305 | struct v4l2_dbg_chip_ident *chip) | ||
306 | { | ||
307 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
308 | |||
309 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_ADV7393, 0); | ||
310 | } | ||
311 | |||
312 | static const struct v4l2_ctrl_ops adv7393_ctrl_ops = { | 303 | static const struct v4l2_ctrl_ops adv7393_ctrl_ops = { |
313 | .s_ctrl = adv7393_s_ctrl, | 304 | .s_ctrl = adv7393_s_ctrl, |
314 | }; | 305 | }; |
315 | 306 | ||
316 | static const struct v4l2_subdev_core_ops adv7393_core_ops = { | 307 | static const struct v4l2_subdev_core_ops adv7393_core_ops = { |
317 | .log_status = adv7393_log_status, | 308 | .log_status = adv7393_log_status, |
318 | .g_chip_ident = adv7393_g_chip_ident, | ||
319 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, | 309 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, |
320 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, | 310 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, |
321 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, | 311 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, |
diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index 5528cd15cc67..1d675b58fd71 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c | |||
@@ -38,7 +38,6 @@ | |||
38 | #include <linux/v4l2-dv-timings.h> | 38 | #include <linux/v4l2-dv-timings.h> |
39 | #include <media/v4l2-device.h> | 39 | #include <media/v4l2-device.h> |
40 | #include <media/v4l2-ctrls.h> | 40 | #include <media/v4l2-ctrls.h> |
41 | #include <media/v4l2-chip-ident.h> | ||
42 | #include <media/adv7604.h> | 41 | #include <media/adv7604.h> |
43 | 42 | ||
44 | static int debug; | 43 | static int debug; |
@@ -643,10 +642,6 @@ static void adv7604_inv_register(struct v4l2_subdev *sd) | |||
643 | static int adv7604_g_register(struct v4l2_subdev *sd, | 642 | static int adv7604_g_register(struct v4l2_subdev *sd, |
644 | struct v4l2_dbg_register *reg) | 643 | struct v4l2_dbg_register *reg) |
645 | { | 644 | { |
646 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
647 | |||
648 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
649 | return -EINVAL; | ||
650 | reg->size = 1; | 645 | reg->size = 1; |
651 | switch (reg->reg >> 8) { | 646 | switch (reg->reg >> 8) { |
652 | case 0: | 647 | case 0: |
@@ -699,10 +694,6 @@ static int adv7604_g_register(struct v4l2_subdev *sd, | |||
699 | static int adv7604_s_register(struct v4l2_subdev *sd, | 694 | static int adv7604_s_register(struct v4l2_subdev *sd, |
700 | const struct v4l2_dbg_register *reg) | 695 | const struct v4l2_dbg_register *reg) |
701 | { | 696 | { |
702 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
703 | |||
704 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
705 | return -EINVAL; | ||
706 | switch (reg->reg >> 8) { | 697 | switch (reg->reg >> 8) { |
707 | case 0: | 698 | case 0: |
708 | io_write(sd, reg->reg & 0xff, reg->val & 0xff); | 699 | io_write(sd, reg->reg & 0xff, reg->val & 0xff); |
@@ -980,14 +971,6 @@ static int adv7604_s_ctrl(struct v4l2_ctrl *ctrl) | |||
980 | return -EINVAL; | 971 | return -EINVAL; |
981 | } | 972 | } |
982 | 973 | ||
983 | static int adv7604_g_chip_ident(struct v4l2_subdev *sd, | ||
984 | struct v4l2_dbg_chip_ident *chip) | ||
985 | { | ||
986 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
987 | |||
988 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_ADV7604, 0); | ||
989 | } | ||
990 | |||
991 | /* ----------------------------------------------------------------------- */ | 974 | /* ----------------------------------------------------------------------- */ |
992 | 975 | ||
993 | static inline bool no_power(struct v4l2_subdev *sd) | 976 | static inline bool no_power(struct v4l2_subdev *sd) |
@@ -1783,7 +1766,6 @@ static const struct v4l2_subdev_core_ops adv7604_core_ops = { | |||
1783 | .s_ctrl = v4l2_subdev_s_ctrl, | 1766 | .s_ctrl = v4l2_subdev_s_ctrl, |
1784 | .queryctrl = v4l2_subdev_queryctrl, | 1767 | .queryctrl = v4l2_subdev_queryctrl, |
1785 | .querymenu = v4l2_subdev_querymenu, | 1768 | .querymenu = v4l2_subdev_querymenu, |
1786 | .g_chip_ident = adv7604_g_chip_ident, | ||
1787 | .interrupt_service_routine = adv7604_isr, | 1769 | .interrupt_service_routine = adv7604_isr, |
1788 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 1770 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
1789 | .g_register = adv7604_g_register, | 1771 | .g_register = adv7604_g_register, |
diff --git a/drivers/media/i2c/ak881x.c b/drivers/media/i2c/ak881x.c index b918c3f29cbe..fcd8a3f626fa 100644 --- a/drivers/media/i2c/ak881x.c +++ b/drivers/media/i2c/ak881x.c | |||
@@ -16,7 +16,6 @@ | |||
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | 17 | ||
18 | #include <media/ak881x.h> | 18 | #include <media/ak881x.h> |
19 | #include <media/v4l2-chip-ident.h> | ||
20 | #include <media/v4l2-common.h> | 19 | #include <media/v4l2-common.h> |
21 | #include <media/v4l2-device.h> | 20 | #include <media/v4l2-device.h> |
22 | 21 | ||
@@ -33,7 +32,6 @@ struct ak881x { | |||
33 | struct v4l2_subdev subdev; | 32 | struct v4l2_subdev subdev; |
34 | struct ak881x_pdata *pdata; | 33 | struct ak881x_pdata *pdata; |
35 | unsigned int lines; | 34 | unsigned int lines; |
36 | int id; /* DEVICE_ID code V4L2_IDENT_AK881X code from v4l2-chip-ident.h */ | ||
37 | char revision; /* DEVICE_REVISION content */ | 35 | char revision; /* DEVICE_REVISION content */ |
38 | }; | 36 | }; |
39 | 37 | ||
@@ -62,36 +60,15 @@ static struct ak881x *to_ak881x(const struct i2c_client *client) | |||
62 | return container_of(i2c_get_clientdata(client), struct ak881x, subdev); | 60 | return container_of(i2c_get_clientdata(client), struct ak881x, subdev); |
63 | } | 61 | } |
64 | 62 | ||
65 | static int ak881x_g_chip_ident(struct v4l2_subdev *sd, | ||
66 | struct v4l2_dbg_chip_ident *id) | ||
67 | { | ||
68 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
69 | struct ak881x *ak881x = to_ak881x(client); | ||
70 | |||
71 | if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) | ||
72 | return -EINVAL; | ||
73 | |||
74 | if (id->match.addr != client->addr) | ||
75 | return -ENODEV; | ||
76 | |||
77 | id->ident = ak881x->id; | ||
78 | id->revision = ak881x->revision; | ||
79 | |||
80 | return 0; | ||
81 | } | ||
82 | |||
83 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 63 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
84 | static int ak881x_g_register(struct v4l2_subdev *sd, | 64 | static int ak881x_g_register(struct v4l2_subdev *sd, |
85 | struct v4l2_dbg_register *reg) | 65 | struct v4l2_dbg_register *reg) |
86 | { | 66 | { |
87 | struct i2c_client *client = v4l2_get_subdevdata(sd); | 67 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
88 | 68 | ||
89 | if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0x26) | 69 | if (reg->reg > 0x26) |
90 | return -EINVAL; | 70 | return -EINVAL; |
91 | 71 | ||
92 | if (reg->match.addr != client->addr) | ||
93 | return -ENODEV; | ||
94 | |||
95 | reg->val = reg_read(client, reg->reg); | 72 | reg->val = reg_read(client, reg->reg); |
96 | 73 | ||
97 | if (reg->val > 0xffff) | 74 | if (reg->val > 0xffff) |
@@ -105,12 +82,9 @@ static int ak881x_s_register(struct v4l2_subdev *sd, | |||
105 | { | 82 | { |
106 | struct i2c_client *client = v4l2_get_subdevdata(sd); | 83 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
107 | 84 | ||
108 | if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0x26) | 85 | if (reg->reg > 0x26) |
109 | return -EINVAL; | 86 | return -EINVAL; |
110 | 87 | ||
111 | if (reg->match.addr != client->addr) | ||
112 | return -ENODEV; | ||
113 | |||
114 | if (reg_write(client, reg->reg, reg->val) < 0) | 88 | if (reg_write(client, reg->reg, reg->val) < 0) |
115 | return -EIO; | 89 | return -EIO; |
116 | 90 | ||
@@ -229,7 +203,6 @@ static int ak881x_s_stream(struct v4l2_subdev *sd, int enable) | |||
229 | } | 203 | } |
230 | 204 | ||
231 | static struct v4l2_subdev_core_ops ak881x_subdev_core_ops = { | 205 | static struct v4l2_subdev_core_ops ak881x_subdev_core_ops = { |
232 | .g_chip_ident = ak881x_g_chip_ident, | ||
233 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 206 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
234 | .g_register = ak881x_g_register, | 207 | .g_register = ak881x_g_register, |
235 | .s_register = ak881x_s_register, | 208 | .s_register = ak881x_s_register, |
@@ -274,10 +247,7 @@ static int ak881x_probe(struct i2c_client *client, | |||
274 | 247 | ||
275 | switch (data) { | 248 | switch (data) { |
276 | case 0x13: | 249 | case 0x13: |
277 | ak881x->id = V4L2_IDENT_AK8813; | ||
278 | break; | ||
279 | case 0x14: | 250 | case 0x14: |
280 | ak881x->id = V4L2_IDENT_AK8814; | ||
281 | break; | 251 | break; |
282 | default: | 252 | default: |
283 | dev_err(&client->dev, | 253 | dev_err(&client->dev, |
diff --git a/drivers/media/i2c/bt819.c b/drivers/media/i2c/bt819.c index ee9ed67e7910..ae1eac01bbc7 100644 --- a/drivers/media/i2c/bt819.c +++ b/drivers/media/i2c/bt819.c | |||
@@ -36,7 +36,6 @@ | |||
36 | #include <linux/videodev2.h> | 36 | #include <linux/videodev2.h> |
37 | #include <linux/slab.h> | 37 | #include <linux/slab.h> |
38 | #include <media/v4l2-device.h> | 38 | #include <media/v4l2-device.h> |
39 | #include <media/v4l2-chip-ident.h> | ||
40 | #include <media/v4l2-ctrls.h> | 39 | #include <media/v4l2-ctrls.h> |
41 | #include <media/bt819.h> | 40 | #include <media/bt819.h> |
42 | 41 | ||
@@ -57,7 +56,6 @@ struct bt819 { | |||
57 | unsigned char reg[32]; | 56 | unsigned char reg[32]; |
58 | 57 | ||
59 | v4l2_std_id norm; | 58 | v4l2_std_id norm; |
60 | int ident; | ||
61 | int input; | 59 | int input; |
62 | int enable; | 60 | int enable; |
63 | }; | 61 | }; |
@@ -373,14 +371,6 @@ static int bt819_s_ctrl(struct v4l2_ctrl *ctrl) | |||
373 | return 0; | 371 | return 0; |
374 | } | 372 | } |
375 | 373 | ||
376 | static int bt819_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
377 | { | ||
378 | struct bt819 *decoder = to_bt819(sd); | ||
379 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
380 | |||
381 | return v4l2_chip_ident_i2c_client(client, chip, decoder->ident, 0); | ||
382 | } | ||
383 | |||
384 | /* ----------------------------------------------------------------------- */ | 374 | /* ----------------------------------------------------------------------- */ |
385 | 375 | ||
386 | static const struct v4l2_ctrl_ops bt819_ctrl_ops = { | 376 | static const struct v4l2_ctrl_ops bt819_ctrl_ops = { |
@@ -388,7 +378,6 @@ static const struct v4l2_ctrl_ops bt819_ctrl_ops = { | |||
388 | }; | 378 | }; |
389 | 379 | ||
390 | static const struct v4l2_subdev_core_ops bt819_core_ops = { | 380 | static const struct v4l2_subdev_core_ops bt819_core_ops = { |
391 | .g_chip_ident = bt819_g_chip_ident, | ||
392 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, | 381 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, |
393 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, | 382 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, |
394 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, | 383 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, |
@@ -435,15 +424,12 @@ static int bt819_probe(struct i2c_client *client, | |||
435 | switch (ver & 0xf0) { | 424 | switch (ver & 0xf0) { |
436 | case 0x70: | 425 | case 0x70: |
437 | name = "bt819a"; | 426 | name = "bt819a"; |
438 | decoder->ident = V4L2_IDENT_BT819A; | ||
439 | break; | 427 | break; |
440 | case 0x60: | 428 | case 0x60: |
441 | name = "bt817a"; | 429 | name = "bt817a"; |
442 | decoder->ident = V4L2_IDENT_BT817A; | ||
443 | break; | 430 | break; |
444 | case 0x20: | 431 | case 0x20: |
445 | name = "bt815a"; | 432 | name = "bt815a"; |
446 | decoder->ident = V4L2_IDENT_BT815A; | ||
447 | break; | 433 | break; |
448 | default: | 434 | default: |
449 | v4l2_dbg(1, debug, sd, | 435 | v4l2_dbg(1, debug, sd, |
diff --git a/drivers/media/i2c/bt856.c b/drivers/media/i2c/bt856.c index 7e5011163b62..7fc163d0253c 100644 --- a/drivers/media/i2c/bt856.c +++ b/drivers/media/i2c/bt856.c | |||
@@ -36,7 +36,6 @@ | |||
36 | #include <linux/i2c.h> | 36 | #include <linux/i2c.h> |
37 | #include <linux/videodev2.h> | 37 | #include <linux/videodev2.h> |
38 | #include <media/v4l2-device.h> | 38 | #include <media/v4l2-device.h> |
39 | #include <media/v4l2-chip-ident.h> | ||
40 | 39 | ||
41 | MODULE_DESCRIPTION("Brooktree-856A video encoder driver"); | 40 | MODULE_DESCRIPTION("Brooktree-856A video encoder driver"); |
42 | MODULE_AUTHOR("Mike Bernson & Dave Perks"); | 41 | MODULE_AUTHOR("Mike Bernson & Dave Perks"); |
@@ -177,17 +176,9 @@ static int bt856_s_routing(struct v4l2_subdev *sd, | |||
177 | return 0; | 176 | return 0; |
178 | } | 177 | } |
179 | 178 | ||
180 | static int bt856_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
181 | { | ||
182 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
183 | |||
184 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_BT856, 0); | ||
185 | } | ||
186 | |||
187 | /* ----------------------------------------------------------------------- */ | 179 | /* ----------------------------------------------------------------------- */ |
188 | 180 | ||
189 | static const struct v4l2_subdev_core_ops bt856_core_ops = { | 181 | static const struct v4l2_subdev_core_ops bt856_core_ops = { |
190 | .g_chip_ident = bt856_g_chip_ident, | ||
191 | .init = bt856_init, | 182 | .init = bt856_init, |
192 | }; | 183 | }; |
193 | 184 | ||
diff --git a/drivers/media/i2c/bt866.c b/drivers/media/i2c/bt866.c index 9355b924b471..a8bf10fc665d 100644 --- a/drivers/media/i2c/bt866.c +++ b/drivers/media/i2c/bt866.c | |||
@@ -36,7 +36,6 @@ | |||
36 | #include <linux/i2c.h> | 36 | #include <linux/i2c.h> |
37 | #include <linux/videodev2.h> | 37 | #include <linux/videodev2.h> |
38 | #include <media/v4l2-device.h> | 38 | #include <media/v4l2-device.h> |
39 | #include <media/v4l2-chip-ident.h> | ||
40 | 39 | ||
41 | MODULE_DESCRIPTION("Brooktree-866 video encoder driver"); | 40 | MODULE_DESCRIPTION("Brooktree-866 video encoder driver"); |
42 | MODULE_AUTHOR("Mike Bernson & Dave Perks"); | 41 | MODULE_AUTHOR("Mike Bernson & Dave Perks"); |
@@ -175,26 +174,14 @@ static int bt866_s_routing(struct v4l2_subdev *sd, | |||
175 | bt866_write(client, 0xdc, val); | 174 | bt866_write(client, 0xdc, val); |
176 | #endif | 175 | #endif |
177 | 176 | ||
178 | static int bt866_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
179 | { | ||
180 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
181 | |||
182 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_BT866, 0); | ||
183 | } | ||
184 | |||
185 | /* ----------------------------------------------------------------------- */ | 177 | /* ----------------------------------------------------------------------- */ |
186 | 178 | ||
187 | static const struct v4l2_subdev_core_ops bt866_core_ops = { | ||
188 | .g_chip_ident = bt866_g_chip_ident, | ||
189 | }; | ||
190 | |||
191 | static const struct v4l2_subdev_video_ops bt866_video_ops = { | 179 | static const struct v4l2_subdev_video_ops bt866_video_ops = { |
192 | .s_std_output = bt866_s_std_output, | 180 | .s_std_output = bt866_s_std_output, |
193 | .s_routing = bt866_s_routing, | 181 | .s_routing = bt866_s_routing, |
194 | }; | 182 | }; |
195 | 183 | ||
196 | static const struct v4l2_subdev_ops bt866_ops = { | 184 | static const struct v4l2_subdev_ops bt866_ops = { |
197 | .core = &bt866_core_ops, | ||
198 | .video = &bt866_video_ops, | 185 | .video = &bt866_video_ops, |
199 | }; | 186 | }; |
200 | 187 | ||
diff --git a/drivers/media/i2c/cs5345.c b/drivers/media/i2c/cs5345.c index 2661757c3a8c..34b76a9e7515 100644 --- a/drivers/media/i2c/cs5345.c +++ b/drivers/media/i2c/cs5345.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <linux/videodev2.h> | 24 | #include <linux/videodev2.h> |
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <media/v4l2-device.h> | 26 | #include <media/v4l2-device.h> |
27 | #include <media/v4l2-chip-ident.h> | ||
28 | #include <media/v4l2-ctrls.h> | 27 | #include <media/v4l2-ctrls.h> |
29 | 28 | ||
30 | MODULE_DESCRIPTION("i2c device driver for cs5345 Audio ADC"); | 29 | MODULE_DESCRIPTION("i2c device driver for cs5345 Audio ADC"); |
@@ -99,10 +98,6 @@ static int cs5345_s_ctrl(struct v4l2_ctrl *ctrl) | |||
99 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 98 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
100 | static int cs5345_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) | 99 | static int cs5345_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) |
101 | { | 100 | { |
102 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
103 | |||
104 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
105 | return -EINVAL; | ||
106 | reg->size = 1; | 101 | reg->size = 1; |
107 | reg->val = cs5345_read(sd, reg->reg & 0x1f); | 102 | reg->val = cs5345_read(sd, reg->reg & 0x1f); |
108 | return 0; | 103 | return 0; |
@@ -110,22 +105,11 @@ static int cs5345_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *r | |||
110 | 105 | ||
111 | static int cs5345_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) | 106 | static int cs5345_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) |
112 | { | 107 | { |
113 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
114 | |||
115 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
116 | return -EINVAL; | ||
117 | cs5345_write(sd, reg->reg & 0x1f, reg->val & 0xff); | 108 | cs5345_write(sd, reg->reg & 0x1f, reg->val & 0xff); |
118 | return 0; | 109 | return 0; |
119 | } | 110 | } |
120 | #endif | 111 | #endif |
121 | 112 | ||
122 | static int cs5345_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
123 | { | ||
124 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
125 | |||
126 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_CS5345, 0); | ||
127 | } | ||
128 | |||
129 | static int cs5345_log_status(struct v4l2_subdev *sd) | 113 | static int cs5345_log_status(struct v4l2_subdev *sd) |
130 | { | 114 | { |
131 | u8 v = cs5345_read(sd, 0x09) & 7; | 115 | u8 v = cs5345_read(sd, 0x09) & 7; |
@@ -148,7 +132,6 @@ static const struct v4l2_ctrl_ops cs5345_ctrl_ops = { | |||
148 | 132 | ||
149 | static const struct v4l2_subdev_core_ops cs5345_core_ops = { | 133 | static const struct v4l2_subdev_core_ops cs5345_core_ops = { |
150 | .log_status = cs5345_log_status, | 134 | .log_status = cs5345_log_status, |
151 | .g_chip_ident = cs5345_g_chip_ident, | ||
152 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, | 135 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, |
153 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, | 136 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, |
154 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, | 137 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, |
diff --git a/drivers/media/i2c/cs53l32a.c b/drivers/media/i2c/cs53l32a.c index 1082fb775ab2..27400c16ef9a 100644 --- a/drivers/media/i2c/cs53l32a.c +++ b/drivers/media/i2c/cs53l32a.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include <linux/i2c.h> | 28 | #include <linux/i2c.h> |
29 | #include <linux/videodev2.h> | 29 | #include <linux/videodev2.h> |
30 | #include <media/v4l2-device.h> | 30 | #include <media/v4l2-device.h> |
31 | #include <media/v4l2-chip-ident.h> | ||
32 | #include <media/v4l2-ctrls.h> | 31 | #include <media/v4l2-ctrls.h> |
33 | 32 | ||
34 | MODULE_DESCRIPTION("i2c device driver for cs53l32a Audio ADC"); | 33 | MODULE_DESCRIPTION("i2c device driver for cs53l32a Audio ADC"); |
@@ -104,14 +103,6 @@ static int cs53l32a_s_ctrl(struct v4l2_ctrl *ctrl) | |||
104 | return -EINVAL; | 103 | return -EINVAL; |
105 | } | 104 | } |
106 | 105 | ||
107 | static int cs53l32a_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
108 | { | ||
109 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
110 | |||
111 | return v4l2_chip_ident_i2c_client(client, | ||
112 | chip, V4L2_IDENT_CS53l32A, 0); | ||
113 | } | ||
114 | |||
115 | static int cs53l32a_log_status(struct v4l2_subdev *sd) | 106 | static int cs53l32a_log_status(struct v4l2_subdev *sd) |
116 | { | 107 | { |
117 | struct cs53l32a_state *state = to_state(sd); | 108 | struct cs53l32a_state *state = to_state(sd); |
@@ -130,7 +121,6 @@ static const struct v4l2_ctrl_ops cs53l32a_ctrl_ops = { | |||
130 | 121 | ||
131 | static const struct v4l2_subdev_core_ops cs53l32a_core_ops = { | 122 | static const struct v4l2_subdev_core_ops cs53l32a_core_ops = { |
132 | .log_status = cs53l32a_log_status, | 123 | .log_status = cs53l32a_log_status, |
133 | .g_chip_ident = cs53l32a_g_chip_ident, | ||
134 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, | 124 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, |
135 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, | 125 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, |
136 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, | 126 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, |
diff --git a/drivers/media/i2c/cx25840/cx25840-core.c b/drivers/media/i2c/cx25840/cx25840-core.c index b81e32f371ae..6fbdad4fe054 100644 --- a/drivers/media/i2c/cx25840/cx25840-core.c +++ b/drivers/media/i2c/cx25840/cx25840-core.c | |||
@@ -45,7 +45,6 @@ | |||
45 | #include <linux/delay.h> | 45 | #include <linux/delay.h> |
46 | #include <linux/math64.h> | 46 | #include <linux/math64.h> |
47 | #include <media/v4l2-common.h> | 47 | #include <media/v4l2-common.h> |
48 | #include <media/v4l2-chip-ident.h> | ||
49 | #include <media/cx25840.h> | 48 | #include <media/cx25840.h> |
50 | 49 | ||
51 | #include "cx25840-core.h" | 50 | #include "cx25840-core.h" |
@@ -1662,8 +1661,6 @@ static int cx25840_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register * | |||
1662 | { | 1661 | { |
1663 | struct i2c_client *client = v4l2_get_subdevdata(sd); | 1662 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
1664 | 1663 | ||
1665 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
1666 | return -EINVAL; | ||
1667 | reg->size = 1; | 1664 | reg->size = 1; |
1668 | reg->val = cx25840_read(client, reg->reg & 0x0fff); | 1665 | reg->val = cx25840_read(client, reg->reg & 0x0fff); |
1669 | return 0; | 1666 | return 0; |
@@ -1673,8 +1670,6 @@ static int cx25840_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_regi | |||
1673 | { | 1670 | { |
1674 | struct i2c_client *client = v4l2_get_subdevdata(sd); | 1671 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
1675 | 1672 | ||
1676 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
1677 | return -EINVAL; | ||
1678 | cx25840_write(client, reg->reg & 0x0fff, reg->val & 0xff); | 1673 | cx25840_write(client, reg->reg & 0x0fff, reg->val & 0xff); |
1679 | return 0; | 1674 | return 0; |
1680 | } | 1675 | } |
@@ -1934,14 +1929,6 @@ static int cx25840_reset(struct v4l2_subdev *sd, u32 val) | |||
1934 | return 0; | 1929 | return 0; |
1935 | } | 1930 | } |
1936 | 1931 | ||
1937 | static int cx25840_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
1938 | { | ||
1939 | struct cx25840_state *state = to_state(sd); | ||
1940 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
1941 | |||
1942 | return v4l2_chip_ident_i2c_client(client, chip, state->id, state->rev); | ||
1943 | } | ||
1944 | |||
1945 | static int cx25840_log_status(struct v4l2_subdev *sd) | 1932 | static int cx25840_log_status(struct v4l2_subdev *sd) |
1946 | { | 1933 | { |
1947 | struct cx25840_state *state = to_state(sd); | 1934 | struct cx25840_state *state = to_state(sd); |
@@ -5047,7 +5034,6 @@ static const struct v4l2_ctrl_ops cx25840_ctrl_ops = { | |||
5047 | 5034 | ||
5048 | static const struct v4l2_subdev_core_ops cx25840_core_ops = { | 5035 | static const struct v4l2_subdev_core_ops cx25840_core_ops = { |
5049 | .log_status = cx25840_log_status, | 5036 | .log_status = cx25840_log_status, |
5050 | .g_chip_ident = cx25840_g_chip_ident, | ||
5051 | .g_ctrl = v4l2_subdev_g_ctrl, | 5037 | .g_ctrl = v4l2_subdev_g_ctrl, |
5052 | .s_ctrl = v4l2_subdev_s_ctrl, | 5038 | .s_ctrl = v4l2_subdev_s_ctrl, |
5053 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, | 5039 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, |
diff --git a/drivers/media/i2c/ks0127.c b/drivers/media/i2c/ks0127.c index c7227763240e..b5223e850a26 100644 --- a/drivers/media/i2c/ks0127.c +++ b/drivers/media/i2c/ks0127.c | |||
@@ -42,7 +42,6 @@ | |||
42 | #include <linux/videodev2.h> | 42 | #include <linux/videodev2.h> |
43 | #include <linux/slab.h> | 43 | #include <linux/slab.h> |
44 | #include <media/v4l2-device.h> | 44 | #include <media/v4l2-device.h> |
45 | #include <media/v4l2-chip-ident.h> | ||
46 | #include "ks0127.h" | 45 | #include "ks0127.h" |
47 | 46 | ||
48 | MODULE_DESCRIPTION("KS0127 video decoder driver"); | 47 | MODULE_DESCRIPTION("KS0127 video decoder driver"); |
@@ -200,7 +199,6 @@ struct adjust { | |||
200 | struct ks0127 { | 199 | struct ks0127 { |
201 | struct v4l2_subdev sd; | 200 | struct v4l2_subdev sd; |
202 | v4l2_std_id norm; | 201 | v4l2_std_id norm; |
203 | int ident; | ||
204 | u8 regs[256]; | 202 | u8 regs[256]; |
205 | }; | 203 | }; |
206 | 204 | ||
@@ -371,12 +369,9 @@ static void ks0127_and_or(struct v4l2_subdev *sd, u8 reg, u8 and_v, u8 or_v) | |||
371 | ****************************************************************************/ | 369 | ****************************************************************************/ |
372 | static void ks0127_init(struct v4l2_subdev *sd) | 370 | static void ks0127_init(struct v4l2_subdev *sd) |
373 | { | 371 | { |
374 | struct ks0127 *ks = to_ks0127(sd); | ||
375 | u8 *table = reg_defaults; | 372 | u8 *table = reg_defaults; |
376 | int i; | 373 | int i; |
377 | 374 | ||
378 | ks->ident = V4L2_IDENT_KS0127; | ||
379 | |||
380 | v4l2_dbg(1, debug, sd, "reset\n"); | 375 | v4l2_dbg(1, debug, sd, "reset\n"); |
381 | msleep(1); | 376 | msleep(1); |
382 | 377 | ||
@@ -397,7 +392,6 @@ static void ks0127_init(struct v4l2_subdev *sd) | |||
397 | 392 | ||
398 | 393 | ||
399 | if ((ks0127_read(sd, KS_STAT) & 0x80) == 0) { | 394 | if ((ks0127_read(sd, KS_STAT) & 0x80) == 0) { |
400 | ks->ident = V4L2_IDENT_KS0122S; | ||
401 | v4l2_dbg(1, debug, sd, "ks0122s found\n"); | 395 | v4l2_dbg(1, debug, sd, "ks0122s found\n"); |
402 | return; | 396 | return; |
403 | } | 397 | } |
@@ -408,7 +402,6 @@ static void ks0127_init(struct v4l2_subdev *sd) | |||
408 | break; | 402 | break; |
409 | 403 | ||
410 | case 9: | 404 | case 9: |
411 | ks->ident = V4L2_IDENT_KS0127B; | ||
412 | v4l2_dbg(1, debug, sd, "ks0127B Revision A found\n"); | 405 | v4l2_dbg(1, debug, sd, "ks0127B Revision A found\n"); |
413 | break; | 406 | break; |
414 | 407 | ||
@@ -646,18 +639,9 @@ static int ks0127_g_input_status(struct v4l2_subdev *sd, u32 *status) | |||
646 | return ks0127_status(sd, status, NULL); | 639 | return ks0127_status(sd, status, NULL); |
647 | } | 640 | } |
648 | 641 | ||
649 | static int ks0127_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
650 | { | ||
651 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
652 | struct ks0127 *ks = to_ks0127(sd); | ||
653 | |||
654 | return v4l2_chip_ident_i2c_client(client, chip, ks->ident, 0); | ||
655 | } | ||
656 | |||
657 | /* ----------------------------------------------------------------------- */ | 642 | /* ----------------------------------------------------------------------- */ |
658 | 643 | ||
659 | static const struct v4l2_subdev_core_ops ks0127_core_ops = { | 644 | static const struct v4l2_subdev_core_ops ks0127_core_ops = { |
660 | .g_chip_ident = ks0127_g_chip_ident, | ||
661 | .s_std = ks0127_s_std, | 645 | .s_std = ks0127_s_std, |
662 | }; | 646 | }; |
663 | 647 | ||
diff --git a/drivers/media/i2c/m52790.c b/drivers/media/i2c/m52790.c index 3eeb546be6d9..bf476358704d 100644 --- a/drivers/media/i2c/m52790.c +++ b/drivers/media/i2c/m52790.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <linux/videodev2.h> | 29 | #include <linux/videodev2.h> |
30 | #include <media/m52790.h> | 30 | #include <media/m52790.h> |
31 | #include <media/v4l2-device.h> | 31 | #include <media/v4l2-device.h> |
32 | #include <media/v4l2-chip-ident.h> | ||
33 | 32 | ||
34 | MODULE_DESCRIPTION("i2c device driver for m52790 A/V switch"); | 33 | MODULE_DESCRIPTION("i2c device driver for m52790 A/V switch"); |
35 | MODULE_AUTHOR("Hans Verkuil"); | 34 | MODULE_AUTHOR("Hans Verkuil"); |
@@ -83,10 +82,7 @@ static int m52790_s_routing(struct v4l2_subdev *sd, | |||
83 | static int m52790_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) | 82 | static int m52790_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) |
84 | { | 83 | { |
85 | struct m52790_state *state = to_state(sd); | 84 | struct m52790_state *state = to_state(sd); |
86 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
87 | 85 | ||
88 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
89 | return -EINVAL; | ||
90 | if (reg->reg != 0) | 86 | if (reg->reg != 0) |
91 | return -EINVAL; | 87 | return -EINVAL; |
92 | reg->size = 1; | 88 | reg->size = 1; |
@@ -97,10 +93,7 @@ static int m52790_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *r | |||
97 | static int m52790_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) | 93 | static int m52790_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) |
98 | { | 94 | { |
99 | struct m52790_state *state = to_state(sd); | 95 | struct m52790_state *state = to_state(sd); |
100 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
101 | 96 | ||
102 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
103 | return -EINVAL; | ||
104 | if (reg->reg != 0) | 97 | if (reg->reg != 0) |
105 | return -EINVAL; | 98 | return -EINVAL; |
106 | state->input = reg->val & 0x0303; | 99 | state->input = reg->val & 0x0303; |
@@ -110,13 +103,6 @@ static int m52790_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_regis | |||
110 | } | 103 | } |
111 | #endif | 104 | #endif |
112 | 105 | ||
113 | static int m52790_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
114 | { | ||
115 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
116 | |||
117 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_M52790, 0); | ||
118 | } | ||
119 | |||
120 | static int m52790_log_status(struct v4l2_subdev *sd) | 106 | static int m52790_log_status(struct v4l2_subdev *sd) |
121 | { | 107 | { |
122 | struct m52790_state *state = to_state(sd); | 108 | struct m52790_state *state = to_state(sd); |
@@ -132,7 +118,6 @@ static int m52790_log_status(struct v4l2_subdev *sd) | |||
132 | 118 | ||
133 | static const struct v4l2_subdev_core_ops m52790_core_ops = { | 119 | static const struct v4l2_subdev_core_ops m52790_core_ops = { |
134 | .log_status = m52790_log_status, | 120 | .log_status = m52790_log_status, |
135 | .g_chip_ident = m52790_g_chip_ident, | ||
136 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 121 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
137 | .g_register = m52790_g_register, | 122 | .g_register = m52790_g_register, |
138 | .s_register = m52790_s_register, | 123 | .s_register = m52790_s_register, |
diff --git a/drivers/media/i2c/msp3400-driver.c b/drivers/media/i2c/msp3400-driver.c index ae92c20790e3..8190fec68080 100644 --- a/drivers/media/i2c/msp3400-driver.c +++ b/drivers/media/i2c/msp3400-driver.c | |||
@@ -570,15 +570,6 @@ static int msp_s_i2s_clock_freq(struct v4l2_subdev *sd, u32 freq) | |||
570 | return 0; | 570 | return 0; |
571 | } | 571 | } |
572 | 572 | ||
573 | static int msp_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
574 | { | ||
575 | struct msp_state *state = to_state(sd); | ||
576 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
577 | |||
578 | return v4l2_chip_ident_i2c_client(client, chip, state->ident, | ||
579 | (state->rev1 << 16) | state->rev2); | ||
580 | } | ||
581 | |||
582 | static int msp_log_status(struct v4l2_subdev *sd) | 573 | static int msp_log_status(struct v4l2_subdev *sd) |
583 | { | 574 | { |
584 | struct msp_state *state = to_state(sd); | 575 | struct msp_state *state = to_state(sd); |
@@ -651,7 +642,6 @@ static const struct v4l2_ctrl_ops msp_ctrl_ops = { | |||
651 | 642 | ||
652 | static const struct v4l2_subdev_core_ops msp_core_ops = { | 643 | static const struct v4l2_subdev_core_ops msp_core_ops = { |
653 | .log_status = msp_log_status, | 644 | .log_status = msp_log_status, |
654 | .g_chip_ident = msp_g_chip_ident, | ||
655 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, | 645 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, |
656 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, | 646 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, |
657 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, | 647 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, |
diff --git a/drivers/media/i2c/mt9m032.c b/drivers/media/i2c/mt9m032.c index cca704e02f79..846b15f0bf64 100644 --- a/drivers/media/i2c/mt9m032.c +++ b/drivers/media/i2c/mt9m032.c | |||
@@ -554,10 +554,8 @@ static int mt9m032_g_register(struct v4l2_subdev *sd, | |||
554 | struct i2c_client *client = v4l2_get_subdevdata(&sensor->subdev); | 554 | struct i2c_client *client = v4l2_get_subdevdata(&sensor->subdev); |
555 | int val; | 555 | int val; |
556 | 556 | ||
557 | if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) | 557 | if (reg->reg > 0xff) |
558 | return -EINVAL; | 558 | return -EINVAL; |
559 | if (reg->match.addr != client->addr) | ||
560 | return -ENODEV; | ||
561 | 559 | ||
562 | val = mt9m032_read(client, reg->reg); | 560 | val = mt9m032_read(client, reg->reg); |
563 | if (val < 0) | 561 | if (val < 0) |
@@ -575,12 +573,9 @@ static int mt9m032_s_register(struct v4l2_subdev *sd, | |||
575 | struct mt9m032 *sensor = to_mt9m032(sd); | 573 | struct mt9m032 *sensor = to_mt9m032(sd); |
576 | struct i2c_client *client = v4l2_get_subdevdata(&sensor->subdev); | 574 | struct i2c_client *client = v4l2_get_subdevdata(&sensor->subdev); |
577 | 575 | ||
578 | if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) | 576 | if (reg->reg > 0xff) |
579 | return -EINVAL; | 577 | return -EINVAL; |
580 | 578 | ||
581 | if (reg->match.addr != client->addr) | ||
582 | return -ENODEV; | ||
583 | |||
584 | return mt9m032_write(client, reg->reg, reg->val); | 579 | return mt9m032_write(client, reg->reg, reg->val); |
585 | } | 580 | } |
586 | #endif | 581 | #endif |
diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c index bf49899945f8..fe3414866a63 100644 --- a/drivers/media/i2c/mt9p031.c +++ b/drivers/media/i2c/mt9p031.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include <linux/videodev2.h> | 25 | #include <linux/videodev2.h> |
26 | 26 | ||
27 | #include <media/mt9p031.h> | 27 | #include <media/mt9p031.h> |
28 | #include <media/v4l2-chip-ident.h> | ||
29 | #include <media/v4l2-ctrls.h> | 28 | #include <media/v4l2-ctrls.h> |
30 | #include <media/v4l2-device.h> | 29 | #include <media/v4l2-device.h> |
31 | #include <media/v4l2-subdev.h> | 30 | #include <media/v4l2-subdev.h> |
diff --git a/drivers/media/i2c/mt9v011.c b/drivers/media/i2c/mt9v011.c index 141919bf77fc..f74698cf14c9 100644 --- a/drivers/media/i2c/mt9v011.c +++ b/drivers/media/i2c/mt9v011.c | |||
@@ -12,7 +12,6 @@ | |||
12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
13 | #include <asm/div64.h> | 13 | #include <asm/div64.h> |
14 | #include <media/v4l2-device.h> | 14 | #include <media/v4l2-device.h> |
15 | #include <media/v4l2-chip-ident.h> | ||
16 | #include <media/v4l2-ctrls.h> | 15 | #include <media/v4l2-ctrls.h> |
17 | #include <media/mt9v011.h> | 16 | #include <media/mt9v011.h> |
18 | 17 | ||
@@ -407,11 +406,6 @@ static int mt9v011_s_mbus_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt | |||
407 | static int mt9v011_g_register(struct v4l2_subdev *sd, | 406 | static int mt9v011_g_register(struct v4l2_subdev *sd, |
408 | struct v4l2_dbg_register *reg) | 407 | struct v4l2_dbg_register *reg) |
409 | { | 408 | { |
410 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
411 | |||
412 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
413 | return -EINVAL; | ||
414 | |||
415 | reg->val = mt9v011_read(sd, reg->reg & 0xff); | 409 | reg->val = mt9v011_read(sd, reg->reg & 0xff); |
416 | reg->size = 2; | 410 | reg->size = 2; |
417 | 411 | ||
@@ -421,29 +415,12 @@ static int mt9v011_g_register(struct v4l2_subdev *sd, | |||
421 | static int mt9v011_s_register(struct v4l2_subdev *sd, | 415 | static int mt9v011_s_register(struct v4l2_subdev *sd, |
422 | const struct v4l2_dbg_register *reg) | 416 | const struct v4l2_dbg_register *reg) |
423 | { | 417 | { |
424 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
425 | |||
426 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
427 | return -EINVAL; | ||
428 | |||
429 | mt9v011_write(sd, reg->reg & 0xff, reg->val & 0xffff); | 418 | mt9v011_write(sd, reg->reg & 0xff, reg->val & 0xffff); |
430 | 419 | ||
431 | return 0; | 420 | return 0; |
432 | } | 421 | } |
433 | #endif | 422 | #endif |
434 | 423 | ||
435 | static int mt9v011_g_chip_ident(struct v4l2_subdev *sd, | ||
436 | struct v4l2_dbg_chip_ident *chip) | ||
437 | { | ||
438 | u16 version; | ||
439 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
440 | |||
441 | version = mt9v011_read(sd, R00_MT9V011_CHIP_VERSION); | ||
442 | |||
443 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_MT9V011, | ||
444 | version); | ||
445 | } | ||
446 | |||
447 | static int mt9v011_s_ctrl(struct v4l2_ctrl *ctrl) | 424 | static int mt9v011_s_ctrl(struct v4l2_ctrl *ctrl) |
448 | { | 425 | { |
449 | struct mt9v011 *core = | 426 | struct mt9v011 *core = |
@@ -485,7 +462,6 @@ static struct v4l2_ctrl_ops mt9v011_ctrl_ops = { | |||
485 | 462 | ||
486 | static const struct v4l2_subdev_core_ops mt9v011_core_ops = { | 463 | static const struct v4l2_subdev_core_ops mt9v011_core_ops = { |
487 | .reset = mt9v011_reset, | 464 | .reset = mt9v011_reset, |
488 | .g_chip_ident = mt9v011_g_chip_ident, | ||
489 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 465 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
490 | .g_register = mt9v011_g_register, | 466 | .g_register = mt9v011_g_register, |
491 | .s_register = mt9v011_s_register, | 467 | .s_register = mt9v011_s_register, |
diff --git a/drivers/media/i2c/noon010pc30.c b/drivers/media/i2c/noon010pc30.c index 2284b02102db..271d0b7967a6 100644 --- a/drivers/media/i2c/noon010pc30.c +++ b/drivers/media/i2c/noon010pc30.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
20 | #include <linux/regulator/consumer.h> | 20 | #include <linux/regulator/consumer.h> |
21 | #include <media/noon010pc30.h> | 21 | #include <media/noon010pc30.h> |
22 | #include <media/v4l2-chip-ident.h> | ||
23 | #include <linux/videodev2.h> | 22 | #include <linux/videodev2.h> |
24 | #include <linux/module.h> | 23 | #include <linux/module.h> |
25 | #include <media/v4l2-ctrls.h> | 24 | #include <media/v4l2-ctrls.h> |
diff --git a/drivers/media/i2c/ov7640.c b/drivers/media/i2c/ov7640.c index 5e117abaa2eb..faa64baf09e8 100644 --- a/drivers/media/i2c/ov7640.c +++ b/drivers/media/i2c/ov7640.c | |||
@@ -20,7 +20,6 @@ | |||
20 | #include <linux/i2c.h> | 20 | #include <linux/i2c.h> |
21 | #include <linux/videodev2.h> | 21 | #include <linux/videodev2.h> |
22 | #include <media/v4l2-device.h> | 22 | #include <media/v4l2-device.h> |
23 | #include <media/v4l2-chip-ident.h> | ||
24 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
25 | 24 | ||
26 | MODULE_DESCRIPTION("OmniVision ov7640 sensor driver"); | 25 | MODULE_DESCRIPTION("OmniVision ov7640 sensor driver"); |
diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c index b030279810d3..e8a1ce204036 100644 --- a/drivers/media/i2c/ov7670.c +++ b/drivers/media/i2c/ov7670.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/delay.h> | 17 | #include <linux/delay.h> |
18 | #include <linux/videodev2.h> | 18 | #include <linux/videodev2.h> |
19 | #include <media/v4l2-device.h> | 19 | #include <media/v4l2-device.h> |
20 | #include <media/v4l2-chip-ident.h> | ||
21 | #include <media/v4l2-ctrls.h> | 20 | #include <media/v4l2-ctrls.h> |
22 | #include <media/v4l2-mediabus.h> | 21 | #include <media/v4l2-mediabus.h> |
23 | #include <media/ov7670.h> | 22 | #include <media/ov7670.h> |
@@ -1462,23 +1461,12 @@ static const struct v4l2_ctrl_ops ov7670_ctrl_ops = { | |||
1462 | .g_volatile_ctrl = ov7670_g_volatile_ctrl, | 1461 | .g_volatile_ctrl = ov7670_g_volatile_ctrl, |
1463 | }; | 1462 | }; |
1464 | 1463 | ||
1465 | static int ov7670_g_chip_ident(struct v4l2_subdev *sd, | ||
1466 | struct v4l2_dbg_chip_ident *chip) | ||
1467 | { | ||
1468 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
1469 | |||
1470 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_OV7670, 0); | ||
1471 | } | ||
1472 | |||
1473 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 1464 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
1474 | static int ov7670_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) | 1465 | static int ov7670_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) |
1475 | { | 1466 | { |
1476 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
1477 | unsigned char val = 0; | 1467 | unsigned char val = 0; |
1478 | int ret; | 1468 | int ret; |
1479 | 1469 | ||
1480 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
1481 | return -EINVAL; | ||
1482 | ret = ov7670_read(sd, reg->reg & 0xff, &val); | 1470 | ret = ov7670_read(sd, reg->reg & 0xff, &val); |
1483 | reg->val = val; | 1471 | reg->val = val; |
1484 | reg->size = 1; | 1472 | reg->size = 1; |
@@ -1487,10 +1475,6 @@ static int ov7670_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *r | |||
1487 | 1475 | ||
1488 | static int ov7670_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) | 1476 | static int ov7670_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) |
1489 | { | 1477 | { |
1490 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
1491 | |||
1492 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
1493 | return -EINVAL; | ||
1494 | ov7670_write(sd, reg->reg & 0xff, reg->val & 0xff); | 1478 | ov7670_write(sd, reg->reg & 0xff, reg->val & 0xff); |
1495 | return 0; | 1479 | return 0; |
1496 | } | 1480 | } |
@@ -1499,7 +1483,6 @@ static int ov7670_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_regis | |||
1499 | /* ----------------------------------------------------------------------- */ | 1483 | /* ----------------------------------------------------------------------- */ |
1500 | 1484 | ||
1501 | static const struct v4l2_subdev_core_ops ov7670_core_ops = { | 1485 | static const struct v4l2_subdev_core_ops ov7670_core_ops = { |
1502 | .g_chip_ident = ov7670_g_chip_ident, | ||
1503 | .reset = ov7670_reset, | 1486 | .reset = ov7670_reset, |
1504 | .init = ov7670_init, | 1487 | .init = ov7670_init, |
1505 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 1488 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
diff --git a/drivers/media/i2c/saa6588.c b/drivers/media/i2c/saa6588.c index 729e78d94222..70bc72e795d0 100644 --- a/drivers/media/i2c/saa6588.c +++ b/drivers/media/i2c/saa6588.c | |||
@@ -33,7 +33,6 @@ | |||
33 | 33 | ||
34 | #include <media/saa6588.h> | 34 | #include <media/saa6588.h> |
35 | #include <media/v4l2-device.h> | 35 | #include <media/v4l2-device.h> |
36 | #include <media/v4l2-chip-ident.h> | ||
37 | 36 | ||
38 | 37 | ||
39 | /* insmod options */ | 38 | /* insmod options */ |
@@ -443,17 +442,9 @@ static int saa6588_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt) | |||
443 | return 0; | 442 | return 0; |
444 | } | 443 | } |
445 | 444 | ||
446 | static int saa6588_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
447 | { | ||
448 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
449 | |||
450 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_SAA6588, 0); | ||
451 | } | ||
452 | |||
453 | /* ----------------------------------------------------------------------- */ | 445 | /* ----------------------------------------------------------------------- */ |
454 | 446 | ||
455 | static const struct v4l2_subdev_core_ops saa6588_core_ops = { | 447 | static const struct v4l2_subdev_core_ops saa6588_core_ops = { |
456 | .g_chip_ident = saa6588_g_chip_ident, | ||
457 | .ioctl = saa6588_ioctl, | 448 | .ioctl = saa6588_ioctl, |
458 | }; | 449 | }; |
459 | 450 | ||
diff --git a/drivers/media/i2c/saa7110.c b/drivers/media/i2c/saa7110.c index e4026aa93f42..532105de96f0 100644 --- a/drivers/media/i2c/saa7110.c +++ b/drivers/media/i2c/saa7110.c | |||
@@ -35,7 +35,6 @@ | |||
35 | #include <linux/i2c.h> | 35 | #include <linux/i2c.h> |
36 | #include <linux/videodev2.h> | 36 | #include <linux/videodev2.h> |
37 | #include <media/v4l2-device.h> | 37 | #include <media/v4l2-device.h> |
38 | #include <media/v4l2-chip-ident.h> | ||
39 | #include <media/v4l2-ctrls.h> | 38 | #include <media/v4l2-ctrls.h> |
40 | 39 | ||
41 | MODULE_DESCRIPTION("Philips SAA7110 video decoder driver"); | 40 | MODULE_DESCRIPTION("Philips SAA7110 video decoder driver"); |
@@ -352,13 +351,6 @@ static int saa7110_s_ctrl(struct v4l2_ctrl *ctrl) | |||
352 | return 0; | 351 | return 0; |
353 | } | 352 | } |
354 | 353 | ||
355 | static int saa7110_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
356 | { | ||
357 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
358 | |||
359 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_SAA7110, 0); | ||
360 | } | ||
361 | |||
362 | /* ----------------------------------------------------------------------- */ | 354 | /* ----------------------------------------------------------------------- */ |
363 | 355 | ||
364 | static const struct v4l2_ctrl_ops saa7110_ctrl_ops = { | 356 | static const struct v4l2_ctrl_ops saa7110_ctrl_ops = { |
@@ -366,7 +358,6 @@ static const struct v4l2_ctrl_ops saa7110_ctrl_ops = { | |||
366 | }; | 358 | }; |
367 | 359 | ||
368 | static const struct v4l2_subdev_core_ops saa7110_core_ops = { | 360 | static const struct v4l2_subdev_core_ops saa7110_core_ops = { |
369 | .g_chip_ident = saa7110_g_chip_ident, | ||
370 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, | 361 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, |
371 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, | 362 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, |
372 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, | 363 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, |
diff --git a/drivers/media/i2c/saa7115.c b/drivers/media/i2c/saa7115.c index 4daa81c55a82..90c43f3fb0f1 100644 --- a/drivers/media/i2c/saa7115.c +++ b/drivers/media/i2c/saa7115.c | |||
@@ -46,7 +46,6 @@ | |||
46 | #include <linux/videodev2.h> | 46 | #include <linux/videodev2.h> |
47 | #include <media/v4l2-device.h> | 47 | #include <media/v4l2-device.h> |
48 | #include <media/v4l2-ctrls.h> | 48 | #include <media/v4l2-ctrls.h> |
49 | #include <media/v4l2-chip-ident.h> | ||
50 | #include <media/saa7115.h> | 49 | #include <media/saa7115.h> |
51 | #include <asm/div64.h> | 50 | #include <asm/div64.h> |
52 | 51 | ||
@@ -63,6 +62,16 @@ module_param(debug, bool, 0644); | |||
63 | MODULE_PARM_DESC(debug, "Debug level (0-1)"); | 62 | MODULE_PARM_DESC(debug, "Debug level (0-1)"); |
64 | 63 | ||
65 | 64 | ||
65 | enum saa711x_model { | ||
66 | SAA7111A, | ||
67 | SAA7111, | ||
68 | SAA7113, | ||
69 | GM7113C, | ||
70 | SAA7114, | ||
71 | SAA7115, | ||
72 | SAA7118, | ||
73 | }; | ||
74 | |||
66 | struct saa711x_state { | 75 | struct saa711x_state { |
67 | struct v4l2_subdev sd; | 76 | struct v4l2_subdev sd; |
68 | struct v4l2_ctrl_handler hdl; | 77 | struct v4l2_ctrl_handler hdl; |
@@ -80,7 +89,7 @@ struct saa711x_state { | |||
80 | int radio; | 89 | int radio; |
81 | int width; | 90 | int width; |
82 | int height; | 91 | int height; |
83 | u32 ident; | 92 | enum saa711x_model ident; |
84 | u32 audclk_freq; | 93 | u32 audclk_freq; |
85 | u32 crystal_freq; | 94 | u32 crystal_freq; |
86 | bool ucgc; | 95 | bool ucgc; |
@@ -111,10 +120,10 @@ static inline int saa711x_write(struct v4l2_subdev *sd, u8 reg, u8 value) | |||
111 | /* Sanity routine to check if a register is present */ | 120 | /* Sanity routine to check if a register is present */ |
112 | static int saa711x_has_reg(const int id, const u8 reg) | 121 | static int saa711x_has_reg(const int id, const u8 reg) |
113 | { | 122 | { |
114 | if (id == V4L2_IDENT_SAA7111) | 123 | if (id == SAA7111) |
115 | return reg < 0x20 && reg != 0x01 && reg != 0x0f && | 124 | return reg < 0x20 && reg != 0x01 && reg != 0x0f && |
116 | (reg < 0x13 || reg > 0x19) && reg != 0x1d && reg != 0x1e; | 125 | (reg < 0x13 || reg > 0x19) && reg != 0x1d && reg != 0x1e; |
117 | if (id == V4L2_IDENT_SAA7111A) | 126 | if (id == SAA7111A) |
118 | return reg < 0x20 && reg != 0x01 && reg != 0x0f && | 127 | return reg < 0x20 && reg != 0x01 && reg != 0x0f && |
119 | reg != 0x14 && reg != 0x18 && reg != 0x19 && | 128 | reg != 0x14 && reg != 0x18 && reg != 0x19 && |
120 | reg != 0x1d && reg != 0x1e; | 129 | reg != 0x1d && reg != 0x1e; |
@@ -127,18 +136,18 @@ static int saa711x_has_reg(const int id, const u8 reg) | |||
127 | return 0; | 136 | return 0; |
128 | 137 | ||
129 | switch (id) { | 138 | switch (id) { |
130 | case V4L2_IDENT_GM7113C: | 139 | case GM7113C: |
131 | return reg != 0x14 && (reg < 0x18 || reg > 0x1e) && reg < 0x20; | 140 | return reg != 0x14 && (reg < 0x18 || reg > 0x1e) && reg < 0x20; |
132 | case V4L2_IDENT_SAA7113: | 141 | case SAA7113: |
133 | return reg != 0x14 && (reg < 0x18 || reg > 0x1e) && (reg < 0x20 || reg > 0x3f) && | 142 | return reg != 0x14 && (reg < 0x18 || reg > 0x1e) && (reg < 0x20 || reg > 0x3f) && |
134 | reg != 0x5d && reg < 0x63; | 143 | reg != 0x5d && reg < 0x63; |
135 | case V4L2_IDENT_SAA7114: | 144 | case SAA7114: |
136 | return (reg < 0x1a || reg > 0x1e) && (reg < 0x20 || reg > 0x2f) && | 145 | return (reg < 0x1a || reg > 0x1e) && (reg < 0x20 || reg > 0x2f) && |
137 | (reg < 0x63 || reg > 0x7f) && reg != 0x33 && reg != 0x37 && | 146 | (reg < 0x63 || reg > 0x7f) && reg != 0x33 && reg != 0x37 && |
138 | reg != 0x81 && reg < 0xf0; | 147 | reg != 0x81 && reg < 0xf0; |
139 | case V4L2_IDENT_SAA7115: | 148 | case SAA7115: |
140 | return (reg < 0x20 || reg > 0x2f) && reg != 0x65 && (reg < 0xfc || reg > 0xfe); | 149 | return (reg < 0x20 || reg > 0x2f) && reg != 0x65 && (reg < 0xfc || reg > 0xfe); |
141 | case V4L2_IDENT_SAA7118: | 150 | case SAA7118: |
142 | return (reg < 0x1a || reg > 0x1d) && (reg < 0x20 || reg > 0x22) && | 151 | return (reg < 0x1a || reg > 0x1d) && (reg < 0x20 || reg > 0x22) && |
143 | (reg < 0x26 || reg > 0x28) && reg != 0x33 && reg != 0x37 && | 152 | (reg < 0x26 || reg > 0x28) && reg != 0x33 && reg != 0x37 && |
144 | (reg < 0x63 || reg > 0x7f) && reg != 0x81 && reg < 0xf0; | 153 | (reg < 0x63 || reg > 0x7f) && reg != 0x81 && reg < 0xf0; |
@@ -955,14 +964,14 @@ static void saa711x_set_v4lstd(struct v4l2_subdev *sd, v4l2_std_id std) | |||
955 | // This works for NTSC-M, SECAM-L and the 50Hz PAL variants. | 964 | // This works for NTSC-M, SECAM-L and the 50Hz PAL variants. |
956 | if (std & V4L2_STD_525_60) { | 965 | if (std & V4L2_STD_525_60) { |
957 | v4l2_dbg(1, debug, sd, "decoder set standard 60 Hz\n"); | 966 | v4l2_dbg(1, debug, sd, "decoder set standard 60 Hz\n"); |
958 | if (state->ident == V4L2_IDENT_GM7113C) | 967 | if (state->ident == GM7113C) |
959 | saa711x_writeregs(sd, gm7113c_cfg_60hz_video); | 968 | saa711x_writeregs(sd, gm7113c_cfg_60hz_video); |
960 | else | 969 | else |
961 | saa711x_writeregs(sd, saa7115_cfg_60hz_video); | 970 | saa711x_writeregs(sd, saa7115_cfg_60hz_video); |
962 | saa711x_set_size(sd, 720, 480); | 971 | saa711x_set_size(sd, 720, 480); |
963 | } else { | 972 | } else { |
964 | v4l2_dbg(1, debug, sd, "decoder set standard 50 Hz\n"); | 973 | v4l2_dbg(1, debug, sd, "decoder set standard 50 Hz\n"); |
965 | if (state->ident == V4L2_IDENT_GM7113C) | 974 | if (state->ident == GM7113C) |
966 | saa711x_writeregs(sd, gm7113c_cfg_50hz_video); | 975 | saa711x_writeregs(sd, gm7113c_cfg_50hz_video); |
967 | else | 976 | else |
968 | saa711x_writeregs(sd, saa7115_cfg_50hz_video); | 977 | saa711x_writeregs(sd, saa7115_cfg_50hz_video); |
@@ -978,8 +987,8 @@ static void saa711x_set_v4lstd(struct v4l2_subdev *sd, v4l2_std_id std) | |||
978 | 011 NTSC N (3.58MHz) PAL M (3.58MHz) | 987 | 011 NTSC N (3.58MHz) PAL M (3.58MHz) |
979 | 100 reserved NTSC-Japan (3.58MHz) | 988 | 100 reserved NTSC-Japan (3.58MHz) |
980 | */ | 989 | */ |
981 | if (state->ident <= V4L2_IDENT_SAA7113 || | 990 | if (state->ident <= SAA7113 || |
982 | state->ident == V4L2_IDENT_GM7113C) { | 991 | state->ident == GM7113C) { |
983 | u8 reg = saa711x_read(sd, R_0E_CHROMA_CNTL_1) & 0x8f; | 992 | u8 reg = saa711x_read(sd, R_0E_CHROMA_CNTL_1) & 0x8f; |
984 | 993 | ||
985 | if (std == V4L2_STD_PAL_M) { | 994 | if (std == V4L2_STD_PAL_M) { |
@@ -998,9 +1007,8 @@ static void saa711x_set_v4lstd(struct v4l2_subdev *sd, v4l2_std_id std) | |||
998 | /* restart task B if needed */ | 1007 | /* restart task B if needed */ |
999 | int taskb = saa711x_read(sd, R_80_GLOBAL_CNTL_1) & 0x10; | 1008 | int taskb = saa711x_read(sd, R_80_GLOBAL_CNTL_1) & 0x10; |
1000 | 1009 | ||
1001 | if (taskb && state->ident == V4L2_IDENT_SAA7114) { | 1010 | if (taskb && state->ident == SAA7114) |
1002 | saa711x_writeregs(sd, saa7115_cfg_vbi_on); | 1011 | saa711x_writeregs(sd, saa7115_cfg_vbi_on); |
1003 | } | ||
1004 | 1012 | ||
1005 | /* switch audio mode too! */ | 1013 | /* switch audio mode too! */ |
1006 | saa711x_s_clock_freq(sd, state->audclk_freq); | 1014 | saa711x_s_clock_freq(sd, state->audclk_freq); |
@@ -1022,7 +1030,7 @@ static void saa711x_set_lcr(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_forma | |||
1022 | 1030 | ||
1023 | #else | 1031 | #else |
1024 | /* SAA7113 and SAA7118 also should support VBI - Need testing */ | 1032 | /* SAA7113 and SAA7118 also should support VBI - Need testing */ |
1025 | if (state->ident != V4L2_IDENT_SAA7115) | 1033 | if (state->ident != SAA7115) |
1026 | return; | 1034 | return; |
1027 | #endif | 1035 | #endif |
1028 | 1036 | ||
@@ -1244,14 +1252,14 @@ static int saa711x_s_routing(struct v4l2_subdev *sd, | |||
1244 | u32 input, u32 output, u32 config) | 1252 | u32 input, u32 output, u32 config) |
1245 | { | 1253 | { |
1246 | struct saa711x_state *state = to_state(sd); | 1254 | struct saa711x_state *state = to_state(sd); |
1247 | u8 mask = (state->ident <= V4L2_IDENT_SAA7111A) ? 0xf8 : 0xf0; | 1255 | u8 mask = (state->ident <= SAA7111A) ? 0xf8 : 0xf0; |
1248 | 1256 | ||
1249 | v4l2_dbg(1, debug, sd, "decoder set input %d output %d\n", | 1257 | v4l2_dbg(1, debug, sd, "decoder set input %d output %d\n", |
1250 | input, output); | 1258 | input, output); |
1251 | 1259 | ||
1252 | /* saa7111/3 does not have these inputs */ | 1260 | /* saa7111/3 does not have these inputs */ |
1253 | if ((state->ident <= V4L2_IDENT_SAA7113 || | 1261 | if ((state->ident <= SAA7113 || |
1254 | state->ident == V4L2_IDENT_GM7113C) && | 1262 | state->ident == GM7113C) && |
1255 | (input == SAA7115_COMPOSITE4 || | 1263 | (input == SAA7115_COMPOSITE4 || |
1256 | input == SAA7115_COMPOSITE5)) { | 1264 | input == SAA7115_COMPOSITE5)) { |
1257 | return -EINVAL; | 1265 | return -EINVAL; |
@@ -1266,7 +1274,7 @@ static int saa711x_s_routing(struct v4l2_subdev *sd, | |||
1266 | state->input = input; | 1274 | state->input = input; |
1267 | 1275 | ||
1268 | /* saa7111 has slightly different input numbering */ | 1276 | /* saa7111 has slightly different input numbering */ |
1269 | if (state->ident <= V4L2_IDENT_SAA7111A) { | 1277 | if (state->ident <= SAA7111A) { |
1270 | if (input >= SAA7115_COMPOSITE4) | 1278 | if (input >= SAA7115_COMPOSITE4) |
1271 | input -= 2; | 1279 | input -= 2; |
1272 | /* saa7111 specific */ | 1280 | /* saa7111 specific */ |
@@ -1289,13 +1297,13 @@ static int saa711x_s_routing(struct v4l2_subdev *sd, | |||
1289 | (state->input >= SAA7115_SVIDEO0 ? 0x80 : 0x0)); | 1297 | (state->input >= SAA7115_SVIDEO0 ? 0x80 : 0x0)); |
1290 | 1298 | ||
1291 | state->output = output; | 1299 | state->output = output; |
1292 | if (state->ident == V4L2_IDENT_SAA7114 || | 1300 | if (state->ident == SAA7114 || |
1293 | state->ident == V4L2_IDENT_SAA7115) { | 1301 | state->ident == SAA7115) { |
1294 | saa711x_write(sd, R_83_X_PORT_I_O_ENA_AND_OUT_CLK, | 1302 | saa711x_write(sd, R_83_X_PORT_I_O_ENA_AND_OUT_CLK, |
1295 | (saa711x_read(sd, R_83_X_PORT_I_O_ENA_AND_OUT_CLK) & 0xfe) | | 1303 | (saa711x_read(sd, R_83_X_PORT_I_O_ENA_AND_OUT_CLK) & 0xfe) | |
1296 | (state->output & 0x01)); | 1304 | (state->output & 0x01)); |
1297 | } | 1305 | } |
1298 | if (state->ident > V4L2_IDENT_SAA7111A) { | 1306 | if (state->ident > SAA7111A) { |
1299 | if (config & SAA7115_IDQ_IS_DEFAULT) | 1307 | if (config & SAA7115_IDQ_IS_DEFAULT) |
1300 | saa711x_write(sd, R_85_I_PORT_SIGNAL_POLAR, 0x20); | 1308 | saa711x_write(sd, R_85_I_PORT_SIGNAL_POLAR, 0x20); |
1301 | else | 1309 | else |
@@ -1308,7 +1316,7 @@ static int saa711x_s_gpio(struct v4l2_subdev *sd, u32 val) | |||
1308 | { | 1316 | { |
1309 | struct saa711x_state *state = to_state(sd); | 1317 | struct saa711x_state *state = to_state(sd); |
1310 | 1318 | ||
1311 | if (state->ident > V4L2_IDENT_SAA7111A) | 1319 | if (state->ident > SAA7111A) |
1312 | return -EINVAL; | 1320 | return -EINVAL; |
1313 | saa711x_write(sd, 0x11, (saa711x_read(sd, 0x11) & 0x7f) | | 1321 | saa711x_write(sd, 0x11, (saa711x_read(sd, 0x11) & 0x7f) | |
1314 | (val ? 0x80 : 0)); | 1322 | (val ? 0x80 : 0)); |
@@ -1398,7 +1406,7 @@ static int saa711x_querystd(struct v4l2_subdev *sd, v4l2_std_id *std) | |||
1398 | 1406 | ||
1399 | reg1f = saa711x_read(sd, R_1F_STATUS_BYTE_2_VD_DEC); | 1407 | reg1f = saa711x_read(sd, R_1F_STATUS_BYTE_2_VD_DEC); |
1400 | 1408 | ||
1401 | if (state->ident == V4L2_IDENT_SAA7115) { | 1409 | if (state->ident == SAA7115) { |
1402 | reg1e = saa711x_read(sd, R_1E_STATUS_BYTE_1_VD_DEC); | 1410 | reg1e = saa711x_read(sd, R_1E_STATUS_BYTE_1_VD_DEC); |
1403 | 1411 | ||
1404 | v4l2_dbg(1, debug, sd, "Status byte 1 (0x1e)=0x%02x\n", reg1e); | 1412 | v4l2_dbg(1, debug, sd, "Status byte 1 (0x1e)=0x%02x\n", reg1e); |
@@ -1449,7 +1457,7 @@ static int saa711x_g_input_status(struct v4l2_subdev *sd, u32 *status) | |||
1449 | int reg1f; | 1457 | int reg1f; |
1450 | 1458 | ||
1451 | *status = V4L2_IN_ST_NO_SIGNAL; | 1459 | *status = V4L2_IN_ST_NO_SIGNAL; |
1452 | if (state->ident == V4L2_IDENT_SAA7115) | 1460 | if (state->ident == SAA7115) |
1453 | reg1e = saa711x_read(sd, R_1E_STATUS_BYTE_1_VD_DEC); | 1461 | reg1e = saa711x_read(sd, R_1E_STATUS_BYTE_1_VD_DEC); |
1454 | reg1f = saa711x_read(sd, R_1F_STATUS_BYTE_2_VD_DEC); | 1462 | reg1f = saa711x_read(sd, R_1F_STATUS_BYTE_2_VD_DEC); |
1455 | if ((reg1f & 0xc1) == 0x81 && (reg1e & 0xc0) == 0x80) | 1463 | if ((reg1f & 0xc1) == 0x81 && (reg1e & 0xc0) == 0x80) |
@@ -1460,10 +1468,6 @@ static int saa711x_g_input_status(struct v4l2_subdev *sd, u32 *status) | |||
1460 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 1468 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
1461 | static int saa711x_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) | 1469 | static int saa711x_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) |
1462 | { | 1470 | { |
1463 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
1464 | |||
1465 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
1466 | return -EINVAL; | ||
1467 | reg->val = saa711x_read(sd, reg->reg & 0xff); | 1471 | reg->val = saa711x_read(sd, reg->reg & 0xff); |
1468 | reg->size = 1; | 1472 | reg->size = 1; |
1469 | return 0; | 1473 | return 0; |
@@ -1471,23 +1475,11 @@ static int saa711x_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register * | |||
1471 | 1475 | ||
1472 | static int saa711x_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) | 1476 | static int saa711x_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) |
1473 | { | 1477 | { |
1474 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
1475 | |||
1476 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
1477 | return -EINVAL; | ||
1478 | saa711x_write(sd, reg->reg & 0xff, reg->val & 0xff); | 1478 | saa711x_write(sd, reg->reg & 0xff, reg->val & 0xff); |
1479 | return 0; | 1479 | return 0; |
1480 | } | 1480 | } |
1481 | #endif | 1481 | #endif |
1482 | 1482 | ||
1483 | static int saa711x_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
1484 | { | ||
1485 | struct saa711x_state *state = to_state(sd); | ||
1486 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
1487 | |||
1488 | return v4l2_chip_ident_i2c_client(client, chip, state->ident, 0); | ||
1489 | } | ||
1490 | |||
1491 | static int saa711x_log_status(struct v4l2_subdev *sd) | 1483 | static int saa711x_log_status(struct v4l2_subdev *sd) |
1492 | { | 1484 | { |
1493 | struct saa711x_state *state = to_state(sd); | 1485 | struct saa711x_state *state = to_state(sd); |
@@ -1496,7 +1488,7 @@ static int saa711x_log_status(struct v4l2_subdev *sd) | |||
1496 | int vcr; | 1488 | int vcr; |
1497 | 1489 | ||
1498 | v4l2_info(sd, "Audio frequency: %d Hz\n", state->audclk_freq); | 1490 | v4l2_info(sd, "Audio frequency: %d Hz\n", state->audclk_freq); |
1499 | if (state->ident != V4L2_IDENT_SAA7115) { | 1491 | if (state->ident != SAA7115) { |
1500 | /* status for the saa7114 */ | 1492 | /* status for the saa7114 */ |
1501 | reg1f = saa711x_read(sd, R_1F_STATUS_BYTE_2_VD_DEC); | 1493 | reg1f = saa711x_read(sd, R_1F_STATUS_BYTE_2_VD_DEC); |
1502 | signalOk = (reg1f & 0xc1) == 0x81; | 1494 | signalOk = (reg1f & 0xc1) == 0x81; |
@@ -1547,7 +1539,6 @@ static const struct v4l2_ctrl_ops saa711x_ctrl_ops = { | |||
1547 | 1539 | ||
1548 | static const struct v4l2_subdev_core_ops saa711x_core_ops = { | 1540 | static const struct v4l2_subdev_core_ops saa711x_core_ops = { |
1549 | .log_status = saa711x_log_status, | 1541 | .log_status = saa711x_log_status, |
1550 | .g_chip_ident = saa711x_g_chip_ident, | ||
1551 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, | 1542 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, |
1552 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, | 1543 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, |
1553 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, | 1544 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, |
@@ -1650,21 +1641,21 @@ static int saa711x_detect_chip(struct i2c_client *client, | |||
1650 | if (chip_ver[0] & 0xf0) { | 1641 | if (chip_ver[0] & 0xf0) { |
1651 | snprintf(name, CHIP_VER_SIZE, "saa711%ca", chip_id); | 1642 | snprintf(name, CHIP_VER_SIZE, "saa711%ca", chip_id); |
1652 | v4l_info(client, "saa7111a variant found\n"); | 1643 | v4l_info(client, "saa7111a variant found\n"); |
1653 | return V4L2_IDENT_SAA7111A; | 1644 | return SAA7111A; |
1654 | } | 1645 | } |
1655 | return V4L2_IDENT_SAA7111; | 1646 | return SAA7111; |
1656 | case '3': | 1647 | case '3': |
1657 | return V4L2_IDENT_SAA7113; | 1648 | return SAA7113; |
1658 | case '4': | 1649 | case '4': |
1659 | return V4L2_IDENT_SAA7114; | 1650 | return SAA7114; |
1660 | case '5': | 1651 | case '5': |
1661 | return V4L2_IDENT_SAA7115; | 1652 | return SAA7115; |
1662 | case '8': | 1653 | case '8': |
1663 | return V4L2_IDENT_SAA7118; | 1654 | return SAA7118; |
1664 | default: | 1655 | default: |
1665 | v4l2_info(client, | 1656 | v4l2_info(client, |
1666 | "WARNING: Philips/NXP chip unknown - Falling back to saa7111\n"); | 1657 | "WARNING: Philips/NXP chip unknown - Falling back to saa7111\n"); |
1667 | return V4L2_IDENT_SAA7111; | 1658 | return SAA7111; |
1668 | } | 1659 | } |
1669 | } | 1660 | } |
1670 | 1661 | ||
@@ -1695,7 +1686,7 @@ static int saa711x_detect_chip(struct i2c_client *client, | |||
1695 | "It seems to be a %s chip (%*ph) @ 0x%x.\n", | 1686 | "It seems to be a %s chip (%*ph) @ 0x%x.\n", |
1696 | name, 16, chip_ver, client->addr << 1); | 1687 | name, 16, chip_ver, client->addr << 1); |
1697 | 1688 | ||
1698 | return V4L2_IDENT_GM7113C; | 1689 | return GM7113C; |
1699 | } | 1690 | } |
1700 | 1691 | ||
1701 | /* Chip was not discovered. Return its ID and don't bind */ | 1692 | /* Chip was not discovered. Return its ID and don't bind */ |
@@ -1774,19 +1765,19 @@ static int saa711x_probe(struct i2c_client *client, | |||
1774 | /* init to 60hz/48khz */ | 1765 | /* init to 60hz/48khz */ |
1775 | state->crystal_freq = SAA7115_FREQ_24_576_MHZ; | 1766 | state->crystal_freq = SAA7115_FREQ_24_576_MHZ; |
1776 | switch (state->ident) { | 1767 | switch (state->ident) { |
1777 | case V4L2_IDENT_SAA7111: | 1768 | case SAA7111: |
1778 | case V4L2_IDENT_SAA7111A: | 1769 | case SAA7111A: |
1779 | saa711x_writeregs(sd, saa7111_init); | 1770 | saa711x_writeregs(sd, saa7111_init); |
1780 | break; | 1771 | break; |
1781 | case V4L2_IDENT_GM7113C: | 1772 | case GM7113C: |
1782 | case V4L2_IDENT_SAA7113: | 1773 | case SAA7113: |
1783 | saa711x_writeregs(sd, saa7113_init); | 1774 | saa711x_writeregs(sd, saa7113_init); |
1784 | break; | 1775 | break; |
1785 | default: | 1776 | default: |
1786 | state->crystal_freq = SAA7115_FREQ_32_11_MHZ; | 1777 | state->crystal_freq = SAA7115_FREQ_32_11_MHZ; |
1787 | saa711x_writeregs(sd, saa7115_init_auto_input); | 1778 | saa711x_writeregs(sd, saa7115_init_auto_input); |
1788 | } | 1779 | } |
1789 | if (state->ident > V4L2_IDENT_SAA7111A) | 1780 | if (state->ident > SAA7111A) |
1790 | saa711x_writeregs(sd, saa7115_init_misc); | 1781 | saa711x_writeregs(sd, saa7115_init_misc); |
1791 | saa711x_set_v4lstd(sd, V4L2_STD_NTSC); | 1782 | saa711x_set_v4lstd(sd, V4L2_STD_NTSC); |
1792 | v4l2_ctrl_handler_setup(hdl); | 1783 | v4l2_ctrl_handler_setup(hdl); |
diff --git a/drivers/media/i2c/saa7127.c b/drivers/media/i2c/saa7127.c index d9c388103e7a..264b755bedce 100644 --- a/drivers/media/i2c/saa7127.c +++ b/drivers/media/i2c/saa7127.c | |||
@@ -54,7 +54,6 @@ | |||
54 | #include <linux/i2c.h> | 54 | #include <linux/i2c.h> |
55 | #include <linux/videodev2.h> | 55 | #include <linux/videodev2.h> |
56 | #include <media/v4l2-device.h> | 56 | #include <media/v4l2-device.h> |
57 | #include <media/v4l2-chip-ident.h> | ||
58 | #include <media/saa7127.h> | 57 | #include <media/saa7127.h> |
59 | 58 | ||
60 | static int debug; | 59 | static int debug; |
@@ -251,10 +250,15 @@ static struct i2c_reg_value saa7127_init_config_50hz_secam[] = { | |||
251 | ********************************************************************** | 250 | ********************************************************************** |
252 | */ | 251 | */ |
253 | 252 | ||
253 | enum saa712x_model { | ||
254 | SAA7127, | ||
255 | SAA7129, | ||
256 | }; | ||
257 | |||
254 | struct saa7127_state { | 258 | struct saa7127_state { |
255 | struct v4l2_subdev sd; | 259 | struct v4l2_subdev sd; |
256 | v4l2_std_id std; | 260 | v4l2_std_id std; |
257 | u32 ident; | 261 | enum saa712x_model ident; |
258 | enum saa7127_input_type input_type; | 262 | enum saa7127_input_type input_type; |
259 | enum saa7127_output_type output_type; | 263 | enum saa7127_output_type output_type; |
260 | int video_enable; | 264 | int video_enable; |
@@ -482,7 +486,7 @@ static int saa7127_set_std(struct v4l2_subdev *sd, v4l2_std_id std) | |||
482 | inittab = saa7127_init_config_60hz; | 486 | inittab = saa7127_init_config_60hz; |
483 | state->reg_61 = SAA7127_60HZ_DAC_CONTROL; | 487 | state->reg_61 = SAA7127_60HZ_DAC_CONTROL; |
484 | 488 | ||
485 | } else if (state->ident == V4L2_IDENT_SAA7129 && | 489 | } else if (state->ident == SAA7129 && |
486 | (std & V4L2_STD_SECAM) && | 490 | (std & V4L2_STD_SECAM) && |
487 | !(std & (V4L2_STD_625_50 & ~V4L2_STD_SECAM))) { | 491 | !(std & (V4L2_STD_625_50 & ~V4L2_STD_SECAM))) { |
488 | 492 | ||
@@ -517,7 +521,7 @@ static int saa7127_set_output_type(struct v4l2_subdev *sd, int output) | |||
517 | break; | 521 | break; |
518 | 522 | ||
519 | case SAA7127_OUTPUT_TYPE_COMPOSITE: | 523 | case SAA7127_OUTPUT_TYPE_COMPOSITE: |
520 | if (state->ident == V4L2_IDENT_SAA7129) | 524 | if (state->ident == SAA7129) |
521 | state->reg_2d = 0x20; /* CVBS only */ | 525 | state->reg_2d = 0x20; /* CVBS only */ |
522 | else | 526 | else |
523 | state->reg_2d = 0x08; /* 00001000 CVBS only, RGB DAC's off (high impedance mode) */ | 527 | state->reg_2d = 0x08; /* 00001000 CVBS only, RGB DAC's off (high impedance mode) */ |
@@ -525,7 +529,7 @@ static int saa7127_set_output_type(struct v4l2_subdev *sd, int output) | |||
525 | break; | 529 | break; |
526 | 530 | ||
527 | case SAA7127_OUTPUT_TYPE_SVIDEO: | 531 | case SAA7127_OUTPUT_TYPE_SVIDEO: |
528 | if (state->ident == V4L2_IDENT_SAA7129) | 532 | if (state->ident == SAA7129) |
529 | state->reg_2d = 0x18; /* Y + C */ | 533 | state->reg_2d = 0x18; /* Y + C */ |
530 | else | 534 | else |
531 | state->reg_2d = 0xff; /*11111111 croma -> R, luma -> CVBS + G + B */ | 535 | state->reg_2d = 0xff; /*11111111 croma -> R, luma -> CVBS + G + B */ |
@@ -543,7 +547,7 @@ static int saa7127_set_output_type(struct v4l2_subdev *sd, int output) | |||
543 | break; | 547 | break; |
544 | 548 | ||
545 | case SAA7127_OUTPUT_TYPE_BOTH: | 549 | case SAA7127_OUTPUT_TYPE_BOTH: |
546 | if (state->ident == V4L2_IDENT_SAA7129) | 550 | if (state->ident == SAA7129) |
547 | state->reg_2d = 0x38; | 551 | state->reg_2d = 0x38; |
548 | else | 552 | else |
549 | state->reg_2d = 0xbf; | 553 | state->reg_2d = 0xbf; |
@@ -661,10 +665,6 @@ static int saa7127_s_vbi_data(struct v4l2_subdev *sd, const struct v4l2_sliced_v | |||
661 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 665 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
662 | static int saa7127_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) | 666 | static int saa7127_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) |
663 | { | 667 | { |
664 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
665 | |||
666 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
667 | return -EINVAL; | ||
668 | reg->val = saa7127_read(sd, reg->reg & 0xff); | 668 | reg->val = saa7127_read(sd, reg->reg & 0xff); |
669 | reg->size = 1; | 669 | reg->size = 1; |
670 | return 0; | 670 | return 0; |
@@ -672,23 +672,11 @@ static int saa7127_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register * | |||
672 | 672 | ||
673 | static int saa7127_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) | 673 | static int saa7127_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) |
674 | { | 674 | { |
675 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
676 | |||
677 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
678 | return -EINVAL; | ||
679 | saa7127_write(sd, reg->reg & 0xff, reg->val & 0xff); | 675 | saa7127_write(sd, reg->reg & 0xff, reg->val & 0xff); |
680 | return 0; | 676 | return 0; |
681 | } | 677 | } |
682 | #endif | 678 | #endif |
683 | 679 | ||
684 | static int saa7127_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
685 | { | ||
686 | struct saa7127_state *state = to_state(sd); | ||
687 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
688 | |||
689 | return v4l2_chip_ident_i2c_client(client, chip, state->ident, 0); | ||
690 | } | ||
691 | |||
692 | static int saa7127_log_status(struct v4l2_subdev *sd) | 680 | static int saa7127_log_status(struct v4l2_subdev *sd) |
693 | { | 681 | { |
694 | struct saa7127_state *state = to_state(sd); | 682 | struct saa7127_state *state = to_state(sd); |
@@ -708,7 +696,6 @@ static int saa7127_log_status(struct v4l2_subdev *sd) | |||
708 | 696 | ||
709 | static const struct v4l2_subdev_core_ops saa7127_core_ops = { | 697 | static const struct v4l2_subdev_core_ops saa7127_core_ops = { |
710 | .log_status = saa7127_log_status, | 698 | .log_status = saa7127_log_status, |
711 | .g_chip_ident = saa7127_g_chip_ident, | ||
712 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 699 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
713 | .g_register = saa7127_g_register, | 700 | .g_register = saa7127_g_register, |
714 | .s_register = saa7127_s_register, | 701 | .s_register = saa7127_s_register, |
@@ -777,10 +764,10 @@ static int saa7127_probe(struct i2c_client *client, | |||
777 | if (saa7127_read(sd, SAA7129_REG_FADE_KEY_COL2) == 0xaa) { | 764 | if (saa7127_read(sd, SAA7129_REG_FADE_KEY_COL2) == 0xaa) { |
778 | saa7127_write(sd, SAA7129_REG_FADE_KEY_COL2, | 765 | saa7127_write(sd, SAA7129_REG_FADE_KEY_COL2, |
779 | read_result); | 766 | read_result); |
780 | state->ident = V4L2_IDENT_SAA7129; | 767 | state->ident = SAA7129; |
781 | strlcpy(client->name, "saa7129", I2C_NAME_SIZE); | 768 | strlcpy(client->name, "saa7129", I2C_NAME_SIZE); |
782 | } else { | 769 | } else { |
783 | state->ident = V4L2_IDENT_SAA7127; | 770 | state->ident = SAA7127; |
784 | strlcpy(client->name, "saa7127", I2C_NAME_SIZE); | 771 | strlcpy(client->name, "saa7127", I2C_NAME_SIZE); |
785 | } | 772 | } |
786 | } | 773 | } |
@@ -804,7 +791,7 @@ static int saa7127_probe(struct i2c_client *client, | |||
804 | saa7127_set_input_type(sd, SAA7127_INPUT_TYPE_NORMAL); | 791 | saa7127_set_input_type(sd, SAA7127_INPUT_TYPE_NORMAL); |
805 | saa7127_set_video_enable(sd, 1); | 792 | saa7127_set_video_enable(sd, 1); |
806 | 793 | ||
807 | if (state->ident == V4L2_IDENT_SAA7129) | 794 | if (state->ident == SAA7129) |
808 | saa7127_write_inittab(sd, saa7129_init_config_extra); | 795 | saa7127_write_inittab(sd, saa7129_init_config_extra); |
809 | return 0; | 796 | return 0; |
810 | } | 797 | } |
@@ -825,10 +812,10 @@ static int saa7127_remove(struct i2c_client *client) | |||
825 | 812 | ||
826 | static struct i2c_device_id saa7127_id[] = { | 813 | static struct i2c_device_id saa7127_id[] = { |
827 | { "saa7127_auto", 0 }, /* auto-detection */ | 814 | { "saa7127_auto", 0 }, /* auto-detection */ |
828 | { "saa7126", V4L2_IDENT_SAA7127 }, | 815 | { "saa7126", SAA7127 }, |
829 | { "saa7127", V4L2_IDENT_SAA7127 }, | 816 | { "saa7127", SAA7127 }, |
830 | { "saa7128", V4L2_IDENT_SAA7129 }, | 817 | { "saa7128", SAA7129 }, |
831 | { "saa7129", V4L2_IDENT_SAA7129 }, | 818 | { "saa7129", SAA7129 }, |
832 | { } | 819 | { } |
833 | }; | 820 | }; |
834 | MODULE_DEVICE_TABLE(i2c, saa7127_id); | 821 | MODULE_DEVICE_TABLE(i2c, saa7127_id); |
diff --git a/drivers/media/i2c/saa717x.c b/drivers/media/i2c/saa717x.c index 330a04c58939..401ca114ab99 100644 --- a/drivers/media/i2c/saa717x.c +++ b/drivers/media/i2c/saa717x.c | |||
@@ -977,10 +977,6 @@ static int saa717x_s_video_routing(struct v4l2_subdev *sd, | |||
977 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 977 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
978 | static int saa717x_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) | 978 | static int saa717x_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) |
979 | { | 979 | { |
980 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
981 | |||
982 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
983 | return -EINVAL; | ||
984 | reg->val = saa717x_read(sd, reg->reg); | 980 | reg->val = saa717x_read(sd, reg->reg); |
985 | reg->size = 1; | 981 | reg->size = 1; |
986 | return 0; | 982 | return 0; |
@@ -988,12 +984,9 @@ static int saa717x_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register * | |||
988 | 984 | ||
989 | static int saa717x_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) | 985 | static int saa717x_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) |
990 | { | 986 | { |
991 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
992 | u16 addr = reg->reg & 0xffff; | 987 | u16 addr = reg->reg & 0xffff; |
993 | u8 val = reg->val & 0xff; | 988 | u8 val = reg->val & 0xff; |
994 | 989 | ||
995 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
996 | return -EINVAL; | ||
997 | saa717x_write(sd, addr, val); | 990 | saa717x_write(sd, addr, val); |
998 | return 0; | 991 | return 0; |
999 | } | 992 | } |
diff --git a/drivers/media/i2c/saa7185.c b/drivers/media/i2c/saa7185.c index e95a0edc7f3e..f56c1c88b27d 100644 --- a/drivers/media/i2c/saa7185.c +++ b/drivers/media/i2c/saa7185.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #include <linux/i2c.h> | 32 | #include <linux/i2c.h> |
33 | #include <linux/videodev2.h> | 33 | #include <linux/videodev2.h> |
34 | #include <media/v4l2-device.h> | 34 | #include <media/v4l2-device.h> |
35 | #include <media/v4l2-chip-ident.h> | ||
36 | 35 | ||
37 | MODULE_DESCRIPTION("Philips SAA7185 video encoder driver"); | 36 | MODULE_DESCRIPTION("Philips SAA7185 video encoder driver"); |
38 | MODULE_AUTHOR("Dave Perks"); | 37 | MODULE_AUTHOR("Dave Perks"); |
@@ -285,17 +284,9 @@ static int saa7185_s_routing(struct v4l2_subdev *sd, | |||
285 | return 0; | 284 | return 0; |
286 | } | 285 | } |
287 | 286 | ||
288 | static int saa7185_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
289 | { | ||
290 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
291 | |||
292 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_SAA7185, 0); | ||
293 | } | ||
294 | |||
295 | /* ----------------------------------------------------------------------- */ | 287 | /* ----------------------------------------------------------------------- */ |
296 | 288 | ||
297 | static const struct v4l2_subdev_core_ops saa7185_core_ops = { | 289 | static const struct v4l2_subdev_core_ops saa7185_core_ops = { |
298 | .g_chip_ident = saa7185_g_chip_ident, | ||
299 | .init = saa7185_init, | 290 | .init = saa7185_init, |
300 | }; | 291 | }; |
301 | 292 | ||
diff --git a/drivers/media/i2c/saa7191.c b/drivers/media/i2c/saa7191.c index 84f7899a4044..08dcaecbeb98 100644 --- a/drivers/media/i2c/saa7191.c +++ b/drivers/media/i2c/saa7191.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <linux/videodev2.h> | 22 | #include <linux/videodev2.h> |
23 | #include <linux/i2c.h> | 23 | #include <linux/i2c.h> |
24 | #include <media/v4l2-device.h> | 24 | #include <media/v4l2-device.h> |
25 | #include <media/v4l2-chip-ident.h> | ||
26 | 25 | ||
27 | #include "saa7191.h" | 26 | #include "saa7191.h" |
28 | 27 | ||
@@ -567,18 +566,9 @@ static int saa7191_g_input_status(struct v4l2_subdev *sd, u32 *status) | |||
567 | } | 566 | } |
568 | 567 | ||
569 | 568 | ||
570 | static int saa7191_g_chip_ident(struct v4l2_subdev *sd, | ||
571 | struct v4l2_dbg_chip_ident *chip) | ||
572 | { | ||
573 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
574 | |||
575 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_SAA7191, 0); | ||
576 | } | ||
577 | |||
578 | /* ----------------------------------------------------------------------- */ | 569 | /* ----------------------------------------------------------------------- */ |
579 | 570 | ||
580 | static const struct v4l2_subdev_core_ops saa7191_core_ops = { | 571 | static const struct v4l2_subdev_core_ops saa7191_core_ops = { |
581 | .g_chip_ident = saa7191_g_chip_ident, | ||
582 | .g_ctrl = saa7191_g_ctrl, | 572 | .g_ctrl = saa7191_g_ctrl, |
583 | .s_ctrl = saa7191_s_ctrl, | 573 | .s_ctrl = saa7191_s_ctrl, |
584 | .s_std = saa7191_s_std, | 574 | .s_std = saa7191_s_std, |
diff --git a/drivers/media/i2c/tda9840.c b/drivers/media/i2c/tda9840.c index 3f1266246ca3..fbdff8b24eec 100644 --- a/drivers/media/i2c/tda9840.c +++ b/drivers/media/i2c/tda9840.c | |||
@@ -31,7 +31,6 @@ | |||
31 | #include <linux/slab.h> | 31 | #include <linux/slab.h> |
32 | #include <linux/i2c.h> | 32 | #include <linux/i2c.h> |
33 | #include <media/v4l2-device.h> | 33 | #include <media/v4l2-device.h> |
34 | #include <media/v4l2-chip-ident.h> | ||
35 | 34 | ||
36 | MODULE_AUTHOR("Michael Hunold <michael@mihu.de>"); | 35 | MODULE_AUTHOR("Michael Hunold <michael@mihu.de>"); |
37 | MODULE_DESCRIPTION("tda9840 driver"); | 36 | MODULE_DESCRIPTION("tda9840 driver"); |
@@ -145,26 +144,14 @@ static int tda9840_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *t) | |||
145 | return 0; | 144 | return 0; |
146 | } | 145 | } |
147 | 146 | ||
148 | static int tda9840_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
149 | { | ||
150 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
151 | |||
152 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_TDA9840, 0); | ||
153 | } | ||
154 | |||
155 | /* ----------------------------------------------------------------------- */ | 147 | /* ----------------------------------------------------------------------- */ |
156 | 148 | ||
157 | static const struct v4l2_subdev_core_ops tda9840_core_ops = { | ||
158 | .g_chip_ident = tda9840_g_chip_ident, | ||
159 | }; | ||
160 | |||
161 | static const struct v4l2_subdev_tuner_ops tda9840_tuner_ops = { | 149 | static const struct v4l2_subdev_tuner_ops tda9840_tuner_ops = { |
162 | .s_tuner = tda9840_s_tuner, | 150 | .s_tuner = tda9840_s_tuner, |
163 | .g_tuner = tda9840_g_tuner, | 151 | .g_tuner = tda9840_g_tuner, |
164 | }; | 152 | }; |
165 | 153 | ||
166 | static const struct v4l2_subdev_ops tda9840_ops = { | 154 | static const struct v4l2_subdev_ops tda9840_ops = { |
167 | .core = &tda9840_core_ops, | ||
168 | .tuner = &tda9840_tuner_ops, | 155 | .tuner = &tda9840_tuner_ops, |
169 | }; | 156 | }; |
170 | 157 | ||
diff --git a/drivers/media/i2c/tea6415c.c b/drivers/media/i2c/tea6415c.c index 52ebc384e453..bbe1a99fda36 100644 --- a/drivers/media/i2c/tea6415c.c +++ b/drivers/media/i2c/tea6415c.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <linux/slab.h> | 33 | #include <linux/slab.h> |
34 | #include <linux/i2c.h> | 34 | #include <linux/i2c.h> |
35 | #include <media/v4l2-device.h> | 35 | #include <media/v4l2-device.h> |
36 | #include <media/v4l2-chip-ident.h> | ||
37 | #include "tea6415c.h" | 36 | #include "tea6415c.h" |
38 | 37 | ||
39 | MODULE_AUTHOR("Michael Hunold <michael@mihu.de>"); | 38 | MODULE_AUTHOR("Michael Hunold <michael@mihu.de>"); |
@@ -119,25 +118,13 @@ static int tea6415c_s_routing(struct v4l2_subdev *sd, | |||
119 | return ret; | 118 | return ret; |
120 | } | 119 | } |
121 | 120 | ||
122 | static int tea6415c_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
123 | { | ||
124 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
125 | |||
126 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_TEA6415C, 0); | ||
127 | } | ||
128 | |||
129 | /* ----------------------------------------------------------------------- */ | 121 | /* ----------------------------------------------------------------------- */ |
130 | 122 | ||
131 | static const struct v4l2_subdev_core_ops tea6415c_core_ops = { | ||
132 | .g_chip_ident = tea6415c_g_chip_ident, | ||
133 | }; | ||
134 | |||
135 | static const struct v4l2_subdev_video_ops tea6415c_video_ops = { | 123 | static const struct v4l2_subdev_video_ops tea6415c_video_ops = { |
136 | .s_routing = tea6415c_s_routing, | 124 | .s_routing = tea6415c_s_routing, |
137 | }; | 125 | }; |
138 | 126 | ||
139 | static const struct v4l2_subdev_ops tea6415c_ops = { | 127 | static const struct v4l2_subdev_ops tea6415c_ops = { |
140 | .core = &tea6415c_core_ops, | ||
141 | .video = &tea6415c_video_ops, | 128 | .video = &tea6415c_video_ops, |
142 | }; | 129 | }; |
143 | 130 | ||
diff --git a/drivers/media/i2c/tea6420.c b/drivers/media/i2c/tea6420.c index 1f869742e3fe..30a8d75771af 100644 --- a/drivers/media/i2c/tea6420.c +++ b/drivers/media/i2c/tea6420.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <linux/slab.h> | 33 | #include <linux/slab.h> |
34 | #include <linux/i2c.h> | 34 | #include <linux/i2c.h> |
35 | #include <media/v4l2-device.h> | 35 | #include <media/v4l2-device.h> |
36 | #include <media/v4l2-chip-ident.h> | ||
37 | #include "tea6420.h" | 36 | #include "tea6420.h" |
38 | 37 | ||
39 | MODULE_AUTHOR("Michael Hunold <michael@mihu.de>"); | 38 | MODULE_AUTHOR("Michael Hunold <michael@mihu.de>"); |
@@ -90,25 +89,13 @@ static int tea6420_s_routing(struct v4l2_subdev *sd, | |||
90 | return 0; | 89 | return 0; |
91 | } | 90 | } |
92 | 91 | ||
93 | static int tea6420_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
94 | { | ||
95 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
96 | |||
97 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_TEA6420, 0); | ||
98 | } | ||
99 | |||
100 | /* ----------------------------------------------------------------------- */ | 92 | /* ----------------------------------------------------------------------- */ |
101 | 93 | ||
102 | static const struct v4l2_subdev_core_ops tea6420_core_ops = { | ||
103 | .g_chip_ident = tea6420_g_chip_ident, | ||
104 | }; | ||
105 | |||
106 | static const struct v4l2_subdev_audio_ops tea6420_audio_ops = { | 94 | static const struct v4l2_subdev_audio_ops tea6420_audio_ops = { |
107 | .s_routing = tea6420_s_routing, | 95 | .s_routing = tea6420_s_routing, |
108 | }; | 96 | }; |
109 | 97 | ||
110 | static const struct v4l2_subdev_ops tea6420_ops = { | 98 | static const struct v4l2_subdev_ops tea6420_ops = { |
111 | .core = &tea6420_core_ops, | ||
112 | .audio = &tea6420_audio_ops, | 99 | .audio = &tea6420_audio_ops, |
113 | }; | 100 | }; |
114 | 101 | ||
diff --git a/drivers/media/i2c/ths7303.c b/drivers/media/i2c/ths7303.c index b954195cfbe7..2e17abc77310 100644 --- a/drivers/media/i2c/ths7303.c +++ b/drivers/media/i2c/ths7303.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
27 | 27 | ||
28 | #include <media/ths7303.h> | 28 | #include <media/ths7303.h> |
29 | #include <media/v4l2-chip-ident.h> | ||
30 | #include <media/v4l2-device.h> | 29 | #include <media/v4l2-device.h> |
31 | 30 | ||
32 | #define THS7303_CHANNEL_1 1 | 31 | #define THS7303_CHANNEL_1 1 |
@@ -212,15 +211,6 @@ static int ths7303_s_dv_timings(struct v4l2_subdev *sd, | |||
212 | return ths7303_config(sd); | 211 | return ths7303_config(sd); |
213 | } | 212 | } |
214 | 213 | ||
215 | static int ths7303_g_chip_ident(struct v4l2_subdev *sd, | ||
216 | struct v4l2_dbg_chip_ident *chip) | ||
217 | { | ||
218 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
219 | struct ths7303_state *state = to_state(sd); | ||
220 | |||
221 | return v4l2_chip_ident_i2c_client(client, chip, state->driver_data, 0); | ||
222 | } | ||
223 | |||
224 | static const struct v4l2_subdev_video_ops ths7303_video_ops = { | 214 | static const struct v4l2_subdev_video_ops ths7303_video_ops = { |
225 | .s_stream = ths7303_s_stream, | 215 | .s_stream = ths7303_s_stream, |
226 | .s_std_output = ths7303_s_std_output, | 216 | .s_std_output = ths7303_s_std_output, |
@@ -232,11 +222,6 @@ static const struct v4l2_subdev_video_ops ths7303_video_ops = { | |||
232 | static int ths7303_g_register(struct v4l2_subdev *sd, | 222 | static int ths7303_g_register(struct v4l2_subdev *sd, |
233 | struct v4l2_dbg_register *reg) | 223 | struct v4l2_dbg_register *reg) |
234 | { | 224 | { |
235 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
236 | |||
237 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
238 | return -EINVAL; | ||
239 | |||
240 | reg->size = 1; | 225 | reg->size = 1; |
241 | reg->val = ths7303_read(sd, reg->reg); | 226 | reg->val = ths7303_read(sd, reg->reg); |
242 | return 0; | 227 | return 0; |
@@ -245,11 +230,6 @@ static int ths7303_g_register(struct v4l2_subdev *sd, | |||
245 | static int ths7303_s_register(struct v4l2_subdev *sd, | 230 | static int ths7303_s_register(struct v4l2_subdev *sd, |
246 | const struct v4l2_dbg_register *reg) | 231 | const struct v4l2_dbg_register *reg) |
247 | { | 232 | { |
248 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
249 | |||
250 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
251 | return -EINVAL; | ||
252 | |||
253 | ths7303_write(sd, reg->reg, reg->val); | 233 | ths7303_write(sd, reg->reg, reg->val); |
254 | return 0; | 234 | return 0; |
255 | } | 235 | } |
@@ -336,7 +316,6 @@ static int ths7303_log_status(struct v4l2_subdev *sd) | |||
336 | } | 316 | } |
337 | 317 | ||
338 | static const struct v4l2_subdev_core_ops ths7303_core_ops = { | 318 | static const struct v4l2_subdev_core_ops ths7303_core_ops = { |
339 | .g_chip_ident = ths7303_g_chip_ident, | ||
340 | .log_status = ths7303_log_status, | 319 | .log_status = ths7303_log_status, |
341 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 320 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
342 | .g_register = ths7303_g_register, | 321 | .g_register = ths7303_g_register, |
@@ -398,8 +377,8 @@ static int ths7303_remove(struct i2c_client *client) | |||
398 | } | 377 | } |
399 | 378 | ||
400 | static const struct i2c_device_id ths7303_id[] = { | 379 | static const struct i2c_device_id ths7303_id[] = { |
401 | {"ths7303", V4L2_IDENT_THS7303}, | 380 | {"ths7303", 0}, |
402 | {"ths7353", V4L2_IDENT_THS7353}, | 381 | {"ths7353", 0}, |
403 | {}, | 382 | {}, |
404 | }; | 383 | }; |
405 | 384 | ||
diff --git a/drivers/media/i2c/tvaudio.c b/drivers/media/i2c/tvaudio.c index fc69e9c27343..38135402019e 100644 --- a/drivers/media/i2c/tvaudio.c +++ b/drivers/media/i2c/tvaudio.c | |||
@@ -38,7 +38,6 @@ | |||
38 | 38 | ||
39 | #include <media/tvaudio.h> | 39 | #include <media/tvaudio.h> |
40 | #include <media/v4l2-device.h> | 40 | #include <media/v4l2-device.h> |
41 | #include <media/v4l2-chip-ident.h> | ||
42 | #include <media/v4l2-ctrls.h> | 41 | #include <media/v4l2-ctrls.h> |
43 | 42 | ||
44 | #include <media/i2c-addr.h> | 43 | #include <media/i2c-addr.h> |
@@ -1838,13 +1837,6 @@ static int tvaudio_s_frequency(struct v4l2_subdev *sd, const struct v4l2_frequen | |||
1838 | return 0; | 1837 | return 0; |
1839 | } | 1838 | } |
1840 | 1839 | ||
1841 | static int tvaudio_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
1842 | { | ||
1843 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
1844 | |||
1845 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_TVAUDIO, 0); | ||
1846 | } | ||
1847 | |||
1848 | static int tvaudio_log_status(struct v4l2_subdev *sd) | 1840 | static int tvaudio_log_status(struct v4l2_subdev *sd) |
1849 | { | 1841 | { |
1850 | struct CHIPSTATE *chip = to_state(sd); | 1842 | struct CHIPSTATE *chip = to_state(sd); |
@@ -1863,7 +1855,6 @@ static const struct v4l2_ctrl_ops tvaudio_ctrl_ops = { | |||
1863 | 1855 | ||
1864 | static const struct v4l2_subdev_core_ops tvaudio_core_ops = { | 1856 | static const struct v4l2_subdev_core_ops tvaudio_core_ops = { |
1865 | .log_status = tvaudio_log_status, | 1857 | .log_status = tvaudio_log_status, |
1866 | .g_chip_ident = tvaudio_g_chip_ident, | ||
1867 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, | 1858 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, |
1868 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, | 1859 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, |
1869 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, | 1860 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, |
diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c index 7438e015d879..b5c17eb89b4e 100644 --- a/drivers/media/i2c/tvp514x.c +++ b/drivers/media/i2c/tvp514x.c | |||
@@ -39,7 +39,6 @@ | |||
39 | #include <media/v4l2-device.h> | 39 | #include <media/v4l2-device.h> |
40 | #include <media/v4l2-common.h> | 40 | #include <media/v4l2-common.h> |
41 | #include <media/v4l2-mediabus.h> | 41 | #include <media/v4l2-mediabus.h> |
42 | #include <media/v4l2-chip-ident.h> | ||
43 | #include <media/v4l2-ctrls.h> | 42 | #include <media/v4l2-ctrls.h> |
44 | #include <media/tvp514x.h> | 43 | #include <media/tvp514x.h> |
45 | #include <media/media-entity.h> | 44 | #include <media/media-entity.h> |
diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c index b3cf26628c09..bef528233f7e 100644 --- a/drivers/media/i2c/tvp5150.c +++ b/drivers/media/i2c/tvp5150.c | |||
@@ -12,7 +12,6 @@ | |||
12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
13 | #include <media/v4l2-device.h> | 13 | #include <media/v4l2-device.h> |
14 | #include <media/tvp5150.h> | 14 | #include <media/tvp5150.h> |
15 | #include <media/v4l2-chip-ident.h> | ||
16 | #include <media/v4l2-ctrls.h> | 15 | #include <media/v4l2-ctrls.h> |
17 | 16 | ||
18 | #include "tvp5150_reg.h" | 17 | #include "tvp5150_reg.h" |
@@ -1031,29 +1030,11 @@ static int tvp5150_g_sliced_fmt(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_f | |||
1031 | return 0; | 1030 | return 0; |
1032 | } | 1031 | } |
1033 | 1032 | ||
1034 | static int tvp5150_g_chip_ident(struct v4l2_subdev *sd, | ||
1035 | struct v4l2_dbg_chip_ident *chip) | ||
1036 | { | ||
1037 | int rev; | ||
1038 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
1039 | |||
1040 | rev = tvp5150_read(sd, TVP5150_ROM_MAJOR_VER) << 8 | | ||
1041 | tvp5150_read(sd, TVP5150_ROM_MINOR_VER); | ||
1042 | |||
1043 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_TVP5150, | ||
1044 | rev); | ||
1045 | } | ||
1046 | |||
1047 | |||
1048 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 1033 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
1049 | static int tvp5150_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) | 1034 | static int tvp5150_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) |
1050 | { | 1035 | { |
1051 | int res; | 1036 | int res; |
1052 | 1037 | ||
1053 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
1054 | |||
1055 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
1056 | return -EINVAL; | ||
1057 | res = tvp5150_read(sd, reg->reg & 0xff); | 1038 | res = tvp5150_read(sd, reg->reg & 0xff); |
1058 | if (res < 0) { | 1039 | if (res < 0) { |
1059 | v4l2_err(sd, "%s: failed with error = %d\n", __func__, res); | 1040 | v4l2_err(sd, "%s: failed with error = %d\n", __func__, res); |
@@ -1067,10 +1048,6 @@ static int tvp5150_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register * | |||
1067 | 1048 | ||
1068 | static int tvp5150_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) | 1049 | static int tvp5150_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) |
1069 | { | 1050 | { |
1070 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
1071 | |||
1072 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
1073 | return -EINVAL; | ||
1074 | tvp5150_write(sd, reg->reg & 0xff, reg->val & 0xff); | 1051 | tvp5150_write(sd, reg->reg & 0xff, reg->val & 0xff); |
1075 | return 0; | 1052 | return 0; |
1076 | } | 1053 | } |
@@ -1094,7 +1071,6 @@ static const struct v4l2_subdev_core_ops tvp5150_core_ops = { | |||
1094 | .log_status = tvp5150_log_status, | 1071 | .log_status = tvp5150_log_status, |
1095 | .s_std = tvp5150_s_std, | 1072 | .s_std = tvp5150_s_std, |
1096 | .reset = tvp5150_reset, | 1073 | .reset = tvp5150_reset, |
1097 | .g_chip_ident = tvp5150_g_chip_ident, | ||
1098 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 1074 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
1099 | .g_register = tvp5150_g_register, | 1075 | .g_register = tvp5150_g_register, |
1100 | .s_register = tvp5150_s_register, | 1076 | .s_register = tvp5150_s_register, |
diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c index f339e6faca90..c2d0280ef3dc 100644 --- a/drivers/media/i2c/tvp7002.c +++ b/drivers/media/i2c/tvp7002.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #include <linux/v4l2-dv-timings.h> | 32 | #include <linux/v4l2-dv-timings.h> |
33 | #include <media/tvp7002.h> | 33 | #include <media/tvp7002.h> |
34 | #include <media/v4l2-device.h> | 34 | #include <media/v4l2-device.h> |
35 | #include <media/v4l2-chip-ident.h> | ||
36 | #include <media/v4l2-common.h> | 35 | #include <media/v4l2-common.h> |
37 | #include <media/v4l2-ctrls.h> | 36 | #include <media/v4l2-ctrls.h> |
38 | #include "tvp7002_reg.h" | 37 | #include "tvp7002_reg.h" |
@@ -533,29 +532,6 @@ static inline void tvp7002_write_err(struct v4l2_subdev *sd, u8 reg, | |||
533 | } | 532 | } |
534 | 533 | ||
535 | /* | 534 | /* |
536 | * tvp7002_g_chip_ident() - Get chip identification number | ||
537 | * @sd: ptr to v4l2_subdev struct | ||
538 | * @chip: ptr to v4l2_dbg_chip_ident struct | ||
539 | * | ||
540 | * Obtains the chip's identification number. | ||
541 | * Returns zero or -EINVAL if read operation fails. | ||
542 | */ | ||
543 | static int tvp7002_g_chip_ident(struct v4l2_subdev *sd, | ||
544 | struct v4l2_dbg_chip_ident *chip) | ||
545 | { | ||
546 | u8 rev; | ||
547 | int error; | ||
548 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
549 | |||
550 | error = tvp7002_read(sd, TVP7002_CHIP_REV, &rev); | ||
551 | |||
552 | if (error < 0) | ||
553 | return error; | ||
554 | |||
555 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_TVP7002, rev); | ||
556 | } | ||
557 | |||
558 | /* | ||
559 | * tvp7002_write_inittab() - Write initialization values | 535 | * tvp7002_write_inittab() - Write initialization values |
560 | * @sd: ptr to v4l2_subdev struct | 536 | * @sd: ptr to v4l2_subdev struct |
561 | * @regs: ptr to i2c_reg_value struct | 537 | * @regs: ptr to i2c_reg_value struct |
@@ -741,13 +717,9 @@ static int tvp7002_query_dv_timings(struct v4l2_subdev *sd, | |||
741 | static int tvp7002_g_register(struct v4l2_subdev *sd, | 717 | static int tvp7002_g_register(struct v4l2_subdev *sd, |
742 | struct v4l2_dbg_register *reg) | 718 | struct v4l2_dbg_register *reg) |
743 | { | 719 | { |
744 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
745 | u8 val; | 720 | u8 val; |
746 | int ret; | 721 | int ret; |
747 | 722 | ||
748 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
749 | return -EINVAL; | ||
750 | |||
751 | ret = tvp7002_read(sd, reg->reg & 0xff, &val); | 723 | ret = tvp7002_read(sd, reg->reg & 0xff, &val); |
752 | reg->val = val; | 724 | reg->val = val; |
753 | return ret; | 725 | return ret; |
@@ -764,11 +736,6 @@ static int tvp7002_g_register(struct v4l2_subdev *sd, | |||
764 | static int tvp7002_s_register(struct v4l2_subdev *sd, | 736 | static int tvp7002_s_register(struct v4l2_subdev *sd, |
765 | const struct v4l2_dbg_register *reg) | 737 | const struct v4l2_dbg_register *reg) |
766 | { | 738 | { |
767 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
768 | |||
769 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
770 | return -EINVAL; | ||
771 | |||
772 | return tvp7002_write(sd, reg->reg & 0xff, reg->val & 0xff); | 739 | return tvp7002_write(sd, reg->reg & 0xff, reg->val & 0xff); |
773 | } | 740 | } |
774 | #endif | 741 | #endif |
@@ -933,7 +900,6 @@ tvp7002_set_pad_format(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, | |||
933 | 900 | ||
934 | /* V4L2 core operation handlers */ | 901 | /* V4L2 core operation handlers */ |
935 | static const struct v4l2_subdev_core_ops tvp7002_core_ops = { | 902 | static const struct v4l2_subdev_core_ops tvp7002_core_ops = { |
936 | .g_chip_ident = tvp7002_g_chip_ident, | ||
937 | .log_status = tvp7002_log_status, | 903 | .log_status = tvp7002_log_status, |
938 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, | 904 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, |
939 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, | 905 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, |
diff --git a/drivers/media/i2c/tw2804.c b/drivers/media/i2c/tw2804.c index 41a5c9b31006..f58607df6193 100644 --- a/drivers/media/i2c/tw2804.c +++ b/drivers/media/i2c/tw2804.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
24 | #include <media/v4l2-subdev.h> | 24 | #include <media/v4l2-subdev.h> |
25 | #include <media/v4l2-device.h> | 25 | #include <media/v4l2-device.h> |
26 | #include <media/v4l2-chip-ident.h> | ||
27 | #include <media/v4l2-ctrls.h> | 26 | #include <media/v4l2-ctrls.h> |
28 | 27 | ||
29 | #define TW2804_REG_AUTOGAIN 0x02 | 28 | #define TW2804_REG_AUTOGAIN 0x02 |
diff --git a/drivers/media/i2c/upd64031a.c b/drivers/media/i2c/upd64031a.c index 13a4cf8bebdf..d248e6a12b8e 100644 --- a/drivers/media/i2c/upd64031a.c +++ b/drivers/media/i2c/upd64031a.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <linux/videodev2.h> | 27 | #include <linux/videodev2.h> |
28 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
29 | #include <media/v4l2-device.h> | 29 | #include <media/v4l2-device.h> |
30 | #include <media/v4l2-chip-ident.h> | ||
31 | #include <media/upd64031a.h> | 30 | #include <media/upd64031a.h> |
32 | 31 | ||
33 | /* --------------------- read registers functions define -------------------- */ | 32 | /* --------------------- read registers functions define -------------------- */ |
@@ -147,13 +146,6 @@ static int upd64031a_s_routing(struct v4l2_subdev *sd, | |||
147 | return upd64031a_s_frequency(sd, NULL); | 146 | return upd64031a_s_frequency(sd, NULL); |
148 | } | 147 | } |
149 | 148 | ||
150 | static int upd64031a_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
151 | { | ||
152 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
153 | |||
154 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_UPD64031A, 0); | ||
155 | } | ||
156 | |||
157 | static int upd64031a_log_status(struct v4l2_subdev *sd) | 149 | static int upd64031a_log_status(struct v4l2_subdev *sd) |
158 | { | 150 | { |
159 | v4l2_info(sd, "Status: SA00=0x%02x SA01=0x%02x\n", | 151 | v4l2_info(sd, "Status: SA00=0x%02x SA01=0x%02x\n", |
@@ -164,10 +156,6 @@ static int upd64031a_log_status(struct v4l2_subdev *sd) | |||
164 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 156 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
165 | static int upd64031a_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) | 157 | static int upd64031a_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) |
166 | { | 158 | { |
167 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
168 | |||
169 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
170 | return -EINVAL; | ||
171 | reg->val = upd64031a_read(sd, reg->reg & 0xff); | 159 | reg->val = upd64031a_read(sd, reg->reg & 0xff); |
172 | reg->size = 1; | 160 | reg->size = 1; |
173 | return 0; | 161 | return 0; |
@@ -175,10 +163,6 @@ static int upd64031a_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register | |||
175 | 163 | ||
176 | static int upd64031a_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) | 164 | static int upd64031a_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) |
177 | { | 165 | { |
178 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
179 | |||
180 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
181 | return -EINVAL; | ||
182 | upd64031a_write(sd, reg->reg & 0xff, reg->val & 0xff); | 166 | upd64031a_write(sd, reg->reg & 0xff, reg->val & 0xff); |
183 | return 0; | 167 | return 0; |
184 | } | 168 | } |
@@ -188,7 +172,6 @@ static int upd64031a_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_re | |||
188 | 172 | ||
189 | static const struct v4l2_subdev_core_ops upd64031a_core_ops = { | 173 | static const struct v4l2_subdev_core_ops upd64031a_core_ops = { |
190 | .log_status = upd64031a_log_status, | 174 | .log_status = upd64031a_log_status, |
191 | .g_chip_ident = upd64031a_g_chip_ident, | ||
192 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 175 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
193 | .g_register = upd64031a_g_register, | 176 | .g_register = upd64031a_g_register, |
194 | .s_register = upd64031a_s_register, | 177 | .s_register = upd64031a_s_register, |
diff --git a/drivers/media/i2c/upd64083.c b/drivers/media/i2c/upd64083.c index e296639ab90e..3a152ce7258a 100644 --- a/drivers/media/i2c/upd64083.c +++ b/drivers/media/i2c/upd64083.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <linux/videodev2.h> | 27 | #include <linux/videodev2.h> |
28 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
29 | #include <media/v4l2-device.h> | 29 | #include <media/v4l2-device.h> |
30 | #include <media/v4l2-chip-ident.h> | ||
31 | #include <media/upd64083.h> | 30 | #include <media/upd64083.h> |
32 | 31 | ||
33 | MODULE_DESCRIPTION("uPD64083 driver"); | 32 | MODULE_DESCRIPTION("uPD64083 driver"); |
@@ -122,10 +121,6 @@ static int upd64083_s_routing(struct v4l2_subdev *sd, | |||
122 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 121 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
123 | static int upd64083_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) | 122 | static int upd64083_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) |
124 | { | 123 | { |
125 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
126 | |||
127 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
128 | return -EINVAL; | ||
129 | reg->val = upd64083_read(sd, reg->reg & 0xff); | 124 | reg->val = upd64083_read(sd, reg->reg & 0xff); |
130 | reg->size = 1; | 125 | reg->size = 1; |
131 | return 0; | 126 | return 0; |
@@ -133,22 +128,11 @@ static int upd64083_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register | |||
133 | 128 | ||
134 | static int upd64083_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) | 129 | static int upd64083_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) |
135 | { | 130 | { |
136 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
137 | |||
138 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
139 | return -EINVAL; | ||
140 | upd64083_write(sd, reg->reg & 0xff, reg->val & 0xff); | 131 | upd64083_write(sd, reg->reg & 0xff, reg->val & 0xff); |
141 | return 0; | 132 | return 0; |
142 | } | 133 | } |
143 | #endif | 134 | #endif |
144 | 135 | ||
145 | static int upd64083_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
146 | { | ||
147 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
148 | |||
149 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_UPD64083, 0); | ||
150 | } | ||
151 | |||
152 | static int upd64083_log_status(struct v4l2_subdev *sd) | 136 | static int upd64083_log_status(struct v4l2_subdev *sd) |
153 | { | 137 | { |
154 | struct i2c_client *client = v4l2_get_subdevdata(sd); | 138 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
@@ -165,7 +149,6 @@ static int upd64083_log_status(struct v4l2_subdev *sd) | |||
165 | 149 | ||
166 | static const struct v4l2_subdev_core_ops upd64083_core_ops = { | 150 | static const struct v4l2_subdev_core_ops upd64083_core_ops = { |
167 | .log_status = upd64083_log_status, | 151 | .log_status = upd64083_log_status, |
168 | .g_chip_ident = upd64083_g_chip_ident, | ||
169 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 152 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
170 | .g_register = upd64083_g_register, | 153 | .g_register = upd64083_g_register, |
171 | .s_register = upd64083_s_register, | 154 | .s_register = upd64083_s_register, |
diff --git a/drivers/media/i2c/vp27smpx.c b/drivers/media/i2c/vp27smpx.c index 208a095d7bcc..6a3a3ff7ee6a 100644 --- a/drivers/media/i2c/vp27smpx.c +++ b/drivers/media/i2c/vp27smpx.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <linux/i2c.h> | 29 | #include <linux/i2c.h> |
30 | #include <linux/videodev2.h> | 30 | #include <linux/videodev2.h> |
31 | #include <media/v4l2-device.h> | 31 | #include <media/v4l2-device.h> |
32 | #include <media/v4l2-chip-ident.h> | ||
33 | 32 | ||
34 | MODULE_DESCRIPTION("vp27smpx driver"); | 33 | MODULE_DESCRIPTION("vp27smpx driver"); |
35 | MODULE_AUTHOR("Hans Verkuil"); | 34 | MODULE_AUTHOR("Hans Verkuil"); |
@@ -112,13 +111,6 @@ static int vp27smpx_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) | |||
112 | return 0; | 111 | return 0; |
113 | } | 112 | } |
114 | 113 | ||
115 | static int vp27smpx_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
116 | { | ||
117 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
118 | |||
119 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_VP27SMPX, 0); | ||
120 | } | ||
121 | |||
122 | static int vp27smpx_log_status(struct v4l2_subdev *sd) | 114 | static int vp27smpx_log_status(struct v4l2_subdev *sd) |
123 | { | 115 | { |
124 | struct vp27smpx_state *state = to_state(sd); | 116 | struct vp27smpx_state *state = to_state(sd); |
@@ -132,7 +124,6 @@ static int vp27smpx_log_status(struct v4l2_subdev *sd) | |||
132 | 124 | ||
133 | static const struct v4l2_subdev_core_ops vp27smpx_core_ops = { | 125 | static const struct v4l2_subdev_core_ops vp27smpx_core_ops = { |
134 | .log_status = vp27smpx_log_status, | 126 | .log_status = vp27smpx_log_status, |
135 | .g_chip_ident = vp27smpx_g_chip_ident, | ||
136 | .s_std = vp27smpx_s_std, | 127 | .s_std = vp27smpx_s_std, |
137 | }; | 128 | }; |
138 | 129 | ||
diff --git a/drivers/media/i2c/vpx3220.c b/drivers/media/i2c/vpx3220.c index f02e74b9b1ac..4c57d8a67c22 100644 --- a/drivers/media/i2c/vpx3220.c +++ b/drivers/media/i2c/vpx3220.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <linux/i2c.h> | 27 | #include <linux/i2c.h> |
28 | #include <linux/videodev2.h> | 28 | #include <linux/videodev2.h> |
29 | #include <media/v4l2-device.h> | 29 | #include <media/v4l2-device.h> |
30 | #include <media/v4l2-chip-ident.h> | ||
31 | #include <media/v4l2-ctrls.h> | 30 | #include <media/v4l2-ctrls.h> |
32 | 31 | ||
33 | MODULE_DESCRIPTION("vpx3220a/vpx3216b/vpx3214c video decoder driver"); | 32 | MODULE_DESCRIPTION("vpx3220a/vpx3216b/vpx3214c video decoder driver"); |
@@ -49,7 +48,6 @@ struct vpx3220 { | |||
49 | unsigned char reg[255]; | 48 | unsigned char reg[255]; |
50 | 49 | ||
51 | v4l2_std_id norm; | 50 | v4l2_std_id norm; |
52 | int ident; | ||
53 | int input; | 51 | int input; |
54 | int enable; | 52 | int enable; |
55 | }; | 53 | }; |
@@ -442,14 +440,6 @@ static int vpx3220_s_ctrl(struct v4l2_ctrl *ctrl) | |||
442 | return -EINVAL; | 440 | return -EINVAL; |
443 | } | 441 | } |
444 | 442 | ||
445 | static int vpx3220_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
446 | { | ||
447 | struct vpx3220 *decoder = to_vpx3220(sd); | ||
448 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
449 | |||
450 | return v4l2_chip_ident_i2c_client(client, chip, decoder->ident, 0); | ||
451 | } | ||
452 | |||
453 | /* ----------------------------------------------------------------------- */ | 443 | /* ----------------------------------------------------------------------- */ |
454 | 444 | ||
455 | static const struct v4l2_ctrl_ops vpx3220_ctrl_ops = { | 445 | static const struct v4l2_ctrl_ops vpx3220_ctrl_ops = { |
@@ -457,7 +447,6 @@ static const struct v4l2_ctrl_ops vpx3220_ctrl_ops = { | |||
457 | }; | 447 | }; |
458 | 448 | ||
459 | static const struct v4l2_subdev_core_ops vpx3220_core_ops = { | 449 | static const struct v4l2_subdev_core_ops vpx3220_core_ops = { |
460 | .g_chip_ident = vpx3220_g_chip_ident, | ||
461 | .init = vpx3220_init, | 450 | .init = vpx3220_init, |
462 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, | 451 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, |
463 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, | 452 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, |
@@ -528,7 +517,6 @@ static int vpx3220_probe(struct i2c_client *client, | |||
528 | ver = i2c_smbus_read_byte_data(client, 0x00); | 517 | ver = i2c_smbus_read_byte_data(client, 0x00); |
529 | pn = (i2c_smbus_read_byte_data(client, 0x02) << 8) + | 518 | pn = (i2c_smbus_read_byte_data(client, 0x02) << 8) + |
530 | i2c_smbus_read_byte_data(client, 0x01); | 519 | i2c_smbus_read_byte_data(client, 0x01); |
531 | decoder->ident = V4L2_IDENT_VPX3220A; | ||
532 | if (ver == 0xec) { | 520 | if (ver == 0xec) { |
533 | switch (pn) { | 521 | switch (pn) { |
534 | case 0x4680: | 522 | case 0x4680: |
@@ -536,11 +524,9 @@ static int vpx3220_probe(struct i2c_client *client, | |||
536 | break; | 524 | break; |
537 | case 0x4260: | 525 | case 0x4260: |
538 | name = "vpx3216b"; | 526 | name = "vpx3216b"; |
539 | decoder->ident = V4L2_IDENT_VPX3216B; | ||
540 | break; | 527 | break; |
541 | case 0x4280: | 528 | case 0x4280: |
542 | name = "vpx3214c"; | 529 | name = "vpx3214c"; |
543 | decoder->ident = V4L2_IDENT_VPX3214C; | ||
544 | break; | 530 | break; |
545 | } | 531 | } |
546 | } | 532 | } |
diff --git a/drivers/media/i2c/vs6624.c b/drivers/media/i2c/vs6624.c index d2209a35c510..25bdd9312fea 100644 --- a/drivers/media/i2c/vs6624.c +++ b/drivers/media/i2c/vs6624.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <linux/types.h> | 27 | #include <linux/types.h> |
28 | #include <linux/videodev2.h> | 28 | #include <linux/videodev2.h> |
29 | 29 | ||
30 | #include <media/v4l2-chip-ident.h> | ||
31 | #include <media/v4l2-ctrls.h> | 30 | #include <media/v4l2-ctrls.h> |
32 | #include <media/v4l2-device.h> | 31 | #include <media/v4l2-device.h> |
33 | #include <media/v4l2-mediabus.h> | 32 | #include <media/v4l2-mediabus.h> |
@@ -722,25 +721,9 @@ static int vs6624_s_stream(struct v4l2_subdev *sd, int enable) | |||
722 | return 0; | 721 | return 0; |
723 | } | 722 | } |
724 | 723 | ||
725 | static int vs6624_g_chip_ident(struct v4l2_subdev *sd, | ||
726 | struct v4l2_dbg_chip_ident *chip) | ||
727 | { | ||
728 | int rev; | ||
729 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
730 | |||
731 | rev = (vs6624_read(sd, VS6624_FW_VSN_MAJOR) << 8) | ||
732 | | vs6624_read(sd, VS6624_FW_VSN_MINOR); | ||
733 | |||
734 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_VS6624, rev); | ||
735 | } | ||
736 | |||
737 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 724 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
738 | static int vs6624_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) | 725 | static int vs6624_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) |
739 | { | 726 | { |
740 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
741 | |||
742 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
743 | return -EINVAL; | ||
744 | reg->val = vs6624_read(sd, reg->reg & 0xffff); | 727 | reg->val = vs6624_read(sd, reg->reg & 0xffff); |
745 | reg->size = 1; | 728 | reg->size = 1; |
746 | return 0; | 729 | return 0; |
@@ -748,10 +731,6 @@ static int vs6624_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *r | |||
748 | 731 | ||
749 | static int vs6624_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) | 732 | static int vs6624_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) |
750 | { | 733 | { |
751 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
752 | |||
753 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | ||
754 | return -EINVAL; | ||
755 | vs6624_write(sd, reg->reg & 0xffff, reg->val & 0xff); | 734 | vs6624_write(sd, reg->reg & 0xffff, reg->val & 0xff); |
756 | return 0; | 735 | return 0; |
757 | } | 736 | } |
@@ -762,7 +741,6 @@ static const struct v4l2_ctrl_ops vs6624_ctrl_ops = { | |||
762 | }; | 741 | }; |
763 | 742 | ||
764 | static const struct v4l2_subdev_core_ops vs6624_core_ops = { | 743 | static const struct v4l2_subdev_core_ops vs6624_core_ops = { |
765 | .g_chip_ident = vs6624_g_chip_ident, | ||
766 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 744 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
767 | .g_register = vs6624_g_register, | 745 | .g_register = vs6624_g_register, |
768 | .s_register = vs6624_s_register, | 746 | .s_register = vs6624_s_register, |
diff --git a/drivers/media/i2c/wm8739.c b/drivers/media/i2c/wm8739.c index ac3faa7bab2d..3be73f6a40e9 100644 --- a/drivers/media/i2c/wm8739.c +++ b/drivers/media/i2c/wm8739.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <linux/i2c.h> | 29 | #include <linux/i2c.h> |
30 | #include <linux/videodev2.h> | 30 | #include <linux/videodev2.h> |
31 | #include <media/v4l2-device.h> | 31 | #include <media/v4l2-device.h> |
32 | #include <media/v4l2-chip-ident.h> | ||
33 | #include <media/v4l2-ctrls.h> | 32 | #include <media/v4l2-ctrls.h> |
34 | 33 | ||
35 | MODULE_DESCRIPTION("wm8739 driver"); | 34 | MODULE_DESCRIPTION("wm8739 driver"); |
@@ -160,13 +159,6 @@ static int wm8739_s_clock_freq(struct v4l2_subdev *sd, u32 audiofreq) | |||
160 | return 0; | 159 | return 0; |
161 | } | 160 | } |
162 | 161 | ||
163 | static int wm8739_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
164 | { | ||
165 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
166 | |||
167 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_WM8739, 0); | ||
168 | } | ||
169 | |||
170 | static int wm8739_log_status(struct v4l2_subdev *sd) | 162 | static int wm8739_log_status(struct v4l2_subdev *sd) |
171 | { | 163 | { |
172 | struct wm8739_state *state = to_state(sd); | 164 | struct wm8739_state *state = to_state(sd); |
@@ -184,7 +176,6 @@ static const struct v4l2_ctrl_ops wm8739_ctrl_ops = { | |||
184 | 176 | ||
185 | static const struct v4l2_subdev_core_ops wm8739_core_ops = { | 177 | static const struct v4l2_subdev_core_ops wm8739_core_ops = { |
186 | .log_status = wm8739_log_status, | 178 | .log_status = wm8739_log_status, |
187 | .g_chip_ident = wm8739_g_chip_ident, | ||
188 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, | 179 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, |
189 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, | 180 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, |
190 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, | 181 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, |
diff --git a/drivers/media/i2c/wm8775.c b/drivers/media/i2c/wm8775.c index 75ded82d513f..3f584a7d0781 100644 --- a/drivers/media/i2c/wm8775.c +++ b/drivers/media/i2c/wm8775.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <linux/i2c.h> | 33 | #include <linux/i2c.h> |
34 | #include <linux/videodev2.h> | 34 | #include <linux/videodev2.h> |
35 | #include <media/v4l2-device.h> | 35 | #include <media/v4l2-device.h> |
36 | #include <media/v4l2-chip-ident.h> | ||
37 | #include <media/v4l2-ctrls.h> | 36 | #include <media/v4l2-ctrls.h> |
38 | #include <media/wm8775.h> | 37 | #include <media/wm8775.h> |
39 | 38 | ||
@@ -158,13 +157,6 @@ static int wm8775_s_ctrl(struct v4l2_ctrl *ctrl) | |||
158 | return -EINVAL; | 157 | return -EINVAL; |
159 | } | 158 | } |
160 | 159 | ||
161 | static int wm8775_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) | ||
162 | { | ||
163 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
164 | |||
165 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_WM8775, 0); | ||
166 | } | ||
167 | |||
168 | static int wm8775_log_status(struct v4l2_subdev *sd) | 160 | static int wm8775_log_status(struct v4l2_subdev *sd) |
169 | { | 161 | { |
170 | struct wm8775_state *state = to_state(sd); | 162 | struct wm8775_state *state = to_state(sd); |
@@ -188,7 +180,6 @@ static const struct v4l2_ctrl_ops wm8775_ctrl_ops = { | |||
188 | 180 | ||
189 | static const struct v4l2_subdev_core_ops wm8775_core_ops = { | 181 | static const struct v4l2_subdev_core_ops wm8775_core_ops = { |
190 | .log_status = wm8775_log_status, | 182 | .log_status = wm8775_log_status, |
191 | .g_chip_ident = wm8775_g_chip_ident, | ||
192 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, | 183 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, |
193 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, | 184 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, |
194 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, | 185 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, |