summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2006-10-04 16:33:51 -0700
committerTrent Piepho <xyzzy@speakeasy.org>2006-10-04 16:33:51 -0700
commitc357ff76a4c4ff3c165f10b16f42454c928e7d13 (patch)
tree3467b9d08d1723420568a95be7cf15f99e95a98b /linux/drivers/media/video
parenta27ae84eafcf32c3a5a0aac91af575e6be8b63b2 (diff)
downloadmediapointer-dvb-s2-c357ff76a4c4ff3c165f10b16f42454c928e7d13.tar.gz
mediapointer-dvb-s2-c357ff76a4c4ff3c165f10b16f42454c928e7d13.tar.bz2
cx88: Add support for VIDIOC_INT_[SR]_REGISTER ioctls
From: Trent Piepho <xyzzy@speakeasy.org> Add support for the advanced debugging ioctls, to allow access to the cx88 registers from userspace. Only i2c_id == 0 is supported, for access to the cx88 adapter itself. There isn't any support for access to I2C clients of the adapter. Most of them don't have R/W registers anyway, and its necessary to use i2c-dev to talk to them from userspace. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r--linux/drivers/media/video/cx88/cx88-video.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-video.c b/linux/drivers/media/video/cx88/cx88-video.c
index 9782a3799..1f1640f0f 100644
--- a/linux/drivers/media/video/cx88/cx88-video.c
+++ b/linux/drivers/media/video/cx88/cx88-video.c
@@ -1779,6 +1779,30 @@ int cx88_do_ioctl(struct inode *inode, struct file *file, int radio,
mutex_unlock(&core->lock);
return 0;
}
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+ /* ioctls to allow direct acces to the cx2388x registers */
+ case VIDIOC_INT_G_REGISTER:
+ {
+ struct v4l2_register *reg = arg;
+
+ if (reg->i2c_id != 0)
+ return -EINVAL;
+ /* cx2388x has a 24-bit register space */
+ reg->val = cx_read(reg->reg&0xffffff);
+ return 0;
+ }
+ case VIDIOC_INT_S_REGISTER:
+ {
+ struct v4l2_register *reg = arg;
+
+ if (reg->i2c_id != 0)
+ return -EINVAL;
+ if (!capable(CAP_SYS_ADMIN))
+ return -EPERM;
+ cx_write(reg->reg&0xffffff, reg->val);
+ return 0;
+ }
+#endif
default:
return v4l_compat_translate_ioctl(inode,file,cmd,arg,