From 07a530f239aa36cea66a206c3fa6259f83f515e8 Mon Sep 17 00:00:00 2001 From: Liu Ying Date: Mon, 10 Jan 2011 18:45:05 +0800 Subject: ENGR00137783-5 ADV7180:Add one internal ioctrl support This patch adds chip identification support. Signed-off-by: Liu Ying --- drivers/media/video/mxc/capture/adv7180.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/media/video/mxc/capture/adv7180.c b/drivers/media/video/mxc/capture/adv7180.c index b1fd54d5d480..3e811d48f097 100644 --- a/drivers/media/video/mxc/capture/adv7180.c +++ b/drivers/media/video/mxc/capture/adv7180.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright 2005-2011 Freescale Semiconductor, Inc. All Rights Reserved. */ /* @@ -32,6 +32,7 @@ #include #include #include +#include #include #include "mxc_v4l2_capture.h" @@ -685,6 +686,25 @@ static int ioctl_s_ctrl(struct v4l2_int_device *s, struct v4l2_control *vc) return retval; } +/*! + * ioctl_g_chip_ident - V4L2 sensor interface handler for + * VIDIOC_DBG_G_CHIP_IDENT ioctl + * @s: pointer to standard V4L2 device structure + * @id: pointer to int + * + * Return 0. + */ +static int ioctl_g_chip_ident(struct v4l2_int_device *s, int *id) +{ + ((struct v4l2_dbg_chip_ident *)id)->match.type = + V4L2_CHIP_MATCH_I2C_DRIVER; + strcpy(((struct v4l2_dbg_chip_ident *)id)->match.name, + "adv7180_decoder"); + ((struct v4l2_dbg_chip_ident *)id)->ident = V4L2_IDENT_ADV7180; + + return 0; +} + /*! * ioctl_init - V4L2 sensor interface handler for VIDIOC_INT_INIT * @s: pointer to standard V4L2 device structure @@ -755,6 +775,8 @@ static struct v4l2_int_ioctl_desc adv7180_ioctl_desc[] = { {vidioc_int_queryctrl_num, (v4l2_int_ioctl_func*)ioctl_queryctrl}, {vidioc_int_g_ctrl_num, (v4l2_int_ioctl_func*)ioctl_g_ctrl}, {vidioc_int_s_ctrl_num, (v4l2_int_ioctl_func*)ioctl_s_ctrl}, + {vidioc_int_g_chip_ident_num, + (v4l2_int_ioctl_func *)ioctl_g_chip_ident}, }; static struct v4l2_int_slave adv7180_slave = { -- cgit v1.2.3