diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-22 20:34:18 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-30 09:39:33 -0200 |
commit | bc97430510960846b6e8f2d62c503653031991e1 (patch) | |
tree | b4a08f2412fe75f61057d17c293c4f59f8868e14 /drivers/media/video/tvp5150.c | |
parent | b3ee7e21f25cdd50cccc906dc09e547f36166372 (diff) |
V4L/DVB (9969): tvp5150: add support for VIDIOC_G_CHIP_IDENT ioctl
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/tvp5150.c')
-rw-r--r-- | drivers/media/video/tvp5150.c | 16 |
1 files changed, 16 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 @@ #include <media/v4l2-device.h> #include <media/tvp5150.h> #include <media/v4l2-i2c-drv-legacy.h> +#include <media/v4l2-chip-ident.h> #include "tvp5150_reg.h" @@ -961,6 +962,20 @@ static int tvp5150_g_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt) } +static int tvp5150_g_chip_ident(struct v4l2_subdev *sd, + struct v4l2_chip_ident *chip) +{ + int rev; + struct i2c_client *client = v4l2_get_subdevdata(sd); + + rev = tvp5150_read(sd, TVP5150_ROM_MAJOR_VER) << 8 | + tvp5150_read(sd, TVP5150_ROM_MINOR_VER); + + return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_TVP5150, + rev); +} + + #ifdef CONFIG_VIDEO_ADV_DEBUG static int tvp5150_g_register(struct v4l2_subdev *sd, struct v4l2_register *reg) { @@ -1026,6 +1041,7 @@ static const struct v4l2_subdev_core_ops tvp5150_core_ops = { .s_ctrl = tvp5150_s_ctrl, .queryctrl = tvp5150_queryctrl, .reset = tvp5150_reset, + .g_chip_ident = tvp5150_g_chip_ident, #ifdef CONFIG_VIDEO_ADV_DEBUG .g_register = tvp5150_g_register, .s_register = tvp5150_s_register, |