diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-02-24 08:57:31 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-02-24 08:57:31 -0200 |
commit | 0c10299d80fe45160d3c79fd58634ae3b1c025db (patch) | |
tree | acc45ce055f216abafdb9a9596b8403612deb3fe /linux/drivers/media/video/saa7127.c | |
parent | 77e1106a1a76a4b429b21841bd1361f0e8fd5652 (diff) | |
parent | 2be3674b75c83865e9a131c6c54aaee005df47ed (diff) | |
download | mediapointer-dvb-s2-0c10299d80fe45160d3c79fd58634ae3b1c025db.tar.gz mediapointer-dvb-s2-0c10299d80fe45160d3c79fd58634ae3b1c025db.tar.bz2 |
merge: http://linuxtv.org/hg/~hverkuil/dvb-api
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/saa7127.c')
-rw-r--r-- | linux/drivers/media/video/saa7127.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/linux/drivers/media/video/saa7127.c b/linux/drivers/media/video/saa7127.c index 89a889591..28306f15d 100644 --- a/linux/drivers/media/video/saa7127.c +++ b/linux/drivers/media/video/saa7127.c @@ -54,6 +54,7 @@ #include <linux/i2c.h> #include <linux/videodev2.h> #include <media/v4l2-common.h> +#include <media/v4l2-chip-ident.h> #include <media/saa7127.h> #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) #include "i2c-compat.h" @@ -246,7 +247,7 @@ static struct i2c_reg_value saa7127_init_config_50hz[] = { struct saa7127_state { v4l2_std_id std; - enum v4l2_chip_ident ident; + u32 ident; enum saa7127_input_type input_type; enum saa7127_output_type output_type; int video_enable; @@ -631,7 +632,7 @@ static int saa7127_command(struct i2c_client *client, { struct v4l2_register *reg = arg; - if (reg->i2c_id != I2C_DRIVERID_SAA7127) + if (!v4l2_chip_match_i2c_client(client, reg->match_type, reg->match_chip)) return -EINVAL; if (!capable(CAP_SYS_ADMIN)) return -EPERM; @@ -662,9 +663,16 @@ static int saa7127_command(struct i2c_client *client, break; } - case VIDIOC_INT_G_CHIP_IDENT: - *(enum v4l2_chip_ident *)arg = 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; |