aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2007-01-28 14:08:36 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-02-21 10:35:13 -0500
commit201f5c9cafeb88cf0658300bd3bceb5c30d28430 (patch)
treed9a8a2ee53239ba3ffb10b27edaefbdfb0ff20cb /drivers
parent6fe7d2c4660174110c6872cacc4fc2acb6e00acf (diff)
V4L/DVB (5175): Pvrusb2: VIDIOC_DBG_[S|G]_REGISTER fixups
Support 64 bit register IDs internally. Only allow root access to this API (for both set and get). Note that actual 64 bit access only becomes possible once the definition for v4l2_register is updated, but this change clears the way for it from the viewpoint of the pvrusb2 driver. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c4
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.h2
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-v4l2.c4
3 files changed, 4 insertions, 6 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 8ba72968639b..40b2f2a6d3cc 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -3253,7 +3253,7 @@ static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw)
3253 3253
3254 3254
3255int pvr2_hdw_register_access(struct pvr2_hdw *hdw, 3255int pvr2_hdw_register_access(struct pvr2_hdw *hdw,
3256 u32 chip_id, u32 reg_id, 3256 u32 chip_id, u64 reg_id,
3257 int setFl,u32 *val_ptr) 3257 int setFl,u32 *val_ptr)
3258{ 3258{
3259#ifdef CONFIG_VIDEO_ADV_DEBUG 3259#ifdef CONFIG_VIDEO_ADV_DEBUG
@@ -3263,6 +3263,8 @@ int pvr2_hdw_register_access(struct pvr2_hdw *hdw,
3263 int stat = 0; 3263 int stat = 0;
3264 int okFl = 0; 3264 int okFl = 0;
3265 3265
3266 if (!capable(CAP_SYS_ADMIN)) return -EPERM;
3267
3266 req.i2c_id = chip_id; 3268 req.i2c_id = chip_id;
3267 req.reg = reg_id; 3269 req.reg = reg_id;
3268 if (setFl) req.val = *val_ptr; 3270 if (setFl) req.val = *val_ptr;
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.h b/drivers/media/video/pvrusb2/pvrusb2-hdw.h
index e6df8e4a7fe0..566a8ef7e121 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.h
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.h
@@ -222,7 +222,7 @@ void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *,
222 setFl - true to set the register, false to read it 222 setFl - true to set the register, false to read it
223 val_ptr - storage location for source / result. */ 223 val_ptr - storage location for source / result. */
224int pvr2_hdw_register_access(struct pvr2_hdw *, 224int pvr2_hdw_register_access(struct pvr2_hdw *,
225 u32 chip_id,u32 reg_id, 225 u32 chip_id,u64 reg_id,
226 int setFl,u32 *val_ptr); 226 int setFl,u32 *val_ptr);
227 227
228/* The following entry points are all lower level things you normally don't 228/* The following entry points are all lower level things you normally don't
diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
index 024b6d80ea0a..4fe4136204c7 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
@@ -738,10 +738,6 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
738 } 738 }
739#ifdef CONFIG_VIDEO_ADV_DEBUG 739#ifdef CONFIG_VIDEO_ADV_DEBUG
740 case VIDIOC_DBG_S_REGISTER: 740 case VIDIOC_DBG_S_REGISTER:
741 if (!capable(CAP_SYS_ADMIN)) {
742 ret = -EPERM;
743 break;
744 } /* fall through */
745 case VIDIOC_DBG_G_REGISTER: 741 case VIDIOC_DBG_G_REGISTER:
746 { 742 {
747 u32 val; 743 u32 val;