aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-24 14:21:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-24 14:21:08 -0400
commitc328d54cd4ad120d76284e46dcca6c6cf996154a (patch)
tree104c023be66faa5fce6e0a56c0a6d13c62fd21e5 /include
parent346ad4b7fe392571f19314f153db9151dbc1d82b (diff)
parentb0166ab3a6ae6d7af8d9a21a7836154963c69a11 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
* git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb: (452 commits) V4L/DVB (7731): tuner-xc2028: fix signal strength calculus V4L/DVB (7730): tuner-xc2028: Fix SCODE load for MTS firmwares V4L/DVB (7729): Fix VIDIOCGAP corruption in ivtv V4L/DVB (7728): tea5761: bugzilla #10462: tea5761 autodetection code were broken V4L/DVB (7726): cx23885: Enable cx23417 support on the HVR1800 V4L/DVB (7725): cx23885: Add generic cx23417 hardware encoder support V4L/DVB (7723): pvrusb2: Clean up input selection list generation in V4L interface V4L/DVB (7722): pvrusb2: Implement FM radio support for Gotview USB2.0 DVD 2 V4L/DVB (7721): pvrusb2: Restructure cx23416 firmware loading to have a common exit point V4L/DVB (7720): pvrusb2: Fix bad error code on cx23416 firmware load failure V4L/DVB (7719): pvrusb2: Implement input selection enforcement V4L/DVB (7718): pvrusb2-dvb: update Kbuild selections V4L/DVB (7717): pvrusb2-dvb: add DVB-T support for Hauppauge pvrusb2 model 73xxx V4L/DVB (7716): pvrusb2: clean up global functions V4L/DVB (7715): pvrusb2: Clean out all use of __FUNCTION__ V4L/DVB (7714): pvrusb2: Fix hang on module removal V4L/DVB (7713): pvrusb2: Implement cleaner DVB kernel thread shutdown V4L/DVB (7712): pvrusb2: Close connect/disconnect race V4L/DVB (7711): pvrusb2: Fix race on module unload V4L/DVB (7710): pvrusb2: Implement critical digital streaming quirk for onair devices ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/dvb/dmx.h3
-rw-r--r--include/linux/i2c-id.h1
-rw-r--r--include/linux/meye.h2
-rw-r--r--include/linux/videodev2.h55
-rw-r--r--include/media/ir-common.h3
-rw-r--r--include/media/soc_camera.h179
-rw-r--r--include/media/tuner-types.h17
-rw-r--r--include/media/tuner.h2
-rw-r--r--include/media/v4l2-chip-ident.h6
-rw-r--r--include/media/v4l2-dev.h4
-rw-r--r--include/media/videobuf-core.h24
-rw-r--r--include/media/videobuf-dma-sg.h17
-rw-r--r--include/media/videobuf-dvb.h3
-rw-r--r--include/media/videobuf-vmalloc.h4
14 files changed, 287 insertions, 33 deletions
diff --git a/include/linux/dvb/dmx.h b/include/linux/dvb/dmx.h
index c6a2353c4e68..402fb7a8d922 100644
--- a/include/linux/dvb/dmx.h
+++ b/include/linux/dvb/dmx.h
@@ -39,9 +39,10 @@ typedef enum
39 DMX_OUT_DECODER, /* Streaming directly to decoder. */ 39 DMX_OUT_DECODER, /* Streaming directly to decoder. */
40 DMX_OUT_TAP, /* Output going to a memory buffer */ 40 DMX_OUT_TAP, /* Output going to a memory buffer */
41 /* (to be retrieved via the read command).*/ 41 /* (to be retrieved via the read command).*/
42 DMX_OUT_TS_TAP /* Output multiplexed into a new TS */ 42 DMX_OUT_TS_TAP, /* Output multiplexed into a new TS */
43 /* (to be retrieved by reading from the */ 43 /* (to be retrieved by reading from the */
44 /* logical DVR device). */ 44 /* logical DVR device). */
45 DMX_OUT_TSDEMUX_TAP /* Like TS_TAP but retrieved from the DMX device */
45} dmx_output_t; 46} dmx_output_t;
46 47
47 48
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index b979112f74e0..32eb8bbe4831 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -125,6 +125,7 @@
125#define I2C_HW_B_CX2341X 0x010020 /* Conexant CX2341X MPEG encoder cards */ 125#define I2C_HW_B_CX2341X 0x010020 /* Conexant CX2341X MPEG encoder cards */
126#define I2C_HW_B_INTELFB 0x010021 /* intel framebuffer driver */ 126#define I2C_HW_B_INTELFB 0x010021 /* intel framebuffer driver */
127#define I2C_HW_B_CX23885 0x010022 /* conexant 23885 based tv cards (bus1) */ 127#define I2C_HW_B_CX23885 0x010022 /* conexant 23885 based tv cards (bus1) */
128#define I2C_HW_B_AU0828 0x010023 /* auvitek au0828 usb bridge */
128 129
129/* --- PCF 8584 based algorithms */ 130/* --- PCF 8584 based algorithms */
130#define I2C_HW_P_ELEK 0x020002 /* Elektor ISA Bus inteface card */ 131#define I2C_HW_P_ELEK 0x020002 /* Elektor ISA Bus inteface card */
diff --git a/include/linux/meye.h b/include/linux/meye.h
index 39fd9c8ddd4b..12010ace1f04 100644
--- a/include/linux/meye.h
+++ b/include/linux/meye.h
@@ -58,7 +58,7 @@ struct meye_params {
58 58
59/* V4L2 private controls */ 59/* V4L2 private controls */
60#define V4L2_CID_AGC V4L2_CID_PRIVATE_BASE 60#define V4L2_CID_AGC V4L2_CID_PRIVATE_BASE
61#define V4L2_CID_SHARPNESS (V4L2_CID_PRIVATE_BASE + 1) 61#define V4L2_CID_MEYE_SHARPNESS (V4L2_CID_PRIVATE_BASE + 1)
62#define V4L2_CID_PICTURE (V4L2_CID_PRIVATE_BASE + 2) 62#define V4L2_CID_PICTURE (V4L2_CID_PRIVATE_BASE + 2)
63#define V4L2_CID_JPEGQUAL (V4L2_CID_PRIVATE_BASE + 3) 63#define V4L2_CID_JPEGQUAL (V4L2_CID_PRIVATE_BASE + 3)
64#define V4L2_CID_FRAMERATE (V4L2_CID_PRIVATE_BASE + 4) 64#define V4L2_CID_FRAMERATE (V4L2_CID_PRIVATE_BASE + 4)
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 17a80177a674..c1411189ba6c 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -282,6 +282,7 @@ struct v4l2_pix_format
282#define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B','G','R','4') /* 32 BGR-8-8-8-8 */ 282#define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B','G','R','4') /* 32 BGR-8-8-8-8 */
283#define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R','G','B','4') /* 32 RGB-8-8-8-8 */ 283#define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R','G','B','4') /* 32 RGB-8-8-8-8 */
284#define V4L2_PIX_FMT_GREY v4l2_fourcc('G','R','E','Y') /* 8 Greyscale */ 284#define V4L2_PIX_FMT_GREY v4l2_fourcc('G','R','E','Y') /* 8 Greyscale */
285#define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y','1','6',' ') /* 16 Greyscale */
285#define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P','A','L','8') /* 8 8-bit palette */ 286#define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P','A','L','8') /* 8 8-bit palette */
286#define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y','V','U','9') /* 9 YVU 4:1:0 */ 287#define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y','V','U','9') /* 9 YVU 4:1:0 */
287#define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y','V','1','2') /* 12 YVU 4:2:0 */ 288#define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y','V','1','2') /* 12 YVU 4:2:0 */
@@ -308,6 +309,7 @@ struct v4l2_pix_format
308 309
309/* see http://www.siliconimaging.com/RGB%20Bayer.htm */ 310/* see http://www.siliconimaging.com/RGB%20Bayer.htm */
310#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */ 311#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */
312#define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B','Y','R','2') /* 16 BGBG.. GRGR.. */
311 313
312/* compressed formats */ 314/* compressed formats */
313#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M','J','P','G') /* Motion-JPEG */ 315#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M','J','P','G') /* Motion-JPEG */
@@ -793,6 +795,7 @@ struct v4l2_ext_controls
793/* Values for ctrl_class field */ 795/* Values for ctrl_class field */
794#define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */ 796#define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */
795#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */ 797#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */
798#define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */
796 799
797#define V4L2_CTRL_ID_MASK (0x0fffffff) 800#define V4L2_CTRL_ID_MASK (0x0fffffff)
798#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) 801#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)
@@ -849,21 +852,37 @@ struct v4l2_querymenu
849#define V4L2_CID_AUDIO_TREBLE (V4L2_CID_BASE+8) 852#define V4L2_CID_AUDIO_TREBLE (V4L2_CID_BASE+8)
850#define V4L2_CID_AUDIO_MUTE (V4L2_CID_BASE+9) 853#define V4L2_CID_AUDIO_MUTE (V4L2_CID_BASE+9)
851#define V4L2_CID_AUDIO_LOUDNESS (V4L2_CID_BASE+10) 854#define V4L2_CID_AUDIO_LOUDNESS (V4L2_CID_BASE+10)
852#define V4L2_CID_BLACK_LEVEL (V4L2_CID_BASE+11) 855#define V4L2_CID_BLACK_LEVEL (V4L2_CID_BASE+11) /* Deprecated */
853#define V4L2_CID_AUTO_WHITE_BALANCE (V4L2_CID_BASE+12) 856#define V4L2_CID_AUTO_WHITE_BALANCE (V4L2_CID_BASE+12)
854#define V4L2_CID_DO_WHITE_BALANCE (V4L2_CID_BASE+13) 857#define V4L2_CID_DO_WHITE_BALANCE (V4L2_CID_BASE+13)
855#define V4L2_CID_RED_BALANCE (V4L2_CID_BASE+14) 858#define V4L2_CID_RED_BALANCE (V4L2_CID_BASE+14)
856#define V4L2_CID_BLUE_BALANCE (V4L2_CID_BASE+15) 859#define V4L2_CID_BLUE_BALANCE (V4L2_CID_BASE+15)
857#define V4L2_CID_GAMMA (V4L2_CID_BASE+16) 860#define V4L2_CID_GAMMA (V4L2_CID_BASE+16)
858#define V4L2_CID_WHITENESS (V4L2_CID_GAMMA) /* ? Not sure */ 861#define V4L2_CID_WHITENESS (V4L2_CID_GAMMA) /* Deprecated */
859#define V4L2_CID_EXPOSURE (V4L2_CID_BASE+17) 862#define V4L2_CID_EXPOSURE (V4L2_CID_BASE+17)
860#define V4L2_CID_AUTOGAIN (V4L2_CID_BASE+18) 863#define V4L2_CID_AUTOGAIN (V4L2_CID_BASE+18)
861#define V4L2_CID_GAIN (V4L2_CID_BASE+19) 864#define V4L2_CID_GAIN (V4L2_CID_BASE+19)
862#define V4L2_CID_HFLIP (V4L2_CID_BASE+20) 865#define V4L2_CID_HFLIP (V4L2_CID_BASE+20)
863#define V4L2_CID_VFLIP (V4L2_CID_BASE+21) 866#define V4L2_CID_VFLIP (V4L2_CID_BASE+21)
864#define V4L2_CID_HCENTER (V4L2_CID_BASE+22) 867
865#define V4L2_CID_VCENTER (V4L2_CID_BASE+23) 868/* Deprecated, use V4L2_CID_PAN_RESET and V4L2_CID_TILT_RESET */
866#define V4L2_CID_LASTP1 (V4L2_CID_BASE+24) /* last CID + 1 */ 869#define V4L2_CID_HCENTER_DEPRECATED (V4L2_CID_BASE+22)
870#define V4L2_CID_VCENTER_DEPRECATED (V4L2_CID_BASE+23)
871
872#define V4L2_CID_POWER_LINE_FREQUENCY (V4L2_CID_BASE+24)
873enum v4l2_power_line_frequency {
874 V4L2_CID_POWER_LINE_FREQUENCY_DISABLED = 0,
875 V4L2_CID_POWER_LINE_FREQUENCY_50HZ = 1,
876 V4L2_CID_POWER_LINE_FREQUENCY_60HZ = 2,
877};
878#define V4L2_CID_HUE_AUTO (V4L2_CID_BASE+25)
879#define V4L2_CID_WHITE_BALANCE_TEMPERATURE (V4L2_CID_BASE+26)
880#define V4L2_CID_SHARPNESS (V4L2_CID_BASE+27)
881#define V4L2_CID_BACKLIGHT_COMPENSATION (V4L2_CID_BASE+28)
882#define V4L2_CID_CHROMA_AGC (V4L2_CID_BASE+29)
883#define V4L2_CID_COLOR_KILLER (V4L2_CID_BASE+30)
884/* last CID + 1 */
885#define V4L2_CID_LASTP1 (V4L2_CID_BASE+31)
867 886
868/* MPEG-class control IDs defined by V4L2 */ 887/* MPEG-class control IDs defined by V4L2 */
869#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) 888#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
@@ -1051,6 +1070,32 @@ enum v4l2_mpeg_cx2341x_video_median_filter_type {
1051#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10) 1070#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10)
1052#define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_MPEG_CX2341X_BASE+11) 1071#define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_MPEG_CX2341X_BASE+11)
1053 1072
1073/* Camera class control IDs */
1074#define V4L2_CID_CAMERA_CLASS_BASE (V4L2_CTRL_CLASS_CAMERA | 0x900)
1075#define V4L2_CID_CAMERA_CLASS (V4L2_CTRL_CLASS_CAMERA | 1)
1076
1077#define V4L2_CID_EXPOSURE_AUTO (V4L2_CID_CAMERA_CLASS_BASE+1)
1078enum v4l2_exposure_auto_type {
1079 V4L2_EXPOSURE_AUTO = 0,
1080 V4L2_EXPOSURE_MANUAL = 1,
1081 V4L2_EXPOSURE_SHUTTER_PRIORITY = 2,
1082 V4L2_EXPOSURE_APERTURE_PRIORITY = 3
1083};
1084#define V4L2_CID_EXPOSURE_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+2)
1085#define V4L2_CID_EXPOSURE_AUTO_PRIORITY (V4L2_CID_CAMERA_CLASS_BASE+3)
1086
1087#define V4L2_CID_PAN_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+4)
1088#define V4L2_CID_TILT_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+5)
1089#define V4L2_CID_PAN_RESET (V4L2_CID_CAMERA_CLASS_BASE+6)
1090#define V4L2_CID_TILT_RESET (V4L2_CID_CAMERA_CLASS_BASE+7)
1091
1092#define V4L2_CID_PAN_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+8)
1093#define V4L2_CID_TILT_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+9)
1094
1095#define V4L2_CID_FOCUS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+10)
1096#define V4L2_CID_FOCUS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+11)
1097#define V4L2_CID_FOCUS_AUTO (V4L2_CID_CAMERA_CLASS_BASE+12)
1098
1054/* 1099/*
1055 * T U N I N G 1100 * T U N I N G
1056 */ 1101 */
diff --git a/include/media/ir-common.h b/include/media/ir-common.h
index a4274203f252..bfee8be5d63f 100644
--- a/include/media/ir-common.h
+++ b/include/media/ir-common.h
@@ -107,6 +107,7 @@ extern IR_KEYTAB_TYPE ir_codes_avermedia[IR_KEYTAB_SIZE];
107extern IR_KEYTAB_TYPE ir_codes_avermedia_dvbt[IR_KEYTAB_SIZE]; 107extern IR_KEYTAB_TYPE ir_codes_avermedia_dvbt[IR_KEYTAB_SIZE];
108extern IR_KEYTAB_TYPE ir_codes_apac_viewcomp[IR_KEYTAB_SIZE]; 108extern IR_KEYTAB_TYPE ir_codes_apac_viewcomp[IR_KEYTAB_SIZE];
109extern IR_KEYTAB_TYPE ir_codes_pixelview[IR_KEYTAB_SIZE]; 109extern IR_KEYTAB_TYPE ir_codes_pixelview[IR_KEYTAB_SIZE];
110extern IR_KEYTAB_TYPE ir_codes_pixelview_new[IR_KEYTAB_SIZE];
110extern IR_KEYTAB_TYPE ir_codes_nebula[IR_KEYTAB_SIZE]; 111extern IR_KEYTAB_TYPE ir_codes_nebula[IR_KEYTAB_SIZE];
111extern IR_KEYTAB_TYPE ir_codes_dntv_live_dvb_t[IR_KEYTAB_SIZE]; 112extern IR_KEYTAB_TYPE ir_codes_dntv_live_dvb_t[IR_KEYTAB_SIZE];
112extern IR_KEYTAB_TYPE ir_codes_iodata_bctv7e[IR_KEYTAB_SIZE]; 113extern IR_KEYTAB_TYPE ir_codes_iodata_bctv7e[IR_KEYTAB_SIZE];
@@ -141,8 +142,10 @@ extern IR_KEYTAB_TYPE ir_codes_encore_enltv[IR_KEYTAB_SIZE];
141extern IR_KEYTAB_TYPE ir_codes_tt_1500[IR_KEYTAB_SIZE]; 142extern IR_KEYTAB_TYPE ir_codes_tt_1500[IR_KEYTAB_SIZE];
142extern IR_KEYTAB_TYPE ir_codes_fusionhdtv_mce[IR_KEYTAB_SIZE]; 143extern IR_KEYTAB_TYPE ir_codes_fusionhdtv_mce[IR_KEYTAB_SIZE];
143extern IR_KEYTAB_TYPE ir_codes_behold[IR_KEYTAB_SIZE]; 144extern IR_KEYTAB_TYPE ir_codes_behold[IR_KEYTAB_SIZE];
145extern IR_KEYTAB_TYPE ir_codes_behold_columbus[IR_KEYTAB_SIZE];
144extern IR_KEYTAB_TYPE ir_codes_pinnacle_pctv_hd[IR_KEYTAB_SIZE]; 146extern IR_KEYTAB_TYPE ir_codes_pinnacle_pctv_hd[IR_KEYTAB_SIZE];
145extern IR_KEYTAB_TYPE ir_codes_genius_tvgo_a11mce[IR_KEYTAB_SIZE]; 147extern IR_KEYTAB_TYPE ir_codes_genius_tvgo_a11mce[IR_KEYTAB_SIZE];
148extern IR_KEYTAB_TYPE ir_codes_powercolor_real_angel[IR_KEYTAB_SIZE];
146 149
147#endif 150#endif
148 151
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
new file mode 100644
index 000000000000..6a8c8be7a1ae
--- /dev/null
+++ b/include/media/soc_camera.h
@@ -0,0 +1,179 @@
1/*
2 * camera image capture (abstract) bus driver header
3 *
4 * Copyright (C) 2006, Sascha Hauer, Pengutronix
5 * Copyright (C) 2008, Guennadi Liakhovetski <kernel@pengutronix.de>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef SOC_CAMERA_H
13#define SOC_CAMERA_H
14
15#include <linux/videodev2.h>
16#include <media/videobuf-dma-sg.h>
17
18struct soc_camera_device {
19 struct list_head list;
20 struct device dev;
21 struct device *control;
22 unsigned short width; /* Current window */
23 unsigned short height; /* sizes */
24 unsigned short x_min; /* Camera capabilities */
25 unsigned short y_min;
26 unsigned short x_current; /* Current window location */
27 unsigned short y_current;
28 unsigned short width_min;
29 unsigned short width_max;
30 unsigned short height_min;
31 unsigned short height_max;
32 unsigned short y_skip_top; /* Lines to skip at the top */
33 unsigned short gain;
34 unsigned short exposure;
35 unsigned char iface; /* Host number */
36 unsigned char devnum; /* Device number per host */
37 unsigned char buswidth; /* See comment in .c */
38 struct soc_camera_ops *ops;
39 struct video_device *vdev;
40 const struct soc_camera_data_format *current_fmt;
41 const struct soc_camera_data_format *formats;
42 int num_formats;
43 struct module *owner;
44 /* soc_camera.c private count. Only accessed with video_lock held */
45 int use_count;
46};
47
48struct soc_camera_file {
49 struct soc_camera_device *icd;
50 struct videobuf_queue vb_vidq;
51 spinlock_t *lock;
52};
53
54struct soc_camera_host {
55 struct list_head list;
56 struct device dev;
57 unsigned char nr; /* Host number */
58 size_t msize;
59 struct videobuf_queue_ops *vbq_ops;
60 void *priv;
61 char *drv_name;
62 struct soc_camera_host_ops *ops;
63};
64
65struct soc_camera_host_ops {
66 struct module *owner;
67 int (*add)(struct soc_camera_device *);
68 void (*remove)(struct soc_camera_device *);
69 int (*set_fmt_cap)(struct soc_camera_device *, __u32,
70 struct v4l2_rect *);
71 int (*try_fmt_cap)(struct soc_camera_device *, struct v4l2_format *);
72 int (*reqbufs)(struct soc_camera_file *, struct v4l2_requestbuffers *);
73 int (*querycap)(struct soc_camera_host *, struct v4l2_capability *);
74 int (*try_bus_param)(struct soc_camera_device *, __u32);
75 int (*set_bus_param)(struct soc_camera_device *, __u32);
76 unsigned int (*poll)(struct file *, poll_table *);
77 spinlock_t* (*spinlock_alloc)(struct soc_camera_file *);
78 void (*spinlock_free)(spinlock_t *);
79};
80
81struct soc_camera_link {
82 /* Camera bus id, used to match a camera and a bus */
83 int bus_id;
84 /* GPIO number to switch between 8 and 10 bit modes */
85 unsigned int gpio;
86};
87
88static inline struct soc_camera_device *to_soc_camera_dev(struct device *dev)
89{
90 return container_of(dev, struct soc_camera_device, dev);
91}
92
93static inline struct soc_camera_host *to_soc_camera_host(struct device *dev)
94{
95 return container_of(dev, struct soc_camera_host, dev);
96}
97
98extern int soc_camera_host_register(struct soc_camera_host *ici);
99extern void soc_camera_host_unregister(struct soc_camera_host *ici);
100extern int soc_camera_device_register(struct soc_camera_device *icd);
101extern void soc_camera_device_unregister(struct soc_camera_device *icd);
102
103extern int soc_camera_video_start(struct soc_camera_device *icd);
104extern void soc_camera_video_stop(struct soc_camera_device *icd);
105
106struct soc_camera_data_format {
107 char *name;
108 unsigned int depth;
109 __u32 fourcc;
110 enum v4l2_colorspace colorspace;
111};
112
113struct soc_camera_ops {
114 struct module *owner;
115 int (*probe)(struct soc_camera_device *);
116 void (*remove)(struct soc_camera_device *);
117 int (*init)(struct soc_camera_device *);
118 int (*release)(struct soc_camera_device *);
119 int (*start_capture)(struct soc_camera_device *);
120 int (*stop_capture)(struct soc_camera_device *);
121 int (*set_fmt_cap)(struct soc_camera_device *, __u32,
122 struct v4l2_rect *);
123 int (*try_fmt_cap)(struct soc_camera_device *, struct v4l2_format *);
124 unsigned long (*query_bus_param)(struct soc_camera_device *);
125 int (*set_bus_param)(struct soc_camera_device *, unsigned long);
126 int (*get_chip_id)(struct soc_camera_device *,
127 struct v4l2_chip_ident *);
128#ifdef CONFIG_VIDEO_ADV_DEBUG
129 int (*get_register)(struct soc_camera_device *, struct v4l2_register *);
130 int (*set_register)(struct soc_camera_device *, struct v4l2_register *);
131#endif
132 int (*get_control)(struct soc_camera_device *, struct v4l2_control *);
133 int (*set_control)(struct soc_camera_device *, struct v4l2_control *);
134 const struct v4l2_queryctrl *controls;
135 int num_controls;
136};
137
138static inline struct v4l2_queryctrl const *soc_camera_find_qctrl(
139 struct soc_camera_ops *ops, int id)
140{
141 int i;
142
143 for (i = 0; i < ops->num_controls; i++)
144 if (ops->controls[i].id == id)
145 return &ops->controls[i];
146
147 return NULL;
148}
149
150#define SOCAM_MASTER (1 << 0)
151#define SOCAM_SLAVE (1 << 1)
152#define SOCAM_HSYNC_ACTIVE_HIGH (1 << 2)
153#define SOCAM_HSYNC_ACTIVE_LOW (1 << 3)
154#define SOCAM_VSYNC_ACTIVE_HIGH (1 << 4)
155#define SOCAM_VSYNC_ACTIVE_LOW (1 << 5)
156#define SOCAM_DATAWIDTH_8 (1 << 6)
157#define SOCAM_DATAWIDTH_9 (1 << 7)
158#define SOCAM_DATAWIDTH_10 (1 << 8)
159#define SOCAM_PCLK_SAMPLE_RISING (1 << 9)
160#define SOCAM_PCLK_SAMPLE_FALLING (1 << 10)
161
162#define SOCAM_DATAWIDTH_MASK (SOCAM_DATAWIDTH_8 | SOCAM_DATAWIDTH_9 | \
163 SOCAM_DATAWIDTH_10)
164
165static inline unsigned long soc_camera_bus_param_compatible(
166 unsigned long camera_flags, unsigned long bus_flags)
167{
168 unsigned long common_flags, hsync, vsync, pclk;
169
170 common_flags = camera_flags & bus_flags;
171
172 hsync = common_flags & (SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_HSYNC_ACTIVE_LOW);
173 vsync = common_flags & (SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW);
174 pclk = common_flags & (SOCAM_PCLK_SAMPLE_RISING | SOCAM_PCLK_SAMPLE_FALLING);
175
176 return (!hsync || !vsync || !pclk) ? 0 : common_flags;
177}
178
179#endif
diff --git a/include/media/tuner-types.h b/include/media/tuner-types.h
index b201371416a0..ab03c5344209 100644
--- a/include/media/tuner-types.h
+++ b/include/media/tuner-types.h
@@ -6,10 +6,11 @@
6#define __TUNER_TYPES_H__ 6#define __TUNER_TYPES_H__
7 7
8enum param_type { 8enum param_type {
9 TUNER_PARAM_TYPE_RADIO, \ 9 TUNER_PARAM_TYPE_RADIO,
10 TUNER_PARAM_TYPE_PAL, \ 10 TUNER_PARAM_TYPE_PAL,
11 TUNER_PARAM_TYPE_SECAM, \ 11 TUNER_PARAM_TYPE_SECAM,
12 TUNER_PARAM_TYPE_NTSC 12 TUNER_PARAM_TYPE_NTSC,
13 TUNER_PARAM_TYPE_DIGITAL,
13}; 14};
14 15
15struct tuner_range { 16struct tuner_range {
@@ -105,6 +106,7 @@ struct tuner_params {
105 the SECAM-L/L' standards. Range: -16:+15 */ 106 the SECAM-L/L' standards. Range: -16:+15 */
106 signed int default_top_secam_high:5; 107 signed int default_top_secam_high:5;
107 108
109 u16 iffreq;
108 110
109 unsigned int count; 111 unsigned int count;
110 struct tuner_range *ranges; 112 struct tuner_range *ranges;
@@ -114,6 +116,13 @@ struct tunertype {
114 char *name; 116 char *name;
115 unsigned int count; 117 unsigned int count;
116 struct tuner_params *params; 118 struct tuner_params *params;
119
120 u16 min;
121 u16 max;
122 u32 stepsize;
123
124 u8 *initdata;
125 u8 *sleepdata;
117}; 126};
118 127
119extern struct tunertype tuners[]; 128extern struct tunertype tuners[];
diff --git a/include/media/tuner.h b/include/media/tuner.h
index 1bf24a6ed8f1..77068fcc86bd 100644
--- a/include/media/tuner.h
+++ b/include/media/tuner.h
@@ -78,7 +78,7 @@
78 78
79#define TUNER_HITACHI_NTSC 40 79#define TUNER_HITACHI_NTSC 40
80#define TUNER_PHILIPS_PAL_MK 41 80#define TUNER_PHILIPS_PAL_MK 41
81#define TUNER_PHILIPS_ATSC 42 81#define TUNER_PHILIPS_FCV1236D 42
82#define TUNER_PHILIPS_FM1236_MK3 43 82#define TUNER_PHILIPS_FM1236_MK3 43
83 83
84#define TUNER_PHILIPS_4IN1 44 /* ATI TV Wonder Pro - Conexant */ 84#define TUNER_PHILIPS_4IN1 44 /* ATI TV Wonder Pro - Conexant */
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h
index 032bb75f69c2..0ea0bd85c036 100644
--- a/include/media/v4l2-chip-ident.h
+++ b/include/media/v4l2-chip-ident.h
@@ -153,6 +153,12 @@ enum {
153 V4L2_IDENT_MSP4428G = 44287, 153 V4L2_IDENT_MSP4428G = 44287,
154 V4L2_IDENT_MSP4448G = 44487, 154 V4L2_IDENT_MSP4448G = 44487,
155 V4L2_IDENT_MSP4458G = 44587, 155 V4L2_IDENT_MSP4458G = 44587,
156
157 /* Micron CMOS sensor chips: 45000-45099 */
158 V4L2_IDENT_MT9M001C12ST = 45000,
159 V4L2_IDENT_MT9M001C12STM = 45005,
160 V4L2_IDENT_MT9V022IX7ATC = 45010, /* No way to detect "normal" I77ATx */
161 V4L2_IDENT_MT9V022IX7ATM = 45015, /* and "lead free" IA7ATx chips */
156}; 162};
157 163
158#endif 164#endif
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index f2114459995d..a807d2f86ee8 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -318,6 +318,10 @@ struct video_device
318 int (*vidioc_g_chip_ident) (struct file *file, void *fh, 318 int (*vidioc_g_chip_ident) (struct file *file, void *fh,
319 struct v4l2_chip_ident *chip); 319 struct v4l2_chip_ident *chip);
320 320
321 /* For other private ioctls */
322 int (*vidioc_default) (struct file *file, void *fh,
323 int cmd, void *arg);
324
321 325
322#ifdef OBSOLETE_OWNER /* to be removed soon */ 326#ifdef OBSOLETE_OWNER /* to be removed soon */
323/* obsolete -- fops->owner is used instead */ 327/* obsolete -- fops->owner is used instead */
diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h
index 99033945cdee..5b39a22533fe 100644
--- a/include/media/videobuf-core.h
+++ b/include/media/videobuf-core.h
@@ -13,6 +13,9 @@
13 * the Free Software Foundation; either version 2 13 * the Free Software Foundation; either version 2
14 */ 14 */
15 15
16#ifndef _VIDEOBUF_CORE_H
17#define _VIDEOBUF_CORE_H
18
16#include <linux/poll.h> 19#include <linux/poll.h>
17#ifdef CONFIG_VIDEO_V4L1_COMPAT 20#ifdef CONFIG_VIDEO_V4L1_COMPAT
18#include <linux/videodev.h> 21#include <linux/videodev.h>
@@ -123,7 +126,8 @@ struct videobuf_queue_ops {
123struct videobuf_qtype_ops { 126struct videobuf_qtype_ops {
124 u32 magic; 127 u32 magic;
125 128
126 void* (*alloc) (size_t size); 129 void *(*alloc) (size_t size);
130 void *(*vmalloc) (struct videobuf_buffer *buf);
127 int (*iolock) (struct videobuf_queue* q, 131 int (*iolock) (struct videobuf_queue* q,
128 struct videobuf_buffer *vb, 132 struct videobuf_buffer *vb,
129 struct v4l2_framebuffer *fbuf); 133 struct v4l2_framebuffer *fbuf);
@@ -151,7 +155,9 @@ struct videobuf_qtype_ops {
151struct videobuf_queue { 155struct videobuf_queue {
152 struct mutex vb_lock; 156 struct mutex vb_lock;
153 spinlock_t *irqlock; 157 spinlock_t *irqlock;
154 void *dev; /* on pci, points to struct pci_dev */ 158 struct device *dev;
159
160 wait_queue_head_t wait; /* wait if queue is empty */
155 161
156 enum v4l2_buf_type type; 162 enum v4l2_buf_type type;
157 unsigned int inputs; /* for V4L2_BUF_FLAG_INPUT */ 163 unsigned int inputs; /* for V4L2_BUF_FLAG_INPUT */
@@ -183,9 +189,13 @@ int videobuf_iolock(struct videobuf_queue* q, struct videobuf_buffer *vb,
183 189
184void *videobuf_alloc(struct videobuf_queue* q); 190void *videobuf_alloc(struct videobuf_queue* q);
185 191
192/* Used on videobuf-dvb */
193void *videobuf_queue_to_vmalloc (struct videobuf_queue* q,
194 struct videobuf_buffer *buf);
195
186void videobuf_queue_core_init(struct videobuf_queue *q, 196void videobuf_queue_core_init(struct videobuf_queue *q,
187 struct videobuf_queue_ops *ops, 197 struct videobuf_queue_ops *ops,
188 void *dev, 198 struct device *dev,
189 spinlock_t *irqlock, 199 spinlock_t *irqlock,
190 enum v4l2_buf_type type, 200 enum v4l2_buf_type type,
191 enum v4l2_field field, 201 enum v4l2_field field,
@@ -231,10 +241,4 @@ int videobuf_mmap_free(struct videobuf_queue *q);
231int videobuf_mmap_mapper(struct videobuf_queue *q, 241int videobuf_mmap_mapper(struct videobuf_queue *q,
232 struct vm_area_struct *vma); 242 struct vm_area_struct *vma);
233 243
234/* --------------------------------------------------------------------- */ 244#endif
235
236/*
237 * Local variables:
238 * c-basic-offset: 8
239 * End:
240 */
diff --git a/include/media/videobuf-dma-sg.h b/include/media/videobuf-dma-sg.h
index 38105031db23..be8da269ee33 100644
--- a/include/media/videobuf-dma-sg.h
+++ b/include/media/videobuf-dma-sg.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * helper functions for PCI DMA video4linux capture buffers 2 * helper functions for SG DMA video4linux capture buffers
3 * 3 *
4 * The functions expect the hardware being able to scatter gatter 4 * The functions expect the hardware being able to scatter gatter
5 * (i.e. the buffers are not linear in physical memory, but fragmented 5 * (i.e. the buffers are not linear in physical memory, but fragmented
@@ -68,9 +68,6 @@ struct videobuf_dmabuf {
68 /* for kernel buffers */ 68 /* for kernel buffers */
69 void *vmalloc; 69 void *vmalloc;
70 70
71 /* Stores the userspace pointer to vmalloc area */
72 void *varea;
73
74 /* for overlay buffers (pci-pci dma) */ 71 /* for overlay buffers (pci-pci dma) */
75 dma_addr_t bus_addr; 72 dma_addr_t bus_addr;
76 73
@@ -81,7 +78,7 @@ struct videobuf_dmabuf {
81 int direction; 78 int direction;
82}; 79};
83 80
84struct videbuf_pci_sg_memory 81struct videobuf_dma_sg_memory
85{ 82{
86 u32 magic; 83 u32 magic;
87 84
@@ -103,11 +100,11 @@ int videobuf_dma_sync(struct videobuf_queue* q,struct videobuf_dmabuf *dma);
103int videobuf_dma_unmap(struct videobuf_queue* q,struct videobuf_dmabuf *dma); 100int videobuf_dma_unmap(struct videobuf_queue* q,struct videobuf_dmabuf *dma);
104struct videobuf_dmabuf *videobuf_to_dma (struct videobuf_buffer *buf); 101struct videobuf_dmabuf *videobuf_to_dma (struct videobuf_buffer *buf);
105 102
106void *videobuf_pci_alloc (size_t size); 103void *videobuf_sg_alloc(size_t size);
107 104
108void videobuf_queue_pci_init(struct videobuf_queue* q, 105void videobuf_queue_sg_init(struct videobuf_queue* q,
109 struct videobuf_queue_ops *ops, 106 struct videobuf_queue_ops *ops,
110 void *dev, 107 struct device *dev,
111 spinlock_t *irqlock, 108 spinlock_t *irqlock,
112 enum v4l2_buf_type type, 109 enum v4l2_buf_type type,
113 enum v4l2_field field, 110 enum v4l2_field field,
@@ -117,6 +114,6 @@ void videobuf_queue_pci_init(struct videobuf_queue* q,
117 /*FIXME: these variants are used only on *-alsa code, where videobuf is 114 /*FIXME: these variants are used only on *-alsa code, where videobuf is
118 * used without queue 115 * used without queue
119 */ 116 */
120int videobuf_pci_dma_map(struct pci_dev *pci,struct videobuf_dmabuf *dma); 117int videobuf_sg_dma_map(struct device *dev, struct videobuf_dmabuf *dma);
121int videobuf_pci_dma_unmap(struct pci_dev *pci,struct videobuf_dmabuf *dma); 118int videobuf_sg_dma_unmap(struct device *dev, struct videobuf_dmabuf *dma);
122 119
diff --git a/include/media/videobuf-dvb.h b/include/media/videobuf-dvb.h
index 8233cafdeef6..b77748696329 100644
--- a/include/media/videobuf-dvb.h
+++ b/include/media/videobuf-dvb.h
@@ -27,7 +27,8 @@ struct videobuf_dvb {
27int videobuf_dvb_register(struct videobuf_dvb *dvb, 27int videobuf_dvb_register(struct videobuf_dvb *dvb,
28 struct module *module, 28 struct module *module,
29 void *adapter_priv, 29 void *adapter_priv,
30 struct device *device); 30 struct device *device,
31 short *adapter_nr);
31void videobuf_dvb_unregister(struct videobuf_dvb *dvb); 32void videobuf_dvb_unregister(struct videobuf_dvb *dvb);
32 33
33/* 34/*
diff --git a/include/media/videobuf-vmalloc.h b/include/media/videobuf-vmalloc.h
index ec63ab0fab93..aed39460c154 100644
--- a/include/media/videobuf-vmalloc.h
+++ b/include/media/videobuf-vmalloc.h
@@ -12,6 +12,8 @@
12 * it under the terms of the GNU General Public License as published by 12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 13 * the Free Software Foundation; either version 2
14 */ 14 */
15#ifndef _VIDEOBUF_VMALLOC_H
16#define _VIDEOBUF_VMALLOC_H
15 17
16#include <media/videobuf-core.h> 18#include <media/videobuf-core.h>
17 19
@@ -39,3 +41,5 @@ void videobuf_queue_vmalloc_init(struct videobuf_queue* q,
39void *videobuf_to_vmalloc (struct videobuf_buffer *buf); 41void *videobuf_to_vmalloc (struct videobuf_buffer *buf);
40 42
41void videobuf_vmalloc_free (struct videobuf_buffer *buf); 43void videobuf_vmalloc_free (struct videobuf_buffer *buf);
44
45#endif