From 547bf60a782e5d6397e4ed6c001bd1ae0633d8f0 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sat, 24 Feb 2007 00:55:14 +0100 Subject: Improve chip matching in v4l2_register for VIDIOC_DBG_G/S_REGISTER From: Hans Verkuil The chip matching in struct v4l2_register was rather primitive. It could not be extended to other busses besides i2c and it lacked a way to differentiate between two i2c chips driven by the same driver on one board (e.g. a PVR500 with two tuner chips, one for analog TV and one for radio). It has now been improved making it much more powerful. Signed-off-by: Hans Verkuil CC: Mike Isely CC: Trent Piepho --- linux/drivers/media/video/cx88/cx88-video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'linux/drivers/media/video/cx88/cx88-video.c') diff --git a/linux/drivers/media/video/cx88/cx88-video.c b/linux/drivers/media/video/cx88/cx88-video.c index 2af3f3d2c..2e6259ceb 100644 --- a/linux/drivers/media/video/cx88/cx88-video.c +++ b/linux/drivers/media/video/cx88/cx88-video.c @@ -1670,7 +1670,7 @@ static int vidioc_g_register (struct file *file, void *fh, { struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core; - if (reg->i2c_id != 0) + if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) return -EINVAL; /* cx2388x has a 24-bit register space */ reg->val = cx_read(reg->reg&0xffffff); @@ -1682,7 +1682,7 @@ static int vidioc_s_register (struct file *file, void *fh, { struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core; - if (reg->i2c_id != 0) + if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) return -EINVAL; cx_write(reg->reg&0xffffff, reg->val); return 0; -- cgit v1.2.3