aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/Kbuild1
-rw-r--r--include/linux/input.h2
-rw-r--r--include/linux/mfd/wl1273-core.h288
-rw-r--r--include/linux/videodev.h340
-rw-r--r--include/media/bt819.h5
-rw-r--r--include/media/cx2341x.h2
-rw-r--r--include/media/ir-common.h107
-rw-r--r--include/media/ir-core.h214
-rw-r--r--include/media/ir-kbd-i2c.h13
-rw-r--r--include/media/lirc_dev.h6
-rw-r--r--include/media/ovcamchip.h90
-rw-r--r--include/media/rc-core.h220
-rw-r--r--include/media/rc-map.h44
-rw-r--r--include/media/saa6588.h (renamed from include/media/rds.h)18
-rw-r--r--include/media/si4713.h3
-rw-r--r--include/media/soc_camera.h5
-rw-r--r--include/media/timb_radio.h1
-rw-r--r--include/media/timb_video.h33
-rw-r--r--include/media/v4l2-chip-ident.h1
-rw-r--r--include/media/v4l2-common.h6
-rw-r--r--include/media/v4l2-ctrls.h4
-rw-r--r--include/media/v4l2-ioctl.h22
-rw-r--r--include/media/videobuf-core.h8
23 files changed, 604 insertions, 829 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 97319a8fc1e0..a354c199ab98 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -367,7 +367,6 @@ header-y += utime.h
367header-y += utsname.h 367header-y += utsname.h
368header-y += veth.h 368header-y += veth.h
369header-y += vhost.h 369header-y += vhost.h
370header-y += videodev.h
371header-y += videodev2.h 370header-y += videodev2.h
372header-y += virtio_9p.h 371header-y += virtio_9p.h
373header-y += virtio_balloon.h 372header-y += virtio_balloon.h
diff --git a/include/linux/input.h b/include/linux/input.h
index 9777668883be..f7a6e1966df3 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -590,6 +590,8 @@ struct input_keymap_entry {
590#define KEY_FRAMEFORWARD 0x1b5 590#define KEY_FRAMEFORWARD 0x1b5
591#define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */ 591#define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */
592#define KEY_MEDIA_REPEAT 0x1b7 /* Consumer - transport control */ 592#define KEY_MEDIA_REPEAT 0x1b7 /* Consumer - transport control */
593#define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */
594#define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */
593 595
594#define KEY_DEL_EOL 0x1c0 596#define KEY_DEL_EOL 0x1c0
595#define KEY_DEL_EOS 0x1c1 597#define KEY_DEL_EOS 0x1c1
diff --git a/include/linux/mfd/wl1273-core.h b/include/linux/mfd/wl1273-core.h
new file mode 100644
index 000000000000..9787293eae5f
--- /dev/null
+++ b/include/linux/mfd/wl1273-core.h
@@ -0,0 +1,288 @@
1/*
2 * include/linux/mfd/wl1273-core.h
3 *
4 * Some definitions for the wl1273 radio receiver/transmitter chip.
5 *
6 * Copyright (C) 2010 Nokia Corporation
7 * Author: Matti J. Aaltonen <matti.j.aaltonen@nokia.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 */
23
24#ifndef WL1273_CORE_H
25#define WL1273_CORE_H
26
27#include <linux/i2c.h>
28#include <linux/mfd/core.h>
29
30#define WL1273_FM_DRIVER_NAME "wl1273-fm"
31#define RX71_FM_I2C_ADDR 0x22
32
33#define WL1273_STEREO_GET 0
34#define WL1273_RSSI_LVL_GET 1
35#define WL1273_IF_COUNT_GET 2
36#define WL1273_FLAG_GET 3
37#define WL1273_RDS_SYNC_GET 4
38#define WL1273_RDS_DATA_GET 5
39#define WL1273_FREQ_SET 10
40#define WL1273_AF_FREQ_SET 11
41#define WL1273_MOST_MODE_SET 12
42#define WL1273_MOST_BLEND_SET 13
43#define WL1273_DEMPH_MODE_SET 14
44#define WL1273_SEARCH_LVL_SET 15
45#define WL1273_BAND_SET 16
46#define WL1273_MUTE_STATUS_SET 17
47#define WL1273_RDS_PAUSE_LVL_SET 18
48#define WL1273_RDS_PAUSE_DUR_SET 19
49#define WL1273_RDS_MEM_SET 20
50#define WL1273_RDS_BLK_B_SET 21
51#define WL1273_RDS_MSK_B_SET 22
52#define WL1273_RDS_PI_MASK_SET 23
53#define WL1273_RDS_PI_SET 24
54#define WL1273_RDS_SYSTEM_SET 25
55#define WL1273_INT_MASK_SET 26
56#define WL1273_SEARCH_DIR_SET 27
57#define WL1273_VOLUME_SET 28
58#define WL1273_AUDIO_ENABLE 29
59#define WL1273_PCM_MODE_SET 30
60#define WL1273_I2S_MODE_CONFIG_SET 31
61#define WL1273_POWER_SET 32
62#define WL1273_INTX_CONFIG_SET 33
63#define WL1273_PULL_EN_SET 34
64#define WL1273_HILO_SET 35
65#define WL1273_SWITCH2FREF 36
66#define WL1273_FREQ_DRIFT_REPORT 37
67
68#define WL1273_PCE_GET 40
69#define WL1273_FIRM_VER_GET 41
70#define WL1273_ASIC_VER_GET 42
71#define WL1273_ASIC_ID_GET 43
72#define WL1273_MAN_ID_GET 44
73#define WL1273_TUNER_MODE_SET 45
74#define WL1273_STOP_SEARCH 46
75#define WL1273_RDS_CNTRL_SET 47
76
77#define WL1273_WRITE_HARDWARE_REG 100
78#define WL1273_CODE_DOWNLOAD 101
79#define WL1273_RESET 102
80
81#define WL1273_FM_POWER_MODE 254
82#define WL1273_FM_INTERRUPT 255
83
84/* Transmitter API */
85
86#define WL1273_CHANL_SET 55
87#define WL1273_SCAN_SPACING_SET 56
88#define WL1273_REF_SET 57
89#define WL1273_POWER_ENB_SET 90
90#define WL1273_POWER_ATT_SET 58
91#define WL1273_POWER_LEV_SET 59
92#define WL1273_AUDIO_DEV_SET 60
93#define WL1273_PILOT_DEV_SET 61
94#define WL1273_RDS_DEV_SET 62
95#define WL1273_PUPD_SET 91
96#define WL1273_AUDIO_IO_SET 63
97#define WL1273_PREMPH_SET 64
98#define WL1273_MONO_SET 66
99#define WL1273_MUTE 92
100#define WL1273_MPX_LMT_ENABLE 67
101#define WL1273_PI_SET 93
102#define WL1273_ECC_SET 69
103#define WL1273_PTY 70
104#define WL1273_AF 71
105#define WL1273_DISPLAY_MODE 74
106#define WL1273_RDS_REP_SET 77
107#define WL1273_RDS_CONFIG_DATA_SET 98
108#define WL1273_RDS_DATA_SET 99
109#define WL1273_RDS_DATA_ENB 94
110#define WL1273_TA_SET 78
111#define WL1273_TP_SET 79
112#define WL1273_DI_SET 80
113#define WL1273_MS_SET 81
114#define WL1273_PS_SCROLL_SPEED 82
115#define WL1273_TX_AUDIO_LEVEL_TEST 96
116#define WL1273_TX_AUDIO_LEVEL_TEST_THRESHOLD 73
117#define WL1273_TX_AUDIO_INPUT_LEVEL_RANGE_SET 54
118#define WL1273_RX_ANTENNA_SELECT 87
119#define WL1273_I2C_DEV_ADDR_SET 86
120#define WL1273_REF_ERR_CALIB_PARAM_SET 88
121#define WL1273_REF_ERR_CALIB_PERIODICITY_SET 89
122#define WL1273_SOC_INT_TRIGGER 52
123#define WL1273_SOC_AUDIO_PATH_SET 83
124#define WL1273_SOC_PCMI_OVERRIDE 84
125#define WL1273_SOC_I2S_OVERRIDE 85
126#define WL1273_RSSI_BLOCK_SCAN_FREQ_SET 95
127#define WL1273_RSSI_BLOCK_SCAN_START 97
128#define WL1273_RSSI_BLOCK_SCAN_DATA_GET 5
129#define WL1273_READ_FMANT_TUNE_VALUE 104
130
131#define WL1273_RDS_OFF 0
132#define WL1273_RDS_ON 1
133#define WL1273_RDS_RESET 2
134
135#define WL1273_AUDIO_DIGITAL 0
136#define WL1273_AUDIO_ANALOG 1
137
138#define WL1273_MODE_RX BIT(0)
139#define WL1273_MODE_TX BIT(1)
140#define WL1273_MODE_OFF BIT(2)
141#define WL1273_MODE_SUSPENDED BIT(3)
142
143#define WL1273_RADIO_CHILD BIT(0)
144#define WL1273_CODEC_CHILD BIT(1)
145
146#define WL1273_RX_MONO 1
147#define WL1273_RX_STEREO 0
148#define WL1273_TX_MONO 0
149#define WL1273_TX_STEREO 1
150
151#define WL1273_MAX_VOLUME 0xffff
152#define WL1273_DEFAULT_VOLUME 0x78b8
153
154/* I2S protocol, left channel first, data width 16 bits */
155#define WL1273_PCM_DEF_MODE 0x00
156
157/* Rx */
158#define WL1273_AUDIO_ENABLE_I2S BIT(0)
159#define WL1273_AUDIO_ENABLE_ANALOG BIT(1)
160
161/* Tx */
162#define WL1273_AUDIO_IO_SET_ANALOG 0
163#define WL1273_AUDIO_IO_SET_I2S 1
164
165#define WL1273_PUPD_SET_OFF 0x00
166#define WL1273_PUPD_SET_ON 0x01
167#define WL1273_PUPD_SET_RETENTION 0x10
168
169/* I2S mode */
170#define WL1273_IS2_WIDTH_32 0x0
171#define WL1273_IS2_WIDTH_40 0x1
172#define WL1273_IS2_WIDTH_22_23 0x2
173#define WL1273_IS2_WIDTH_23_22 0x3
174#define WL1273_IS2_WIDTH_48 0x4
175#define WL1273_IS2_WIDTH_50 0x5
176#define WL1273_IS2_WIDTH_60 0x6
177#define WL1273_IS2_WIDTH_64 0x7
178#define WL1273_IS2_WIDTH_80 0x8
179#define WL1273_IS2_WIDTH_96 0x9
180#define WL1273_IS2_WIDTH_128 0xa
181#define WL1273_IS2_WIDTH 0xf
182
183#define WL1273_IS2_FORMAT_STD (0x0 << 4)
184#define WL1273_IS2_FORMAT_LEFT (0x1 << 4)
185#define WL1273_IS2_FORMAT_RIGHT (0x2 << 4)
186#define WL1273_IS2_FORMAT_USER (0x3 << 4)
187
188#define WL1273_IS2_MASTER (0x0 << 6)
189#define WL1273_IS2_SLAVEW (0x1 << 6)
190
191#define WL1273_IS2_TRI_AFTER_SENDING (0x0 << 7)
192#define WL1273_IS2_TRI_ALWAYS_ACTIVE (0x1 << 7)
193
194#define WL1273_IS2_SDOWS_RR (0x0 << 8)
195#define WL1273_IS2_SDOWS_RF (0x1 << 8)
196#define WL1273_IS2_SDOWS_FR (0x2 << 8)
197#define WL1273_IS2_SDOWS_FF (0x3 << 8)
198
199#define WL1273_IS2_TRI_OPT (0x0 << 10)
200#define WL1273_IS2_TRI_ALWAYS (0x1 << 10)
201
202#define WL1273_IS2_RATE_48K (0x0 << 12)
203#define WL1273_IS2_RATE_44_1K (0x1 << 12)
204#define WL1273_IS2_RATE_32K (0x2 << 12)
205#define WL1273_IS2_RATE_22_05K (0x4 << 12)
206#define WL1273_IS2_RATE_16K (0x5 << 12)
207#define WL1273_IS2_RATE_12K (0x8 << 12)
208#define WL1273_IS2_RATE_11_025 (0x9 << 12)
209#define WL1273_IS2_RATE_8K (0xa << 12)
210#define WL1273_IS2_RATE (0xf << 12)
211
212#define WL1273_I2S_DEF_MODE (WL1273_IS2_WIDTH_32 | \
213 WL1273_IS2_FORMAT_STD | \
214 WL1273_IS2_MASTER | \
215 WL1273_IS2_TRI_AFTER_SENDING | \
216 WL1273_IS2_SDOWS_RR | \
217 WL1273_IS2_TRI_OPT | \
218 WL1273_IS2_RATE_48K)
219
220#define SCHAR_MIN (-128)
221#define SCHAR_MAX 127
222
223#define WL1273_FR_EVENT BIT(0)
224#define WL1273_BL_EVENT BIT(1)
225#define WL1273_RDS_EVENT BIT(2)
226#define WL1273_BBLK_EVENT BIT(3)
227#define WL1273_LSYNC_EVENT BIT(4)
228#define WL1273_LEV_EVENT BIT(5)
229#define WL1273_IFFR_EVENT BIT(6)
230#define WL1273_PI_EVENT BIT(7)
231#define WL1273_PD_EVENT BIT(8)
232#define WL1273_STIC_EVENT BIT(9)
233#define WL1273_MAL_EVENT BIT(10)
234#define WL1273_POW_ENB_EVENT BIT(11)
235#define WL1273_SCAN_OVER_EVENT BIT(12)
236#define WL1273_ERROR_EVENT BIT(13)
237
238#define TUNER_MODE_STOP_SEARCH 0
239#define TUNER_MODE_PRESET 1
240#define TUNER_MODE_AUTO_SEEK 2
241#define TUNER_MODE_AF 3
242#define TUNER_MODE_AUTO_SEEK_PI 4
243#define TUNER_MODE_AUTO_SEEK_BULK 5
244
245#define RDS_BLOCK_SIZE 3
246
247struct wl1273_fm_platform_data {
248 int (*request_resources) (struct i2c_client *client);
249 void (*free_resources) (void);
250 void (*enable) (void);
251 void (*disable) (void);
252
253 u8 forbidden_modes;
254 unsigned int children;
255};
256
257#define WL1273_FM_CORE_CELLS 2
258
259#define WL1273_BAND_OTHER 0
260#define WL1273_BAND_JAPAN 1
261
262#define WL1273_BAND_JAPAN_LOW 76000
263#define WL1273_BAND_JAPAN_HIGH 90000
264#define WL1273_BAND_OTHER_LOW 87500
265#define WL1273_BAND_OTHER_HIGH 108000
266
267#define WL1273_BAND_TX_LOW 76000
268#define WL1273_BAND_TX_HIGH 108000
269
270struct wl1273_core {
271 struct mfd_cell cells[WL1273_FM_CORE_CELLS];
272 struct wl1273_fm_platform_data *pdata;
273
274 unsigned int mode;
275 unsigned int i2s_mode;
276 unsigned int volume;
277 unsigned int audio_mode;
278 unsigned int channel_number;
279 struct mutex lock; /* for serializing fm radio operations */
280
281 struct i2c_client *client;
282
283 int (*write)(struct wl1273_core *core, u8, u16);
284 int (*set_audio)(struct wl1273_core *core, unsigned int);
285 int (*set_volume)(struct wl1273_core *core, unsigned int);
286};
287
288#endif /* ifndef WL1273_CORE_H */
diff --git a/include/linux/videodev.h b/include/linux/videodev.h
deleted file mode 100644
index b19eab140977..000000000000
--- a/include/linux/videodev.h
+++ /dev/null
@@ -1,340 +0,0 @@
1/*
2 * Video for Linux version 1 - OBSOLETE
3 *
4 * Header file for v4l1 drivers and applications, for
5 * Linux kernels 2.2.x or 2.4.x.
6 *
7 * Provides header for legacy drivers and applications
8 *
9 * See http://linuxtv.org for more info
10 *
11 */
12#ifndef __LINUX_VIDEODEV_H
13#define __LINUX_VIDEODEV_H
14
15#include <linux/types.h>
16#include <linux/ioctl.h>
17#include <linux/videodev2.h>
18
19#if defined(__MIN_V4L1) && defined (__KERNEL__)
20
21/*
22 * Used by those V4L2 core functions that need a minimum V4L1 support,
23 * in order to allow V4L1 Compatibilty code compilation.
24 */
25
26struct video_mbuf
27{
28 int size; /* Total memory to map */
29 int frames; /* Frames */
30 int offsets[VIDEO_MAX_FRAME];
31};
32
33#define VIDIOCGMBUF _IOR('v',20, struct video_mbuf) /* Memory map buffer info */
34
35#else
36#if defined(CONFIG_VIDEO_V4L1_COMPAT) || !defined (__KERNEL__)
37
38#define VID_TYPE_CAPTURE 1 /* Can capture */
39#define VID_TYPE_TUNER 2 /* Can tune */
40#define VID_TYPE_TELETEXT 4 /* Does teletext */
41#define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */
42#define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */
43#define VID_TYPE_CLIPPING 32 /* Can clip */
44#define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */
45#define VID_TYPE_SCALES 128 /* Scalable */
46#define VID_TYPE_MONOCHROME 256 /* Monochrome only */
47#define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */
48#define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */
49#define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */
50#define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */
51#define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */
52
53struct video_capability
54{
55 char name[32];
56 int type;
57 int channels; /* Num channels */
58 int audios; /* Num audio devices */
59 int maxwidth; /* Supported width */
60 int maxheight; /* And height */
61 int minwidth; /* Supported width */
62 int minheight; /* And height */
63};
64
65
66struct video_channel
67{
68 int channel;
69 char name[32];
70 int tuners;
71 __u32 flags;
72#define VIDEO_VC_TUNER 1 /* Channel has a tuner */
73#define VIDEO_VC_AUDIO 2 /* Channel has audio */
74 __u16 type;
75#define VIDEO_TYPE_TV 1
76#define VIDEO_TYPE_CAMERA 2
77 __u16 norm; /* Norm set by channel */
78};
79
80struct video_tuner
81{
82 int tuner;
83 char name[32];
84 unsigned long rangelow, rangehigh; /* Tuner range */
85 __u32 flags;
86#define VIDEO_TUNER_PAL 1
87#define VIDEO_TUNER_NTSC 2
88#define VIDEO_TUNER_SECAM 4
89#define VIDEO_TUNER_LOW 8 /* Uses KHz not MHz */
90#define VIDEO_TUNER_NORM 16 /* Tuner can set norm */
91#define VIDEO_TUNER_STEREO_ON 128 /* Tuner is seeing stereo */
92#define VIDEO_TUNER_RDS_ON 256 /* Tuner is seeing an RDS datastream */
93#define VIDEO_TUNER_MBS_ON 512 /* Tuner is seeing an MBS datastream */
94 __u16 mode; /* PAL/NTSC/SECAM/OTHER */
95#define VIDEO_MODE_PAL 0
96#define VIDEO_MODE_NTSC 1
97#define VIDEO_MODE_SECAM 2
98#define VIDEO_MODE_AUTO 3
99 __u16 signal; /* Signal strength 16bit scale */
100};
101
102struct video_picture
103{
104 __u16 brightness;
105 __u16 hue;
106 __u16 colour;
107 __u16 contrast;
108 __u16 whiteness; /* Black and white only */
109 __u16 depth; /* Capture depth */
110 __u16 palette; /* Palette in use */
111#define VIDEO_PALETTE_GREY 1 /* Linear greyscale */
112#define VIDEO_PALETTE_HI240 2 /* High 240 cube (BT848) */
113#define VIDEO_PALETTE_RGB565 3 /* 565 16 bit RGB */
114#define VIDEO_PALETTE_RGB24 4 /* 24bit RGB */
115#define VIDEO_PALETTE_RGB32 5 /* 32bit RGB */
116#define VIDEO_PALETTE_RGB555 6 /* 555 15bit RGB */
117#define VIDEO_PALETTE_YUV422 7 /* YUV422 capture */
118#define VIDEO_PALETTE_YUYV 8
119#define VIDEO_PALETTE_UYVY 9 /* The great thing about standards is ... */
120#define VIDEO_PALETTE_YUV420 10
121#define VIDEO_PALETTE_YUV411 11 /* YUV411 capture */
122#define VIDEO_PALETTE_RAW 12 /* RAW capture (BT848) */
123#define VIDEO_PALETTE_YUV422P 13 /* YUV 4:2:2 Planar */
124#define VIDEO_PALETTE_YUV411P 14 /* YUV 4:1:1 Planar */
125#define VIDEO_PALETTE_YUV420P 15 /* YUV 4:2:0 Planar */
126#define VIDEO_PALETTE_YUV410P 16 /* YUV 4:1:0 Planar */
127#define VIDEO_PALETTE_PLANAR 13 /* start of planar entries */
128#define VIDEO_PALETTE_COMPONENT 7 /* start of component entries */
129};
130
131struct video_audio
132{
133 int audio; /* Audio channel */
134 __u16 volume; /* If settable */
135 __u16 bass, treble;
136 __u32 flags;
137#define VIDEO_AUDIO_MUTE 1
138#define VIDEO_AUDIO_MUTABLE 2
139#define VIDEO_AUDIO_VOLUME 4
140#define VIDEO_AUDIO_BASS 8
141#define VIDEO_AUDIO_TREBLE 16
142#define VIDEO_AUDIO_BALANCE 32
143 char name[16];
144#define VIDEO_SOUND_MONO 1
145#define VIDEO_SOUND_STEREO 2
146#define VIDEO_SOUND_LANG1 4
147#define VIDEO_SOUND_LANG2 8
148 __u16 mode;
149 __u16 balance; /* Stereo balance */
150 __u16 step; /* Step actual volume uses */
151};
152
153struct video_clip
154{
155 __s32 x,y;
156 __s32 width, height;
157 struct video_clip *next; /* For user use/driver use only */
158};
159
160struct video_window
161{
162 __u32 x,y; /* Position of window */
163 __u32 width,height; /* Its size */
164 __u32 chromakey;
165 __u32 flags;
166 struct video_clip __user *clips; /* Set only */
167 int clipcount;
168#define VIDEO_WINDOW_INTERLACE 1
169#define VIDEO_WINDOW_CHROMAKEY 16 /* Overlay by chromakey */
170#define VIDEO_CLIP_BITMAP -1
171/* bitmap is 1024x625, a '1' bit represents a clipped pixel */
172#define VIDEO_CLIPMAP_SIZE (128 * 625)
173};
174
175struct video_capture
176{
177 __u32 x,y; /* Offsets into image */
178 __u32 width, height; /* Area to capture */
179 __u16 decimation; /* Decimation divider */
180 __u16 flags; /* Flags for capture */
181#define VIDEO_CAPTURE_ODD 0 /* Temporal */
182#define VIDEO_CAPTURE_EVEN 1
183};
184
185struct video_buffer
186{
187 void *base;
188 int height,width;
189 int depth;
190 int bytesperline;
191};
192
193struct video_mmap
194{
195 unsigned int frame; /* Frame (0 - n) for double buffer */
196 int height,width;
197 unsigned int format; /* should be VIDEO_PALETTE_* */
198};
199
200struct video_key
201{
202 __u8 key[8];
203 __u32 flags;
204};
205
206struct video_mbuf
207{
208 int size; /* Total memory to map */
209 int frames; /* Frames */
210 int offsets[VIDEO_MAX_FRAME];
211};
212
213#define VIDEO_NO_UNIT (-1)
214
215struct video_unit
216{
217 int video; /* Video minor */
218 int vbi; /* VBI minor */
219 int radio; /* Radio minor */
220 int audio; /* Audio minor */
221 int teletext; /* Teletext minor */
222};
223
224struct vbi_format {
225 __u32 sampling_rate; /* in Hz */
226 __u32 samples_per_line;
227 __u32 sample_format; /* VIDEO_PALETTE_RAW only (1 byte) */
228 __s32 start[2]; /* starting line for each frame */
229 __u32 count[2]; /* count of lines for each frame */
230 __u32 flags;
231#define VBI_UNSYNC 1 /* can distingues between top/bottom field */
232#define VBI_INTERLACED 2 /* lines are interlaced */
233};
234
235/* video_info is biased towards hardware mpeg encode/decode */
236/* but it could apply generically to any hardware compressor/decompressor */
237struct video_info
238{
239 __u32 frame_count; /* frames output since decode/encode began */
240 __u32 h_size; /* current unscaled horizontal size */
241 __u32 v_size; /* current unscaled veritcal size */
242 __u32 smpte_timecode; /* current SMPTE timecode (for current GOP) */
243 __u32 picture_type; /* current picture type */
244 __u32 temporal_reference; /* current temporal reference */
245 __u8 user_data[256]; /* user data last found in compressed stream */
246 /* user_data[0] contains user data flags, user_data[1] has count */
247};
248
249/* generic structure for setting playback modes */
250struct video_play_mode
251{
252 int mode;
253 int p1;
254 int p2;
255};
256
257/* for loading microcode / fpga programming */
258struct video_code
259{
260 char loadwhat[16]; /* name or tag of file being passed */
261 int datasize;
262 __u8 *data;
263};
264
265#define VIDIOCGCAP _IOR('v',1,struct video_capability) /* Get capabilities */
266#define VIDIOCGCHAN _IOWR('v',2,struct video_channel) /* Get channel info (sources) */
267#define VIDIOCSCHAN _IOW('v',3,struct video_channel) /* Set channel */
268#define VIDIOCGTUNER _IOWR('v',4,struct video_tuner) /* Get tuner abilities */
269#define VIDIOCSTUNER _IOW('v',5,struct video_tuner) /* Tune the tuner for the current channel */
270#define VIDIOCGPICT _IOR('v',6,struct video_picture) /* Get picture properties */
271#define VIDIOCSPICT _IOW('v',7,struct video_picture) /* Set picture properties */
272#define VIDIOCCAPTURE _IOW('v',8,int) /* Start, end capture */
273#define VIDIOCGWIN _IOR('v',9, struct video_window) /* Get the video overlay window */
274#define VIDIOCSWIN _IOW('v',10, struct video_window) /* Set the video overlay window - passes clip list for hardware smarts , chromakey etc */
275#define VIDIOCGFBUF _IOR('v',11, struct video_buffer) /* Get frame buffer */
276#define VIDIOCSFBUF _IOW('v',12, struct video_buffer) /* Set frame buffer - root only */
277#define VIDIOCKEY _IOR('v',13, struct video_key) /* Video key event - to dev 255 is to all - cuts capture on all DMA windows with this key (0xFFFFFFFF == all) */
278#define VIDIOCGFREQ _IOR('v',14, unsigned long) /* Set tuner */
279#define VIDIOCSFREQ _IOW('v',15, unsigned long) /* Set tuner */
280#define VIDIOCGAUDIO _IOR('v',16, struct video_audio) /* Get audio info */
281#define VIDIOCSAUDIO _IOW('v',17, struct video_audio) /* Audio source, mute etc */
282#define VIDIOCSYNC _IOW('v',18, int) /* Sync with mmap grabbing */
283#define VIDIOCMCAPTURE _IOW('v',19, struct video_mmap) /* Grab frames */
284#define VIDIOCGMBUF _IOR('v',20, struct video_mbuf) /* Memory map buffer info */
285#define VIDIOCGUNIT _IOR('v',21, struct video_unit) /* Get attached units */
286#define VIDIOCGCAPTURE _IOR('v',22, struct video_capture) /* Get subcapture */
287#define VIDIOCSCAPTURE _IOW('v',23, struct video_capture) /* Set subcapture */
288#define VIDIOCSPLAYMODE _IOW('v',24, struct video_play_mode) /* Set output video mode/feature */
289#define VIDIOCSWRITEMODE _IOW('v',25, int) /* Set write mode */
290#define VIDIOCGPLAYINFO _IOR('v',26, struct video_info) /* Get current playback info from hardware */
291#define VIDIOCSMICROCODE _IOW('v',27, struct video_code) /* Load microcode into hardware */
292#define VIDIOCGVBIFMT _IOR('v',28, struct vbi_format) /* Get VBI information */
293#define VIDIOCSVBIFMT _IOW('v',29, struct vbi_format) /* Set VBI information */
294
295
296#define BASE_VIDIOCPRIVATE 192 /* 192-255 are private */
297
298/* VIDIOCSWRITEMODE */
299#define VID_WRITE_MPEG_AUD 0
300#define VID_WRITE_MPEG_VID 1
301#define VID_WRITE_OSD 2
302#define VID_WRITE_TTX 3
303#define VID_WRITE_CC 4
304#define VID_WRITE_MJPEG 5
305
306/* VIDIOCSPLAYMODE */
307#define VID_PLAY_VID_OUT_MODE 0
308 /* p1: = VIDEO_MODE_PAL, VIDEO_MODE_NTSC, etc ... */
309#define VID_PLAY_GENLOCK 1
310 /* p1: 0 = OFF, 1 = ON */
311 /* p2: GENLOCK FINE DELAY value */
312#define VID_PLAY_NORMAL 2
313#define VID_PLAY_PAUSE 3
314#define VID_PLAY_SINGLE_FRAME 4
315#define VID_PLAY_FAST_FORWARD 5
316#define VID_PLAY_SLOW_MOTION 6
317#define VID_PLAY_IMMEDIATE_NORMAL 7
318#define VID_PLAY_SWITCH_CHANNELS 8
319#define VID_PLAY_FREEZE_FRAME 9
320#define VID_PLAY_STILL_MODE 10
321#define VID_PLAY_MASTER_MODE 11
322 /* p1: see below */
323#define VID_PLAY_MASTER_NONE 1
324#define VID_PLAY_MASTER_VIDEO 2
325#define VID_PLAY_MASTER_AUDIO 3
326#define VID_PLAY_ACTIVE_SCANLINES 12
327 /* p1 = first active; p2 = last active */
328#define VID_PLAY_RESET 13
329#define VID_PLAY_END_MARK 14
330
331#endif /* CONFIG_VIDEO_V4L1_COMPAT */
332#endif /* __MIN_V4L1 */
333
334#endif /* __LINUX_VIDEODEV_H */
335
336/*
337 * Local variables:
338 * c-basic-offset: 8
339 * End:
340 */
diff --git a/include/media/bt819.h b/include/media/bt819.h
index 38f666bde77a..8025f4bc2bb6 100644
--- a/include/media/bt819.h
+++ b/include/media/bt819.h
@@ -26,7 +26,10 @@
26/* v4l2_device notifications. */ 26/* v4l2_device notifications. */
27 27
28/* Needed to reset the FIFO buffer when changing the input 28/* Needed to reset the FIFO buffer when changing the input
29 or the video standard. */ 29 or the video standard.
30
31 Note: these ioctls that internal to the kernel and are never called
32 from userspace. */
30#define BT819_FIFO_RESET_LOW _IO('b', 0) 33#define BT819_FIFO_RESET_LOW _IO('b', 0)
31#define BT819_FIFO_RESET_HIGH _IO('b', 1) 34#define BT819_FIFO_RESET_HIGH _IO('b', 1)
32 35
diff --git a/include/media/cx2341x.h b/include/media/cx2341x.h
index 8d08ebfe20b7..9635eebaab09 100644
--- a/include/media/cx2341x.h
+++ b/include/media/cx2341x.h
@@ -95,7 +95,7 @@ int cx2341x_update(void *priv, cx2341x_mbox_func func,
95 const struct cx2341x_mpeg_params *new); 95 const struct cx2341x_mpeg_params *new);
96int cx2341x_ctrl_query(const struct cx2341x_mpeg_params *params, 96int cx2341x_ctrl_query(const struct cx2341x_mpeg_params *params,
97 struct v4l2_queryctrl *qctrl); 97 struct v4l2_queryctrl *qctrl);
98const char **cx2341x_ctrl_get_menu(const struct cx2341x_mpeg_params *p, u32 id); 98const char * const *cx2341x_ctrl_get_menu(const struct cx2341x_mpeg_params *p, u32 id);
99int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params, int busy, 99int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params, int busy,
100 struct v4l2_ext_controls *ctrls, unsigned int cmd); 100 struct v4l2_ext_controls *ctrls, unsigned int cmd);
101void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p); 101void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p);
diff --git a/include/media/ir-common.h b/include/media/ir-common.h
deleted file mode 100644
index 528050e39ad9..000000000000
--- a/include/media/ir-common.h
+++ /dev/null
@@ -1,107 +0,0 @@
1/*
2 *
3 * some common structs and functions to handle infrared remotes via
4 * input layer ...
5 *
6 * (c) 2003 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#ifndef _IR_COMMON
24#define _IR_COMMON
25
26#include <linux/input.h>
27#include <linux/workqueue.h>
28#include <linux/interrupt.h>
29#include <media/ir-core.h>
30
31#define RC5_START(x) (((x)>>12)&3)
32#define RC5_TOGGLE(x) (((x)>>11)&1)
33#define RC5_ADDR(x) (((x)>>6)&31)
34#define RC5_INSTR(x) ((x)&63)
35
36struct ir_input_state {
37 /* configuration */
38 u64 ir_type;
39
40 /* key info */
41 u32 ir_key; /* ir scancode */
42 u32 keycode; /* linux key code */
43 int keypressed; /* current state */
44};
45
46/* this was saa7134_ir and bttv_ir, moved here for
47 * rc5 decoding. */
48struct card_ir {
49 struct input_dev *dev;
50 struct ir_input_state ir;
51 char name[32];
52 char phys[32];
53 int users;
54
55 u32 running:1;
56 struct ir_dev_props props;
57
58 /* Usual gpio signalling */
59
60 u32 mask_keycode;
61 u32 mask_keydown;
62 u32 mask_keyup;
63 u32 polling;
64 u32 last_gpio;
65 int shift_by;
66 int start; // What should RC5_START() be
67 int addr; // What RC5_ADDR() should be.
68 int rc5_key_timeout;
69 int rc5_remote_gap;
70 struct work_struct work;
71 struct timer_list timer;
72
73 /* RC5 gpio */
74 u32 rc5_gpio;
75 struct timer_list timer_end; /* timer_end for code completion */
76 struct timer_list timer_keyup; /* timer_end for key release */
77 u32 last_rc5; /* last good rc5 code */
78 u32 last_bit; /* last raw bit seen */
79 u32 code; /* raw code under construction */
80 struct timeval base_time; /* time of last seen code */
81 int active; /* building raw code */
82
83 /* NEC decoding */
84 u32 nec_gpio;
85 struct tasklet_struct tlet;
86
87 /* IR core raw decoding */
88 u32 raw_decode;
89};
90
91/* Routines from ir-functions.c */
92
93int ir_input_init(struct input_dev *dev, struct ir_input_state *ir,
94 const u64 ir_type);
95void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir);
96void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir,
97 u32 ir_key);
98u32 ir_extract_bits(u32 data, u32 mask);
99int ir_dump_samples(u32 *samples, int count);
100int ir_decode_biphase(u32 *samples, int count, int low, int high);
101int ir_decode_pulsedistance(u32 *samples, int count, int low, int high);
102u32 ir_rc5_decode(unsigned int code);
103
104void ir_rc5_timer_end(unsigned long data);
105void ir_rc5_timer_keyup(unsigned long data);
106
107#endif
diff --git a/include/media/ir-core.h b/include/media/ir-core.h
deleted file mode 100644
index 6dc37fae6606..000000000000
--- a/include/media/ir-core.h
+++ /dev/null
@@ -1,214 +0,0 @@
1/*
2 * Remote Controller core header
3 *
4 * Copyright (C) 2009-2010 by Mauro Carvalho Chehab <mchehab@redhat.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#ifndef _IR_CORE
17#define _IR_CORE
18
19#include <linux/spinlock.h>
20#include <linux/kfifo.h>
21#include <linux/time.h>
22#include <linux/timer.h>
23#include <media/rc-map.h>
24
25extern int ir_core_debug;
26#define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \
27 printk(KERN_DEBUG "%s: " fmt , __func__, ## arg)
28
29enum rc_driver_type {
30 RC_DRIVER_SCANCODE = 0, /* Driver or hardware generates a scancode */
31 RC_DRIVER_IR_RAW, /* Needs a Infra-Red pulse/space decoder */
32};
33
34/**
35 * struct ir_dev_props - Allow caller drivers to set special properties
36 * @driver_type: specifies if the driver or hardware have already a decoder,
37 * or if it needs to use the IR raw event decoders to produce a scancode
38 * @allowed_protos: bitmask with the supported IR_TYPE_* protocols
39 * @scanmask: some hardware decoders are not capable of providing the full
40 * scancode to the application. As this is a hardware limit, we can't do
41 * anything with it. Yet, as the same keycode table can be used with other
42 * devices, a mask is provided to allow its usage. Drivers should generally
43 * leave this field in blank
44 * @timeout: optional time after which device stops sending data
45 * @min_timeout: minimum timeout supported by device
46 * @max_timeout: maximum timeout supported by device
47 * @rx_resolution : resolution (in ns) of input sampler
48 * @tx_resolution: resolution (in ns) of output sampler
49 * @priv: driver-specific data, to be used on the callbacks
50 * @change_protocol: allow changing the protocol used on hardware decoders
51 * @open: callback to allow drivers to enable polling/irq when IR input device
52 * is opened.
53 * @close: callback to allow drivers to disable polling/irq when IR input device
54 * is opened.
55 * @s_tx_mask: set transmitter mask (for devices with multiple tx outputs)
56 * @s_tx_carrier: set transmit carrier frequency
57 * @s_tx_duty_cycle: set transmit duty cycle (0% - 100%)
58 * @s_rx_carrier: inform driver about carrier it is expected to handle
59 * @tx_ir: transmit IR
60 * @s_idle: optional: enable/disable hardware idle mode, upon which,
61 device doesn't interrupt host until it sees IR pulses
62 * @s_learning_mode: enable wide band receiver used for learning
63 * @s_carrier_report: enable carrier reports
64 */
65struct ir_dev_props {
66 enum rc_driver_type driver_type;
67 unsigned long allowed_protos;
68 u32 scanmask;
69
70 u32 timeout;
71 u32 min_timeout;
72 u32 max_timeout;
73
74 u32 rx_resolution;
75 u32 tx_resolution;
76
77 void *priv;
78 int (*change_protocol)(void *priv, u64 ir_type);
79 int (*open)(void *priv);
80 void (*close)(void *priv);
81 int (*s_tx_mask)(void *priv, u32 mask);
82 int (*s_tx_carrier)(void *priv, u32 carrier);
83 int (*s_tx_duty_cycle)(void *priv, u32 duty_cycle);
84 int (*s_rx_carrier_range)(void *priv, u32 min, u32 max);
85 int (*tx_ir)(void *priv, int *txbuf, u32 n);
86 void (*s_idle)(void *priv, bool enable);
87 int (*s_learning_mode)(void *priv, int enable);
88 int (*s_carrier_report) (void *priv, int enable);
89};
90
91struct ir_input_dev {
92 struct device dev; /* device */
93 char *driver_name; /* Name of the driver module */
94 struct ir_scancode_table rc_tab; /* scan/key table */
95 unsigned long devno; /* device number */
96 struct ir_dev_props *props; /* Device properties */
97 struct ir_raw_event_ctrl *raw; /* for raw pulse/space events */
98 struct input_dev *input_dev; /* the input device associated with this device */
99 bool idle;
100
101 /* key info - needed by IR keycode handlers */
102 spinlock_t keylock; /* protects the below members */
103 bool keypressed; /* current state */
104 unsigned long keyup_jiffies; /* when should the current keypress be released? */
105 struct timer_list timer_keyup; /* timer for releasing a keypress */
106 u32 last_keycode; /* keycode of last command */
107 u32 last_scancode; /* scancode of last command */
108 u8 last_toggle; /* toggle of last command */
109};
110
111enum raw_event_type {
112 IR_SPACE = (1 << 0),
113 IR_PULSE = (1 << 1),
114 IR_START_EVENT = (1 << 2),
115 IR_STOP_EVENT = (1 << 3),
116};
117
118#define to_ir_input_dev(_attr) container_of(_attr, struct ir_input_dev, attr)
119
120/* From ir-keytable.c */
121int __ir_input_register(struct input_dev *dev,
122 const struct ir_scancode_table *ir_codes,
123 struct ir_dev_props *props,
124 const char *driver_name);
125
126static inline int ir_input_register(struct input_dev *dev,
127 const char *map_name,
128 struct ir_dev_props *props,
129 const char *driver_name) {
130 struct ir_scancode_table *ir_codes;
131 struct ir_input_dev *ir_dev;
132 int rc;
133
134 if (!map_name)
135 return -EINVAL;
136
137 ir_codes = get_rc_map(map_name);
138 if (!ir_codes) {
139 ir_codes = get_rc_map(RC_MAP_EMPTY);
140
141 if (!ir_codes)
142 return -EINVAL;
143 }
144
145 rc = __ir_input_register(dev, ir_codes, props, driver_name);
146 if (rc < 0)
147 return -EINVAL;
148
149 ir_dev = input_get_drvdata(dev);
150
151 if (!rc && ir_dev->props && ir_dev->props->change_protocol)
152 rc = ir_dev->props->change_protocol(ir_dev->props->priv,
153 ir_codes->ir_type);
154
155 return rc;
156}
157
158void ir_input_unregister(struct input_dev *input_dev);
159
160void ir_repeat(struct input_dev *dev);
161void ir_keydown(struct input_dev *dev, int scancode, u8 toggle);
162void ir_keyup(struct ir_input_dev *ir);
163u32 ir_g_keycode_from_table(struct input_dev *input_dev, u32 scancode);
164
165/* From ir-raw-event.c */
166
167struct ir_raw_event {
168 union {
169 u32 duration;
170
171 struct {
172 u32 carrier;
173 u8 duty_cycle;
174 };
175 };
176
177 unsigned pulse:1;
178 unsigned reset:1;
179 unsigned timeout:1;
180 unsigned carrier_report:1;
181};
182
183#define DEFINE_IR_RAW_EVENT(event) \
184 struct ir_raw_event event = { \
185 { .duration = 0 } , \
186 .pulse = 0, \
187 .reset = 0, \
188 .timeout = 0, \
189 .carrier_report = 0 }
190
191static inline void init_ir_raw_event(struct ir_raw_event *ev)
192{
193 memset(ev, 0, sizeof(*ev));
194}
195
196#define IR_MAX_DURATION 0xFFFFFFFF /* a bit more than 4 seconds */
197
198void ir_raw_event_handle(struct input_dev *input_dev);
199int ir_raw_event_store(struct input_dev *input_dev, struct ir_raw_event *ev);
200int ir_raw_event_store_edge(struct input_dev *input_dev, enum raw_event_type type);
201int ir_raw_event_store_with_filter(struct input_dev *input_dev,
202 struct ir_raw_event *ev);
203void ir_raw_event_set_idle(struct input_dev *input_dev, bool idle);
204
205static inline void ir_raw_event_reset(struct input_dev *input_dev)
206{
207 DEFINE_IR_RAW_EVENT(ev);
208 ev.reset = true;
209
210 ir_raw_event_store(input_dev, &ev);
211 ir_raw_event_handle(input_dev);
212}
213
214#endif /* _IR_CORE */
diff --git a/include/media/ir-kbd-i2c.h b/include/media/ir-kbd-i2c.h
index 557c676ab7dc..768aa77925cd 100644
--- a/include/media/ir-kbd-i2c.h
+++ b/include/media/ir-kbd-i2c.h
@@ -1,7 +1,7 @@
1#ifndef _IR_I2C 1#ifndef _IR_I2C
2#define _IR_I2C 2#define _IR_I2C
3 3
4#include <media/ir-common.h> 4#include <media/rc-core.h>
5 5
6#define DEFAULT_POLLING_INTERVAL 100 /* ms */ 6#define DEFAULT_POLLING_INTERVAL 100 /* ms */
7 7
@@ -9,11 +9,9 @@ struct IR_i2c;
9 9
10struct IR_i2c { 10struct IR_i2c {
11 char *ir_codes; 11 char *ir_codes;
12
13 struct i2c_client *c; 12 struct i2c_client *c;
14 struct input_dev *input; 13 struct rc_dev *rc;
15 struct ir_input_state ir; 14
16 u64 ir_type;
17 /* Used to avoid fast repeating */ 15 /* Used to avoid fast repeating */
18 unsigned char old; 16 unsigned char old;
19 17
@@ -39,13 +37,16 @@ enum ir_kbd_get_key_fn {
39struct IR_i2c_init_data { 37struct IR_i2c_init_data {
40 char *ir_codes; 38 char *ir_codes;
41 const char *name; 39 const char *name;
42 u64 type; /* IR_TYPE_RC5, etc */ 40 u64 type; /* RC_TYPE_RC5, etc */
43 u32 polling_interval; /* 0 means DEFAULT_POLLING_INTERVAL */ 41 u32 polling_interval; /* 0 means DEFAULT_POLLING_INTERVAL */
42
44 /* 43 /*
45 * Specify either a function pointer or a value indicating one of 44 * Specify either a function pointer or a value indicating one of
46 * ir_kbd_i2c's internal get_key functions 45 * ir_kbd_i2c's internal get_key functions
47 */ 46 */
48 int (*get_key)(struct IR_i2c*, u32*, u32*); 47 int (*get_key)(struct IR_i2c*, u32*, u32*);
49 enum ir_kbd_get_key_fn internal_get_key_func; 48 enum ir_kbd_get_key_fn internal_get_key_func;
49
50 struct rc_dev *rc_dev;
50}; 51};
51#endif 52#endif
diff --git a/include/media/lirc_dev.h b/include/media/lirc_dev.h
index 54780a560d0e..630e702c9511 100644
--- a/include/media/lirc_dev.h
+++ b/include/media/lirc_dev.h
@@ -217,9 +217,9 @@ int lirc_dev_fop_open(struct inode *inode, struct file *file);
217int lirc_dev_fop_close(struct inode *inode, struct file *file); 217int lirc_dev_fop_close(struct inode *inode, struct file *file);
218unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait); 218unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait);
219long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg); 219long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
220ssize_t lirc_dev_fop_read(struct file *file, char *buffer, size_t length, 220ssize_t lirc_dev_fop_read(struct file *file, char __user *buffer, size_t length,
221 loff_t *ppos); 221 loff_t *ppos);
222ssize_t lirc_dev_fop_write(struct file *file, const char *buffer, size_t length, 222ssize_t lirc_dev_fop_write(struct file *file, const char __user *buffer,
223 loff_t *ppos); 223 size_t length, loff_t *ppos);
224 224
225#endif 225#endif
diff --git a/include/media/ovcamchip.h b/include/media/ovcamchip.h
deleted file mode 100644
index 05b9569ef1c8..000000000000
--- a/include/media/ovcamchip.h
+++ /dev/null
@@ -1,90 +0,0 @@
1/* OmniVision* camera chip driver API
2 *
3 * Copyright (c) 1999-2004 Mark McClelland
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. NO WARRANTY OF ANY KIND is expressed or implied.
9 *
10 * * OmniVision is a trademark of OmniVision Technologies, Inc. This driver
11 * is not sponsored or developed by them.
12 */
13
14#ifndef __LINUX_OVCAMCHIP_H
15#define __LINUX_OVCAMCHIP_H
16
17#include <linux/videodev.h>
18#include <media/v4l2-common.h>
19
20/* --------------------------------- */
21/* ENUMERATIONS */
22/* --------------------------------- */
23
24/* Controls */
25enum {
26 OVCAMCHIP_CID_CONT, /* Contrast */
27 OVCAMCHIP_CID_BRIGHT, /* Brightness */
28 OVCAMCHIP_CID_SAT, /* Saturation */
29 OVCAMCHIP_CID_HUE, /* Hue */
30 OVCAMCHIP_CID_EXP, /* Exposure */
31 OVCAMCHIP_CID_FREQ, /* Light frequency */
32 OVCAMCHIP_CID_BANDFILT, /* Banding filter */
33 OVCAMCHIP_CID_AUTOBRIGHT, /* Auto brightness */
34 OVCAMCHIP_CID_AUTOEXP, /* Auto exposure */
35 OVCAMCHIP_CID_BACKLIGHT, /* Back light compensation */
36 OVCAMCHIP_CID_MIRROR, /* Mirror horizontally */
37};
38
39/* Chip types */
40#define NUM_CC_TYPES 9
41enum {
42 CC_UNKNOWN,
43 CC_OV76BE,
44 CC_OV7610,
45 CC_OV7620,
46 CC_OV7620AE,
47 CC_OV6620,
48 CC_OV6630,
49 CC_OV6630AE,
50 CC_OV6630AF,
51};
52
53/* --------------------------------- */
54/* I2C ADDRESSES */
55/* --------------------------------- */
56
57#define OV7xx0_SID (0x42 >> 1)
58#define OV6xx0_SID (0xC0 >> 1)
59
60/* --------------------------------- */
61/* API */
62/* --------------------------------- */
63
64struct ovcamchip_control {
65 __u32 id;
66 __s32 value;
67};
68
69struct ovcamchip_window {
70 int x;
71 int y;
72 int width;
73 int height;
74 int format;
75 int quarter; /* Scale width and height down 2x */
76
77 /* This stuff will be removed eventually */
78 int clockdiv; /* Clock divisor setting */
79};
80
81/* Commands */
82#define OVCAMCHIP_CMD_Q_SUBTYPE _IOR (0x88, 0x00, int)
83#define OVCAMCHIP_CMD_INITIALIZE _IOW (0x88, 0x01, int)
84/* You must call OVCAMCHIP_CMD_INITIALIZE before any of commands below! */
85#define OVCAMCHIP_CMD_S_CTRL _IOW (0x88, 0x02, struct ovcamchip_control)
86#define OVCAMCHIP_CMD_G_CTRL _IOWR (0x88, 0x03, struct ovcamchip_control)
87#define OVCAMCHIP_CMD_S_MODE _IOW (0x88, 0x04, struct ovcamchip_window)
88#define OVCAMCHIP_MAX_CMD _IO (0x88, 0x3f)
89
90#endif
diff --git a/include/media/rc-core.h b/include/media/rc-core.h
new file mode 100644
index 000000000000..a23c1fc685a1
--- /dev/null
+++ b/include/media/rc-core.h
@@ -0,0 +1,220 @@
1/*
2 * Remote Controller core header
3 *
4 * Copyright (C) 2009-2010 by Mauro Carvalho Chehab <mchehab@redhat.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#ifndef _RC_CORE
17#define _RC_CORE
18
19#include <linux/spinlock.h>
20#include <linux/kfifo.h>
21#include <linux/time.h>
22#include <linux/timer.h>
23#include <media/rc-map.h>
24
25extern int rc_core_debug;
26#define IR_dprintk(level, fmt, arg...) if (rc_core_debug >= level) \
27 printk(KERN_DEBUG "%s: " fmt , __func__, ## arg)
28
29enum rc_driver_type {
30 RC_DRIVER_SCANCODE = 0, /* Driver or hardware generates a scancode */
31 RC_DRIVER_IR_RAW, /* Needs a Infra-Red pulse/space decoder */
32};
33
34/**
35 * struct rc_dev - represents a remote control device
36 * @dev: driver model's view of this device
37 * @input_name: name of the input child device
38 * @input_phys: physical path to the input child device
39 * @input_id: id of the input child device (struct input_id)
40 * @driver_name: name of the hardware driver which registered this device
41 * @map_name: name of the default keymap
42 * @rc_map: current scan/key table
43 * @devno: unique remote control device number
44 * @raw: additional data for raw pulse/space devices
45 * @input_dev: the input child device used to communicate events to userspace
46 * @driver_type: specifies if protocol decoding is done in hardware or software
47 * @idle: used to keep track of RX state
48 * @allowed_protos: bitmask with the supported RC_TYPE_* protocols
49 * @scanmask: some hardware decoders are not capable of providing the full
50 * scancode to the application. As this is a hardware limit, we can't do
51 * anything with it. Yet, as the same keycode table can be used with other
52 * devices, a mask is provided to allow its usage. Drivers should generally
53 * leave this field in blank
54 * @priv: driver-specific data
55 * @keylock: protects the remaining members of the struct
56 * @keypressed: whether a key is currently pressed
57 * @keyup_jiffies: time (in jiffies) when the current keypress should be released
58 * @timer_keyup: timer for releasing a keypress
59 * @last_keycode: keycode of last keypress
60 * @last_scancode: scancode of last keypress
61 * @last_toggle: toggle value of last command
62 * @timeout: optional time after which device stops sending data
63 * @min_timeout: minimum timeout supported by device
64 * @max_timeout: maximum timeout supported by device
65 * @rx_resolution : resolution (in ns) of input sampler
66 * @tx_resolution: resolution (in ns) of output sampler
67 * @change_protocol: allow changing the protocol used on hardware decoders
68 * @open: callback to allow drivers to enable polling/irq when IR input device
69 * is opened.
70 * @close: callback to allow drivers to disable polling/irq when IR input device
71 * is opened.
72 * @s_tx_mask: set transmitter mask (for devices with multiple tx outputs)
73 * @s_tx_carrier: set transmit carrier frequency
74 * @s_tx_duty_cycle: set transmit duty cycle (0% - 100%)
75 * @s_rx_carrier: inform driver about carrier it is expected to handle
76 * @tx_ir: transmit IR
77 * @s_idle: enable/disable hardware idle mode, upon which,
78 * device doesn't interrupt host until it sees IR pulses
79 * @s_learning_mode: enable wide band receiver used for learning
80 * @s_carrier_report: enable carrier reports
81 */
82struct rc_dev {
83 struct device dev;
84 const char *input_name;
85 const char *input_phys;
86 struct input_id input_id;
87 char *driver_name;
88 const char *map_name;
89 struct rc_map rc_map;
90 unsigned long devno;
91 struct ir_raw_event_ctrl *raw;
92 struct input_dev *input_dev;
93 enum rc_driver_type driver_type;
94 bool idle;
95 u64 allowed_protos;
96 u32 scanmask;
97 void *priv;
98 spinlock_t keylock;
99 bool keypressed;
100 unsigned long keyup_jiffies;
101 struct timer_list timer_keyup;
102 u32 last_keycode;
103 u32 last_scancode;
104 u8 last_toggle;
105 u32 timeout;
106 u32 min_timeout;
107 u32 max_timeout;
108 u32 rx_resolution;
109 u32 tx_resolution;
110 int (*change_protocol)(struct rc_dev *dev, u64 rc_type);
111 int (*open)(struct rc_dev *dev);
112 void (*close)(struct rc_dev *dev);
113 int (*s_tx_mask)(struct rc_dev *dev, u32 mask);
114 int (*s_tx_carrier)(struct rc_dev *dev, u32 carrier);
115 int (*s_tx_duty_cycle)(struct rc_dev *dev, u32 duty_cycle);
116 int (*s_rx_carrier_range)(struct rc_dev *dev, u32 min, u32 max);
117 int (*tx_ir)(struct rc_dev *dev, int *txbuf, u32 n);
118 void (*s_idle)(struct rc_dev *dev, bool enable);
119 int (*s_learning_mode)(struct rc_dev *dev, int enable);
120 int (*s_carrier_report) (struct rc_dev *dev, int enable);
121};
122
123#define to_rc_dev(d) container_of(d, struct rc_dev, dev)
124
125/*
126 * From rc-main.c
127 * Those functions can be used on any type of Remote Controller. They
128 * basically creates an input_dev and properly reports the device as a
129 * Remote Controller, at sys/class/rc.
130 */
131
132struct rc_dev *rc_allocate_device(void);
133void rc_free_device(struct rc_dev *dev);
134int rc_register_device(struct rc_dev *dev);
135void rc_unregister_device(struct rc_dev *dev);
136
137void rc_repeat(struct rc_dev *dev);
138void rc_keydown(struct rc_dev *dev, int scancode, u8 toggle);
139void rc_keydown_notimeout(struct rc_dev *dev, int scancode, u8 toggle);
140void rc_keyup(struct rc_dev *dev);
141u32 rc_g_keycode_from_table(struct rc_dev *dev, u32 scancode);
142
143/*
144 * From rc-raw.c
145 * The Raw interface is specific to InfraRed. It may be a good idea to
146 * split it later into a separate header.
147 */
148
149enum raw_event_type {
150 IR_SPACE = (1 << 0),
151 IR_PULSE = (1 << 1),
152 IR_START_EVENT = (1 << 2),
153 IR_STOP_EVENT = (1 << 3),
154};
155
156struct ir_raw_event {
157 union {
158 u32 duration;
159
160 struct {
161 u32 carrier;
162 u8 duty_cycle;
163 };
164 };
165
166 unsigned pulse:1;
167 unsigned reset:1;
168 unsigned timeout:1;
169 unsigned carrier_report:1;
170};
171
172#define DEFINE_IR_RAW_EVENT(event) \
173 struct ir_raw_event event = { \
174 { .duration = 0 } , \
175 .pulse = 0, \
176 .reset = 0, \
177 .timeout = 0, \
178 .carrier_report = 0 }
179
180static inline void init_ir_raw_event(struct ir_raw_event *ev)
181{
182 memset(ev, 0, sizeof(*ev));
183}
184
185#define IR_MAX_DURATION 0xFFFFFFFF /* a bit more than 4 seconds */
186
187void ir_raw_event_handle(struct rc_dev *dev);
188int ir_raw_event_store(struct rc_dev *dev, struct ir_raw_event *ev);
189int ir_raw_event_store_edge(struct rc_dev *dev, enum raw_event_type type);
190int ir_raw_event_store_with_filter(struct rc_dev *dev,
191 struct ir_raw_event *ev);
192void ir_raw_event_set_idle(struct rc_dev *dev, bool idle);
193
194static inline void ir_raw_event_reset(struct rc_dev *dev)
195{
196 DEFINE_IR_RAW_EVENT(ev);
197 ev.reset = true;
198
199 ir_raw_event_store(dev, &ev);
200 ir_raw_event_handle(dev);
201}
202
203/* extract mask bits out of data and pack them into the result */
204static inline u32 ir_extract_bits(u32 data, u32 mask)
205{
206 u32 vbit = 1, value = 0;
207
208 do {
209 if (mask & 1) {
210 if (data & 1)
211 value |= vbit;
212 vbit <<= 1;
213 }
214 data >>= 1;
215 } while (mask >>= 1);
216
217 return value;
218}
219
220#endif /* _RC_CORE */
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index e0f17edf38ed..ee9e2f747c76 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -11,45 +11,45 @@
11 11
12#include <linux/input.h> 12#include <linux/input.h>
13 13
14#define IR_TYPE_UNKNOWN 0 14#define RC_TYPE_UNKNOWN 0
15#define IR_TYPE_RC5 (1 << 0) /* Philips RC5 protocol */ 15#define RC_TYPE_RC5 (1 << 0) /* Philips RC5 protocol */
16#define IR_TYPE_NEC (1 << 1) 16#define RC_TYPE_NEC (1 << 1)
17#define IR_TYPE_RC6 (1 << 2) /* Philips RC6 protocol */ 17#define RC_TYPE_RC6 (1 << 2) /* Philips RC6 protocol */
18#define IR_TYPE_JVC (1 << 3) /* JVC protocol */ 18#define RC_TYPE_JVC (1 << 3) /* JVC protocol */
19#define IR_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */ 19#define RC_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */
20#define IR_TYPE_RC5_SZ (1 << 5) /* RC5 variant used by Streamzap */ 20#define RC_TYPE_RC5_SZ (1 << 5) /* RC5 variant used by Streamzap */
21#define IR_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */ 21#define RC_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */
22#define IR_TYPE_OTHER (1u << 31) 22#define RC_TYPE_OTHER (1u << 31)
23 23
24#define IR_TYPE_ALL (IR_TYPE_RC5 | IR_TYPE_NEC | IR_TYPE_RC6 | \ 24#define RC_TYPE_ALL (RC_TYPE_RC5 | RC_TYPE_NEC | RC_TYPE_RC6 | \
25 IR_TYPE_JVC | IR_TYPE_SONY | IR_TYPE_LIRC | \ 25 RC_TYPE_JVC | RC_TYPE_SONY | RC_TYPE_LIRC | \
26 IR_TYPE_RC5_SZ | IR_TYPE_OTHER) 26 RC_TYPE_RC5_SZ | RC_TYPE_OTHER)
27 27
28struct ir_scancode { 28struct rc_map_table {
29 u32 scancode; 29 u32 scancode;
30 u32 keycode; 30 u32 keycode;
31}; 31};
32 32
33struct ir_scancode_table { 33struct rc_map {
34 struct ir_scancode *scan; 34 struct rc_map_table *scan;
35 unsigned int size; /* Max number of entries */ 35 unsigned int size; /* Max number of entries */
36 unsigned int len; /* Used number of entries */ 36 unsigned int len; /* Used number of entries */
37 unsigned int alloc; /* Size of *scan in bytes */ 37 unsigned int alloc; /* Size of *scan in bytes */
38 u64 ir_type; 38 u64 rc_type;
39 const char *name; 39 const char *name;
40 spinlock_t lock; 40 spinlock_t lock;
41}; 41};
42 42
43struct rc_keymap { 43struct rc_map_list {
44 struct list_head list; 44 struct list_head list;
45 struct ir_scancode_table map; 45 struct rc_map map;
46}; 46};
47 47
48/* Routines from rc-map.c */ 48/* Routines from rc-map.c */
49 49
50int ir_register_map(struct rc_keymap *map); 50int rc_map_register(struct rc_map_list *map);
51void ir_unregister_map(struct rc_keymap *map); 51void rc_map_unregister(struct rc_map_list *map);
52struct ir_scancode_table *get_rc_map(const char *name); 52struct rc_map *rc_map_get(const char *name);
53void rc_map_init(void); 53void rc_map_init(void);
54 54
55/* Names of the several keytables defined in-kernel */ 55/* Names of the several keytables defined in-kernel */
@@ -119,6 +119,7 @@ void rc_map_init(void);
119#define RC_MAP_PINNACLE_PCTV_HD "rc-pinnacle-pctv-hd" 119#define RC_MAP_PINNACLE_PCTV_HD "rc-pinnacle-pctv-hd"
120#define RC_MAP_PIXELVIEW_NEW "rc-pixelview-new" 120#define RC_MAP_PIXELVIEW_NEW "rc-pixelview-new"
121#define RC_MAP_PIXELVIEW "rc-pixelview" 121#define RC_MAP_PIXELVIEW "rc-pixelview"
122#define RC_MAP_PIXELVIEW_002T "rc-pixelview-002t"
122#define RC_MAP_PIXELVIEW_MK12 "rc-pixelview-mk12" 123#define RC_MAP_PIXELVIEW_MK12 "rc-pixelview-mk12"
123#define RC_MAP_POWERCOLOR_REAL_ANGEL "rc-powercolor-real-angel" 124#define RC_MAP_POWERCOLOR_REAL_ANGEL "rc-powercolor-real-angel"
124#define RC_MAP_PROTEUS_2309 "rc-proteus-2309" 125#define RC_MAP_PROTEUS_2309 "rc-proteus-2309"
@@ -137,6 +138,7 @@ void rc_map_init(void);
137#define RC_MAP_TREKSTOR "rc-trekstor" 138#define RC_MAP_TREKSTOR "rc-trekstor"
138#define RC_MAP_TT_1500 "rc-tt-1500" 139#define RC_MAP_TT_1500 "rc-tt-1500"
139#define RC_MAP_TWINHAN_VP1027_DVBS "rc-twinhan1027" 140#define RC_MAP_TWINHAN_VP1027_DVBS "rc-twinhan1027"
141#define RC_MAP_VIDEOMATE_M1F "rc-videomate-m1f"
140#define RC_MAP_VIDEOMATE_S350 "rc-videomate-s350" 142#define RC_MAP_VIDEOMATE_S350 "rc-videomate-s350"
141#define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr" 143#define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr"
142#define RC_MAP_WINFAST "rc-winfast" 144#define RC_MAP_WINFAST "rc-winfast"
diff --git a/include/media/rds.h b/include/media/saa6588.h
index a89426667618..2c3c4420a4eb 100644
--- a/include/media/rds.h
+++ b/include/media/saa6588.h
@@ -4,9 +4,6 @@
4 saa6588.c and every driver (e.g. bttv-driver.c) that wants 4 saa6588.c and every driver (e.g. bttv-driver.c) that wants
5 to use the saa6588 module. 5 to use the saa6588 module.
6 6
7 Instead of having a separate rds.h, I'd prefer to include
8 this stuff in one of the already existing files like tuner.h
9
10 (c) 2005 by Hans J. Koch 7 (c) 2005 by Hans J. Koch
11 8
12 This program is free software; you can redistribute it and/or modify 9 This program is free software; you can redistribute it and/or modify
@@ -25,10 +22,10 @@
25 22
26*/ 23*/
27 24
28#ifndef _RDS_H 25#ifndef _SAA6588_H
29#define _RDS_H 26#define _SAA6588_H
30 27
31struct rds_command { 28struct saa6588_command {
32 unsigned int block_count; 29 unsigned int block_count;
33 int result; 30 int result;
34 unsigned char __user *buffer; 31 unsigned char __user *buffer;
@@ -36,9 +33,10 @@ struct rds_command {
36 poll_table *event_list; 33 poll_table *event_list;
37}; 34};
38 35
39#define RDS_CMD_OPEN _IOW('R',1,int) 36/* These ioctls are internal to the kernel */
40#define RDS_CMD_CLOSE _IOW('R',2,int) 37#define SAA6588_CMD_OPEN _IOW('R', 1, int)
41#define RDS_CMD_READ _IOR('R',3,int) 38#define SAA6588_CMD_CLOSE _IOW('R', 2, int)
42#define RDS_CMD_POLL _IOR('R',4,int) 39#define SAA6588_CMD_READ _IOR('R', 3, int)
40#define SAA6588_CMD_POLL _IOR('R', 4, int)
43 41
44#endif 42#endif
diff --git a/include/media/si4713.h b/include/media/si4713.h
index 99850a54ed09..ed7353e8a982 100644
--- a/include/media/si4713.h
+++ b/include/media/si4713.h
@@ -23,8 +23,7 @@
23 * Platform dependent definition 23 * Platform dependent definition
24 */ 24 */
25struct si4713_platform_data { 25struct si4713_platform_data {
26 /* Set power state, zero is off, non-zero is on. */ 26 int gpio_reset; /* < 0 if not used */
27 int (*set_power)(int power);
28}; 27};
29 28
30/* 29/*
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index 86e3631764ef..9386db829fb7 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -97,6 +97,7 @@ struct soc_camera_host_ops {
97#define SOCAM_SENSOR_INVERT_DATA (1 << 4) 97#define SOCAM_SENSOR_INVERT_DATA (1 << 4)
98 98
99struct i2c_board_info; 99struct i2c_board_info;
100struct regulator_bulk_data;
100 101
101struct soc_camera_link { 102struct soc_camera_link {
102 /* Camera bus id, used to match a camera and a bus */ 103 /* Camera bus id, used to match a camera and a bus */
@@ -108,6 +109,10 @@ struct soc_camera_link {
108 const char *module_name; 109 const char *module_name;
109 void *priv; 110 void *priv;
110 111
112 /* Optional regulators that have to be managed on power on/off events */
113 struct regulator_bulk_data *regulators;
114 int num_regulators;
115
111 /* 116 /*
112 * For non-I2C devices platform platform has to provide methods to 117 * For non-I2C devices platform platform has to provide methods to
113 * add a device to the system and to remove 118 * add a device to the system and to remove
diff --git a/include/media/timb_radio.h b/include/media/timb_radio.h
index fcd32a3696ba..a59a84854dc1 100644
--- a/include/media/timb_radio.h
+++ b/include/media/timb_radio.h
@@ -24,7 +24,6 @@
24struct timb_radio_platform_data { 24struct timb_radio_platform_data {
25 int i2c_adapter; /* I2C adapter where the tuner and dsp are attached */ 25 int i2c_adapter; /* I2C adapter where the tuner and dsp are attached */
26 struct { 26 struct {
27 const char *module_name;
28 struct i2c_board_info *info; 27 struct i2c_board_info *info;
29 } tuner; 28 } tuner;
30 struct { 29 struct {
diff --git a/include/media/timb_video.h b/include/media/timb_video.h
new file mode 100644
index 000000000000..70ae43970a49
--- /dev/null
+++ b/include/media/timb_video.h
@@ -0,0 +1,33 @@
1/*
2 * timb_video.h Platform struct for the Timberdale video driver
3 * Copyright (c) 2009-2010 Intel Corporation
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19#ifndef _TIMB_VIDEO_
20#define _TIMB_VIDEO_ 1
21
22#include <linux/i2c.h>
23
24struct timb_video_platform_data {
25 int dma_channel;
26 int i2c_adapter; /* The I2C adapter where the encoder is attached */
27 struct {
28 const char *module_name;
29 struct i2c_board_info *info;
30 } encoder;
31};
32
33#endif
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h
index 51e89f2267b8..44fe44ec9ea7 100644
--- a/include/media/v4l2-chip-ident.h
+++ b/include/media/v4l2-chip-ident.h
@@ -74,6 +74,7 @@ enum {
74 V4L2_IDENT_SOI968 = 256, 74 V4L2_IDENT_SOI968 = 256,
75 V4L2_IDENT_OV9640 = 257, 75 V4L2_IDENT_OV9640 = 257,
76 V4L2_IDENT_OV6650 = 258, 76 V4L2_IDENT_OV6650 = 258,
77 V4L2_IDENT_OV2640 = 259,
77 78
78 /* module saa7146: reserved range 300-309 */ 79 /* module saa7146: reserved range 300-309 */
79 V4L2_IDENT_SAA7146 = 300, 80 V4L2_IDENT_SAA7146 = 300,
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 239125af3ea3..2d65b35cdab2 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -98,12 +98,12 @@ int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority local);
98/* Control helper functions */ 98/* Control helper functions */
99 99
100int v4l2_ctrl_check(struct v4l2_ext_control *ctrl, struct v4l2_queryctrl *qctrl, 100int v4l2_ctrl_check(struct v4l2_ext_control *ctrl, struct v4l2_queryctrl *qctrl,
101 const char **menu_items); 101 const char * const *menu_items);
102const char *v4l2_ctrl_get_name(u32 id); 102const char *v4l2_ctrl_get_name(u32 id);
103const char **v4l2_ctrl_get_menu(u32 id); 103const char * const *v4l2_ctrl_get_menu(u32 id);
104int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 step, s32 def); 104int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 step, s32 def);
105int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu, 105int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu,
106 struct v4l2_queryctrl *qctrl, const char **menu_items); 106 struct v4l2_queryctrl *qctrl, const char * const *menu_items);
107#define V4L2_CTRL_MENU_IDS_END (0xffffffff) 107#define V4L2_CTRL_MENU_IDS_END (0xffffffff)
108int v4l2_ctrl_query_menu_valid_items(struct v4l2_querymenu *qmenu, const u32 *ids); 108int v4l2_ctrl_query_menu_valid_items(struct v4l2_querymenu *qmenu, const u32 *ids);
109 109
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index 9b7bea928a88..d69ab4aae032 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -112,7 +112,7 @@ struct v4l2_ctrl {
112 u32 step; 112 u32 step;
113 u32 menu_skip_mask; 113 u32 menu_skip_mask;
114 }; 114 };
115 const char **qmenu; 115 const char * const *qmenu;
116 unsigned long flags; 116 unsigned long flags;
117 union { 117 union {
118 s32 val; 118 s32 val;
@@ -202,7 +202,7 @@ struct v4l2_ctrl_config {
202 s32 def; 202 s32 def;
203 u32 flags; 203 u32 flags;
204 u32 menu_skip_mask; 204 u32 menu_skip_mask;
205 const char **qmenu; 205 const char * const *qmenu;
206 unsigned int is_private:1; 206 unsigned int is_private:1;
207 unsigned int is_volatile:1; 207 unsigned int is_volatile:1;
208}; 208};
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index 06daa6e8e051..67df37542c68 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -14,12 +14,7 @@
14#include <linux/device.h> 14#include <linux/device.h>
15#include <linux/mutex.h> 15#include <linux/mutex.h>
16#include <linux/compiler.h> /* need __user */ 16#include <linux/compiler.h> /* need __user */
17#ifdef CONFIG_VIDEO_V4L1_COMPAT
18#define __MIN_V4L1
19#include <linux/videodev.h>
20#else
21#include <linux/videodev2.h> 17#include <linux/videodev2.h>
22#endif
23 18
24struct v4l2_fh; 19struct v4l2_fh;
25 20
@@ -113,10 +108,6 @@ struct v4l2_ioctl_ops {
113 108
114 109
115 int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i); 110 int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i);
116#ifdef CONFIG_VIDEO_V4L1_COMPAT
117 /* buffer type is struct vidio_mbuf * */
118 int (*vidiocgmbuf) (struct file *file, void *fh, struct video_mbuf *p);
119#endif
120 int (*vidioc_g_fbuf) (struct file *file, void *fh, 111 int (*vidioc_g_fbuf) (struct file *file, void *fh,
121 struct v4l2_framebuffer *a); 112 struct v4l2_framebuffer *a);
122 int (*vidioc_s_fbuf) (struct file *file, void *fh, 113 int (*vidioc_s_fbuf) (struct file *file, void *fh,
@@ -300,22 +291,15 @@ extern void v4l_printk_ioctl(unsigned int cmd);
300extern const char *v4l2_field_names[]; 291extern const char *v4l2_field_names[];
301extern const char *v4l2_type_names[]; 292extern const char *v4l2_type_names[];
302 293
303/* Compatibility layer interface -- v4l1-compat module */
304typedef long (*v4l2_kioctl)(struct file *file,
305 unsigned int cmd, void *arg);
306#ifdef CONFIG_VIDEO_V4L1_COMPAT
307long v4l_compat_translate_ioctl(struct file *file,
308 int cmd, void *arg, v4l2_kioctl driver_ioctl);
309#else
310#define v4l_compat_translate_ioctl(file, cmd, arg, ioctl) (-EINVAL)
311#endif
312
313#ifdef CONFIG_COMPAT 294#ifdef CONFIG_COMPAT
314/* 32 Bits compatibility layer for 64 bits processors */ 295/* 32 Bits compatibility layer for 64 bits processors */
315extern long v4l2_compat_ioctl32(struct file *file, unsigned int cmd, 296extern long v4l2_compat_ioctl32(struct file *file, unsigned int cmd,
316 unsigned long arg); 297 unsigned long arg);
317#endif 298#endif
318 299
300typedef long (*v4l2_kioctl)(struct file *file,
301 unsigned int cmd, void *arg);
302
319/* Include support for obsoleted stuff */ 303/* Include support for obsoleted stuff */
320extern long video_usercopy(struct file *file, unsigned int cmd, 304extern long video_usercopy(struct file *file, unsigned int cmd,
321 unsigned long arg, v4l2_kioctl func); 305 unsigned long arg, v4l2_kioctl func);
diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h
index 1d3835fc26be..90ed895e217d 100644
--- a/include/media/videobuf-core.h
+++ b/include/media/videobuf-core.h
@@ -17,10 +17,6 @@
17#define _VIDEOBUF_CORE_H 17#define _VIDEOBUF_CORE_H
18 18
19#include <linux/poll.h> 19#include <linux/poll.h>
20#ifdef CONFIG_VIDEO_V4L1_COMPAT
21#define __MIN_V4L1
22#include <linux/videodev.h>
23#endif
24#include <linux/videodev2.h> 20#include <linux/videodev2.h>
25 21
26#define UNSET (-1U) 22#define UNSET (-1U)
@@ -212,10 +208,6 @@ int videobuf_qbuf(struct videobuf_queue *q,
212 struct v4l2_buffer *b); 208 struct v4l2_buffer *b);
213int videobuf_dqbuf(struct videobuf_queue *q, 209int videobuf_dqbuf(struct videobuf_queue *q,
214 struct v4l2_buffer *b, int nonblocking); 210 struct v4l2_buffer *b, int nonblocking);
215#ifdef CONFIG_VIDEO_V4L1_COMPAT
216int videobuf_cgmbuf(struct videobuf_queue *q,
217 struct video_mbuf *mbuf, int count);
218#endif
219int videobuf_streamon(struct videobuf_queue *q); 211int videobuf_streamon(struct videobuf_queue *q);
220int videobuf_streamoff(struct videobuf_queue *q); 212int videobuf_streamoff(struct videobuf_queue *q);
221 213