aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/soc_camera
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/i2c/soc_camera')
-rw-r--r--drivers/media/i2c/soc_camera/imx074.c19
-rw-r--r--drivers/media/i2c/soc_camera/mt9m001.c33
-rw-r--r--drivers/media/i2c/soc_camera/mt9m111.c33
-rw-r--r--drivers/media/i2c/soc_camera/mt9t031.c32
-rw-r--r--drivers/media/i2c/soc_camera/mt9t112.c16
-rw-r--r--drivers/media/i2c/soc_camera/mt9v022.c47
-rw-r--r--drivers/media/i2c/soc_camera/ov2640.c16
-rw-r--r--drivers/media/i2c/soc_camera/ov5642.c19
-rw-r--r--drivers/media/i2c/soc_camera/ov6650.c12
-rw-r--r--drivers/media/i2c/soc_camera/ov772x.c16
-rw-r--r--drivers/media/i2c/soc_camera/ov9640.c16
-rw-r--r--drivers/media/i2c/soc_camera/ov9740.c17
-rw-r--r--drivers/media/i2c/soc_camera/rj54n1cb0c.c31
-rw-r--r--drivers/media/i2c/soc_camera/tw9910.c14
14 files changed, 21 insertions, 300 deletions
diff --git a/drivers/media/i2c/soc_camera/imx074.c b/drivers/media/i2c/soc_camera/imx074.c
index a2a5cbbdbe28..a315d4386c8e 100644
--- a/drivers/media/i2c/soc_camera/imx074.c
+++ b/drivers/media/i2c/soc_camera/imx074.c
@@ -19,7 +19,6 @@
19 19
20#include <media/soc_camera.h> 20#include <media/soc_camera.h>
21#include <media/v4l2-subdev.h> 21#include <media/v4l2-subdev.h>
22#include <media/v4l2-chip-ident.h>
23 22
24/* IMX074 registers */ 23/* IMX074 registers */
25 24
@@ -251,23 +250,6 @@ static int imx074_s_stream(struct v4l2_subdev *sd, int enable)
251 return reg_write(client, MODE_SELECT, !!enable); 250 return reg_write(client, MODE_SELECT, !!enable);
252} 251}
253 252
254static int imx074_g_chip_ident(struct v4l2_subdev *sd,
255 struct v4l2_dbg_chip_ident *id)
256{
257 struct i2c_client *client = v4l2_get_subdevdata(sd);
258
259 if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
260 return -EINVAL;
261
262 if (id->match.addr != client->addr)
263 return -ENODEV;
264
265 id->ident = V4L2_IDENT_IMX074;
266 id->revision = 0;
267
268 return 0;
269}
270
271static int imx074_s_power(struct v4l2_subdev *sd, int on) 253static int imx074_s_power(struct v4l2_subdev *sd, int on)
272{ 254{
273 struct i2c_client *client = v4l2_get_subdevdata(sd); 255 struct i2c_client *client = v4l2_get_subdevdata(sd);
@@ -299,7 +281,6 @@ static struct v4l2_subdev_video_ops imx074_subdev_video_ops = {
299}; 281};
300 282
301static struct v4l2_subdev_core_ops imx074_subdev_core_ops = { 283static struct v4l2_subdev_core_ops imx074_subdev_core_ops = {
302 .g_chip_ident = imx074_g_chip_ident,
303 .s_power = imx074_s_power, 284 .s_power = imx074_s_power,
304}; 285};
305 286
diff --git a/drivers/media/i2c/soc_camera/mt9m001.c b/drivers/media/i2c/soc_camera/mt9m001.c
index dd9089805757..3f1f437ee1c6 100644
--- a/drivers/media/i2c/soc_camera/mt9m001.c
+++ b/drivers/media/i2c/soc_camera/mt9m001.c
@@ -17,7 +17,6 @@
17#include <media/soc_camera.h> 17#include <media/soc_camera.h>
18#include <media/soc_mediabus.h> 18#include <media/soc_mediabus.h>
19#include <media/v4l2-subdev.h> 19#include <media/v4l2-subdev.h>
20#include <media/v4l2-chip-ident.h>
21#include <media/v4l2-ctrls.h> 20#include <media/v4l2-ctrls.h>
22 21
23/* 22/*
@@ -97,7 +96,6 @@ struct mt9m001 {
97 const struct mt9m001_datafmt *fmt; 96 const struct mt9m001_datafmt *fmt;
98 const struct mt9m001_datafmt *fmts; 97 const struct mt9m001_datafmt *fmts;
99 int num_fmts; 98 int num_fmts;
100 int model; /* V4L2_IDENT_MT9M001* codes from v4l2-chip-ident.h */
101 unsigned int total_h; 99 unsigned int total_h;
102 unsigned short y_skip_top; /* Lines to skip at the top */ 100 unsigned short y_skip_top; /* Lines to skip at the top */
103}; 101};
@@ -320,36 +318,15 @@ static int mt9m001_try_fmt(struct v4l2_subdev *sd,
320 return 0; 318 return 0;
321} 319}
322 320
323static int mt9m001_g_chip_ident(struct v4l2_subdev *sd,
324 struct v4l2_dbg_chip_ident *id)
325{
326 struct i2c_client *client = v4l2_get_subdevdata(sd);
327 struct mt9m001 *mt9m001 = to_mt9m001(client);
328
329 if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
330 return -EINVAL;
331
332 if (id->match.addr != client->addr)
333 return -ENODEV;
334
335 id->ident = mt9m001->model;
336 id->revision = 0;
337
338 return 0;
339}
340
341#ifdef CONFIG_VIDEO_ADV_DEBUG 321#ifdef CONFIG_VIDEO_ADV_DEBUG
342static int mt9m001_g_register(struct v4l2_subdev *sd, 322static int mt9m001_g_register(struct v4l2_subdev *sd,
343 struct v4l2_dbg_register *reg) 323 struct v4l2_dbg_register *reg)
344{ 324{
345 struct i2c_client *client = v4l2_get_subdevdata(sd); 325 struct i2c_client *client = v4l2_get_subdevdata(sd);
346 326
347 if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) 327 if (reg->reg > 0xff)
348 return -EINVAL; 328 return -EINVAL;
349 329
350 if (reg->match.addr != client->addr)
351 return -ENODEV;
352
353 reg->size = 2; 330 reg->size = 2;
354 reg->val = reg_read(client, reg->reg); 331 reg->val = reg_read(client, reg->reg);
355 332
@@ -364,12 +341,9 @@ static int mt9m001_s_register(struct v4l2_subdev *sd,
364{ 341{
365 struct i2c_client *client = v4l2_get_subdevdata(sd); 342 struct i2c_client *client = v4l2_get_subdevdata(sd);
366 343
367 if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) 344 if (reg->reg > 0xff)
368 return -EINVAL; 345 return -EINVAL;
369 346
370 if (reg->match.addr != client->addr)
371 return -ENODEV;
372
373 if (reg_write(client, reg->reg, reg->val) < 0) 347 if (reg_write(client, reg->reg, reg->val) < 0)
374 return -EIO; 348 return -EIO;
375 349
@@ -505,11 +479,9 @@ static int mt9m001_video_probe(struct soc_camera_subdev_desc *ssdd,
505 switch (data) { 479 switch (data) {
506 case 0x8411: 480 case 0x8411:
507 case 0x8421: 481 case 0x8421:
508 mt9m001->model = V4L2_IDENT_MT9M001C12ST;
509 mt9m001->fmts = mt9m001_colour_fmts; 482 mt9m001->fmts = mt9m001_colour_fmts;
510 break; 483 break;
511 case 0x8431: 484 case 0x8431:
512 mt9m001->model = V4L2_IDENT_MT9M001C12STM;
513 mt9m001->fmts = mt9m001_monochrome_fmts; 485 mt9m001->fmts = mt9m001_monochrome_fmts;
514 break; 486 break;
515 default: 487 default:
@@ -580,7 +552,6 @@ static const struct v4l2_ctrl_ops mt9m001_ctrl_ops = {
580}; 552};
581 553
582static struct v4l2_subdev_core_ops mt9m001_subdev_core_ops = { 554static struct v4l2_subdev_core_ops mt9m001_subdev_core_ops = {
583 .g_chip_ident = mt9m001_g_chip_ident,
584#ifdef CONFIG_VIDEO_ADV_DEBUG 555#ifdef CONFIG_VIDEO_ADV_DEBUG
585 .g_register = mt9m001_g_register, 556 .g_register = mt9m001_g_register,
586 .s_register = mt9m001_s_register, 557 .s_register = mt9m001_s_register,
diff --git a/drivers/media/i2c/soc_camera/mt9m111.c b/drivers/media/i2c/soc_camera/mt9m111.c
index 8bd4e0d2ea03..1aaca0423df7 100644
--- a/drivers/media/i2c/soc_camera/mt9m111.c
+++ b/drivers/media/i2c/soc_camera/mt9m111.c
@@ -19,7 +19,6 @@
19#include <media/soc_camera.h> 19#include <media/soc_camera.h>
20#include <media/v4l2-common.h> 20#include <media/v4l2-common.h>
21#include <media/v4l2-ctrls.h> 21#include <media/v4l2-ctrls.h>
22#include <media/v4l2-chip-ident.h>
23 22
24/* 23/*
25 * MT9M111, MT9M112 and MT9M131: 24 * MT9M111, MT9M112 and MT9M131:
@@ -205,8 +204,6 @@ struct mt9m111 {
205 struct v4l2_subdev subdev; 204 struct v4l2_subdev subdev;
206 struct v4l2_ctrl_handler hdl; 205 struct v4l2_ctrl_handler hdl;
207 struct v4l2_ctrl *gain; 206 struct v4l2_ctrl *gain;
208 int model; /* V4L2_IDENT_MT9M111 or V4L2_IDENT_MT9M112 code
209 * from v4l2-chip-ident.h */
210 struct mt9m111_context *ctx; 207 struct mt9m111_context *ctx;
211 struct v4l2_rect rect; /* cropping rectangle */ 208 struct v4l2_rect rect; /* cropping rectangle */
212 int width; /* output */ 209 int width; /* output */
@@ -600,24 +597,6 @@ static int mt9m111_s_fmt(struct v4l2_subdev *sd,
600 return ret; 597 return ret;
601} 598}
602 599
603static int mt9m111_g_chip_ident(struct v4l2_subdev *sd,
604 struct v4l2_dbg_chip_ident *id)
605{
606 struct i2c_client *client = v4l2_get_subdevdata(sd);
607 struct mt9m111 *mt9m111 = container_of(sd, struct mt9m111, subdev);
608
609 if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
610 return -EINVAL;
611
612 if (id->match.addr != client->addr)
613 return -ENODEV;
614
615 id->ident = mt9m111->model;
616 id->revision = 0;
617
618 return 0;
619}
620
621#ifdef CONFIG_VIDEO_ADV_DEBUG 600#ifdef CONFIG_VIDEO_ADV_DEBUG
622static int mt9m111_g_register(struct v4l2_subdev *sd, 601static int mt9m111_g_register(struct v4l2_subdev *sd,
623 struct v4l2_dbg_register *reg) 602 struct v4l2_dbg_register *reg)
@@ -625,10 +604,8 @@ static int mt9m111_g_register(struct v4l2_subdev *sd,
625 struct i2c_client *client = v4l2_get_subdevdata(sd); 604 struct i2c_client *client = v4l2_get_subdevdata(sd);
626 int val; 605 int val;
627 606
628 if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0x2ff) 607 if (reg->reg > 0x2ff)
629 return -EINVAL; 608 return -EINVAL;
630 if (reg->match.addr != client->addr)
631 return -ENODEV;
632 609
633 val = mt9m111_reg_read(client, reg->reg); 610 val = mt9m111_reg_read(client, reg->reg);
634 reg->size = 2; 611 reg->size = 2;
@@ -645,12 +622,9 @@ static int mt9m111_s_register(struct v4l2_subdev *sd,
645{ 622{
646 struct i2c_client *client = v4l2_get_subdevdata(sd); 623 struct i2c_client *client = v4l2_get_subdevdata(sd);
647 624
648 if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0x2ff) 625 if (reg->reg > 0x2ff)
649 return -EINVAL; 626 return -EINVAL;
650 627
651 if (reg->match.addr != client->addr)
652 return -ENODEV;
653
654 if (mt9m111_reg_write(client, reg->reg, reg->val) < 0) 628 if (mt9m111_reg_write(client, reg->reg, reg->val) < 0)
655 return -EIO; 629 return -EIO;
656 630
@@ -856,7 +830,6 @@ static const struct v4l2_ctrl_ops mt9m111_ctrl_ops = {
856}; 830};
857 831
858static struct v4l2_subdev_core_ops mt9m111_subdev_core_ops = { 832static struct v4l2_subdev_core_ops mt9m111_subdev_core_ops = {
859 .g_chip_ident = mt9m111_g_chip_ident,
860 .s_power = mt9m111_s_power, 833 .s_power = mt9m111_s_power,
861#ifdef CONFIG_VIDEO_ADV_DEBUG 834#ifdef CONFIG_VIDEO_ADV_DEBUG
862 .g_register = mt9m111_g_register, 835 .g_register = mt9m111_g_register,
@@ -923,12 +896,10 @@ static int mt9m111_video_probe(struct i2c_client *client)
923 896
924 switch (data) { 897 switch (data) {
925 case 0x143a: /* MT9M111 or MT9M131 */ 898 case 0x143a: /* MT9M111 or MT9M131 */
926 mt9m111->model = V4L2_IDENT_MT9M111;
927 dev_info(&client->dev, 899 dev_info(&client->dev,
928 "Detected a MT9M111/MT9M131 chip ID %x\n", data); 900 "Detected a MT9M111/MT9M131 chip ID %x\n", data);
929 break; 901 break;
930 case 0x148c: /* MT9M112 */ 902 case 0x148c: /* MT9M112 */
931 mt9m111->model = V4L2_IDENT_MT9M112;
932 dev_info(&client->dev, "Detected a MT9M112 chip ID %x\n", data); 903 dev_info(&client->dev, "Detected a MT9M112 chip ID %x\n", data);
933 break; 904 break;
934 default: 905 default:
diff --git a/drivers/media/i2c/soc_camera/mt9t031.c b/drivers/media/i2c/soc_camera/mt9t031.c
index 26a15b87a9a2..1d2cc27767fe 100644
--- a/drivers/media/i2c/soc_camera/mt9t031.c
+++ b/drivers/media/i2c/soc_camera/mt9t031.c
@@ -18,7 +18,6 @@
18#include <linux/module.h> 18#include <linux/module.h>
19 19
20#include <media/soc_camera.h> 20#include <media/soc_camera.h>
21#include <media/v4l2-chip-ident.h>
22#include <media/v4l2-subdev.h> 21#include <media/v4l2-subdev.h>
23#include <media/v4l2-ctrls.h> 22#include <media/v4l2-ctrls.h>
24 23
@@ -76,7 +75,6 @@ struct mt9t031 {
76 struct v4l2_ctrl *exposure; 75 struct v4l2_ctrl *exposure;
77 }; 76 };
78 struct v4l2_rect rect; /* Sensor window */ 77 struct v4l2_rect rect; /* Sensor window */
79 int model; /* V4L2_IDENT_MT9T031* codes from v4l2-chip-ident.h */
80 u16 xskip; 78 u16 xskip;
81 u16 yskip; 79 u16 yskip;
82 unsigned int total_h; 80 unsigned int total_h;
@@ -391,36 +389,15 @@ static int mt9t031_try_fmt(struct v4l2_subdev *sd,
391 return 0; 389 return 0;
392} 390}
393 391
394static int mt9t031_g_chip_ident(struct v4l2_subdev *sd,
395 struct v4l2_dbg_chip_ident *id)
396{
397 struct i2c_client *client = v4l2_get_subdevdata(sd);
398 struct mt9t031 *mt9t031 = to_mt9t031(client);
399
400 if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
401 return -EINVAL;
402
403 if (id->match.addr != client->addr)
404 return -ENODEV;
405
406 id->ident = mt9t031->model;
407 id->revision = 0;
408
409 return 0;
410}
411
412#ifdef CONFIG_VIDEO_ADV_DEBUG 392#ifdef CONFIG_VIDEO_ADV_DEBUG
413static int mt9t031_g_register(struct v4l2_subdev *sd, 393static int mt9t031_g_register(struct v4l2_subdev *sd,
414 struct v4l2_dbg_register *reg) 394 struct v4l2_dbg_register *reg)
415{ 395{
416 struct i2c_client *client = v4l2_get_subdevdata(sd); 396 struct i2c_client *client = v4l2_get_subdevdata(sd);
417 397
418 if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) 398 if (reg->reg > 0xff)
419 return -EINVAL; 399 return -EINVAL;
420 400
421 if (reg->match.addr != client->addr)
422 return -ENODEV;
423
424 reg->val = reg_read(client, reg->reg); 401 reg->val = reg_read(client, reg->reg);
425 402
426 if (reg->val > 0xffff) 403 if (reg->val > 0xffff)
@@ -434,12 +411,9 @@ static int mt9t031_s_register(struct v4l2_subdev *sd,
434{ 411{
435 struct i2c_client *client = v4l2_get_subdevdata(sd); 412 struct i2c_client *client = v4l2_get_subdevdata(sd);
436 413
437 if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) 414 if (reg->reg > 0xff)
438 return -EINVAL; 415 return -EINVAL;
439 416
440 if (reg->match.addr != client->addr)
441 return -ENODEV;
442
443 if (reg_write(client, reg->reg, reg->val) < 0) 417 if (reg_write(client, reg->reg, reg->val) < 0)
444 return -EIO; 418 return -EIO;
445 419
@@ -650,7 +624,6 @@ static int mt9t031_video_probe(struct i2c_client *client)
650 624
651 switch (data) { 625 switch (data) {
652 case 0x1621: 626 case 0x1621:
653 mt9t031->model = V4L2_IDENT_MT9T031;
654 break; 627 break;
655 default: 628 default:
656 dev_err(&client->dev, 629 dev_err(&client->dev,
@@ -685,7 +658,6 @@ static const struct v4l2_ctrl_ops mt9t031_ctrl_ops = {
685}; 658};
686 659
687static struct v4l2_subdev_core_ops mt9t031_subdev_core_ops = { 660static struct v4l2_subdev_core_ops mt9t031_subdev_core_ops = {
688 .g_chip_ident = mt9t031_g_chip_ident,
689 .s_power = mt9t031_s_power, 661 .s_power = mt9t031_s_power,
690#ifdef CONFIG_VIDEO_ADV_DEBUG 662#ifdef CONFIG_VIDEO_ADV_DEBUG
691 .g_register = mt9t031_g_register, 663 .g_register = mt9t031_g_register,
diff --git a/drivers/media/i2c/soc_camera/mt9t112.c b/drivers/media/i2c/soc_camera/mt9t112.c
index a7256b732804..0391d01e8d25 100644
--- a/drivers/media/i2c/soc_camera/mt9t112.c
+++ b/drivers/media/i2c/soc_camera/mt9t112.c
@@ -27,7 +27,6 @@
27 27
28#include <media/mt9t112.h> 28#include <media/mt9t112.h>
29#include <media/soc_camera.h> 29#include <media/soc_camera.h>
30#include <media/v4l2-chip-ident.h>
31#include <media/v4l2-common.h> 30#include <media/v4l2-common.h>
32 31
33/* you can check PLL/clock info */ 32/* you can check PLL/clock info */
@@ -91,7 +90,6 @@ struct mt9t112_priv {
91 struct i2c_client *client; 90 struct i2c_client *client;
92 struct v4l2_rect frame; 91 struct v4l2_rect frame;
93 const struct mt9t112_format *format; 92 const struct mt9t112_format *format;
94 int model;
95 int num_formats; 93 int num_formats;
96 u32 flags; 94 u32 flags;
97/* for flags */ 95/* for flags */
@@ -738,17 +736,6 @@ static int mt9t112_init_camera(const struct i2c_client *client)
738/************************************************************************ 736/************************************************************************
739 v4l2_subdev_core_ops 737 v4l2_subdev_core_ops
740************************************************************************/ 738************************************************************************/
741static int mt9t112_g_chip_ident(struct v4l2_subdev *sd,
742 struct v4l2_dbg_chip_ident *id)
743{
744 struct i2c_client *client = v4l2_get_subdevdata(sd);
745 struct mt9t112_priv *priv = to_mt9t112(client);
746
747 id->ident = priv->model;
748 id->revision = 0;
749
750 return 0;
751}
752 739
753#ifdef CONFIG_VIDEO_ADV_DEBUG 740#ifdef CONFIG_VIDEO_ADV_DEBUG
754static int mt9t112_g_register(struct v4l2_subdev *sd, 741static int mt9t112_g_register(struct v4l2_subdev *sd,
@@ -786,7 +773,6 @@ static int mt9t112_s_power(struct v4l2_subdev *sd, int on)
786} 773}
787 774
788static struct v4l2_subdev_core_ops mt9t112_subdev_core_ops = { 775static struct v4l2_subdev_core_ops mt9t112_subdev_core_ops = {
789 .g_chip_ident = mt9t112_g_chip_ident,
790#ifdef CONFIG_VIDEO_ADV_DEBUG 776#ifdef CONFIG_VIDEO_ADV_DEBUG
791 .g_register = mt9t112_g_register, 777 .g_register = mt9t112_g_register,
792 .s_register = mt9t112_s_register, 778 .s_register = mt9t112_s_register,
@@ -1061,12 +1047,10 @@ static int mt9t112_camera_probe(struct i2c_client *client)
1061 switch (chipid) { 1047 switch (chipid) {
1062 case 0x2680: 1048 case 0x2680:
1063 devname = "mt9t111"; 1049 devname = "mt9t111";
1064 priv->model = V4L2_IDENT_MT9T111;
1065 priv->num_formats = 1; 1050 priv->num_formats = 1;
1066 break; 1051 break;
1067 case 0x2682: 1052 case 0x2682:
1068 devname = "mt9t112"; 1053 devname = "mt9t112";
1069 priv->model = V4L2_IDENT_MT9T112;
1070 priv->num_formats = ARRAY_SIZE(mt9t112_cfmts); 1054 priv->num_formats = ARRAY_SIZE(mt9t112_cfmts);
1071 break; 1055 break;
1072 default: 1056 default:
diff --git a/drivers/media/i2c/soc_camera/mt9v022.c b/drivers/media/i2c/soc_camera/mt9v022.c
index a295e598486f..41ff4535eb0d 100644
--- a/drivers/media/i2c/soc_camera/mt9v022.c
+++ b/drivers/media/i2c/soc_camera/mt9v022.c
@@ -19,7 +19,6 @@
19#include <media/soc_camera.h> 19#include <media/soc_camera.h>
20#include <media/soc_mediabus.h> 20#include <media/soc_mediabus.h>
21#include <media/v4l2-subdev.h> 21#include <media/v4l2-subdev.h>
22#include <media/v4l2-chip-ident.h>
23#include <media/v4l2-ctrls.h> 22#include <media/v4l2-ctrls.h>
24 23
25/* 24/*
@@ -133,6 +132,11 @@ static const struct mt9v02x_register mt9v024_register = {
133 .pixclk_fv_lv = MT9V024_PIXCLK_FV_LV, 132 .pixclk_fv_lv = MT9V024_PIXCLK_FV_LV,
134}; 133};
135 134
135enum mt9v022_model {
136 MT9V022IX7ATM,
137 MT9V022IX7ATC,
138};
139
136struct mt9v022 { 140struct mt9v022 {
137 struct v4l2_subdev subdev; 141 struct v4l2_subdev subdev;
138 struct v4l2_ctrl_handler hdl; 142 struct v4l2_ctrl_handler hdl;
@@ -153,7 +157,7 @@ struct mt9v022 {
153 const struct mt9v022_datafmt *fmts; 157 const struct mt9v022_datafmt *fmts;
154 const struct mt9v02x_register *reg; 158 const struct mt9v02x_register *reg;
155 int num_fmts; 159 int num_fmts;
156 int model; /* V4L2_IDENT_MT9V022* codes from v4l2-chip-ident.h */ 160 enum mt9v022_model model;
157 u16 chip_control; 161 u16 chip_control;
158 u16 chip_version; 162 u16 chip_version;
159 unsigned short y_skip_top; /* Lines to skip at the top */ 163 unsigned short y_skip_top; /* Lines to skip at the top */
@@ -406,12 +410,12 @@ static int mt9v022_s_fmt(struct v4l2_subdev *sd,
406 switch (mf->code) { 410 switch (mf->code) {
407 case V4L2_MBUS_FMT_Y8_1X8: 411 case V4L2_MBUS_FMT_Y8_1X8:
408 case V4L2_MBUS_FMT_Y10_1X10: 412 case V4L2_MBUS_FMT_Y10_1X10:
409 if (mt9v022->model != V4L2_IDENT_MT9V022IX7ATM) 413 if (mt9v022->model != MT9V022IX7ATM)
410 return -EINVAL; 414 return -EINVAL;
411 break; 415 break;
412 case V4L2_MBUS_FMT_SBGGR8_1X8: 416 case V4L2_MBUS_FMT_SBGGR8_1X8:
413 case V4L2_MBUS_FMT_SBGGR10_1X10: 417 case V4L2_MBUS_FMT_SBGGR10_1X10:
414 if (mt9v022->model != V4L2_IDENT_MT9V022IX7ATC) 418 if (mt9v022->model != MT9V022IX7ATC)
415 return -EINVAL; 419 return -EINVAL;
416 break; 420 break;
417 default: 421 default:
@@ -457,36 +461,15 @@ static int mt9v022_try_fmt(struct v4l2_subdev *sd,
457 return 0; 461 return 0;
458} 462}
459 463
460static int mt9v022_g_chip_ident(struct v4l2_subdev *sd,
461 struct v4l2_dbg_chip_ident *id)
462{
463 struct i2c_client *client = v4l2_get_subdevdata(sd);
464 struct mt9v022 *mt9v022 = to_mt9v022(client);
465
466 if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
467 return -EINVAL;
468
469 if (id->match.addr != client->addr)
470 return -ENODEV;
471
472 id->ident = mt9v022->model;
473 id->revision = 0;
474
475 return 0;
476}
477
478#ifdef CONFIG_VIDEO_ADV_DEBUG 464#ifdef CONFIG_VIDEO_ADV_DEBUG
479static int mt9v022_g_register(struct v4l2_subdev *sd, 465static int mt9v022_g_register(struct v4l2_subdev *sd,
480 struct v4l2_dbg_register *reg) 466 struct v4l2_dbg_register *reg)
481{ 467{
482 struct i2c_client *client = v4l2_get_subdevdata(sd); 468 struct i2c_client *client = v4l2_get_subdevdata(sd);
483 469
484 if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) 470 if (reg->reg > 0xff)
485 return -EINVAL; 471 return -EINVAL;
486 472
487 if (reg->match.addr != client->addr)
488 return -ENODEV;
489
490 reg->size = 2; 473 reg->size = 2;
491 reg->val = reg_read(client, reg->reg); 474 reg->val = reg_read(client, reg->reg);
492 475
@@ -501,12 +484,9 @@ static int mt9v022_s_register(struct v4l2_subdev *sd,
501{ 484{
502 struct i2c_client *client = v4l2_get_subdevdata(sd); 485 struct i2c_client *client = v4l2_get_subdevdata(sd);
503 486
504 if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) 487 if (reg->reg > 0xff)
505 return -EINVAL; 488 return -EINVAL;
506 489
507 if (reg->match.addr != client->addr)
508 return -ENODEV;
509
510 if (reg_write(client, reg->reg, reg->val) < 0) 490 if (reg_write(client, reg->reg, reg->val) < 0)
511 return -EIO; 491 return -EIO;
512 492
@@ -706,11 +686,11 @@ static int mt9v022_video_probe(struct i2c_client *client)
706 if (sensor_type && (!strcmp("colour", sensor_type) || 686 if (sensor_type && (!strcmp("colour", sensor_type) ||
707 !strcmp("color", sensor_type))) { 687 !strcmp("color", sensor_type))) {
708 ret = reg_write(client, MT9V022_PIXEL_OPERATION_MODE, 4 | 0x11); 688 ret = reg_write(client, MT9V022_PIXEL_OPERATION_MODE, 4 | 0x11);
709 mt9v022->model = V4L2_IDENT_MT9V022IX7ATC; 689 mt9v022->model = MT9V022IX7ATC;
710 mt9v022->fmts = mt9v022_colour_fmts; 690 mt9v022->fmts = mt9v022_colour_fmts;
711 } else { 691 } else {
712 ret = reg_write(client, MT9V022_PIXEL_OPERATION_MODE, 0x11); 692 ret = reg_write(client, MT9V022_PIXEL_OPERATION_MODE, 0x11);
713 mt9v022->model = V4L2_IDENT_MT9V022IX7ATM; 693 mt9v022->model = MT9V022IX7ATM;
714 mt9v022->fmts = mt9v022_monochrome_fmts; 694 mt9v022->fmts = mt9v022_monochrome_fmts;
715 } 695 }
716 696
@@ -740,7 +720,7 @@ static int mt9v022_video_probe(struct i2c_client *client)
740 mt9v022->fmt = &mt9v022->fmts[0]; 720 mt9v022->fmt = &mt9v022->fmts[0];
741 721
742 dev_info(&client->dev, "Detected a MT9V022 chip ID %x, %s sensor\n", 722 dev_info(&client->dev, "Detected a MT9V022 chip ID %x, %s sensor\n",
743 data, mt9v022->model == V4L2_IDENT_MT9V022IX7ATM ? 723 data, mt9v022->model == MT9V022IX7ATM ?
744 "monochrome" : "colour"); 724 "monochrome" : "colour");
745 725
746 ret = mt9v022_init(client); 726 ret = mt9v022_init(client);
@@ -768,7 +748,6 @@ static const struct v4l2_ctrl_ops mt9v022_ctrl_ops = {
768}; 748};
769 749
770static struct v4l2_subdev_core_ops mt9v022_subdev_core_ops = { 750static struct v4l2_subdev_core_ops mt9v022_subdev_core_ops = {
771 .g_chip_ident = mt9v022_g_chip_ident,
772#ifdef CONFIG_VIDEO_ADV_DEBUG 751#ifdef CONFIG_VIDEO_ADV_DEBUG
773 .g_register = mt9v022_g_register, 752 .g_register = mt9v022_g_register,
774 .s_register = mt9v022_s_register, 753 .s_register = mt9v022_s_register,
diff --git a/drivers/media/i2c/soc_camera/ov2640.c b/drivers/media/i2c/soc_camera/ov2640.c
index e3168424f9ba..7961cba6880a 100644
--- a/drivers/media/i2c/soc_camera/ov2640.c
+++ b/drivers/media/i2c/soc_camera/ov2640.c
@@ -22,7 +22,6 @@
22#include <linux/videodev2.h> 22#include <linux/videodev2.h>
23 23
24#include <media/soc_camera.h> 24#include <media/soc_camera.h>
25#include <media/v4l2-chip-ident.h>
26#include <media/v4l2-subdev.h> 25#include <media/v4l2-subdev.h>
27#include <media/v4l2-ctrls.h> 26#include <media/v4l2-ctrls.h>
28 27
@@ -304,7 +303,6 @@ struct ov2640_priv {
304 struct v4l2_ctrl_handler hdl; 303 struct v4l2_ctrl_handler hdl;
305 enum v4l2_mbus_pixelcode cfmt_code; 304 enum v4l2_mbus_pixelcode cfmt_code;
306 const struct ov2640_win_size *win; 305 const struct ov2640_win_size *win;
307 int model;
308}; 306};
309 307
310/* 308/*
@@ -723,18 +721,6 @@ static int ov2640_s_ctrl(struct v4l2_ctrl *ctrl)
723 return -EINVAL; 721 return -EINVAL;
724} 722}
725 723
726static int ov2640_g_chip_ident(struct v4l2_subdev *sd,
727 struct v4l2_dbg_chip_ident *id)
728{
729 struct i2c_client *client = v4l2_get_subdevdata(sd);
730 struct ov2640_priv *priv = to_ov2640(client);
731
732 id->ident = priv->model;
733 id->revision = 0;
734
735 return 0;
736}
737
738#ifdef CONFIG_VIDEO_ADV_DEBUG 724#ifdef CONFIG_VIDEO_ADV_DEBUG
739static int ov2640_g_register(struct v4l2_subdev *sd, 725static int ov2640_g_register(struct v4l2_subdev *sd,
740 struct v4l2_dbg_register *reg) 726 struct v4l2_dbg_register *reg)
@@ -1009,7 +995,6 @@ static int ov2640_video_probe(struct i2c_client *client)
1009 switch (VERSION(pid, ver)) { 995 switch (VERSION(pid, ver)) {
1010 case PID_OV2640: 996 case PID_OV2640:
1011 devname = "ov2640"; 997 devname = "ov2640";
1012 priv->model = V4L2_IDENT_OV2640;
1013 break; 998 break;
1014 default: 999 default:
1015 dev_err(&client->dev, 1000 dev_err(&client->dev,
@@ -1034,7 +1019,6 @@ static const struct v4l2_ctrl_ops ov2640_ctrl_ops = {
1034}; 1019};
1035 1020
1036static struct v4l2_subdev_core_ops ov2640_subdev_core_ops = { 1021static struct v4l2_subdev_core_ops ov2640_subdev_core_ops = {
1037 .g_chip_ident = ov2640_g_chip_ident,
1038#ifdef CONFIG_VIDEO_ADV_DEBUG 1022#ifdef CONFIG_VIDEO_ADV_DEBUG
1039 .g_register = ov2640_g_register, 1023 .g_register = ov2640_g_register,
1040 .s_register = ov2640_s_register, 1024 .s_register = ov2640_s_register,
diff --git a/drivers/media/i2c/soc_camera/ov5642.c b/drivers/media/i2c/soc_camera/ov5642.c
index 9aa56de69eed..c93a157d1d93 100644
--- a/drivers/media/i2c/soc_camera/ov5642.c
+++ b/drivers/media/i2c/soc_camera/ov5642.c
@@ -24,7 +24,6 @@
24#include <linux/v4l2-mediabus.h> 24#include <linux/v4l2-mediabus.h>
25 25
26#include <media/soc_camera.h> 26#include <media/soc_camera.h>
27#include <media/v4l2-chip-ident.h>
28#include <media/v4l2-subdev.h> 27#include <media/v4l2-subdev.h>
29 28
30/* OV5642 registers */ 29/* OV5642 registers */
@@ -848,23 +847,6 @@ static int ov5642_enum_fmt(struct v4l2_subdev *sd, unsigned int index,
848 return 0; 847 return 0;
849} 848}
850 849
851static int ov5642_g_chip_ident(struct v4l2_subdev *sd,
852 struct v4l2_dbg_chip_ident *id)
853{
854 struct i2c_client *client = v4l2_get_subdevdata(sd);
855
856 if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
857 return -EINVAL;
858
859 if (id->match.addr != client->addr)
860 return -ENODEV;
861
862 id->ident = V4L2_IDENT_OV5642;
863 id->revision = 0;
864
865 return 0;
866}
867
868static int ov5642_s_crop(struct v4l2_subdev *sd, const struct v4l2_crop *a) 850static int ov5642_s_crop(struct v4l2_subdev *sd, const struct v4l2_crop *a)
869{ 851{
870 struct i2c_client *client = v4l2_get_subdevdata(sd); 852 struct i2c_client *client = v4l2_get_subdevdata(sd);
@@ -966,7 +948,6 @@ static struct v4l2_subdev_video_ops ov5642_subdev_video_ops = {
966 948
967static struct v4l2_subdev_core_ops ov5642_subdev_core_ops = { 949static struct v4l2_subdev_core_ops ov5642_subdev_core_ops = {
968 .s_power = ov5642_s_power, 950 .s_power = ov5642_s_power,
969 .g_chip_ident = ov5642_g_chip_ident,
970#ifdef CONFIG_VIDEO_ADV_DEBUG 951#ifdef CONFIG_VIDEO_ADV_DEBUG
971 .g_register = ov5642_get_register, 952 .g_register = ov5642_get_register,
972 .s_register = ov5642_set_register, 953 .s_register = ov5642_set_register,
diff --git a/drivers/media/i2c/soc_camera/ov6650.c b/drivers/media/i2c/soc_camera/ov6650.c
index 991202d4bbae..d2869d87d3b1 100644
--- a/drivers/media/i2c/soc_camera/ov6650.c
+++ b/drivers/media/i2c/soc_camera/ov6650.c
@@ -32,7 +32,6 @@
32#include <linux/module.h> 32#include <linux/module.h>
33 33
34#include <media/soc_camera.h> 34#include <media/soc_camera.h>
35#include <media/v4l2-chip-ident.h>
36#include <media/v4l2-ctrls.h> 35#include <media/v4l2-ctrls.h>
37 36
38/* Register definitions */ 37/* Register definitions */
@@ -390,16 +389,6 @@ static int ov6550_s_ctrl(struct v4l2_ctrl *ctrl)
390 return -EINVAL; 389 return -EINVAL;
391} 390}
392 391
393/* Get chip identification */
394static int ov6650_g_chip_ident(struct v4l2_subdev *sd,
395 struct v4l2_dbg_chip_ident *id)
396{
397 id->ident = V4L2_IDENT_OV6650;
398 id->revision = 0;
399
400 return 0;
401}
402
403#ifdef CONFIG_VIDEO_ADV_DEBUG 392#ifdef CONFIG_VIDEO_ADV_DEBUG
404static int ov6650_get_register(struct v4l2_subdev *sd, 393static int ov6650_get_register(struct v4l2_subdev *sd,
405 struct v4l2_dbg_register *reg) 394 struct v4l2_dbg_register *reg)
@@ -879,7 +868,6 @@ static const struct v4l2_ctrl_ops ov6550_ctrl_ops = {
879}; 868};
880 869
881static struct v4l2_subdev_core_ops ov6650_core_ops = { 870static struct v4l2_subdev_core_ops ov6650_core_ops = {
882 .g_chip_ident = ov6650_g_chip_ident,
883#ifdef CONFIG_VIDEO_ADV_DEBUG 871#ifdef CONFIG_VIDEO_ADV_DEBUG
884 .g_register = ov6650_get_register, 872 .g_register = ov6650_get_register,
885 .s_register = ov6650_set_register, 873 .s_register = ov6650_set_register,
diff --git a/drivers/media/i2c/soc_camera/ov772x.c b/drivers/media/i2c/soc_camera/ov772x.c
index 713d62e349f6..b2f623603986 100644
--- a/drivers/media/i2c/soc_camera/ov772x.c
+++ b/drivers/media/i2c/soc_camera/ov772x.c
@@ -27,7 +27,6 @@
27#include <media/ov772x.h> 27#include <media/ov772x.h>
28#include <media/soc_camera.h> 28#include <media/soc_camera.h>
29#include <media/v4l2-ctrls.h> 29#include <media/v4l2-ctrls.h>
30#include <media/v4l2-chip-ident.h>
31#include <media/v4l2-subdev.h> 30#include <media/v4l2-subdev.h>
32 31
33/* 32/*
@@ -399,7 +398,6 @@ struct ov772x_priv {
399 struct ov772x_camera_info *info; 398 struct ov772x_camera_info *info;
400 const struct ov772x_color_format *cfmt; 399 const struct ov772x_color_format *cfmt;
401 const struct ov772x_win_size *win; 400 const struct ov772x_win_size *win;
402 int model;
403 unsigned short flag_vflip:1; 401 unsigned short flag_vflip:1;
404 unsigned short flag_hflip:1; 402 unsigned short flag_hflip:1;
405 /* band_filter = COM8[5] ? 256 - BDBASE : 0 */ 403 /* band_filter = COM8[5] ? 256 - BDBASE : 0 */
@@ -620,17 +618,6 @@ static int ov772x_s_ctrl(struct v4l2_ctrl *ctrl)
620 return -EINVAL; 618 return -EINVAL;
621} 619}
622 620
623static int ov772x_g_chip_ident(struct v4l2_subdev *sd,
624 struct v4l2_dbg_chip_ident *id)
625{
626 struct ov772x_priv *priv = to_ov772x(sd);
627
628 id->ident = priv->model;
629 id->revision = 0;
630
631 return 0;
632}
633
634#ifdef CONFIG_VIDEO_ADV_DEBUG 621#ifdef CONFIG_VIDEO_ADV_DEBUG
635static int ov772x_g_register(struct v4l2_subdev *sd, 622static int ov772x_g_register(struct v4l2_subdev *sd,
636 struct v4l2_dbg_register *reg) 623 struct v4l2_dbg_register *reg)
@@ -965,11 +952,9 @@ static int ov772x_video_probe(struct ov772x_priv *priv)
965 switch (VERSION(pid, ver)) { 952 switch (VERSION(pid, ver)) {
966 case OV7720: 953 case OV7720:
967 devname = "ov7720"; 954 devname = "ov7720";
968 priv->model = V4L2_IDENT_OV7720;
969 break; 955 break;
970 case OV7725: 956 case OV7725:
971 devname = "ov7725"; 957 devname = "ov7725";
972 priv->model = V4L2_IDENT_OV7725;
973 break; 958 break;
974 default: 959 default:
975 dev_err(&client->dev, 960 dev_err(&client->dev,
@@ -997,7 +982,6 @@ static const struct v4l2_ctrl_ops ov772x_ctrl_ops = {
997}; 982};
998 983
999static struct v4l2_subdev_core_ops ov772x_subdev_core_ops = { 984static struct v4l2_subdev_core_ops ov772x_subdev_core_ops = {
1000 .g_chip_ident = ov772x_g_chip_ident,
1001#ifdef CONFIG_VIDEO_ADV_DEBUG 985#ifdef CONFIG_VIDEO_ADV_DEBUG
1002 .g_register = ov772x_g_register, 986 .g_register = ov772x_g_register,
1003 .s_register = ov772x_s_register, 987 .s_register = ov772x_s_register,
diff --git a/drivers/media/i2c/soc_camera/ov9640.c b/drivers/media/i2c/soc_camera/ov9640.c
index 20ca62d371c1..6817be329666 100644
--- a/drivers/media/i2c/soc_camera/ov9640.c
+++ b/drivers/media/i2c/soc_camera/ov9640.c
@@ -28,7 +28,6 @@
28#include <linux/videodev2.h> 28#include <linux/videodev2.h>
29 29
30#include <media/soc_camera.h> 30#include <media/soc_camera.h>
31#include <media/v4l2-chip-ident.h>
32#include <media/v4l2-common.h> 31#include <media/v4l2-common.h>
33#include <media/v4l2-ctrls.h> 32#include <media/v4l2-ctrls.h>
34 33
@@ -287,18 +286,6 @@ static int ov9640_s_ctrl(struct v4l2_ctrl *ctrl)
287 return -EINVAL; 286 return -EINVAL;
288} 287}
289 288
290/* Get chip identification */
291static int ov9640_g_chip_ident(struct v4l2_subdev *sd,
292 struct v4l2_dbg_chip_ident *id)
293{
294 struct ov9640_priv *priv = to_ov9640_sensor(sd);
295
296 id->ident = priv->model;
297 id->revision = priv->revision;
298
299 return 0;
300}
301
302#ifdef CONFIG_VIDEO_ADV_DEBUG 289#ifdef CONFIG_VIDEO_ADV_DEBUG
303static int ov9640_get_register(struct v4l2_subdev *sd, 290static int ov9640_get_register(struct v4l2_subdev *sd,
304 struct v4l2_dbg_register *reg) 291 struct v4l2_dbg_register *reg)
@@ -615,12 +602,10 @@ static int ov9640_video_probe(struct i2c_client *client)
615 switch (VERSION(pid, ver)) { 602 switch (VERSION(pid, ver)) {
616 case OV9640_V2: 603 case OV9640_V2:
617 devname = "ov9640"; 604 devname = "ov9640";
618 priv->model = V4L2_IDENT_OV9640;
619 priv->revision = 2; 605 priv->revision = 2;
620 break; 606 break;
621 case OV9640_V3: 607 case OV9640_V3:
622 devname = "ov9640"; 608 devname = "ov9640";
623 priv->model = V4L2_IDENT_OV9640;
624 priv->revision = 3; 609 priv->revision = 3;
625 break; 610 break;
626 default: 611 default:
@@ -644,7 +629,6 @@ static const struct v4l2_ctrl_ops ov9640_ctrl_ops = {
644}; 629};
645 630
646static struct v4l2_subdev_core_ops ov9640_core_ops = { 631static struct v4l2_subdev_core_ops ov9640_core_ops = {
647 .g_chip_ident = ov9640_g_chip_ident,
648#ifdef CONFIG_VIDEO_ADV_DEBUG 632#ifdef CONFIG_VIDEO_ADV_DEBUG
649 .g_register = ov9640_get_register, 633 .g_register = ov9640_get_register,
650 .s_register = ov9640_set_register, 634 .s_register = ov9640_set_register,
diff --git a/drivers/media/i2c/soc_camera/ov9740.c b/drivers/media/i2c/soc_camera/ov9740.c
index 012bd6271124..0bc21a643c08 100644
--- a/drivers/media/i2c/soc_camera/ov9740.c
+++ b/drivers/media/i2c/soc_camera/ov9740.c
@@ -17,7 +17,6 @@
17#include <linux/v4l2-mediabus.h> 17#include <linux/v4l2-mediabus.h>
18 18
19#include <media/soc_camera.h> 19#include <media/soc_camera.h>
20#include <media/v4l2-chip-ident.h>
21#include <media/v4l2-ctrls.h> 20#include <media/v4l2-ctrls.h>
22 21
23#define to_ov9740(sd) container_of(sd, struct ov9740_priv, subdev) 22#define to_ov9740(sd) container_of(sd, struct ov9740_priv, subdev)
@@ -197,7 +196,6 @@ struct ov9740_priv {
197 struct v4l2_subdev subdev; 196 struct v4l2_subdev subdev;
198 struct v4l2_ctrl_handler hdl; 197 struct v4l2_ctrl_handler hdl;
199 198
200 int ident;
201 u16 model; 199 u16 model;
202 u8 revision; 200 u8 revision;
203 u8 manid; 201 u8 manid;
@@ -772,18 +770,6 @@ static int ov9740_s_ctrl(struct v4l2_ctrl *ctrl)
772 return 0; 770 return 0;
773} 771}
774 772
775/* Get chip identification */
776static int ov9740_g_chip_ident(struct v4l2_subdev *sd,
777 struct v4l2_dbg_chip_ident *id)
778{
779 struct ov9740_priv *priv = to_ov9740(sd);
780
781 id->ident = priv->ident;
782 id->revision = priv->revision;
783
784 return 0;
785}
786
787static int ov9740_s_power(struct v4l2_subdev *sd, int on) 773static int ov9740_s_power(struct v4l2_subdev *sd, int on)
788{ 774{
789 struct i2c_client *client = v4l2_get_subdevdata(sd); 775 struct i2c_client *client = v4l2_get_subdevdata(sd);
@@ -887,8 +873,6 @@ static int ov9740_video_probe(struct i2c_client *client)
887 goto done; 873 goto done;
888 } 874 }
889 875
890 priv->ident = V4L2_IDENT_OV9740;
891
892 dev_info(&client->dev, "ov9740 Model ID 0x%04x, Revision 0x%02x, " 876 dev_info(&client->dev, "ov9740 Model ID 0x%04x, Revision 0x%02x, "
893 "Manufacturer 0x%02x, SMIA Version 0x%02x\n", 877 "Manufacturer 0x%02x, SMIA Version 0x%02x\n",
894 priv->model, priv->revision, priv->manid, priv->smiaver); 878 priv->model, priv->revision, priv->manid, priv->smiaver);
@@ -927,7 +911,6 @@ static struct v4l2_subdev_video_ops ov9740_video_ops = {
927}; 911};
928 912
929static struct v4l2_subdev_core_ops ov9740_core_ops = { 913static struct v4l2_subdev_core_ops ov9740_core_ops = {
930 .g_chip_ident = ov9740_g_chip_ident,
931 .s_power = ov9740_s_power, 914 .s_power = ov9740_s_power,
932#ifdef CONFIG_VIDEO_ADV_DEBUG 915#ifdef CONFIG_VIDEO_ADV_DEBUG
933 .g_register = ov9740_get_register, 916 .g_register = ov9740_get_register,
diff --git a/drivers/media/i2c/soc_camera/rj54n1cb0c.c b/drivers/media/i2c/soc_camera/rj54n1cb0c.c
index 1f9ec3b06b4e..81b515c2fb36 100644
--- a/drivers/media/i2c/soc_camera/rj54n1cb0c.c
+++ b/drivers/media/i2c/soc_camera/rj54n1cb0c.c
@@ -18,7 +18,6 @@
18#include <media/rj54n1cb0c.h> 18#include <media/rj54n1cb0c.h>
19#include <media/soc_camera.h> 19#include <media/soc_camera.h>
20#include <media/v4l2-subdev.h> 20#include <media/v4l2-subdev.h>
21#include <media/v4l2-chip-ident.h>
22#include <media/v4l2-ctrls.h> 21#include <media/v4l2-ctrls.h>
23 22
24#define RJ54N1_DEV_CODE 0x0400 23#define RJ54N1_DEV_CODE 0x0400
@@ -1120,37 +1119,16 @@ static int rj54n1_s_fmt(struct v4l2_subdev *sd,
1120 return 0; 1119 return 0;
1121} 1120}
1122 1121
1123static int rj54n1_g_chip_ident(struct v4l2_subdev *sd,
1124 struct v4l2_dbg_chip_ident *id)
1125{
1126 struct i2c_client *client = v4l2_get_subdevdata(sd);
1127
1128 if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
1129 return -EINVAL;
1130
1131 if (id->match.addr != client->addr)
1132 return -ENODEV;
1133
1134 id->ident = V4L2_IDENT_RJ54N1CB0C;
1135 id->revision = 0;
1136
1137 return 0;
1138}
1139
1140#ifdef CONFIG_VIDEO_ADV_DEBUG 1122#ifdef CONFIG_VIDEO_ADV_DEBUG
1141static int rj54n1_g_register(struct v4l2_subdev *sd, 1123static int rj54n1_g_register(struct v4l2_subdev *sd,
1142 struct v4l2_dbg_register *reg) 1124 struct v4l2_dbg_register *reg)
1143{ 1125{
1144 struct i2c_client *client = v4l2_get_subdevdata(sd); 1126 struct i2c_client *client = v4l2_get_subdevdata(sd);
1145 1127
1146 if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || 1128 if (reg->reg < 0x400 || reg->reg > 0x1fff)
1147 reg->reg < 0x400 || reg->reg > 0x1fff)
1148 /* Registers > 0x0800 are only available from Sharp support */ 1129 /* Registers > 0x0800 are only available from Sharp support */
1149 return -EINVAL; 1130 return -EINVAL;
1150 1131
1151 if (reg->match.addr != client->addr)
1152 return -ENODEV;
1153
1154 reg->size = 1; 1132 reg->size = 1;
1155 reg->val = reg_read(client, reg->reg); 1133 reg->val = reg_read(client, reg->reg);
1156 1134
@@ -1165,14 +1143,10 @@ static int rj54n1_s_register(struct v4l2_subdev *sd,
1165{ 1143{
1166 struct i2c_client *client = v4l2_get_subdevdata(sd); 1144 struct i2c_client *client = v4l2_get_subdevdata(sd);
1167 1145
1168 if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || 1146 if (reg->reg < 0x400 || reg->reg > 0x1fff)
1169 reg->reg < 0x400 || reg->reg > 0x1fff)
1170 /* Registers >= 0x0800 are only available from Sharp support */ 1147 /* Registers >= 0x0800 are only available from Sharp support */
1171 return -EINVAL; 1148 return -EINVAL;
1172 1149
1173 if (reg->match.addr != client->addr)
1174 return -ENODEV;
1175
1176 if (reg_write(client, reg->reg, reg->val) < 0) 1150 if (reg_write(client, reg->reg, reg->val) < 0)
1177 return -EIO; 1151 return -EIO;
1178 1152
@@ -1233,7 +1207,6 @@ static const struct v4l2_ctrl_ops rj54n1_ctrl_ops = {
1233}; 1207};
1234 1208
1235static struct v4l2_subdev_core_ops rj54n1_subdev_core_ops = { 1209static struct v4l2_subdev_core_ops rj54n1_subdev_core_ops = {
1236 .g_chip_ident = rj54n1_g_chip_ident,
1237#ifdef CONFIG_VIDEO_ADV_DEBUG 1210#ifdef CONFIG_VIDEO_ADV_DEBUG
1238 .g_register = rj54n1_g_register, 1211 .g_register = rj54n1_g_register,
1239 .s_register = rj54n1_s_register, 1212 .s_register = rj54n1_s_register,
diff --git a/drivers/media/i2c/soc_camera/tw9910.c b/drivers/media/i2c/soc_camera/tw9910.c
index bad90b16a6dd..8a2ac244d0b3 100644
--- a/drivers/media/i2c/soc_camera/tw9910.c
+++ b/drivers/media/i2c/soc_camera/tw9910.c
@@ -27,7 +27,6 @@
27 27
28#include <media/soc_camera.h> 28#include <media/soc_camera.h>
29#include <media/tw9910.h> 29#include <media/tw9910.h>
30#include <media/v4l2-chip-ident.h>
31#include <media/v4l2-subdev.h> 30#include <media/v4l2-subdev.h>
32 31
33#define GET_ID(val) ((val & 0xF8) >> 3) 32#define GET_ID(val) ((val & 0xF8) >> 3)
@@ -518,18 +517,6 @@ static int tw9910_s_std(struct v4l2_subdev *sd, v4l2_std_id norm)
518 return 0; 517 return 0;
519} 518}
520 519
521static int tw9910_g_chip_ident(struct v4l2_subdev *sd,
522 struct v4l2_dbg_chip_ident *id)
523{
524 struct i2c_client *client = v4l2_get_subdevdata(sd);
525 struct tw9910_priv *priv = to_tw9910(client);
526
527 id->ident = V4L2_IDENT_TW9910;
528 id->revision = priv->revision;
529
530 return 0;
531}
532
533#ifdef CONFIG_VIDEO_ADV_DEBUG 520#ifdef CONFIG_VIDEO_ADV_DEBUG
534static int tw9910_g_register(struct v4l2_subdev *sd, 521static int tw9910_g_register(struct v4l2_subdev *sd,
535 struct v4l2_dbg_register *reg) 522 struct v4l2_dbg_register *reg)
@@ -823,7 +810,6 @@ done:
823} 810}
824 811
825static struct v4l2_subdev_core_ops tw9910_subdev_core_ops = { 812static struct v4l2_subdev_core_ops tw9910_subdev_core_ops = {
826 .g_chip_ident = tw9910_g_chip_ident,
827 .s_std = tw9910_s_std, 813 .s_std = tw9910_s_std,
828 .g_std = tw9910_g_std, 814 .g_std = tw9910_g_std,
829#ifdef CONFIG_VIDEO_ADV_DEBUG 815#ifdef CONFIG_VIDEO_ADV_DEBUG