summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLiu Ying <b17645@freescale.com>2011-01-10 18:45:05 +0800
committerLiu Ying <b17645@freescale.com>2011-01-11 12:43:35 +0800
commit2292186baf9223ffc5434dd67526f45a7692fe31 (patch)
tree8a7edf10ed8e4fa825b8b22f1e945abadbf83106 /drivers
parent12f26df7402a0b95bb56faee102759888c41ae5a (diff)
ENGR00137783-5 ADV7180:Add one internal ioctrl support
This patch adds chip identification support. Signed-off-by: Liu Ying <b17645@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/mxc/capture/adv7180.c24
1 files changed, 23 insertions, 1 deletions
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 <linux/workqueue.h>
#include <linux/regulator/consumer.h>
#include <linux/fsl_devices.h>
+#include <media/v4l2-chip-ident.h>
#include <media/v4l2-int-device.h>
#include "mxc_v4l2_capture.h"
@@ -686,6 +687,25 @@ static int ioctl_s_ctrl(struct v4l2_int_device *s, struct v4l2_control *vc)
}
/*!
+ * 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 = {