aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pvrusb2/pvrusb2-hdw.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-02-23 18:55:14 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-03-01 10:09:44 -0500
commitf3d092b84a855c44914fea0648695bef7d751266 (patch)
tree3ae7a87e18e83be2a39e00a2ae29f26299d1c272 /drivers/media/video/pvrusb2/pvrusb2-hdw.c
parentd55c7aec666658495e5b57a6b194c8c2a1ac255f (diff)
V4L/DVB (5304): Improve chip matching in v4l2_register
The chip matching in struct v4l2_register for VIDIOC_DBG_G/S_REGISTER was rather primitive. It could not be extended to other busses besides i2c and it lacked a way to. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-hdw.c')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index a1ca0f5007e0..1cd4bb3ae260 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -3256,8 +3256,8 @@ static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw)
3256 3256
3257 3257
3258int pvr2_hdw_register_access(struct pvr2_hdw *hdw, 3258int pvr2_hdw_register_access(struct pvr2_hdw *hdw,
3259 u32 chip_id, u64 reg_id, 3259 u32 match_type, u32 match_chip, u64 reg_id,
3260 int setFl,u32 *val_ptr) 3260 int setFl,u64 *val_ptr)
3261{ 3261{
3262#ifdef CONFIG_VIDEO_ADV_DEBUG 3262#ifdef CONFIG_VIDEO_ADV_DEBUG
3263 struct list_head *item; 3263 struct list_head *item;
@@ -3268,13 +3268,16 @@ int pvr2_hdw_register_access(struct pvr2_hdw *hdw,
3268 3268
3269 if (!capable(CAP_SYS_ADMIN)) return -EPERM; 3269 if (!capable(CAP_SYS_ADMIN)) return -EPERM;
3270 3270
3271 req.i2c_id = chip_id; 3271 req.match_type = match_type;
3272 req.match_chip = match_chip;
3272 req.reg = reg_id; 3273 req.reg = reg_id;
3273 if (setFl) req.val = *val_ptr; 3274 if (setFl) req.val = *val_ptr;
3274 mutex_lock(&hdw->i2c_list_lock); do { 3275 mutex_lock(&hdw->i2c_list_lock); do {
3275 list_for_each(item,&hdw->i2c_clients) { 3276 list_for_each(item,&hdw->i2c_clients) {
3276 cp = list_entry(item,struct pvr2_i2c_client,list); 3277 cp = list_entry(item,struct pvr2_i2c_client,list);
3277 if (cp->client->driver->id != chip_id) continue; 3278 if (!v4l2_chip_match_i2c_client(cp->client, req.match_type, req.match_chip)) {
3279 continue;
3280 }
3278 stat = pvr2_i2c_client_cmd( 3281 stat = pvr2_i2c_client_cmd(
3279 cp,(setFl ? VIDIOC_DBG_S_REGISTER : 3282 cp,(setFl ? VIDIOC_DBG_S_REGISTER :
3280 VIDIOC_DBG_G_REGISTER),&req); 3283 VIDIOC_DBG_G_REGISTER),&req);