diff options
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/cx25840.h | 1 | ||||
-rw-r--r-- | include/media/davinci/vpfe_capture.h | 2 | ||||
-rw-r--r-- | include/media/ir-common.h | 40 | ||||
-rw-r--r-- | include/media/ir-core.h | 62 | ||||
-rw-r--r-- | include/media/mt9t112.h | 30 | ||||
-rw-r--r-- | include/media/ov772x.h | 4 | ||||
-rw-r--r-- | include/media/rj54n1cb0c.h | 19 | ||||
-rw-r--r-- | include/media/saa7146_vv.h | 4 | ||||
-rw-r--r-- | include/media/sh_mobile_ceu.h | 2 | ||||
-rw-r--r-- | include/media/soc_camera.h | 30 | ||||
-rw-r--r-- | include/media/soc_camera_platform.h | 3 | ||||
-rw-r--r-- | include/media/soc_mediabus.h | 65 | ||||
-rw-r--r-- | include/media/tw9910.h | 1 | ||||
-rw-r--r-- | include/media/v4l2-chip-ident.h | 25 | ||||
-rw-r--r-- | include/media/v4l2-common.h | 2 | ||||
-rw-r--r-- | include/media/v4l2-dev.h | 23 | ||||
-rw-r--r-- | include/media/v4l2-ioctl.h | 15 | ||||
-rw-r--r-- | include/media/v4l2-mediabus.h | 61 | ||||
-rw-r--r-- | include/media/v4l2-subdev.h | 162 | ||||
-rw-r--r-- | include/media/videobuf-core.h | 4 | ||||
-rw-r--r-- | include/media/videobuf-dma-contig.h | 2 | ||||
-rw-r--r-- | include/media/videobuf-dma-sg.h | 2 | ||||
-rw-r--r-- | include/media/videobuf-dvb.h | 4 | ||||
-rw-r--r-- | include/media/videobuf-vmalloc.h | 4 |
24 files changed, 482 insertions, 85 deletions
diff --git a/include/media/cx25840.h b/include/media/cx25840.h index 2c3fbaa33f74..0b0cb1776796 100644 --- a/include/media/cx25840.h +++ b/include/media/cx25840.h | |||
@@ -84,6 +84,7 @@ enum cx25840_video_input { | |||
84 | CX25840_NONE0_CH3 = 0x80000080, | 84 | CX25840_NONE0_CH3 = 0x80000080, |
85 | CX25840_NONE1_CH3 = 0x800000c0, | 85 | CX25840_NONE1_CH3 = 0x800000c0, |
86 | CX25840_SVIDEO_ON = 0x80000100, | 86 | CX25840_SVIDEO_ON = 0x80000100, |
87 | CX25840_COMPONENT_ON = 0x80000200, | ||
87 | }; | 88 | }; |
88 | 89 | ||
89 | enum cx25840_audio_input { | 90 | enum cx25840_audio_input { |
diff --git a/include/media/davinci/vpfe_capture.h b/include/media/davinci/vpfe_capture.h index 71d8982e13ff..d863e5e8426d 100644 --- a/include/media/davinci/vpfe_capture.h +++ b/include/media/davinci/vpfe_capture.h | |||
@@ -83,6 +83,8 @@ struct vpfe_subdev_info { | |||
83 | struct vpfe_config { | 83 | struct vpfe_config { |
84 | /* Number of sub devices connected to vpfe */ | 84 | /* Number of sub devices connected to vpfe */ |
85 | int num_subdevs; | 85 | int num_subdevs; |
86 | /* i2c bus adapter no */ | ||
87 | int i2c_adapter_id; | ||
86 | /* information about each subdev */ | 88 | /* information about each subdev */ |
87 | struct vpfe_subdev_info *sub_devs; | 89 | struct vpfe_subdev_info *sub_devs; |
88 | /* evm card info */ | 90 | /* evm card info */ |
diff --git a/include/media/ir-common.h b/include/media/ir-common.h index 29f0e53cff94..2c6af24b905e 100644 --- a/include/media/ir-common.h +++ b/include/media/ir-common.h | |||
@@ -26,26 +26,7 @@ | |||
26 | #include <linux/input.h> | 26 | #include <linux/input.h> |
27 | #include <linux/workqueue.h> | 27 | #include <linux/workqueue.h> |
28 | #include <linux/interrupt.h> | 28 | #include <linux/interrupt.h> |
29 | 29 | #include <media/ir-core.h> | |
30 | #define IR_TYPE_RC5 1 | ||
31 | #define IR_TYPE_PD 2 /* Pulse distance encoded IR */ | ||
32 | #define IR_TYPE_OTHER 99 | ||
33 | |||
34 | #define IR_KEYTAB_TYPE u32 | ||
35 | #define IR_KEYTAB_SIZE 128 /* enougth for rc5, probably need more some day */ | ||
36 | |||
37 | struct ir_scancode { | ||
38 | u16 scancode; | ||
39 | u32 keycode; | ||
40 | }; | ||
41 | |||
42 | struct ir_scancode_table { | ||
43 | struct ir_scancode *scan; | ||
44 | int size; | ||
45 | }; | ||
46 | |||
47 | #define IR_KEYCODE(tab,code) (((unsigned)code < IR_KEYTAB_SIZE) \ | ||
48 | ? tab[code] : KEY_RESERVED) | ||
49 | 30 | ||
50 | #define RC5_START(x) (((x)>>12)&3) | 31 | #define RC5_START(x) (((x)>>12)&3) |
51 | #define RC5_TOGGLE(x) (((x)>>11)&1) | 32 | #define RC5_TOGGLE(x) (((x)>>11)&1) |
@@ -55,11 +36,9 @@ struct ir_scancode_table { | |||
55 | struct ir_input_state { | 36 | struct ir_input_state { |
56 | /* configuration */ | 37 | /* configuration */ |
57 | int ir_type; | 38 | int ir_type; |
58 | IR_KEYTAB_TYPE ir_codes[IR_KEYTAB_SIZE]; | ||
59 | 39 | ||
60 | /* key info */ | 40 | /* key info */ |
61 | u32 ir_raw; /* raw data */ | 41 | u32 ir_key; /* ir scancode */ |
62 | u32 ir_key; /* ir key code */ | ||
63 | u32 keycode; /* linux key code */ | 42 | u32 keycode; /* linux key code */ |
64 | int keypressed; /* current state */ | 43 | int keypressed; /* current state */ |
65 | }; | 44 | }; |
@@ -102,20 +81,23 @@ struct card_ir { | |||
102 | struct tasklet_struct tlet; | 81 | struct tasklet_struct tlet; |
103 | }; | 82 | }; |
104 | 83 | ||
105 | void ir_input_init(struct input_dev *dev, struct ir_input_state *ir, | 84 | /* Routines from ir-functions.c */ |
106 | int ir_type, struct ir_scancode_table *ir_codes); | 85 | |
86 | int ir_input_init(struct input_dev *dev, struct ir_input_state *ir, | ||
87 | int ir_type); | ||
107 | void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); | 88 | void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); |
108 | void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir, | 89 | void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir, |
109 | u32 ir_key, u32 ir_raw); | 90 | u32 ir_key); |
110 | u32 ir_extract_bits(u32 data, u32 mask); | 91 | u32 ir_extract_bits(u32 data, u32 mask); |
111 | int ir_dump_samples(u32 *samples, int count); | 92 | int ir_dump_samples(u32 *samples, int count); |
112 | int ir_decode_biphase(u32 *samples, int count, int low, int high); | 93 | int ir_decode_biphase(u32 *samples, int count, int low, int high); |
113 | int ir_decode_pulsedistance(u32 *samples, int count, int low, int high); | 94 | int ir_decode_pulsedistance(u32 *samples, int count, int low, int high); |
95 | u32 ir_rc5_decode(unsigned int code); | ||
114 | 96 | ||
115 | void ir_rc5_timer_end(unsigned long data); | 97 | void ir_rc5_timer_end(unsigned long data); |
116 | void ir_rc5_timer_keyup(unsigned long data); | 98 | void ir_rc5_timer_keyup(unsigned long data); |
117 | 99 | ||
118 | /* Keymaps to be used by other modules */ | 100 | /* scancode->keycode map tables from ir-keymaps.c */ |
119 | 101 | ||
120 | extern struct ir_scancode_table ir_codes_empty_table; | 102 | extern struct ir_scancode_table ir_codes_empty_table; |
121 | extern struct ir_scancode_table ir_codes_avermedia_table; | 103 | extern struct ir_scancode_table ir_codes_avermedia_table; |
@@ -150,6 +132,7 @@ extern struct ir_scancode_table ir_codes_rc5_tv_table; | |||
150 | extern struct ir_scancode_table ir_codes_winfast_table; | 132 | extern struct ir_scancode_table ir_codes_winfast_table; |
151 | extern struct ir_scancode_table ir_codes_pinnacle_color_table; | 133 | extern struct ir_scancode_table ir_codes_pinnacle_color_table; |
152 | extern struct ir_scancode_table ir_codes_hauppauge_new_table; | 134 | extern struct ir_scancode_table ir_codes_hauppauge_new_table; |
135 | extern struct ir_scancode_table ir_codes_rc5_hauppauge_new_table; | ||
153 | extern struct ir_scancode_table ir_codes_npgtech_table; | 136 | extern struct ir_scancode_table ir_codes_npgtech_table; |
154 | extern struct ir_scancode_table ir_codes_norwood_table; | 137 | extern struct ir_scancode_table ir_codes_norwood_table; |
155 | extern struct ir_scancode_table ir_codes_proteus_2309_table; | 138 | extern struct ir_scancode_table ir_codes_proteus_2309_table; |
@@ -172,8 +155,11 @@ extern struct ir_scancode_table ir_codes_ati_tv_wonder_hd_600_table; | |||
172 | extern struct ir_scancode_table ir_codes_kworld_plus_tv_analog_table; | 155 | extern struct ir_scancode_table ir_codes_kworld_plus_tv_analog_table; |
173 | extern struct ir_scancode_table ir_codes_kaiomy_table; | 156 | extern struct ir_scancode_table ir_codes_kaiomy_table; |
174 | extern struct ir_scancode_table ir_codes_dm1105_nec_table; | 157 | extern struct ir_scancode_table ir_codes_dm1105_nec_table; |
158 | extern struct ir_scancode_table ir_codes_tevii_nec_table; | ||
159 | extern struct ir_scancode_table ir_codes_tbs_nec_table; | ||
175 | extern struct ir_scancode_table ir_codes_evga_indtube_table; | 160 | extern struct ir_scancode_table ir_codes_evga_indtube_table; |
176 | extern struct ir_scancode_table ir_codes_terratec_cinergy_xs_table; | 161 | extern struct ir_scancode_table ir_codes_terratec_cinergy_xs_table; |
177 | extern struct ir_scancode_table ir_codes_videomate_s350_table; | 162 | extern struct ir_scancode_table ir_codes_videomate_s350_table; |
178 | extern struct ir_scancode_table ir_codes_gadmei_rm008z_table; | 163 | extern struct ir_scancode_table ir_codes_gadmei_rm008z_table; |
164 | extern struct ir_scancode_table ir_codes_nec_terratec_cinergy_xs_table; | ||
179 | #endif | 165 | #endif |
diff --git a/include/media/ir-core.h b/include/media/ir-core.h new file mode 100644 index 000000000000..299d201e1339 --- /dev/null +++ b/include/media/ir-core.h | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | * Remote Controller core header | ||
3 | * | ||
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 | ||
6 | * the Free Software Foundation version 2 of the License. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | */ | ||
13 | |||
14 | #ifndef _IR_CORE | ||
15 | #define _IR_CORE | ||
16 | |||
17 | #include <linux/input.h> | ||
18 | #include <linux/spinlock.h> | ||
19 | |||
20 | extern int ir_core_debug; | ||
21 | #define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \ | ||
22 | printk(KERN_DEBUG "%s: " fmt , __func__, ## arg) | ||
23 | |||
24 | enum ir_type { | ||
25 | IR_TYPE_UNKNOWN = 0, | ||
26 | IR_TYPE_RC5 = 1, | ||
27 | IR_TYPE_PD = 2, /* Pulse distance encoded IR */ | ||
28 | IR_TYPE_NEC = 3, | ||
29 | IR_TYPE_OTHER = 99, | ||
30 | }; | ||
31 | |||
32 | struct ir_scancode { | ||
33 | u16 scancode; | ||
34 | u32 keycode; | ||
35 | }; | ||
36 | |||
37 | struct ir_scancode_table { | ||
38 | struct ir_scancode *scan; | ||
39 | int size; | ||
40 | enum ir_type ir_type; | ||
41 | spinlock_t lock; | ||
42 | }; | ||
43 | |||
44 | struct ir_input_dev { | ||
45 | struct input_dev *dev; | ||
46 | struct ir_scancode_table rc_tab; | ||
47 | }; | ||
48 | |||
49 | /* Routines from ir-keytable.c */ | ||
50 | |||
51 | u32 ir_g_keycode_from_table(struct input_dev *input_dev, | ||
52 | u32 scancode); | ||
53 | |||
54 | int ir_set_keycode_table(struct input_dev *input_dev, | ||
55 | struct ir_scancode_table *rc_tab); | ||
56 | |||
57 | int ir_roundup_tablesize(int n_elems); | ||
58 | int ir_input_register(struct input_dev *dev, | ||
59 | struct ir_scancode_table *ir_codes); | ||
60 | void ir_input_unregister(struct input_dev *input_dev); | ||
61 | |||
62 | #endif | ||
diff --git a/include/media/mt9t112.h b/include/media/mt9t112.h new file mode 100644 index 000000000000..a43c74ab05ec --- /dev/null +++ b/include/media/mt9t112.h | |||
@@ -0,0 +1,30 @@ | |||
1 | /* mt9t112 Camera | ||
2 | * | ||
3 | * Copyright (C) 2009 Renesas Solutions Corp. | ||
4 | * Kuninori Morimoto <morimoto.kuninori@renesas.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 version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __MT9T112_H__ | ||
12 | #define __MT9T112_H__ | ||
13 | |||
14 | #define MT9T112_FLAG_PCLK_RISING_EDGE (1 << 0) | ||
15 | #define MT9T112_FLAG_DATAWIDTH_8 (1 << 1) /* default width is 10 */ | ||
16 | |||
17 | struct mt9t112_pll_divider { | ||
18 | u8 m, n; | ||
19 | u8 p1, p2, p3, p4, p5, p6, p7; | ||
20 | }; | ||
21 | |||
22 | /* | ||
23 | * mt9t112 camera info | ||
24 | */ | ||
25 | struct mt9t112_camera_info { | ||
26 | u32 flags; | ||
27 | struct mt9t112_pll_divider divider; | ||
28 | }; | ||
29 | |||
30 | #endif /* __MT9T112_H__ */ | ||
diff --git a/include/media/ov772x.h b/include/media/ov772x.h index 30d9629198ef..14c77efd6a85 100644 --- a/include/media/ov772x.h +++ b/include/media/ov772x.h | |||
@@ -1,4 +1,5 @@ | |||
1 | /* ov772x Camera | 1 | /* |
2 | * ov772x Camera | ||
2 | * | 3 | * |
3 | * Copyright (C) 2008 Renesas Solutions Corp. | 4 | * Copyright (C) 2008 Renesas Solutions Corp. |
4 | * Kuninori Morimoto <morimoto.kuninori@renesas.com> | 5 | * Kuninori Morimoto <morimoto.kuninori@renesas.com> |
@@ -54,7 +55,6 @@ struct ov772x_edge_ctrl { | |||
54 | struct ov772x_camera_info { | 55 | struct ov772x_camera_info { |
55 | unsigned long buswidth; | 56 | unsigned long buswidth; |
56 | unsigned long flags; | 57 | unsigned long flags; |
57 | struct soc_camera_link link; | ||
58 | struct ov772x_edge_ctrl edgectrl; | 58 | struct ov772x_edge_ctrl edgectrl; |
59 | }; | 59 | }; |
60 | 60 | ||
diff --git a/include/media/rj54n1cb0c.h b/include/media/rj54n1cb0c.h new file mode 100644 index 000000000000..8ae3288ae925 --- /dev/null +++ b/include/media/rj54n1cb0c.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * RJ54N1CB0C Private data | ||
3 | * | ||
4 | * Copyright (C) 2009, Guennadi Liakhovetski <g.liakhovetski@gmx.de> | ||
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 __RJ54N1CB0C_H__ | ||
12 | #define __RJ54N1CB0C_H__ | ||
13 | |||
14 | struct rj54n1_pdata { | ||
15 | unsigned int mclk_freq; | ||
16 | bool ioctl_high; | ||
17 | }; | ||
18 | |||
19 | #endif | ||
diff --git a/include/media/saa7146_vv.h b/include/media/saa7146_vv.h index eed5fccc83f3..4aeff96ff7d8 100644 --- a/include/media/saa7146_vv.h +++ b/include/media/saa7146_vv.h | |||
@@ -108,8 +108,6 @@ struct saa7146_fh { | |||
108 | 108 | ||
109 | struct saa7146_vv | 109 | struct saa7146_vv |
110 | { | 110 | { |
111 | int vbi_minor; | ||
112 | |||
113 | /* vbi capture */ | 111 | /* vbi capture */ |
114 | struct saa7146_dmaqueue vbi_q; | 112 | struct saa7146_dmaqueue vbi_q; |
115 | /* vbi workaround interrupt queue */ | 113 | /* vbi workaround interrupt queue */ |
@@ -117,8 +115,6 @@ struct saa7146_vv | |||
117 | int vbi_fieldcount; | 115 | int vbi_fieldcount; |
118 | struct saa7146_fh *vbi_streaming; | 116 | struct saa7146_fh *vbi_streaming; |
119 | 117 | ||
120 | int video_minor; | ||
121 | |||
122 | int video_status; | 118 | int video_status; |
123 | struct saa7146_fh *video_fh; | 119 | struct saa7146_fh *video_fh; |
124 | 120 | ||
diff --git a/include/media/sh_mobile_ceu.h b/include/media/sh_mobile_ceu.h index 0f3524cff435..b67747836878 100644 --- a/include/media/sh_mobile_ceu.h +++ b/include/media/sh_mobile_ceu.h | |||
@@ -3,6 +3,8 @@ | |||
3 | 3 | ||
4 | #define SH_CEU_FLAG_USE_8BIT_BUS (1 << 0) /* use 8bit bus width */ | 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 | #define SH_CEU_FLAG_USE_16BIT_BUS (1 << 1) /* use 16bit bus width */ |
6 | #define SH_CEU_FLAG_HSYNC_LOW (1 << 2) /* default High if possible */ | ||
7 | #define SH_CEU_FLAG_VSYNC_LOW (1 << 3) /* default High if possible */ | ||
6 | 8 | ||
7 | struct sh_mobile_ceu_info { | 9 | struct sh_mobile_ceu_info { |
8 | unsigned long flags; | 10 | unsigned long flags; |
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index 3d74e60032dd..dcc5b86bcb6c 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h | |||
@@ -24,18 +24,13 @@ struct soc_camera_device { | |||
24 | struct device *pdev; /* Platform device */ | 24 | struct device *pdev; /* Platform device */ |
25 | s32 user_width; | 25 | s32 user_width; |
26 | s32 user_height; | 26 | s32 user_height; |
27 | unsigned short width_min; | 27 | enum v4l2_colorspace colorspace; |
28 | unsigned short height_min; | ||
29 | unsigned short y_skip_top; /* Lines to skip at the top */ | ||
30 | unsigned char iface; /* Host number */ | 28 | unsigned char iface; /* Host number */ |
31 | unsigned char devnum; /* Device number per host */ | 29 | unsigned char devnum; /* Device number per host */ |
32 | unsigned char buswidth; /* See comment in .c */ | ||
33 | struct soc_camera_sense *sense; /* See comment in struct definition */ | 30 | struct soc_camera_sense *sense; /* See comment in struct definition */ |
34 | struct soc_camera_ops *ops; | 31 | struct soc_camera_ops *ops; |
35 | struct video_device *vdev; | 32 | struct video_device *vdev; |
36 | const struct soc_camera_data_format *current_fmt; | 33 | const struct soc_camera_format_xlate *current_fmt; |
37 | const struct soc_camera_data_format *formats; | ||
38 | int num_formats; | ||
39 | struct soc_camera_format_xlate *user_formats; | 34 | struct soc_camera_format_xlate *user_formats; |
40 | int num_user_formats; | 35 | int num_user_formats; |
41 | enum v4l2_field field; /* Preserve field over close() */ | 36 | enum v4l2_field field; /* Preserve field over close() */ |
@@ -107,6 +102,8 @@ struct soc_camera_link { | |||
107 | int i2c_adapter_id; | 102 | int i2c_adapter_id; |
108 | struct i2c_board_info *board_info; | 103 | struct i2c_board_info *board_info; |
109 | const char *module_name; | 104 | const char *module_name; |
105 | void *priv; | ||
106 | |||
110 | /* | 107 | /* |
111 | * For non-I2C devices platform platform has to provide methods to | 108 | * For non-I2C devices platform platform has to provide methods to |
112 | * add a device to the system and to remove | 109 | * add a device to the system and to remove |
@@ -162,23 +159,13 @@ static inline struct v4l2_subdev *soc_camera_to_subdev( | |||
162 | int soc_camera_host_register(struct soc_camera_host *ici); | 159 | int soc_camera_host_register(struct soc_camera_host *ici); |
163 | void soc_camera_host_unregister(struct soc_camera_host *ici); | 160 | void soc_camera_host_unregister(struct soc_camera_host *ici); |
164 | 161 | ||
165 | const struct soc_camera_data_format *soc_camera_format_by_fourcc( | ||
166 | struct soc_camera_device *icd, unsigned int fourcc); | ||
167 | const struct soc_camera_format_xlate *soc_camera_xlate_by_fourcc( | 162 | const struct soc_camera_format_xlate *soc_camera_xlate_by_fourcc( |
168 | struct soc_camera_device *icd, unsigned int fourcc); | 163 | struct soc_camera_device *icd, unsigned int fourcc); |
169 | 164 | ||
170 | struct soc_camera_data_format { | ||
171 | const char *name; | ||
172 | unsigned int depth; | ||
173 | __u32 fourcc; | ||
174 | enum v4l2_colorspace colorspace; | ||
175 | }; | ||
176 | |||
177 | /** | 165 | /** |
178 | * struct soc_camera_format_xlate - match between host and sensor formats | 166 | * struct soc_camera_format_xlate - match between host and sensor formats |
179 | * @cam_fmt: sensor format provided by the sensor | 167 | * @code: code of a sensor provided format |
180 | * @host_fmt: host format after host translation from cam_fmt | 168 | * @host_fmt: host format after host translation from code |
181 | * @buswidth: bus width for this format | ||
182 | * | 169 | * |
183 | * Host and sensor translation structure. Used in table of host and sensor | 170 | * Host and sensor translation structure. Used in table of host and sensor |
184 | * formats matchings in soc_camera_device. A host can override the generic list | 171 | * formats matchings in soc_camera_device. A host can override the generic list |
@@ -186,9 +173,8 @@ struct soc_camera_data_format { | |||
186 | * format setup. | 173 | * format setup. |
187 | */ | 174 | */ |
188 | struct soc_camera_format_xlate { | 175 | struct soc_camera_format_xlate { |
189 | const struct soc_camera_data_format *cam_fmt; | 176 | enum v4l2_mbus_pixelcode code; |
190 | const struct soc_camera_data_format *host_fmt; | 177 | const struct soc_mbus_pixelfmt *host_fmt; |
191 | unsigned char buswidth; | ||
192 | }; | 178 | }; |
193 | 179 | ||
194 | struct soc_camera_ops { | 180 | struct soc_camera_ops { |
diff --git a/include/media/soc_camera_platform.h b/include/media/soc_camera_platform.h index bb70401b8141..0ecefe227b76 100644 --- a/include/media/soc_camera_platform.h +++ b/include/media/soc_camera_platform.h | |||
@@ -19,11 +19,10 @@ struct device; | |||
19 | struct soc_camera_platform_info { | 19 | struct soc_camera_platform_info { |
20 | const char *format_name; | 20 | const char *format_name; |
21 | unsigned long format_depth; | 21 | unsigned long format_depth; |
22 | struct v4l2_pix_format format; | 22 | struct v4l2_mbus_framefmt format; |
23 | unsigned long bus_param; | 23 | unsigned long bus_param; |
24 | struct device *dev; | 24 | struct device *dev; |
25 | int (*set_capture)(struct soc_camera_platform_info *info, int enable); | 25 | int (*set_capture)(struct soc_camera_platform_info *info, int enable); |
26 | struct soc_camera_link link; | ||
27 | }; | 26 | }; |
28 | 27 | ||
29 | #endif /* __SOC_CAMERA_H__ */ | 28 | #endif /* __SOC_CAMERA_H__ */ |
diff --git a/include/media/soc_mediabus.h b/include/media/soc_mediabus.h new file mode 100644 index 000000000000..037cd7be001e --- /dev/null +++ b/include/media/soc_mediabus.h | |||
@@ -0,0 +1,65 @@ | |||
1 | /* | ||
2 | * SoC-camera Media Bus API extensions | ||
3 | * | ||
4 | * Copyright (C) 2009, Guennadi Liakhovetski <g.liakhovetski@gmx.de> | ||
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 SOC_MEDIABUS_H | ||
12 | #define SOC_MEDIABUS_H | ||
13 | |||
14 | #include <linux/videodev2.h> | ||
15 | |||
16 | #include <media/v4l2-mediabus.h> | ||
17 | |||
18 | /** | ||
19 | * enum soc_mbus_packing - data packing types on the media-bus | ||
20 | * @SOC_MBUS_PACKING_NONE: no packing, bit-for-bit transfer to RAM | ||
21 | * @SOC_MBUS_PACKING_2X8_PADHI: 16 bits transferred in 2 8-bit samples, in the | ||
22 | * possibly incomplete byte high bits are padding | ||
23 | * @SOC_MBUS_PACKING_2X8_PADLO: as above, but low bits are padding | ||
24 | * @SOC_MBUS_PACKING_EXTEND16: sample width (e.g., 10 bits) has to be extended | ||
25 | * to 16 bits | ||
26 | */ | ||
27 | enum soc_mbus_packing { | ||
28 | SOC_MBUS_PACKING_NONE, | ||
29 | SOC_MBUS_PACKING_2X8_PADHI, | ||
30 | SOC_MBUS_PACKING_2X8_PADLO, | ||
31 | SOC_MBUS_PACKING_EXTEND16, | ||
32 | }; | ||
33 | |||
34 | /** | ||
35 | * enum soc_mbus_order - sample order on the media bus | ||
36 | * @SOC_MBUS_ORDER_LE: least significant sample first | ||
37 | * @SOC_MBUS_ORDER_BE: most significant sample first | ||
38 | */ | ||
39 | enum soc_mbus_order { | ||
40 | SOC_MBUS_ORDER_LE, | ||
41 | SOC_MBUS_ORDER_BE, | ||
42 | }; | ||
43 | |||
44 | /** | ||
45 | * struct soc_mbus_pixelfmt - Data format on the media bus | ||
46 | * @name: Name of the format | ||
47 | * @fourcc: Fourcc code, that will be obtained if the data is | ||
48 | * stored in memory in the following way: | ||
49 | * @packing: Type of sample-packing, that has to be used | ||
50 | * @order: Sample order when storing in memory | ||
51 | * @bits_per_sample: How many bits the bridge has to sample | ||
52 | */ | ||
53 | struct soc_mbus_pixelfmt { | ||
54 | const char *name; | ||
55 | u32 fourcc; | ||
56 | enum soc_mbus_packing packing; | ||
57 | enum soc_mbus_order order; | ||
58 | u8 bits_per_sample; | ||
59 | }; | ||
60 | |||
61 | const struct soc_mbus_pixelfmt *soc_mbus_get_fmtdesc( | ||
62 | enum v4l2_mbus_pixelcode code); | ||
63 | s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf); | ||
64 | |||
65 | #endif | ||
diff --git a/include/media/tw9910.h b/include/media/tw9910.h index 73231e7880d8..5e2895a05e6b 100644 --- a/include/media/tw9910.h +++ b/include/media/tw9910.h | |||
@@ -32,7 +32,6 @@ enum tw9910_mpout_pin { | |||
32 | struct tw9910_video_info { | 32 | struct tw9910_video_info { |
33 | unsigned long buswidth; | 33 | unsigned long buswidth; |
34 | enum tw9910_mpout_pin mpout; | 34 | enum tw9910_mpout_pin mpout; |
35 | struct soc_camera_link link; | ||
36 | }; | 35 | }; |
37 | 36 | ||
38 | 37 | ||
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h index cf16689adba7..6cc107d198a0 100644 --- a/include/media/v4l2-chip-ident.h +++ b/include/media/v4l2-chip-ident.h | |||
@@ -64,6 +64,7 @@ enum { | |||
64 | V4L2_IDENT_OV9650 = 254, | 64 | V4L2_IDENT_OV9650 = 254, |
65 | V4L2_IDENT_OV9655 = 255, | 65 | V4L2_IDENT_OV9655 = 255, |
66 | V4L2_IDENT_SOI968 = 256, | 66 | V4L2_IDENT_SOI968 = 256, |
67 | V4L2_IDENT_OV9640 = 257, | ||
67 | 68 | ||
68 | /* module saa7146: reserved range 300-309 */ | 69 | /* module saa7146: reserved range 300-309 */ |
69 | V4L2_IDENT_SAA7146 = 300, | 70 | V4L2_IDENT_SAA7146 = 300, |
@@ -72,6 +73,7 @@ enum { | |||
72 | V4L2_IDENT_CX23418_843 = 403, /* Integrated A/V Decoder on the '418 */ | 73 | V4L2_IDENT_CX23418_843 = 403, /* Integrated A/V Decoder on the '418 */ |
73 | V4L2_IDENT_CX23415 = 415, | 74 | V4L2_IDENT_CX23415 = 415, |
74 | V4L2_IDENT_CX23416 = 416, | 75 | V4L2_IDENT_CX23416 = 416, |
76 | V4L2_IDENT_CX23417 = 417, | ||
75 | V4L2_IDENT_CX23418 = 418, | 77 | V4L2_IDENT_CX23418 = 418, |
76 | 78 | ||
77 | /* module au0828 */ | 79 | /* module au0828 */ |
@@ -129,6 +131,9 @@ enum { | |||
129 | V4L2_IDENT_SAA6752HS = 6752, | 131 | V4L2_IDENT_SAA6752HS = 6752, |
130 | V4L2_IDENT_SAA6752HS_AC3 = 6753, | 132 | V4L2_IDENT_SAA6752HS_AC3 = 6753, |
131 | 133 | ||
134 | /* modules tef6862: just ident 6862 */ | ||
135 | V4L2_IDENT_TEF6862 = 6862, | ||
136 | |||
132 | /* module adv7170: just ident 7170 */ | 137 | /* module adv7170: just ident 7170 */ |
133 | V4L2_IDENT_ADV7170 = 7170, | 138 | V4L2_IDENT_ADV7170 = 7170, |
134 | 139 | ||
@@ -165,12 +170,27 @@ enum { | |||
165 | /* module mt9v011, just ident 8243 */ | 170 | /* module mt9v011, just ident 8243 */ |
166 | V4L2_IDENT_MT9V011 = 8243, | 171 | V4L2_IDENT_MT9V011 = 8243, |
167 | 172 | ||
173 | /* module cx23885 and cx25840 */ | ||
174 | V4L2_IDENT_CX23885 = 8850, | ||
175 | V4L2_IDENT_CX23885_AV = 8851, /* Integrated A/V decoder */ | ||
176 | V4L2_IDENT_CX23887 = 8870, | ||
177 | V4L2_IDENT_CX23887_AV = 8871, /* Integrated A/V decoder */ | ||
178 | V4L2_IDENT_CX23888 = 8880, | ||
179 | V4L2_IDENT_CX23888_AV = 8881, /* Integrated A/V decoder */ | ||
180 | V4L2_IDENT_CX23888_IR = 8882, /* Integrated infrared controller */ | ||
181 | |||
168 | /* module tw9910: just ident 9910 */ | 182 | /* module tw9910: just ident 9910 */ |
169 | V4L2_IDENT_TW9910 = 9910, | 183 | V4L2_IDENT_TW9910 = 9910, |
170 | 184 | ||
171 | /* module sn9c20x: just ident 10000 */ | 185 | /* module sn9c20x: just ident 10000 */ |
172 | V4L2_IDENT_SN9C20X = 10000, | 186 | V4L2_IDENT_SN9C20X = 10000, |
173 | 187 | ||
188 | /* module cx231xx and cx25840 */ | ||
189 | V4L2_IDENT_CX2310X_AV = 23099, /* Integrated A/V decoder; not in '100 */ | ||
190 | V4L2_IDENT_CX23100 = 23100, | ||
191 | V4L2_IDENT_CX23101 = 23101, | ||
192 | V4L2_IDENT_CX23102 = 23102, | ||
193 | |||
174 | /* module msp3400: reserved range 34000-34999 and 44000-44999 */ | 194 | /* module msp3400: reserved range 34000-34999 and 44000-44999 */ |
175 | V4L2_IDENT_MSPX4XX = 34000, /* generic MSPX4XX identifier, only | 195 | V4L2_IDENT_MSPX4XX = 34000, /* generic MSPX4XX identifier, only |
176 | use internally (tveeprom.c). */ | 196 | use internally (tveeprom.c). */ |
@@ -247,6 +267,8 @@ enum { | |||
247 | V4L2_IDENT_MT9V022IX7ATC = 45010, /* No way to detect "normal" I77ATx */ | 267 | V4L2_IDENT_MT9V022IX7ATC = 45010, /* No way to detect "normal" I77ATx */ |
248 | V4L2_IDENT_MT9V022IX7ATM = 45015, /* and "lead free" IA7ATx chips */ | 268 | V4L2_IDENT_MT9V022IX7ATM = 45015, /* and "lead free" IA7ATx chips */ |
249 | V4L2_IDENT_MT9T031 = 45020, | 269 | V4L2_IDENT_MT9T031 = 45020, |
270 | V4L2_IDENT_MT9T111 = 45021, | ||
271 | V4L2_IDENT_MT9T112 = 45022, | ||
250 | V4L2_IDENT_MT9V111 = 45031, | 272 | V4L2_IDENT_MT9V111 = 45031, |
251 | V4L2_IDENT_MT9V112 = 45032, | 273 | V4L2_IDENT_MT9V112 = 45032, |
252 | 274 | ||
@@ -264,6 +286,9 @@ enum { | |||
264 | 286 | ||
265 | /* module m52790: just ident 52790 */ | 287 | /* module m52790: just ident 52790 */ |
266 | V4L2_IDENT_M52790 = 52790, | 288 | V4L2_IDENT_M52790 = 52790, |
289 | |||
290 | /* Sharp RJ54N1CB0C, 0xCB0C = 51980 */ | ||
291 | V4L2_IDENT_RJ54N1CB0C = 51980, | ||
267 | }; | 292 | }; |
268 | 293 | ||
269 | #endif | 294 | #endif |
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 1c25b10da34b..1c7b259f341c 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
@@ -212,5 +212,5 @@ void v4l_bound_align_image(unsigned int *w, unsigned int wmin, | |||
212 | unsigned int *h, unsigned int hmin, | 212 | unsigned int *h, unsigned int hmin, |
213 | unsigned int hmax, unsigned int halign, | 213 | unsigned int hmax, unsigned int halign, |
214 | unsigned int salign); | 214 | unsigned int salign); |
215 | 215 | int v4l_fill_dv_preset_info(u32 preset, struct v4l2_dv_enum_preset *info); | |
216 | #endif /* V4L2_COMMON_H_ */ | 216 | #endif /* V4L2_COMMON_H_ */ |
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index 73c9867d744c..2dee93892ea2 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h | |||
@@ -28,10 +28,10 @@ struct v4l2_ioctl_callbacks; | |||
28 | struct video_device; | 28 | struct video_device; |
29 | struct v4l2_device; | 29 | struct v4l2_device; |
30 | 30 | ||
31 | /* Flag to mark the video_device struct as unregistered. | 31 | /* Flag to mark the video_device struct as registered. |
32 | Drivers can set this flag if they want to block all future | 32 | Drivers can clear this flag if they want to block all future |
33 | device access. It is set by video_unregister_device. */ | 33 | device access. It is cleared by video_unregister_device. */ |
34 | #define V4L2_FL_UNREGISTERED (0) | 34 | #define V4L2_FL_REGISTERED (0) |
35 | 35 | ||
36 | struct v4l2_file_operations { | 36 | struct v4l2_file_operations { |
37 | struct module *owner; | 37 | struct module *owner; |
@@ -96,9 +96,7 @@ struct video_device | |||
96 | /* Register video devices. Note that if video_register_device fails, | 96 | /* Register video devices. Note that if video_register_device fails, |
97 | the release() callback of the video_device structure is *not* called, so | 97 | the release() callback of the video_device structure is *not* called, so |
98 | the caller is responsible for freeing any data. Usually that means that | 98 | the caller is responsible for freeing any data. Usually that means that |
99 | you call video_device_release() on failure. | 99 | you call video_device_release() on failure. */ |
100 | |||
101 | Also note that vdev->minor is set to -1 if the registration failed. */ | ||
102 | int __must_check video_register_device(struct video_device *vdev, int type, int nr); | 100 | int __must_check video_register_device(struct video_device *vdev, int type, int nr); |
103 | 101 | ||
104 | /* Same as video_register_device, but no warning is issued if the desired | 102 | /* Same as video_register_device, but no warning is issued if the desired |
@@ -106,7 +104,7 @@ int __must_check video_register_device(struct video_device *vdev, int type, int | |||
106 | int __must_check video_register_device_no_warn(struct video_device *vdev, int type, int nr); | 104 | int __must_check video_register_device_no_warn(struct video_device *vdev, int type, int nr); |
107 | 105 | ||
108 | /* Unregister video devices. Will do nothing if vdev == NULL or | 106 | /* Unregister video devices. Will do nothing if vdev == NULL or |
109 | vdev->minor < 0. */ | 107 | video_is_registered() returns false. */ |
110 | void video_unregister_device(struct video_device *vdev); | 108 | void video_unregister_device(struct video_device *vdev); |
111 | 109 | ||
112 | /* helper functions to alloc/release struct video_device, the | 110 | /* helper functions to alloc/release struct video_device, the |
@@ -141,9 +139,14 @@ static inline void *video_drvdata(struct file *file) | |||
141 | return video_get_drvdata(video_devdata(file)); | 139 | return video_get_drvdata(video_devdata(file)); |
142 | } | 140 | } |
143 | 141 | ||
144 | static inline int video_is_unregistered(struct video_device *vdev) | 142 | static inline const char *video_device_node_name(struct video_device *vdev) |
143 | { | ||
144 | return dev_name(&vdev->dev); | ||
145 | } | ||
146 | |||
147 | static inline int video_is_registered(struct video_device *vdev) | ||
145 | { | 148 | { |
146 | return test_bit(V4L2_FL_UNREGISTERED, &vdev->flags); | 149 | return test_bit(V4L2_FL_REGISTERED, &vdev->flags); |
147 | } | 150 | } |
148 | 151 | ||
149 | #endif /* _V4L2_DEV_H */ | 152 | #endif /* _V4L2_DEV_H */ |
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h index 7a4529defa88..e8ba0f2efbae 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h | |||
@@ -239,6 +239,21 @@ struct v4l2_ioctl_ops { | |||
239 | int (*vidioc_enum_frameintervals) (struct file *file, void *fh, | 239 | int (*vidioc_enum_frameintervals) (struct file *file, void *fh, |
240 | struct v4l2_frmivalenum *fival); | 240 | struct v4l2_frmivalenum *fival); |
241 | 241 | ||
242 | /* DV Timings IOCTLs */ | ||
243 | int (*vidioc_enum_dv_presets) (struct file *file, void *fh, | ||
244 | struct v4l2_dv_enum_preset *preset); | ||
245 | |||
246 | int (*vidioc_s_dv_preset) (struct file *file, void *fh, | ||
247 | struct v4l2_dv_preset *preset); | ||
248 | int (*vidioc_g_dv_preset) (struct file *file, void *fh, | ||
249 | struct v4l2_dv_preset *preset); | ||
250 | int (*vidioc_query_dv_preset) (struct file *file, void *fh, | ||
251 | struct v4l2_dv_preset *qpreset); | ||
252 | int (*vidioc_s_dv_timings) (struct file *file, void *fh, | ||
253 | struct v4l2_dv_timings *timings); | ||
254 | int (*vidioc_g_dv_timings) (struct file *file, void *fh, | ||
255 | struct v4l2_dv_timings *timings); | ||
256 | |||
242 | /* For other private ioctls */ | 257 | /* For other private ioctls */ |
243 | long (*vidioc_default) (struct file *file, void *fh, | 258 | long (*vidioc_default) (struct file *file, void *fh, |
244 | int cmd, void *arg); | 259 | int cmd, void *arg); |
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h new file mode 100644 index 000000000000..0dbe02ada259 --- /dev/null +++ b/include/media/v4l2-mediabus.h | |||
@@ -0,0 +1,61 @@ | |||
1 | /* | ||
2 | * Media Bus API header | ||
3 | * | ||
4 | * Copyright (C) 2009, Guennadi Liakhovetski <g.liakhovetski@gmx.de> | ||
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 V4L2_MEDIABUS_H | ||
12 | #define V4L2_MEDIABUS_H | ||
13 | |||
14 | /* | ||
15 | * These pixel codes uniquely identify data formats on the media bus. Mostly | ||
16 | * they correspond to similarly named V4L2_PIX_FMT_* formats, format 0 is | ||
17 | * reserved, V4L2_MBUS_FMT_FIXED shall be used by host-client pairs, where the | ||
18 | * data format is fixed. Additionally, "2X8" means that one pixel is transferred | ||
19 | * in two 8-bit samples, "BE" or "LE" specify in which order those samples are | ||
20 | * transferred over the bus: "LE" means that the least significant bits are | ||
21 | * transferred first, "BE" means that the most significant bits are transferred | ||
22 | * first, and "PADHI" and "PADLO" define which bits - low or high, in the | ||
23 | * incomplete high byte, are filled with padding bits. | ||
24 | */ | ||
25 | enum v4l2_mbus_pixelcode { | ||
26 | V4L2_MBUS_FMT_FIXED = 1, | ||
27 | V4L2_MBUS_FMT_YUYV8_2X8_LE, | ||
28 | V4L2_MBUS_FMT_YVYU8_2X8_LE, | ||
29 | V4L2_MBUS_FMT_YUYV8_2X8_BE, | ||
30 | V4L2_MBUS_FMT_YVYU8_2X8_BE, | ||
31 | V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE, | ||
32 | V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE, | ||
33 | V4L2_MBUS_FMT_RGB565_2X8_LE, | ||
34 | V4L2_MBUS_FMT_RGB565_2X8_BE, | ||
35 | V4L2_MBUS_FMT_SBGGR8_1X8, | ||
36 | V4L2_MBUS_FMT_SBGGR10_1X10, | ||
37 | V4L2_MBUS_FMT_GREY8_1X8, | ||
38 | V4L2_MBUS_FMT_Y10_1X10, | ||
39 | V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE, | ||
40 | V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE, | ||
41 | V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE, | ||
42 | V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE, | ||
43 | }; | ||
44 | |||
45 | /** | ||
46 | * struct v4l2_mbus_framefmt - frame format on the media bus | ||
47 | * @width: frame width | ||
48 | * @height: frame height | ||
49 | * @code: data format code | ||
50 | * @field: used interlacing type | ||
51 | * @colorspace: colorspace of the data | ||
52 | */ | ||
53 | struct v4l2_mbus_framefmt { | ||
54 | __u32 width; | ||
55 | __u32 height; | ||
56 | enum v4l2_mbus_pixelcode code; | ||
57 | enum v4l2_field field; | ||
58 | enum v4l2_colorspace colorspace; | ||
59 | }; | ||
60 | |||
61 | #endif | ||
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index d411345f244b..9ba99cd39ee7 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h | |||
@@ -22,6 +22,17 @@ | |||
22 | #define _V4L2_SUBDEV_H | 22 | #define _V4L2_SUBDEV_H |
23 | 23 | ||
24 | #include <media/v4l2-common.h> | 24 | #include <media/v4l2-common.h> |
25 | #include <media/v4l2-mediabus.h> | ||
26 | |||
27 | /* generic v4l2_device notify callback notification values */ | ||
28 | #define V4L2_SUBDEV_IR_RX_NOTIFY _IOW('v', 0, u32) | ||
29 | #define V4L2_SUBDEV_IR_RX_FIFO_SERVICE_REQ 0x00000001 | ||
30 | #define V4L2_SUBDEV_IR_RX_END_OF_RX_DETECTED 0x00000002 | ||
31 | #define V4L2_SUBDEV_IR_RX_HW_FIFO_OVERRUN 0x00000004 | ||
32 | #define V4L2_SUBDEV_IR_RX_SW_FIFO_OVERRUN 0x00000008 | ||
33 | |||
34 | #define V4L2_SUBDEV_IR_TX_NOTIFY _IOW('v', 1, u32) | ||
35 | #define V4L2_SUBDEV_IR_TX_FIFO_SERVICE_REQ 0x00000001 | ||
25 | 36 | ||
26 | struct v4l2_device; | 37 | struct v4l2_device; |
27 | struct v4l2_subdev; | 38 | struct v4l2_subdev; |
@@ -96,6 +107,9 @@ struct v4l2_decode_vbi_line { | |||
96 | 107 | ||
97 | s_gpio: set GPIO pins. Very simple right now, might need to be extended with | 108 | s_gpio: set GPIO pins. Very simple right now, might need to be extended with |
98 | a direction argument if needed. | 109 | a direction argument if needed. |
110 | |||
111 | s_power: puts subdevice in power saving mode (on == 0) or normal operation | ||
112 | mode (on == 1). | ||
99 | */ | 113 | */ |
100 | struct v4l2_subdev_core_ops { | 114 | struct v4l2_subdev_core_ops { |
101 | int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); | 115 | int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); |
@@ -118,6 +132,7 @@ struct v4l2_subdev_core_ops { | |||
118 | int (*g_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg); | 132 | int (*g_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg); |
119 | int (*s_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg); | 133 | int (*s_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg); |
120 | #endif | 134 | #endif |
135 | int (*s_power)(struct v4l2_subdev *sd, int on); | ||
121 | }; | 136 | }; |
122 | 137 | ||
123 | /* s_mode: switch the tuner to a specific tuner mode. Replacement of s_radio. | 138 | /* s_mode: switch the tuner to a specific tuner mode. Replacement of s_radio. |
@@ -127,8 +142,6 @@ struct v4l2_subdev_core_ops { | |||
127 | s_type_addr: sets tuner type and its I2C addr. | 142 | s_type_addr: sets tuner type and its I2C addr. |
128 | 143 | ||
129 | s_config: sets tda9887 specific stuff, like port1, port2 and qss | 144 | s_config: sets tda9887 specific stuff, like port1, port2 and qss |
130 | |||
131 | s_standby: puts tuner on powersaving state, disabling it, except for i2c. | ||
132 | */ | 145 | */ |
133 | struct v4l2_subdev_tuner_ops { | 146 | struct v4l2_subdev_tuner_ops { |
134 | int (*s_mode)(struct v4l2_subdev *sd, enum v4l2_tuner_type); | 147 | int (*s_mode)(struct v4l2_subdev *sd, enum v4l2_tuner_type); |
@@ -141,7 +154,6 @@ struct v4l2_subdev_tuner_ops { | |||
141 | int (*s_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm); | 154 | int (*s_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm); |
142 | int (*s_type_addr)(struct v4l2_subdev *sd, struct tuner_setup *type); | 155 | int (*s_type_addr)(struct v4l2_subdev *sd, struct tuner_setup *type); |
143 | int (*s_config)(struct v4l2_subdev *sd, const struct v4l2_priv_tun_config *config); | 156 | int (*s_config)(struct v4l2_subdev *sd, const struct v4l2_priv_tun_config *config); |
144 | int (*s_standby)(struct v4l2_subdev *sd); | ||
145 | }; | 157 | }; |
146 | 158 | ||
147 | /* s_clock_freq: set the frequency (in Hz) of the audio clock output. | 159 | /* s_clock_freq: set the frequency (in Hz) of the audio clock output. |
@@ -196,7 +208,7 @@ struct v4l2_subdev_audio_ops { | |||
196 | s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by | 208 | s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by |
197 | video input devices. | 209 | video input devices. |
198 | 210 | ||
199 | s_crystal_freq: sets the frequency of the crystal used to generate the | 211 | s_crystal_freq: sets the frequency of the crystal used to generate the |
200 | clocks in Hz. An extra flags field allows device specific configuration | 212 | clocks in Hz. An extra flags field allows device specific configuration |
201 | regarding clock frequency dividers, etc. If not used, then set flags | 213 | regarding clock frequency dividers, etc. If not used, then set flags |
202 | to 0. If the frequency is not supported, then -EINVAL is returned. | 214 | to 0. If the frequency is not supported, then -EINVAL is returned. |
@@ -206,6 +218,26 @@ struct v4l2_subdev_audio_ops { | |||
206 | 218 | ||
207 | s_routing: see s_routing in audio_ops, except this version is for video | 219 | s_routing: see s_routing in audio_ops, except this version is for video |
208 | devices. | 220 | devices. |
221 | |||
222 | s_dv_preset: set dv (Digital Video) preset in the sub device. Similar to | ||
223 | s_std() | ||
224 | |||
225 | query_dv_preset: query dv preset in the sub device. This is similar to | ||
226 | querystd() | ||
227 | |||
228 | s_dv_timings(): Set custom dv timings in the sub device. This is used | ||
229 | when sub device is capable of setting detailed timing information | ||
230 | in the hardware to generate/detect the video signal. | ||
231 | |||
232 | g_dv_timings(): Get custom dv timings in the sub device. | ||
233 | |||
234 | enum_mbus_fmt: enumerate pixel formats, provided by a video data source | ||
235 | |||
236 | g_mbus_fmt: get the current pixel format, provided by a video data source | ||
237 | |||
238 | try_mbus_fmt: try to set a pixel format on a video data source | ||
239 | |||
240 | s_mbus_fmt: set a pixel format on a video data source | ||
209 | */ | 241 | */ |
210 | struct v4l2_subdev_video_ops { | 242 | struct v4l2_subdev_video_ops { |
211 | int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); | 243 | int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); |
@@ -229,13 +261,125 @@ struct v4l2_subdev_video_ops { | |||
229 | int (*s_parm)(struct v4l2_subdev *sd, struct v4l2_streamparm *param); | 261 | int (*s_parm)(struct v4l2_subdev *sd, struct v4l2_streamparm *param); |
230 | int (*enum_framesizes)(struct v4l2_subdev *sd, struct v4l2_frmsizeenum *fsize); | 262 | int (*enum_framesizes)(struct v4l2_subdev *sd, struct v4l2_frmsizeenum *fsize); |
231 | int (*enum_frameintervals)(struct v4l2_subdev *sd, struct v4l2_frmivalenum *fival); | 263 | int (*enum_frameintervals)(struct v4l2_subdev *sd, struct v4l2_frmivalenum *fival); |
264 | int (*s_dv_preset)(struct v4l2_subdev *sd, | ||
265 | struct v4l2_dv_preset *preset); | ||
266 | int (*query_dv_preset)(struct v4l2_subdev *sd, | ||
267 | struct v4l2_dv_preset *preset); | ||
268 | int (*s_dv_timings)(struct v4l2_subdev *sd, | ||
269 | struct v4l2_dv_timings *timings); | ||
270 | int (*g_dv_timings)(struct v4l2_subdev *sd, | ||
271 | struct v4l2_dv_timings *timings); | ||
272 | int (*enum_mbus_fmt)(struct v4l2_subdev *sd, int index, | ||
273 | enum v4l2_mbus_pixelcode *code); | ||
274 | int (*g_mbus_fmt)(struct v4l2_subdev *sd, | ||
275 | struct v4l2_mbus_framefmt *fmt); | ||
276 | int (*try_mbus_fmt)(struct v4l2_subdev *sd, | ||
277 | struct v4l2_mbus_framefmt *fmt); | ||
278 | int (*s_mbus_fmt)(struct v4l2_subdev *sd, | ||
279 | struct v4l2_mbus_framefmt *fmt); | ||
280 | }; | ||
281 | |||
282 | /** | ||
283 | * struct v4l2_subdev_sensor_ops - v4l2-subdev sensor operations | ||
284 | * @g_skip_top_lines: number of lines at the top of the image to be skipped. | ||
285 | * This is needed for some sensors, which always corrupt | ||
286 | * several top lines of the output image, or which send their | ||
287 | * metadata in them. | ||
288 | */ | ||
289 | struct v4l2_subdev_sensor_ops { | ||
290 | int (*g_skip_top_lines)(struct v4l2_subdev *sd, u32 *lines); | ||
291 | }; | ||
292 | |||
293 | /* | ||
294 | interrupt_service_routine: Called by the bridge chip's interrupt service | ||
295 | handler, when an IR interrupt status has be raised due to this subdev, | ||
296 | so that this subdev can handle the details. It may schedule work to be | ||
297 | performed later. It must not sleep. *Called from an IRQ context*. | ||
298 | |||
299 | [rt]x_g_parameters: Get the current operating parameters and state of the | ||
300 | the IR receiver or transmitter. | ||
301 | |||
302 | [rt]x_s_parameters: Set the current operating parameters and state of the | ||
303 | the IR receiver or transmitter. It is recommended to call | ||
304 | [rt]x_g_parameters first to fill out the current state, and only change | ||
305 | the fields that need to be changed. Upon return, the actual device | ||
306 | operating parameters and state will be returned. Note that hardware | ||
307 | limitations may prevent the actual settings from matching the requested | ||
308 | settings - e.g. an actual carrier setting of 35,904 Hz when 36,000 Hz | ||
309 | was requested. An exception is when the shutdown parameter is true. | ||
310 | The last used operational parameters will be returned, but the actual | ||
311 | state of the hardware be different to minimize power consumption and | ||
312 | processing when shutdown is true. | ||
313 | |||
314 | rx_read: Reads received codes or pulse width data. | ||
315 | The semantics are similar to a non-blocking read() call. | ||
316 | |||
317 | tx_write: Writes codes or pulse width data for transmission. | ||
318 | The semantics are similar to a non-blocking write() call. | ||
319 | */ | ||
320 | |||
321 | enum v4l2_subdev_ir_mode { | ||
322 | V4L2_SUBDEV_IR_MODE_PULSE_WIDTH, /* space & mark widths in nanosecs */ | ||
323 | }; | ||
324 | |||
325 | /* Data format of data read or written for V4L2_SUBDEV_IR_MODE_PULSE_WIDTH */ | ||
326 | #define V4L2_SUBDEV_IR_PULSE_MAX_WIDTH_NS 0x7fffffff | ||
327 | #define V4L2_SUBDEV_IR_PULSE_LEVEL_MASK 0x80000000 | ||
328 | #define V4L2_SUBDEV_IR_PULSE_RX_SEQ_END 0xffffffff | ||
329 | |||
330 | struct v4l2_subdev_ir_parameters { | ||
331 | /* Either Rx or Tx */ | ||
332 | unsigned int bytes_per_data_element; /* of data in read or write call */ | ||
333 | enum v4l2_subdev_ir_mode mode; | ||
334 | |||
335 | bool enable; | ||
336 | bool interrupt_enable; | ||
337 | bool shutdown; /* true: set hardware to low/no power, false: normal */ | ||
338 | |||
339 | bool modulation; /* true: uses carrier, false: baseband */ | ||
340 | u32 max_pulse_width; /* ns, valid only for baseband signal */ | ||
341 | unsigned int carrier_freq; /* Hz, valid only for modulated signal*/ | ||
342 | unsigned int duty_cycle; /* percent, valid only for modulated signal*/ | ||
343 | bool invert; /* logically invert sense of mark/space */ | ||
344 | |||
345 | /* Rx only */ | ||
346 | u32 noise_filter_min_width; /* ns, min time of a valid pulse */ | ||
347 | unsigned int carrier_range_lower; /* Hz, valid only for modulated sig */ | ||
348 | unsigned int carrier_range_upper; /* Hz, valid only for modulated sig */ | ||
349 | u32 resolution; /* ns */ | ||
350 | }; | ||
351 | |||
352 | struct v4l2_subdev_ir_ops { | ||
353 | /* Common to receiver and transmitter */ | ||
354 | int (*interrupt_service_routine)(struct v4l2_subdev *sd, | ||
355 | u32 status, bool *handled); | ||
356 | |||
357 | /* Receiver */ | ||
358 | int (*rx_read)(struct v4l2_subdev *sd, u8 *buf, size_t count, | ||
359 | ssize_t *num); | ||
360 | |||
361 | int (*rx_g_parameters)(struct v4l2_subdev *sd, | ||
362 | struct v4l2_subdev_ir_parameters *params); | ||
363 | int (*rx_s_parameters)(struct v4l2_subdev *sd, | ||
364 | struct v4l2_subdev_ir_parameters *params); | ||
365 | |||
366 | /* Transmitter */ | ||
367 | int (*tx_write)(struct v4l2_subdev *sd, u8 *buf, size_t count, | ||
368 | ssize_t *num); | ||
369 | |||
370 | int (*tx_g_parameters)(struct v4l2_subdev *sd, | ||
371 | struct v4l2_subdev_ir_parameters *params); | ||
372 | int (*tx_s_parameters)(struct v4l2_subdev *sd, | ||
373 | struct v4l2_subdev_ir_parameters *params); | ||
232 | }; | 374 | }; |
233 | 375 | ||
234 | struct v4l2_subdev_ops { | 376 | struct v4l2_subdev_ops { |
235 | const struct v4l2_subdev_core_ops *core; | 377 | const struct v4l2_subdev_core_ops *core; |
236 | const struct v4l2_subdev_tuner_ops *tuner; | 378 | const struct v4l2_subdev_tuner_ops *tuner; |
237 | const struct v4l2_subdev_audio_ops *audio; | 379 | const struct v4l2_subdev_audio_ops *audio; |
238 | const struct v4l2_subdev_video_ops *video; | 380 | const struct v4l2_subdev_video_ops *video; |
381 | const struct v4l2_subdev_ir_ops *ir; | ||
382 | const struct v4l2_subdev_sensor_ops *sensor; | ||
239 | }; | 383 | }; |
240 | 384 | ||
241 | #define V4L2_SUBDEV_NAME_SIZE 32 | 385 | #define V4L2_SUBDEV_NAME_SIZE 32 |
@@ -290,7 +434,7 @@ static inline void v4l2_subdev_init(struct v4l2_subdev *sd, | |||
290 | Example: err = v4l2_subdev_call(sd, core, g_chip_ident, &chip); | 434 | Example: err = v4l2_subdev_call(sd, core, g_chip_ident, &chip); |
291 | */ | 435 | */ |
292 | #define v4l2_subdev_call(sd, o, f, args...) \ | 436 | #define v4l2_subdev_call(sd, o, f, args...) \ |
293 | (!(sd) ? -ENODEV : (((sd) && (sd)->ops->o && (sd)->ops->o->f) ? \ | 437 | (!(sd) ? -ENODEV : (((sd)->ops->o && (sd)->ops->o->f) ? \ |
294 | (sd)->ops->o->f((sd) , ##args) : -ENOIOCTLCMD)) | 438 | (sd)->ops->o->f((sd) , ##args) : -ENOIOCTLCMD)) |
295 | 439 | ||
296 | /* Send a notification to v4l2_device. */ | 440 | /* Send a notification to v4l2_device. */ |
diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h index 1c5946c44758..316fdccdcaa0 100644 --- a/include/media/videobuf-core.h +++ b/include/media/videobuf-core.h | |||
@@ -166,7 +166,7 @@ struct videobuf_queue { | |||
166 | enum v4l2_field field; | 166 | enum v4l2_field field; |
167 | enum v4l2_field last; /* for field=V4L2_FIELD_ALTERNATE */ | 167 | enum v4l2_field last; /* for field=V4L2_FIELD_ALTERNATE */ |
168 | struct videobuf_buffer *bufs[VIDEO_MAX_FRAME]; | 168 | struct videobuf_buffer *bufs[VIDEO_MAX_FRAME]; |
169 | struct videobuf_queue_ops *ops; | 169 | const struct videobuf_queue_ops *ops; |
170 | struct videobuf_qtype_ops *int_ops; | 170 | struct videobuf_qtype_ops *int_ops; |
171 | 171 | ||
172 | unsigned int streaming:1; | 172 | unsigned int streaming:1; |
@@ -195,7 +195,7 @@ void *videobuf_queue_to_vmalloc (struct videobuf_queue* q, | |||
195 | struct videobuf_buffer *buf); | 195 | struct videobuf_buffer *buf); |
196 | 196 | ||
197 | void videobuf_queue_core_init(struct videobuf_queue *q, | 197 | void videobuf_queue_core_init(struct videobuf_queue *q, |
198 | struct videobuf_queue_ops *ops, | 198 | const struct videobuf_queue_ops *ops, |
199 | struct device *dev, | 199 | struct device *dev, |
200 | spinlock_t *irqlock, | 200 | spinlock_t *irqlock, |
201 | enum v4l2_buf_type type, | 201 | enum v4l2_buf_type type, |
diff --git a/include/media/videobuf-dma-contig.h b/include/media/videobuf-dma-contig.h index 549386681aab..ebaa9bc1ee8d 100644 --- a/include/media/videobuf-dma-contig.h +++ b/include/media/videobuf-dma-contig.h | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <media/videobuf-core.h> | 17 | #include <media/videobuf-core.h> |
18 | 18 | ||
19 | void videobuf_queue_dma_contig_init(struct videobuf_queue *q, | 19 | void videobuf_queue_dma_contig_init(struct videobuf_queue *q, |
20 | struct videobuf_queue_ops *ops, | 20 | const struct videobuf_queue_ops *ops, |
21 | struct device *dev, | 21 | struct device *dev, |
22 | spinlock_t *irqlock, | 22 | spinlock_t *irqlock, |
23 | enum v4l2_buf_type type, | 23 | enum v4l2_buf_type type, |
diff --git a/include/media/videobuf-dma-sg.h b/include/media/videobuf-dma-sg.h index dda47f0082e9..53e72f787175 100644 --- a/include/media/videobuf-dma-sg.h +++ b/include/media/videobuf-dma-sg.h | |||
@@ -103,7 +103,7 @@ struct videobuf_dmabuf *videobuf_to_dma (struct videobuf_buffer *buf); | |||
103 | void *videobuf_sg_alloc(size_t size); | 103 | void *videobuf_sg_alloc(size_t size); |
104 | 104 | ||
105 | void videobuf_queue_sg_init(struct videobuf_queue* q, | 105 | void videobuf_queue_sg_init(struct videobuf_queue* q, |
106 | struct videobuf_queue_ops *ops, | 106 | const struct videobuf_queue_ops *ops, |
107 | struct device *dev, | 107 | struct device *dev, |
108 | spinlock_t *irqlock, | 108 | spinlock_t *irqlock, |
109 | enum v4l2_buf_type type, | 109 | enum v4l2_buf_type type, |
diff --git a/include/media/videobuf-dvb.h b/include/media/videobuf-dvb.h index 6ba4f1271d23..07cf4b9d0a65 100644 --- a/include/media/videobuf-dvb.h +++ b/include/media/videobuf-dvb.h | |||
@@ -42,7 +42,9 @@ int videobuf_dvb_register_bus(struct videobuf_dvb_frontends *f, | |||
42 | void *adapter_priv, | 42 | void *adapter_priv, |
43 | struct device *device, | 43 | struct device *device, |
44 | short *adapter_nr, | 44 | short *adapter_nr, |
45 | int mfe_shared); | 45 | int mfe_shared, |
46 | int (*fe_ioctl_override)(struct dvb_frontend *, | ||
47 | unsigned int, void *, unsigned int)); | ||
46 | 48 | ||
47 | void videobuf_dvb_unregister_bus(struct videobuf_dvb_frontends *f); | 49 | void videobuf_dvb_unregister_bus(struct videobuf_dvb_frontends *f); |
48 | 50 | ||
diff --git a/include/media/videobuf-vmalloc.h b/include/media/videobuf-vmalloc.h index e87222c6a125..4b419a257a7d 100644 --- a/include/media/videobuf-vmalloc.h +++ b/include/media/videobuf-vmalloc.h | |||
@@ -30,8 +30,8 @@ struct videobuf_vmalloc_memory | |||
30 | }; | 30 | }; |
31 | 31 | ||
32 | void videobuf_queue_vmalloc_init(struct videobuf_queue* q, | 32 | void videobuf_queue_vmalloc_init(struct videobuf_queue* q, |
33 | struct videobuf_queue_ops *ops, | 33 | const struct videobuf_queue_ops *ops, |
34 | void *dev, | 34 | struct device *dev, |
35 | spinlock_t *irqlock, | 35 | spinlock_t *irqlock, |
36 | enum v4l2_buf_type type, | 36 | enum v4l2_buf_type type, |
37 | enum v4l2_field field, | 37 | enum v4l2_field field, |