diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2007-06-28 20:17:36 -0700 |
---|---|---|
committer | Trent Piepho <xyzzy@speakeasy.org> | 2007-06-28 20:17:36 -0700 |
commit | d911ab7a6384107cc663d379c79815bf49dae1eb (patch) | |
tree | 0ee0932f4b31d45b9cf6a7a96acfa09db89c2352 /linux/drivers/media/video/bt8xx | |
parent | 7ea277dbfe353d78c9e6558e71894608f72bb322 (diff) | |
download | mediapointer-dvb-s2-d911ab7a6384107cc663d379c79815bf49dae1eb.tar.gz mediapointer-dvb-s2-d911ab7a6384107cc663d379c79815bf49dae1eb.tar.bz2 |
bttv: Add support for DBG_[SG]_REGISTER ioctls
From: Trent Piepho <xyzzy@speakeasy.org>
Adds the advanced debugging register read/write ioctl support to the bttv
driver.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Diffstat (limited to 'linux/drivers/media/video/bt8xx')
-rw-r--r-- | linux/drivers/media/video/bt8xx/bttv-driver.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/linux/drivers/media/video/bt8xx/bttv-driver.c b/linux/drivers/media/video/bt8xx/bttv-driver.c index 73c080c09..86ada5b84 100644 --- a/linux/drivers/media/video/bt8xx/bttv-driver.c +++ b/linux/drivers/media/video/bt8xx/bttv-driver.c @@ -2297,6 +2297,24 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg) printk(KERN_INFO "bttv%d: ================== END STATUS CARD #%d ==================\n", btv->c.nr, btv->c.nr); return 0; } +#ifdef CONFIG_VIDEO_ADV_DEBUG + case VIDIOC_DBG_G_REGISTER: + case VIDIOC_DBG_S_REGISTER: + { + struct v4l2_register *reg = arg; + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) + return -EINVAL; + /* bt848 has a 12-bit register space */ + reg->reg &= 0xfff; + if (cmd == VIDIOC_DBG_G_REGISTER) + reg->val = btread(reg->reg); + else + btwrite(reg->val, reg->reg); + return 0; + } +#endif default: return -ENOIOCTLCMD; @@ -3607,6 +3625,8 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, case VIDIOC_G_FREQUENCY: case VIDIOC_S_FREQUENCY: case VIDIOC_LOG_STATUS: + case VIDIOC_DBG_G_REGISTER: + case VIDIOC_DBG_S_REGISTER: return bttv_common_ioctls(btv,cmd,arg); default: @@ -3991,6 +4011,8 @@ static int radio_do_ioctl(struct inode *inode, struct file *file, case VIDIOCGAUDIO: case VIDIOCSAUDIO: case VIDIOC_LOG_STATUS: + case VIDIOC_DBG_G_REGISTER: + case VIDIOC_DBG_S_REGISTER: return bttv_common_ioctls(btv,cmd,arg); default: |