From 9c4dfadbde3cfa78b92c28597125b8c41d36ffd0 Mon Sep 17 00:00:00 2001 From: Jonathan Corbet Date: Sat, 4 Nov 2006 09:22:27 -0300 Subject: V4L/DVB (4796): A couple of V4L2 defines needed by Cafe Camara driver Two defines for V4L2, needed by the Cafe camera driver: 1) Add the RGB444 image format 2) Add the "init" internal command which is separate from "reset". Signed-off-by: Jonathan Corbet Signed-off-by: Mauro Carvalho Chehab --- include/linux/videodev2.h | 1 + include/media/v4l2-common.h | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'include') diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index df5c4654360..5cb380a559f 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -244,6 +244,7 @@ struct v4l2_pix_format #define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y','Y','U','V') /* 16 YUV 4:2:2 */ #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H','I','2','4') /* 8 8-bit color */ #define V4L2_PIX_FMT_HM12 v4l2_fourcc('H','M','1','2') /* 8 YUV 4:2:0 16x16 macroblocks */ +#define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R','4','4','4') /* 16 xxxxrrrr ggggbbbb */ /* see http://www.siliconimaging.com/RGB%20Bayer.htm */ #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */ diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index aecc946980a..8263ea00ca6 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h @@ -251,4 +251,8 @@ struct v4l2_crystal_freq { If the frequency is not supported, then -EINVAL is returned. */ #define VIDIOC_INT_S_CRYSTAL_FREQ _IOW ('d', 113, struct v4l2_crystal_freq) +/* Initialize the sensor registors to some sort of reasonable + default values. */ +#define VIDIOC_INT_INIT _IOW ('d', 114, u32) + #endif /* V4L2_COMMON_H_ */ -- cgit v1.2.3 From d905b382d797a213e15868cbf3204f50ed52e30b Mon Sep 17 00:00:00 2001 From: Jonathan Corbet Date: Sat, 4 Nov 2006 09:25:53 -0300 Subject: V4L/DVB (4797): Marvell 88ALP01 "cafe" driver A driver for the Marvell M88ALP01 "CAFE" CMOS integrated camera controller. This driver has been renamed "cafe_ccic" since my previous patch set. Signed-off-by: Jonathan Corbet Signed-off-by: Mauro Carvalho Chehab --- include/linux/i2c-id.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 0a8f750cbed..a32db163cbc 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h @@ -250,6 +250,7 @@ #define I2C_HW_SMBUS_OV518 0x04000f /* OV518(+) USB 1.1 webcam ICs */ #define I2C_HW_SMBUS_OV519 0x040010 /* OV519 USB 1.1 webcam IC */ #define I2C_HW_SMBUS_OVFX2 0x040011 /* Cypress/OmniVision FX2 webcam */ +#define I2C_HW_SMBUS_CAFE 0x040012 /* Marvell 88ALP01 "CAFE" cam */ /* --- ISA pseudo-adapter */ #define I2C_HW_ISA 0x050000 -- cgit v1.2.3 From 111f33564e19b2b5f70e3df9a8f92c08c1c91fd9 Mon Sep 17 00:00:00 2001 From: Jonathan Corbet Date: Sat, 4 Nov 2006 09:26:00 -0300 Subject: V4L/DVB (4798): OmniVision OV7670 driver This patch adds a V4L2 driver for the OmniVision OV7670 camera. Signed-off-by: Jonathan Corbet Signed-off-by: Mauro Carvalho Chehab --- include/linux/i2c-id.h | 1 + include/media/v4l2-common.h | 3 +++ 2 files changed, 4 insertions(+) (limited to 'include') diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index a32db163cbc..0f4cf34b6fa 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h @@ -159,6 +159,7 @@ #define I2C_DRIVERID_ASB100 1043 #define I2C_DRIVERID_FSCHER 1046 #define I2C_DRIVERID_W83L785TS 1047 +#define I2C_DRIVERID_OV7670 1048 /* Omnivision 7670 camera */ /* * ---- Adapter types ---------------------------------------------------- diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 8263ea00ca6..91b19921f95 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h @@ -144,6 +144,9 @@ enum v4l2_chip_ident { V4L2_IDENT_CX25841 = 241, V4L2_IDENT_CX25842 = 242, V4L2_IDENT_CX25843 = 243, + + /* OmniVision sensors - range 250-299 */ + V4L2_IDENT_OV7670 = 250, }; /* audio ioctls */ -- cgit v1.2.3 From f2520106e78b250c2c4662608cb8db1169932a2d Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 12 Nov 2006 09:28:46 -0300 Subject: V4L/DVB (4812): Detect presence of IR receiver/IR transmitter in tveeprom Thanks to input from Steven Toth from Hauppauge the tveeprom module has been extended to detect the presence of an IR transmitter (aka IR-blaster). Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/tveeprom.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/media/tveeprom.h b/include/media/tveeprom.h index e9fc1a78549..5660ea24996 100644 --- a/include/media/tveeprom.h +++ b/include/media/tveeprom.h @@ -3,7 +3,7 @@ struct tveeprom { u32 has_radio; - u32 has_ir; /* 0: no IR, 1: IR present, 2: unknown */ + u32 has_ir; /* bit 0: IR receiver present, bit 1: IR transmitter (blaster) present. -1 == unknown */ u32 has_MAC_address; /* 0: no MAC, 1: MAC present, 2: unknown */ u32 tuner_type; -- cgit v1.2.3 From e75f9cee32827853fc2f9d1ceb6352e3edc33e9d Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 20 Nov 2006 13:19:20 -0300 Subject: V4L/DVB (4861): Remove the need of a STD array for drivers using video_ioctl2 video_ioctl2 will auto-generate standard entries at ENUM_FMT. Also, now, a driver may return a subset of the video array at the return, to be stored as the current_norm. For example, a driver may ask for V4L2_STD_PAL. At return, driver may change it to V4L2_STD_PAL_B. This way, a futher call to G_STD will return the exact detected video std. Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-dev.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index 6a11d772700..fb96472a1bd 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h @@ -43,6 +43,7 @@ /* Video standard functions */ extern unsigned int v4l2_video_std_fps(struct v4l2_standard *vs); +extern char *v4l2_norm_to_name(v4l2_std_id id); extern int v4l2_video_std_construct(struct v4l2_standard *vs, int id, char *name); @@ -81,12 +82,6 @@ extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd, * This version moves redundant code from video device code to * the common handler */ -struct v4l2_tvnorm { - char *name; - v4l2_std_id id; - - void *priv_data; -}; struct video_device { @@ -104,9 +99,8 @@ struct video_device int debug; /* Activates debug level*/ /* Video standard vars */ - int tvnormsize; /* Size of tvnorm array */ - v4l2_std_id current_norm; /* Current tvnorm */ - struct v4l2_tvnorm *tvnorms; + v4l2_std_id tvnorms; /* Supported tv norms */ + v4l2_std_id current_norm; /* Current tvnorm */ /* callbacks */ void (*release)(struct video_device *vfd); @@ -211,7 +205,7 @@ struct video_device /* Standard handling G_STD and ENUMSTD are handled by videodev.c */ - int (*vidioc_s_std) (struct file *file, void *fh, v4l2_std_id a); + int (*vidioc_s_std) (struct file *file, void *fh, v4l2_std_id *norm); int (*vidioc_querystd) (struct file *file, void *fh, v4l2_std_id *a); /* Input handling */ -- cgit v1.2.3 From 2520fffd8b7a312e77009414d3201c9751d6448c Mon Sep 17 00:00:00 2001 From: David Hardeman Date: Sat, 2 Dec 2006 21:16:05 -0200 Subject: V4L/DVB (4879): budget-ci IR: integrate with ir-common This converts the budget-ci driver so that it uses ir-common for some of its IR processing. In particular, the keymap for the Nova-T (sub 13c2:1011) is switched to the Hauppauge grey/black keymap, of which the keys on the supplied R808 remote control form a subset. The old budget-ci keymap is moved to ir-keymaps.c and is used for other remotes. The debounce logic for buggy remotes (i.e. Zenith) is made conditional the new debounce parameter and defaults to off (so that repeat keypresses aren't ignored for all working remotes). Some parts are based on Darren Salt's dvb-ir patchset. Signed-off-by: David Hardeman Signed-off-by: Andrew de Quincey Signed-off-by: Mauro Carvalho Chehab --- include/media/ir-common.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/media/ir-common.h b/include/media/ir-common.h index 8f58406533c..2b25f5c9500 100644 --- a/include/media/ir-common.h +++ b/include/media/ir-common.h @@ -92,6 +92,7 @@ extern IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE]; extern IR_KEYTAB_TYPE ir_codes_npgtech[IR_KEYTAB_SIZE]; extern IR_KEYTAB_TYPE ir_codes_norwood[IR_KEYTAB_SIZE]; extern IR_KEYTAB_TYPE ir_codes_proteus_2309[IR_KEYTAB_SIZE]; +extern IR_KEYTAB_TYPE ir_codes_budget_ci_old[IR_KEYTAB_SIZE]; #endif -- cgit v1.2.3 From 88bbdf74fcfa7ed1fd1a3c825ee5575752344326 Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Wed, 1 Nov 2006 12:46:32 -0300 Subject: V4L/DVB (4914): Saa7146: Protect access to the IER register by a spinlock Protect the access to the IER register of the SAA7146 by the device spinlock. I2C transfers may use interrupt mode now. Signed-off-by: Oliver Endriss Signed-off-by: Mauro Carvalho Chehab --- include/media/saa7146.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/media/saa7146.h b/include/media/saa7146.h index fee579f10b3..afa5ff6469b 100644 --- a/include/media/saa7146.h +++ b/include/media/saa7146.h @@ -42,10 +42,20 @@ extern unsigned int saa7146_debug; #define DEB_INT(x) if (0!=(DEBUG_VARIABLE&0x20)) { DEBUG_PROLOG; printk x; } /* interrupt debug messages */ #define DEB_CAP(x) if (0!=(DEBUG_VARIABLE&0x40)) { DEBUG_PROLOG; printk x; } /* capture debug messages */ -#define SAA7146_IER_DISABLE(x,y) \ - saa7146_write(x, IER, saa7146_read(x, IER) & ~(y)); -#define SAA7146_IER_ENABLE(x,y) \ - saa7146_write(x, IER, saa7146_read(x, IER) | (y)); +#define SAA7146_IER_DISABLE(x,y) \ + do { \ + unsigned int flags; \ + spin_lock_irqsave(&x->int_slock, flags); \ + saa7146_write(x, IER, saa7146_read(x, IER) & ~(y)); \ + spin_unlock_irqrestore(&x->int_slock, flags); \ + } while(0) +#define SAA7146_IER_ENABLE(x,y) \ + do { \ + unsigned int flags; \ + spin_lock_irqsave(&x->int_slock, flags); \ + saa7146_write(x, IER, saa7146_read(x, IER) | (y)); \ + spin_unlock_irqrestore(&x->int_slock, flags); \ + } while(0) #define SAA7146_ISR_CLEAR(x,y) \ saa7146_write(x, ISR, (y)); -- cgit v1.2.3 From 4207700d9b238c2db1bcba47a23251c6024687b6 Mon Sep 17 00:00:00 2001 From: Oliver Endriss Date: Fri, 3 Nov 2006 15:13:52 -0300 Subject: V4L/DVB (4917): Saa7146: Convert SAA7146_IER_{DIS,EN}ABLE macros to inline functions Convert SAA7146_IER_{DIS,EN}ABLE macros to inline functions. Fixes a problem with macro expansion (reported by C.Y.M). Signed-off-by: Oliver Endriss Signed-off-by: Mauro Carvalho Chehab --- include/media/saa7146.h | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/media/saa7146.h b/include/media/saa7146.h index afa5ff6469b..796bcf151a3 100644 --- a/include/media/saa7146.h +++ b/include/media/saa7146.h @@ -42,20 +42,6 @@ extern unsigned int saa7146_debug; #define DEB_INT(x) if (0!=(DEBUG_VARIABLE&0x20)) { DEBUG_PROLOG; printk x; } /* interrupt debug messages */ #define DEB_CAP(x) if (0!=(DEBUG_VARIABLE&0x40)) { DEBUG_PROLOG; printk x; } /* capture debug messages */ -#define SAA7146_IER_DISABLE(x,y) \ - do { \ - unsigned int flags; \ - spin_lock_irqsave(&x->int_slock, flags); \ - saa7146_write(x, IER, saa7146_read(x, IER) & ~(y)); \ - spin_unlock_irqrestore(&x->int_slock, flags); \ - } while(0) -#define SAA7146_IER_ENABLE(x,y) \ - do { \ - unsigned int flags; \ - spin_lock_irqsave(&x->int_slock, flags); \ - saa7146_write(x, IER, saa7146_read(x, IER) | (y)); \ - spin_unlock_irqrestore(&x->int_slock, flags); \ - } while(0) #define SAA7146_ISR_CLEAR(x,y) \ saa7146_write(x, ISR, (y)); @@ -451,4 +437,20 @@ int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop); #define SAA7146_I2C_BUS_BIT_RATE_80 (0x200) #define SAA7146_I2C_BUS_BIT_RATE_60 (0x300) +static inline void SAA7146_IER_DISABLE(struct saa7146_dev *x, unsigned y) +{ + unsigned long flags; + spin_lock_irqsave(&x->int_slock, flags); + saa7146_write(x, IER, saa7146_read(x, IER) & ~y); + spin_unlock_irqrestore(&x->int_slock, flags); +} + +static inline void SAA7146_IER_ENABLE(struct saa7146_dev *x, unsigned y) +{ + unsigned long flags; + spin_lock_irqsave(&x->int_slock, flags); + saa7146_write(x, IER, saa7146_read(x, IER) | y); + spin_unlock_irqrestore(&x->int_slock, flags); +} + #endif -- cgit v1.2.3 From cefccc8011c58b559498396f0ccefa0a0ffa3f53 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 4 Dec 2006 08:31:35 -0300 Subject: V4L/DVB (4934): Usbvision radio requires GainNormal at e register Adds an option to select GainNormal at tda9887 and make usbvision to use it. Signed-off-by: Mauro Carvalho Chehab --- include/media/tuner.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/media/tuner.h b/include/media/tuner.h index 3116e750132..99acf847365 100644 --- a/include/media/tuner.h +++ b/include/media/tuner.h @@ -145,6 +145,7 @@ extern int tuner_debug; #define TDA9887_DEEMPHASIS_75 (3<<16) #define TDA9887_AUTOMUTE (1<<18) #define TDA9887_GATING_18 (1<<19) +#define TDA9887_GAIN_NORMAL (1<<20) #ifdef __KERNEL__ -- cgit v1.2.3 From 483deb0f2b38060c1f2de216c09f05b1869b0d52 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 4 Dec 2006 08:31:38 -0300 Subject: V4L/DVB (4935): Added the capability of selecting fm gain by tuner Some tuners require using cGainNormal instead of cGainLow for high sensibility on FM reception. Signed-off-by: Mauro Carvalho Chehab --- include/media/tuner-types.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/media/tuner-types.h b/include/media/tuner-types.h index 37dad07a843..e5ad3fcfe98 100644 --- a/include/media/tuner-types.h +++ b/include/media/tuner-types.h @@ -50,6 +50,10 @@ struct tuner_params { sensitivity. If this setting is 1, then set PORT2 to 1 to get proper FM reception. */ unsigned int port2_fm_high_sensitivity:1; + /* Some Philips tuners use tda9887 cGainNormal to select the FM radio + sensitivity. If this setting is 1, e register will use cGainNormal + instead of cGainLow. */ + unsigned int fm_gain_normal:1; /* Most tuners with a tda9887 use QSS mode. Some (cheaper) tuners use Intercarrier mode. If this setting is 1, then the tuner needs to be set to intercarrier mode. */ -- cgit v1.2.3