From eef209698fa363311251b4e0be6f874f837d3da3 Mon Sep 17 00:00:00 2001 From: Ricardo Cerqueira Date: Sun, 26 Mar 2006 03:14:42 +0100 Subject: Subject: Pinnacle PCTV grey remote control support From: Sylvain Pasche This adds support for the older (?) Pinnacle PCTV remotes (with all buttons colored in grey). There's no autodetection for the type of remote, though; saa7134 defaults to the colored one, to use the grey remote the "pinnacle_remote=1" option must be passed to the saa7134 module Signed-off-by: Sylvain Pasche Signed-off-by: Ricardo Cerqueira --- linux/include/media/ir-common.h | 4 ++-- linux/include/media/ir-kbd-i2c.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'linux/include') diff --git a/linux/include/media/ir-common.h b/linux/include/media/ir-common.h index 8a2e4c640..bee527e44 100644 --- a/linux/include/media/ir-common.h +++ b/linux/include/media/ir-common.h @@ -74,7 +74,7 @@ extern IR_KEYTAB_TYPE ir_codes_cinergy_1400[IR_KEYTAB_SIZE]; extern IR_KEYTAB_TYPE ir_codes_avertv_303[IR_KEYTAB_SIZE]; extern IR_KEYTAB_TYPE ir_codes_dntv_live_dvbt_pro[IR_KEYTAB_SIZE]; extern IR_KEYTAB_TYPE ir_codes_em_terratec[IR_KEYTAB_SIZE]; -extern IR_KEYTAB_TYPE ir_codes_em_pinnacle_usb[IR_KEYTAB_SIZE]; +extern IR_KEYTAB_TYPE ir_codes_pinnacle_grey[IR_KEYTAB_SIZE]; extern IR_KEYTAB_TYPE ir_codes_flyvideo[IR_KEYTAB_SIZE]; extern IR_KEYTAB_TYPE ir_codes_flydvb[IR_KEYTAB_SIZE]; extern IR_KEYTAB_TYPE ir_codes_cinergy[IR_KEYTAB_SIZE]; @@ -88,7 +88,7 @@ extern IR_KEYTAB_TYPE ir_codes_pctv_sedna[IR_KEYTAB_SIZE]; extern IR_KEYTAB_TYPE ir_codes_pv951[IR_KEYTAB_SIZE]; extern IR_KEYTAB_TYPE ir_codes_rc5_tv[IR_KEYTAB_SIZE]; extern IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE]; -extern IR_KEYTAB_TYPE ir_codes_pinnacle[IR_KEYTAB_SIZE]; +extern IR_KEYTAB_TYPE ir_codes_pinnacle_color[IR_KEYTAB_SIZE]; extern IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE]; #endif diff --git a/linux/include/media/ir-kbd-i2c.h b/linux/include/media/ir-kbd-i2c.h index 730f21ed9..a455f7ce5 100644 --- a/linux/include/media/ir-kbd-i2c.h +++ b/linux/include/media/ir-kbd-i2c.h @@ -20,5 +20,6 @@ struct IR_i2c { int (*get_key)(struct IR_i2c*, u32*, u32*); }; -int get_key_pinnacle(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw); +int get_key_pinnacle_grey(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw); +int get_key_pinnacle_color(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw); #endif -- cgit v1.2.3 From fb70cc5ac6a14c86a9573bbb7ec6b95d32e287bb Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Wed, 19 Apr 2006 23:50:35 +0200 Subject: Add support for Samsung TCPG 6121P30A PAL tuner. From: Hans Verkuil Signed-off-by: Hans Verkuil --- linux/include/media/tuner.h | 1 + 1 file changed, 1 insertion(+) (limited to 'linux/include') diff --git a/linux/include/media/tuner.h b/linux/include/media/tuner.h index 515680247..adf4a3494 100644 --- a/linux/include/media/tuner.h +++ b/linux/include/media/tuner.h @@ -119,6 +119,7 @@ #define TUNER_XCEIVE_XC3028 71 #define TUNER_THOMSON_FE6600 72 /* DViCO FusionHDTV DVB-T Hybrid */ +#define TUNER_SAMSUNG_TCPG_6121P30A 73 /* Hauppauge PVR-500 PAL */ /* tv card specific */ #define TDA9887_PRESENT (1<<0) -- cgit v1.2.3 From 89ea8b07bd06b642101d489dbe88cbc18d707a17 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sat, 22 Apr 2006 15:22:46 +0200 Subject: Add support for the cx25836/7 video decoder. From: Hans Verkuil Signed-off-by: Scott Alfter Signed-off-by: Hans Verkuil --- linux/include/media/v4l2-common.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'linux/include') diff --git a/linux/include/media/v4l2-common.h b/linux/include/media/v4l2-common.h index 6ffa8eabb..31223f4eb 100644 --- a/linux/include/media/v4l2-common.h +++ b/linux/include/media/v4l2-common.h @@ -118,6 +118,8 @@ enum v4l2_chip_ident { V4L2_IDENT_SAA7129 = 159, /* module cx25840: reserved range 200-249 */ + V4L2_IDENT_CX25836 = 236, + V4L2_IDENT_CX25837 = 237, V4L2_IDENT_CX25840 = 240, V4L2_IDENT_CX25841 = 241, V4L2_IDENT_CX25842 = 242, -- cgit v1.2.3 From 795652e2cf756c5cfa9b4cecb3f066b8ea01eb08 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 24 Apr 2006 11:26:16 -0300 Subject: Added missing pwc files from previous commit From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- linux/include/media/pwc-ioctl.h | 329 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 329 insertions(+) create mode 100644 linux/include/media/pwc-ioctl.h (limited to 'linux/include') diff --git a/linux/include/media/pwc-ioctl.h b/linux/include/media/pwc-ioctl.h new file mode 100644 index 000000000..6e32ef4e2 --- /dev/null +++ b/linux/include/media/pwc-ioctl.h @@ -0,0 +1,329 @@ +#ifndef PWC_IOCTL_H +#define PWC_IOCTL_H + +/* (C) 2001-2004 Nemosoft Unv. + (C) 2004-2006 Luc Saillard (luc@saillard.org) + + NOTE: this version of pwc is an unofficial (modified) release of pwc & pcwx + driver and thus may have bugs that are not present in the original version. + Please send bug reports and support requests to . + The decompression routines have been implemented by reverse-engineering the + Nemosoft binary pwcx module. Caveat emptor. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* This is pwc-ioctl.h belonging to PWC 10.0.10 + It contains structures and defines to communicate from user space + directly to the driver. + */ + +/* + Changes + 2001/08/03 Alvarado Added ioctl constants to access methods for + changing white balance and red/blue gains + 2002/12/15 G. H. Fernandez-Toribio VIDIOCGREALSIZE + 2003/12/13 Nemosft Unv. Some modifications to make interfacing to + PWCX easier + 2006/01/01 Luc Saillard Add raw format definition + */ + +/* These are private ioctl() commands, specific for the Philips webcams. + They contain functions not found in other webcams, and settings not + specified in the Video4Linux API. + + The #define names are built up like follows: + VIDIOC VIDeo IOCtl prefix + PWC Philps WebCam + G optional: Get + S optional: Set + ... the function + */ + +#include +#include + +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 10) +/* Compatibility for older kernel */ +typedef __u16 __le16; +#endif + + /* Enumeration of image sizes */ +#define PSZ_SQCIF 0x00 +#define PSZ_QSIF 0x01 +#define PSZ_QCIF 0x02 +#define PSZ_SIF 0x03 +#define PSZ_CIF 0x04 +#define PSZ_VGA 0x05 +#define PSZ_MAX 6 + + +/* The frame rate is encoded in the video_window.flags parameter using + the upper 16 bits, since some flags are defined nowadays. The following + defines provide a mask and shift to filter out this value. + This value can also be passing using the private flag when using v4l2 and + VIDIOC_S_FMT ioctl. + + In 'Snapshot' mode the camera freezes its automatic exposure and colour + balance controls. + */ +#define PWC_FPS_SHIFT 16 +#define PWC_FPS_MASK 0x00FF0000 +#define PWC_FPS_FRMASK 0x003F0000 +#define PWC_FPS_SNAPSHOT 0x00400000 +#define PWC_QLT_MASK 0x03000000 +#define PWC_QLT_SHIFT 24 + + +/* structure for transferring x & y coordinates */ +struct pwc_coord +{ + int x, y; /* guess what */ + int size; /* size, or offset */ +}; + + +/* Used with VIDIOCPWCPROBE */ +struct pwc_probe +{ + char name[32]; + int type; +}; + +struct pwc_serial +{ + char serial[30]; /* String with serial number. Contains terminating 0 */ +}; + +/* pwc_whitebalance.mode values */ +#define PWC_WB_INDOOR 0 +#define PWC_WB_OUTDOOR 1 +#define PWC_WB_FL 2 +#define PWC_WB_MANUAL 3 +#define PWC_WB_AUTO 4 + +/* Used with VIDIOCPWC[SG]AWB (Auto White Balance). + Set mode to one of the PWC_WB_* values above. + *red and *blue are the respective gains of these colour components inside + the camera; range 0..65535 + When 'mode' == PWC_WB_MANUAL, 'manual_red' and 'manual_blue' are set or read; + otherwise undefined. + 'read_red' and 'read_blue' are read-only. +*/ +struct pwc_whitebalance +{ + int mode; + int manual_red, manual_blue; /* R/W */ + int read_red, read_blue; /* R/O */ +}; + +/* + 'control_speed' and 'control_delay' are used in automatic whitebalance mode, + and tell the camera how fast it should react to changes in lighting, and + with how much delay. Valid values are 0..65535. +*/ +struct pwc_wb_speed +{ + int control_speed; + int control_delay; + +}; + +/* Used with VIDIOCPWC[SG]LED */ +struct pwc_leds +{ + int led_on; /* Led on-time; range = 0..25000 */ + int led_off; /* Led off-time; range = 0..25000 */ +}; + +/* Image size (used with GREALSIZE) */ +struct pwc_imagesize +{ + int width; + int height; +}; + +/* Defines and structures for Motorized Pan & Tilt */ +#define PWC_MPT_PAN 0x01 +#define PWC_MPT_TILT 0x02 +#define PWC_MPT_TIMEOUT 0x04 /* for status */ + +/* Set angles; when absolute != 0, the angle is absolute and the + driver calculates the relative offset for you. This can only + be used with VIDIOCPWCSANGLE; VIDIOCPWCGANGLE always returns + absolute angles. + */ +struct pwc_mpt_angles +{ + int absolute; /* write-only */ + int pan; /* degrees * 100 */ + int tilt; /* degress * 100 */ +}; + +/* Range of angles of the camera, both horizontally and vertically. + */ +struct pwc_mpt_range +{ + int pan_min, pan_max; /* degrees * 100 */ + int tilt_min, tilt_max; +}; + +struct pwc_mpt_status +{ + int status; + int time_pan; + int time_tilt; +}; + + +/* This is used for out-of-kernel decompression. With it, you can get + all the necessary information to initialize and use the decompressor + routines in standalone applications. + */ +struct pwc_video_command +{ + int type; /* camera type (645, 675, 730, etc.) */ + int release; /* release number */ + + int size; /* one of PSZ_* */ + int alternate; + int command_len; /* length of USB video command */ + unsigned char command_buf[13]; /* Actual USB video command */ + int bandlength; /* >0 = compressed */ + int frame_size; /* Size of one (un)compressed frame */ +}; + +/* Flags for PWCX subroutines. Not all modules honour all flags. */ +#define PWCX_FLAG_PLANAR 0x0001 +#define PWCX_FLAG_BAYER 0x0008 + + +/* IOCTL definitions */ + + /* Restore user settings */ +#define VIDIOCPWCRUSER _IO('v', 192) + /* Save user settings */ +#define VIDIOCPWCSUSER _IO('v', 193) + /* Restore factory settings */ +#define VIDIOCPWCFACTORY _IO('v', 194) + + /* You can manipulate the compression factor. A compression preference of 0 + means use uncompressed modes when available; 1 is low compression, 2 is + medium and 3 is high compression preferred. Of course, the higher the + compression, the lower the bandwidth used but more chance of artefacts + in the image. The driver automatically chooses a higher compression when + the preferred mode is not available. + */ + /* Set preferred compression quality (0 = uncompressed, 3 = highest compression) */ +#define VIDIOCPWCSCQUAL _IOW('v', 195, int) + /* Get preferred compression quality */ +#define VIDIOCPWCGCQUAL _IOR('v', 195, int) + + +/* Retrieve serial number of camera */ +#define VIDIOCPWCGSERIAL _IOR('v', 198, struct pwc_serial) + + /* This is a probe function; since so many devices are supported, it + becomes difficult to include all the names in programs that want to + check for the enhanced Philips stuff. So in stead, try this PROBE; + it returns a structure with the original name, and the corresponding + Philips type. + To use, fill the structure with zeroes, call PROBE and if that succeeds, + compare the name with that returned from VIDIOCGCAP; they should be the + same. If so, you can be assured it is a Philips (OEM) cam and the type + is valid. + */ +#define VIDIOCPWCPROBE _IOR('v', 199, struct pwc_probe) + + /* Set AGC (Automatic Gain Control); int < 0 = auto, 0..65535 = fixed */ +#define VIDIOCPWCSAGC _IOW('v', 200, int) + /* Get AGC; int < 0 = auto; >= 0 = fixed, range 0..65535 */ +#define VIDIOCPWCGAGC _IOR('v', 200, int) + /* Set shutter speed; int < 0 = auto; >= 0 = fixed, range 0..65535 */ +#define VIDIOCPWCSSHUTTER _IOW('v', 201, int) + + /* Color compensation (Auto White Balance) */ +#define VIDIOCPWCSAWB _IOW('v', 202, struct pwc_whitebalance) +#define VIDIOCPWCGAWB _IOR('v', 202, struct pwc_whitebalance) + + /* Auto WB speed */ +#define VIDIOCPWCSAWBSPEED _IOW('v', 203, struct pwc_wb_speed) +#define VIDIOCPWCGAWBSPEED _IOR('v', 203, struct pwc_wb_speed) + + /* LEDs on/off/blink; int range 0..65535 */ +#define VIDIOCPWCSLED _IOW('v', 205, struct pwc_leds) +#define VIDIOCPWCGLED _IOR('v', 205, struct pwc_leds) + + /* Contour (sharpness); int < 0 = auto, 0..65536 = fixed */ +#define VIDIOCPWCSCONTOUR _IOW('v', 206, int) +#define VIDIOCPWCGCONTOUR _IOR('v', 206, int) + + /* Backlight compensation; 0 = off, otherwise on */ +#define VIDIOCPWCSBACKLIGHT _IOW('v', 207, int) +#define VIDIOCPWCGBACKLIGHT _IOR('v', 207, int) + + /* Flickerless mode; = 0 off, otherwise on */ +#define VIDIOCPWCSFLICKER _IOW('v', 208, int) +#define VIDIOCPWCGFLICKER _IOR('v', 208, int) + + /* Dynamic noise reduction; 0 off, 3 = high noise reduction */ +#define VIDIOCPWCSDYNNOISE _IOW('v', 209, int) +#define VIDIOCPWCGDYNNOISE _IOR('v', 209, int) + + /* Real image size as used by the camera; tells you whether or not there's a gray border around the image */ +#define VIDIOCPWCGREALSIZE _IOR('v', 210, struct pwc_imagesize) + + /* Motorized pan & tilt functions */ +#define VIDIOCPWCMPTRESET _IOW('v', 211, int) +#define VIDIOCPWCMPTGRANGE _IOR('v', 211, struct pwc_mpt_range) +#define VIDIOCPWCMPTSANGLE _IOW('v', 212, struct pwc_mpt_angles) +#define VIDIOCPWCMPTGANGLE _IOR('v', 212, struct pwc_mpt_angles) +#define VIDIOCPWCMPTSTATUS _IOR('v', 213, struct pwc_mpt_status) + + /* Get the USB set-video command; needed for initializing libpwcx */ +#define VIDIOCPWCGVIDCMD _IOR('v', 215, struct pwc_video_command) +struct pwc_table_init_buffer { + int len; + char *buffer; + +}; +#define VIDIOCPWCGVIDTABLE _IOR('v', 216, struct pwc_table_init_buffer) + +/* + * This is private command used when communicating with v4l2. + * In the future all private ioctl will be remove/replace to + * use interface offer by v4l2. + */ + +#define V4L2_CID_PRIVATE_SAVE_USER (V4L2_CID_PRIVATE_BASE + 0) +#define V4L2_CID_PRIVATE_RESTORE_USER (V4L2_CID_PRIVATE_BASE + 1) +#define V4L2_CID_PRIVATE_RESTORE_FACTORY (V4L2_CID_PRIVATE_BASE + 2) +#define V4L2_CID_PRIVATE_COLOUR_MODE (V4L2_CID_PRIVATE_BASE + 3) +#define V4L2_CID_PRIVATE_AUTOCONTOUR (V4L2_CID_PRIVATE_BASE + 4) +#define V4L2_CID_PRIVATE_CONTOUR (V4L2_CID_PRIVATE_BASE + 5) +#define V4L2_CID_PRIVATE_BACKLIGHT (V4L2_CID_PRIVATE_BASE + 6) +#define V4L2_CID_PRIVATE_FLICKERLESS (V4L2_CID_PRIVATE_BASE + 7) +#define V4L2_CID_PRIVATE_NOISE_REDUCTION (V4L2_CID_PRIVATE_BASE + 8) + +struct pwc_raw_frame { + __le16 type; /* type of the webcam */ + __le16 vbandlength; /* Size of 4lines compressed (used by the decompressor) */ + __u8 cmd[4]; /* the four byte of the command (in case of nala, + only the first 3 bytes is filled) */ + __u8 rawframe[0]; /* frame_size = H/4*vbandlength */ +} __attribute__ ((packed)); + + +#endif -- cgit v1.2.3 From e87f301495ed4c2fc6b9d7efc7594f8e4abb5708 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Thu, 27 Apr 2006 00:29:17 -0400 Subject: v4l: rename TUNER_LG_TDVS_H062F to TUNER_LG_TDVS_H06XF From: Michael Krufky Signed-off-by: Michael Krufky --- linux/include/media/tuner.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux/include') diff --git a/linux/include/media/tuner.h b/linux/include/media/tuner.h index adf4a3494..4548ede84 100644 --- a/linux/include/media/tuner.h +++ b/linux/include/media/tuner.h @@ -108,7 +108,7 @@ #define TUNER_TEA5767 62 /* Only FM Radio Tuner */ #define TUNER_PHILIPS_FMD1216ME_MK3 63 -#define TUNER_LG_TDVS_H062F 64 /* DViCO FusionHDTV 5 */ +#define TUNER_LG_TDVS_H06XF 64 /* TDVS H061F, H062F, H064F */ #define TUNER_YMEC_TVF66T5_B_DFF 65 /* Acorp Y878F */ #define TUNER_LG_TALN 66 #define TUNER_PHILIPS_TD1316 67 -- cgit v1.2.3 From 13a1f108bfa987434a7b60a33837b47dea5f50db Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 27 Apr 2006 10:17:00 -0300 Subject: AverMedia 6 Eyes AVS6EYES support From: Martin Samuelsson Add support for the AverMedia 6 Eyes MJPEG card. - Updated drivers/media/video/Kconfig with AVS6EYES options. - Added CONFIG_VIDEO_ZORAN_AVS6EYES to drivers/media/video/Makefile. - Added I2C_DRIVERID_BT866 and I2C_DRIVERID_KS0127 to include/linux/i2c-id.h - Added drivers/media/video/ks0127.c, imported and modified from the Marvel project. - Added drivers/media/video/ks0127.h, imported and modified from the Marvel project. - Added drivers/media/video/bt866.c, ported from a 2.4 version by Christer Weinigel. - Added AVS6EYES to drivers/media/video/zoran_card.c - Added input_mux to all cards in drivers/media/video/zoran_card.c - Added input mux module parameter to drivers/media/video/zoran_card.c - Added AVS6EYES to card_type in drivers/media/video/zoran.h - Added input_mux to card_info in drivers/media/video/zoran.h - Upped BUZ_MAX_INPUT in drivers/media/video/zoran.h from 8 to 16, as the AVS6EYES has 10. - Updated Documentation/video4linux/Zoran with information about AVS6EYES. Signed-off-by: Martin Samuelsson Signed-off-by: Adrian Bunk Signed-off-by: Andrew Morton Signed-off-by: Mauro Carvalho Chehab --- linux/include/linux/i2c-id.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'linux/include') diff --git a/linux/include/linux/i2c-id.h b/linux/include/linux/i2c-id.h index c8b81f419..748bbf7c3 100644 --- a/linux/include/linux/i2c-id.h +++ b/linux/include/linux/i2c-id.h @@ -112,6 +112,8 @@ #define I2C_DRIVERID_X1205 82 /* Xicor/Intersil X1205 RTC */ #define I2C_DRIVERID_PCF8563 83 /* Philips PCF8563 RTC */ #define I2C_DRIVERID_RS5C372 84 /* Ricoh RS5C372 RTC */ +#define I2C_DRIVERID_BT866 85 /* Conexant bt866 video encoder */ +#define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */ #define I2C_DRIVERID_I2CDEV 900 #define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ -- cgit v1.2.3 From 1aadc904874b153386bc286fba17fb0f73a6e355 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 27 Apr 2006 10:17:46 -0300 Subject: Git dvb Kconfig fix 2 From: Andrew Morton A trainwreck. Signed-off-by: Andrew Morton Signed-off-by: Mauro Carvalho Chehab --- linux/include/linux/videodev2.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'linux/include') diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h index 5d46a8d2a..6e769cdb0 100644 --- a/linux/include/linux/videodev2.h +++ b/linux/include/linux/videodev2.h @@ -1246,7 +1246,8 @@ extern char *v4l2_type_names[]; typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file, unsigned int cmd, void *arg); -#ifdef CONFIG_VIDEO_V4L1_COMPAT +#if defined(CONFIG_VIDEO_V4L1_COMPAT) || \ + defined(CONFIG_VIDEO_V4L1_COMPAT_MODULE) int v4l_compat_translate_ioctl(struct inode *inode, struct file *file, int cmd, void *arg, v4l2_kioctl driver_ioctl); #else -- cgit v1.2.3 From 53fd6cc3b7515ecc4f2e59732063c4ed7d730fd5 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 2 May 2006 11:18:17 -0300 Subject: Reverted from previous patch since it is not required From: Mauro Carvalho Chehab kernel-sync: Signed-off-by: Mauro Carvalho Chehab --- linux/include/linux/videodev2.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'linux/include') diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h index 6e769cdb0..5d46a8d2a 100644 --- a/linux/include/linux/videodev2.h +++ b/linux/include/linux/videodev2.h @@ -1246,8 +1246,7 @@ extern char *v4l2_type_names[]; typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file, unsigned int cmd, void *arg); -#if defined(CONFIG_VIDEO_V4L1_COMPAT) || \ - defined(CONFIG_VIDEO_V4L1_COMPAT_MODULE) +#ifdef CONFIG_VIDEO_V4L1_COMPAT int v4l_compat_translate_ioctl(struct inode *inode, struct file *file, int cmd, void *arg, v4l2_kioctl driver_ioctl); #else -- cgit v1.2.3 From e7db9b9952eddc8ac52a8a902ad1af7b048c8e17 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 2 May 2006 15:44:02 -0300 Subject: Removed obsoleted CVS files From: Mauro Carvalho Chehab Those files were used on cvs tree. they make no sense for hg. kenel-sync: Signed-off-by: Mauro Carvalho Chehab --- linux/include/linux/.cvsignore | 1 - 1 file changed, 1 deletion(-) delete mode 100644 linux/include/linux/.cvsignore (limited to 'linux/include') diff --git a/linux/include/linux/.cvsignore b/linux/include/linux/.cvsignore deleted file mode 100644 index c095fc3ef..000000000 --- a/linux/include/linux/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -dvb \ No newline at end of file -- cgit v1.2.3 From fb92440f40e711054ab1c7cf588f5e1c4991a57d Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 2 May 2006 16:00:44 -0300 Subject: i2c-compat.h were duplicated at linux/include. removing. From: Mauro Carvalho Chehab This file is meant only to make compatibility with kernel 2.4. Shouldn't stay at linux/*. Signed-off-by: Mauro Carvalho Chehab --- linux/include/media/i2c-compat.h | 57 ---------------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 linux/include/media/i2c-compat.h (limited to 'linux/include') diff --git a/linux/include/media/i2c-compat.h b/linux/include/media/i2c-compat.h deleted file mode 100644 index 39fa183fa..000000000 --- a/linux/include/media/i2c-compat.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * $Id: i2c-compat.h,v 1.3 2005/10/16 12:13:58 mchehab Exp $ - * - * some i2c layer compatibility stuff -- to avoid cluttering up the - * i2c modules with tons of #ifdefs - */ - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,66) - -static inline void *i2c_get_adapdata(struct i2c_adapter *dev) -{ - return dev->data; -} - -static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data) -{ - dev->data = data; -} - -static inline void *i2c_get_clientdata(struct i2c_client *dev) -{ - return dev->data; -} - -static inline void i2c_set_clientdata(struct i2c_client *dev, void *data) -{ - dev->data = data; -} - -#define I2C_DEVNAME(str) .name = str - -static inline char *i2c_clientname(struct i2c_client *c) -{ - return c->name; -} - -static inline void i2c_clients_command(struct i2c_adapter *adap, - unsigned int cmd, void *arg) -{ - int i; - - for (i = 0; i < I2C_CLIENT_MAX; i++) { - if (NULL == adap->clients[i]) - continue; - if (NULL == adap->clients[i]->driver->command) - continue; - adap->clients[i]->driver->command(adap->clients[i],cmd,arg); - } -} - -#endif - -/* - * Local variables: - * c-basic-offset: 8 - * End: - */ -- cgit v1.2.3 From b4d9770fbc462b4f10ebbf8950e94654309352c2 Mon Sep 17 00:00:00 2001 From: Manu Abraham Date: Fri, 5 May 2006 22:24:46 +0400 Subject: Add frontend support for new Delivery systems and modulations -DVB-S2, 8PSK and higher order modulations, some advanced DVB-S2 features require additional support at the demux level -DVB-T, Add support for HP/LP stream selection -DVB-H, Add basic support to the frontend API -DSS, basic frontend API support only, will require additional support at the demux level Ack'd by: Marcel Siegert Acked-by: Andrew de Quincey Ack'd by: Patrick Boettcher Signed-off-by: Manu Abraham --- linux/include/linux/dvb/frontend.h | 530 ++++++++++++++++++++++++++++++++++++- 1 file changed, 529 insertions(+), 1 deletion(-) (limited to 'linux/include') diff --git a/linux/include/linux/dvb/frontend.h b/linux/include/linux/dvb/frontend.h index c8cbd90ba..fe3b69605 100644 --- a/linux/include/linux/dvb/frontend.h +++ b/linux/include/linux/dvb/frontend.h @@ -7,6 +7,8 @@ * Andre Draszik * for convergence integrated media GmbH * + * Copyright (C) 2006 Manu Abraham + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 @@ -249,7 +251,9 @@ struct dvb_frontend_event { */ #define FE_TUNE_MODE_ONESHOT 0x01 - +/** + * FE_GET_INFO, is now a legacy IOCTL as well + */ #define FE_GET_INFO _IOR('o', 61, struct dvb_frontend_info) #define FE_DISEQC_RESET_OVERLOAD _IO('o', 62) @@ -267,6 +271,9 @@ struct dvb_frontend_event { #define FE_READ_SNR _IOR('o', 72, __u16) #define FE_READ_UNCORRECTED_BLOCKS _IOR('o', 73, __u32) +/** + * Legacy IOCTL's + */ #define FE_SET_FRONTEND _IOW('o', 76, struct dvb_frontend_parameters) #define FE_GET_FRONTEND _IOR('o', 77, struct dvb_frontend_parameters) #define FE_SET_FRONTEND_TUNE_MODE _IO('o', 81) /* unsigned int */ @@ -274,4 +281,525 @@ struct dvb_frontend_event { #define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */ +/** + * New operations for new and multiple delivery systems. + * + * References: + * DVB-S: ISO 13818-1/ITU H.222, EN 300 468 + * DVB-S2: EN 300 468, EN 301 210, TR 102 376 + * DVB-C: ISO 13818-1/ITU H.222, EN 300 468, EN 300 429 + * DVB-T: ISO 13818-1/ITU H.222, EN 300 468, EN 300 744 + * DVB-H: EN 300 468, EN 302 304 + */ + +/** + * Supported Delivery systems, some devices + * are capable of supporting multiple delivery systems. + * + * FE_DELSYS_IGNORE, causes the delivery system + * not to be queried. + * + * FE_DELSYS_AUTO, Some devices/drivers, might in + * future be capable of detectinng the delivery system. + */ +enum fe_delsys { + FE_DELSYS_IGNORE = (0 << 0), + FE_DELSYS_DVBS = (1 << 0), + FE_DELSYS_DVBS2 = (1 << 1), + FE_DELSYS_DSS = (1 << 2), + FE_DELSYS_DVBC = (1 << 3), + FE_DELSYS_DVBT = (1 << 4), + FE_DELSYS_DVBH = (1 << 5), + FE_DELSYS_ATSC = (1 << 6), + FE_DELSYS_AUTO = (1 << 31) +}; + +/** + * Supported Transport types, some delivery systems + * support multiple transports too. + * + * FE_MATYPE_IGNORE, causes the transport type not + * to be queried. + * + * FE_MATYPE_AUTO, Some devices/drivers, might + * support auto detecting the transport type, depending + * on some other settings and or hardware features. + * + * NOTE: This is specified by the DVB-S2 specifications + * This change of transport type might require an additional + * change at the PCI bridge level, for some implementations. + */ +enum fe_matype { + FE_MATYPE_IGNORE = (0 << 0), + FE_MATYPE_TRANSPORT = (1 << 0), + FE_MATYPE_GENERIC_PACKET = (1 << 1), + FE_MATYPE_GENERIC_CONTINUOUS = (1 << 2), + FE_MATYPE_RESERVED = (1 << 3), + FE_MATYPE_AUTO = (1 << 31) +}; + +/** + * Supported Stream Priorities + * + * Some delivery systems do have streams having + * different priorities. ie, High priority/Low priority. + * + * NOTE: The default should be the High priority stream. + */ +enum fe_stream { + FE_STREAM_HP = (1 << 0), + FE_STREAM_LP = (1 << 1) +}; + +/** + * Supported Modulations. + * Some devices support multiple modulation types + * + * FE_MOD_IGNORE, causes the modulation type not + * to be queried. + * + * FE_MOD_AUTO, Some devices/drivers, might support + * auto detecting the modulation type, depending on + * some other settings and or hardware features. + */ +enum fe_modulations { + FE_MOD_IGNORE = (0 << 0), + FE_MOD_NONE = (1 << 0), + FE_MOD_BPSK = (1 << 1), + FE_MOD_QPSK = (1 << 2), + FE_MOD_OQPSK = (1 << 3), + FE_MOD_8PSK = (1 << 4), + FE_MOD_16APSK = (1 << 5), + FE_MOD_32APSK = (1 << 6), + FE_MOD_QAM16 = (1 << 7), + FE_MOD_QAM32 = (1 << 8), + FE_MOD_QAM64 = (1 << 9), + FE_MOD_QAM128 = (1 << 10), + FE_MOD_QAM256 = (1 << 11), + FE_MOD_QAM512 = (1 << 12), + FE_MOD_QAM1024 = (1 << 13), + FE_MOD_QAMAUTO = (1 << 14), + FE_MOD_OFDM = (1 << 15), + FE_MOD_COFDM = (1 << 16), + FE_MOD_VSB8 = (1 << 17), + FE_MOD_VSB16 = (1 << 18), + FE_MOD_RSVD = (1 << 19), + FE_MOD_AUTO = (1 << 31) +}; + +/** + * Supported FEC (Forward Error Correction) Code rates + * + * FE_FECRATE_IGNORE, causes the FECRATE type not + * to be queried. + * + * FE_FECRATE_AUTO, Some devices/drivers, might + * support auto detecting the FEC code rate type, depending + * on some other hardware settings and or hardware features. + */ +enum fe_fecrates { + FE_FECRATE_IGNORE = (0 << 0), + FE_FECRATE_NONE = (1 << 0), + FE_FECRATE_1_4 = (1 << 1), + FE_FECRATE_1_3 = (1 << 2), + FE_FECRATE_2_5 = (1 << 3), + FE_FECRATE_1_2 = (1 << 4), + FE_FECRATE_3_5 = (1 << 5), + FE_FECRATE_2_3 = (1 << 6), + FE_FECRATE_3_4 = (1 << 7), + FE_FECRATE_4_5 = (1 << 8), + FE_FECRATE_5_6 = (1 << 9), + FE_FECRATE_6_7 = (1 << 10), + FE_FECRATE_7_8 = (1 << 11), + FE_FECRATE_8_9 = (1 << 12), + FE_FECRATE_9_10 = (1 << 13), + FE_FECRATE_RSVD = (1 << 14), + FE_FECRATE_AUTO = (1 << 31) +}; + +/** + * Supported MODCOD types + * + * The MODCOD types are specific to the DVB-S2 specification + * Some devices directly take the MODCOD values as an input + * or just output the same. + * + * In any case a single frontend will not be able to do + * multiple modulations/code rates at any given point of time. + */ +enum fe_modcod { + FE_MODCOD_DUMMY_PLFRAME = 0, + FE_MODCOD_QPSK_1_4, + FE_MODCOD_QPSK_1_3, + FE_MODCOD_QPSK_2_5, + FE_MODCOD_QPSK_1_2, + FE_MODCOD_QPSK_3_5, + FE_MODCOD_QPSK_2_3, + FE_MODCOD_QPSK_3_4, + FE_MODCOD_QPSK_4_5, + FE_MODCOD_QPSK_5_6, + FE_MODCOD_QPSK_8_9, + FE_MODCOD_QPSK_9_10, + FE_MODCOD_8PSK_3_5, + FE_MODCOD_8PSK_2_3, + FE_MODCOD_8PSK_3_4, + FE_MODCOD_8PSK_5_6, + FE_MODCOD_8PSK_8_9, + FE_MODCOD_8PSK_9_10, + FE_MODCOD_16APSK_2_3, + FE_MODCOD_16APSK_3_4, + FE_MODCOD_16APSK_4_5, + FE_MODCOD_16APSK_5_6, + FE_MODCOD_16APSK_8_9, + FE_MODCOD_16APSK_9_10, + FE_MODCOD_32APSK_3_4, + FE_MODCOD_32APSK_4_5, + FE_MODCOD_32APSK_5_6, + FE_MODCOD_32APSK_8_9, + FE_MODCOD_32APSK_9_10, + FE_MODCOD_RESERVED_1, + FE_MODCOD_BPSK_1_3, + FE_MODCOD_BPSK_1_4, + FE_MODCOD_RESERVED_2 +}; + +/** + * Supported Bandwidth modes + * + * FE_BANDWIDTH_IGNORE, causes the bandwidth not + * to be queried. + * + * FE_BANDWIDTH_AUTO, Some devices/drivers, might + * support auto detecting the Bandwidth, depending + * on some other hardware settings and or hardware features. + */ +enum fe_bandwidths { + FE_BANDWIDTH_IGNORE = (0 << 0), + FE_BANDWIDTH_8_MHZ = (1 << 1), + FE_BANDWIDTH_7_MHZ = (1 << 2), + FE_BANDWIDTH_6_MHZ = (1 << 3), + FE_BANDWIDTH_5_MHZ = (1 << 4), + FE_BANDWIDTH_RESERVED = (1 << 5), + FE_BANDWIDTH_AUTO = (1 << 31) +}; + +/** + * Supported Inversion modes + * + * FE_INVERSION_IGNORE, causes the inversion not + * to be queried. + * + * FE_INVERSION_AUTO, Some devices/drivers, might + * support auto detecting the Inversion, depending + * on some other hardware settings and or hardware features. + * + * NOTE: All current delivery systems need inversion in some + * way or the other, due to hardware implementation specifics. + * and/or others. + */ +enum fe_inversion { + FE_INVERSION_IGNORE = (0 << 0), + FE_INVERSION_OFF = (1 << 0), + FE_INVERSION_ON = (1 << 1), + FE_INVERSION_AUTO = (1 << 31) +}; + +/** + * Supported Transmission modes + * + * FE_TRANSMISSION_MODE_IGNORE, causes the transmission mode + * not to be queried. + * + * FE_TRANSMISSION_MODE_AUTO, Some devices/drivers, might + * support auto detecting the Transmission Mode, depending + * on some other hardware settings and or hardware features. + * + * NOTE: Currently applies to DVB-T and DVB-H only. + */ +enum fe_transmit_modes { + FE_TRANSMISSION_MODE_IGNORE = (0 << 0), + FE_TRANSMISSION_MODE_2K = (1 << 1), + FE_TRANSMISSION_MODE_4K = (1 << 2), + FE_TRANSMISSION_MODE_8K = (1 << 3), + FE_TRANSMISSION_MODE_RESERVED = (1 << 4), + FE_TRANSMISSION_MODE_AUTO = (1 << 31) +}; + +/** + * Supported Guard Intervals + * + * FE_GUARD_INTERVAL_IGNORE, causes the guard interval + * not to be queried. + * + * FE_GUARD_INTERVAL_AUTO, Some devices/drivers, might + * support auto detecting the Transmission Mode, depending + * on some other hardware settings and or hardware features. + * + * NOTE: Currently applies to DVB-T and DVB-H only. + */ +enum fe_guard_intervals { + FE_GUARD_INTERVAL_IGNORE = (0 << 0), + FE_GUARD_INTERVAL_1_32 = (1 << 1), + FE_GUARD_INTERVAL_1_16 = (1 << 2), + FE_GUARD_INTERVAL_1_8 = (1 << 3), + FE_GUARD_INTERVAL_1_4 = (1 << 4), + FE_GUARD_INTERVAL_AUTO = (1 << 31) +}; + +/** + * Supported Hierarchial Modulations + * + * FE_HIERARCHY_IGNORE, causes the hierarchy + * not to be queried. + * + * FE_HIERARCHY_AUTO, Some devices/drivers, might + * support auto detecting the hierarchial modulation, depending + * on some other hardware settings and or hardware features. + * + * NOTE: Currently applies to DVB-T and DVB-H only. + */ +enum fe_hierarchy_info { + FE_HIERARCHY_IGNORE = (0 << 0), + FE_HIERARCHY_OFF = (1 << 1), + FE_HIERARCHY_ON = (1 << 2), + FE_HIERARCHY_AUTO = (1 << 31) +}; + +/** + * Supported Rolloff Rates + * + * FE_ROLLOFF_IGNORE, causes the hierarchy + * not to be queried. + * + * FE_ROLLOFF_AUTO, Some devices/drivers, might + * support auto detecting the hierarchial modulation, depending + * on some other hardware settings and or hardware features. + * + * NOTE: Currently applies to DVB-T and DVB-H only, + * not applicable to DVB-S2, DVB-S2 uses fe_matype + */ +enum fe_rolloff { + FE_ROLLOFF_IGNORE = (0 << 0), + FE_ROLLOFF_1 = (1 << 1), + FE_ROLLOFF_2 = (1 << 2), + FE_ROLLOFF_4 = (1 << 3), + FE_ROLLOFF_AUTO = (1 << 31) +}; + +/** + * Supported Interleaver types + * + * FE_INTERLEAVER_IGNORE, causes the hierarchy + * not to be queried. + * + * FE_INTERLEAVER_AUTO, Some devices/drivers, might + * support auto detecting the hierarchial modulation, depending + * on some other hardware settings and or hardware features. + * + * NOTE: Currently applies only to DVB-H. + */ +enum fe_interleaver { + FE_INTERLEAVER_IGNORE = (0 << 0), + FE_INTERLEAVER_NATIVE = (1 << 1), + FE_INTERLEAVER_INDEPTH = (1 << 2), + FE_INTERLEAVER_AUTO = (1 << 31) +}; + + +/** + * Supported MPE-FEC modes + * + * FE_MPEFEC_IGNORE, causes the mpefec indicator + * not to be queried. + * + * NOTE: MPE-FEC is an indicator according to EN 300 468 + * Currently applies only to DVB-H. + */ +enum fe_mpefec { + FE_MPEFEC_IGNORE = (0 << 0), + FE_MPEFEC_ON = (1 << 1), + FE_MPEFEC_OFF = (1 << 2) +}; + +/** + * Supported Timeslicing mode + * + * FE_TIMESLICING_IGNORE, causes the timeslicing indicator + * not to be queried. + * + * NOTE: Timeslicing is an indicator according to EN 300 468 + * Currently applies only to DVB-H. + */ +enum fe_timeslicing { + FE_TIMESLICING_IGNORE = (0 << 0), + FE_TIMESLICING_ON = (1 << 1), + FE_TIMESLICING_OFF = (1 << 2) +}; + +/** + * DVB-S parameters + */ +struct dvbs_params { + __u32 symbol_rate; + + enum fe_modulations modulation; + enum fe_fecrates fecrate; +}; + +/** + * DVB-S2 parameters + */ +struct dvbs2_params { + __u32 symbol_rate; + + enum fe_modulations modulation; + enum fe_fecrates fecrate; + enum fe_stream streamtype; + enum fe_fecrates coderate_HP; + enum fe_fecrates coderate_LP; +}; + +/** + * DSS parameters + */ +struct dss_params { + __u32 symbol_rate; + + enum fe_modulations modulation; + enum fe_fecrates fecrate; +}; + +/** + * DVB-C parameters + */ +struct dvbc_params { + __u32 symbol_rate; + + enum fe_modulations modulation; + enum fe_fecrates fecrate; +}; + +/** + * DVB-T parameters + */ +struct dvbt_params { + enum fe_modulations constellation; + enum fe_bandwidths bandwidth; + enum fe_fecrates code_rate_HP; + enum fe_fecrates code_rate_LP; + enum fe_transmit_modes transmission_mode; + enum fe_guard_intervals guard_interval; + enum fe_hierarchy_info hierarchy; + enum fe_rolloff alpha; + enum fe_stream stream; +}; + +/** + * DVB-H parameters + */ +struct dvbh_params { + enum fe_modulations constellation; + enum fe_fecrates code_rate_HP; + enum fe_fecrates code_rate_LP; + enum fe_transmit_modes transmission_mode; + enum fe_guard_intervals guard_interval; + enum fe_hierarchy_info hierarchy; + enum fe_rolloff alpha; + enum fe_interleaver interleaver; + enum fe_mpefec mpefec; + enum fe_timeslicing timeslicing; + enum fe_stream stream; + __u32 bandwidth; +}; + +/** + * ATSC parameters + */ +struct atsc_params { + enum fe_modulations modulation; +}; + +/** + * Padding to handle future binary compatibility issues. + * + * NOTE: The padding is a dummy parameter ! + */ +struct pad_params { + __u8 pad[512]; +}; + +/** + * Frontend capability information + */ +struct dvb_frontend_cap { + char name[128]; + + __u32 frequency_min; + __u32 frequency_max; + __u32 frequency_stepsize; + __u32 frequency_tolerance; + __u32 symbol_rate_min; + __u32 symbol_rate_max; + __u32 symbol_rate_tolerance; + + enum fe_delsys delivery; + enum fe_inversion inversion; + + union { + struct dvbs_params dvbs; + struct dvbs2_params dvbs2; + struct dss_params dss; + struct dvbc_params dvbc; + struct dvbt_params dvbt; + struct dvbh_params dvbh; + struct atsc_params atsc; + struct pad_params pad; + } delsys; +}; + +/** + * We have the NEW IOCTL's defined now. This IOCTL + * is supposed to handle all the new delivery systems + * FE_GET_CAPS, gets all the capabilities in one go. + * + * For the GET IOCTL's ie FE_GET_PARAMS and FE_GET_CAPS + * some of the parameters maybe selectively queried by + * setting that relevant parameter to IGNORE. + */ +#define FE_GET_CAPS _IOR('o', 84, struct dvb_frontend_cap) + +/** + * Frontend parameters + */ +struct dvb_frontend_params { + __u32 frequency; + + enum fe_delsys delivery; + enum fe_inversion inversion; + + union { + struct dvbs_params dvbs; + struct dvbs2_params dvbs2; + struct dss_params dss; + struct dvbc_params dvbc; + struct dvbt_params dvbt; + struct dvbh_params dvbh; + struct atsc_params atsc; + struct pad_params pad; + } delsys; +}; + +/** + * We have the NEW IOCTL's defined now. These IOCTL's + * are supposed to handle all the new delivery systems. + * FE_SET_PARAMS, sets all the parameters in one go. + * FE_GET_PARAMS, gets all the parameters in one go. + * + * For the GET IOCTL's ie FE_GET_PARAMS and FE_GET_CAPS + * some of the parameters maybe selectively queried by + * setting that relevant parameter to IGNORE. + */ +#define FE_SET_PARAMS _IOW('o', 82, struct dvb_frontend_params) +#define FE_GET_PARAMS _IOR('o', 83, struct dvb_frontend_params) + #endif /*_DVBFRONTEND_H_*/ -- cgit v1.2.3 From 9a5a7b6c35191d8c0681eba05fa6b2d0e63c4583 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 7 May 2006 19:10:00 -0300 Subject: revert manu's multiproto patch by his ask. From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- linux/include/linux/dvb/frontend.h | 530 +------------------------------------ 1 file changed, 1 insertion(+), 529 deletions(-) (limited to 'linux/include') diff --git a/linux/include/linux/dvb/frontend.h b/linux/include/linux/dvb/frontend.h index fe3b69605..c8cbd90ba 100644 --- a/linux/include/linux/dvb/frontend.h +++ b/linux/include/linux/dvb/frontend.h @@ -7,8 +7,6 @@ * Andre Draszik * for convergence integrated media GmbH * - * Copyright (C) 2006 Manu Abraham - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 @@ -251,9 +249,7 @@ struct dvb_frontend_event { */ #define FE_TUNE_MODE_ONESHOT 0x01 -/** - * FE_GET_INFO, is now a legacy IOCTL as well - */ + #define FE_GET_INFO _IOR('o', 61, struct dvb_frontend_info) #define FE_DISEQC_RESET_OVERLOAD _IO('o', 62) @@ -271,9 +267,6 @@ struct dvb_frontend_event { #define FE_READ_SNR _IOR('o', 72, __u16) #define FE_READ_UNCORRECTED_BLOCKS _IOR('o', 73, __u32) -/** - * Legacy IOCTL's - */ #define FE_SET_FRONTEND _IOW('o', 76, struct dvb_frontend_parameters) #define FE_GET_FRONTEND _IOR('o', 77, struct dvb_frontend_parameters) #define FE_SET_FRONTEND_TUNE_MODE _IO('o', 81) /* unsigned int */ @@ -281,525 +274,4 @@ struct dvb_frontend_event { #define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */ -/** - * New operations for new and multiple delivery systems. - * - * References: - * DVB-S: ISO 13818-1/ITU H.222, EN 300 468 - * DVB-S2: EN 300 468, EN 301 210, TR 102 376 - * DVB-C: ISO 13818-1/ITU H.222, EN 300 468, EN 300 429 - * DVB-T: ISO 13818-1/ITU H.222, EN 300 468, EN 300 744 - * DVB-H: EN 300 468, EN 302 304 - */ - -/** - * Supported Delivery systems, some devices - * are capable of supporting multiple delivery systems. - * - * FE_DELSYS_IGNORE, causes the delivery system - * not to be queried. - * - * FE_DELSYS_AUTO, Some devices/drivers, might in - * future be capable of detectinng the delivery system. - */ -enum fe_delsys { - FE_DELSYS_IGNORE = (0 << 0), - FE_DELSYS_DVBS = (1 << 0), - FE_DELSYS_DVBS2 = (1 << 1), - FE_DELSYS_DSS = (1 << 2), - FE_DELSYS_DVBC = (1 << 3), - FE_DELSYS_DVBT = (1 << 4), - FE_DELSYS_DVBH = (1 << 5), - FE_DELSYS_ATSC = (1 << 6), - FE_DELSYS_AUTO = (1 << 31) -}; - -/** - * Supported Transport types, some delivery systems - * support multiple transports too. - * - * FE_MATYPE_IGNORE, causes the transport type not - * to be queried. - * - * FE_MATYPE_AUTO, Some devices/drivers, might - * support auto detecting the transport type, depending - * on some other settings and or hardware features. - * - * NOTE: This is specified by the DVB-S2 specifications - * This change of transport type might require an additional - * change at the PCI bridge level, for some implementations. - */ -enum fe_matype { - FE_MATYPE_IGNORE = (0 << 0), - FE_MATYPE_TRANSPORT = (1 << 0), - FE_MATYPE_GENERIC_PACKET = (1 << 1), - FE_MATYPE_GENERIC_CONTINUOUS = (1 << 2), - FE_MATYPE_RESERVED = (1 << 3), - FE_MATYPE_AUTO = (1 << 31) -}; - -/** - * Supported Stream Priorities - * - * Some delivery systems do have streams having - * different priorities. ie, High priority/Low priority. - * - * NOTE: The default should be the High priority stream. - */ -enum fe_stream { - FE_STREAM_HP = (1 << 0), - FE_STREAM_LP = (1 << 1) -}; - -/** - * Supported Modulations. - * Some devices support multiple modulation types - * - * FE_MOD_IGNORE, causes the modulation type not - * to be queried. - * - * FE_MOD_AUTO, Some devices/drivers, might support - * auto detecting the modulation type, depending on - * some other settings and or hardware features. - */ -enum fe_modulations { - FE_MOD_IGNORE = (0 << 0), - FE_MOD_NONE = (1 << 0), - FE_MOD_BPSK = (1 << 1), - FE_MOD_QPSK = (1 << 2), - FE_MOD_OQPSK = (1 << 3), - FE_MOD_8PSK = (1 << 4), - FE_MOD_16APSK = (1 << 5), - FE_MOD_32APSK = (1 << 6), - FE_MOD_QAM16 = (1 << 7), - FE_MOD_QAM32 = (1 << 8), - FE_MOD_QAM64 = (1 << 9), - FE_MOD_QAM128 = (1 << 10), - FE_MOD_QAM256 = (1 << 11), - FE_MOD_QAM512 = (1 << 12), - FE_MOD_QAM1024 = (1 << 13), - FE_MOD_QAMAUTO = (1 << 14), - FE_MOD_OFDM = (1 << 15), - FE_MOD_COFDM = (1 << 16), - FE_MOD_VSB8 = (1 << 17), - FE_MOD_VSB16 = (1 << 18), - FE_MOD_RSVD = (1 << 19), - FE_MOD_AUTO = (1 << 31) -}; - -/** - * Supported FEC (Forward Error Correction) Code rates - * - * FE_FECRATE_IGNORE, causes the FECRATE type not - * to be queried. - * - * FE_FECRATE_AUTO, Some devices/drivers, might - * support auto detecting the FEC code rate type, depending - * on some other hardware settings and or hardware features. - */ -enum fe_fecrates { - FE_FECRATE_IGNORE = (0 << 0), - FE_FECRATE_NONE = (1 << 0), - FE_FECRATE_1_4 = (1 << 1), - FE_FECRATE_1_3 = (1 << 2), - FE_FECRATE_2_5 = (1 << 3), - FE_FECRATE_1_2 = (1 << 4), - FE_FECRATE_3_5 = (1 << 5), - FE_FECRATE_2_3 = (1 << 6), - FE_FECRATE_3_4 = (1 << 7), - FE_FECRATE_4_5 = (1 << 8), - FE_FECRATE_5_6 = (1 << 9), - FE_FECRATE_6_7 = (1 << 10), - FE_FECRATE_7_8 = (1 << 11), - FE_FECRATE_8_9 = (1 << 12), - FE_FECRATE_9_10 = (1 << 13), - FE_FECRATE_RSVD = (1 << 14), - FE_FECRATE_AUTO = (1 << 31) -}; - -/** - * Supported MODCOD types - * - * The MODCOD types are specific to the DVB-S2 specification - * Some devices directly take the MODCOD values as an input - * or just output the same. - * - * In any case a single frontend will not be able to do - * multiple modulations/code rates at any given point of time. - */ -enum fe_modcod { - FE_MODCOD_DUMMY_PLFRAME = 0, - FE_MODCOD_QPSK_1_4, - FE_MODCOD_QPSK_1_3, - FE_MODCOD_QPSK_2_5, - FE_MODCOD_QPSK_1_2, - FE_MODCOD_QPSK_3_5, - FE_MODCOD_QPSK_2_3, - FE_MODCOD_QPSK_3_4, - FE_MODCOD_QPSK_4_5, - FE_MODCOD_QPSK_5_6, - FE_MODCOD_QPSK_8_9, - FE_MODCOD_QPSK_9_10, - FE_MODCOD_8PSK_3_5, - FE_MODCOD_8PSK_2_3, - FE_MODCOD_8PSK_3_4, - FE_MODCOD_8PSK_5_6, - FE_MODCOD_8PSK_8_9, - FE_MODCOD_8PSK_9_10, - FE_MODCOD_16APSK_2_3, - FE_MODCOD_16APSK_3_4, - FE_MODCOD_16APSK_4_5, - FE_MODCOD_16APSK_5_6, - FE_MODCOD_16APSK_8_9, - FE_MODCOD_16APSK_9_10, - FE_MODCOD_32APSK_3_4, - FE_MODCOD_32APSK_4_5, - FE_MODCOD_32APSK_5_6, - FE_MODCOD_32APSK_8_9, - FE_MODCOD_32APSK_9_10, - FE_MODCOD_RESERVED_1, - FE_MODCOD_BPSK_1_3, - FE_MODCOD_BPSK_1_4, - FE_MODCOD_RESERVED_2 -}; - -/** - * Supported Bandwidth modes - * - * FE_BANDWIDTH_IGNORE, causes the bandwidth not - * to be queried. - * - * FE_BANDWIDTH_AUTO, Some devices/drivers, might - * support auto detecting the Bandwidth, depending - * on some other hardware settings and or hardware features. - */ -enum fe_bandwidths { - FE_BANDWIDTH_IGNORE = (0 << 0), - FE_BANDWIDTH_8_MHZ = (1 << 1), - FE_BANDWIDTH_7_MHZ = (1 << 2), - FE_BANDWIDTH_6_MHZ = (1 << 3), - FE_BANDWIDTH_5_MHZ = (1 << 4), - FE_BANDWIDTH_RESERVED = (1 << 5), - FE_BANDWIDTH_AUTO = (1 << 31) -}; - -/** - * Supported Inversion modes - * - * FE_INVERSION_IGNORE, causes the inversion not - * to be queried. - * - * FE_INVERSION_AUTO, Some devices/drivers, might - * support auto detecting the Inversion, depending - * on some other hardware settings and or hardware features. - * - * NOTE: All current delivery systems need inversion in some - * way or the other, due to hardware implementation specifics. - * and/or others. - */ -enum fe_inversion { - FE_INVERSION_IGNORE = (0 << 0), - FE_INVERSION_OFF = (1 << 0), - FE_INVERSION_ON = (1 << 1), - FE_INVERSION_AUTO = (1 << 31) -}; - -/** - * Supported Transmission modes - * - * FE_TRANSMISSION_MODE_IGNORE, causes the transmission mode - * not to be queried. - * - * FE_TRANSMISSION_MODE_AUTO, Some devices/drivers, might - * support auto detecting the Transmission Mode, depending - * on some other hardware settings and or hardware features. - * - * NOTE: Currently applies to DVB-T and DVB-H only. - */ -enum fe_transmit_modes { - FE_TRANSMISSION_MODE_IGNORE = (0 << 0), - FE_TRANSMISSION_MODE_2K = (1 << 1), - FE_TRANSMISSION_MODE_4K = (1 << 2), - FE_TRANSMISSION_MODE_8K = (1 << 3), - FE_TRANSMISSION_MODE_RESERVED = (1 << 4), - FE_TRANSMISSION_MODE_AUTO = (1 << 31) -}; - -/** - * Supported Guard Intervals - * - * FE_GUARD_INTERVAL_IGNORE, causes the guard interval - * not to be queried. - * - * FE_GUARD_INTERVAL_AUTO, Some devices/drivers, might - * support auto detecting the Transmission Mode, depending - * on some other hardware settings and or hardware features. - * - * NOTE: Currently applies to DVB-T and DVB-H only. - */ -enum fe_guard_intervals { - FE_GUARD_INTERVAL_IGNORE = (0 << 0), - FE_GUARD_INTERVAL_1_32 = (1 << 1), - FE_GUARD_INTERVAL_1_16 = (1 << 2), - FE_GUARD_INTERVAL_1_8 = (1 << 3), - FE_GUARD_INTERVAL_1_4 = (1 << 4), - FE_GUARD_INTERVAL_AUTO = (1 << 31) -}; - -/** - * Supported Hierarchial Modulations - * - * FE_HIERARCHY_IGNORE, causes the hierarchy - * not to be queried. - * - * FE_HIERARCHY_AUTO, Some devices/drivers, might - * support auto detecting the hierarchial modulation, depending - * on some other hardware settings and or hardware features. - * - * NOTE: Currently applies to DVB-T and DVB-H only. - */ -enum fe_hierarchy_info { - FE_HIERARCHY_IGNORE = (0 << 0), - FE_HIERARCHY_OFF = (1 << 1), - FE_HIERARCHY_ON = (1 << 2), - FE_HIERARCHY_AUTO = (1 << 31) -}; - -/** - * Supported Rolloff Rates - * - * FE_ROLLOFF_IGNORE, causes the hierarchy - * not to be queried. - * - * FE_ROLLOFF_AUTO, Some devices/drivers, might - * support auto detecting the hierarchial modulation, depending - * on some other hardware settings and or hardware features. - * - * NOTE: Currently applies to DVB-T and DVB-H only, - * not applicable to DVB-S2, DVB-S2 uses fe_matype - */ -enum fe_rolloff { - FE_ROLLOFF_IGNORE = (0 << 0), - FE_ROLLOFF_1 = (1 << 1), - FE_ROLLOFF_2 = (1 << 2), - FE_ROLLOFF_4 = (1 << 3), - FE_ROLLOFF_AUTO = (1 << 31) -}; - -/** - * Supported Interleaver types - * - * FE_INTERLEAVER_IGNORE, causes the hierarchy - * not to be queried. - * - * FE_INTERLEAVER_AUTO, Some devices/drivers, might - * support auto detecting the hierarchial modulation, depending - * on some other hardware settings and or hardware features. - * - * NOTE: Currently applies only to DVB-H. - */ -enum fe_interleaver { - FE_INTERLEAVER_IGNORE = (0 << 0), - FE_INTERLEAVER_NATIVE = (1 << 1), - FE_INTERLEAVER_INDEPTH = (1 << 2), - FE_INTERLEAVER_AUTO = (1 << 31) -}; - - -/** - * Supported MPE-FEC modes - * - * FE_MPEFEC_IGNORE, causes the mpefec indicator - * not to be queried. - * - * NOTE: MPE-FEC is an indicator according to EN 300 468 - * Currently applies only to DVB-H. - */ -enum fe_mpefec { - FE_MPEFEC_IGNORE = (0 << 0), - FE_MPEFEC_ON = (1 << 1), - FE_MPEFEC_OFF = (1 << 2) -}; - -/** - * Supported Timeslicing mode - * - * FE_TIMESLICING_IGNORE, causes the timeslicing indicator - * not to be queried. - * - * NOTE: Timeslicing is an indicator according to EN 300 468 - * Currently applies only to DVB-H. - */ -enum fe_timeslicing { - FE_TIMESLICING_IGNORE = (0 << 0), - FE_TIMESLICING_ON = (1 << 1), - FE_TIMESLICING_OFF = (1 << 2) -}; - -/** - * DVB-S parameters - */ -struct dvbs_params { - __u32 symbol_rate; - - enum fe_modulations modulation; - enum fe_fecrates fecrate; -}; - -/** - * DVB-S2 parameters - */ -struct dvbs2_params { - __u32 symbol_rate; - - enum fe_modulations modulation; - enum fe_fecrates fecrate; - enum fe_stream streamtype; - enum fe_fecrates coderate_HP; - enum fe_fecrates coderate_LP; -}; - -/** - * DSS parameters - */ -struct dss_params { - __u32 symbol_rate; - - enum fe_modulations modulation; - enum fe_fecrates fecrate; -}; - -/** - * DVB-C parameters - */ -struct dvbc_params { - __u32 symbol_rate; - - enum fe_modulations modulation; - enum fe_fecrates fecrate; -}; - -/** - * DVB-T parameters - */ -struct dvbt_params { - enum fe_modulations constellation; - enum fe_bandwidths bandwidth; - enum fe_fecrates code_rate_HP; - enum fe_fecrates code_rate_LP; - enum fe_transmit_modes transmission_mode; - enum fe_guard_intervals guard_interval; - enum fe_hierarchy_info hierarchy; - enum fe_rolloff alpha; - enum fe_stream stream; -}; - -/** - * DVB-H parameters - */ -struct dvbh_params { - enum fe_modulations constellation; - enum fe_fecrates code_rate_HP; - enum fe_fecrates code_rate_LP; - enum fe_transmit_modes transmission_mode; - enum fe_guard_intervals guard_interval; - enum fe_hierarchy_info hierarchy; - enum fe_rolloff alpha; - enum fe_interleaver interleaver; - enum fe_mpefec mpefec; - enum fe_timeslicing timeslicing; - enum fe_stream stream; - __u32 bandwidth; -}; - -/** - * ATSC parameters - */ -struct atsc_params { - enum fe_modulations modulation; -}; - -/** - * Padding to handle future binary compatibility issues. - * - * NOTE: The padding is a dummy parameter ! - */ -struct pad_params { - __u8 pad[512]; -}; - -/** - * Frontend capability information - */ -struct dvb_frontend_cap { - char name[128]; - - __u32 frequency_min; - __u32 frequency_max; - __u32 frequency_stepsize; - __u32 frequency_tolerance; - __u32 symbol_rate_min; - __u32 symbol_rate_max; - __u32 symbol_rate_tolerance; - - enum fe_delsys delivery; - enum fe_inversion inversion; - - union { - struct dvbs_params dvbs; - struct dvbs2_params dvbs2; - struct dss_params dss; - struct dvbc_params dvbc; - struct dvbt_params dvbt; - struct dvbh_params dvbh; - struct atsc_params atsc; - struct pad_params pad; - } delsys; -}; - -/** - * We have the NEW IOCTL's defined now. This IOCTL - * is supposed to handle all the new delivery systems - * FE_GET_CAPS, gets all the capabilities in one go. - * - * For the GET IOCTL's ie FE_GET_PARAMS and FE_GET_CAPS - * some of the parameters maybe selectively queried by - * setting that relevant parameter to IGNORE. - */ -#define FE_GET_CAPS _IOR('o', 84, struct dvb_frontend_cap) - -/** - * Frontend parameters - */ -struct dvb_frontend_params { - __u32 frequency; - - enum fe_delsys delivery; - enum fe_inversion inversion; - - union { - struct dvbs_params dvbs; - struct dvbs2_params dvbs2; - struct dss_params dss; - struct dvbc_params dvbc; - struct dvbt_params dvbt; - struct dvbh_params dvbh; - struct atsc_params atsc; - struct pad_params pad; - } delsys; -}; - -/** - * We have the NEW IOCTL's defined now. These IOCTL's - * are supposed to handle all the new delivery systems. - * FE_SET_PARAMS, sets all the parameters in one go. - * FE_GET_PARAMS, gets all the parameters in one go. - * - * For the GET IOCTL's ie FE_GET_PARAMS and FE_GET_CAPS - * some of the parameters maybe selectively queried by - * setting that relevant parameter to IGNORE. - */ -#define FE_SET_PARAMS _IOW('o', 82, struct dvb_frontend_params) -#define FE_GET_PARAMS _IOR('o', 83, struct dvb_frontend_params) - #endif /*_DVBFRONTEND_H_*/ -- cgit v1.2.3 From 3806358efcb85863e495093fa74fb649167785b5 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sat, 20 May 2006 21:04:31 +0200 Subject: Add support for the Texas Instruments TLV320AIC23B audio codec From: Scott Alfter Signed-off-by: Scott Alfter Signed-off-by: Hans Verkuil --- linux/include/linux/i2c-id.h | 1 + 1 file changed, 1 insertion(+) (limited to 'linux/include') diff --git a/linux/include/linux/i2c-id.h b/linux/include/linux/i2c-id.h index 748bbf7c3..21338bb34 100644 --- a/linux/include/linux/i2c-id.h +++ b/linux/include/linux/i2c-id.h @@ -114,6 +114,7 @@ #define I2C_DRIVERID_RS5C372 84 /* Ricoh RS5C372 RTC */ #define I2C_DRIVERID_BT866 85 /* Conexant bt866 video encoder */ #define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */ +#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */ #define I2C_DRIVERID_I2CDEV 900 #define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ -- cgit v1.2.3 From 75a16706f30b342b7c4664fd7a0b0362e3f9adc6 Mon Sep 17 00:00:00 2001 From: Ricardo Cerqueira Date: Mon, 22 May 2006 11:44:02 +0100 Subject: New cx88 card #50: NPG Tech RealTV From: Ricardo Cerqueira Added support for a new cx88 card, including it's remote Signed-off-by: Ricardo Cerqueira --- linux/include/media/ir-common.h | 1 + 1 file changed, 1 insertion(+) (limited to 'linux/include') diff --git a/linux/include/media/ir-common.h b/linux/include/media/ir-common.h index f0beace1f..7bab09b0e 100644 --- a/linux/include/media/ir-common.h +++ b/linux/include/media/ir-common.h @@ -89,6 +89,7 @@ extern IR_KEYTAB_TYPE ir_codes_rc5_tv[IR_KEYTAB_SIZE]; extern IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE]; extern IR_KEYTAB_TYPE ir_codes_pinnacle_color[IR_KEYTAB_SIZE]; extern IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE]; +extern IR_KEYTAB_TYPE ir_codes_npgtech[IR_KEYTAB_SIZE]; #endif -- cgit v1.2.3 From 35006ff0b9db3efb1546bb3d08bfa586b2eacac2 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 26 May 2006 10:28:13 -0300 Subject: Trivial videodev2.h patch From: David Mosberger-Tang linux/videodev2.h uses types such as __u8 but it fails to include . Within the kernel, that's not a problem because already includes . However, there are user apps that try to include videodev2.h (e.g., ekiga) and at least on ia64, it causes compilation failures since doesn't get included for any other reason, leaving __u8 etc. undefined. The attached patch fixes the problem for me. Signed-off-by: Andrew Morton Signed-off-by: Mauro Carvalho Chehab --- linux/include/linux/videodev2.h | 1 + 1 file changed, 1 insertion(+) (limited to 'linux/include') diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h index 5d46a8d2a..47e70ab7a 100644 --- a/linux/include/linux/videodev2.h +++ b/linux/include/linux/videodev2.h @@ -26,6 +26,7 @@ #endif #endif #endif +#include #include /* need __user */ -- cgit v1.2.3 From 5b59056968698df6812231be56c058efe8c0e629 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 4 Jun 2006 10:06:18 -0300 Subject: Several improvements at videodev.c From: Mauro Carvalho Chehab Videodev now is capable of better handling V4L2 api, by processing V4L2 ioctls and using callbacks to the driver. The drivers should be migrated to the newer way and the older one will be obsoleted soon. Signed-off-by: Mauro Carvalho Chehab --- linux/include/linux/videodev.h | 67 +++---- linux/include/linux/videodev2.h | 169 +--------------- linux/include/media/v4l2-common.h | 6 + linux/include/media/v4l2-dev.h | 408 ++++++++++++++++++++++++++++++++++++++ linux/include/media/video-buf.h | 1 + 5 files changed, 452 insertions(+), 199 deletions(-) create mode 100644 linux/include/media/v4l2-dev.h (limited to 'linux/include') diff --git a/linux/include/linux/videodev.h b/linux/include/linux/videodev.h index 26b09a153..01228a4bf 100644 --- a/linux/include/linux/videodev.h +++ b/linux/include/linux/videodev.h @@ -1,50 +1,34 @@ +/* + * Video for Linux version 1 - OBSOLETE + * + * Header file for v4l1 drivers and applications, for + * Linux kernels 2.2.x or 2.4.x. + * + * Provides header for legacy drivers and applications + * + * See http://linuxtv.org for more info + * + */ #ifndef __LINUX_VIDEODEV_H #define __LINUX_VIDEODEV_H #include - -#define HAVE_V4L1 1 - -#include - -#ifdef __KERNEL__ - -#include - -extern struct video_device* video_devdata(struct file*); - +#include +#include +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69) +#include +#endif #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) -#define to_video_device(cd) container_of(cd, struct video_device, class_dev) -static inline void -video_device_create_file(struct video_device *vfd, - struct class_device_attribute *attr) -{ - class_device_create_file(&vfd->class_dev, attr); -} -static inline void -video_device_remove_file(struct video_device *vfd, - struct class_device_attribute *attr) -{ - class_device_remove_file(&vfd->class_dev, attr); -} +#include +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) +#include #endif - -#if OBSOLETE_OWNER /* to be removed in 2.6.15 */ -/* helper functions to access driver private data. */ -static inline void *video_get_drvdata(struct video_device *dev) -{ - return dev->priv; -} - -static inline void video_set_drvdata(struct video_device *dev, void *data) -{ - dev->priv = data; -} #endif +#include /* need __user */ -extern int video_exclusive_open(struct inode *inode, struct file *file); -extern int video_exclusive_release(struct inode *inode, struct file *file); -#endif /* __KERNEL__ */ +#define HAVE_V4L1 1 + +#include struct video_capability { @@ -365,6 +349,11 @@ struct video_code #define VID_HARDWARE_SAA7114H 37 #define VID_HARDWARE_SN9C102 38 #define VID_HARDWARE_ARV 39 + +#ifdef __KERNEL__ +#include +#endif /* __KERNEL__ */ + #endif /* __LINUX_VIDEODEV_H */ /* diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h index 47e70ab7a..98ca1d1c8 100644 --- a/linux/include/linux/videodev2.h +++ b/linux/include/linux/videodev2.h @@ -1,36 +1,23 @@ -#ifndef __LINUX_VIDEODEV2_H -#define __LINUX_VIDEODEV2_H /* * Video for Linux Two * - * Header file for v4l or V4L2 drivers and applications, for - * Linux kernels 2.2.x or 2.4.x. + * Header file for v4l or V4L2 drivers and applications + * with public API. + * All kernel-specific stuff were moved to media/v4l2-dev.h, so + * no #if __KERNEL tests are allowed here * - * See http://bytesex.org/v4l/ for API specs and other - * v4l2 documentation. + * See http://linuxtv.org for more info * * Author: Bill Dirks * Justin Schoeman * et al. */ -#ifdef __KERNEL__ +#ifndef __LINUX_VIDEODEV2_H +#define __LINUX_VIDEODEV2_H #include /* need struct timeval */ -#include -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69) -#include -#endif -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) -#include -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) -#include -#endif -#endif -#endif #include #include /* need __user */ - -#define OBSOLETE_OWNER 1 /* It will be removed for 2.6.17 */ #define HAVE_V4L2 1 /* @@ -55,98 +42,6 @@ #define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ #define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ -#ifdef __KERNEL__ - -/* Minor device allocation */ -#define MINOR_VFL_TYPE_GRABBER_MIN 0 -#define MINOR_VFL_TYPE_GRABBER_MAX 63 -#define MINOR_VFL_TYPE_RADIO_MIN 64 -#define MINOR_VFL_TYPE_RADIO_MAX 127 -#define MINOR_VFL_TYPE_VTX_MIN 192 -#define MINOR_VFL_TYPE_VTX_MAX 223 -#define MINOR_VFL_TYPE_VBI_MIN 224 -#define MINOR_VFL_TYPE_VBI_MAX 255 - -#define VFL_TYPE_GRABBER 0 -#define VFL_TYPE_VBI 1 -#define VFL_TYPE_RADIO 2 -#define VFL_TYPE_VTX 3 - -struct video_device -{ - /* device info */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) - struct device *dev; -#endif - char name[32]; - int type; /* v4l1 */ - int type2; /* v4l2 */ - int hardware; - int minor; - - /* device ops + callbacks */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) - const struct file_operations *fops; -#else - struct file_operations *fops; -#endif - void (*release)(struct video_device *vfd); - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - /* old, obsolete interface -- dropped in 2.5.x, don't use it */ - int (*open)(struct video_device *, int mode); - void (*close)(struct video_device *); - long (*read)(struct video_device *, char *, unsigned long, int noblock); - long (*write)(struct video_device *, const char *, unsigned long, int noblock); - unsigned int (*poll)(struct video_device *, struct file *, poll_table *); - int (*ioctl)(struct video_device *, unsigned int , void *); - int (*mmap)(struct video_device *, const char *, unsigned long); - int (*initialize)(struct video_device *); -#endif - -#if OBSOLETE_OWNER /* to be removed in 2.6.15 */ - /* obsolete -- fops->owner is used instead */ - struct module *owner; - /* dev->driver_data will be used instead some day. - * Use the video_{get|set}_drvdata() helper functions, - * so the switch over will be transparent for you. - * Or use {pci|usb}_{get|set}_drvdata() directly. */ - void *priv; -#endif - - /* for videodev.c intenal usage -- please don't touch */ - int users; /* video_exclusive_{open|close} ... */ -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) - struct mutex lock; /* ... helper function uses these */ -#else - struct semaphore lock; /* ... helper function uses these */ -#endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69) - devfs_handle_t devfs_handle; /* devfs */ -#else - char devfs_name[64]; /* devfs */ -#endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) - struct class_device class_dev; /* sysfs */ -#endif -}; - -#define VIDEO_MAJOR 81 - -extern int video_register_device(struct video_device *, int type, int nr); -extern void video_unregister_device(struct video_device *); -extern int video_usercopy(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg, - int (*func)(struct inode *inode, struct file *file, - unsigned int cmd, void *arg)); - -/* helper functions to alloc / release struct video_device, the - later can be used for video_device->release() */ -struct video_device *video_device_alloc(void); -void video_device_release(struct video_device *vfd); - -#endif - /* * M I S C E L L A N E O U S */ @@ -1202,6 +1097,7 @@ struct v4l2_streamparm #endif #define VIDIOC_LOG_STATUS _IO ('V', 70) +#ifdef __OLD_VIDIOC_ /* for compatibility, will go away some day */ #define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int) #define VIDIOC_S_PARM_OLD _IOW ('V', 22, struct v4l2_streamparm) @@ -1209,57 +1105,10 @@ struct v4l2_streamparm #define VIDIOC_G_AUDIO_OLD _IOWR ('V', 33, struct v4l2_audio) #define VIDIOC_G_AUDOUT_OLD _IOWR ('V', 49, struct v4l2_audioout) #define VIDIOC_CROPCAP_OLD _IOR ('V', 58, struct v4l2_cropcap) - -#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */ - - -#ifdef __KERNEL__ -/* - * - * V 4 L 2 D R I V E R H E L P E R A P I - * - * Some commonly needed functions for drivers (v4l2-common.o module) - */ -#include - -/* Video standard functions */ -extern unsigned int v4l2_video_std_fps(struct v4l2_standard *vs); -extern int v4l2_video_std_construct(struct v4l2_standard *vs, - int id, char *name); - -/* prority handling */ -struct v4l2_prio_state { - atomic_t prios[4]; -}; -int v4l2_prio_init(struct v4l2_prio_state *global); -int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local, - enum v4l2_priority new); -int v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local); -int v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority *local); -enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global); -int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local); - -/* names for fancy debug output */ -extern char *v4l2_field_names[]; -extern char *v4l2_type_names[]; - -/* Compatibility layer interface -- v4l1-compat module */ -typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file, - unsigned int cmd, void *arg); - -#ifdef CONFIG_VIDEO_V4L1_COMPAT -int v4l_compat_translate_ioctl(struct inode *inode, struct file *file, - int cmd, void *arg, v4l2_kioctl driver_ioctl); -#else -#define v4l_compat_translate_ioctl(inode,file,cmd,arg,ioctl) -EINVAL #endif -/* 32 Bits compatibility layer for 64 bits processors */ -extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd, - unsigned long arg); - +#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */ -#endif /* __KERNEL__ */ #endif /* __LINUX_VIDEODEV2_H */ /* diff --git a/linux/include/media/v4l2-common.h b/linux/include/media/v4l2-common.h index 31223f4eb..f1d7a063a 100644 --- a/linux/include/media/v4l2-common.h +++ b/linux/include/media/v4l2-common.h @@ -26,8 +26,14 @@ #ifndef V4L2_COMMON_H_ #define V4L2_COMMON_H_ +#include + /* v4l debugging and diagnostics */ +/* Debug bitmask flags to be used on V4L2 */ +#define V4L2_DEBUG_IOCTL 0x01 +#define V4L2_DEBUG_IOCTL_ARG 0x02 + /* Common printk constucts for v4l-i2c drivers. These macros create a unique prefix consisting of the driver name, the adapter number and the i2c address. */ diff --git a/linux/include/media/v4l2-dev.h b/linux/include/media/v4l2-dev.h new file mode 100644 index 000000000..f1822e460 --- /dev/null +++ b/linux/include/media/v4l2-dev.h @@ -0,0 +1,408 @@ +/* + * + * V 4 L 2 D R I V E R H E L P E R A P I + * + * Moved from videodev2.h + * + * Some commonly needed functions for drivers (v4l2-common.o module) + */ +#ifndef _V4L2_DEV_H +#define _V4L2_DEV_H + +#define OBSOLETE_OWNER 1 /* to be removed soon */ + +#include +#include +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69) +#include +#endif +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) +#include +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) +#include +#endif +#endif +#include /* need __user */ +#ifdef CONFIG_VIDEO_V4L1 +#include +#else +#include +#endif + +#include + +#define VIDEO_MAJOR 81 +/* Minor device allocation */ +#define MINOR_VFL_TYPE_GRABBER_MIN 0 +#define MINOR_VFL_TYPE_GRABBER_MAX 63 +#define MINOR_VFL_TYPE_RADIO_MIN 64 +#define MINOR_VFL_TYPE_RADIO_MAX 127 +#define MINOR_VFL_TYPE_VTX_MIN 192 +#define MINOR_VFL_TYPE_VTX_MAX 223 +#define MINOR_VFL_TYPE_VBI_MIN 224 +#define MINOR_VFL_TYPE_VBI_MAX 255 + +#define VFL_TYPE_GRABBER 0 +#define VFL_TYPE_VBI 1 +#define VFL_TYPE_RADIO 2 +#define VFL_TYPE_VTX 3 + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) + const struct file_operations *fops; +#endif + +/* Video standard functions */ +extern unsigned int v4l2_video_std_fps(struct v4l2_standard *vs); +extern int v4l2_video_std_construct(struct v4l2_standard *vs, + int id, char *name); + +/* prority handling */ +struct v4l2_prio_state { + atomic_t prios[4]; +}; +int v4l2_prio_init(struct v4l2_prio_state *global); +int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local, + enum v4l2_priority new); +int v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local); +int v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority *local); +enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global); +int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local); + +/* names for fancy debug output */ +extern char *v4l2_field_names[]; +extern char *v4l2_type_names[]; + +/* Compatibility layer interface -- v4l1-compat module */ +typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file, + unsigned int cmd, void *arg); +#ifdef CONFIG_VIDEO_V4L1_COMPAT +int v4l_compat_translate_ioctl(struct inode *inode, struct file *file, + int cmd, void *arg, v4l2_kioctl driver_ioctl); +#else +#define v4l_compat_translate_ioctl(inode,file,cmd,arg,ioctl) -EINVAL +#endif + +/* 32 Bits compatibility layer for 64 bits processors */ +extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd, + unsigned long arg); + +/* + * Newer version of video_device, handled by videodev2.c + * 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 +{ + /* device ops */ + struct file_operations *fops; + + /* device info */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) + struct device *dev; +#endif + char name[32]; + int type; /* v4l1 */ + int type2; /* v4l2 */ + int hardware; + int minor; + + /* This pointer is passed by parameter to each ioctl handler + and should contain file handler for the device */ + void *fh; + + 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; + + /* callbacks */ + void (*release)(struct video_device *vfd); + + /* ioctl callbacks */ + + /* VIDIOC_QUERYCAP handler */ + int (*vidioc_querycap)(struct file *file, void *fh, struct v4l2_capability *cap); + + /* Priority handling */ + int (*vidioc_g_priority) (struct file *file, void *fh, + enum v4l2_priority *p); + int (*vidioc_s_priority) (struct file *file, void *fh, + enum v4l2_priority p); + + /* VIDIOC_ENUM_FMT handlers */ + int (*vidioc_enum_fmt_cap) (struct file *file, void *fh, + struct v4l2_fmtdesc *f); + int (*vidioc_enum_fmt_overlay) (struct file *file, void *fh, + struct v4l2_fmtdesc *f); + int (*vidioc_enum_fmt_vbi) (struct file *file, void *fh, + struct v4l2_fmtdesc *f); + int (*vidioc_enum_fmt_vbi_capture) (struct file *file, void *fh, + struct v4l2_fmtdesc *f); + int (*vidioc_enum_fmt_video_output)(struct file *file, void *fh, + struct v4l2_fmtdesc *f); + int (*vidioc_enum_fmt_vbi_output) (struct file *file, void *fh, + struct v4l2_fmtdesc *f); + int (*vidioc_enum_fmt_type_private)(struct file *file, void *fh, + struct v4l2_fmtdesc *f); + + /* VIDIOC_G_FMT handlers */ + int (*vidioc_g_fmt_cap) (struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_g_fmt_overlay) (struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_g_fmt_vbi) (struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_g_fmt_vbi_output) (struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_g_fmt_vbi_capture)(struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_g_fmt_video_output)(struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_g_fmt_type_private)(struct file *file, void *fh, + struct v4l2_format *f); + + /* VIDIOC_S_FMT handlers */ + int (*vidioc_s_fmt_cap) (struct file *file, void *fh, + struct v4l2_format *f); + + int (*vidioc_s_fmt_overlay) (struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_s_fmt_vbi) (struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_s_fmt_vbi_output) (struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_s_fmt_vbi_capture)(struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_s_fmt_video_output)(struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_s_fmt_type_private)(struct file *file, void *fh, + struct v4l2_format *f); + + /* VIDIOC_TRY_FMT handlers */ + int (*vidioc_try_fmt_cap) (struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_try_fmt_overlay) (struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_try_fmt_vbi) (struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_try_fmt_vbi_output) (struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_try_fmt_vbi_capture)(struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_try_fmt_video_output)(struct file *file, void *fh, + struct v4l2_format *f); + int (*vidioc_try_fmt_type_private)(struct file *file, void *fh, + struct v4l2_format *f); + + /* Buffer handlers */ + int (*vidioc_reqbufs) (struct file *file, void *fh, struct v4l2_requestbuffers *b); + int (*vidioc_querybuf)(struct file *file, void *fh, struct v4l2_buffer *b); + int (*vidioc_qbuf) (struct file *file, void *fh, struct v4l2_buffer *b); + int (*vidioc_dqbuf) (struct file *file, void *fh, struct v4l2_buffer *b); + + + int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i); +#ifdef HAVE_V4L1 + /* buffer type is struct vidio_mbuf * */ + int (*vidiocgmbuf) (struct file *file, void *fh, struct video_mbuf *p); +#endif + int (*vidioc_g_fbuf) (struct file *file, void *fh, + struct v4l2_framebuffer *a); + int (*vidioc_s_fbuf) (struct file *file, void *fh, + struct v4l2_framebuffer *a); + + /* Stream on/off */ + int (*vidioc_streamon) (struct file *file, void *fh, enum v4l2_buf_type i); + int (*vidioc_streamoff)(struct file *file, void *fh, enum v4l2_buf_type i); + + /* 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_querystd) (struct file *file, void *fh, v4l2_std_id *a); + + /* Input handling */ + int (*vidioc_enum_input)(struct file *file, void *fh, + struct v4l2_input *inp); + int (*vidioc_g_input) (struct file *file, void *fh, unsigned int *i); + int (*vidioc_s_input) (struct file *file, void *fh, unsigned int i); + + /* Output handling */ + int (*vidioc_enumoutput) (struct file *file, void *fh, + struct v4l2_output *a); + int (*vidioc_g_output) (struct file *file, void *fh, unsigned int *i); + int (*vidioc_s_output) (struct file *file, void *fh, unsigned int i); + + /* Control handling */ + int (*vidioc_queryctrl) (struct file *file, void *fh, + struct v4l2_queryctrl *a); + int (*vidioc_g_ctrl) (struct file *file, void *fh, + struct v4l2_control *a); + int (*vidioc_s_ctrl) (struct file *file, void *fh, + struct v4l2_control *a); + int (*vidioc_querymenu) (struct file *file, void *fh, + struct v4l2_querymenu *a); + + /* Audio ioctls */ + int (*vidioc_enumaudio) (struct file *file, void *fh, + struct v4l2_audio *a); + int (*vidioc_g_audio) (struct file *file, void *fh, + struct v4l2_audio *a); + int (*vidioc_s_audio) (struct file *file, void *fh, + struct v4l2_audio *a); + + /* Audio out ioctls */ + int (*vidioc_enumaudout) (struct file *file, void *fh, + struct v4l2_audioout *a); + int (*vidioc_g_audout) (struct file *file, void *fh, + struct v4l2_audioout *a); + int (*vidioc_s_audout) (struct file *file, void *fh, + struct v4l2_audioout *a); + int (*vidioc_g_modulator) (struct file *file, void *fh, + struct v4l2_modulator *a); + int (*vidioc_s_modulator) (struct file *file, void *fh, + struct v4l2_modulator *a); + /* Crop ioctls */ + int (*vidioc_cropcap) (struct file *file, void *fh, + struct v4l2_cropcap *a); + int (*vidioc_g_crop) (struct file *file, void *fh, + struct v4l2_crop *a); + int (*vidioc_s_crop) (struct file *file, void *fh, + struct v4l2_crop *a); + /* Compression ioctls */ + int (*vidioc_g_mpegcomp) (struct file *file, void *fh, + struct v4l2_mpeg_compression *a); + int (*vidioc_s_mpegcomp) (struct file *file, void *fh, + struct v4l2_mpeg_compression *a); + int (*vidioc_g_jpegcomp) (struct file *file, void *fh, + struct v4l2_jpegcompression *a); + int (*vidioc_s_jpegcomp) (struct file *file, void *fh, + struct v4l2_jpegcompression *a); + + /* Stream type-dependent parameter ioctls */ + int (*vidioc_g_parm) (struct file *file, void *fh, + struct v4l2_streamparm *a); + int (*vidioc_s_parm) (struct file *file, void *fh, + struct v4l2_streamparm *a); + + /* Tuner ioctls */ + int (*vidioc_g_tuner) (struct file *file, void *fh, + struct v4l2_tuner *a); + int (*vidioc_s_tuner) (struct file *file, void *fh, + struct v4l2_tuner *a); + int (*vidioc_g_frequency) (struct file *file, void *fh, + struct v4l2_frequency *a); + int (*vidioc_s_frequency) (struct file *file, void *fh, + struct v4l2_frequency *a); + + /* Sliced VBI cap */ + int (*vidioc_g_sliced_vbi_cap) (struct file *file, void *fh, + struct v4l2_sliced_vbi_cap *a); + + /* Log status ioctl */ + int (*vidioc_log_status) (struct file *file, void *fh); + +#if 0 /* old, obsolete interface */ + int (*open)(struct video_device *, int mode); + void (*close)(struct video_device *); + long (*read)(struct video_device *, char *, unsigned long, int noblock); + long (*write)(struct video_device *, const char *, unsigned long, int noblock); + unsigned int (*poll)(struct video_device *, struct file *, poll_table *); + int (*ioctl)(struct video_device *, unsigned int , void *); + int (*mmap)(struct video_device *, const char *, unsigned long); + int (*initialize)(struct video_device *); +#endif + +#if OBSOLETE_OWNER /* to be removed soon */ +/* obsolete -- fops->owner is used instead */ +struct module *owner; +/* dev->driver_data will be used instead some day. + * Use the video_{get|set}_drvdata() helper functions, + * so the switch over will be transparent for you. + * Or use {pci|usb}_{get|set}_drvdata() directly. */ +void *priv; +#endif + + /* for videodev.c intenal usage -- please don't touch */ + int users; /* video_exclusive_{open|close} ... */ +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) + struct mutex lock; /* ... helper function uses these */ +#else + struct semaphore lock; /* ... helper function uses these */ +#endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69) + devfs_handle_t devfs_handle; /* devfs */ +#else + char devfs_name[64]; /* devfs */ +#endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) + struct class_device class_dev; /* sysfs */ +#endif +}; + +/* Version 2 functions */ +extern int video_register_device(struct video_device *vfd, int type, int nr); +void video_unregister_device(struct video_device *); +extern int video_ioctl2(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg); + +/* helper functions to alloc / release struct video_device, the + later can be used for video_device->release() */ +struct video_device *video_device_alloc(void); +void video_device_release(struct video_device *vfd); + +/* Include support for obsoleted stuff */ +extern int video_usercopy(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg, + int (*func)(struct inode *inode, struct file *file, + unsigned int cmd, void *arg)); + + +#ifdef HAVE_V4L1 +#include + +extern struct video_device* video_devdata(struct file*); + +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) +#define to_video_device(cd) container_of(cd, struct video_device, class_dev) +static inline void +video_device_create_file(struct video_device *vfd, + struct class_device_attribute *attr) +{ + class_device_create_file(&vfd->class_dev, attr); +} +static inline void +video_device_remove_file(struct video_device *vfd, + struct class_device_attribute *attr) +{ + class_device_remove_file(&vfd->class_dev, attr); +} +#endif + +#if OBSOLETE_OWNER /* to be removed soon */ +/* helper functions to access driver private data. */ +static inline void *video_get_drvdata(struct video_device *dev) +{ + return dev->priv; +} + +static inline void video_set_drvdata(struct video_device *dev, void *data) +{ + dev->priv = data; +} +#endif + +extern int video_exclusive_open(struct inode *inode, struct file *file); +extern int video_exclusive_release(struct inode *inode, struct file *file); +#endif /* HAVE_V4L1 */ + +#endif /* _V4L2_DEV_H */ diff --git a/linux/include/media/video-buf.h b/linux/include/media/video-buf.h index 7f8f6ca81..ae694cfbc 100644 --- a/linux/include/media/video-buf.h +++ b/linux/include/media/video-buf.h @@ -23,6 +23,7 @@ */ #include +#include #define UNSET (-1U) -- cgit v1.2.3 From 846c556b88da6cefc77bcd828f0266c7b6f1da29 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 5 Jun 2006 10:26:32 -0300 Subject: Removed all references to kernel stuff from videodev.h and videodev2.h From: Mauro Carvalho Chehab The videodev.h and videodev2.h describe the public API for V4L and V4L2. It shouldn't have there any kernel-specific stuff. Those were moved to v4l2-dev.h. This patch removes some uneeded headers and include v4l2-common.h on all V4L driver. This header includes device implementation of V4L2 API provided on v4l2-dev.h as well as V4L2 internal ioctls that provides connections between master driver and its i2c devices. Signed-off-by: Mauro Carvalho Chehab --- linux/include/linux/videodev.h | 18 ------------------ linux/include/linux/videodev2.h | 18 ++++-------------- linux/include/media/ovcamchip.h | 1 + linux/include/media/saa7146_vv.h | 2 +- linux/include/media/v4l2-dev.h | 4 ++-- 5 files changed, 8 insertions(+), 35 deletions(-) (limited to 'linux/include') diff --git a/linux/include/linux/videodev.h b/linux/include/linux/videodev.h index 01228a4bf..41bc7e960 100644 --- a/linux/include/linux/videodev.h +++ b/linux/include/linux/videodev.h @@ -12,20 +12,6 @@ #ifndef __LINUX_VIDEODEV_H #define __LINUX_VIDEODEV_H -#include -#include -#include -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69) -#include -#endif -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) -#include -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) -#include -#endif -#endif -#include /* need __user */ - #define HAVE_V4L1 1 #include @@ -350,10 +336,6 @@ struct video_code #define VID_HARDWARE_SN9C102 38 #define VID_HARDWARE_ARV 39 -#ifdef __KERNEL__ -#include -#endif /* __KERNEL__ */ - #endif /* __LINUX_VIDEODEV_H */ /* diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h index 98ca1d1c8..8ed112a10 100644 --- a/linux/include/linux/videodev2.h +++ b/linux/include/linux/videodev2.h @@ -24,7 +24,6 @@ * Common stuff for both V4L1 and V4L2 * Moved from videodev.h */ - #define VIDEO_MAX_FRAME 32 #define VID_TYPE_CAPTURE 1 /* Can capture */ @@ -200,7 +199,6 @@ struct v4l2_capability /* * V I D E O I M A G E F O R M A T */ - struct v4l2_pix_format { __u32 width; @@ -213,7 +211,7 @@ struct v4l2_pix_format __u32 priv; /* private data, depends on pixelformat */ }; -/* Pixel format FOURCC depth Description */ +/* Pixel format FOURCC depth Description */ #define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R','G','B','1') /* 8 RGB-3-3-2 */ #define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R','G','B','O') /* 16 RGB-5-5-5 */ #define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R','G','B','P') /* 16 RGB-5-6-5 */ @@ -273,7 +271,6 @@ struct v4l2_fmtdesc #define V4L2_FMT_FLAG_COMPRESSED 0x0001 - /* * T I M E C O D E */ @@ -303,7 +300,6 @@ struct v4l2_timecode #define V4L2_TC_USERBITS_8BITCHARS 0x0008 /* The above is based on SMPTE timecodes */ - #if 1 /* * M P E G C O M P R E S S I O N P A R A M E T E R S @@ -312,8 +308,6 @@ struct v4l2_timecode * ### there will be some incompatible changes. * */ - - enum v4l2_bitrate_mode { V4L2_BITRATE_NONE = 0, /* not specified */ V4L2_BITRATE_CBR, /* constant bitrate */ @@ -423,7 +417,6 @@ struct v4l2_jpegcompression * allways use APP0 */ }; - /* * M E M O R Y - M A P P I N G B U F F E R S */ @@ -505,7 +498,6 @@ struct v4l2_window void __user *bitmap; }; - /* * C A P T U R E P A R A M E T E R S */ @@ -518,6 +510,7 @@ struct v4l2_captureparm __u32 readbuffers; /* # of buffers for read */ __u32 reserved[4]; }; + /* Flags for 'capability' and 'capturemode' fields */ #define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */ #define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */ @@ -535,7 +528,6 @@ struct v4l2_outputparm /* * I N P U T I M A G E C R O P P I N G */ - struct v4l2_cropcap { enum v4l2_buf_type type; struct v4l2_rect bounds; @@ -642,7 +634,6 @@ struct v4l2_standard __u32 reserved[4]; }; - /* * V I D E O I N P U T S */ @@ -657,6 +648,7 @@ struct v4l2_input __u32 status; __u32 reserved[4]; }; + /* Values for the 'type' field */ #define V4L2_INPUT_TYPE_TUNER 1 #define V4L2_INPUT_TYPE_CAMERA 2 @@ -836,6 +828,7 @@ struct v4l2_audio __u32 mode; __u32 reserved[2]; }; + /* Flags for the 'capability' field */ #define V4L2_AUDCAP_STEREO 0x00001 #define V4L2_AUDCAP_AVL 0x00002 @@ -859,7 +852,6 @@ struct v4l2_audioout */ /* Raw VBI */ - struct v4l2_vbi_format { __u32 sampling_rate; /* in 1 Hz */ @@ -1032,8 +1024,6 @@ struct v4l2_streamparm } parm; }; - - /* * I O C T L C O D E S F O R V I D E O D E V I C E S * diff --git a/linux/include/media/ovcamchip.h b/linux/include/media/ovcamchip.h index 773fb09c6..9813334d6 100644 --- a/linux/include/media/ovcamchip.h +++ b/linux/include/media/ovcamchip.h @@ -16,6 +16,7 @@ #include "compat.h" #include +#include #include /* --------------------------------- */ diff --git a/linux/include/media/saa7146_vv.h b/linux/include/media/saa7146_vv.h index 4507cb61a..83fe2e3d1 100644 --- a/linux/include/media/saa7146_vv.h +++ b/linux/include/media/saa7146_vv.h @@ -2,7 +2,7 @@ #define __SAA7146_VV__ #include - +#include #include #include diff --git a/linux/include/media/v4l2-dev.h b/linux/include/media/v4l2-dev.h index f1822e460..d3181cf0e 100644 --- a/linux/include/media/v4l2-dev.h +++ b/linux/include/media/v4l2-dev.h @@ -322,7 +322,7 @@ struct video_device int (*initialize)(struct video_device *); #endif -#if OBSOLETE_OWNER /* to be removed soon */ +#ifdef OBSOLETE_OWNER /* to be removed soon */ /* obsolete -- fops->owner is used instead */ struct module *owner; /* dev->driver_data will be used instead some day. @@ -388,7 +388,7 @@ video_device_remove_file(struct video_device *vfd, } #endif -#if OBSOLETE_OWNER /* to be removed soon */ +#ifdef OBSOLETE_OWNER /* to be removed soon */ /* helper functions to access driver private data. */ static inline void *video_get_drvdata(struct video_device *dev) { -- cgit v1.2.3 From 70924af414b258c769a2ece2c64b7c9b14c18fc8 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 5 Jun 2006 11:46:46 -0300 Subject: Userspace compilation were broken by the changes at videodev. From: Mauro Carvalho Chehab Userspace have its own headers for timeval, so, include linux/time.h shouldn't be done at userspace. Signed-off-by: Mauro Carvalho Chehab --- linux/include/linux/videodev2.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'linux/include') diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h index 8ed112a10..630ebfaca 100644 --- a/linux/include/linux/videodev2.h +++ b/linux/include/linux/videodev2.h @@ -14,7 +14,9 @@ */ #ifndef __LINUX_VIDEODEV2_H #define __LINUX_VIDEODEV2_H +#ifdef __KERNEL__ #include /* need struct timeval */ +#endif #include #include /* need __user */ -- cgit v1.2.3 From cf2dd5ced9bcd10541403a7fb3e3c6ab7084e038 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 6 Jun 2006 21:18:44 -0300 Subject: Fixes lots of small errors at videodev. From: Mauro Carvalho Chehab Fixes several small errors at debug; Fixes max line size to 80 columns; Fixes parameter passage to callback functions; Removed unused fh pointer at video_device struct. Signed-off-by: Mauro Carvalho Chehab --- linux/include/media/v4l2-dev.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'linux/include') diff --git a/linux/include/media/v4l2-dev.h b/linux/include/media/v4l2-dev.h index d3181cf0e..f43216d68 100644 --- a/linux/include/media/v4l2-dev.h +++ b/linux/include/media/v4l2-dev.h @@ -113,10 +113,6 @@ struct video_device int hardware; int minor; - /* This pointer is passed by parameter to each ioctl handler - and should contain file handler for the device */ - void *fh; - int debug; /* Activates debug level*/ /* Video standard vars */ -- cgit v1.2.3 From cc64aacbe823925c5cd8593e2f0e0fe7ba896053 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 8 Jun 2006 11:52:11 -0300 Subject: Fix compilation with kernel 2.6.17 From: Andrew Ruder This bug were introduced by the changes at videodev2.h Signed-off-by: Mauro Carvalho Chehab --- linux/include/media/v4l2-dev.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'linux/include') diff --git a/linux/include/media/v4l2-dev.h b/linux/include/media/v4l2-dev.h index f43216d68..18f1bd706 100644 --- a/linux/include/media/v4l2-dev.h +++ b/linux/include/media/v4l2-dev.h @@ -47,10 +47,6 @@ #define VFL_TYPE_RADIO 2 #define VFL_TYPE_VTX 3 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) - const struct file_operations *fops; -#endif - /* Video standard functions */ extern unsigned int v4l2_video_std_fps(struct v4l2_standard *vs); extern int v4l2_video_std_construct(struct v4l2_standard *vs, @@ -101,7 +97,11 @@ struct v4l2_tvnorm { struct video_device { /* device ops */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) + const struct file_operations *fops; +#else struct file_operations *fops; +#endif /* device info */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) -- cgit v1.2.3 From 01e2ad77614e339b1152ee338061c9330d2e5243 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 17 Jun 2006 07:57:03 -0300 Subject: Fixes some userspace dependencies at V4L2 public api header From: Mauro Carvalho Chehab Make life easier for distro guys, by removing the need of including #define __user at the userspace header. Also, linux/compiler.h is not needed at userspace. Signed-off-by: Mauro Carvalho Chehab --- linux/include/linux/videodev2.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'linux/include') diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h index 630ebfaca..26dc9c62d 100644 --- a/linux/include/linux/videodev2.h +++ b/linux/include/linux/videodev2.h @@ -15,10 +15,12 @@ #ifndef __LINUX_VIDEODEV2_H #define __LINUX_VIDEODEV2_H #ifdef __KERNEL__ -#include /* need struct timeval */ +#include /* need struct timeval */ +#include /* need __user */ +#else +#define __user #endif #include -#include /* need __user */ #define HAVE_V4L2 1 -- cgit v1.2.3 From 6a8bf297dd5c299754ce555c1d786c666619d5fc Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 18 Jun 2006 18:27:19 +0200 Subject: Add the new MPEG control/ioctl definitions to the public videodev2.h header. From: Hans Verkuil The old, experimental, VIDIOC_S/G_CODEC API to pass MPEG parameters is now obsolete and is replaced by 'extended controls' which offer more flexibility and are hopefully more future proof. Signed-off-by: Hans Verkuil --- linux/include/linux/videodev2.h | 225 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 222 insertions(+), 3 deletions(-) (limited to 'linux/include') diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h index 26dc9c62d..d095481c0 100644 --- a/linux/include/linux/videodev2.h +++ b/linux/include/linux/videodev2.h @@ -105,6 +105,8 @@ enum v4l2_ctrl_type { V4L2_CTRL_TYPE_BOOLEAN = 2, V4L2_CTRL_TYPE_MENU = 3, V4L2_CTRL_TYPE_BUTTON = 4, + V4L2_CTRL_TYPE_INTEGER64 = 5, + V4L2_CTRL_TYPE_CTRL_CLASS = 6, }; enum v4l2_tuner_type { @@ -251,7 +253,7 @@ struct v4l2_pix_format #define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M','J','P','G') /* Motion-JPEG */ #define V4L2_PIX_FMT_JPEG v4l2_fourcc('J','P','E','G') /* JFIF JPEG */ #define V4L2_PIX_FMT_DV v4l2_fourcc('d','v','s','d') /* 1394 */ -#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M','P','E','G') /* MPEG */ +#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M','P','E','G') /* MPEG-1/2/4 */ /* Vendor-specific formats */ #define V4L2_PIX_FMT_WNVA v4l2_fourcc('W','N','V','A') /* Winnov hw compress */ @@ -703,6 +705,34 @@ struct v4l2_control __s32 value; }; +struct v4l2_ext_control +{ + __u32 id; + __u32 reserved2[2]; + union { + __s32 value; + __s64 value64; + void *reserved; + }; +}; + +struct v4l2_ext_controls +{ + __u32 ctrl_class; + __u32 count; + __u32 error_idx; + __u32 reserved[2]; + struct v4l2_ext_control *controls; +}; + +/* Values for ctrl_class field */ +#define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */ +#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */ + +#define V4L2_CTRL_ID_MASK (0x0fffffff) +#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) +#define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000) + /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ struct v4l2_queryctrl { @@ -729,12 +759,21 @@ struct v4l2_querymenu /* Control flags */ #define V4L2_CTRL_FLAG_DISABLED 0x0001 #define V4L2_CTRL_FLAG_GRABBED 0x0002 +#define V4L2_CTRL_FLAG_READ_ONLY 0x0004 +#define V4L2_CTRL_FLAG_UPDATE 0x0008 +#define V4L2_CTRL_FLAG_INACTIVE 0x0010 +#define V4L2_CTRL_FLAG_SLIDER 0x0020 + +/* Query flag, to be ORed with the control ID */ +#define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000 -/* Control IDs defined by V4L2 */ -#define V4L2_CID_BASE 0x00980900 +/* User-class control IDs defined by V4L2 */ +#define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900) +#define V4L2_CID_USER_BASE V4L2_CID_BASE /* IDs reserved for driver specific controls */ #define V4L2_CID_PRIVATE_BASE 0x08000000 +#define V4L2_CID_USER_CLASS (V4L2_CTRL_CLASS_USER | 1) #define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0) #define V4L2_CID_CONTRAST (V4L2_CID_BASE+1) #define V4L2_CID_SATURATION (V4L2_CID_BASE+2) @@ -761,6 +800,183 @@ struct v4l2_querymenu #define V4L2_CID_VCENTER (V4L2_CID_BASE+23) #define V4L2_CID_LASTP1 (V4L2_CID_BASE+24) /* last CID + 1 */ +/* MPEG-class control IDs defined by V4L2 */ +#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) +#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1) + +/* MPEG streams */ +#define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0) +enum v4l2_mpeg_stream_type { + V4L2_MPEG_STREAM_TYPE_MPEG2_PS, /* MPEG-2 program stream */ + V4L2_MPEG_STREAM_TYPE_MPEG2_TS, /* MPEG-2 transport stream */ + V4L2_MPEG_STREAM_TYPE_MPEG1_SS, /* MPEG-1 system stream */ + V4L2_MPEG_STREAM_TYPE_MPEG2_DVD, /* MPEG-2 DVD-compatible stream */ + V4L2_MPEG_STREAM_TYPE_MPEG1_VCD, /* MPEG-1 VCD-compatible stream */ + V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD, /* MPEG-2 SVCD-compatible stream */ +}; +#define V4L2_CID_MPEG_STREAM_PID_PMT (V4L2_CID_MPEG_BASE+1) +#define V4L2_CID_MPEG_STREAM_PID_AUDIO (V4L2_CID_MPEG_BASE+2) +#define V4L2_CID_MPEG_STREAM_PID_VIDEO (V4L2_CID_MPEG_BASE+3) +#define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4) +#define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5) +#define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6) + +/* MPEG audio */ +#define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100) +enum v4l2_mpeg_audio_sampling_freq { + V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100, + V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000, + V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000, +}; +#define V4L2_CID_MPEG_AUDIO_ENCODING (V4L2_CID_MPEG_BASE+101) +enum v4l2_mpeg_audio_encoding { + V4L2_MPEG_AUDIO_ENCODING_LAYER_1, + V4L2_MPEG_AUDIO_ENCODING_LAYER_2, + V4L2_MPEG_AUDIO_ENCODING_LAYER_3, +}; +#define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102) +enum v4l2_mpeg_audio_l1_bitrate { + V4L2_MPEG_AUDIO_L1_BITRATE_32K, + V4L2_MPEG_AUDIO_L1_BITRATE_64K, + V4L2_MPEG_AUDIO_L1_BITRATE_96K, + V4L2_MPEG_AUDIO_L1_BITRATE_128K, + V4L2_MPEG_AUDIO_L1_BITRATE_160K, + V4L2_MPEG_AUDIO_L1_BITRATE_192K, + V4L2_MPEG_AUDIO_L1_BITRATE_224K, + V4L2_MPEG_AUDIO_L1_BITRATE_256K, + V4L2_MPEG_AUDIO_L1_BITRATE_288K, + V4L2_MPEG_AUDIO_L1_BITRATE_320K, + V4L2_MPEG_AUDIO_L1_BITRATE_352K, + V4L2_MPEG_AUDIO_L1_BITRATE_384K, + V4L2_MPEG_AUDIO_L1_BITRATE_416K, + V4L2_MPEG_AUDIO_L1_BITRATE_448K, +}; +#define V4L2_CID_MPEG_AUDIO_L2_BITRATE (V4L2_CID_MPEG_BASE+103) +enum v4l2_mpeg_audio_l2_bitrate { + V4L2_MPEG_AUDIO_L2_BITRATE_32K, + V4L2_MPEG_AUDIO_L2_BITRATE_48K, + V4L2_MPEG_AUDIO_L2_BITRATE_56K, + V4L2_MPEG_AUDIO_L2_BITRATE_64K, + V4L2_MPEG_AUDIO_L2_BITRATE_80K, + V4L2_MPEG_AUDIO_L2_BITRATE_96K, + V4L2_MPEG_AUDIO_L2_BITRATE_112K, + V4L2_MPEG_AUDIO_L2_BITRATE_128K, + V4L2_MPEG_AUDIO_L2_BITRATE_160K, + V4L2_MPEG_AUDIO_L2_BITRATE_192K, + V4L2_MPEG_AUDIO_L2_BITRATE_224K, + V4L2_MPEG_AUDIO_L2_BITRATE_256K, + V4L2_MPEG_AUDIO_L2_BITRATE_320K, + V4L2_MPEG_AUDIO_L2_BITRATE_384K, +}; +#define V4L2_CID_MPEG_AUDIO_L3_BITRATE (V4L2_CID_MPEG_BASE+104) +enum v4l2_mpeg_audio_l3_bitrate { + V4L2_MPEG_AUDIO_L3_BITRATE_32K, + V4L2_MPEG_AUDIO_L3_BITRATE_40K, + V4L2_MPEG_AUDIO_L3_BITRATE_48K, + V4L2_MPEG_AUDIO_L3_BITRATE_56K, + V4L2_MPEG_AUDIO_L3_BITRATE_64K, + V4L2_MPEG_AUDIO_L3_BITRATE_80K, + V4L2_MPEG_AUDIO_L3_BITRATE_96K, + V4L2_MPEG_AUDIO_L3_BITRATE_112K, + V4L2_MPEG_AUDIO_L3_BITRATE_128K, + V4L2_MPEG_AUDIO_L3_BITRATE_160K, + V4L2_MPEG_AUDIO_L3_BITRATE_192K, + V4L2_MPEG_AUDIO_L3_BITRATE_224K, + V4L2_MPEG_AUDIO_L3_BITRATE_256K, + V4L2_MPEG_AUDIO_L3_BITRATE_320K, +}; +#define V4L2_CID_MPEG_AUDIO_MODE (V4L2_CID_MPEG_BASE+105) +enum v4l2_mpeg_audio_mode { + V4L2_MPEG_AUDIO_MODE_STEREO, + V4L2_MPEG_AUDIO_MODE_JOINT_STEREO, + V4L2_MPEG_AUDIO_MODE_DUAL, + V4L2_MPEG_AUDIO_MODE_MONO, +}; +#define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (V4L2_CID_MPEG_BASE+106) +enum v4l2_mpeg_audio_mode_extension { + V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4, + V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8, + V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12, + V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16, +}; +#define V4L2_CID_MPEG_AUDIO_EMPHASIS (V4L2_CID_MPEG_BASE+107) +enum v4l2_mpeg_audio_emphasis { + V4L2_MPEG_AUDIO_EMPHASIS_NONE, + V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS, + V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17, +}; +#define V4L2_CID_MPEG_AUDIO_CRC (V4L2_CID_MPEG_BASE+108) +enum v4l2_mpeg_audio_crc { + V4L2_MPEG_AUDIO_CRC_NONE, + V4L2_MPEG_AUDIO_CRC_CRC16, +}; + +/* MPEG video */ +#define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200) +enum v4l2_mpeg_video_encoding { + V4L2_MPEG_VIDEO_ENCODING_MPEG_1, + V4L2_MPEG_VIDEO_ENCODING_MPEG_2, +}; +#define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201) +enum v4l2_mpeg_video_aspect { + V4L2_MPEG_VIDEO_ASPECT_1x1, + V4L2_MPEG_VIDEO_ASPECT_4x3, + V4L2_MPEG_VIDEO_ASPECT_16x9, + V4L2_MPEG_VIDEO_ASPECT_221x100, +}; +#define V4L2_CID_MPEG_VIDEO_B_FRAMES (V4L2_CID_MPEG_BASE+202) +#define V4L2_CID_MPEG_VIDEO_GOP_SIZE (V4L2_CID_MPEG_BASE+203) +#define V4L2_CID_MPEG_VIDEO_GOP_CLOSURE (V4L2_CID_MPEG_BASE+204) +#define V4L2_CID_MPEG_VIDEO_PULLDOWN (V4L2_CID_MPEG_BASE+205) +#define V4L2_CID_MPEG_VIDEO_BITRATE_MODE (V4L2_CID_MPEG_BASE+206) +enum v4l2_mpeg_video_bitrate_mode { + V4L2_MPEG_VIDEO_BITRATE_MODE_VBR, + V4L2_MPEG_VIDEO_BITRATE_MODE_CBR, +}; +#define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_MPEG_BASE+207) +#define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_MPEG_BASE+208) +#define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209) + +/* MPEG-class control IDs specific to the CX2584x driver as defined by V4L2 */ +#define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000) +#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0) +enum v4l2_mpeg_cx2341x_video_spatial_filter_mode { + V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL, + V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO, +}; +#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+1) +#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+2) +enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type { + V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF, + V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR, + V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT, + V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE, + V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE, +}; +#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+3) +enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type { + V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF, + V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR, +}; +#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+4) +enum v4l2_mpeg_cx2341x_video_temporal_filter_mode { + V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL, + V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO, +}; +#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+5) +#define V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+6) +enum v4l2_mpeg_cx2341x_video_median_filter_type { + V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF, + V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR, + V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT, + V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT, + V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG, +}; +#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+7) +#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+8) +#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+9) +#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10) + /* * T U N I N G */ @@ -1090,6 +1306,9 @@ struct v4l2_streamparm #define VIDIOC_G_SLICED_VBI_CAP _IOR ('V', 69, struct v4l2_sliced_vbi_cap) #endif #define VIDIOC_LOG_STATUS _IO ('V', 70) +#define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls) +#define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls) +#define VIDIOC_TRY_EXT_CTRLS _IOWR ('V', 73, struct v4l2_ext_controls) #ifdef __OLD_VIDIOC_ /* for compatibility, will go away some day */ -- cgit v1.2.3 From 13df997912f6bd6191afa971517b5dd138c2a013 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 18 Jun 2006 18:43:28 +0200 Subject: Add videodev support for VIDIOC_S/G/TRY_EXT_CTRLS. From: Hans Verkuil videodev.c copies the control list specified in struct v4l2_ext_controls to kernel space. Signed-off-by: Hans Verkuil --- linux/include/media/v4l2-dev.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'linux/include') diff --git a/linux/include/media/v4l2-dev.h b/linux/include/media/v4l2-dev.h index 18f1bd706..39f4b7c69 100644 --- a/linux/include/media/v4l2-dev.h +++ b/linux/include/media/v4l2-dev.h @@ -245,6 +245,12 @@ struct video_device struct v4l2_control *a); int (*vidioc_s_ctrl) (struct file *file, void *fh, struct v4l2_control *a); + int (*vidioc_g_ext_ctrls) (struct file *file, void *fh, + struct v4l2_ext_controls *a); + int (*vidioc_s_ext_ctrls) (struct file *file, void *fh, + struct v4l2_ext_controls *a); + int (*vidioc_try_ext_ctrls) (struct file *file, void *fh, + struct v4l2_ext_controls *a); int (*vidioc_querymenu) (struct file *file, void *fh, struct v4l2_querymenu *a); -- cgit v1.2.3 From 1a96c8458e3bc1a8fd44dd305323a254e7776443 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 18 Jun 2006 19:11:08 +0200 Subject: Add helper functions for control processing to v4l2-common. From: Hans Verkuil Control processing is often duplicated in the various drivers. Unfortunately, simple things like the names of controls are often different between drivers, even though it is the same controls. Adding in the new extended controls and the need for having control helper functions became apparent. Several functions have now been added to v4l2-common to do things like filling the v4l2_queryctrl and v4l2_querymenu structs, to check for valid control input and to move to the next control when enumerating over all controls. Signed-off-by: Hans Verkuil --- linux/include/media/v4l2-common.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'linux/include') diff --git a/linux/include/media/v4l2-common.h b/linux/include/media/v4l2-common.h index f1d7a063a..98976fd3b 100644 --- a/linux/include/media/v4l2-common.h +++ b/linux/include/media/v4l2-common.h @@ -90,6 +90,19 @@ extern void v4l_printk_ioctl_arg(char *s,unsigned int cmd, void *arg); /* ------------------------------------------------------------------------- */ +/* Control helper functions */ + +int v4l2_ctrl_check(struct v4l2_ext_control *ctrl, struct v4l2_queryctrl *qctrl, + const char **menu_items); +const char **v4l2_ctrl_get_menu(u32 id); +int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 step, s32 def); +int v4l2_ctrl_query_fill_std(struct v4l2_queryctrl *qctrl); +int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu, + struct v4l2_queryctrl *qctrl, const char **menu_items); +u32 v4l2_ctrl_next(const u32 * const *ctrl_classes, u32 id); + +/* ------------------------------------------------------------------------- */ + /* Internal ioctls */ /* VIDIOC_INT_G_REGISTER and VIDIOC_INT_S_REGISTER */ -- cgit v1.2.3 From 22ca6fbfdb83215e3e763226f6f15c2e7aec7a16 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 18 Jun 2006 19:40:30 +0200 Subject: Add CX2341X MPEG encoder module. From: Hans Verkuil Adds the cx2341x.c module that handles the programming of the Conexant cx23415/6 MPEG encoder chip used by cx88-blackbird, pvrusb2 and ivtv. Signed-off-by: Hans Verkuil --- linux/include/media/cx2341x.h | 60 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) (limited to 'linux/include') diff --git a/linux/include/media/cx2341x.h b/linux/include/media/cx2341x.h index 7e7dcc072..81ebead2d 100644 --- a/linux/include/media/cx2341x.h +++ b/linux/include/media/cx2341x.h @@ -19,6 +19,66 @@ #ifndef CX2341X_H #define CX2341X_H +struct cx2341x_mpeg_params { + /* misc */ + u16 width; + u16 height; + u16 is_50hz; + + /* stream */ + enum v4l2_mpeg_stream_type stream_type; + + /* audio */ + enum v4l2_mpeg_audio_sampling_freq audio_sampling_freq; + enum v4l2_mpeg_audio_encoding audio_encoding; + enum v4l2_mpeg_audio_l2_bitrate audio_l2_bitrate; + enum v4l2_mpeg_audio_mode audio_mode; + enum v4l2_mpeg_audio_mode_extension audio_mode_extension; + enum v4l2_mpeg_audio_emphasis audio_emphasis; + enum v4l2_mpeg_audio_crc audio_crc; + u8 audio_properties; + + /* video */ + enum v4l2_mpeg_video_encoding video_encoding; + enum v4l2_mpeg_video_aspect video_aspect; + u16 video_b_frames; + u16 video_gop_size; + u16 video_gop_closure; + u16 video_pulldown; + enum v4l2_mpeg_video_bitrate_mode video_bitrate_mode; + u32 video_bitrate; + u32 video_bitrate_peak; + u16 video_temporal_decimation; + + /* encoding filters */ + enum v4l2_mpeg_cx2341x_video_spatial_filter_mode video_spatial_filter_mode; + u16 video_spatial_filter; + enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type video_luma_spatial_filter_type; + enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type video_chroma_spatial_filter_type; + enum v4l2_mpeg_cx2341x_video_temporal_filter_mode video_temporal_filter_mode; + u16 video_temporal_filter; + enum v4l2_mpeg_cx2341x_video_median_filter_type video_median_filter_type; + u16 video_luma_median_filter_top; + u16 video_luma_median_filter_bottom; + u16 video_chroma_median_filter_top; + u16 video_chroma_median_filter_bottom; +}; + +#define CX2341X_MBOX_MAX_DATA 16 + +typedef int (*cx2341x_mbox_func)(void *priv, int cmd, int in, int out, + u32 data[CX2341X_MBOX_MAX_DATA]); +int cx2341x_update(void *priv, cx2341x_mbox_func func, + const struct cx2341x_mpeg_params *old, + const struct cx2341x_mpeg_params *new); +int cx2341x_ctrl_query(struct cx2341x_mpeg_params *params, + struct v4l2_queryctrl *qctrl); +const char **cx2341x_ctrl_get_menu(u32 id); +int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params, + struct v4l2_ext_controls *ctrls, int cmd); +void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p); +void cx2341x_log_status(struct cx2341x_mpeg_params *p, int cardid); + /* Firmware names */ #define CX2341X_FIRM_ENC_FILENAME "v4l-cx2341x-enc.fw" /* Decoder firmware for the cx23415 only */ -- cgit v1.2.3 From 6cdc5db5eecbf7385e190aab3718ccfbdc981077 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 18 Jun 2006 21:54:20 +0200 Subject: Put old MPEGCOMP API under #if __KERNEL__ and issue warnings when used. From: Hans Verkuil Signed-off-by: Hans Verkuil --- linux/include/linux/videodev2.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'linux/include') diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h index d095481c0..3512e05f7 100644 --- a/linux/include/linux/videodev2.h +++ b/linux/include/linux/videodev2.h @@ -306,12 +306,13 @@ struct v4l2_timecode #define V4L2_TC_USERBITS_8BITCHARS 0x0008 /* The above is based on SMPTE timecodes */ -#if 1 +#ifdef __KERNEL__ /* * M P E G C O M P R E S S I O N P A R A M E T E R S * - * ### WARNING: this is still work-in-progress right now, most likely - * ### there will be some incompatible changes. + * ### WARNING: This experimental MPEG compression API is obsolete. + * ### It is replaced by the MPEG controls API. + * ### This old API will disappear in the near future! * */ enum v4l2_bitrate_mode { @@ -1253,7 +1254,7 @@ struct v4l2_streamparm #define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc) #define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format) #define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format) -#if 1 /* experimental */ +#ifdef __KERNEL__ #define VIDIOC_G_MPEGCOMP _IOR ('V', 6, struct v4l2_mpeg_compression) #define VIDIOC_S_MPEGCOMP _IOW ('V', 7, struct v4l2_mpeg_compression) #endif -- cgit v1.2.3 From af650bccdb8afcbd266fd7521df4b15bab26124e Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 19 Jun 2006 22:53:08 +0200 Subject: Add cx2341x-specific control array to cx2341x.c From: Hans Verkuil Signed-off-by: Hans Verkuil --- linux/include/media/cx2341x.h | 1 + 1 file changed, 1 insertion(+) (limited to 'linux/include') diff --git a/linux/include/media/cx2341x.h b/linux/include/media/cx2341x.h index 81ebead2d..0c9292fa5 100644 --- a/linux/include/media/cx2341x.h +++ b/linux/include/media/cx2341x.h @@ -66,6 +66,7 @@ struct cx2341x_mpeg_params { #define CX2341X_MBOX_MAX_DATA 16 +extern const u32 cx2341x_mpeg_ctrls[]; typedef int (*cx2341x_mbox_func)(void *priv, int cmd, int in, int out, u32 data[CX2341X_MBOX_MAX_DATA]); int cx2341x_update(void *priv, cx2341x_mbox_func func, -- cgit v1.2.3 From c3c161df40114ed8f7c0a3bebd385c173919de18 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Wed, 21 Jun 2006 22:04:13 +0200 Subject: CX2341X port was always set to 'memory', but 'streaming' is also possible From: Hans Verkuil ivtv uses the memory (DMA) interface with the CX2341X, while pvrusb2 and cx88-blackbird use the streaming interface. This setting is now selectable by the driver. Signed-off-by: Hans Verkuil --- linux/include/media/cx2341x.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'linux/include') diff --git a/linux/include/media/cx2341x.h b/linux/include/media/cx2341x.h index 0c9292fa5..fb170d4b5 100644 --- a/linux/include/media/cx2341x.h +++ b/linux/include/media/cx2341x.h @@ -19,8 +19,15 @@ #ifndef CX2341X_H #define CX2341X_H +enum cx2341x_port { + CX2341X_PORT_MEMORY, + CX2341X_PORT_STREAMING, + CX2341X_PORT_SERIAL +}; + struct cx2341x_mpeg_params { /* misc */ + enum cx2341x_port port; u16 width; u16 height; u16 is_50hz; -- cgit v1.2.3 From 47e7619ed0e11061799a387d580aa2aa90561ead Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Fri, 23 Jun 2006 20:52:50 +0200 Subject: Explicitly set the enum values. From: Hans Verkuil It's better to use explicit enums. It reduces the chance of someone inserting new enums in the middle which would break things. Signed-off-by: Hans Verkuil --- linux/include/linux/videodev2.h | 182 ++++++++++++++++++++-------------------- linux/include/media/cx2341x.h | 6 +- 2 files changed, 94 insertions(+), 94 deletions(-) (limited to 'linux/include') diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h index 3512e05f7..952fcd831 100644 --- a/linux/include/linux/videodev2.h +++ b/linux/include/linux/videodev2.h @@ -808,12 +808,12 @@ struct v4l2_querymenu /* MPEG streams */ #define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0) enum v4l2_mpeg_stream_type { - V4L2_MPEG_STREAM_TYPE_MPEG2_PS, /* MPEG-2 program stream */ - V4L2_MPEG_STREAM_TYPE_MPEG2_TS, /* MPEG-2 transport stream */ - V4L2_MPEG_STREAM_TYPE_MPEG1_SS, /* MPEG-1 system stream */ - V4L2_MPEG_STREAM_TYPE_MPEG2_DVD, /* MPEG-2 DVD-compatible stream */ - V4L2_MPEG_STREAM_TYPE_MPEG1_VCD, /* MPEG-1 VCD-compatible stream */ - V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD, /* MPEG-2 SVCD-compatible stream */ + V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0, /* MPEG-2 program stream */ + V4L2_MPEG_STREAM_TYPE_MPEG2_TS = 1, /* MPEG-2 transport stream */ + V4L2_MPEG_STREAM_TYPE_MPEG1_SS = 2, /* MPEG-1 system stream */ + V4L2_MPEG_STREAM_TYPE_MPEG2_DVD = 3, /* MPEG-2 DVD-compatible stream */ + V4L2_MPEG_STREAM_TYPE_MPEG1_VCD = 4, /* MPEG-1 VCD-compatible stream */ + V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD = 5, /* MPEG-2 SVCD-compatible stream */ }; #define V4L2_CID_MPEG_STREAM_PID_PMT (V4L2_CID_MPEG_BASE+1) #define V4L2_CID_MPEG_STREAM_PID_AUDIO (V4L2_CID_MPEG_BASE+2) @@ -825,105 +825,105 @@ enum v4l2_mpeg_stream_type { /* MPEG audio */ #define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100) enum v4l2_mpeg_audio_sampling_freq { - V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100, - V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000, - V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000, + V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0, + V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000 = 1, + V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000 = 2, }; #define V4L2_CID_MPEG_AUDIO_ENCODING (V4L2_CID_MPEG_BASE+101) enum v4l2_mpeg_audio_encoding { - V4L2_MPEG_AUDIO_ENCODING_LAYER_1, - V4L2_MPEG_AUDIO_ENCODING_LAYER_2, - V4L2_MPEG_AUDIO_ENCODING_LAYER_3, + V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0, + V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1, + V4L2_MPEG_AUDIO_ENCODING_LAYER_3 = 2, }; #define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102) enum v4l2_mpeg_audio_l1_bitrate { - V4L2_MPEG_AUDIO_L1_BITRATE_32K, - V4L2_MPEG_AUDIO_L1_BITRATE_64K, - V4L2_MPEG_AUDIO_L1_BITRATE_96K, - V4L2_MPEG_AUDIO_L1_BITRATE_128K, - V4L2_MPEG_AUDIO_L1_BITRATE_160K, - V4L2_MPEG_AUDIO_L1_BITRATE_192K, - V4L2_MPEG_AUDIO_L1_BITRATE_224K, - V4L2_MPEG_AUDIO_L1_BITRATE_256K, - V4L2_MPEG_AUDIO_L1_BITRATE_288K, - V4L2_MPEG_AUDIO_L1_BITRATE_320K, - V4L2_MPEG_AUDIO_L1_BITRATE_352K, - V4L2_MPEG_AUDIO_L1_BITRATE_384K, - V4L2_MPEG_AUDIO_L1_BITRATE_416K, - V4L2_MPEG_AUDIO_L1_BITRATE_448K, + V4L2_MPEG_AUDIO_L1_BITRATE_32K = 0, + V4L2_MPEG_AUDIO_L1_BITRATE_64K = 1, + V4L2_MPEG_AUDIO_L1_BITRATE_96K = 2, + V4L2_MPEG_AUDIO_L1_BITRATE_128K = 3, + V4L2_MPEG_AUDIO_L1_BITRATE_160K = 4, + V4L2_MPEG_AUDIO_L1_BITRATE_192K = 5, + V4L2_MPEG_AUDIO_L1_BITRATE_224K = 6, + V4L2_MPEG_AUDIO_L1_BITRATE_256K = 7, + V4L2_MPEG_AUDIO_L1_BITRATE_288K = 8, + V4L2_MPEG_AUDIO_L1_BITRATE_320K = 9, + V4L2_MPEG_AUDIO_L1_BITRATE_352K = 10, + V4L2_MPEG_AUDIO_L1_BITRATE_384K = 11, + V4L2_MPEG_AUDIO_L1_BITRATE_416K = 12, + V4L2_MPEG_AUDIO_L1_BITRATE_448K = 13, }; #define V4L2_CID_MPEG_AUDIO_L2_BITRATE (V4L2_CID_MPEG_BASE+103) enum v4l2_mpeg_audio_l2_bitrate { - V4L2_MPEG_AUDIO_L2_BITRATE_32K, - V4L2_MPEG_AUDIO_L2_BITRATE_48K, - V4L2_MPEG_AUDIO_L2_BITRATE_56K, - V4L2_MPEG_AUDIO_L2_BITRATE_64K, - V4L2_MPEG_AUDIO_L2_BITRATE_80K, - V4L2_MPEG_AUDIO_L2_BITRATE_96K, - V4L2_MPEG_AUDIO_L2_BITRATE_112K, - V4L2_MPEG_AUDIO_L2_BITRATE_128K, - V4L2_MPEG_AUDIO_L2_BITRATE_160K, - V4L2_MPEG_AUDIO_L2_BITRATE_192K, - V4L2_MPEG_AUDIO_L2_BITRATE_224K, - V4L2_MPEG_AUDIO_L2_BITRATE_256K, - V4L2_MPEG_AUDIO_L2_BITRATE_320K, - V4L2_MPEG_AUDIO_L2_BITRATE_384K, + V4L2_MPEG_AUDIO_L2_BITRATE_32K = 0, + V4L2_MPEG_AUDIO_L2_BITRATE_48K = 1, + V4L2_MPEG_AUDIO_L2_BITRATE_56K = 2, + V4L2_MPEG_AUDIO_L2_BITRATE_64K = 3, + V4L2_MPEG_AUDIO_L2_BITRATE_80K = 4, + V4L2_MPEG_AUDIO_L2_BITRATE_96K = 5, + V4L2_MPEG_AUDIO_L2_BITRATE_112K = 6, + V4L2_MPEG_AUDIO_L2_BITRATE_128K = 7, + V4L2_MPEG_AUDIO_L2_BITRATE_160K = 8, + V4L2_MPEG_AUDIO_L2_BITRATE_192K = 9, + V4L2_MPEG_AUDIO_L2_BITRATE_224K = 10, + V4L2_MPEG_AUDIO_L2_BITRATE_256K = 11, + V4L2_MPEG_AUDIO_L2_BITRATE_320K = 12, + V4L2_MPEG_AUDIO_L2_BITRATE_384K = 13, }; #define V4L2_CID_MPEG_AUDIO_L3_BITRATE (V4L2_CID_MPEG_BASE+104) enum v4l2_mpeg_audio_l3_bitrate { - V4L2_MPEG_AUDIO_L3_BITRATE_32K, - V4L2_MPEG_AUDIO_L3_BITRATE_40K, - V4L2_MPEG_AUDIO_L3_BITRATE_48K, - V4L2_MPEG_AUDIO_L3_BITRATE_56K, - V4L2_MPEG_AUDIO_L3_BITRATE_64K, - V4L2_MPEG_AUDIO_L3_BITRATE_80K, - V4L2_MPEG_AUDIO_L3_BITRATE_96K, - V4L2_MPEG_AUDIO_L3_BITRATE_112K, - V4L2_MPEG_AUDIO_L3_BITRATE_128K, - V4L2_MPEG_AUDIO_L3_BITRATE_160K, - V4L2_MPEG_AUDIO_L3_BITRATE_192K, - V4L2_MPEG_AUDIO_L3_BITRATE_224K, - V4L2_MPEG_AUDIO_L3_BITRATE_256K, - V4L2_MPEG_AUDIO_L3_BITRATE_320K, + V4L2_MPEG_AUDIO_L3_BITRATE_32K = 0, + V4L2_MPEG_AUDIO_L3_BITRATE_40K = 1, + V4L2_MPEG_AUDIO_L3_BITRATE_48K = 2, + V4L2_MPEG_AUDIO_L3_BITRATE_56K = 3, + V4L2_MPEG_AUDIO_L3_BITRATE_64K = 4, + V4L2_MPEG_AUDIO_L3_BITRATE_80K = 5, + V4L2_MPEG_AUDIO_L3_BITRATE_96K = 6, + V4L2_MPEG_AUDIO_L3_BITRATE_112K = 7, + V4L2_MPEG_AUDIO_L3_BITRATE_128K = 8, + V4L2_MPEG_AUDIO_L3_BITRATE_160K = 9, + V4L2_MPEG_AUDIO_L3_BITRATE_192K = 10, + V4L2_MPEG_AUDIO_L3_BITRATE_224K = 11, + V4L2_MPEG_AUDIO_L3_BITRATE_256K = 12, + V4L2_MPEG_AUDIO_L3_BITRATE_320K = 13, }; #define V4L2_CID_MPEG_AUDIO_MODE (V4L2_CID_MPEG_BASE+105) enum v4l2_mpeg_audio_mode { - V4L2_MPEG_AUDIO_MODE_STEREO, - V4L2_MPEG_AUDIO_MODE_JOINT_STEREO, - V4L2_MPEG_AUDIO_MODE_DUAL, - V4L2_MPEG_AUDIO_MODE_MONO, + V4L2_MPEG_AUDIO_MODE_STEREO = 0, + V4L2_MPEG_AUDIO_MODE_JOINT_STEREO = 1, + V4L2_MPEG_AUDIO_MODE_DUAL = 2, + V4L2_MPEG_AUDIO_MODE_MONO = 3, }; #define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (V4L2_CID_MPEG_BASE+106) enum v4l2_mpeg_audio_mode_extension { - V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4, - V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8, - V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12, - V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16, + V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4 = 0, + V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8 = 1, + V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12 = 2, + V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16 = 3, }; #define V4L2_CID_MPEG_AUDIO_EMPHASIS (V4L2_CID_MPEG_BASE+107) enum v4l2_mpeg_audio_emphasis { - V4L2_MPEG_AUDIO_EMPHASIS_NONE, - V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS, - V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17, + V4L2_MPEG_AUDIO_EMPHASIS_NONE = 0, + V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS = 1, + V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17 = 2, }; #define V4L2_CID_MPEG_AUDIO_CRC (V4L2_CID_MPEG_BASE+108) enum v4l2_mpeg_audio_crc { - V4L2_MPEG_AUDIO_CRC_NONE, - V4L2_MPEG_AUDIO_CRC_CRC16, + V4L2_MPEG_AUDIO_CRC_NONE = 0, + V4L2_MPEG_AUDIO_CRC_CRC16 = 1, }; /* MPEG video */ #define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200) enum v4l2_mpeg_video_encoding { - V4L2_MPEG_VIDEO_ENCODING_MPEG_1, - V4L2_MPEG_VIDEO_ENCODING_MPEG_2, + V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0, + V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1, }; #define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201) enum v4l2_mpeg_video_aspect { - V4L2_MPEG_VIDEO_ASPECT_1x1, - V4L2_MPEG_VIDEO_ASPECT_4x3, - V4L2_MPEG_VIDEO_ASPECT_16x9, - V4L2_MPEG_VIDEO_ASPECT_221x100, + V4L2_MPEG_VIDEO_ASPECT_1x1 = 0, + V4L2_MPEG_VIDEO_ASPECT_4x3 = 1, + V4L2_MPEG_VIDEO_ASPECT_16x9 = 2, + V4L2_MPEG_VIDEO_ASPECT_221x100 = 3, }; #define V4L2_CID_MPEG_VIDEO_B_FRAMES (V4L2_CID_MPEG_BASE+202) #define V4L2_CID_MPEG_VIDEO_GOP_SIZE (V4L2_CID_MPEG_BASE+203) @@ -931,8 +931,8 @@ enum v4l2_mpeg_video_aspect { #define V4L2_CID_MPEG_VIDEO_PULLDOWN (V4L2_CID_MPEG_BASE+205) #define V4L2_CID_MPEG_VIDEO_BITRATE_MODE (V4L2_CID_MPEG_BASE+206) enum v4l2_mpeg_video_bitrate_mode { - V4L2_MPEG_VIDEO_BITRATE_MODE_VBR, - V4L2_MPEG_VIDEO_BITRATE_MODE_CBR, + V4L2_MPEG_VIDEO_BITRATE_MODE_VBR = 0, + V4L2_MPEG_VIDEO_BITRATE_MODE_CBR = 1, }; #define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_MPEG_BASE+207) #define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_MPEG_BASE+208) @@ -942,36 +942,36 @@ enum v4l2_mpeg_video_bitrate_mode { #define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000) #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0) enum v4l2_mpeg_cx2341x_video_spatial_filter_mode { - V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL, - V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO, + V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL = 0, + V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO = 1, }; #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+1) #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+2) enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type { - V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF, - V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR, - V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT, - V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE, - V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE, + V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF = 0, + V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR = 1, + V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT = 2, + V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE = 3, + V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE = 4, }; #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+3) enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type { - V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF, - V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR, + V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF = 0, + V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR = 1, }; #define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+4) enum v4l2_mpeg_cx2341x_video_temporal_filter_mode { - V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL, - V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO, + V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL = 0, + V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO = 1, }; #define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+5) #define V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+6) enum v4l2_mpeg_cx2341x_video_median_filter_type { - V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF, - V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR, - V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT, - V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT, - V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG, + V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF = 0, + V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR = 1, + V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT = 2, + V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT = 3, + V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG = 4, }; #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+7) #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+8) diff --git a/linux/include/media/cx2341x.h b/linux/include/media/cx2341x.h index fb170d4b5..51fb06b4c 100644 --- a/linux/include/media/cx2341x.h +++ b/linux/include/media/cx2341x.h @@ -20,9 +20,9 @@ #define CX2341X_H enum cx2341x_port { - CX2341X_PORT_MEMORY, - CX2341X_PORT_STREAMING, - CX2341X_PORT_SERIAL + CX2341X_PORT_MEMORY = 0, + CX2341X_PORT_STREAMING = 1, + CX2341X_PORT_SERIAL = 2 }; struct cx2341x_mpeg_params { -- cgit v1.2.3 From 2b9b626849d56a89bbccfc172636a16cb2a513f1 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 23 Jun 2006 16:13:56 -0300 Subject: Merge tda9887 module into tuner. From: Mauro Carvalho Chehab Most uses a tda988[5/6/7] IF demodulator as part of the device. Having this as a separate stuff makes harder to configure it, since there are some tda9887 options that are tuner-dependent and should be bound into tuner-types structures. This patch merges tda9887 module into tuner. More work is required to make tuner-types to properly use it. Signed-off-by: Mauro Carvalho Chehab --- linux/include/media/tuner.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'linux/include') diff --git a/linux/include/media/tuner.h b/linux/include/media/tuner.h index 4548ede84..fa5829c4c 100644 --- a/linux/include/media/tuner.h +++ b/linux/include/media/tuner.h @@ -25,6 +25,8 @@ #include #include +extern int tuner_debug; + #define ADDR_UNSET (255) #define TUNER_TEMIC_PAL 0 /* 4002 FH5 (3X 7756, 9483) */ @@ -120,6 +122,7 @@ #define TUNER_THOMSON_FE6600 72 /* DViCO FusionHDTV DVB-T Hybrid */ #define TUNER_SAMSUNG_TCPG_6121P30A 73 /* Hauppauge PVR-500 PAL */ +#define TUNER_TDA9887 74 /* This tuner should be used only internally */ /* tv card specific */ #define TDA9887_PRESENT (1<<0) @@ -191,6 +194,10 @@ struct tuner { int using_v4l2; + /* used by tda9887 */ + unsigned int tda9887_config; + unsigned char tda9887_data[4]; + /* used by MT2032 */ unsigned int xogc; unsigned int radio_if2; @@ -207,6 +214,8 @@ struct tuner { void (*set_radio_freq)(struct i2c_client *c, unsigned int freq); int (*has_signal)(struct i2c_client *c); int (*is_stereo)(struct i2c_client *c); + int (*get_afc)(struct i2c_client *c); + void (*tuner_status)(struct i2c_client *c); void (*standby)(struct i2c_client *c); }; @@ -219,6 +228,7 @@ extern int tda8290_probe(struct i2c_client *c); extern int tea5767_tuner_init(struct i2c_client *c); extern int default_tuner_init(struct i2c_client *c); extern int tea5767_autodetection(struct i2c_client *c); +extern int tda9887_tuner_init(struct i2c_client *c); #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15) #define tuner_warn(fmt, arg...) do {\ -- cgit v1.2.3 From 7b3bc6a8a45954a235cdceccbd474d01e36468b4 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sat, 24 Jun 2006 14:26:43 +0200 Subject: Add HM12 YUV format define. From: Hans Verkuil HM12 is a YUV 4:1:1 format used by the cx2341x MPEG encoder/decoder for the raw YUV input/output. The Y and UV planes are broken up in 16x16 macroblocks and each macroblock is transmitted in turn (row by row). Signed-off-by: Hans Verkuil --- linux/include/linux/videodev2.h | 1 + 1 file changed, 1 insertion(+) (limited to 'linux/include') diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h index 952fcd831..aea1ab1ef 100644 --- a/linux/include/linux/videodev2.h +++ b/linux/include/linux/videodev2.h @@ -245,6 +245,7 @@ struct v4l2_pix_format #define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y','U','1','2') /* 12 YUV 4:2:0 */ #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:1:1 16x16 macroblocks */ /* see http://www.siliconimaging.com/RGB%20Bayer.htm */ #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */ -- cgit v1.2.3 From ab9eca654d43314813593d7ea057ccad4342d932 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sat, 24 Jun 2006 19:36:02 +0200 Subject: Add V4L2_CID_MPEG_STREAM_VBI_FMT control From: Hans Verkuil V4L2_CID_MPEG_STREAM_VBI_FMT controls if and how VBI data is embedded in an MPEG stream. Currently only one format is supported: the format designed for the ivtv driver. This should be extended with new standard formats (such as defined for DVB) in the future. Signed-off-by: Hans Verkuil --- linux/include/linux/videodev2.h | 5 +++++ linux/include/media/cx2341x.h | 6 ++++++ 2 files changed, 11 insertions(+) (limited to 'linux/include') diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h index aea1ab1ef..60b5b4b27 100644 --- a/linux/include/linux/videodev2.h +++ b/linux/include/linux/videodev2.h @@ -822,6 +822,11 @@ enum v4l2_mpeg_stream_type { #define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4) #define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5) #define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6) +#define V4L2_CID_MPEG_STREAM_VBI_FMT (V4L2_CID_MPEG_BASE+7) +enum v4l2_mpeg_stream_vbi_fmt { + V4L2_MPEG_STREAM_VBI_FMT_NONE = 0, /* No VBI in the MPEG stream */ + V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */ +}; /* MPEG audio */ #define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100) diff --git a/linux/include/media/cx2341x.h b/linux/include/media/cx2341x.h index 51fb06b4c..074c4008a 100644 --- a/linux/include/media/cx2341x.h +++ b/linux/include/media/cx2341x.h @@ -25,8 +25,13 @@ enum cx2341x_port { CX2341X_PORT_SERIAL = 2 }; +enum cx2341x_cap { + CX2341X_CAP_HAS_SLICED_VBI = 1 << 0, +}; + struct cx2341x_mpeg_params { /* misc */ + u32 capabilities; enum cx2341x_port port; u16 width; u16 height; @@ -34,6 +39,7 @@ struct cx2341x_mpeg_params { /* stream */ enum v4l2_mpeg_stream_type stream_type; + enum v4l2_mpeg_stream_vbi_fmt stream_vbi_fmt; /* audio */ enum v4l2_mpeg_audio_sampling_freq audio_sampling_freq; -- cgit v1.2.3 From c265cca51af88f5caff789df5ead7de8662ccc0f Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 25 Jun 2006 20:34:39 +0200 Subject: Add tda9887-specific tuner configuration From: Hans Verkuil Many tda9887 settings depend on the chosen tuner. Expand the tuner parameters to include these tda9887 settings. Signed-off-by: Hans Verkuil --- linux/include/media/tuner-types.h | 58 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 3 deletions(-) (limited to 'linux/include') diff --git a/linux/include/media/tuner-types.h b/linux/include/media/tuner-types.h index 0e2503be4..2ffb4f81d 100644 --- a/linux/include/media/tuner-types.h +++ b/linux/include/media/tuner-types.h @@ -27,9 +27,7 @@ struct tuner_range { struct tuner_params { enum param_type type; -#if 0 /* disabled for 2.6.16 merge window, since it's unused */ - unsigned int tda988x; -#endif + /* Many Philips based tuners have a comment like this in their * datasheet: * @@ -49,6 +47,60 @@ struct tuner_params { * static unless the control byte was sent first. */ unsigned int cb_first_if_lower_freq:1; + /* Set to 1 if this tuner uses a tda9887 */ + unsigned int has_tda9887:1; + /* Many Philips tuners use tda9887 PORT1 to select the FM radio + sensitivity. If this setting is 1, then set PORT1 to 1 to + get proper FM reception. */ + unsigned int port1_fm_high_sensitivity:1; + /* Some Philips tuners use tda9887 PORT2 to select the FM radio + sensitivity. If this setting is 1, then set PORT2 to 1 to + get proper FM reception. */ + unsigned int port2_fm_high_sensitivity: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. */ + unsigned int intercarrier_mode:1; + /* This setting sets the default value for PORT1. + 0 means inactive, 1 means active. Note: the actual bit + value written to the tda9887 is inverted. So a 0 here + means a 1 in the B6 bit. */ + unsigned int port1_active:1; + /* This setting sets the default value for PORT2. + 0 means inactive, 1 means active. Note: the actual bit + value written to the tda9887 is inverted. So a 0 here + means a 1 in the B7 bit. */ + unsigned int port2_active:1; + /* Sometimes PORT1 is inverted when the SECAM-L' standard is selected. + Set this bit to 1 if this is needed. */ + unsigned int port1_invert_for_secam_lc:1; + /* Sometimes PORT2 is inverted when the SECAM-L' standard is selected. + Set this bit to 1 if this is needed. */ + unsigned int port2_invert_for_secam_lc:1; + /* Some cards require PORT1 to be 1 for mono Radio FM and 0 for stereo. */ + unsigned int port1_set_for_fm_mono:1; + /* Default tda9887 TOP value in dB for the low band. Default is 0. + Range: -16:+15 */ + signed int default_top_low:5; + /* Default tda9887 TOP value in dB for the mid band. Default is 0. + Range: -16:+15 */ + signed int default_top_mid:5; + /* Default tda9887 TOP value in dB for the high band. Default is 0. + Range: -16:+15 */ + signed int default_top_high:5; + /* Default tda9887 TOP value in dB for SECAM-L/L' for the low band. + Default is 0. Several tuners require a different TOP value for + the SECAM-L/L' standards. Range: -16:+15 */ + signed int default_top_secam_low:5; + /* Default tda9887 TOP value in dB for SECAM-L/L' for the mid band. + Default is 0. Several tuners require a different TOP value for + the SECAM-L/L' standards. Range: -16:+15 */ + signed int default_top_secam_mid:5; + /* Default tda9887 TOP value in dB for SECAM-L/L' for the high band. + Default is 0. Several tuners require a different TOP value for + the SECAM-L/L' standards. Range: -16:+15 */ + signed int default_top_secam_high:5; + #if 0 /* to be used when we merge dvb-pll */ u32 min; u32 max; -- cgit v1.2.3 From 78b6dfe3d0f7e5d17ce931cf67307a174188a794 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 26 Jun 2006 14:31:18 +0200 Subject: Fix 64-bit compile warnings. From: Hans Verkuil Signed-off-by: Hans Verkuil --- linux/include/media/cx2341x.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux/include') diff --git a/linux/include/media/cx2341x.h b/linux/include/media/cx2341x.h index 074c4008a..e1cbf7974 100644 --- a/linux/include/media/cx2341x.h +++ b/linux/include/media/cx2341x.h @@ -89,7 +89,7 @@ int cx2341x_ctrl_query(struct cx2341x_mpeg_params *params, struct v4l2_queryctrl *qctrl); const char **cx2341x_ctrl_get_menu(u32 id); int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params, - struct v4l2_ext_controls *ctrls, int cmd); + struct v4l2_ext_controls *ctrls, unsigned int cmd); void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p); void cx2341x_log_status(struct cx2341x_mpeg_params *p, int cardid); -- cgit v1.2.3 From f946df2d8b2498e21954e07cc0126e8beb34ac40 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 26 Jun 2006 23:24:05 +0200 Subject: Pass an explicit log prefix to cx2341x_log_status From: Hans Verkuil A card number is not unique enough. Instead, let the caller specify the prefix of the status messages. Signed-off-by: Hans Verkuil --- linux/include/media/cx2341x.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux/include') diff --git a/linux/include/media/cx2341x.h b/linux/include/media/cx2341x.h index e1cbf7974..d91d88f93 100644 --- a/linux/include/media/cx2341x.h +++ b/linux/include/media/cx2341x.h @@ -91,7 +91,7 @@ const char **cx2341x_ctrl_get_menu(u32 id); int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params, struct v4l2_ext_controls *ctrls, unsigned int cmd); void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p); -void cx2341x_log_status(struct cx2341x_mpeg_params *p, int cardid); +void cx2341x_log_status(struct cx2341x_mpeg_params *p, const char *prefix); /* Firmware names */ #define CX2341X_FIRM_ENC_FILENAME "v4l-cx2341x-enc.fw" -- cgit v1.2.3