diff options
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/bt819.h | 33 | ||||
-rw-r--r-- | include/media/cx2341x.h | 6 | ||||
-rw-r--r-- | include/media/cx25840.h | 12 | ||||
-rw-r--r-- | include/media/ir-common.h | 3 | ||||
-rw-r--r-- | include/media/ir-kbd-i2c.h | 3 | ||||
-rw-r--r-- | include/media/ov772x.h | 5 | ||||
-rw-r--r-- | include/media/saa7146.h | 8 | ||||
-rw-r--r-- | include/media/saa7146_vv.h | 17 | ||||
-rw-r--r-- | include/media/sh_mobile_ceu.h | 5 | ||||
-rw-r--r-- | include/media/soc_camera.h | 24 | ||||
-rw-r--r-- | include/media/v4l2-chip-ident.h | 94 | ||||
-rw-r--r-- | include/media/v4l2-common.h | 24 | ||||
-rw-r--r-- | include/media/v4l2-dev.h | 2 | ||||
-rw-r--r-- | include/media/v4l2-device.h | 40 | ||||
-rw-r--r-- | include/media/v4l2-ioctl.h | 2 | ||||
-rw-r--r-- | include/media/v4l2-subdev.h | 22 | ||||
-rw-r--r-- | include/media/videobuf-core.h | 1 |
17 files changed, 243 insertions, 58 deletions
diff --git a/include/media/bt819.h b/include/media/bt819.h new file mode 100644 index 000000000000..38f666bde77a --- /dev/null +++ b/include/media/bt819.h | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | bt819.h - bt819 notifications | ||
3 | |||
4 | Copyright (C) 2009 Hans Verkuil (hverkuil@xs4all.nl) | ||
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; either version 2 of the License, or | ||
9 | (at your option) any later version. | ||
10 | |||
11 | This program is distributed in the hope that it will be useful, | ||
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | GNU General Public License for more details. | ||
15 | |||
16 | You should have received a copy of the GNU General Public License | ||
17 | along with this program; if not, write to the Free Software | ||
18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef _BT819_H_ | ||
22 | #define _BT819_H_ | ||
23 | |||
24 | #include <linux/ioctl.h> | ||
25 | |||
26 | /* v4l2_device notifications. */ | ||
27 | |||
28 | /* Needed to reset the FIFO buffer when changing the input | ||
29 | or the video standard. */ | ||
30 | #define BT819_FIFO_RESET_LOW _IO('b', 0) | ||
31 | #define BT819_FIFO_RESET_HIGH _IO('b', 1) | ||
32 | |||
33 | #endif | ||
diff --git a/include/media/cx2341x.h b/include/media/cx2341x.h index 9ec4d5889ef5..9ebe8558b9b6 100644 --- a/include/media/cx2341x.h +++ b/include/media/cx2341x.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | cx23415/6 header containing common defines. | 2 | cx23415/6/8 header containing common defines. |
3 | 3 | ||
4 | This program is free software; you can redistribute it and/or modify | 4 | This program is free software; you can redistribute it and/or modify |
5 | it under the terms of the GNU General Public License as published by | 5 | it under the terms of the GNU General Public License as published by |
@@ -28,6 +28,7 @@ enum cx2341x_port { | |||
28 | enum cx2341x_cap { | 28 | enum cx2341x_cap { |
29 | CX2341X_CAP_HAS_SLICED_VBI = 1 << 0, | 29 | CX2341X_CAP_HAS_SLICED_VBI = 1 << 0, |
30 | CX2341X_CAP_HAS_TS = 1 << 1, | 30 | CX2341X_CAP_HAS_TS = 1 << 1, |
31 | CX2341X_CAP_HAS_AC3 = 1 << 2, | ||
31 | }; | 32 | }; |
32 | 33 | ||
33 | struct cx2341x_mpeg_params { | 34 | struct cx2341x_mpeg_params { |
@@ -47,11 +48,12 @@ struct cx2341x_mpeg_params { | |||
47 | enum v4l2_mpeg_audio_sampling_freq audio_sampling_freq; | 48 | enum v4l2_mpeg_audio_sampling_freq audio_sampling_freq; |
48 | enum v4l2_mpeg_audio_encoding audio_encoding; | 49 | enum v4l2_mpeg_audio_encoding audio_encoding; |
49 | enum v4l2_mpeg_audio_l2_bitrate audio_l2_bitrate; | 50 | enum v4l2_mpeg_audio_l2_bitrate audio_l2_bitrate; |
51 | enum v4l2_mpeg_audio_ac3_bitrate audio_ac3_bitrate; | ||
50 | enum v4l2_mpeg_audio_mode audio_mode; | 52 | enum v4l2_mpeg_audio_mode audio_mode; |
51 | enum v4l2_mpeg_audio_mode_extension audio_mode_extension; | 53 | enum v4l2_mpeg_audio_mode_extension audio_mode_extension; |
52 | enum v4l2_mpeg_audio_emphasis audio_emphasis; | 54 | enum v4l2_mpeg_audio_emphasis audio_emphasis; |
53 | enum v4l2_mpeg_audio_crc audio_crc; | 55 | enum v4l2_mpeg_audio_crc audio_crc; |
54 | u16 audio_properties; | 56 | u32 audio_properties; |
55 | u16 audio_mute; | 57 | u16 audio_mute; |
56 | 58 | ||
57 | /* video */ | 59 | /* video */ |
diff --git a/include/media/cx25840.h b/include/media/cx25840.h index db431d513f2f..2c3fbaa33f74 100644 --- a/include/media/cx25840.h +++ b/include/media/cx25840.h | |||
@@ -21,6 +21,18 @@ | |||
21 | #ifndef _CX25840_H_ | 21 | #ifndef _CX25840_H_ |
22 | #define _CX25840_H_ | 22 | #define _CX25840_H_ |
23 | 23 | ||
24 | /* Note that the cx25840 driver requires that the bridge driver calls the | ||
25 | v4l2_subdev's init operation in order to load the driver's firmware. | ||
26 | Without this the audio standard detection will fail and you will | ||
27 | only get mono. | ||
28 | |||
29 | Since loading the firmware is often problematic when the driver is | ||
30 | compiled into the kernel I recommend postponing calling this function | ||
31 | until the first open of the video device. Another reason for | ||
32 | postponing it is that loading this firmware takes a long time (seconds) | ||
33 | due to the slow i2c bus speed. So it will speed up the boot process if | ||
34 | you can avoid loading the fw as long as the video device isn't used. */ | ||
35 | |||
24 | enum cx25840_video_input { | 36 | enum cx25840_video_input { |
25 | /* Composite video inputs In1-In8 */ | 37 | /* Composite video inputs In1-In8 */ |
26 | CX25840_COMPOSITE1 = 1, | 38 | CX25840_COMPOSITE1 = 1, |
diff --git a/include/media/ir-common.h b/include/media/ir-common.h index 5bf2ea00678c..7b5b91f60425 100644 --- a/include/media/ir-common.h +++ b/include/media/ir-common.h | |||
@@ -111,6 +111,7 @@ extern IR_KEYTAB_TYPE ir_codes_empty[IR_KEYTAB_SIZE]; | |||
111 | extern IR_KEYTAB_TYPE ir_codes_avermedia[IR_KEYTAB_SIZE]; | 111 | extern IR_KEYTAB_TYPE ir_codes_avermedia[IR_KEYTAB_SIZE]; |
112 | extern IR_KEYTAB_TYPE ir_codes_avermedia_dvbt[IR_KEYTAB_SIZE]; | 112 | extern IR_KEYTAB_TYPE ir_codes_avermedia_dvbt[IR_KEYTAB_SIZE]; |
113 | extern IR_KEYTAB_TYPE ir_codes_avermedia_m135a[IR_KEYTAB_SIZE]; | 113 | extern IR_KEYTAB_TYPE ir_codes_avermedia_m135a[IR_KEYTAB_SIZE]; |
114 | extern IR_KEYTAB_TYPE ir_codes_avermedia_cardbus[IR_KEYTAB_SIZE]; | ||
114 | extern IR_KEYTAB_TYPE ir_codes_apac_viewcomp[IR_KEYTAB_SIZE]; | 115 | extern IR_KEYTAB_TYPE ir_codes_apac_viewcomp[IR_KEYTAB_SIZE]; |
115 | extern IR_KEYTAB_TYPE ir_codes_pixelview[IR_KEYTAB_SIZE]; | 116 | extern IR_KEYTAB_TYPE ir_codes_pixelview[IR_KEYTAB_SIZE]; |
116 | extern IR_KEYTAB_TYPE ir_codes_pixelview_new[IR_KEYTAB_SIZE]; | 117 | extern IR_KEYTAB_TYPE ir_codes_pixelview_new[IR_KEYTAB_SIZE]; |
@@ -159,6 +160,8 @@ extern IR_KEYTAB_TYPE ir_codes_real_audio_220_32_keys[IR_KEYTAB_SIZE]; | |||
159 | extern IR_KEYTAB_TYPE ir_codes_msi_tvanywhere_plus[IR_KEYTAB_SIZE]; | 160 | extern IR_KEYTAB_TYPE ir_codes_msi_tvanywhere_plus[IR_KEYTAB_SIZE]; |
160 | extern IR_KEYTAB_TYPE ir_codes_ati_tv_wonder_hd_600[IR_KEYTAB_SIZE]; | 161 | extern IR_KEYTAB_TYPE ir_codes_ati_tv_wonder_hd_600[IR_KEYTAB_SIZE]; |
161 | extern IR_KEYTAB_TYPE ir_codes_kworld_plus_tv_analog[IR_KEYTAB_SIZE]; | 162 | extern IR_KEYTAB_TYPE ir_codes_kworld_plus_tv_analog[IR_KEYTAB_SIZE]; |
163 | extern IR_KEYTAB_TYPE ir_codes_kaiomy[IR_KEYTAB_SIZE]; | ||
164 | extern IR_KEYTAB_TYPE ir_codes_dm1105_nec[IR_KEYTAB_SIZE]; | ||
162 | #endif | 165 | #endif |
163 | 166 | ||
164 | /* | 167 | /* |
diff --git a/include/media/ir-kbd-i2c.h b/include/media/ir-kbd-i2c.h index 00fa57eb9fde..07963d705400 100644 --- a/include/media/ir-kbd-i2c.h +++ b/include/media/ir-kbd-i2c.h | |||
@@ -14,8 +14,7 @@ struct IR_i2c { | |||
14 | /* Used to avoid fast repeating */ | 14 | /* Used to avoid fast repeating */ |
15 | unsigned char old; | 15 | unsigned char old; |
16 | 16 | ||
17 | struct work_struct work; | 17 | struct delayed_work work; |
18 | struct timer_list timer; | ||
19 | char phys[32]; | 18 | char phys[32]; |
20 | int (*get_key)(struct IR_i2c*, u32*, u32*); | 19 | int (*get_key)(struct IR_i2c*, u32*, u32*); |
21 | }; | 20 | }; |
diff --git a/include/media/ov772x.h b/include/media/ov772x.h index e391d55edb95..57db48dd85b8 100644 --- a/include/media/ov772x.h +++ b/include/media/ov772x.h | |||
@@ -13,8 +13,13 @@ | |||
13 | 13 | ||
14 | #include <media/soc_camera.h> | 14 | #include <media/soc_camera.h> |
15 | 15 | ||
16 | /* for flags */ | ||
17 | #define OV772X_FLAG_VFLIP 0x00000001 /* Vertical flip image */ | ||
18 | #define OV772X_FLAG_HFLIP 0x00000002 /* Horizontal flip image */ | ||
19 | |||
16 | struct ov772x_camera_info { | 20 | struct ov772x_camera_info { |
17 | unsigned long buswidth; | 21 | unsigned long buswidth; |
22 | unsigned long flags; | ||
18 | struct soc_camera_link link; | 23 | struct soc_camera_link link; |
19 | }; | 24 | }; |
20 | 25 | ||
diff --git a/include/media/saa7146.h b/include/media/saa7146.h index c5a6e22a4b37..fff4235adae5 100644 --- a/include/media/saa7146.h +++ b/include/media/saa7146.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/stringify.h> | 13 | #include <linux/stringify.h> |
14 | #include <linux/mutex.h> | 14 | #include <linux/mutex.h> |
15 | #include <linux/scatterlist.h> | 15 | #include <linux/scatterlist.h> |
16 | #include <media/v4l2-device.h> | ||
16 | 17 | ||
17 | #include <linux/vmalloc.h> /* for vmalloc() */ | 18 | #include <linux/vmalloc.h> /* for vmalloc() */ |
18 | #include <linux/mm.h> /* for vmalloc_to_page() */ | 19 | #include <linux/mm.h> /* for vmalloc_to_page() */ |
@@ -110,6 +111,8 @@ struct saa7146_dev | |||
110 | 111 | ||
111 | struct list_head item; | 112 | struct list_head item; |
112 | 113 | ||
114 | struct v4l2_device v4l2_dev; | ||
115 | |||
113 | /* different device locks */ | 116 | /* different device locks */ |
114 | spinlock_t slock; | 117 | spinlock_t slock; |
115 | struct mutex lock; | 118 | struct mutex lock; |
@@ -145,6 +148,11 @@ struct saa7146_dev | |||
145 | struct saa7146_dma d_rps1; | 148 | struct saa7146_dma d_rps1; |
146 | }; | 149 | }; |
147 | 150 | ||
151 | static inline struct saa7146_dev *to_saa7146_dev(struct v4l2_device *v4l2_dev) | ||
152 | { | ||
153 | return container_of(v4l2_dev, struct saa7146_dev, v4l2_dev); | ||
154 | } | ||
155 | |||
148 | /* from saa7146_i2c.c */ | 156 | /* from saa7146_i2c.c */ |
149 | int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c_adapter, u32 bitrate); | 157 | int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c_adapter, u32 bitrate); |
150 | 158 | ||
diff --git a/include/media/saa7146_vv.h b/include/media/saa7146_vv.h index c8d0b23fde29..eed5fccc83f3 100644 --- a/include/media/saa7146_vv.h +++ b/include/media/saa7146_vv.h | |||
@@ -150,16 +150,6 @@ struct saa7146_vv | |||
150 | unsigned int resources; /* resource management for device */ | 150 | unsigned int resources; /* resource management for device */ |
151 | }; | 151 | }; |
152 | 152 | ||
153 | #define SAA7146_EXCLUSIVE 0x1 | ||
154 | #define SAA7146_BEFORE 0x2 | ||
155 | #define SAA7146_AFTER 0x4 | ||
156 | |||
157 | struct saa7146_extension_ioctls | ||
158 | { | ||
159 | unsigned int cmd; | ||
160 | int flags; | ||
161 | }; | ||
162 | |||
163 | /* flags */ | 153 | /* flags */ |
164 | #define SAA7146_USE_PORT_B_FOR_VBI 0x2 /* use input port b for vbi hardware bug workaround */ | 154 | #define SAA7146_USE_PORT_B_FOR_VBI 0x2 /* use input port b for vbi hardware bug workaround */ |
165 | 155 | ||
@@ -176,8 +166,10 @@ struct saa7146_ext_vv | |||
176 | int num_stds; | 166 | int num_stds; |
177 | int (*std_callback)(struct saa7146_dev*, struct saa7146_standard *); | 167 | int (*std_callback)(struct saa7146_dev*, struct saa7146_standard *); |
178 | 168 | ||
179 | struct saa7146_extension_ioctls *ioctls; | 169 | /* the extension can override this */ |
180 | long (*ioctl)(struct saa7146_fh *, unsigned int cmd, void *arg); | 170 | struct v4l2_ioctl_ops ops; |
171 | /* pointer to the saa7146 core ops */ | ||
172 | const struct v4l2_ioctl_ops *core_ops; | ||
181 | 173 | ||
182 | struct v4l2_file_operations vbi_fops; | 174 | struct v4l2_file_operations vbi_fops; |
183 | }; | 175 | }; |
@@ -213,6 +205,7 @@ void saa7146_set_hps_source_and_sync(struct saa7146_dev *saa, int source, int sy | |||
213 | void saa7146_set_gpio(struct saa7146_dev *saa, u8 pin, u8 data); | 205 | void saa7146_set_gpio(struct saa7146_dev *saa, u8 pin, u8 data); |
214 | 206 | ||
215 | /* from saa7146_video.c */ | 207 | /* from saa7146_video.c */ |
208 | extern const struct v4l2_ioctl_ops saa7146_video_ioctl_ops; | ||
216 | extern struct saa7146_use_ops saa7146_video_uops; | 209 | extern struct saa7146_use_ops saa7146_video_uops; |
217 | int saa7146_start_preview(struct saa7146_fh *fh); | 210 | int saa7146_start_preview(struct saa7146_fh *fh); |
218 | int saa7146_stop_preview(struct saa7146_fh *fh); | 211 | int saa7146_stop_preview(struct saa7146_fh *fh); |
diff --git a/include/media/sh_mobile_ceu.h b/include/media/sh_mobile_ceu.h index b5dbefea3740..0f3524cff435 100644 --- a/include/media/sh_mobile_ceu.h +++ b/include/media/sh_mobile_ceu.h | |||
@@ -1,10 +1,11 @@ | |||
1 | #ifndef __ASM_SH_MOBILE_CEU_H__ | 1 | #ifndef __ASM_SH_MOBILE_CEU_H__ |
2 | #define __ASM_SH_MOBILE_CEU_H__ | 2 | #define __ASM_SH_MOBILE_CEU_H__ |
3 | 3 | ||
4 | #include <media/soc_camera.h> | 4 | #define SH_CEU_FLAG_USE_8BIT_BUS (1 << 0) /* use 8bit bus width */ |
5 | #define SH_CEU_FLAG_USE_16BIT_BUS (1 << 1) /* use 16bit bus width */ | ||
5 | 6 | ||
6 | struct sh_mobile_ceu_info { | 7 | struct sh_mobile_ceu_info { |
7 | unsigned long flags; /* SOCAM_... */ | 8 | unsigned long flags; |
8 | }; | 9 | }; |
9 | 10 | ||
10 | #endif /* __ASM_SH_MOBILE_CEU_H__ */ | 11 | #endif /* __ASM_SH_MOBILE_CEU_H__ */ |
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index 7440d9250665..37013688af44 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h | |||
@@ -45,6 +45,7 @@ struct soc_camera_device { | |||
45 | int num_formats; | 45 | int num_formats; |
46 | struct soc_camera_format_xlate *user_formats; | 46 | struct soc_camera_format_xlate *user_formats; |
47 | int num_user_formats; | 47 | int num_user_formats; |
48 | enum v4l2_field field; /* Preserve field over close() */ | ||
48 | struct module *owner; | 49 | struct module *owner; |
49 | void *host_priv; /* Per-device host private data */ | 50 | void *host_priv; /* Per-device host private data */ |
50 | /* soc_camera.c private count. Only accessed with .video_lock held */ | 51 | /* soc_camera.c private count. Only accessed with .video_lock held */ |
@@ -74,7 +75,8 @@ struct soc_camera_host_ops { | |||
74 | int (*resume)(struct soc_camera_device *); | 75 | int (*resume)(struct soc_camera_device *); |
75 | int (*get_formats)(struct soc_camera_device *, int, | 76 | int (*get_formats)(struct soc_camera_device *, int, |
76 | struct soc_camera_format_xlate *); | 77 | struct soc_camera_format_xlate *); |
77 | int (*set_fmt)(struct soc_camera_device *, __u32, struct v4l2_rect *); | 78 | int (*set_crop)(struct soc_camera_device *, struct v4l2_rect *); |
79 | int (*set_fmt)(struct soc_camera_device *, struct v4l2_format *); | ||
78 | int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *); | 80 | int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *); |
79 | void (*init_videobuf)(struct videobuf_queue *, | 81 | void (*init_videobuf)(struct videobuf_queue *, |
80 | struct soc_camera_device *); | 82 | struct soc_camera_device *); |
@@ -93,13 +95,18 @@ struct soc_camera_host_ops { | |||
93 | struct soc_camera_link { | 95 | struct soc_camera_link { |
94 | /* Camera bus id, used to match a camera and a bus */ | 96 | /* Camera bus id, used to match a camera and a bus */ |
95 | int bus_id; | 97 | int bus_id; |
96 | /* GPIO number to switch between 8 and 10 bit modes */ | ||
97 | unsigned int gpio; | ||
98 | /* Per camera SOCAM_SENSOR_* bus flags */ | 98 | /* Per camera SOCAM_SENSOR_* bus flags */ |
99 | unsigned long flags; | 99 | unsigned long flags; |
100 | /* Optional callbacks to power on or off and reset the sensor */ | 100 | /* Optional callbacks to power on or off and reset the sensor */ |
101 | int (*power)(struct device *, int); | 101 | int (*power)(struct device *, int); |
102 | int (*reset)(struct device *); | 102 | int (*reset)(struct device *); |
103 | /* | ||
104 | * some platforms may support different data widths than the sensors | ||
105 | * native ones due to different data line routing. Let the board code | ||
106 | * overwrite the width flags. | ||
107 | */ | ||
108 | int (*set_bus_param)(struct soc_camera_link *, unsigned long flags); | ||
109 | unsigned long (*query_bus_param)(struct soc_camera_link *); | ||
103 | }; | 110 | }; |
104 | 111 | ||
105 | static inline struct soc_camera_device *to_soc_camera_dev(struct device *dev) | 112 | static inline struct soc_camera_device *to_soc_camera_dev(struct device *dev) |
@@ -159,7 +166,8 @@ struct soc_camera_ops { | |||
159 | int (*release)(struct soc_camera_device *); | 166 | int (*release)(struct soc_camera_device *); |
160 | int (*start_capture)(struct soc_camera_device *); | 167 | int (*start_capture)(struct soc_camera_device *); |
161 | int (*stop_capture)(struct soc_camera_device *); | 168 | int (*stop_capture)(struct soc_camera_device *); |
162 | int (*set_fmt)(struct soc_camera_device *, __u32, struct v4l2_rect *); | 169 | int (*set_crop)(struct soc_camera_device *, struct v4l2_rect *); |
170 | int (*set_fmt)(struct soc_camera_device *, struct v4l2_format *); | ||
163 | int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *); | 171 | int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *); |
164 | unsigned long (*query_bus_param)(struct soc_camera_device *); | 172 | unsigned long (*query_bus_param)(struct soc_camera_device *); |
165 | int (*set_bus_param)(struct soc_camera_device *, unsigned long); | 173 | int (*set_bus_param)(struct soc_camera_device *, unsigned long); |
@@ -239,15 +247,19 @@ static inline struct v4l2_queryctrl const *soc_camera_find_qctrl( | |||
239 | static inline unsigned long soc_camera_bus_param_compatible( | 247 | static inline unsigned long soc_camera_bus_param_compatible( |
240 | unsigned long camera_flags, unsigned long bus_flags) | 248 | unsigned long camera_flags, unsigned long bus_flags) |
241 | { | 249 | { |
242 | unsigned long common_flags, hsync, vsync, pclk; | 250 | unsigned long common_flags, hsync, vsync, pclk, data, buswidth, mode; |
243 | 251 | ||
244 | common_flags = camera_flags & bus_flags; | 252 | common_flags = camera_flags & bus_flags; |
245 | 253 | ||
246 | hsync = common_flags & (SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_HSYNC_ACTIVE_LOW); | 254 | hsync = common_flags & (SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_HSYNC_ACTIVE_LOW); |
247 | vsync = common_flags & (SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW); | 255 | vsync = common_flags & (SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW); |
248 | pclk = common_flags & (SOCAM_PCLK_SAMPLE_RISING | SOCAM_PCLK_SAMPLE_FALLING); | 256 | pclk = common_flags & (SOCAM_PCLK_SAMPLE_RISING | SOCAM_PCLK_SAMPLE_FALLING); |
257 | data = common_flags & (SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATA_ACTIVE_LOW); | ||
258 | mode = common_flags & (SOCAM_MASTER | SOCAM_SLAVE); | ||
259 | buswidth = common_flags & SOCAM_DATAWIDTH_MASK; | ||
249 | 260 | ||
250 | return (!hsync || !vsync || !pclk) ? 0 : common_flags; | 261 | return (!hsync || !vsync || !pclk || !data || !mode || !buswidth) ? 0 : |
262 | common_flags; | ||
251 | } | 263 | } |
252 | 264 | ||
253 | extern unsigned long soc_camera_apply_sensor_flags(struct soc_camera_link *icl, | 265 | extern unsigned long soc_camera_apply_sensor_flags(struct soc_camera_link *icl, |
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h index 9aaf652b20ef..1be461a29077 100644 --- a/include/media/v4l2-chip-ident.h +++ b/include/media/v4l2-chip-ident.h | |||
@@ -37,10 +37,8 @@ enum { | |||
37 | /* module saa7110: just ident 100 */ | 37 | /* module saa7110: just ident 100 */ |
38 | V4L2_IDENT_SAA7110 = 100, | 38 | V4L2_IDENT_SAA7110 = 100, |
39 | 39 | ||
40 | /* module saa7111: just ident 101 */ | 40 | /* module saa7115: reserved range 101-149 */ |
41 | V4L2_IDENT_SAA7111 = 101, | 41 | V4L2_IDENT_SAA7111 = 101, |
42 | |||
43 | /* module saa7115: reserved range 102-149 */ | ||
44 | V4L2_IDENT_SAA7113 = 103, | 42 | V4L2_IDENT_SAA7113 = 103, |
45 | V4L2_IDENT_SAA7114 = 104, | 43 | V4L2_IDENT_SAA7114 = 104, |
46 | V4L2_IDENT_SAA7115 = 105, | 44 | V4L2_IDENT_SAA7115 = 105, |
@@ -63,44 +61,96 @@ enum { | |||
63 | V4L2_IDENT_OV7720 = 251, | 61 | V4L2_IDENT_OV7720 = 251, |
64 | V4L2_IDENT_OV7725 = 252, | 62 | V4L2_IDENT_OV7725 = 252, |
65 | 63 | ||
66 | /* Conexant MPEG encoder/decoders: reserved range 410-420 */ | 64 | /* module saa7146: reserved range 300-309 */ |
65 | V4L2_IDENT_SAA7146 = 300, | ||
66 | |||
67 | /* Conexant MPEG encoder/decoders: reserved range 400-420 */ | ||
68 | V4L2_IDENT_CX23418_843 = 403, /* Integrated A/V Decoder on the '418 */ | ||
67 | V4L2_IDENT_CX23415 = 415, | 69 | V4L2_IDENT_CX23415 = 415, |
68 | V4L2_IDENT_CX23416 = 416, | 70 | V4L2_IDENT_CX23416 = 416, |
69 | V4L2_IDENT_CX23418 = 418, | 71 | V4L2_IDENT_CX23418 = 418, |
70 | 72 | ||
73 | /* module au0828 */ | ||
74 | V4L2_IDENT_AU0828 = 828, | ||
75 | |||
76 | /* module indycam: just ident 2000 */ | ||
77 | V4L2_IDENT_INDYCAM = 2000, | ||
78 | |||
79 | /* module bt819: reserved range 810-819 */ | ||
80 | V4L2_IDENT_BT815A = 815, | ||
81 | V4L2_IDENT_BT817A = 817, | ||
82 | V4L2_IDENT_BT819A = 819, | ||
83 | |||
84 | /* module bt856: just ident 856 */ | ||
85 | V4L2_IDENT_BT856 = 856, | ||
86 | |||
87 | /* module bt866: just ident 866 */ | ||
88 | V4L2_IDENT_BT866 = 866, | ||
89 | |||
90 | /* module ks0127: reserved range 1120-1129 */ | ||
91 | V4L2_IDENT_KS0122S = 1122, | ||
92 | V4L2_IDENT_KS0127 = 1127, | ||
93 | V4L2_IDENT_KS0127B = 1128, | ||
94 | |||
71 | /* module vp27smpx: just ident 2700 */ | 95 | /* module vp27smpx: just ident 2700 */ |
72 | V4L2_IDENT_VP27SMPX = 2700, | 96 | V4L2_IDENT_VP27SMPX = 2700, |
73 | 97 | ||
98 | /* module vpx3220: reserved range: 3210-3229 */ | ||
99 | V4L2_IDENT_VPX3214C = 3214, | ||
100 | V4L2_IDENT_VPX3216B = 3216, | ||
101 | V4L2_IDENT_VPX3220A = 3220, | ||
102 | |||
74 | /* module tvp5150 */ | 103 | /* module tvp5150 */ |
75 | V4L2_IDENT_TVP5150 = 5150, | 104 | V4L2_IDENT_TVP5150 = 5150, |
76 | 105 | ||
106 | /* module saa5246a: just ident 5246 */ | ||
107 | V4L2_IDENT_SAA5246A = 5246, | ||
108 | |||
109 | /* module saa5249: just ident 5249 */ | ||
110 | V4L2_IDENT_SAA5249 = 5249, | ||
111 | |||
77 | /* module cs5345: just ident 5345 */ | 112 | /* module cs5345: just ident 5345 */ |
78 | V4L2_IDENT_CS5345 = 5345, | 113 | V4L2_IDENT_CS5345 = 5345, |
79 | 114 | ||
115 | /* module tea6415c: just ident 6415 */ | ||
116 | V4L2_IDENT_TEA6415C = 6415, | ||
117 | |||
118 | /* module tea6420: just ident 6420 */ | ||
119 | V4L2_IDENT_TEA6420 = 6420, | ||
120 | |||
121 | /* module saa6588: just ident 6588 */ | ||
122 | V4L2_IDENT_SAA6588 = 6588, | ||
123 | |||
80 | /* module saa6752hs: reserved range 6750-6759 */ | 124 | /* module saa6752hs: reserved range 6750-6759 */ |
81 | V4L2_IDENT_SAA6752HS = 6752, | 125 | V4L2_IDENT_SAA6752HS = 6752, |
82 | V4L2_IDENT_SAA6752HS_AC3 = 6753, | 126 | V4L2_IDENT_SAA6752HS_AC3 = 6753, |
83 | 127 | ||
128 | /* module adv7170: just ident 7170 */ | ||
129 | V4L2_IDENT_ADV7170 = 7170, | ||
130 | |||
131 | /* module adv7175: just ident 7175 */ | ||
132 | V4L2_IDENT_ADV7175 = 7175, | ||
133 | |||
134 | /* module saa7185: just ident 7185 */ | ||
135 | V4L2_IDENT_SAA7185 = 7185, | ||
136 | |||
137 | /* module saa7191: just ident 7191 */ | ||
138 | V4L2_IDENT_SAA7191 = 7191, | ||
139 | |||
84 | /* module wm8739: just ident 8739 */ | 140 | /* module wm8739: just ident 8739 */ |
85 | V4L2_IDENT_WM8739 = 8739, | 141 | V4L2_IDENT_WM8739 = 8739, |
86 | 142 | ||
87 | /* module wm8775: just ident 8775 */ | 143 | /* module wm8775: just ident 8775 */ |
88 | V4L2_IDENT_WM8775 = 8775, | 144 | V4L2_IDENT_WM8775 = 8775, |
89 | 145 | ||
90 | /* module tw9910: just ident 9910 */ | 146 | /* module tda9840: just ident 9840 */ |
91 | V4L2_IDENT_TW9910 = 9910, | 147 | V4L2_IDENT_TDA9840 = 9840, |
92 | |||
93 | /* module cs53132a: just ident 53132 */ | ||
94 | V4L2_IDENT_CS53l32A = 53132, | ||
95 | |||
96 | /* module upd64031a: just ident 64031 */ | ||
97 | V4L2_IDENT_UPD64031A = 64031, | ||
98 | 148 | ||
99 | /* module upd64083: just ident 64083 */ | 149 | /* module cafe_ccic, just ident 8801 */ |
100 | V4L2_IDENT_UPD64083 = 64083, | 150 | V4L2_IDENT_CAFE = 8801, |
101 | 151 | ||
102 | /* module m52790: just ident 52790 */ | 152 | /* module tw9910: just ident 9910 */ |
103 | V4L2_IDENT_M52790 = 52790, | 153 | V4L2_IDENT_TW9910 = 9910, |
104 | 154 | ||
105 | /* module msp3400: reserved range 34000-34999 and 44000-44999 */ | 155 | /* module msp3400: reserved range 34000-34999 and 44000-44999 */ |
106 | V4L2_IDENT_MSPX4XX = 34000, /* generic MSPX4XX identifier, only | 156 | V4L2_IDENT_MSPX4XX = 34000, /* generic MSPX4XX identifier, only |
@@ -178,6 +228,18 @@ enum { | |||
178 | V4L2_IDENT_MT9V022IX7ATC = 45010, /* No way to detect "normal" I77ATx */ | 228 | V4L2_IDENT_MT9V022IX7ATC = 45010, /* No way to detect "normal" I77ATx */ |
179 | V4L2_IDENT_MT9V022IX7ATM = 45015, /* and "lead free" IA7ATx chips */ | 229 | V4L2_IDENT_MT9V022IX7ATM = 45015, /* and "lead free" IA7ATx chips */ |
180 | V4L2_IDENT_MT9T031 = 45020, | 230 | V4L2_IDENT_MT9T031 = 45020, |
231 | |||
232 | /* module cs53132a: just ident 53132 */ | ||
233 | V4L2_IDENT_CS53l32A = 53132, | ||
234 | |||
235 | /* module upd64031a: just ident 64031 */ | ||
236 | V4L2_IDENT_UPD64031A = 64031, | ||
237 | |||
238 | /* module upd64083: just ident 64083 */ | ||
239 | V4L2_IDENT_UPD64083 = 64083, | ||
240 | |||
241 | /* module m52790: just ident 52790 */ | ||
242 | V4L2_IDENT_M52790 = 52790, | ||
181 | }; | 243 | }; |
182 | 244 | ||
183 | #endif | 245 | #endif |
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 95e74f1874e1..3a6905615d68 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
@@ -102,11 +102,15 @@ int v4l2_ctrl_check(struct v4l2_ext_control *ctrl, struct v4l2_queryctrl *qctrl, | |||
102 | const char *v4l2_ctrl_get_name(u32 id); | 102 | const char *v4l2_ctrl_get_name(u32 id); |
103 | const char **v4l2_ctrl_get_menu(u32 id); | 103 | const char **v4l2_ctrl_get_menu(u32 id); |
104 | int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 step, s32 def); | 104 | int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 step, s32 def); |
105 | int v4l2_ctrl_query_fill_std(struct v4l2_queryctrl *qctrl); | ||
106 | int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu, | 105 | int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu, |
107 | struct v4l2_queryctrl *qctrl, const char **menu_items); | 106 | struct v4l2_queryctrl *qctrl, const char **menu_items); |
108 | #define V4L2_CTRL_MENU_IDS_END (0xffffffff) | 107 | #define V4L2_CTRL_MENU_IDS_END (0xffffffff) |
109 | int v4l2_ctrl_query_menu_valid_items(struct v4l2_querymenu *qmenu, const u32 *ids); | 108 | int v4l2_ctrl_query_menu_valid_items(struct v4l2_querymenu *qmenu, const u32 *ids); |
109 | |||
110 | /* Note: ctrl_classes points to an array of u32 pointers. Each u32 array is a | ||
111 | 0-terminated array of control IDs. Each array must be sorted low to high | ||
112 | and belong to the same control class. The array of u32 pointers must also | ||
113 | be sorted, from low class IDs to high class IDs. */ | ||
110 | u32 v4l2_ctrl_next(const u32 * const *ctrl_classes, u32 id); | 114 | u32 v4l2_ctrl_next(const u32 * const *ctrl_classes, u32 id); |
111 | 115 | ||
112 | /* ------------------------------------------------------------------------- */ | 116 | /* ------------------------------------------------------------------------- */ |
@@ -149,6 +153,21 @@ struct v4l2_subdev *v4l2_i2c_new_probed_subdev(struct i2c_adapter *adapter, | |||
149 | /* Initialize an v4l2_subdev with data from an i2c_client struct */ | 153 | /* Initialize an v4l2_subdev with data from an i2c_client struct */ |
150 | void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client, | 154 | void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client, |
151 | const struct v4l2_subdev_ops *ops); | 155 | const struct v4l2_subdev_ops *ops); |
156 | /* Return i2c client address of v4l2_subdev. */ | ||
157 | unsigned short v4l2_i2c_subdev_addr(struct v4l2_subdev *sd); | ||
158 | |||
159 | enum v4l2_i2c_tuner_type { | ||
160 | ADDRS_RADIO, /* Radio tuner addresses */ | ||
161 | ADDRS_DEMOD, /* Demod tuner addresses */ | ||
162 | ADDRS_TV, /* TV tuner addresses */ | ||
163 | /* TV tuner addresses if demod is present, this excludes | ||
164 | addresses used by the demodulator from the list of | ||
165 | candidates. */ | ||
166 | ADDRS_TV_WITH_DEMOD, | ||
167 | }; | ||
168 | /* Return a list of I2C tuner addresses to probe. Use only if the tuner | ||
169 | addresses are unknown. */ | ||
170 | const unsigned short *v4l2_i2c_tuner_addrs(enum v4l2_i2c_tuner_type type); | ||
152 | 171 | ||
153 | /* ------------------------------------------------------------------------- */ | 172 | /* ------------------------------------------------------------------------- */ |
154 | 173 | ||
@@ -284,4 +303,7 @@ struct v4l2_crystal_freq { | |||
284 | a v4l2_gpio struct if a direction is also needed. */ | 303 | a v4l2_gpio struct if a direction is also needed. */ |
285 | #define VIDIOC_INT_S_GPIO _IOW('d', 117, u32) | 304 | #define VIDIOC_INT_S_GPIO _IOW('d', 117, u32) |
286 | 305 | ||
306 | /* Get input status. Same as the status field in the v4l2_input struct. */ | ||
307 | #define VIDIOC_INT_G_INPUT_STATUS _IOR('d', 118, u32) | ||
308 | |||
287 | #endif /* V4L2_COMMON_H_ */ | 309 | #endif /* V4L2_COMMON_H_ */ |
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index e36faab8459b..2058dd45e915 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h | |||
@@ -40,6 +40,8 @@ struct v4l2_file_operations { | |||
40 | unsigned int (*poll) (struct file *, struct poll_table_struct *); | 40 | unsigned int (*poll) (struct file *, struct poll_table_struct *); |
41 | long (*ioctl) (struct file *, unsigned int, unsigned long); | 41 | long (*ioctl) (struct file *, unsigned int, unsigned long); |
42 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); | 42 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); |
43 | unsigned long (*get_unmapped_area) (struct file *, unsigned long, | ||
44 | unsigned long, unsigned long, unsigned long); | ||
43 | int (*mmap) (struct file *, struct vm_area_struct *); | 45 | int (*mmap) (struct file *, struct vm_area_struct *); |
44 | int (*open) (struct file *); | 46 | int (*open) (struct file *); |
45 | int (*release) (struct file *); | 47 | int (*release) (struct file *); |
diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h index 55e41afd95ef..0dd3e8e8653e 100644 --- a/include/media/v4l2-device.h +++ b/include/media/v4l2-device.h | |||
@@ -33,7 +33,9 @@ | |||
33 | #define V4L2_DEVICE_NAME_SIZE (BUS_ID_SIZE + 16) | 33 | #define V4L2_DEVICE_NAME_SIZE (BUS_ID_SIZE + 16) |
34 | 34 | ||
35 | struct v4l2_device { | 35 | struct v4l2_device { |
36 | /* dev->driver_data points to this struct */ | 36 | /* dev->driver_data points to this struct. |
37 | Note: dev might be NULL if there is no parent device | ||
38 | as is the case with e.g. ISA devices. */ | ||
37 | struct device *dev; | 39 | struct device *dev; |
38 | /* used to keep track of the registered subdevs */ | 40 | /* used to keep track of the registered subdevs */ |
39 | struct list_head subdevs; | 41 | struct list_head subdevs; |
@@ -42,33 +44,43 @@ struct v4l2_device { | |||
42 | spinlock_t lock; | 44 | spinlock_t lock; |
43 | /* unique device name, by default the driver name + bus ID */ | 45 | /* unique device name, by default the driver name + bus ID */ |
44 | char name[V4L2_DEVICE_NAME_SIZE]; | 46 | char name[V4L2_DEVICE_NAME_SIZE]; |
47 | /* notify callback called by some sub-devices. */ | ||
48 | void (*notify)(struct v4l2_subdev *sd, | ||
49 | unsigned int notification, void *arg); | ||
45 | }; | 50 | }; |
46 | 51 | ||
47 | /* Initialize v4l2_dev and make dev->driver_data point to v4l2_dev */ | 52 | /* Initialize v4l2_dev and make dev->driver_data point to v4l2_dev. |
53 | dev may be NULL in rare cases (ISA devices). In that case you | ||
54 | must fill in the v4l2_dev->name field before calling this function. */ | ||
48 | int __must_check v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev); | 55 | int __must_check v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev); |
49 | /* Set v4l2_dev->dev->driver_data to NULL and unregister all sub-devices */ | 56 | /* Set v4l2_dev->dev to NULL. Call when the USB parent disconnects. |
57 | Since the parent disappears this ensures that v4l2_dev doesn't have an | ||
58 | invalid parent pointer. */ | ||
59 | void v4l2_device_disconnect(struct v4l2_device *v4l2_dev); | ||
60 | /* Unregister all sub-devices and any other resources related to v4l2_dev. */ | ||
50 | void v4l2_device_unregister(struct v4l2_device *v4l2_dev); | 61 | void v4l2_device_unregister(struct v4l2_device *v4l2_dev); |
51 | 62 | ||
52 | /* Register a subdev with a v4l2 device. While registered the subdev module | 63 | /* Register a subdev with a v4l2 device. While registered the subdev module |
53 | is marked as in-use. An error is returned if the module is no longer | 64 | is marked as in-use. An error is returned if the module is no longer |
54 | loaded when you attempt to register it. */ | 65 | loaded when you attempt to register it. */ |
55 | int __must_check v4l2_device_register_subdev(struct v4l2_device *dev, struct v4l2_subdev *sd); | 66 | int __must_check v4l2_device_register_subdev(struct v4l2_device *v4l2_dev, |
67 | struct v4l2_subdev *sd); | ||
56 | /* Unregister a subdev with a v4l2 device. Can also be called if the subdev | 68 | /* Unregister a subdev with a v4l2 device. Can also be called if the subdev |
57 | wasn't registered. In that case it will do nothing. */ | 69 | wasn't registered. In that case it will do nothing. */ |
58 | void v4l2_device_unregister_subdev(struct v4l2_subdev *sd); | 70 | void v4l2_device_unregister_subdev(struct v4l2_subdev *sd); |
59 | 71 | ||
60 | /* Iterate over all subdevs. */ | 72 | /* Iterate over all subdevs. */ |
61 | #define v4l2_device_for_each_subdev(sd, dev) \ | 73 | #define v4l2_device_for_each_subdev(sd, v4l2_dev) \ |
62 | list_for_each_entry(sd, &(dev)->subdevs, list) | 74 | list_for_each_entry(sd, &(v4l2_dev)->subdevs, list) |
63 | 75 | ||
64 | /* Call the specified callback for all subdevs matching the condition. | 76 | /* Call the specified callback for all subdevs matching the condition. |
65 | Ignore any errors. Note that you cannot add or delete a subdev | 77 | Ignore any errors. Note that you cannot add or delete a subdev |
66 | while walking the subdevs list. */ | 78 | while walking the subdevs list. */ |
67 | #define __v4l2_device_call_subdevs(dev, cond, o, f, args...) \ | 79 | #define __v4l2_device_call_subdevs(v4l2_dev, cond, o, f, args...) \ |
68 | do { \ | 80 | do { \ |
69 | struct v4l2_subdev *sd; \ | 81 | struct v4l2_subdev *sd; \ |
70 | \ | 82 | \ |
71 | list_for_each_entry(sd, &(dev)->subdevs, list) \ | 83 | list_for_each_entry(sd, &(v4l2_dev)->subdevs, list) \ |
72 | if ((cond) && sd->ops->o && sd->ops->o->f) \ | 84 | if ((cond) && sd->ops->o && sd->ops->o->f) \ |
73 | sd->ops->o->f(sd , ##args); \ | 85 | sd->ops->o->f(sd , ##args); \ |
74 | } while (0) | 86 | } while (0) |
@@ -77,12 +89,12 @@ void v4l2_device_unregister_subdev(struct v4l2_subdev *sd); | |||
77 | If the callback returns an error other than 0 or -ENOIOCTLCMD, then | 89 | If the callback returns an error other than 0 or -ENOIOCTLCMD, then |
78 | return with that error code. Note that you cannot add or delete a | 90 | return with that error code. Note that you cannot add or delete a |
79 | subdev while walking the subdevs list. */ | 91 | subdev while walking the subdevs list. */ |
80 | #define __v4l2_device_call_subdevs_until_err(dev, cond, o, f, args...) \ | 92 | #define __v4l2_device_call_subdevs_until_err(v4l2_dev, cond, o, f, args...) \ |
81 | ({ \ | 93 | ({ \ |
82 | struct v4l2_subdev *sd; \ | 94 | struct v4l2_subdev *sd; \ |
83 | long err = 0; \ | 95 | long err = 0; \ |
84 | \ | 96 | \ |
85 | list_for_each_entry(sd, &(dev)->subdevs, list) { \ | 97 | list_for_each_entry(sd, &(v4l2_dev)->subdevs, list) { \ |
86 | if ((cond) && sd->ops->o && sd->ops->o->f) \ | 98 | if ((cond) && sd->ops->o && sd->ops->o->f) \ |
87 | err = sd->ops->o->f(sd , ##args); \ | 99 | err = sd->ops->o->f(sd , ##args); \ |
88 | if (err && err != -ENOIOCTLCMD) \ | 100 | if (err && err != -ENOIOCTLCMD) \ |
@@ -94,16 +106,16 @@ void v4l2_device_unregister_subdev(struct v4l2_subdev *sd); | |||
94 | /* Call the specified callback for all subdevs matching grp_id (if 0, then | 106 | /* Call the specified callback for all subdevs matching grp_id (if 0, then |
95 | match them all). Ignore any errors. Note that you cannot add or delete | 107 | match them all). Ignore any errors. Note that you cannot add or delete |
96 | a subdev while walking the subdevs list. */ | 108 | a subdev while walking the subdevs list. */ |
97 | #define v4l2_device_call_all(dev, grpid, o, f, args...) \ | 109 | #define v4l2_device_call_all(v4l2_dev, grpid, o, f, args...) \ |
98 | __v4l2_device_call_subdevs(dev, \ | 110 | __v4l2_device_call_subdevs(v4l2_dev, \ |
99 | !(grpid) || sd->grp_id == (grpid), o, f , ##args) | 111 | !(grpid) || sd->grp_id == (grpid), o, f , ##args) |
100 | 112 | ||
101 | /* Call the specified callback for all subdevs matching grp_id (if 0, then | 113 | /* Call the specified callback for all subdevs matching grp_id (if 0, then |
102 | match them all). If the callback returns an error other than 0 or | 114 | match them all). If the callback returns an error other than 0 or |
103 | -ENOIOCTLCMD, then return with that error code. Note that you cannot | 115 | -ENOIOCTLCMD, then return with that error code. Note that you cannot |
104 | add or delete a subdev while walking the subdevs list. */ | 116 | add or delete a subdev while walking the subdevs list. */ |
105 | #define v4l2_device_call_until_err(dev, grpid, o, f, args...) \ | 117 | #define v4l2_device_call_until_err(v4l2_dev, grpid, o, f, args...) \ |
106 | __v4l2_device_call_subdevs_until_err(dev, \ | 118 | __v4l2_device_call_subdevs_until_err(v4l2_dev, \ |
107 | !(grpid) || sd->grp_id == (grpid), o, f , ##args) | 119 | !(grpid) || sd->grp_id == (grpid), o, f , ##args) |
108 | 120 | ||
109 | #endif | 121 | #endif |
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h index b01c044868d0..7a4529defa88 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h | |||
@@ -15,6 +15,7 @@ | |||
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 | 17 | #ifdef CONFIG_VIDEO_V4L1_COMPAT |
18 | #define __MIN_V4L1 | ||
18 | #include <linux/videodev.h> | 19 | #include <linux/videodev.h> |
19 | #else | 20 | #else |
20 | #include <linux/videodev2.h> | 21 | #include <linux/videodev2.h> |
@@ -267,6 +268,7 @@ struct v4l2_ioctl_ops { | |||
267 | 268 | ||
268 | /* Video standard functions */ | 269 | /* Video standard functions */ |
269 | extern const char *v4l2_norm_to_name(v4l2_std_id id); | 270 | extern const char *v4l2_norm_to_name(v4l2_std_id id); |
271 | extern void v4l2_video_std_frame_period(int id, struct v4l2_fract *frameperiod); | ||
270 | extern int v4l2_video_std_construct(struct v4l2_standard *vs, | 272 | extern int v4l2_video_std_construct(struct v4l2_standard *vs, |
271 | int id, const char *name); | 273 | int id, const char *name); |
272 | /* Prints the ioctl in a human-readable format */ | 274 | /* Prints the ioctl in a human-readable format */ |
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 37b09e56e943..1d181b4ccb01 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h | |||
@@ -78,6 +78,9 @@ struct v4l2_subdev_core_ops { | |||
78 | int (*queryctrl)(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc); | 78 | int (*queryctrl)(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc); |
79 | int (*g_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl); | 79 | int (*g_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl); |
80 | int (*s_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl); | 80 | int (*s_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl); |
81 | int (*g_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls); | ||
82 | int (*s_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls); | ||
83 | int (*try_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls); | ||
81 | int (*querymenu)(struct v4l2_subdev *sd, struct v4l2_querymenu *qm); | 84 | int (*querymenu)(struct v4l2_subdev *sd, struct v4l2_querymenu *qm); |
82 | long (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg); | 85 | long (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg); |
83 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 86 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
@@ -112,9 +115,17 @@ struct v4l2_subdev_video_ops { | |||
112 | int (*g_vbi_data)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_data *vbi_data); | 115 | int (*g_vbi_data)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_data *vbi_data); |
113 | int (*g_sliced_vbi_cap)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_cap *cap); | 116 | int (*g_sliced_vbi_cap)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_cap *cap); |
114 | int (*s_std_output)(struct v4l2_subdev *sd, v4l2_std_id std); | 117 | int (*s_std_output)(struct v4l2_subdev *sd, v4l2_std_id std); |
118 | int (*querystd)(struct v4l2_subdev *sd, v4l2_std_id *std); | ||
119 | int (*g_input_status)(struct v4l2_subdev *sd, u32 *status); | ||
115 | int (*s_stream)(struct v4l2_subdev *sd, int enable); | 120 | int (*s_stream)(struct v4l2_subdev *sd, int enable); |
116 | int (*s_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt); | 121 | int (*enum_fmt)(struct v4l2_subdev *sd, struct v4l2_fmtdesc *fmtdesc); |
117 | int (*g_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt); | 122 | int (*g_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt); |
123 | int (*try_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt); | ||
124 | int (*s_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt); | ||
125 | int (*g_parm)(struct v4l2_subdev *sd, struct v4l2_streamparm *param); | ||
126 | int (*s_parm)(struct v4l2_subdev *sd, struct v4l2_streamparm *param); | ||
127 | int (*enum_framesizes)(struct v4l2_subdev *sd, struct v4l2_frmsizeenum *fsize); | ||
128 | int (*enum_frameintervals)(struct v4l2_subdev *sd, struct v4l2_frmivalenum *fival); | ||
118 | }; | 129 | }; |
119 | 130 | ||
120 | struct v4l2_subdev_ops { | 131 | struct v4l2_subdev_ops { |
@@ -132,7 +143,7 @@ struct v4l2_subdev_ops { | |||
132 | struct v4l2_subdev { | 143 | struct v4l2_subdev { |
133 | struct list_head list; | 144 | struct list_head list; |
134 | struct module *owner; | 145 | struct module *owner; |
135 | struct v4l2_device *dev; | 146 | struct v4l2_device *v4l2_dev; |
136 | const struct v4l2_subdev_ops *ops; | 147 | const struct v4l2_subdev_ops *ops; |
137 | /* name must be unique */ | 148 | /* name must be unique */ |
138 | char name[V4L2_SUBDEV_NAME_SIZE]; | 149 | char name[V4L2_SUBDEV_NAME_SIZE]; |
@@ -171,7 +182,7 @@ static inline void v4l2_subdev_init(struct v4l2_subdev *sd, | |||
171 | /* ops->core MUST be set */ | 182 | /* ops->core MUST be set */ |
172 | BUG_ON(!ops || !ops->core); | 183 | BUG_ON(!ops || !ops->core); |
173 | sd->ops = ops; | 184 | sd->ops = ops; |
174 | sd->dev = NULL; | 185 | sd->v4l2_dev = NULL; |
175 | sd->name[0] = '\0'; | 186 | sd->name[0] = '\0'; |
176 | sd->grp_id = 0; | 187 | sd->grp_id = 0; |
177 | sd->priv = NULL; | 188 | sd->priv = NULL; |
@@ -186,4 +197,9 @@ static inline void v4l2_subdev_init(struct v4l2_subdev *sd, | |||
186 | (!(sd) ? -ENODEV : (((sd) && (sd)->ops->o && (sd)->ops->o->f) ? \ | 197 | (!(sd) ? -ENODEV : (((sd) && (sd)->ops->o && (sd)->ops->o->f) ? \ |
187 | (sd)->ops->o->f((sd) , ##args) : -ENOIOCTLCMD)) | 198 | (sd)->ops->o->f((sd) , ##args) : -ENOIOCTLCMD)) |
188 | 199 | ||
200 | /* Send a notification to v4l2_device. */ | ||
201 | #define v4l2_subdev_notify(sd, notification, arg) \ | ||
202 | ((!(sd) || !(sd)->v4l2_dev || !(sd)->v4l2_dev->notify) ? -ENODEV : \ | ||
203 | (sd)->v4l2_dev->notify((sd), (notification), (arg))) | ||
204 | |||
189 | #endif | 205 | #endif |
diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h index 874f1340d049..1c5946c44758 100644 --- a/include/media/videobuf-core.h +++ b/include/media/videobuf-core.h | |||
@@ -18,6 +18,7 @@ | |||
18 | 18 | ||
19 | #include <linux/poll.h> | 19 | #include <linux/poll.h> |
20 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | 20 | #ifdef CONFIG_VIDEO_V4L1_COMPAT |
21 | #define __MIN_V4L1 | ||
21 | #include <linux/videodev.h> | 22 | #include <linux/videodev.h> |
22 | #endif | 23 | #endif |
23 | #include <linux/videodev2.h> | 24 | #include <linux/videodev2.h> |