aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/ad9389b.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/i2c/ad9389b.c')
-rw-r--r--drivers/media/i2c/ad9389b.c21
1 files changed, 2 insertions, 19 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
344static int ad9389b_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) 343static 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, &reg->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
355static int ad9389b_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) 350static 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, &reg->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
366static 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
373static int ad9389b_log_status(struct v4l2_subdev *sd) 357static 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
597static const struct v4l2_subdev_core_ops ad9389b_core_ops = { 581static 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
1305static struct i2c_device_id ad9389b_id[] = { 1288static 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};
1310MODULE_DEVICE_TABLE(i2c, ad9389b_id); 1293MODULE_DEVICE_TABLE(i2c, ad9389b_id);