summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/saa7115.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/saa7115.c')
-rw-r--r--linux/drivers/media/video/saa7115.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/linux/drivers/media/video/saa7115.c b/linux/drivers/media/video/saa7115.c
index d868920de..8b4abb3a1 100644
--- a/linux/drivers/media/video/saa7115.c
+++ b/linux/drivers/media/video/saa7115.c
@@ -45,6 +45,7 @@
#include <linux/i2c.h>
#include <linux/videodev2.h>
#include <media/v4l2-common.h>
+#include <media/v4l2-chip-ident.h>
#include <media/saa7115.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
#include "i2c-compat.h"
@@ -91,7 +92,7 @@ struct saa711x_state {
int sat;
int width;
int height;
- enum v4l2_chip_ident ident;
+ u32 ident;
u32 audclk_freq;
u32 crystal_freq;
u8 ucgc;
@@ -1243,7 +1244,6 @@ static void saa711x_decode_vbi_line(struct i2c_client *client,
static int saa711x_command(struct i2c_client *client, unsigned int cmd, void *arg)
{
struct saa711x_state *state = i2c_get_clientdata(client);
- int *iarg = arg;
/* ioctls to allow direct access to the saa7115 registers for testing */
switch (cmd) {
@@ -1436,7 +1436,7 @@ static int saa711x_command(struct i2c_client *client, unsigned int cmd, void *ar
{
struct v4l2_register *reg = arg;
- if (reg->i2c_id != I2C_DRIVERID_SAA711X)
+ if (!v4l2_chip_match_i2c_client(client, reg->match_type, reg->match_chip))
return -EINVAL;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
@@ -1448,9 +1448,16 @@ static int saa711x_command(struct i2c_client *client, unsigned int cmd, void *ar
}
#endif
- case VIDIOC_INT_G_CHIP_IDENT:
- *iarg = state->ident;
+ 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 = state->ident;
+ chip->revision = 0;
break;
+ }
default:
return -EINVAL;