summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/ov7670.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/ov7670.c')
-rw-r--r--linux/drivers/media/video/ov7670.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/linux/drivers/media/video/ov7670.c b/linux/drivers/media/video/ov7670.c
index 1fee42eaa..d68f36851 100644
--- a/linux/drivers/media/video/ov7670.c
+++ b/linux/drivers/media/video/ov7670.c
@@ -16,6 +16,7 @@
#include <linux/videodev.h>
#include "compat.h"
#include <media/v4l2-common.h>
+#include <media/v4l2-chip-ident.h>
#include <linux/i2c.h>
@@ -1314,9 +1315,16 @@ static int ov7670_command(struct i2c_client *client, unsigned int cmd,
void *arg)
{
switch (cmd) {
- case VIDIOC_INT_G_CHIP_IDENT:
- * (enum v4l2_chip_ident *) arg = V4L2_IDENT_OV7670;
+ case VIDIOC_G_CHIP_IDENT:
+ {
+ struct v4l2_chip_ident *chip = arg;
+
+ if (!v4l2_chip_match_i2c_client(client, chip->match_type, chip->match_chip))
+ return -EINVAL;
+ chip->ident = V4L2_IDENT_OV7670;
+ chip->revision = 0;
return 0;
+ }
case VIDIOC_INT_RESET:
ov7670_reset(client);