aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/tvp5150.c16
-rw-r--r--include/media/v4l2-chip-ident.h3
2 files changed, 19 insertions, 0 deletions
diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c
index e8a4637350ec..a388a9f0cb18 100644
--- a/drivers/media/video/tvp5150.c
+++ b/drivers/media/video/tvp5150.c
@@ -12,6 +12,7 @@
12#include <media/v4l2-device.h> 12#include <media/v4l2-device.h>
13#include <media/tvp5150.h> 13#include <media/tvp5150.h>
14#include <media/v4l2-i2c-drv-legacy.h> 14#include <media/v4l2-i2c-drv-legacy.h>
15#include <media/v4l2-chip-ident.h>
15 16
16#include "tvp5150_reg.h" 17#include "tvp5150_reg.h"
17 18
@@ -961,6 +962,20 @@ static int tvp5150_g_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt)
961} 962}
962 963
963 964
965static int tvp5150_g_chip_ident(struct v4l2_subdev *sd,
966 struct v4l2_chip_ident *chip)
967{
968 int rev;
969 struct i2c_client *client = v4l2_get_subdevdata(sd);
970
971 rev = tvp5150_read(sd, TVP5150_ROM_MAJOR_VER) << 8 |
972 tvp5150_read(sd, TVP5150_ROM_MINOR_VER);
973
974 return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_TVP5150,
975 rev);
976}
977
978
964#ifdef CONFIG_VIDEO_ADV_DEBUG 979#ifdef CONFIG_VIDEO_ADV_DEBUG
965static int tvp5150_g_register(struct v4l2_subdev *sd, struct v4l2_register *reg) 980static int tvp5150_g_register(struct v4l2_subdev *sd, struct v4l2_register *reg)
966{ 981{
@@ -1026,6 +1041,7 @@ static const struct v4l2_subdev_core_ops tvp5150_core_ops = {
1026 .s_ctrl = tvp5150_s_ctrl, 1041 .s_ctrl = tvp5150_s_ctrl,
1027 .queryctrl = tvp5150_queryctrl, 1042 .queryctrl = tvp5150_queryctrl,
1028 .reset = tvp5150_reset, 1043 .reset = tvp5150_reset,
1044 .g_chip_ident = tvp5150_g_chip_ident,
1029#ifdef CONFIG_VIDEO_ADV_DEBUG 1045#ifdef CONFIG_VIDEO_ADV_DEBUG
1030 .g_register = tvp5150_g_register, 1046 .g_register = tvp5150_g_register,
1031 .s_register = tvp5150_s_register, 1047 .s_register = tvp5150_s_register,
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h
index bfe5142e6672..e3e5b53931de 100644
--- a/include/media/v4l2-chip-ident.h
+++ b/include/media/v4l2-chip-ident.h
@@ -70,6 +70,9 @@ enum {
70 /* module vp27smpx: just ident 2700 */ 70 /* module vp27smpx: just ident 2700 */
71 V4L2_IDENT_VP27SMPX = 2700, 71 V4L2_IDENT_VP27SMPX = 2700,
72 72
73 /* module tvp5150 */
74 V4L2_IDENT_TVP5150 = 5150,
75
73 /* module cs5345: just ident 5345 */ 76 /* module cs5345: just ident 5345 */
74 V4L2_IDENT_CS5345 = 5345, 77 V4L2_IDENT_CS5345 = 5345,
75 78