From 95f91de57e3412b6cad75d2b8ed83545e8e30217 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Tue, 27 Feb 2007 20:10:15 +0100 Subject: Update ivtv VIDIOC_G_CHIP_IDENT. From: Hans Verkuil ivtv now sets the correct chip ident and returns the correct error codes. Signed-off-by: Hans Verkuil --- linux/drivers/media/video/ivtv/ivtv-ioctl.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'linux/drivers/media/video/ivtv/ivtv-ioctl.c') diff --git a/linux/drivers/media/video/ivtv/ivtv-ioctl.c b/linux/drivers/media/video/ivtv/ivtv-ioctl.c index 36af92e50..f8107e337 100644 --- a/linux/drivers/media/video/ivtv/ivtv-ioctl.c +++ b/linux/drivers/media/video/ivtv/ivtv-ioctl.c @@ -662,18 +662,26 @@ static int ivtv_internal_ioctls(struct file *filp, unsigned int cmd, void *arg) return ivtv_i2c_id(itv, reg->match_chip, cmd, arg); return ivtv_call_i2c_client(itv, reg->match_chip, cmd, arg); - case VIDIOC_G_CHIP_IDENT: + case VIDIOC_G_CHIP_IDENT: { + struct v4l2_chip_ident *chip = arg; + IVTV_DEBUG_IOCTL("VIDIOC_G_CHIP_IDENT\n"); - if (v4l2_chip_match_host(reg->match_type, reg->match_chip)) { - struct v4l2_chip_ident *chip = arg; + chip->ident = V4L2_IDENT_NONE; + chip->revision = 0; + if (reg->match_type == V4L2_CHIP_MATCH_HOST) { + if (v4l2_chip_match_host(reg->match_type, reg->match_chip)) { + struct v4l2_chip_ident *chip = arg; - chip->ident = itv->has_cx23415 ? V4L2_IDENT_CX23415 : V4L2_IDENT_CX23416; - chip->revision = 0; + chip->ident = itv->has_cx23415 ? V4L2_IDENT_CX23415 : V4L2_IDENT_CX23416; + } return 0; } if (reg->match_type == V4L2_CHIP_MATCH_I2C_DRIVER) return ivtv_i2c_id(itv, reg->match_chip, cmd, arg); - return ivtv_call_i2c_client(itv, reg->match_chip, cmd, arg); + if (reg->match_type == V4L2_CHIP_MATCH_I2C_ADDR) + return ivtv_call_i2c_client(itv, reg->match_chip, cmd, arg); + return -EINVAL; + } case VIDIOC_INT_S_AUDIO_ROUTING: { struct v4l2_routing *route = arg; -- cgit v1.2.3