diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-07-02 16:55:02 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-07-02 16:55:02 -0300 |
commit | 24b1cf4ab4be6bebbdc0c76a2ad7d25a39ce7d3f (patch) | |
tree | b326863f704290d43c8861f13bd773f9cca798d6 /linux/drivers/media/video/bt8xx | |
parent | d531e1dbeb7dad87f971e1d651c925b11e99b9cb (diff) | |
parent | b08432f588a4161f12dd8419a2673ba582c9d3ab (diff) | |
download | mediapointer-dvb-s2-24b1cf4ab4be6bebbdc0c76a2ad7d25a39ce7d3f.tar.gz mediapointer-dvb-s2-24b1cf4ab4be6bebbdc0c76a2ad7d25a39ce7d3f.tar.bz2 |
merge: http://www.linuxtv.org/hg/~tmerle/v4l-dvb
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/bt8xx')
-rw-r--r-- | linux/drivers/media/video/bt8xx/bttv-driver.c | 35 | ||||
-rw-r--r-- | linux/drivers/media/video/bt8xx/bttv-input.c | 1 | ||||
-rw-r--r-- | linux/drivers/media/video/bt8xx/bttv.h | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/bt8xx/bttvp.h | 4 |
4 files changed, 31 insertions, 11 deletions
diff --git a/linux/drivers/media/video/bt8xx/bttv-driver.c b/linux/drivers/media/video/bt8xx/bttv-driver.c index 73c080c09..94dc7f867 100644 --- a/linux/drivers/media/video/bt8xx/bttv-driver.c +++ b/linux/drivers/media/video/bt8xx/bttv-driver.c @@ -1376,7 +1376,7 @@ set_tvnorm(struct bttv *btv, unsigned int norm) /* Call with btv->lock down. */ static void -set_input(struct bttv *btv, unsigned int input) +set_input(struct bttv *btv, unsigned int input, unsigned int norm) { unsigned long flags; @@ -1395,7 +1395,7 @@ set_input(struct bttv *btv, unsigned int input) } audio_input(btv,(input == bttv_tvcards[btv->c.type].tuner ? TVAUDIO_INPUT_TUNER : TVAUDIO_INPUT_EXTERN)); - set_tvnorm(btv,btv->tvnorm); + set_tvnorm(btv, norm); i2c_vidiocschan(btv); } @@ -1486,7 +1486,7 @@ static void bttv_reinit_bt848(struct bttv *btv) init_bt848(btv); btv->pll.pll_current = -1; - set_input(btv,btv->input); + set_input(btv, btv->input, btv->tvnorm); } static int get_control(struct bttv *btv, struct v4l2_control *c) @@ -2056,8 +2056,7 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg) return 0; } - btv->tvnorm = v->norm; - set_input(btv,v->channel); + set_input(btv, v->channel, v->norm); mutex_unlock(&btv->lock); return 0; } @@ -2193,7 +2192,7 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg) if (*i > bttv_tvcards[btv->c.type].video_inputs) return -EINVAL; mutex_lock(&btv->lock); - set_input(btv,*i); + set_input(btv, *i, btv->tvnorm); mutex_unlock(&btv->lock); return 0; } @@ -2297,6 +2296,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 +3624,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 +4010,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: @@ -4841,7 +4862,7 @@ static int __devinit bttv_probe(struct pci_dev *dev, bt848_hue(btv,32768); bt848_sat(btv,32768); audio_mute(btv, 1); - set_input(btv,0); + set_input(btv, 0, btv->tvnorm); bttv_crop_reset(&btv->crop[0], btv->tvnorm); btv->crop[1] = btv->crop[0]; /* current = default */ disclaim_vbi_lines(btv); diff --git a/linux/drivers/media/video/bt8xx/bttv-input.c b/linux/drivers/media/video/bt8xx/bttv-input.c index fb5df7238..5a5fdd8e2 100644 --- a/linux/drivers/media/video/bt8xx/bttv-input.c +++ b/linux/drivers/media/video/bt8xx/bttv-input.c @@ -25,7 +25,6 @@ #include <linux/interrupt.h> #include <linux/input.h> -#include "compat.h" #include "bttv.h" #include "bttvp.h" diff --git a/linux/drivers/media/video/bt8xx/bttv.h b/linux/drivers/media/video/bt8xx/bttv.h index 582ac6c90..b6ee3cd0f 100644 --- a/linux/drivers/media/video/bt8xx/bttv.h +++ b/linux/drivers/media/video/bt8xx/bttv.h @@ -14,9 +14,9 @@ #ifndef _BTTV_H_ #define _BTTV_H_ -#include "compat.h" #include <linux/videodev.h> #include <linux/i2c.h> +#include "compat.h" #include <media/ir-common.h> #include <media/ir-kbd-i2c.h> #include <media/i2c-addr.h> diff --git a/linux/drivers/media/video/bt8xx/bttvp.h b/linux/drivers/media/video/bt8xx/bttvp.h index eee6f5ae3..9428a665d 100644 --- a/linux/drivers/media/video/bt8xx/bttvp.h +++ b/linux/drivers/media/video/bt8xx/bttvp.h @@ -25,7 +25,6 @@ #ifndef _BTTVP_H_ #define _BTTVP_H_ -#include "compat.h" #include <linux/version.h> #define BTTV_VERSION_CODE KERNEL_VERSION(0,9,17) @@ -34,7 +33,6 @@ #include <linux/i2c.h> #include <linux/i2c-algo-bit.h> #include <linux/videodev.h> -#include <media/v4l2-common.h> #include <linux/pci.h> #include <linux/input.h> #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) @@ -42,6 +40,8 @@ #endif #include <asm/scatterlist.h> #include <asm/io.h> +#include "compat.h" +#include <media/v4l2-common.h> #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) #include "i2c-compat.h" |