diff options
Diffstat (limited to 'linux/drivers/media/video/tvp5150.c')
-rw-r--r-- | linux/drivers/media/video/tvp5150.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/linux/drivers/media/video/tvp5150.c b/linux/drivers/media/video/tvp5150.c index 1eb6e96bd..46b97d9b1 100644 --- a/linux/drivers/media/video/tvp5150.c +++ b/linux/drivers/media/video/tvp5150.c @@ -1046,17 +1046,8 @@ static int tvp5150_command(struct i2c_client *c, #endif #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: + case VIDIOC_DBG_G_REGISTER: + case VIDIOC_DBG_S_REGISTER: { struct v4l2_register *reg = arg; @@ -1064,7 +1055,10 @@ static int tvp5150_command(struct i2c_client *c, return -EINVAL; if (!capable(CAP_SYS_ADMIN)) return -EPERM; - tvp5150_write(c, reg->reg & 0xff, reg->val & 0xff); + if (cmd == VIDIOC_DBG_G_REGISTER) + reg->val = tvp5150_read(c, reg->reg & 0xff); + else + tvp5150_write(c, reg->reg & 0xff, reg->val & 0xff); break; } #endif |