summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <devnull@localhost>2005-12-26 14:05:52 +0000
committerMauro Carvalho Chehab <devnull@localhost>2005-12-26 14:05:52 +0000
commit975fb44c7ba7ef7c157da0f2e2367a694077a99f (patch)
treeac1b951a619da855b88b3e846e02316fbbd8f61d /linux
parentf12863ef9f416661a0701b40684653e682edd686 (diff)
downloadmediapointer-dvb-s2-975fb44c7ba7ef7c157da0f2e2367a694077a99f.tar.gz
mediapointer-dvb-s2-975fb44c7ba7ef7c157da0f2e2367a694077a99f.tar.bz2
Included advanced debug option to tvp5150.c
- Included advanced debug option to tvp5150.c - Now, advanced debug info is the first item at V4L menu. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/Kconfig16
-rw-r--r--linux/drivers/media/video/tvp5150.c24
-rw-r--r--linux/include/linux/i2c-id.h1
3 files changed, 34 insertions, 7 deletions
diff --git a/linux/drivers/media/video/Kconfig b/linux/drivers/media/video/Kconfig
index c89cc0a92..2fe260fff 100644
--- a/linux/drivers/media/video/Kconfig
+++ b/linux/drivers/media/video/Kconfig
@@ -7,6 +7,15 @@ menu "Video For Linux"
comment "Video Adapters"
+config VIDEO_ADV_DEBUG
+ bool "Enable advanced debug functionality"
+ depends on VIDEO_DEV
+ default n
+ ---help---
+ Say Y here to enable advanced debugging functionality on some
+ V4L devices.
+ In doubt, say N.
+
config VIDEO_BT848
tristate "BT848 Video For Linux"
depends on VIDEO_DEV && PCI && I2C
@@ -344,11 +353,4 @@ config VIDEO_DECODER
Say Y here to compile drivers for SAA7115, SAA7127 and CX25840
video decoders.
-config VIDEO_ADV_DEBUG
- bool "Enable advanced debug functionality"
- depends on VIDEO_DEV && VIDEO_DECODER && EXPERIMENTAL
- ---help---
- Say Y here to enable advanced debugging functionality in the
- SAA7115, SAA7127 and CX25840 video decoders.
-
endmenu
diff --git a/linux/drivers/media/video/tvp5150.c b/linux/drivers/media/video/tvp5150.c
index b907fbf2b..a758caea2 100644
--- a/linux/drivers/media/video/tvp5150.c
+++ b/linux/drivers/media/video/tvp5150.c
@@ -861,6 +861,30 @@ static int tvp5150_command(struct i2c_client *c,
*(v4l2_std_id *)arg = decoder->norm;
break;
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+ case VIDIOC_INT_G_REGISTER:
+ {
+ struct v4l2_register *reg = arg;
+
+ if (reg->i2c_id != I2C_DRIVERID_TVP5150)
+ return -EINVAL;
+ reg->val = tvp5150_read(c, reg->reg & 0xff);
+ break;
+ }
+
+ case VIDIOC_INT_S_REGISTER:
+ {
+ struct v4l2_register *reg = arg;
+
+ if (reg->i2c_id != I2C_DRIVERID_TVP5150)
+ return -EINVAL;
+ if (!capable(CAP_SYS_ADMIN))
+ return -EPERM;
+ tvp5150_write(c, reg->reg & 0xff, reg->val & 0xff);
+ break;
+ }
+#endif
+
case DECODER_DUMP:
dump_reg(c);
break;
diff --git a/linux/include/linux/i2c-id.h b/linux/include/linux/i2c-id.h
index 006c81ef4..c4564a283 100644
--- a/linux/include/linux/i2c-id.h
+++ b/linux/include/linux/i2c-id.h
@@ -109,6 +109,7 @@
#define I2C_DRIVERID_SAA711X 73 /* saa711x video encoders */
#define I2C_DRIVERID_AKITAIOEXP 74 /* IO Expander on Sharp SL-C1000 */
#define I2C_DRIVERID_INFRARED 75 /* I2C InfraRed on Video boards */
+#define I2C_DRIVERID_TVP5150 76 /* TVP5150 video decoder */
#define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */
#define I2C_DRIVERID_EXP1 0xF1