aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-ioctl.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-12-30 05:14:19 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-01-02 14:11:52 -0500
commitaecde8b53b8ee1330a5a8206200f0d6b8845a6e0 (patch)
tree53a1aef6597a9d829864c054230b312010abc3a7 /drivers/media/video/ivtv/ivtv-ioctl.c
parentda1b5c95e49bb564ae8c61ed135d34ed09acbb66 (diff)
V4L/DVB (10141): v4l2: debugging API changed to match against driver name instead of ID.
Since the i2c driver ID will be removed in the near future we have to modify the v4l2 debugging API to use the driver name instead of driver ID. Note that this API is not used in applications other than v4l2-dbg.cpp as it is for debugging and testing only. Should anyone use the old VIDIOC_G_CHIP_IDENT, then this will be logged with a warning that it is deprecated and will be removed in 2.6.30. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-ioctl.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-ioctl.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c
index 1f6ca93b9840..f6b3ef6e691b 100644
--- a/drivers/media/video/ivtv/ivtv-ioctl.c
+++ b/drivers/media/video/ivtv/ivtv-ioctl.c
@@ -674,19 +674,19 @@ static int ivtv_s_fmt_vid_out_overlay(struct file *file, void *fh, struct v4l2_f
674 return ret; 674 return ret;
675} 675}
676 676
677static int ivtv_g_chip_ident(struct file *file, void *fh, struct v4l2_chip_ident *chip) 677static int ivtv_g_chip_ident(struct file *file, void *fh, struct v4l2_dbg_chip_ident *chip)
678{ 678{
679 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv; 679 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
680 680
681 chip->ident = V4L2_IDENT_NONE; 681 chip->ident = V4L2_IDENT_NONE;
682 chip->revision = 0; 682 chip->revision = 0;
683 if (chip->match_type == V4L2_CHIP_MATCH_HOST) { 683 if (chip->match.type == V4L2_CHIP_MATCH_HOST) {
684 if (v4l2_chip_match_host(chip->match_type, chip->match_chip)) 684 if (v4l2_chip_match_host(&chip->match))
685 chip->ident = itv->has_cx23415 ? V4L2_IDENT_CX23415 : V4L2_IDENT_CX23416; 685 chip->ident = itv->has_cx23415 ? V4L2_IDENT_CX23415 : V4L2_IDENT_CX23416;
686 return 0; 686 return 0;
687 } 687 }
688 if (chip->match_type != V4L2_CHIP_MATCH_I2C_DRIVER && 688 if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER &&
689 chip->match_type != V4L2_CHIP_MATCH_I2C_ADDR) 689 chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
690 return -EINVAL; 690 return -EINVAL;
691 /* TODO: is this correct? */ 691 /* TODO: is this correct? */
692 return ivtv_call_all_err(itv, core, g_chip_ident, chip); 692 return ivtv_call_all_err(itv, core, g_chip_ident, chip);
@@ -695,7 +695,7 @@ static int ivtv_g_chip_ident(struct file *file, void *fh, struct v4l2_chip_ident
695#ifdef CONFIG_VIDEO_ADV_DEBUG 695#ifdef CONFIG_VIDEO_ADV_DEBUG
696static int ivtv_itvc(struct ivtv *itv, unsigned int cmd, void *arg) 696static int ivtv_itvc(struct ivtv *itv, unsigned int cmd, void *arg)
697{ 697{
698 struct v4l2_register *regs = arg; 698 struct v4l2_dbg_register *regs = arg;
699 volatile u8 __iomem *reg_start; 699 volatile u8 __iomem *reg_start;
700 700
701 if (!capable(CAP_SYS_ADMIN)) 701 if (!capable(CAP_SYS_ADMIN))
@@ -710,6 +710,7 @@ static int ivtv_itvc(struct ivtv *itv, unsigned int cmd, void *arg)
710 else 710 else
711 return -EINVAL; 711 return -EINVAL;
712 712
713 regs->size = 4;
713 if (cmd == VIDIOC_DBG_G_REGISTER) 714 if (cmd == VIDIOC_DBG_G_REGISTER)
714 regs->val = readl(regs->reg + reg_start); 715 regs->val = readl(regs->reg + reg_start);
715 else 716 else
@@ -717,11 +718,11 @@ static int ivtv_itvc(struct ivtv *itv, unsigned int cmd, void *arg)
717 return 0; 718 return 0;
718} 719}
719 720
720static int ivtv_g_register(struct file *file, void *fh, struct v4l2_register *reg) 721static int ivtv_g_register(struct file *file, void *fh, struct v4l2_dbg_register *reg)
721{ 722{
722 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv; 723 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
723 724
724 if (v4l2_chip_match_host(reg->match_type, reg->match_chip)) 725 if (v4l2_chip_match_host(&reg->match))
725 return ivtv_itvc(itv, VIDIOC_DBG_G_REGISTER, reg); 726 return ivtv_itvc(itv, VIDIOC_DBG_G_REGISTER, reg);
726 /* TODO: subdev errors should not be ignored, this should become a 727 /* TODO: subdev errors should not be ignored, this should become a
727 subdev helper function. */ 728 subdev helper function. */
@@ -729,11 +730,11 @@ static int ivtv_g_register(struct file *file, void *fh, struct v4l2_register *re
729 return 0; 730 return 0;
730} 731}
731 732
732static int ivtv_s_register(struct file *file, void *fh, struct v4l2_register *reg) 733static int ivtv_s_register(struct file *file, void *fh, struct v4l2_dbg_register *reg)
733{ 734{
734 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv; 735 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
735 736
736 if (v4l2_chip_match_host(reg->match_type, reg->match_chip)) 737 if (v4l2_chip_match_host(&reg->match))
737 return ivtv_itvc(itv, VIDIOC_DBG_S_REGISTER, reg); 738 return ivtv_itvc(itv, VIDIOC_DBG_S_REGISTER, reg);
738 /* TODO: subdev errors should not be ignored, this should become a 739 /* TODO: subdev errors should not be ignored, this should become a
739 subdev helper function. */ 740 subdev helper function. */