aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-04-21 05:12:35 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-04-21 05:12:35 -0400
commit676ee36be04985062522804c2de04f0764212be6 (patch)
tree781df135c5a91a04decad1b7d53b5a925dc11522 /include/media
parentb18042a673e88c9457a6d1716219c2367ca447b0 (diff)
parente183201b9e917daf2530b637b2f34f1d5afb934d (diff)
Merge branch 'patchwork' into v4l_for_linus
* patchwork: (404 commits) [media] uvcvideo: add support for VIDIOC_QUERY_EXT_CTRL [media] uvcvideo: fix cropcap v4l2-compliance failure [media] media: omap3isp: remove unused clkdev [media] coda: Add tracing support [media] coda: drop dma_sync_single_for_device in coda_bitstream_queue [media] coda: fix fill bitstream errors in nonstreaming case [media] coda: call SEQ_END when the first queue is stopped [media] coda: fail to start streaming if userspace set invalid formats [media] coda: remove duplicate error messages for buffer allocations [media] coda: move parameter buffer in together with context buffer allocation [media] coda: allocate bitstream buffer from REQBUFS, size depends on the format [media] coda: allocate per-context buffers from REQBUFS [media] coda: use strlcpy instead of snprintf [media] coda: bitstream payload is unsigned [media] coda: fix double call to debugfs_remove [media] coda: check kasprintf return value in coda_open [media] coda: bitrate can only be set in kbps steps [media] v4l2-mem2mem: no need to initialize b in v4l2_m2m_next_buf and v4l2_m2m_buf_remove [media] s5p-mfc: set allow_zero_bytesused flag for vb2_queue_init [media] coda: set allow_zero_bytesused flag for vb2_queue_init ...
Diffstat (limited to 'include/media')
-rw-r--r--include/media/adv7604.h83
-rw-r--r--include/media/davinci/vpfe_capture.h2
-rw-r--r--include/media/media-entity.h21
-rw-r--r--include/media/mt9p031.h2
-rw-r--r--include/media/omap3isp.h38
-rw-r--r--include/media/ov2659.h34
-rw-r--r--include/media/saa7146_vv.h4
-rw-r--r--include/media/v4l2-clk.h10
-rw-r--r--include/media/v4l2-dev.h1
-rw-r--r--include/media/v4l2-device.h2
-rw-r--r--include/media/v4l2-ioctl.h6
-rw-r--r--include/media/v4l2-of.h30
-rw-r--r--include/media/v4l2-subdev.h55
-rw-r--r--include/media/videobuf2-core.h20
14 files changed, 179 insertions, 129 deletions
diff --git a/include/media/adv7604.h b/include/media/adv7604.h
index aa1c4477722d..9ecf353160c1 100644
--- a/include/media/adv7604.h
+++ b/include/media/adv7604.h
@@ -47,16 +47,16 @@ enum adv7604_bus_order {
47}; 47};
48 48
49/* Input Color Space (IO register 0x02, [7:4]) */ 49/* Input Color Space (IO register 0x02, [7:4]) */
50enum adv7604_inp_color_space { 50enum adv76xx_inp_color_space {
51 ADV7604_INP_COLOR_SPACE_LIM_RGB = 0, 51 ADV76XX_INP_COLOR_SPACE_LIM_RGB = 0,
52 ADV7604_INP_COLOR_SPACE_FULL_RGB = 1, 52 ADV76XX_INP_COLOR_SPACE_FULL_RGB = 1,
53 ADV7604_INP_COLOR_SPACE_LIM_YCbCr_601 = 2, 53 ADV76XX_INP_COLOR_SPACE_LIM_YCbCr_601 = 2,
54 ADV7604_INP_COLOR_SPACE_LIM_YCbCr_709 = 3, 54 ADV76XX_INP_COLOR_SPACE_LIM_YCbCr_709 = 3,
55 ADV7604_INP_COLOR_SPACE_XVYCC_601 = 4, 55 ADV76XX_INP_COLOR_SPACE_XVYCC_601 = 4,
56 ADV7604_INP_COLOR_SPACE_XVYCC_709 = 5, 56 ADV76XX_INP_COLOR_SPACE_XVYCC_709 = 5,
57 ADV7604_INP_COLOR_SPACE_FULL_YCbCr_601 = 6, 57 ADV76XX_INP_COLOR_SPACE_FULL_YCbCr_601 = 6,
58 ADV7604_INP_COLOR_SPACE_FULL_YCbCr_709 = 7, 58 ADV76XX_INP_COLOR_SPACE_FULL_YCbCr_709 = 7,
59 ADV7604_INP_COLOR_SPACE_AUTO = 0xf, 59 ADV76XX_INP_COLOR_SPACE_AUTO = 0xf,
60}; 60};
61 61
62/* Select output format (IO register 0x03, [4:2]) */ 62/* Select output format (IO register 0x03, [4:2]) */
@@ -66,38 +66,39 @@ enum adv7604_op_format_mode_sel {
66 ADV7604_OP_FORMAT_MODE2 = 0x08, 66 ADV7604_OP_FORMAT_MODE2 = 0x08,
67}; 67};
68 68
69enum adv7604_drive_strength { 69enum adv76xx_drive_strength {
70 ADV7604_DR_STR_MEDIUM_LOW = 1, 70 ADV76XX_DR_STR_MEDIUM_LOW = 1,
71 ADV7604_DR_STR_MEDIUM_HIGH = 2, 71 ADV76XX_DR_STR_MEDIUM_HIGH = 2,
72 ADV7604_DR_STR_HIGH = 3, 72 ADV76XX_DR_STR_HIGH = 3,
73}; 73};
74 74
75enum adv7604_int1_config { 75/* INT1 Configuration (IO register 0x40, [1:0]) */
76 ADV7604_INT1_CONFIG_OPEN_DRAIN, 76enum adv76xx_int1_config {
77 ADV7604_INT1_CONFIG_ACTIVE_LOW, 77 ADV76XX_INT1_CONFIG_OPEN_DRAIN,
78 ADV7604_INT1_CONFIG_ACTIVE_HIGH, 78 ADV76XX_INT1_CONFIG_ACTIVE_LOW,
79 ADV7604_INT1_CONFIG_DISABLED, 79 ADV76XX_INT1_CONFIG_ACTIVE_HIGH,
80 ADV76XX_INT1_CONFIG_DISABLED,
80}; 81};
81 82
82enum adv7604_page { 83enum adv76xx_page {
83 ADV7604_PAGE_IO, 84 ADV76XX_PAGE_IO,
84 ADV7604_PAGE_AVLINK, 85 ADV7604_PAGE_AVLINK,
85 ADV7604_PAGE_CEC, 86 ADV76XX_PAGE_CEC,
86 ADV7604_PAGE_INFOFRAME, 87 ADV76XX_PAGE_INFOFRAME,
87 ADV7604_PAGE_ESDP, 88 ADV7604_PAGE_ESDP,
88 ADV7604_PAGE_DPP, 89 ADV7604_PAGE_DPP,
89 ADV7604_PAGE_AFE, 90 ADV76XX_PAGE_AFE,
90 ADV7604_PAGE_REP, 91 ADV76XX_PAGE_REP,
91 ADV7604_PAGE_EDID, 92 ADV76XX_PAGE_EDID,
92 ADV7604_PAGE_HDMI, 93 ADV76XX_PAGE_HDMI,
93 ADV7604_PAGE_TEST, 94 ADV76XX_PAGE_TEST,
94 ADV7604_PAGE_CP, 95 ADV76XX_PAGE_CP,
95 ADV7604_PAGE_VDP, 96 ADV7604_PAGE_VDP,
96 ADV7604_PAGE_MAX, 97 ADV76XX_PAGE_MAX,
97}; 98};
98 99
99/* Platform dependent definition */ 100/* Platform dependent definition */
100struct adv7604_platform_data { 101struct adv76xx_platform_data {
101 /* DIS_PWRDNB: 1 if the PWRDNB pin is unused and unconnected */ 102 /* DIS_PWRDNB: 1 if the PWRDNB pin is unused and unconnected */
102 unsigned disable_pwrdnb:1; 103 unsigned disable_pwrdnb:1;
103 104
@@ -116,7 +117,7 @@ struct adv7604_platform_data {
116 enum adv7604_op_format_mode_sel op_format_mode_sel; 117 enum adv7604_op_format_mode_sel op_format_mode_sel;
117 118
118 /* Configuration of the INT1 pin */ 119 /* Configuration of the INT1 pin */
119 enum adv7604_int1_config int1_config; 120 enum adv76xx_int1_config int1_config;
120 121
121 /* IO register 0x02 */ 122 /* IO register 0x02 */
122 unsigned alt_gamma:1; 123 unsigned alt_gamma:1;
@@ -134,9 +135,9 @@ struct adv7604_platform_data {
134 unsigned inv_llc_pol:1; 135 unsigned inv_llc_pol:1;
135 136
136 /* IO register 0x14 */ 137 /* IO register 0x14 */
137 enum adv7604_drive_strength dr_str_data; 138 enum adv76xx_drive_strength dr_str_data;
138 enum adv7604_drive_strength dr_str_clk; 139 enum adv76xx_drive_strength dr_str_clk;
139 enum adv7604_drive_strength dr_str_sync; 140 enum adv76xx_drive_strength dr_str_sync;
140 141
141 /* IO register 0x30 */ 142 /* IO register 0x30 */
142 unsigned output_bus_lsb_to_msb:1; 143 unsigned output_bus_lsb_to_msb:1;
@@ -145,11 +146,11 @@ struct adv7604_platform_data {
145 unsigned hdmi_free_run_mode; 146 unsigned hdmi_free_run_mode;
146 147
147 /* i2c addresses: 0 == use default */ 148 /* i2c addresses: 0 == use default */
148 u8 i2c_addresses[ADV7604_PAGE_MAX]; 149 u8 i2c_addresses[ADV76XX_PAGE_MAX];
149}; 150};
150 151
151enum adv7604_pad { 152enum adv76xx_pad {
152 ADV7604_PAD_HDMI_PORT_A = 0, 153 ADV76XX_PAD_HDMI_PORT_A = 0,
153 ADV7604_PAD_HDMI_PORT_B = 1, 154 ADV7604_PAD_HDMI_PORT_B = 1,
154 ADV7604_PAD_HDMI_PORT_C = 2, 155 ADV7604_PAD_HDMI_PORT_C = 2,
155 ADV7604_PAD_HDMI_PORT_D = 3, 156 ADV7604_PAD_HDMI_PORT_D = 3,
@@ -158,7 +159,7 @@ enum adv7604_pad {
158 /* The source pad is either 1 (ADV7611) or 6 (ADV7604) */ 159 /* The source pad is either 1 (ADV7611) or 6 (ADV7604) */
159 ADV7604_PAD_SOURCE = 6, 160 ADV7604_PAD_SOURCE = 6,
160 ADV7611_PAD_SOURCE = 1, 161 ADV7611_PAD_SOURCE = 1,
161 ADV7604_PAD_MAX = 7, 162 ADV76XX_PAD_MAX = 7,
162}; 163};
163 164
164#define V4L2_CID_ADV_RX_ANALOG_SAMPLING_PHASE (V4L2_CID_DV_CLASS_BASE + 0x1000) 165#define V4L2_CID_ADV_RX_ANALOG_SAMPLING_PHASE (V4L2_CID_DV_CLASS_BASE + 0x1000)
@@ -166,7 +167,7 @@ enum adv7604_pad {
166#define V4L2_CID_ADV_RX_FREE_RUN_COLOR (V4L2_CID_DV_CLASS_BASE + 0x1002) 167#define V4L2_CID_ADV_RX_FREE_RUN_COLOR (V4L2_CID_DV_CLASS_BASE + 0x1002)
167 168
168/* notify events */ 169/* notify events */
169#define ADV7604_HOTPLUG 1 170#define ADV76XX_HOTPLUG 1
170#define ADV7604_FMT_CHANGE 2 171#define ADV76XX_FMT_CHANGE 2
171 172
172#endif 173#endif
diff --git a/include/media/davinci/vpfe_capture.h b/include/media/davinci/vpfe_capture.h
index 288772e6900a..28bcd71cdd26 100644
--- a/include/media/davinci/vpfe_capture.h
+++ b/include/media/davinci/vpfe_capture.h
@@ -102,7 +102,7 @@ struct vpfe_config {
102struct vpfe_device { 102struct vpfe_device {
103 /* V4l2 specific parameters */ 103 /* V4l2 specific parameters */
104 /* Identifies video device for this channel */ 104 /* Identifies video device for this channel */
105 struct video_device *video_dev; 105 struct video_device video_dev;
106 /* sub devices */ 106 /* sub devices */
107 struct v4l2_subdev **sd; 107 struct v4l2_subdev **sd;
108 /* vpfe cfg */ 108 /* vpfe cfg */
diff --git a/include/media/media-entity.h b/include/media/media-entity.h
index e00459185d20..0c003d817493 100644
--- a/include/media/media-entity.h
+++ b/include/media/media-entity.h
@@ -44,6 +44,15 @@ struct media_pad {
44 unsigned long flags; /* Pad flags (MEDIA_PAD_FL_*) */ 44 unsigned long flags; /* Pad flags (MEDIA_PAD_FL_*) */
45}; 45};
46 46
47/**
48 * struct media_entity_operations - Media entity operations
49 * @link_setup: Notify the entity of link changes. The operation can
50 * return an error, in which case link setup will be
51 * cancelled. Optional.
52 * @link_validate: Return whether a link is valid from the entity point of
53 * view. The media_entity_pipeline_start() function
54 * validates all links by calling this operation. Optional.
55 */
47struct media_entity_operations { 56struct media_entity_operations {
48 int (*link_setup)(struct media_entity *entity, 57 int (*link_setup)(struct media_entity *entity,
49 const struct media_pad *local, 58 const struct media_pad *local,
@@ -87,17 +96,7 @@ struct media_entity {
87 struct { 96 struct {
88 u32 major; 97 u32 major;
89 u32 minor; 98 u32 minor;
90 } v4l; 99 } dev;
91 struct {
92 u32 major;
93 u32 minor;
94 } fb;
95 struct {
96 u32 card;
97 u32 device;
98 u32 subdevice;
99 } alsa;
100 int dvb;
101 100
102 /* Sub-device specifications */ 101 /* Sub-device specifications */
103 /* Nothing needed yet */ 102 /* Nothing needed yet */
diff --git a/include/media/mt9p031.h b/include/media/mt9p031.h
index b1e63f2b72bd..1ba361205af1 100644
--- a/include/media/mt9p031.h
+++ b/include/media/mt9p031.h
@@ -5,12 +5,10 @@ struct v4l2_subdev;
5 5
6/* 6/*
7 * struct mt9p031_platform_data - MT9P031 platform data 7 * struct mt9p031_platform_data - MT9P031 platform data
8 * @reset: Chip reset GPIO (set to -1 if not used)
9 * @ext_freq: Input clock frequency 8 * @ext_freq: Input clock frequency
10 * @target_freq: Pixel clock frequency 9 * @target_freq: Pixel clock frequency
11 */ 10 */
12struct mt9p031_platform_data { 11struct mt9p031_platform_data {
13 int reset;
14 int ext_freq; 12 int ext_freq;
15 int target_freq; 13 int target_freq;
16}; 14};
diff --git a/include/media/omap3isp.h b/include/media/omap3isp.h
index 398279dd1922..048f8f9117ef 100644
--- a/include/media/omap3isp.h
+++ b/include/media/omap3isp.h
@@ -45,7 +45,7 @@ enum {
45}; 45};
46 46
47/** 47/**
48 * struct isp_parallel_platform_data - Parallel interface platform data 48 * struct isp_parallel_cfg - Parallel interface configuration
49 * @data_lane_shift: Data lane shifter 49 * @data_lane_shift: Data lane shifter
50 * ISP_LANE_SHIFT_0 - CAMEXT[13:0] -> CAM[13:0] 50 * ISP_LANE_SHIFT_0 - CAMEXT[13:0] -> CAM[13:0]
51 * ISP_LANE_SHIFT_2 - CAMEXT[13:2] -> CAM[11:0] 51 * ISP_LANE_SHIFT_2 - CAMEXT[13:2] -> CAM[11:0]
@@ -62,7 +62,7 @@ enum {
62 * @data_pol: Data polarity 62 * @data_pol: Data polarity
63 * 0 - Normal, 1 - One's complement 63 * 0 - Normal, 1 - One's complement
64 */ 64 */
65struct isp_parallel_platform_data { 65struct isp_parallel_cfg {
66 unsigned int data_lane_shift:2; 66 unsigned int data_lane_shift:2;
67 unsigned int clk_pol:1; 67 unsigned int clk_pol:1;
68 unsigned int hs_pol:1; 68 unsigned int hs_pol:1;
@@ -105,7 +105,7 @@ struct isp_csiphy_lanes_cfg {
105}; 105};
106 106
107/** 107/**
108 * struct isp_ccp2_platform_data - CCP2 interface platform data 108 * struct isp_ccp2_cfg - CCP2 interface configuration
109 * @strobe_clk_pol: Strobe/clock polarity 109 * @strobe_clk_pol: Strobe/clock polarity
110 * 0 - Non Inverted, 1 - Inverted 110 * 0 - Non Inverted, 1 - Inverted
111 * @crc: Enable the cyclic redundancy check 111 * @crc: Enable the cyclic redundancy check
@@ -117,7 +117,7 @@ struct isp_csiphy_lanes_cfg {
117 * ISP_CCP2_PHY_DATA_STROBE - Data/strobe physical layer 117 * ISP_CCP2_PHY_DATA_STROBE - Data/strobe physical layer
118 * @vpclk_div: Video port output clock control 118 * @vpclk_div: Video port output clock control
119 */ 119 */
120struct isp_ccp2_platform_data { 120struct isp_ccp2_cfg {
121 unsigned int strobe_clk_pol:1; 121 unsigned int strobe_clk_pol:1;
122 unsigned int crc:1; 122 unsigned int crc:1;
123 unsigned int ccp2_mode:1; 123 unsigned int ccp2_mode:1;
@@ -127,39 +127,31 @@ struct isp_ccp2_platform_data {
127}; 127};
128 128
129/** 129/**
130 * struct isp_csi2_platform_data - CSI2 interface platform data 130 * struct isp_csi2_cfg - CSI2 interface configuration
131 * @crc: Enable the cyclic redundancy check 131 * @crc: Enable the cyclic redundancy check
132 * @vpclk_div: Video port output clock control
133 */ 132 */
134struct isp_csi2_platform_data { 133struct isp_csi2_cfg {
135 unsigned crc:1; 134 unsigned crc:1;
136 unsigned vpclk_div:2;
137 struct isp_csiphy_lanes_cfg lanecfg; 135 struct isp_csiphy_lanes_cfg lanecfg;
138}; 136};
139 137
140struct isp_subdev_i2c_board_info { 138struct isp_bus_cfg {
141 struct i2c_board_info *board_info;
142 int i2c_adapter_id;
143};
144
145struct isp_v4l2_subdevs_group {
146 struct isp_subdev_i2c_board_info *subdevs;
147 enum isp_interface_type interface; 139 enum isp_interface_type interface;
148 union { 140 union {
149 struct isp_parallel_platform_data parallel; 141 struct isp_parallel_cfg parallel;
150 struct isp_ccp2_platform_data ccp2; 142 struct isp_ccp2_cfg ccp2;
151 struct isp_csi2_platform_data csi2; 143 struct isp_csi2_cfg csi2;
152 } bus; /* gcc < 4.6.0 chokes on anonymous union initializers */ 144 } bus; /* gcc < 4.6.0 chokes on anonymous union initializers */
153}; 145};
154 146
155struct isp_platform_xclk { 147struct isp_platform_subdev {
156 const char *dev_id; 148 struct i2c_board_info *board_info;
157 const char *con_id; 149 int i2c_adapter_id;
150 struct isp_bus_cfg *bus;
158}; 151};
159 152
160struct isp_platform_data { 153struct isp_platform_data {
161 struct isp_platform_xclk xclks[2]; 154 struct isp_platform_subdev *subdevs;
162 struct isp_v4l2_subdevs_group *subdevs;
163 void (*set_constraints)(struct isp_device *isp, bool enable); 155 void (*set_constraints)(struct isp_device *isp, bool enable);
164}; 156};
165 157
diff --git a/include/media/ov2659.h b/include/media/ov2659.h
new file mode 100644
index 000000000000..4216adc1ede2
--- /dev/null
+++ b/include/media/ov2659.h
@@ -0,0 +1,34 @@
1/*
2 * Omnivision OV2659 CMOS Image Sensor driver
3 *
4 * Copyright (C) 2015 Texas Instruments, Inc.
5 *
6 * Benoit Parrot <bparrot@ti.com>
7 * Lad, Prabhakar <prabhakar.csengg@gmail.com>
8 *
9 * This program is free software; you may redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; version 2 of the License.
12 *
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
17 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
18 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 * SOFTWARE.
21 */
22
23#ifndef OV2659_H
24#define OV2659_H
25
26/**
27 * struct ov2659_platform_data - ov2659 driver platform data
28 * @link_frequency: target pixel clock frequency
29 */
30struct ov2659_platform_data {
31 s64 link_frequency;
32};
33
34#endif /* OV2659_H */
diff --git a/include/media/saa7146_vv.h b/include/media/saa7146_vv.h
index 944ecdf3530f..92766f77a5de 100644
--- a/include/media/saa7146_vv.h
+++ b/include/media/saa7146_vv.h
@@ -178,8 +178,8 @@ struct saa7146_use_ops {
178}; 178};
179 179
180/* from saa7146_fops.c */ 180/* from saa7146_fops.c */
181int saa7146_register_device(struct video_device **vid, struct saa7146_dev* dev, char *name, int type); 181int saa7146_register_device(struct video_device *vid, struct saa7146_dev *dev, char *name, int type);
182int saa7146_unregister_device(struct video_device **vid, struct saa7146_dev* dev); 182int saa7146_unregister_device(struct video_device *vid, struct saa7146_dev *dev);
183void saa7146_buffer_finish(struct saa7146_dev *dev, struct saa7146_dmaqueue *q, int state); 183void saa7146_buffer_finish(struct saa7146_dev *dev, struct saa7146_dmaqueue *q, int state);
184void saa7146_buffer_next(struct saa7146_dev *dev, struct saa7146_dmaqueue *q,int vbi); 184void saa7146_buffer_next(struct saa7146_dev *dev, struct saa7146_dmaqueue *q,int vbi);
185int saa7146_buffer_queue(struct saa7146_dev *dev, struct saa7146_dmaqueue *q, struct saa7146_buf *buf); 185int saa7146_buffer_queue(struct saa7146_dev *dev, struct saa7146_dmaqueue *q, struct saa7146_buf *buf);
diff --git a/include/media/v4l2-clk.h b/include/media/v4l2-clk.h
index 0b36cc138304..3ef6e3d5ed6c 100644
--- a/include/media/v4l2-clk.h
+++ b/include/media/v4l2-clk.h
@@ -22,14 +22,15 @@
22struct module; 22struct module;
23struct device; 23struct device;
24 24
25struct clk;
25struct v4l2_clk { 26struct v4l2_clk {
26 struct list_head list; 27 struct list_head list;
27 const struct v4l2_clk_ops *ops; 28 const struct v4l2_clk_ops *ops;
28 const char *dev_id; 29 const char *dev_id;
29 const char *id;
30 int enable; 30 int enable;
31 struct mutex lock; /* Protect the enable count */ 31 struct mutex lock; /* Protect the enable count */
32 atomic_t use_count; 32 atomic_t use_count;
33 struct clk *clk;
33 void *priv; 34 void *priv;
34}; 35};
35 36
@@ -43,7 +44,7 @@ struct v4l2_clk_ops {
43 44
44struct v4l2_clk *v4l2_clk_register(const struct v4l2_clk_ops *ops, 45struct v4l2_clk *v4l2_clk_register(const struct v4l2_clk_ops *ops,
45 const char *dev_name, 46 const char *dev_name,
46 const char *name, void *priv); 47 void *priv);
47void v4l2_clk_unregister(struct v4l2_clk *clk); 48void v4l2_clk_unregister(struct v4l2_clk *clk);
48struct v4l2_clk *v4l2_clk_get(struct device *dev, const char *id); 49struct v4l2_clk *v4l2_clk_get(struct device *dev, const char *id);
49void v4l2_clk_put(struct v4l2_clk *clk); 50void v4l2_clk_put(struct v4l2_clk *clk);
@@ -55,14 +56,13 @@ int v4l2_clk_set_rate(struct v4l2_clk *clk, unsigned long rate);
55struct module; 56struct module;
56 57
57struct v4l2_clk *__v4l2_clk_register_fixed(const char *dev_id, 58struct v4l2_clk *__v4l2_clk_register_fixed(const char *dev_id,
58 const char *id, unsigned long rate, struct module *owner); 59 unsigned long rate, struct module *owner);
59void v4l2_clk_unregister_fixed(struct v4l2_clk *clk); 60void v4l2_clk_unregister_fixed(struct v4l2_clk *clk);
60 61
61static inline struct v4l2_clk *v4l2_clk_register_fixed(const char *dev_id, 62static inline struct v4l2_clk *v4l2_clk_register_fixed(const char *dev_id,
62 const char *id,
63 unsigned long rate) 63 unsigned long rate)
64{ 64{
65 return __v4l2_clk_register_fixed(dev_id, id, rate, THIS_MODULE); 65 return __v4l2_clk_register_fixed(dev_id, rate, THIS_MODULE);
66} 66}
67 67
68#define v4l2_clk_name_i2c(name, size, adap, client) snprintf(name, size, \ 68#define v4l2_clk_name_i2c(name, size, adap, client) snprintf(name, size, \
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index 3e4fddfc840c..acbcd2f5fe7f 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -65,7 +65,6 @@ struct v4l2_file_operations {
65 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); 65 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
66 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); 66 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
67 unsigned int (*poll) (struct file *, struct poll_table_struct *); 67 unsigned int (*poll) (struct file *, struct poll_table_struct *);
68 long (*ioctl) (struct file *, unsigned int, unsigned long);
69 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); 68 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
70#ifdef CONFIG_COMPAT 69#ifdef CONFIG_COMPAT
71 long (*compat_ioctl32) (struct file *, unsigned int, unsigned long); 70 long (*compat_ioctl32) (struct file *, unsigned int, unsigned long);
diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h
index ffb69da3ce9e..9c581578783f 100644
--- a/include/media/v4l2-device.h
+++ b/include/media/v4l2-device.h
@@ -58,8 +58,6 @@ struct v4l2_device {
58 struct v4l2_ctrl_handler *ctrl_handler; 58 struct v4l2_ctrl_handler *ctrl_handler;
59 /* Device's priority state */ 59 /* Device's priority state */
60 struct v4l2_prio_state prio; 60 struct v4l2_prio_state prio;
61 /* BKL replacement mutex. Temporary solution only. */
62 struct mutex ioctl_lock;
63 /* Keep track of the references to this struct. */ 61 /* Keep track of the references to this struct. */
64 struct kref ref; 62 struct kref ref;
65 /* Release function that is called when the ref count goes to 0. */ 63 /* Release function that is called when the ref count goes to 0. */
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index 8537983b9b22..8fbbd76d78e8 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -23,12 +23,6 @@ struct v4l2_ioctl_ops {
23 /* VIDIOC_QUERYCAP handler */ 23 /* VIDIOC_QUERYCAP handler */
24 int (*vidioc_querycap)(struct file *file, void *fh, struct v4l2_capability *cap); 24 int (*vidioc_querycap)(struct file *file, void *fh, struct v4l2_capability *cap);
25 25
26 /* Priority handling */
27 int (*vidioc_g_priority) (struct file *file, void *fh,
28 enum v4l2_priority *p);
29 int (*vidioc_s_priority) (struct file *file, void *fh,
30 enum v4l2_priority p);
31
32 /* VIDIOC_ENUM_FMT handlers */ 26 /* VIDIOC_ENUM_FMT handlers */
33 int (*vidioc_enum_fmt_vid_cap) (struct file *file, void *fh, 27 int (*vidioc_enum_fmt_vid_cap) (struct file *file, void *fh,
34 struct v4l2_fmtdesc *f); 28 struct v4l2_fmtdesc *f);
diff --git a/include/media/v4l2-of.h b/include/media/v4l2-of.h
index 70fa7b7b0487..f831c9c225b6 100644
--- a/include/media/v4l2-of.h
+++ b/include/media/v4l2-of.h
@@ -29,12 +29,15 @@ struct device_node;
29 * @data_lanes: an array of physical data lane indexes 29 * @data_lanes: an array of physical data lane indexes
30 * @clock_lane: physical lane index of the clock lane 30 * @clock_lane: physical lane index of the clock lane
31 * @num_data_lanes: number of data lanes 31 * @num_data_lanes: number of data lanes
32 * @lane_polarities: polarity of the lanes. The order is the same of
33 * the physical lanes.
32 */ 34 */
33struct v4l2_of_bus_mipi_csi2 { 35struct v4l2_of_bus_mipi_csi2 {
34 unsigned int flags; 36 unsigned int flags;
35 unsigned char data_lanes[4]; 37 unsigned char data_lanes[4];
36 unsigned char clock_lane; 38 unsigned char clock_lane;
37 unsigned short num_data_lanes; 39 unsigned short num_data_lanes;
40 bool lane_polarities[5];
38}; 41};
39 42
40/** 43/**
@@ -66,9 +69,26 @@ struct v4l2_of_endpoint {
66 struct list_head head; 69 struct list_head head;
67}; 70};
68 71
72/**
73 * struct v4l2_of_link - a link between two endpoints
74 * @local_node: pointer to device_node of this endpoint
75 * @local_port: identifier of the port this endpoint belongs to
76 * @remote_node: pointer to device_node of the remote endpoint
77 * @remote_port: identifier of the port the remote endpoint belongs to
78 */
79struct v4l2_of_link {
80 struct device_node *local_node;
81 unsigned int local_port;
82 struct device_node *remote_node;
83 unsigned int remote_port;
84};
85
69#ifdef CONFIG_OF 86#ifdef CONFIG_OF
70int v4l2_of_parse_endpoint(const struct device_node *node, 87int v4l2_of_parse_endpoint(const struct device_node *node,
71 struct v4l2_of_endpoint *endpoint); 88 struct v4l2_of_endpoint *endpoint);
89int v4l2_of_parse_link(const struct device_node *node,
90 struct v4l2_of_link *link);
91void v4l2_of_put_link(struct v4l2_of_link *link);
72#else /* CONFIG_OF */ 92#else /* CONFIG_OF */
73 93
74static inline int v4l2_of_parse_endpoint(const struct device_node *node, 94static inline int v4l2_of_parse_endpoint(const struct device_node *node,
@@ -77,6 +97,16 @@ static inline int v4l2_of_parse_endpoint(const struct device_node *node,
77 return -ENOSYS; 97 return -ENOSYS;
78} 98}
79 99
100static inline int v4l2_of_parse_link(const struct device_node *node,
101 struct v4l2_of_link *link)
102{
103 return -ENOSYS;
104}
105
106static inline void v4l2_of_put_link(struct v4l2_of_link *link)
107{
108}
109
80#endif /* CONFIG_OF */ 110#endif /* CONFIG_OF */
81 111
82#endif /* _V4L2_OF_H */ 112#endif /* _V4L2_OF_H */
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 5beeb8744fd1..2f0a345a7fed 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -332,8 +332,6 @@ struct v4l2_subdev_video_ops {
332 struct v4l2_subdev_frame_interval *interval); 332 struct v4l2_subdev_frame_interval *interval);
333 int (*s_frame_interval)(struct v4l2_subdev *sd, 333 int (*s_frame_interval)(struct v4l2_subdev *sd,
334 struct v4l2_subdev_frame_interval *interval); 334 struct v4l2_subdev_frame_interval *interval);
335 int (*enum_framesizes)(struct v4l2_subdev *sd, struct v4l2_frmsizeenum *fsize);
336 int (*enum_frameintervals)(struct v4l2_subdev *sd, struct v4l2_frmivalenum *fival);
337 int (*s_dv_timings)(struct v4l2_subdev *sd, 335 int (*s_dv_timings)(struct v4l2_subdev *sd,
338 struct v4l2_dv_timings *timings); 336 struct v4l2_dv_timings *timings);
339 int (*g_dv_timings)(struct v4l2_subdev *sd, 337 int (*g_dv_timings)(struct v4l2_subdev *sd,
@@ -482,6 +480,18 @@ struct v4l2_subdev_ir_ops {
482 struct v4l2_subdev_ir_parameters *params); 480 struct v4l2_subdev_ir_parameters *params);
483}; 481};
484 482
483/*
484 * Used for storing subdev pad information. This structure only needs
485 * to be passed to the pad op if the 'which' field of the main argument
486 * is set to V4L2_SUBDEV_FORMAT_TRY. For V4L2_SUBDEV_FORMAT_ACTIVE it is
487 * safe to pass NULL.
488 */
489struct v4l2_subdev_pad_config {
490 struct v4l2_mbus_framefmt try_fmt;
491 struct v4l2_rect try_crop;
492 struct v4l2_rect try_compose;
493};
494
485/** 495/**
486 * struct v4l2_subdev_pad_ops - v4l2-subdev pad level operations 496 * struct v4l2_subdev_pad_ops - v4l2-subdev pad level operations
487 * @get_frame_desc: get the current low level media bus frame parameters. 497 * @get_frame_desc: get the current low level media bus frame parameters.
@@ -489,21 +499,26 @@ struct v4l2_subdev_ir_ops {
489 * may be adjusted by the subdev driver to device capabilities. 499 * may be adjusted by the subdev driver to device capabilities.
490 */ 500 */
491struct v4l2_subdev_pad_ops { 501struct v4l2_subdev_pad_ops {
492 int (*enum_mbus_code)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, 502 int (*enum_mbus_code)(struct v4l2_subdev *sd,
503 struct v4l2_subdev_pad_config *cfg,
493 struct v4l2_subdev_mbus_code_enum *code); 504 struct v4l2_subdev_mbus_code_enum *code);
494 int (*enum_frame_size)(struct v4l2_subdev *sd, 505 int (*enum_frame_size)(struct v4l2_subdev *sd,
495 struct v4l2_subdev_fh *fh, 506 struct v4l2_subdev_pad_config *cfg,
496 struct v4l2_subdev_frame_size_enum *fse); 507 struct v4l2_subdev_frame_size_enum *fse);
497 int (*enum_frame_interval)(struct v4l2_subdev *sd, 508 int (*enum_frame_interval)(struct v4l2_subdev *sd,
498 struct v4l2_subdev_fh *fh, 509 struct v4l2_subdev_pad_config *cfg,
499 struct v4l2_subdev_frame_interval_enum *fie); 510 struct v4l2_subdev_frame_interval_enum *fie);
500 int (*get_fmt)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, 511 int (*get_fmt)(struct v4l2_subdev *sd,
512 struct v4l2_subdev_pad_config *cfg,
501 struct v4l2_subdev_format *format); 513 struct v4l2_subdev_format *format);
502 int (*set_fmt)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, 514 int (*set_fmt)(struct v4l2_subdev *sd,
515 struct v4l2_subdev_pad_config *cfg,
503 struct v4l2_subdev_format *format); 516 struct v4l2_subdev_format *format);
504 int (*get_selection)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, 517 int (*get_selection)(struct v4l2_subdev *sd,
518 struct v4l2_subdev_pad_config *cfg,
505 struct v4l2_subdev_selection *sel); 519 struct v4l2_subdev_selection *sel);
506 int (*set_selection)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, 520 int (*set_selection)(struct v4l2_subdev *sd,
521 struct v4l2_subdev_pad_config *cfg,
507 struct v4l2_subdev_selection *sel); 522 struct v4l2_subdev_selection *sel);
508 int (*get_edid)(struct v4l2_subdev *sd, struct v4l2_edid *edid); 523 int (*get_edid)(struct v4l2_subdev *sd, struct v4l2_edid *edid);
509 int (*set_edid)(struct v4l2_subdev *sd, struct v4l2_edid *edid); 524 int (*set_edid)(struct v4l2_subdev *sd, struct v4l2_edid *edid);
@@ -625,11 +640,7 @@ struct v4l2_subdev {
625struct v4l2_subdev_fh { 640struct v4l2_subdev_fh {
626 struct v4l2_fh vfh; 641 struct v4l2_fh vfh;
627#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API) 642#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
628 struct { 643 struct v4l2_subdev_pad_config *pad;
629 struct v4l2_mbus_framefmt try_fmt;
630 struct v4l2_rect try_crop;
631 struct v4l2_rect try_compose;
632 } *pad;
633#endif 644#endif
634}; 645};
635 646
@@ -639,17 +650,17 @@ struct v4l2_subdev_fh {
639#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API) 650#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
640#define __V4L2_SUBDEV_MK_GET_TRY(rtype, fun_name, field_name) \ 651#define __V4L2_SUBDEV_MK_GET_TRY(rtype, fun_name, field_name) \
641 static inline struct rtype * \ 652 static inline struct rtype * \
642 v4l2_subdev_get_try_##fun_name(struct v4l2_subdev_fh *fh, \ 653 fun_name(struct v4l2_subdev *sd, \
643 unsigned int pad) \ 654 struct v4l2_subdev_pad_config *cfg, \
655 unsigned int pad) \
644 { \ 656 { \
645 BUG_ON(pad >= vdev_to_v4l2_subdev( \ 657 BUG_ON(pad >= sd->entity.num_pads); \
646 fh->vfh.vdev)->entity.num_pads); \ 658 return &cfg[pad].field_name; \
647 return &fh->pad[pad].field_name; \
648 } 659 }
649 660
650__V4L2_SUBDEV_MK_GET_TRY(v4l2_mbus_framefmt, format, try_fmt) 661__V4L2_SUBDEV_MK_GET_TRY(v4l2_mbus_framefmt, v4l2_subdev_get_try_format, try_fmt)
651__V4L2_SUBDEV_MK_GET_TRY(v4l2_rect, crop, try_crop) 662__V4L2_SUBDEV_MK_GET_TRY(v4l2_rect, v4l2_subdev_get_try_crop, try_crop)
652__V4L2_SUBDEV_MK_GET_TRY(v4l2_rect, compose, try_compose) 663__V4L2_SUBDEV_MK_GET_TRY(v4l2_rect, v4l2_subdev_get_try_compose, try_compose)
653#endif 664#endif
654 665
655extern const struct v4l2_file_operations v4l2_subdev_fops; 666extern const struct v4l2_file_operations v4l2_subdev_fops;
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index bd2cec2d6c3d..a5790fd5d125 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -134,17 +134,6 @@ enum vb2_io_modes {
134}; 134};
135 135
136/** 136/**
137 * enum vb2_fileio_flags - flags for selecting a mode of the file io emulator,
138 * by default the 'streaming' style is used by the file io emulator
139 * @VB2_FILEIO_READ_ONCE: report EOF after reading the first buffer
140 * @VB2_FILEIO_WRITE_IMMEDIATELY: queue buffer after each write() call
141 */
142enum vb2_fileio_flags {
143 VB2_FILEIO_READ_ONCE = (1 << 0),
144 VB2_FILEIO_WRITE_IMMEDIATELY = (1 << 1),
145};
146
147/**
148 * enum vb2_buffer_state - current video buffer state 137 * enum vb2_buffer_state - current video buffer state
149 * @VB2_BUF_STATE_DEQUEUED: buffer under userspace control 138 * @VB2_BUF_STATE_DEQUEUED: buffer under userspace control
150 * @VB2_BUF_STATE_PREPARING: buffer is being prepared in videobuf 139 * @VB2_BUF_STATE_PREPARING: buffer is being prepared in videobuf
@@ -346,7 +335,9 @@ struct v4l2_fh;
346 * 335 *
347 * @type: queue type (see V4L2_BUF_TYPE_* in linux/videodev2.h 336 * @type: queue type (see V4L2_BUF_TYPE_* in linux/videodev2.h
348 * @io_modes: supported io methods (see vb2_io_modes enum) 337 * @io_modes: supported io methods (see vb2_io_modes enum)
349 * @io_flags: additional io flags (see vb2_fileio_flags enum) 338 * @fileio_read_once: report EOF after reading the first buffer
339 * @fileio_write_immediately: queue buffer after each write() call
340 * @allow_zero_bytesused: allow bytesused == 0 to be passed to the driver
350 * @lock: pointer to a mutex that protects the vb2_queue struct. The 341 * @lock: pointer to a mutex that protects the vb2_queue struct. The
351 * driver can set this to a mutex to let the v4l2 core serialize 342 * driver can set this to a mutex to let the v4l2 core serialize
352 * the queuing ioctls. If the driver wants to handle locking 343 * the queuing ioctls. If the driver wants to handle locking
@@ -396,7 +387,10 @@ struct v4l2_fh;
396struct vb2_queue { 387struct vb2_queue {
397 enum v4l2_buf_type type; 388 enum v4l2_buf_type type;
398 unsigned int io_modes; 389 unsigned int io_modes;
399 unsigned int io_flags; 390 unsigned fileio_read_once:1;
391 unsigned fileio_write_immediately:1;
392 unsigned allow_zero_bytesused:1;
393
400 struct mutex *lock; 394 struct mutex *lock;
401 struct v4l2_fh *owner; 395 struct v4l2_fh *owner;
402 396