aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-28 12:35:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-28 12:35:11 -0400
commit0851668fdd97e526b2a41f794b785c204dd3d3e0 (patch)
tree4ef7c20a8be8393006c6fe9627eb29dd30877d61 /include/media
parent00ebb6382b8d9c7c15b5f8ad230670d8161d38dd (diff)
parent7655e594945289b418af39f6669fea4666a7b520 (diff)
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (505 commits) [media] af9015: Fix max I2C message size when used with tda18271 [media] IR: initialize ir_raw_event in few more drivers [media] Guard a divide in v4l1 compat layer [media] imon: fix nomouse modprobe option [media] imon: remove redundant change_protocol call [media] imon: fix my egregious brown paper bag w/rdev/idev split [media] cafe_ccic: Configure ov7670 correctly [media] ov7670: allow configuration of image size, clock speed, and I/O method [media] af9015: support for DigitalNow TinyTwin v3 [1f4d:9016] [media] af9015: map DigitalNow TinyTwin v2 remote [media] DigitalNow TinyTwin remote controller [media] af9015: RC fixes and improvements videodev2.h.xml: Update to reflect the latest changes at videodev2.h [media] v4l: document new Bayer and monochrome pixel formats [media] DocBook/v4l: Add missing formats used on gspca cpia1 and sn9c2028 [media] firedtv: add parameter to fake ca_system_ids in CA_INFO [media] tm6000: fix a macro coding style issue tm6000: Remove some ugly debug code [media] Nova-S-Plus audio line input [media] [RFC,1/1] V4L2: Use new CAP bits in existing RDS capable drivers ...
Diffstat (limited to 'include/media')
-rw-r--r--include/media/ir-core.h41
-rw-r--r--include/media/ir-kbd-i2c.h10
-rw-r--r--include/media/lirc_dev.h6
-rw-r--r--include/media/omap1_camera.h35
-rw-r--r--include/media/rc-map.h19
-rw-r--r--include/media/s3c_fimc.h60
-rw-r--r--include/media/sh_vou.h1
-rw-r--r--include/media/soc_camera.h9
-rw-r--r--include/media/sr030pc30.h21
-rw-r--r--include/media/v4l2-chip-ident.h8
-rw-r--r--include/media/v4l2-common.h10
-rw-r--r--include/media/v4l2-dev.h8
-rw-r--r--include/media/v4l2-device.h57
-rw-r--r--include/media/v4l2-i2c-drv.h80
-rw-r--r--include/media/v4l2-mediabus.h8
-rw-r--r--include/media/v4l2-subdev.h24
-rw-r--r--include/media/videobuf-core.h19
-rw-r--r--include/media/videobuf-dma-contig.h3
-rw-r--r--include/media/videobuf-dma-sg.h3
-rw-r--r--include/media/videobuf-vmalloc.h3
-rw-r--r--include/media/wm8775.h3
21 files changed, 293 insertions, 135 deletions
diff --git a/include/media/ir-core.h b/include/media/ir-core.h
index eb7fddf8f607..6dc37fae6606 100644
--- a/include/media/ir-core.h
+++ b/include/media/ir-core.h
@@ -60,6 +60,7 @@ enum rc_driver_type {
60 * @s_idle: optional: enable/disable hardware idle mode, upon which, 60 * @s_idle: optional: enable/disable hardware idle mode, upon which,
61 device doesn't interrupt host until it sees IR pulses 61 device doesn't interrupt host until it sees IR pulses
62 * @s_learning_mode: enable wide band receiver used for learning 62 * @s_learning_mode: enable wide band receiver used for learning
63 * @s_carrier_report: enable carrier reports
63 */ 64 */
64struct ir_dev_props { 65struct ir_dev_props {
65 enum rc_driver_type driver_type; 66 enum rc_driver_type driver_type;
@@ -82,8 +83,9 @@ struct ir_dev_props {
82 int (*s_tx_duty_cycle)(void *priv, u32 duty_cycle); 83 int (*s_tx_duty_cycle)(void *priv, u32 duty_cycle);
83 int (*s_rx_carrier_range)(void *priv, u32 min, u32 max); 84 int (*s_rx_carrier_range)(void *priv, u32 min, u32 max);
84 int (*tx_ir)(void *priv, int *txbuf, u32 n); 85 int (*tx_ir)(void *priv, int *txbuf, u32 n);
85 void (*s_idle)(void *priv, int enable); 86 void (*s_idle)(void *priv, bool enable);
86 int (*s_learning_mode)(void *priv, int enable); 87 int (*s_learning_mode)(void *priv, int enable);
88 int (*s_carrier_report) (void *priv, int enable);
87}; 89};
88 90
89struct ir_input_dev { 91struct ir_input_dev {
@@ -157,27 +159,54 @@ void ir_input_unregister(struct input_dev *input_dev);
157 159
158void ir_repeat(struct input_dev *dev); 160void ir_repeat(struct input_dev *dev);
159void ir_keydown(struct input_dev *dev, int scancode, u8 toggle); 161void ir_keydown(struct input_dev *dev, int scancode, u8 toggle);
162void ir_keyup(struct ir_input_dev *ir);
160u32 ir_g_keycode_from_table(struct input_dev *input_dev, u32 scancode); 163u32 ir_g_keycode_from_table(struct input_dev *input_dev, u32 scancode);
161 164
162/* From ir-raw-event.c */ 165/* From ir-raw-event.c */
163 166
164struct ir_raw_event { 167struct ir_raw_event {
165 unsigned pulse:1; 168 union {
166 unsigned duration:31; 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;
167}; 181};
168 182
169#define IR_MAX_DURATION 0x7FFFFFFF /* a bit more than 2 seconds */ 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 */
170 197
171void ir_raw_event_handle(struct input_dev *input_dev); 198void ir_raw_event_handle(struct input_dev *input_dev);
172int ir_raw_event_store(struct input_dev *input_dev, struct ir_raw_event *ev); 199int ir_raw_event_store(struct input_dev *input_dev, struct ir_raw_event *ev);
173int ir_raw_event_store_edge(struct input_dev *input_dev, enum raw_event_type type); 200int ir_raw_event_store_edge(struct input_dev *input_dev, enum raw_event_type type);
174int ir_raw_event_store_with_filter(struct input_dev *input_dev, 201int ir_raw_event_store_with_filter(struct input_dev *input_dev,
175 struct ir_raw_event *ev); 202 struct ir_raw_event *ev);
176void ir_raw_event_set_idle(struct input_dev *input_dev, int idle); 203void ir_raw_event_set_idle(struct input_dev *input_dev, bool idle);
177 204
178static inline void ir_raw_event_reset(struct input_dev *input_dev) 205static inline void ir_raw_event_reset(struct input_dev *input_dev)
179{ 206{
180 struct ir_raw_event ev = { .pulse = false, .duration = 0 }; 207 DEFINE_IR_RAW_EVENT(ev);
208 ev.reset = true;
209
181 ir_raw_event_store(input_dev, &ev); 210 ir_raw_event_store(input_dev, &ev);
182 ir_raw_event_handle(input_dev); 211 ir_raw_event_handle(input_dev);
183} 212}
diff --git a/include/media/ir-kbd-i2c.h b/include/media/ir-kbd-i2c.h
index 5e96d7a430be..557c676ab7dc 100644
--- a/include/media/ir-kbd-i2c.h
+++ b/include/media/ir-kbd-i2c.h
@@ -3,6 +3,8 @@
3 3
4#include <media/ir-common.h> 4#include <media/ir-common.h>
5 5
6#define DEFAULT_POLLING_INTERVAL 100 /* ms */
7
6struct IR_i2c; 8struct IR_i2c;
7 9
8struct IR_i2c { 10struct IR_i2c {
@@ -15,6 +17,8 @@ struct IR_i2c {
15 /* Used to avoid fast repeating */ 17 /* Used to avoid fast repeating */
16 unsigned char old; 18 unsigned char old;
17 19
20 u32 polling_interval; /* in ms */
21
18 struct delayed_work work; 22 struct delayed_work work;
19 char name[32]; 23 char name[32];
20 char phys[32]; 24 char phys[32];
@@ -24,7 +28,6 @@ struct IR_i2c {
24enum ir_kbd_get_key_fn { 28enum ir_kbd_get_key_fn {
25 IR_KBD_GET_KEY_CUSTOM = 0, 29 IR_KBD_GET_KEY_CUSTOM = 0,
26 IR_KBD_GET_KEY_PIXELVIEW, 30 IR_KBD_GET_KEY_PIXELVIEW,
27 IR_KBD_GET_KEY_PV951,
28 IR_KBD_GET_KEY_HAUP, 31 IR_KBD_GET_KEY_HAUP,
29 IR_KBD_GET_KEY_KNC1, 32 IR_KBD_GET_KEY_KNC1,
30 IR_KBD_GET_KEY_FUSIONHDTV, 33 IR_KBD_GET_KEY_FUSIONHDTV,
@@ -35,8 +38,9 @@ enum ir_kbd_get_key_fn {
35/* Can be passed when instantiating an ir_video i2c device */ 38/* Can be passed when instantiating an ir_video i2c device */
36struct IR_i2c_init_data { 39struct IR_i2c_init_data {
37 char *ir_codes; 40 char *ir_codes;
38 const char *name; 41 const char *name;
39 u64 type; /* IR_TYPE_RC5, etc */ 42 u64 type; /* IR_TYPE_RC5, etc */
43 u32 polling_interval; /* 0 means DEFAULT_POLLING_INTERVAL */
40 /* 44 /*
41 * Specify either a function pointer or a value indicating one of 45 * Specify either a function pointer or a value indicating one of
42 * ir_kbd_i2c's internal get_key functions 46 * ir_kbd_i2c's internal get_key functions
diff --git a/include/media/lirc_dev.h b/include/media/lirc_dev.h
index b1f60663cb39..54780a560d0e 100644
--- a/include/media/lirc_dev.h
+++ b/include/media/lirc_dev.h
@@ -125,10 +125,10 @@ static inline unsigned int lirc_buffer_write(struct lirc_buffer *buf,
125struct lirc_driver { 125struct lirc_driver {
126 char name[40]; 126 char name[40];
127 int minor; 127 int minor;
128 unsigned long code_length; 128 __u32 code_length;
129 unsigned int buffer_size; /* in chunks holding one code each */ 129 unsigned int buffer_size; /* in chunks holding one code each */
130 int sample_rate; 130 int sample_rate;
131 unsigned long features; 131 __u32 features;
132 132
133 unsigned int chunk_size; 133 unsigned int chunk_size;
134 134
@@ -139,7 +139,7 @@ struct lirc_driver {
139 struct lirc_buffer *rbuf; 139 struct lirc_buffer *rbuf;
140 int (*set_use_inc) (void *data); 140 int (*set_use_inc) (void *data);
141 void (*set_use_dec) (void *data); 141 void (*set_use_dec) (void *data);
142 struct file_operations *fops; 142 const struct file_operations *fops;
143 struct device *dev; 143 struct device *dev;
144 struct module *owner; 144 struct module *owner;
145}; 145};
diff --git a/include/media/omap1_camera.h b/include/media/omap1_camera.h
new file mode 100644
index 000000000000..819767cf04d4
--- /dev/null
+++ b/include/media/omap1_camera.h
@@ -0,0 +1,35 @@
1/*
2 * Header for V4L2 SoC Camera driver for OMAP1 Camera Interface
3 *
4 * Copyright (C) 2010, Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
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 version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __MEDIA_OMAP1_CAMERA_H_
12#define __MEDIA_OMAP1_CAMERA_H_
13
14#include <linux/bitops.h>
15
16#define OMAP1_CAMERA_IOSIZE 0x1c
17
18enum omap1_cam_vb_mode {
19 OMAP1_CAM_DMA_CONTIG = 0,
20 OMAP1_CAM_DMA_SG,
21};
22
23#define OMAP1_CAMERA_MIN_BUF_COUNT(x) ((x) == OMAP1_CAM_DMA_CONTIG ? 3 : 2)
24
25struct omap1_cam_platform_data {
26 unsigned long camexclk_khz;
27 unsigned long lclk_khz_max;
28 unsigned long flags;
29};
30
31#define OMAP1_CAMERA_LCLK_RISING BIT(0)
32#define OMAP1_CAMERA_RST_LOW BIT(1)
33#define OMAP1_CAMERA_RST_HIGH BIT(2)
34
35#endif /* __MEDIA_OMAP1_CAMERA_H_ */
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index 9b201ec8dc7f..e0f17edf38ed 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -17,12 +17,13 @@
17#define IR_TYPE_RC6 (1 << 2) /* Philips RC6 protocol */ 17#define IR_TYPE_RC6 (1 << 2) /* Philips RC6 protocol */
18#define IR_TYPE_JVC (1 << 3) /* JVC protocol */ 18#define IR_TYPE_JVC (1 << 3) /* JVC protocol */
19#define IR_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */ 19#define IR_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */
20#define IR_TYPE_RC5_SZ (1 << 5) /* RC5 variant used by Streamzap */
20#define IR_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */ 21#define IR_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */
21#define IR_TYPE_OTHER (1u << 31) 22#define IR_TYPE_OTHER (1u << 31)
22 23
23#define IR_TYPE_ALL (IR_TYPE_RC5 | IR_TYPE_NEC | IR_TYPE_RC6 | \ 24#define IR_TYPE_ALL (IR_TYPE_RC5 | IR_TYPE_NEC | IR_TYPE_RC6 | \
24 IR_TYPE_JVC | IR_TYPE_SONY | IR_TYPE_LIRC | \ 25 IR_TYPE_JVC | IR_TYPE_SONY | IR_TYPE_LIRC | \
25 IR_TYPE_OTHER) 26 IR_TYPE_RC5_SZ | IR_TYPE_OTHER)
26 27
27struct ir_scancode { 28struct ir_scancode {
28 u32 scancode; 29 u32 scancode;
@@ -54,6 +55,8 @@ void rc_map_init(void);
54/* Names of the several keytables defined in-kernel */ 55/* Names of the several keytables defined in-kernel */
55 56
56#define RC_MAP_ADSTECH_DVB_T_PCI "rc-adstech-dvb-t-pci" 57#define RC_MAP_ADSTECH_DVB_T_PCI "rc-adstech-dvb-t-pci"
58#define RC_MAP_ALINK_DTU_M "rc-alink-dtu-m"
59#define RC_MAP_ANYSEE "rc-anysee"
57#define RC_MAP_APAC_VIEWCOMP "rc-apac-viewcomp" 60#define RC_MAP_APAC_VIEWCOMP "rc-apac-viewcomp"
58#define RC_MAP_ASUS_PC39 "rc-asus-pc39" 61#define RC_MAP_ASUS_PC39 "rc-asus-pc39"
59#define RC_MAP_ATI_TV_WONDER_HD_600 "rc-ati-tv-wonder-hd-600" 62#define RC_MAP_ATI_TV_WONDER_HD_600 "rc-ati-tv-wonder-hd-600"
@@ -62,8 +65,10 @@ void rc_map_init(void);
62#define RC_MAP_AVERMEDIA_DVBT "rc-avermedia-dvbt" 65#define RC_MAP_AVERMEDIA_DVBT "rc-avermedia-dvbt"
63#define RC_MAP_AVERMEDIA_M135A "rc-avermedia-m135a" 66#define RC_MAP_AVERMEDIA_M135A "rc-avermedia-m135a"
64#define RC_MAP_AVERMEDIA_M733A_RM_K6 "rc-avermedia-m733a-rm-k6" 67#define RC_MAP_AVERMEDIA_M733A_RM_K6 "rc-avermedia-m733a-rm-k6"
68#define RC_MAP_AVERMEDIA_RM_KS "rc-avermedia-rm-ks"
65#define RC_MAP_AVERMEDIA "rc-avermedia" 69#define RC_MAP_AVERMEDIA "rc-avermedia"
66#define RC_MAP_AVERTV_303 "rc-avertv-303" 70#define RC_MAP_AVERTV_303 "rc-avertv-303"
71#define RC_MAP_AZUREWAVE_AD_TU700 "rc-azurewave-ad-tu700"
67#define RC_MAP_BEHOLD_COLUMBUS "rc-behold-columbus" 72#define RC_MAP_BEHOLD_COLUMBUS "rc-behold-columbus"
68#define RC_MAP_BEHOLD "rc-behold" 73#define RC_MAP_BEHOLD "rc-behold"
69#define RC_MAP_BUDGET_CI_OLD "rc-budget-ci-old" 74#define RC_MAP_BUDGET_CI_OLD "rc-budget-ci-old"
@@ -71,6 +76,8 @@ void rc_map_init(void);
71#define RC_MAP_CINERGY "rc-cinergy" 76#define RC_MAP_CINERGY "rc-cinergy"
72#define RC_MAP_DIB0700_NEC_TABLE "rc-dib0700-nec" 77#define RC_MAP_DIB0700_NEC_TABLE "rc-dib0700-nec"
73#define RC_MAP_DIB0700_RC5_TABLE "rc-dib0700-rc5" 78#define RC_MAP_DIB0700_RC5_TABLE "rc-dib0700-rc5"
79#define RC_MAP_DIGITALNOW_TINYTWIN "rc-digitalnow-tinytwin"
80#define RC_MAP_DIGITTRADE "rc-digittrade"
74#define RC_MAP_DM1105_NEC "rc-dm1105-nec" 81#define RC_MAP_DM1105_NEC "rc-dm1105-nec"
75#define RC_MAP_DNTV_LIVE_DVBT_PRO "rc-dntv-live-dvbt-pro" 82#define RC_MAP_DNTV_LIVE_DVBT_PRO "rc-dntv-live-dvbt-pro"
76#define RC_MAP_DNTV_LIVE_DVB_T "rc-dntv-live-dvb-t" 83#define RC_MAP_DNTV_LIVE_DVB_T "rc-dntv-live-dvb-t"
@@ -94,8 +101,12 @@ void rc_map_init(void);
94#define RC_MAP_KAIOMY "rc-kaiomy" 101#define RC_MAP_KAIOMY "rc-kaiomy"
95#define RC_MAP_KWORLD_315U "rc-kworld-315u" 102#define RC_MAP_KWORLD_315U "rc-kworld-315u"
96#define RC_MAP_KWORLD_PLUS_TV_ANALOG "rc-kworld-plus-tv-analog" 103#define RC_MAP_KWORLD_PLUS_TV_ANALOG "rc-kworld-plus-tv-analog"
104#define RC_MAP_LEADTEK_Y04G0051 "rc-leadtek-y04g0051"
97#define RC_MAP_LIRC "rc-lirc" 105#define RC_MAP_LIRC "rc-lirc"
106#define RC_MAP_LME2510 "rc-lme2510"
98#define RC_MAP_MANLI "rc-manli" 107#define RC_MAP_MANLI "rc-manli"
108#define RC_MAP_MSI_DIGIVOX_II "rc-msi-digivox-ii"
109#define RC_MAP_MSI_DIGIVOX_III "rc-msi-digivox-iii"
99#define RC_MAP_MSI_TVANYWHERE_PLUS "rc-msi-tvanywhere-plus" 110#define RC_MAP_MSI_TVANYWHERE_PLUS "rc-msi-tvanywhere-plus"
100#define RC_MAP_MSI_TVANYWHERE "rc-msi-tvanywhere" 111#define RC_MAP_MSI_TVANYWHERE "rc-msi-tvanywhere"
101#define RC_MAP_NEBULA "rc-nebula" 112#define RC_MAP_NEBULA "rc-nebula"
@@ -114,14 +125,18 @@ void rc_map_init(void);
114#define RC_MAP_PURPLETV "rc-purpletv" 125#define RC_MAP_PURPLETV "rc-purpletv"
115#define RC_MAP_PV951 "rc-pv951" 126#define RC_MAP_PV951 "rc-pv951"
116#define RC_MAP_RC5_HAUPPAUGE_NEW "rc-rc5-hauppauge-new" 127#define RC_MAP_RC5_HAUPPAUGE_NEW "rc-rc5-hauppauge-new"
117#define RC_MAP_RC5_STREAMZAP "rc-rc5-streamzap"
118#define RC_MAP_RC5_TV "rc-rc5-tv" 128#define RC_MAP_RC5_TV "rc-rc5-tv"
119#define RC_MAP_RC6_MCE "rc-rc6-mce" 129#define RC_MAP_RC6_MCE "rc-rc6-mce"
120#define RC_MAP_REAL_AUDIO_220_32_KEYS "rc-real-audio-220-32-keys" 130#define RC_MAP_REAL_AUDIO_220_32_KEYS "rc-real-audio-220-32-keys"
131#define RC_MAP_STREAMZAP "rc-streamzap"
121#define RC_MAP_TBS_NEC "rc-tbs-nec" 132#define RC_MAP_TBS_NEC "rc-tbs-nec"
122#define RC_MAP_TERRATEC_CINERGY_XS "rc-terratec-cinergy-xs" 133#define RC_MAP_TERRATEC_CINERGY_XS "rc-terratec-cinergy-xs"
134#define RC_MAP_TERRATEC_SLIM "rc-terratec-slim"
123#define RC_MAP_TEVII_NEC "rc-tevii-nec" 135#define RC_MAP_TEVII_NEC "rc-tevii-nec"
136#define RC_MAP_TOTAL_MEDIA_IN_HAND "rc-total-media-in-hand"
137#define RC_MAP_TREKSTOR "rc-trekstor"
124#define RC_MAP_TT_1500 "rc-tt-1500" 138#define RC_MAP_TT_1500 "rc-tt-1500"
139#define RC_MAP_TWINHAN_VP1027_DVBS "rc-twinhan1027"
125#define RC_MAP_VIDEOMATE_S350 "rc-videomate-s350" 140#define RC_MAP_VIDEOMATE_S350 "rc-videomate-s350"
126#define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr" 141#define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr"
127#define RC_MAP_WINFAST "rc-winfast" 142#define RC_MAP_WINFAST "rc-winfast"
diff --git a/include/media/s3c_fimc.h b/include/media/s3c_fimc.h
new file mode 100644
index 000000000000..ca1b6738e4a4
--- /dev/null
+++ b/include/media/s3c_fimc.h
@@ -0,0 +1,60 @@
1/*
2 * Samsung S5P SoC camera interface driver header
3 *
4 * Copyright (c) 2010 Samsung Electronics Co., Ltd
5 * Author: Sylwester Nawrocki, <s.nawrocki@samsung.com>
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 S3C_FIMC_H_
13#define S3C_FIMC_H_
14
15enum cam_bus_type {
16 FIMC_ITU_601 = 1,
17 FIMC_ITU_656,
18 FIMC_MIPI_CSI2,
19 FIMC_LCD_WB, /* FIFO link from LCD mixer */
20};
21
22#define FIMC_CLK_INV_PCLK (1 << 0)
23#define FIMC_CLK_INV_VSYNC (1 << 1)
24#define FIMC_CLK_INV_HREF (1 << 2)
25#define FIMC_CLK_INV_HSYNC (1 << 3)
26
27struct i2c_board_info;
28
29/**
30 * struct s3c_fimc_isp_info - image sensor information required for host
31 * interace configuration.
32 *
33 * @board_info: pointer to I2C subdevice's board info
34 * @bus_type: determines bus type, MIPI, ITU-R BT.601 etc.
35 * @i2c_bus_num: i2c control bus id the sensor is attached to
36 * @mux_id: FIMC camera interface multiplexer index (separate for MIPI and ITU)
37 * @bus_width: camera data bus width in bits
38 * @flags: flags defining bus signals polarity inversion (High by default)
39 */
40struct s3c_fimc_isp_info {
41 struct i2c_board_info *board_info;
42 enum cam_bus_type bus_type;
43 u16 i2c_bus_num;
44 u16 mux_id;
45 u16 bus_width;
46 u16 flags;
47};
48
49
50#define FIMC_MAX_CAMIF_CLIENTS 2
51
52/**
53 * struct s3c_platform_fimc - camera host interface platform data
54 *
55 * @isp_info: properties of camera sensor required for host interface setup
56 */
57struct s3c_platform_fimc {
58 struct s3c_fimc_isp_info *isp_info[FIMC_MAX_CAMIF_CLIENTS];
59};
60#endif /* S3C_FIMC_H_ */
diff --git a/include/media/sh_vou.h b/include/media/sh_vou.h
index a3ef30242b00..ec3ba9a597a2 100644
--- a/include/media/sh_vou.h
+++ b/include/media/sh_vou.h
@@ -28,7 +28,6 @@ struct sh_vou_pdata {
28 int i2c_adap; 28 int i2c_adap;
29 struct i2c_board_info *board_info; 29 struct i2c_board_info *board_info;
30 unsigned long flags; 30 unsigned long flags;
31 char *module_name;
32}; 31};
33 32
34#endif 33#endif
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index 2ce957301f77..86e3631764ef 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -21,6 +21,8 @@
21 21
22extern struct bus_type soc_camera_bus_type; 22extern struct bus_type soc_camera_bus_type;
23 23
24struct file;
25
24struct soc_camera_device { 26struct soc_camera_device {
25 struct list_head list; 27 struct list_head list;
26 struct device dev; 28 struct device dev;
@@ -41,10 +43,7 @@ struct soc_camera_device {
41 /* soc_camera.c private count. Only accessed with .video_lock held */ 43 /* soc_camera.c private count. Only accessed with .video_lock held */
42 int use_count; 44 int use_count;
43 struct mutex video_lock; /* Protects device data */ 45 struct mutex video_lock; /* Protects device data */
44}; 46 struct file *streamer; /* stream owner */
45
46struct soc_camera_file {
47 struct soc_camera_device *icd;
48 struct videobuf_queue vb_vidq; 47 struct videobuf_queue vb_vidq;
49}; 48};
50 49
@@ -79,7 +78,7 @@ struct soc_camera_host_ops {
79 int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *); 78 int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *);
80 void (*init_videobuf)(struct videobuf_queue *, 79 void (*init_videobuf)(struct videobuf_queue *,
81 struct soc_camera_device *); 80 struct soc_camera_device *);
82 int (*reqbufs)(struct soc_camera_file *, struct v4l2_requestbuffers *); 81 int (*reqbufs)(struct soc_camera_device *, struct v4l2_requestbuffers *);
83 int (*querycap)(struct soc_camera_host *, struct v4l2_capability *); 82 int (*querycap)(struct soc_camera_host *, struct v4l2_capability *);
84 int (*set_bus_param)(struct soc_camera_device *, __u32); 83 int (*set_bus_param)(struct soc_camera_device *, __u32);
85 int (*get_ctrl)(struct soc_camera_device *, struct v4l2_control *); 84 int (*get_ctrl)(struct soc_camera_device *, struct v4l2_control *);
diff --git a/include/media/sr030pc30.h b/include/media/sr030pc30.h
new file mode 100644
index 000000000000..6f901a653ba2
--- /dev/null
+++ b/include/media/sr030pc30.h
@@ -0,0 +1,21 @@
1/*
2 * Driver header for SR030PC30 camera sensor
3 *
4 * Copyright (c) 2010 Samsung Electronics, Co. Ltd
5 * Contact: Sylwester Nawrocki <s.nawrocki@samsung.com>
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 as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13#ifndef SR030PC30_H
14#define SR030PC30_H
15
16struct sr030pc30_platform_data {
17 unsigned long clk_rate; /* master clock frequency in Hz */
18 int (*set_power)(struct device *dev, int on);
19};
20
21#endif /* SR030PC30_H */
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h
index 21b4428c12ab..51e89f2267b8 100644
--- a/include/media/v4l2-chip-ident.h
+++ b/include/media/v4l2-chip-ident.h
@@ -38,6 +38,9 @@ enum {
38 /* module tvaudio: reserved range 50-99 */ 38 /* module tvaudio: reserved range 50-99 */
39 V4L2_IDENT_TVAUDIO = 50, /* A tvaudio chip, unknown which it is exactly */ 39 V4L2_IDENT_TVAUDIO = 50, /* A tvaudio chip, unknown which it is exactly */
40 40
41 /* Sony IMX074 */
42 V4L2_IDENT_IMX074 = 74,
43
41 /* module saa7110: just ident 100 */ 44 /* module saa7110: just ident 100 */
42 V4L2_IDENT_SAA7110 = 100, 45 V4L2_IDENT_SAA7110 = 100,
43 46
@@ -70,6 +73,7 @@ enum {
70 V4L2_IDENT_OV9655 = 255, 73 V4L2_IDENT_OV9655 = 255,
71 V4L2_IDENT_SOI968 = 256, 74 V4L2_IDENT_SOI968 = 256,
72 V4L2_IDENT_OV9640 = 257, 75 V4L2_IDENT_OV9640 = 257,
76 V4L2_IDENT_OV6650 = 258,
73 77
74 /* module saa7146: reserved range 300-309 */ 78 /* module saa7146: reserved range 300-309 */
75 V4L2_IDENT_SAA7146 = 300, 79 V4L2_IDENT_SAA7146 = 300,
@@ -111,6 +115,10 @@ enum {
111 V4L2_IDENT_VPX3216B = 3216, 115 V4L2_IDENT_VPX3216B = 3216,
112 V4L2_IDENT_VPX3220A = 3220, 116 V4L2_IDENT_VPX3220A = 3220,
113 117
118 /* VX855 just ident 3409 */
119 /* Other via devs could use 3314, 3324, 3327, 3336, 3364, 3353 */
120 V4L2_IDENT_VIA_VX855 = 3409,
121
114 /* module tvp5150 */ 122 /* module tvp5150 */
115 V4L2_IDENT_TVP5150 = 5150, 123 V4L2_IDENT_TVP5150 = 5150,
116 124
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 98b32645e5a7..41dd480e45f1 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -232,4 +232,14 @@ void v4l_bound_align_image(unsigned int *w, unsigned int wmin,
232 unsigned int hmax, unsigned int halign, 232 unsigned int hmax, unsigned int halign,
233 unsigned int salign); 233 unsigned int salign);
234int v4l_fill_dv_preset_info(u32 preset, struct v4l2_dv_enum_preset *info); 234int v4l_fill_dv_preset_info(u32 preset, struct v4l2_dv_enum_preset *info);
235
236struct v4l2_discrete_probe {
237 const struct v4l2_frmsize_discrete *sizes;
238 int num_sizes;
239};
240
241const struct v4l2_frmsize_discrete *v4l2_find_nearest_format(
242 const struct v4l2_discrete_probe *probe,
243 s32 width, s32 height);
244
235#endif /* V4L2_COMMON_H_ */ 245#endif /* V4L2_COMMON_H_ */
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index 1efcacbed01a..15802a067a12 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -21,8 +21,7 @@
21#define VFL_TYPE_GRABBER 0 21#define VFL_TYPE_GRABBER 0
22#define VFL_TYPE_VBI 1 22#define VFL_TYPE_VBI 1
23#define VFL_TYPE_RADIO 2 23#define VFL_TYPE_RADIO 2
24#define VFL_TYPE_VTX 3 24#define VFL_TYPE_MAX 3
25#define VFL_TYPE_MAX 4
26 25
27struct v4l2_ioctl_callbacks; 26struct v4l2_ioctl_callbacks;
28struct video_device; 27struct video_device;
@@ -42,8 +41,6 @@ struct v4l2_file_operations {
42 unsigned int (*poll) (struct file *, struct poll_table_struct *); 41 unsigned int (*poll) (struct file *, struct poll_table_struct *);
43 long (*ioctl) (struct file *, unsigned int, unsigned long); 42 long (*ioctl) (struct file *, unsigned int, unsigned long);
44 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); 43 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
45 unsigned long (*get_unmapped_area) (struct file *, unsigned long,
46 unsigned long, unsigned long, unsigned long);
47 int (*mmap) (struct file *, struct vm_area_struct *); 44 int (*mmap) (struct file *, struct vm_area_struct *);
48 int (*open) (struct file *); 45 int (*open) (struct file *);
49 int (*release) (struct file *); 46 int (*release) (struct file *);
@@ -97,6 +94,9 @@ struct video_device
97 94
98 /* ioctl callbacks */ 95 /* ioctl callbacks */
99 const struct v4l2_ioctl_ops *ioctl_ops; 96 const struct v4l2_ioctl_ops *ioctl_ops;
97
98 /* serialization lock */
99 struct mutex *lock;
100}; 100};
101 101
102/* dev to video-device */ 102/* dev to video-device */
diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h
index 8bcbd7a0271c..6648036b728d 100644
--- a/include/media/v4l2-device.h
+++ b/include/media/v4l2-device.h
@@ -101,46 +101,67 @@ void v4l2_device_unregister_subdev(struct v4l2_subdev *sd);
101/* Call the specified callback for all subdevs matching the condition. 101/* Call the specified callback for all subdevs matching the condition.
102 Ignore any errors. Note that you cannot add or delete a subdev 102 Ignore any errors. Note that you cannot add or delete a subdev
103 while walking the subdevs list. */ 103 while walking the subdevs list. */
104#define __v4l2_device_call_subdevs(v4l2_dev, cond, o, f, args...) \ 104#define __v4l2_device_call_subdevs_p(v4l2_dev, sd, cond, o, f, args...) \
105 do { \ 105 do { \
106 struct v4l2_subdev *sd; \ 106 list_for_each_entry((sd), &(v4l2_dev)->subdevs, list) \
107 if ((cond) && (sd)->ops->o && (sd)->ops->o->f) \
108 (sd)->ops->o->f((sd) , ##args); \
109 } while (0)
110
111#define __v4l2_device_call_subdevs(v4l2_dev, cond, o, f, args...) \
112 do { \
113 struct v4l2_subdev *__sd; \
107 \ 114 \
108 list_for_each_entry(sd, &(v4l2_dev)->subdevs, list) \ 115 __v4l2_device_call_subdevs_p(v4l2_dev, __sd, cond, o, \
109 if ((cond) && sd->ops->o && sd->ops->o->f) \ 116 f , ##args); \
110 sd->ops->o->f(sd , ##args); \
111 } while (0) 117 } while (0)
112 118
113/* Call the specified callback for all subdevs matching the condition. 119/* Call the specified callback for all subdevs matching the condition.
114 If the callback returns an error other than 0 or -ENOIOCTLCMD, then 120 If the callback returns an error other than 0 or -ENOIOCTLCMD, then
115 return with that error code. Note that you cannot add or delete a 121 return with that error code. Note that you cannot add or delete a
116 subdev while walking the subdevs list. */ 122 subdev while walking the subdevs list. */
117#define __v4l2_device_call_subdevs_until_err(v4l2_dev, cond, o, f, args...) \ 123#define __v4l2_device_call_subdevs_until_err_p(v4l2_dev, sd, cond, o, f, args...) \
118({ \ 124({ \
119 struct v4l2_subdev *sd; \ 125 long __err = 0; \
120 long err = 0; \
121 \ 126 \
122 list_for_each_entry(sd, &(v4l2_dev)->subdevs, list) { \ 127 list_for_each_entry((sd), &(v4l2_dev)->subdevs, list) { \
123 if ((cond) && sd->ops->o && sd->ops->o->f) \ 128 if ((cond) && (sd)->ops->o && (sd)->ops->o->f) \
124 err = sd->ops->o->f(sd , ##args); \ 129 __err = (sd)->ops->o->f((sd) , ##args); \
125 if (err && err != -ENOIOCTLCMD) \ 130 if (__err && __err != -ENOIOCTLCMD) \
126 break; \ 131 break; \
127 } \ 132 } \
128 (err == -ENOIOCTLCMD) ? 0 : err; \ 133 (__err == -ENOIOCTLCMD) ? 0 : __err; \
134})
135
136#define __v4l2_device_call_subdevs_until_err(v4l2_dev, cond, o, f, args...) \
137({ \
138 struct v4l2_subdev *__sd; \
139 __v4l2_device_call_subdevs_until_err_p(v4l2_dev, __sd, cond, o, \
140 f, args...); \
129}) 141})
130 142
131/* Call the specified callback for all subdevs matching grp_id (if 0, then 143/* Call the specified callback for all subdevs matching grp_id (if 0, then
132 match them all). Ignore any errors. Note that you cannot add or delete 144 match them all). Ignore any errors. Note that you cannot add or delete
133 a subdev while walking the subdevs list. */ 145 a subdev while walking the subdevs list. */
134#define v4l2_device_call_all(v4l2_dev, grpid, o, f, args...) \ 146#define v4l2_device_call_all(v4l2_dev, grpid, o, f, args...) \
135 __v4l2_device_call_subdevs(v4l2_dev, \ 147 do { \
136 !(grpid) || sd->grp_id == (grpid), o, f , ##args) 148 struct v4l2_subdev *__sd; \
149 \
150 __v4l2_device_call_subdevs_p(v4l2_dev, __sd, \
151 !(grpid) || __sd->grp_id == (grpid), o, f , \
152 ##args); \
153 } while (0)
137 154
138/* Call the specified callback for all subdevs matching grp_id (if 0, then 155/* Call the specified callback for all subdevs matching grp_id (if 0, then
139 match them all). If the callback returns an error other than 0 or 156 match them all). If the callback returns an error other than 0 or
140 -ENOIOCTLCMD, then return with that error code. Note that you cannot 157 -ENOIOCTLCMD, then return with that error code. Note that you cannot
141 add or delete a subdev while walking the subdevs list. */ 158 add or delete a subdev while walking the subdevs list. */
142#define v4l2_device_call_until_err(v4l2_dev, grpid, o, f, args...) \ 159#define v4l2_device_call_until_err(v4l2_dev, grpid, o, f, args...) \
143 __v4l2_device_call_subdevs_until_err(v4l2_dev, \ 160({ \
144 !(grpid) || sd->grp_id == (grpid), o, f , ##args) 161 struct v4l2_subdev *__sd; \
162 __v4l2_device_call_subdevs_until_err_p(v4l2_dev, __sd, \
163 !(grpid) || __sd->grp_id == (grpid), o, f , \
164 ##args); \
165})
145 166
146#endif 167#endif
diff --git a/include/media/v4l2-i2c-drv.h b/include/media/v4l2-i2c-drv.h
deleted file mode 100644
index 74bf741d1a9b..000000000000
--- a/include/media/v4l2-i2c-drv.h
+++ /dev/null
@@ -1,80 +0,0 @@
1/*
2 * v4l2-i2c-drv.h - contains I2C handling code that's identical for
3 * all V4L2 I2C drivers. Use this header if the
4 * I2C driver is only used by drivers converted
5 * to the bus-based I2C API.
6 *
7 * Copyright (C) 2007 Hans Verkuil <hverkuil@xs4all.nl>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24/* NOTE: the full version of this header is in the v4l-dvb repository
25 * and allows v4l i2c drivers to be compiled on pre-2.6.26 kernels.
26 * The version of this header as it appears in the kernel is a stripped
27 * version (without all the backwards compatibility stuff) and so it
28 * looks a bit odd.
29 *
30 * If you look at the full version then you will understand the reason
31 * for introducing this header since you really don't want to have all
32 * the tricky backwards compatibility code in each and every i2c driver.
33 *
34 * If the i2c driver will never be compiled for pre-2.6.26 kernels, then
35 * DO NOT USE this header! Just write it as a regular i2c driver.
36 */
37
38#ifndef __V4L2_I2C_DRV_H__
39#define __V4L2_I2C_DRV_H__
40
41#include <media/v4l2-common.h>
42
43struct v4l2_i2c_driver_data {
44 const char * const name;
45 int (*command)(struct i2c_client *client, unsigned int cmd, void *arg);
46 int (*probe)(struct i2c_client *client, const struct i2c_device_id *id);
47 int (*remove)(struct i2c_client *client);
48 int (*suspend)(struct i2c_client *client, pm_message_t state);
49 int (*resume)(struct i2c_client *client);
50 const struct i2c_device_id *id_table;
51};
52
53static struct v4l2_i2c_driver_data v4l2_i2c_data;
54static struct i2c_driver v4l2_i2c_driver;
55
56
57/* Bus-based I2C implementation for kernels >= 2.6.26 */
58
59static int __init v4l2_i2c_drv_init(void)
60{
61 v4l2_i2c_driver.driver.name = v4l2_i2c_data.name;
62 v4l2_i2c_driver.command = v4l2_i2c_data.command;
63 v4l2_i2c_driver.probe = v4l2_i2c_data.probe;
64 v4l2_i2c_driver.remove = v4l2_i2c_data.remove;
65 v4l2_i2c_driver.suspend = v4l2_i2c_data.suspend;
66 v4l2_i2c_driver.resume = v4l2_i2c_data.resume;
67 v4l2_i2c_driver.id_table = v4l2_i2c_data.id_table;
68 return i2c_add_driver(&v4l2_i2c_driver);
69}
70
71
72static void __exit v4l2_i2c_drv_cleanup(void)
73{
74 i2c_del_driver(&v4l2_i2c_driver);
75}
76
77module_init(v4l2_i2c_drv_init);
78module_exit(v4l2_i2c_drv_cleanup);
79
80#endif /* __V4L2_I2C_DRV_H__ */
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
index f0cf2e7def06..8e6559838ae3 100644
--- a/include/media/v4l2-mediabus.h
+++ b/include/media/v4l2-mediabus.h
@@ -28,10 +28,18 @@ enum v4l2_mbus_pixelcode {
28 V4L2_MBUS_FMT_YVYU8_2X8, 28 V4L2_MBUS_FMT_YVYU8_2X8,
29 V4L2_MBUS_FMT_UYVY8_2X8, 29 V4L2_MBUS_FMT_UYVY8_2X8,
30 V4L2_MBUS_FMT_VYUY8_2X8, 30 V4L2_MBUS_FMT_VYUY8_2X8,
31 V4L2_MBUS_FMT_YVYU10_2X10,
32 V4L2_MBUS_FMT_YUYV10_2X10,
33 V4L2_MBUS_FMT_YVYU10_1X20,
34 V4L2_MBUS_FMT_YUYV10_1X20,
35 V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE,
36 V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE,
31 V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE, 37 V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE,
32 V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE, 38 V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE,
33 V4L2_MBUS_FMT_RGB565_2X8_LE, 39 V4L2_MBUS_FMT_RGB565_2X8_LE,
34 V4L2_MBUS_FMT_RGB565_2X8_BE, 40 V4L2_MBUS_FMT_RGB565_2X8_BE,
41 V4L2_MBUS_FMT_BGR565_2X8_LE,
42 V4L2_MBUS_FMT_BGR565_2X8_BE,
35 V4L2_MBUS_FMT_SBGGR8_1X8, 43 V4L2_MBUS_FMT_SBGGR8_1X8,
36 V4L2_MBUS_FMT_SBGGR10_1X10, 44 V4L2_MBUS_FMT_SBGGR10_1X10,
37 V4L2_MBUS_FMT_GREY8_1X8, 45 V4L2_MBUS_FMT_GREY8_1X8,
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 4a97d7341a94..b0316a7cf08d 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -256,10 +256,6 @@ struct v4l2_subdev_video_ops {
256 int (*querystd)(struct v4l2_subdev *sd, v4l2_std_id *std); 256 int (*querystd)(struct v4l2_subdev *sd, v4l2_std_id *std);
257 int (*g_input_status)(struct v4l2_subdev *sd, u32 *status); 257 int (*g_input_status)(struct v4l2_subdev *sd, u32 *status);
258 int (*s_stream)(struct v4l2_subdev *sd, int enable); 258 int (*s_stream)(struct v4l2_subdev *sd, int enable);
259 int (*enum_fmt)(struct v4l2_subdev *sd, struct v4l2_fmtdesc *fmtdesc);
260 int (*g_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt);
261 int (*try_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt);
262 int (*s_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt);
263 int (*cropcap)(struct v4l2_subdev *sd, struct v4l2_cropcap *cc); 259 int (*cropcap)(struct v4l2_subdev *sd, struct v4l2_cropcap *cc);
264 int (*g_crop)(struct v4l2_subdev *sd, struct v4l2_crop *crop); 260 int (*g_crop)(struct v4l2_subdev *sd, struct v4l2_crop *crop);
265 int (*s_crop)(struct v4l2_subdev *sd, struct v4l2_crop *crop); 261 int (*s_crop)(struct v4l2_subdev *sd, struct v4l2_crop *crop);
@@ -442,17 +438,28 @@ struct v4l2_subdev {
442 /* can be used to group similar subdevs, value is driver-specific */ 438 /* can be used to group similar subdevs, value is driver-specific */
443 u32 grp_id; 439 u32 grp_id;
444 /* pointer to private data */ 440 /* pointer to private data */
445 void *priv; 441 void *dev_priv;
442 void *host_priv;
446}; 443};
447 444
448static inline void v4l2_set_subdevdata(struct v4l2_subdev *sd, void *p) 445static inline void v4l2_set_subdevdata(struct v4l2_subdev *sd, void *p)
449{ 446{
450 sd->priv = p; 447 sd->dev_priv = p;
451} 448}
452 449
453static inline void *v4l2_get_subdevdata(const struct v4l2_subdev *sd) 450static inline void *v4l2_get_subdevdata(const struct v4l2_subdev *sd)
454{ 451{
455 return sd->priv; 452 return sd->dev_priv;
453}
454
455static inline void v4l2_set_subdev_hostdata(struct v4l2_subdev *sd, void *p)
456{
457 sd->host_priv = p;
458}
459
460static inline void *v4l2_get_subdev_hostdata(const struct v4l2_subdev *sd)
461{
462 return sd->host_priv;
456} 463}
457 464
458static inline void v4l2_subdev_init(struct v4l2_subdev *sd, 465static inline void v4l2_subdev_init(struct v4l2_subdev *sd,
@@ -466,7 +473,8 @@ static inline void v4l2_subdev_init(struct v4l2_subdev *sd,
466 sd->flags = 0; 473 sd->flags = 0;
467 sd->name[0] = '\0'; 474 sd->name[0] = '\0';
468 sd->grp_id = 0; 475 sd->grp_id = 0;
469 sd->priv = NULL; 476 sd->dev_priv = NULL;
477 sd->host_priv = NULL;
470} 478}
471 479
472/* Call an ops of a v4l2_subdev, doing the right checks against 480/* Call an ops of a v4l2_subdev, doing the right checks against
diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h
index f2c41cebf453..1d3835fc26be 100644
--- a/include/media/videobuf-core.h
+++ b/include/media/videobuf-core.h
@@ -139,6 +139,7 @@ struct videobuf_qtype_ops {
139 139
140struct videobuf_queue { 140struct videobuf_queue {
141 struct mutex vb_lock; 141 struct mutex vb_lock;
142 struct mutex *ext_lock;
142 spinlock_t *irqlock; 143 spinlock_t *irqlock;
143 struct device *dev; 144 struct device *dev;
144 145
@@ -167,7 +168,20 @@ struct videobuf_queue {
167 void *priv_data; 168 void *priv_data;
168}; 169};
169 170
170int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr); 171static inline void videobuf_queue_lock(struct videobuf_queue *q)
172{
173 if (!q->ext_lock)
174 mutex_lock(&q->vb_lock);
175}
176
177static inline void videobuf_queue_unlock(struct videobuf_queue *q)
178{
179 if (!q->ext_lock)
180 mutex_unlock(&q->vb_lock);
181}
182
183int videobuf_waiton(struct videobuf_queue *q, struct videobuf_buffer *vb,
184 int non_blocking, int intr);
171int videobuf_iolock(struct videobuf_queue *q, struct videobuf_buffer *vb, 185int videobuf_iolock(struct videobuf_queue *q, struct videobuf_buffer *vb,
172 struct v4l2_framebuffer *fbuf); 186 struct v4l2_framebuffer *fbuf);
173 187
@@ -185,7 +199,8 @@ void videobuf_queue_core_init(struct videobuf_queue *q,
185 enum v4l2_field field, 199 enum v4l2_field field,
186 unsigned int msize, 200 unsigned int msize,
187 void *priv, 201 void *priv,
188 struct videobuf_qtype_ops *int_ops); 202 struct videobuf_qtype_ops *int_ops,
203 struct mutex *ext_lock);
189int videobuf_queue_is_busy(struct videobuf_queue *q); 204int videobuf_queue_is_busy(struct videobuf_queue *q);
190void videobuf_queue_cancel(struct videobuf_queue *q); 205void videobuf_queue_cancel(struct videobuf_queue *q);
191 206
diff --git a/include/media/videobuf-dma-contig.h b/include/media/videobuf-dma-contig.h
index ebaa9bc1ee8d..f0ed82543d9f 100644
--- a/include/media/videobuf-dma-contig.h
+++ b/include/media/videobuf-dma-contig.h
@@ -23,7 +23,8 @@ void videobuf_queue_dma_contig_init(struct videobuf_queue *q,
23 enum v4l2_buf_type type, 23 enum v4l2_buf_type type,
24 enum v4l2_field field, 24 enum v4l2_field field,
25 unsigned int msize, 25 unsigned int msize,
26 void *priv); 26 void *priv,
27 struct mutex *ext_lock);
27 28
28dma_addr_t videobuf_to_dma_contig(struct videobuf_buffer *buf); 29dma_addr_t videobuf_to_dma_contig(struct videobuf_buffer *buf);
29void videobuf_dma_contig_free(struct videobuf_queue *q, 30void videobuf_dma_contig_free(struct videobuf_queue *q,
diff --git a/include/media/videobuf-dma-sg.h b/include/media/videobuf-dma-sg.h
index aa4ebb42a565..1c647e8148c4 100644
--- a/include/media/videobuf-dma-sg.h
+++ b/include/media/videobuf-dma-sg.h
@@ -103,7 +103,8 @@ void videobuf_queue_sg_init(struct videobuf_queue *q,
103 enum v4l2_buf_type type, 103 enum v4l2_buf_type type,
104 enum v4l2_field field, 104 enum v4l2_field field,
105 unsigned int msize, 105 unsigned int msize,
106 void *priv); 106 void *priv,
107 struct mutex *ext_lock);
107 108
108#endif /* _VIDEOBUF_DMA_SG_H */ 109#endif /* _VIDEOBUF_DMA_SG_H */
109 110
diff --git a/include/media/videobuf-vmalloc.h b/include/media/videobuf-vmalloc.h
index e19403c18dae..486a97efdb56 100644
--- a/include/media/videobuf-vmalloc.h
+++ b/include/media/videobuf-vmalloc.h
@@ -36,7 +36,8 @@ void videobuf_queue_vmalloc_init(struct videobuf_queue *q,
36 enum v4l2_buf_type type, 36 enum v4l2_buf_type type,
37 enum v4l2_field field, 37 enum v4l2_field field,
38 unsigned int msize, 38 unsigned int msize,
39 void *priv); 39 void *priv,
40 struct mutex *ext_lock);
40 41
41void *videobuf_to_vmalloc(struct videobuf_buffer *buf); 42void *videobuf_to_vmalloc(struct videobuf_buffer *buf);
42 43
diff --git a/include/media/wm8775.h b/include/media/wm8775.h
index 60739c5a23ae..a1c4d417dfa2 100644
--- a/include/media/wm8775.h
+++ b/include/media/wm8775.h
@@ -32,4 +32,7 @@
32#define WM8775_AIN3 4 32#define WM8775_AIN3 4
33#define WM8775_AIN4 8 33#define WM8775_AIN4 8
34 34
35/* subdev group ID */
36#define WM8775_GID (1 << 0)
37
35#endif 38#endif