diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/platform_data/vsp1.h | 2 | ||||
| -rw-r--r-- | include/media/adv7604.h | 38 | ||||
| -rw-r--r-- | include/media/adv7842.h | 59 | ||||
| -rw-r--r-- | include/media/atmel-isi.h | 2 | ||||
| -rw-r--r-- | include/media/media-entity.h | 1 | ||||
| -rw-r--r-- | include/media/omap4iss.h | 65 | ||||
| -rw-r--r-- | include/media/rc-map.h | 1 | ||||
| -rw-r--r-- | include/media/saa6588.h | 2 | ||||
| -rw-r--r-- | include/media/saa6752hs.h | 26 | ||||
| -rw-r--r-- | include/media/si4713.h | 2 | ||||
| -rw-r--r-- | include/media/v4l2-fh.h | 4 | ||||
| -rw-r--r-- | include/media/v4l2-int-device.h | 305 | ||||
| -rw-r--r-- | include/media/v4l2-mem2mem.h | 24 | ||||
| -rw-r--r-- | include/media/v4l2-of.h | 6 | ||||
| -rw-r--r-- | include/media/videobuf2-core.h | 18 | ||||
| -rw-r--r-- | include/trace/events/v4l2.h | 157 | ||||
| -rw-r--r-- | include/uapi/linux/media.h | 1 | ||||
| -rw-r--r-- | include/uapi/linux/v4l2-controls.h | 9 | ||||
| -rw-r--r-- | include/uapi/linux/v4l2-mediabus.h | 3 | ||||
| -rw-r--r-- | include/uapi/linux/videodev2.h | 4 | ||||
| -rw-r--r-- | include/uapi/linux/vsp1.h | 34 |
21 files changed, 396 insertions, 367 deletions
diff --git a/include/linux/platform_data/vsp1.h b/include/linux/platform_data/vsp1.h index a73a456d7f11..63170e2614b3 100644 --- a/include/linux/platform_data/vsp1.h +++ b/include/linux/platform_data/vsp1.h | |||
| @@ -14,6 +14,8 @@ | |||
| 14 | #define __PLATFORM_VSP1_H__ | 14 | #define __PLATFORM_VSP1_H__ |
| 15 | 15 | ||
| 16 | #define VSP1_HAS_LIF (1 << 0) | 16 | #define VSP1_HAS_LIF (1 << 0) |
| 17 | #define VSP1_HAS_LUT (1 << 1) | ||
| 18 | #define VSP1_HAS_SRU (1 << 2) | ||
| 17 | 19 | ||
| 18 | struct vsp1_platform_data { | 20 | struct vsp1_platform_data { |
| 19 | unsigned int features; | 21 | unsigned int features; |
diff --git a/include/media/adv7604.h b/include/media/adv7604.h index dc004bc926c9..d262a3a922bd 100644 --- a/include/media/adv7604.h +++ b/include/media/adv7604.h | |||
| @@ -78,11 +78,14 @@ enum adv7604_op_format_sel { | |||
| 78 | ADV7604_OP_FORMAT_SEL_SDR_ITU656_24_MODE2 = 0x8a, | 78 | ADV7604_OP_FORMAT_SEL_SDR_ITU656_24_MODE2 = 0x8a, |
| 79 | }; | 79 | }; |
| 80 | 80 | ||
| 81 | enum adv7604_drive_strength { | ||
| 82 | ADV7604_DR_STR_MEDIUM_LOW = 1, | ||
| 83 | ADV7604_DR_STR_MEDIUM_HIGH = 2, | ||
| 84 | ADV7604_DR_STR_HIGH = 3, | ||
| 85 | }; | ||
| 86 | |||
| 81 | /* Platform dependent definition */ | 87 | /* Platform dependent definition */ |
| 82 | struct adv7604_platform_data { | 88 | struct adv7604_platform_data { |
| 83 | /* connector - HDMI or DVI? */ | ||
| 84 | unsigned connector_hdmi:1; | ||
| 85 | |||
| 86 | /* DIS_PWRDNB: 1 if the PWRDNB pin is unused and unconnected */ | 89 | /* DIS_PWRDNB: 1 if the PWRDNB pin is unused and unconnected */ |
| 87 | unsigned disable_pwrdnb:1; | 90 | unsigned disable_pwrdnb:1; |
| 88 | 91 | ||
| @@ -110,6 +113,15 @@ struct adv7604_platform_data { | |||
| 110 | unsigned replicate_av_codes:1; | 113 | unsigned replicate_av_codes:1; |
| 111 | unsigned invert_cbcr:1; | 114 | unsigned invert_cbcr:1; |
| 112 | 115 | ||
| 116 | /* IO register 0x06 */ | ||
| 117 | unsigned inv_vs_pol:1; | ||
| 118 | unsigned inv_hs_pol:1; | ||
| 119 | |||
| 120 | /* IO register 0x14 */ | ||
| 121 | enum adv7604_drive_strength dr_str_data; | ||
| 122 | enum adv7604_drive_strength dr_str_clk; | ||
| 123 | enum adv7604_drive_strength dr_str_sync; | ||
| 124 | |||
| 113 | /* IO register 0x30 */ | 125 | /* IO register 0x30 */ |
| 114 | unsigned output_bus_lsb_to_msb:1; | 126 | unsigned output_bus_lsb_to_msb:1; |
| 115 | 127 | ||
| @@ -131,16 +143,20 @@ struct adv7604_platform_data { | |||
| 131 | u8 i2c_vdp; | 143 | u8 i2c_vdp; |
| 132 | }; | 144 | }; |
| 133 | 145 | ||
| 134 | /* | 146 | enum adv7604_input_port { |
| 135 | * Mode of operation. | 147 | ADV7604_INPUT_HDMI_PORT_A, |
| 136 | * This is used as the input argument of the s_routing video op. | 148 | ADV7604_INPUT_HDMI_PORT_B, |
| 137 | */ | 149 | ADV7604_INPUT_HDMI_PORT_C, |
| 138 | enum adv7604_mode { | 150 | ADV7604_INPUT_HDMI_PORT_D, |
| 139 | ADV7604_MODE_COMP, | 151 | ADV7604_INPUT_VGA_RGB, |
| 140 | ADV7604_MODE_GR, | 152 | ADV7604_INPUT_VGA_COMP, |
| 141 | ADV7604_MODE_HDMI, | ||
| 142 | }; | 153 | }; |
| 143 | 154 | ||
| 155 | #define ADV7604_EDID_PORT_A 0 | ||
| 156 | #define ADV7604_EDID_PORT_B 1 | ||
| 157 | #define ADV7604_EDID_PORT_C 2 | ||
| 158 | #define ADV7604_EDID_PORT_D 3 | ||
| 159 | |||
| 144 | #define V4L2_CID_ADV_RX_ANALOG_SAMPLING_PHASE (V4L2_CID_DV_CLASS_BASE + 0x1000) | 160 | #define V4L2_CID_ADV_RX_ANALOG_SAMPLING_PHASE (V4L2_CID_DV_CLASS_BASE + 0x1000) |
| 145 | #define V4L2_CID_ADV_RX_FREE_RUN_COLOR_MANUAL (V4L2_CID_DV_CLASS_BASE + 0x1001) | 161 | #define V4L2_CID_ADV_RX_FREE_RUN_COLOR_MANUAL (V4L2_CID_DV_CLASS_BASE + 0x1001) |
| 146 | #define V4L2_CID_ADV_RX_FREE_RUN_COLOR (V4L2_CID_DV_CLASS_BASE + 0x1002) | 162 | #define V4L2_CID_ADV_RX_FREE_RUN_COLOR (V4L2_CID_DV_CLASS_BASE + 0x1002) |
diff --git a/include/media/adv7842.h b/include/media/adv7842.h index c02201d1c092..39322091e8b0 100644 --- a/include/media/adv7842.h +++ b/include/media/adv7842.h | |||
| @@ -108,6 +108,13 @@ enum adv7842_select_input { | |||
| 108 | ADV7842_SELECT_SDP_YC, | 108 | ADV7842_SELECT_SDP_YC, |
| 109 | }; | 109 | }; |
| 110 | 110 | ||
| 111 | enum adv7842_drive_strength { | ||
| 112 | ADV7842_DR_STR_LOW = 0, | ||
| 113 | ADV7842_DR_STR_MEDIUM_LOW = 1, | ||
| 114 | ADV7842_DR_STR_MEDIUM_HIGH = 2, | ||
| 115 | ADV7842_DR_STR_HIGH = 3, | ||
| 116 | }; | ||
| 117 | |||
| 111 | struct adv7842_sdp_csc_coeff { | 118 | struct adv7842_sdp_csc_coeff { |
| 112 | bool manual; | 119 | bool manual; |
| 113 | uint16_t scaling; | 120 | uint16_t scaling; |
| @@ -131,13 +138,18 @@ struct adv7842_sdp_io_sync_adjustment { | |||
| 131 | uint16_t hs_width; | 138 | uint16_t hs_width; |
| 132 | uint16_t de_beg; | 139 | uint16_t de_beg; |
| 133 | uint16_t de_end; | 140 | uint16_t de_end; |
| 141 | uint8_t vs_beg_o; | ||
| 142 | uint8_t vs_beg_e; | ||
| 143 | uint8_t vs_end_o; | ||
| 144 | uint8_t vs_end_e; | ||
| 145 | uint8_t de_v_beg_o; | ||
| 146 | uint8_t de_v_beg_e; | ||
| 147 | uint8_t de_v_end_o; | ||
| 148 | uint8_t de_v_end_e; | ||
| 134 | }; | 149 | }; |
| 135 | 150 | ||
| 136 | /* Platform dependent definition */ | 151 | /* Platform dependent definition */ |
| 137 | struct adv7842_platform_data { | 152 | struct adv7842_platform_data { |
| 138 | /* connector - HDMI or DVI? */ | ||
| 139 | unsigned connector_hdmi:1; | ||
| 140 | |||
| 141 | /* chip reset during probe */ | 153 | /* chip reset during probe */ |
| 142 | unsigned chip_reset:1; | 154 | unsigned chip_reset:1; |
| 143 | 155 | ||
| @@ -156,12 +168,12 @@ struct adv7842_platform_data { | |||
| 156 | /* Default mode */ | 168 | /* Default mode */ |
| 157 | enum adv7842_mode mode; | 169 | enum adv7842_mode mode; |
| 158 | 170 | ||
| 171 | /* Default input */ | ||
| 172 | unsigned input; | ||
| 173 | |||
| 159 | /* Video standard */ | 174 | /* Video standard */ |
| 160 | enum adv7842_vid_std_select vid_std_select; | 175 | enum adv7842_vid_std_select vid_std_select; |
| 161 | 176 | ||
| 162 | /* Input Color Space */ | ||
| 163 | enum adv7842_inp_color_space inp_color_space; | ||
| 164 | |||
| 165 | /* Select output format */ | 177 | /* Select output format */ |
| 166 | enum adv7842_op_format_sel op_format_sel; | 178 | enum adv7842_op_format_sel op_format_sel; |
| 167 | 179 | ||
| @@ -181,22 +193,37 @@ struct adv7842_platform_data { | |||
| 181 | unsigned output_bus_lsb_to_msb:1; | 193 | unsigned output_bus_lsb_to_msb:1; |
| 182 | 194 | ||
| 183 | /* IO register 0x14 */ | 195 | /* IO register 0x14 */ |
| 184 | struct { | 196 | enum adv7842_drive_strength dr_str_data; |
| 185 | unsigned data:2; | 197 | enum adv7842_drive_strength dr_str_clk; |
| 186 | unsigned clock:2; | 198 | enum adv7842_drive_strength dr_str_sync; |
| 187 | unsigned sync:2; | 199 | |
| 188 | } drive_strength; | 200 | /* |
| 201 | * IO register 0x19: Adjustment to the LLC DLL phase in | ||
| 202 | * increments of 1/32 of a clock period. | ||
| 203 | */ | ||
| 204 | unsigned llc_dll_phase:5; | ||
| 189 | 205 | ||
| 190 | /* External RAM for 3-D comb or frame synchronizer */ | 206 | /* External RAM for 3-D comb or frame synchronizer */ |
| 191 | unsigned sd_ram_size; /* ram size in MB */ | 207 | unsigned sd_ram_size; /* ram size in MB */ |
| 192 | unsigned sd_ram_ddr:1; /* ddr or sdr sdram */ | 208 | unsigned sd_ram_ddr:1; /* ddr or sdr sdram */ |
| 193 | 209 | ||
| 194 | /* Free run */ | 210 | /* HDMI free run, CP-reg 0xBA */ |
| 195 | unsigned hdmi_free_run_mode; | 211 | unsigned hdmi_free_run_enable:1; |
| 212 | /* 0 = Mode 0: run when there is no TMDS clock | ||
| 213 | 1 = Mode 1: run when there is no TMDS clock or the | ||
| 214 | video resolution does not match programmed one. */ | ||
| 215 | unsigned hdmi_free_run_mode:1; | ||
| 216 | |||
| 217 | /* SDP free run, CP-reg 0xDD */ | ||
| 218 | unsigned sdp_free_run_auto:1; | ||
| 219 | unsigned sdp_free_run_man_col_en:1; | ||
| 220 | unsigned sdp_free_run_cbar_en:1; | ||
| 221 | unsigned sdp_free_run_force:1; | ||
| 196 | 222 | ||
| 197 | struct adv7842_sdp_csc_coeff sdp_csc_coeff; | 223 | struct adv7842_sdp_csc_coeff sdp_csc_coeff; |
| 198 | 224 | ||
| 199 | struct adv7842_sdp_io_sync_adjustment sdp_io_sync; | 225 | struct adv7842_sdp_io_sync_adjustment sdp_io_sync_625; |
| 226 | struct adv7842_sdp_io_sync_adjustment sdp_io_sync_525; | ||
| 200 | 227 | ||
| 201 | /* i2c addresses */ | 228 | /* i2c addresses */ |
| 202 | u8 i2c_sdp_io; | 229 | u8 i2c_sdp_io; |
| @@ -223,4 +250,8 @@ struct adv7842_platform_data { | |||
| 223 | * deinterlacer. */ | 250 | * deinterlacer. */ |
| 224 | #define ADV7842_CMD_RAM_TEST _IO('V', BASE_VIDIOC_PRIVATE) | 251 | #define ADV7842_CMD_RAM_TEST _IO('V', BASE_VIDIOC_PRIVATE) |
| 225 | 252 | ||
| 253 | #define ADV7842_EDID_PORT_A 0 | ||
| 254 | #define ADV7842_EDID_PORT_B 1 | ||
| 255 | #define ADV7842_EDID_PORT_VGA 2 | ||
| 256 | |||
| 226 | #endif | 257 | #endif |
diff --git a/include/media/atmel-isi.h b/include/media/atmel-isi.h index 656823075709..2b023471ac89 100644 --- a/include/media/atmel-isi.h +++ b/include/media/atmel-isi.h | |||
| @@ -56,6 +56,7 @@ | |||
| 56 | #define ISI_CFG1_FRATE_DIV_6 (5 << 8) | 56 | #define ISI_CFG1_FRATE_DIV_6 (5 << 8) |
| 57 | #define ISI_CFG1_FRATE_DIV_7 (6 << 8) | 57 | #define ISI_CFG1_FRATE_DIV_7 (6 << 8) |
| 58 | #define ISI_CFG1_FRATE_DIV_8 (7 << 8) | 58 | #define ISI_CFG1_FRATE_DIV_8 (7 << 8) |
| 59 | #define ISI_CFG1_FRATE_DIV_MASK (7 << 8) | ||
| 59 | #define ISI_CFG1_DISCR (1 << 11) | 60 | #define ISI_CFG1_DISCR (1 << 11) |
| 60 | #define ISI_CFG1_FULL_MODE (1 << 12) | 61 | #define ISI_CFG1_FULL_MODE (1 << 12) |
| 61 | 62 | ||
| @@ -66,6 +67,7 @@ | |||
| 66 | #define ISI_CFG2_YCC_SWAP_MODE_1 (1 << 28) | 67 | #define ISI_CFG2_YCC_SWAP_MODE_1 (1 << 28) |
| 67 | #define ISI_CFG2_YCC_SWAP_MODE_2 (2 << 28) | 68 | #define ISI_CFG2_YCC_SWAP_MODE_2 (2 << 28) |
| 68 | #define ISI_CFG2_YCC_SWAP_MODE_3 (3 << 28) | 69 | #define ISI_CFG2_YCC_SWAP_MODE_3 (3 << 28) |
| 70 | #define ISI_CFG2_YCC_SWAP_MODE_MASK (3 << 28) | ||
| 69 | #define ISI_CFG2_IM_VSIZE_OFFSET 0 | 71 | #define ISI_CFG2_IM_VSIZE_OFFSET 0 |
| 70 | #define ISI_CFG2_IM_HSIZE_OFFSET 16 | 72 | #define ISI_CFG2_IM_HSIZE_OFFSET 16 |
| 71 | #define ISI_CFG2_IM_VSIZE_MASK (0x7FF << ISI_CFG2_IM_VSIZE_OFFSET) | 73 | #define ISI_CFG2_IM_VSIZE_MASK (0x7FF << ISI_CFG2_IM_VSIZE_OFFSET) |
diff --git a/include/media/media-entity.h b/include/media/media-entity.h index 10df55187981..e00459185d20 100644 --- a/include/media/media-entity.h +++ b/include/media/media-entity.h | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #define _MEDIA_ENTITY_H | 24 | #define _MEDIA_ENTITY_H |
| 25 | 25 | ||
| 26 | #include <linux/bitops.h> | 26 | #include <linux/bitops.h> |
| 27 | #include <linux/kernel.h> | ||
| 27 | #include <linux/list.h> | 28 | #include <linux/list.h> |
| 28 | #include <linux/media.h> | 29 | #include <linux/media.h> |
| 29 | 30 | ||
diff --git a/include/media/omap4iss.h b/include/media/omap4iss.h new file mode 100644 index 000000000000..0d7620db5e32 --- /dev/null +++ b/include/media/omap4iss.h | |||
| @@ -0,0 +1,65 @@ | |||
| 1 | #ifndef ARCH_ARM_PLAT_OMAP4_ISS_H | ||
| 2 | #define ARCH_ARM_PLAT_OMAP4_ISS_H | ||
| 3 | |||
| 4 | #include <linux/i2c.h> | ||
| 5 | |||
| 6 | struct iss_device; | ||
| 7 | |||
| 8 | enum iss_interface_type { | ||
| 9 | ISS_INTERFACE_CSI2A_PHY1, | ||
| 10 | ISS_INTERFACE_CSI2B_PHY2, | ||
| 11 | }; | ||
| 12 | |||
| 13 | /** | ||
| 14 | * struct iss_csiphy_lane: CSI2 lane position and polarity | ||
| 15 | * @pos: position of the lane | ||
| 16 | * @pol: polarity of the lane | ||
| 17 | */ | ||
| 18 | struct iss_csiphy_lane { | ||
| 19 | u8 pos; | ||
| 20 | u8 pol; | ||
| 21 | }; | ||
| 22 | |||
| 23 | #define ISS_CSIPHY1_NUM_DATA_LANES 4 | ||
| 24 | #define ISS_CSIPHY2_NUM_DATA_LANES 1 | ||
| 25 | |||
| 26 | /** | ||
| 27 | * struct iss_csiphy_lanes_cfg - CSI2 lane configuration | ||
| 28 | * @data: Configuration of one or two data lanes | ||
| 29 | * @clk: Clock lane configuration | ||
| 30 | */ | ||
| 31 | struct iss_csiphy_lanes_cfg { | ||
| 32 | struct iss_csiphy_lane data[ISS_CSIPHY1_NUM_DATA_LANES]; | ||
| 33 | struct iss_csiphy_lane clk; | ||
| 34 | }; | ||
| 35 | |||
| 36 | /** | ||
| 37 | * struct iss_csi2_platform_data - CSI2 interface platform data | ||
| 38 | * @crc: Enable the cyclic redundancy check | ||
| 39 | * @vpclk_div: Video port output clock control | ||
| 40 | */ | ||
| 41 | struct iss_csi2_platform_data { | ||
| 42 | unsigned crc:1; | ||
| 43 | unsigned vpclk_div:2; | ||
| 44 | struct iss_csiphy_lanes_cfg lanecfg; | ||
| 45 | }; | ||
| 46 | |||
| 47 | struct iss_subdev_i2c_board_info { | ||
| 48 | struct i2c_board_info *board_info; | ||
| 49 | int i2c_adapter_id; | ||
| 50 | }; | ||
| 51 | |||
| 52 | struct iss_v4l2_subdevs_group { | ||
| 53 | struct iss_subdev_i2c_board_info *subdevs; | ||
| 54 | enum iss_interface_type interface; | ||
| 55 | union { | ||
| 56 | struct iss_csi2_platform_data csi2; | ||
| 57 | } bus; /* gcc < 4.6.0 chokes on anonymous union initializers */ | ||
| 58 | }; | ||
| 59 | |||
| 60 | struct iss_platform_data { | ||
| 61 | struct iss_v4l2_subdevs_group *subdevs; | ||
| 62 | void (*set_constraints)(struct iss_device *iss, bool enable); | ||
| 63 | }; | ||
| 64 | |||
| 65 | #endif | ||
diff --git a/include/media/rc-map.h b/include/media/rc-map.h index 6628f5d01f52..a20ed97d7d8a 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h | |||
| @@ -193,6 +193,7 @@ void rc_map_init(void); | |||
| 193 | #define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr" | 193 | #define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr" |
| 194 | #define RC_MAP_WINFAST "rc-winfast" | 194 | #define RC_MAP_WINFAST "rc-winfast" |
| 195 | #define RC_MAP_WINFAST_USBII_DELUXE "rc-winfast-usbii-deluxe" | 195 | #define RC_MAP_WINFAST_USBII_DELUXE "rc-winfast-usbii-deluxe" |
| 196 | #define RC_MAP_SU3000 "rc-su3000" | ||
| 196 | 197 | ||
| 197 | /* | 198 | /* |
| 198 | * Please, do not just append newer Remote Controller names at the end. | 199 | * Please, do not just append newer Remote Controller names at the end. |
diff --git a/include/media/saa6588.h b/include/media/saa6588.h index 2c3c4420a4eb..b5ec1aa60ed5 100644 --- a/include/media/saa6588.h +++ b/include/media/saa6588.h | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | 27 | ||
| 28 | struct saa6588_command { | 28 | struct saa6588_command { |
| 29 | unsigned int block_count; | 29 | unsigned int block_count; |
| 30 | bool nonblocking; | ||
| 30 | int result; | 31 | int result; |
| 31 | unsigned char __user *buffer; | 32 | unsigned char __user *buffer; |
| 32 | struct file *instance; | 33 | struct file *instance; |
| @@ -34,7 +35,6 @@ struct saa6588_command { | |||
| 34 | }; | 35 | }; |
| 35 | 36 | ||
| 36 | /* These ioctls are internal to the kernel */ | 37 | /* These ioctls are internal to the kernel */ |
| 37 | #define SAA6588_CMD_OPEN _IOW('R', 1, int) | ||
| 38 | #define SAA6588_CMD_CLOSE _IOW('R', 2, int) | 38 | #define SAA6588_CMD_CLOSE _IOW('R', 2, int) |
| 39 | #define SAA6588_CMD_READ _IOR('R', 3, int) | 39 | #define SAA6588_CMD_READ _IOR('R', 3, int) |
| 40 | #define SAA6588_CMD_POLL _IOR('R', 4, int) | 40 | #define SAA6588_CMD_POLL _IOR('R', 4, int) |
diff --git a/include/media/saa6752hs.h b/include/media/saa6752hs.h deleted file mode 100644 index 3b8686ead80d..000000000000 --- a/include/media/saa6752hs.h +++ /dev/null | |||
| @@ -1,26 +0,0 @@ | |||
| 1 | /* | ||
| 2 | saa6752hs.h - definition for saa6752hs MPEG encoder | ||
| 3 | |||
| 4 | Copyright (C) 2003 Andrew de Quincey <adq@lidskialf.net> | ||
| 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 | |||
| 22 | /* | ||
| 23 | * Local variables: | ||
| 24 | * c-basic-offset: 8 | ||
| 25 | * End: | ||
| 26 | */ | ||
diff --git a/include/media/si4713.h b/include/media/si4713.h index ed7353e8a982..f98a0a7af61c 100644 --- a/include/media/si4713.h +++ b/include/media/si4713.h | |||
| @@ -23,6 +23,8 @@ | |||
| 23 | * Platform dependent definition | 23 | * Platform dependent definition |
| 24 | */ | 24 | */ |
| 25 | struct si4713_platform_data { | 25 | struct si4713_platform_data { |
| 26 | const char * const *supply_names; | ||
| 27 | unsigned supplies; | ||
| 26 | int gpio_reset; /* < 0 if not used */ | 28 | int gpio_reset; /* < 0 if not used */ |
| 27 | }; | 29 | }; |
| 28 | 30 | ||
diff --git a/include/media/v4l2-fh.h b/include/media/v4l2-fh.h index 528cdaf622e1..803516775162 100644 --- a/include/media/v4l2-fh.h +++ b/include/media/v4l2-fh.h | |||
| @@ -45,6 +45,10 @@ struct v4l2_fh { | |||
| 45 | struct list_head available; /* Dequeueable event */ | 45 | struct list_head available; /* Dequeueable event */ |
| 46 | unsigned int navailable; | 46 | unsigned int navailable; |
| 47 | u32 sequence; | 47 | u32 sequence; |
| 48 | |||
| 49 | #if IS_ENABLED(CONFIG_V4L2_MEM2MEM_DEV) | ||
| 50 | struct v4l2_m2m_ctx *m2m_ctx; | ||
| 51 | #endif | ||
| 48 | }; | 52 | }; |
| 49 | 53 | ||
| 50 | /* | 54 | /* |
diff --git a/include/media/v4l2-int-device.h b/include/media/v4l2-int-device.h deleted file mode 100644 index 0286c95814ff..000000000000 --- a/include/media/v4l2-int-device.h +++ /dev/null | |||
| @@ -1,305 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/media/v4l2-int-device.h | ||
| 3 | * | ||
| 4 | * V4L2 internal ioctl interface. | ||
| 5 | * | ||
| 6 | * Copyright (C) 2007 Nokia Corporation. | ||
| 7 | * | ||
| 8 | * Contact: Sakari Ailus <sakari.ailus@nokia.com> | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or | ||
| 11 | * modify it under the terms of the GNU General Public License | ||
| 12 | * version 2 as published by the Free Software Foundation. | ||
| 13 | * | ||
| 14 | * This program is distributed in the hope that it will be useful, but | ||
| 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 17 | * General Public License for more details. | ||
| 18 | * | ||
| 19 | * You should have received a copy of the GNU General Public License | ||
| 20 | * along with this program; if not, write to the Free Software | ||
| 21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
| 22 | * 02110-1301 USA | ||
| 23 | */ | ||
| 24 | |||
| 25 | #ifndef V4L2_INT_DEVICE_H | ||
| 26 | #define V4L2_INT_DEVICE_H | ||
| 27 | |||
| 28 | #include <media/v4l2-common.h> | ||
| 29 | |||
| 30 | #define V4L2NAMESIZE 32 | ||
| 31 | |||
| 32 | /* | ||
| 33 | * | ||
| 34 | * The internal V4L2 device interface core. | ||
| 35 | * | ||
| 36 | */ | ||
| 37 | |||
| 38 | enum v4l2_int_type { | ||
| 39 | v4l2_int_type_master = 1, | ||
| 40 | v4l2_int_type_slave | ||
| 41 | }; | ||
| 42 | |||
| 43 | struct module; | ||
| 44 | |||
| 45 | struct v4l2_int_device; | ||
| 46 | |||
| 47 | struct v4l2_int_master { | ||
| 48 | int (*attach)(struct v4l2_int_device *slave); | ||
| 49 | void (*detach)(struct v4l2_int_device *slave); | ||
| 50 | }; | ||
| 51 | |||
| 52 | typedef int (v4l2_int_ioctl_func)(struct v4l2_int_device *); | ||
| 53 | typedef int (v4l2_int_ioctl_func_0)(struct v4l2_int_device *); | ||
| 54 | typedef int (v4l2_int_ioctl_func_1)(struct v4l2_int_device *, void *); | ||
| 55 | |||
| 56 | struct v4l2_int_ioctl_desc { | ||
| 57 | int num; | ||
| 58 | v4l2_int_ioctl_func *func; | ||
| 59 | }; | ||
| 60 | |||
| 61 | struct v4l2_int_slave { | ||
| 62 | /* Don't touch master. */ | ||
| 63 | struct v4l2_int_device *master; | ||
| 64 | |||
| 65 | char attach_to[V4L2NAMESIZE]; | ||
| 66 | |||
| 67 | int num_ioctls; | ||
| 68 | struct v4l2_int_ioctl_desc *ioctls; | ||
| 69 | }; | ||
| 70 | |||
| 71 | struct v4l2_int_device { | ||
| 72 | /* Don't touch head. */ | ||
| 73 | struct list_head head; | ||
| 74 | |||
| 75 | struct module *module; | ||
| 76 | |||
| 77 | char name[V4L2NAMESIZE]; | ||
| 78 | |||
| 79 | enum v4l2_int_type type; | ||
| 80 | union { | ||
| 81 | struct v4l2_int_master *master; | ||
| 82 | struct v4l2_int_slave *slave; | ||
| 83 | } u; | ||
| 84 | |||
| 85 | void *priv; | ||
| 86 | }; | ||
| 87 | |||
| 88 | void v4l2_int_device_try_attach_all(void); | ||
| 89 | |||
| 90 | int v4l2_int_device_register(struct v4l2_int_device *d); | ||
| 91 | void v4l2_int_device_unregister(struct v4l2_int_device *d); | ||
| 92 | |||
| 93 | int v4l2_int_ioctl_0(struct v4l2_int_device *d, int cmd); | ||
| 94 | int v4l2_int_ioctl_1(struct v4l2_int_device *d, int cmd, void *arg); | ||
| 95 | |||
| 96 | /* | ||
| 97 | * | ||
| 98 | * Types and definitions for IOCTL commands. | ||
| 99 | * | ||
| 100 | */ | ||
| 101 | |||
| 102 | enum v4l2_power { | ||
| 103 | V4L2_POWER_OFF = 0, | ||
| 104 | V4L2_POWER_ON, | ||
| 105 | V4L2_POWER_STANDBY, | ||
| 106 | }; | ||
| 107 | |||
| 108 | /* Slave interface type. */ | ||
| 109 | enum v4l2_if_type { | ||
| 110 | /* | ||
| 111 | * Parallel 8-, 10- or 12-bit interface, used by for example | ||
| 112 | * on certain image sensors. | ||
| 113 | */ | ||
| 114 | V4L2_IF_TYPE_BT656, | ||
| 115 | }; | ||
| 116 | |||
| 117 | enum v4l2_if_type_bt656_mode { | ||
| 118 | /* | ||
| 119 | * Modes without Bt synchronisation codes. Separate | ||
| 120 | * synchronisation signal lines are used. | ||
| 121 | */ | ||
| 122 | V4L2_IF_TYPE_BT656_MODE_NOBT_8BIT, | ||
| 123 | V4L2_IF_TYPE_BT656_MODE_NOBT_10BIT, | ||
| 124 | V4L2_IF_TYPE_BT656_MODE_NOBT_12BIT, | ||
| 125 | /* | ||
| 126 | * Use Bt synchronisation codes. The vertical and horizontal | ||
| 127 | * synchronisation is done based on synchronisation codes. | ||
| 128 | */ | ||
| 129 | V4L2_IF_TYPE_BT656_MODE_BT_8BIT, | ||
| 130 | V4L2_IF_TYPE_BT656_MODE_BT_10BIT, | ||
| 131 | }; | ||
| 132 | |||
| 133 | struct v4l2_if_type_bt656 { | ||
| 134 | /* | ||
| 135 | * 0: Frame begins when vsync is high. | ||
| 136 | * 1: Frame begins when vsync changes from low to high. | ||
| 137 | */ | ||
| 138 | unsigned frame_start_on_rising_vs:1; | ||
| 139 | /* Use Bt synchronisation codes for sync correction. */ | ||
| 140 | unsigned bt_sync_correct:1; | ||
| 141 | /* Swap every two adjacent image data elements. */ | ||
| 142 | unsigned swap:1; | ||
| 143 | /* Inverted latch clock polarity from slave. */ | ||
| 144 | unsigned latch_clk_inv:1; | ||
| 145 | /* Hs polarity. 0 is active high, 1 active low. */ | ||
| 146 | unsigned nobt_hs_inv:1; | ||
| 147 | /* Vs polarity. 0 is active high, 1 active low. */ | ||
| 148 | unsigned nobt_vs_inv:1; | ||
| 149 | enum v4l2_if_type_bt656_mode mode; | ||
| 150 | /* Minimum accepted bus clock for slave (in Hz). */ | ||
| 151 | u32 clock_min; | ||
| 152 | /* Maximum accepted bus clock for slave. */ | ||
| 153 | u32 clock_max; | ||
| 154 | /* | ||
| 155 | * Current wish of the slave. May only change in response to | ||
| 156 | * ioctls that affect image capture. | ||
| 157 | */ | ||
| 158 | u32 clock_curr; | ||
| 159 | }; | ||
| 160 | |||
| 161 | struct v4l2_ifparm { | ||
| 162 | enum v4l2_if_type if_type; | ||
| 163 | union { | ||
| 164 | struct v4l2_if_type_bt656 bt656; | ||
| 165 | } u; | ||
| 166 | }; | ||
| 167 | |||
| 168 | /* IOCTL command numbers. */ | ||
| 169 | enum v4l2_int_ioctl_num { | ||
| 170 | /* | ||
| 171 | * | ||
| 172 | * "Proper" V4L ioctls, as in struct video_device. | ||
| 173 | * | ||
| 174 | */ | ||
| 175 | vidioc_int_enum_fmt_cap_num = 1, | ||
| 176 | vidioc_int_g_fmt_cap_num, | ||
| 177 | vidioc_int_s_fmt_cap_num, | ||
| 178 | vidioc_int_try_fmt_cap_num, | ||
| 179 | vidioc_int_queryctrl_num, | ||
| 180 | vidioc_int_g_ctrl_num, | ||
| 181 | vidioc_int_s_ctrl_num, | ||
| 182 | vidioc_int_cropcap_num, | ||
| 183 | vidioc_int_g_crop_num, | ||
| 184 | vidioc_int_s_crop_num, | ||
| 185 | vidioc_int_g_parm_num, | ||
| 186 | vidioc_int_s_parm_num, | ||
| 187 | vidioc_int_querystd_num, | ||
| 188 | vidioc_int_s_std_num, | ||
| 189 | vidioc_int_s_video_routing_num, | ||
| 190 | |||
| 191 | /* | ||
| 192 | * | ||
| 193 | * Strictly internal ioctls. | ||
| 194 | * | ||
| 195 | */ | ||
| 196 | /* Initialise the device when slave attaches to the master. */ | ||
| 197 | vidioc_int_dev_init_num = 1000, | ||
| 198 | /* Delinitialise the device at slave detach. */ | ||
| 199 | vidioc_int_dev_exit_num, | ||
| 200 | /* Set device power state. */ | ||
| 201 | vidioc_int_s_power_num, | ||
| 202 | /* | ||
| 203 | * Get slave private data, e.g. platform-specific slave | ||
| 204 | * configuration used by the master. | ||
| 205 | */ | ||
| 206 | vidioc_int_g_priv_num, | ||
| 207 | /* Get slave interface parameters. */ | ||
| 208 | vidioc_int_g_ifparm_num, | ||
| 209 | /* Does the slave need to be reset after VIDIOC_DQBUF? */ | ||
| 210 | vidioc_int_g_needs_reset_num, | ||
| 211 | vidioc_int_enum_framesizes_num, | ||
| 212 | vidioc_int_enum_frameintervals_num, | ||
| 213 | |||
| 214 | /* | ||
| 215 | * | ||
| 216 | * VIDIOC_INT_* ioctls. | ||
| 217 | * | ||
| 218 | */ | ||
| 219 | /* VIDIOC_INT_RESET */ | ||
| 220 | vidioc_int_reset_num, | ||
| 221 | /* VIDIOC_INT_INIT */ | ||
| 222 | vidioc_int_init_num, | ||
| 223 | |||
| 224 | /* | ||
| 225 | * | ||
| 226 | * Start of private ioctls. | ||
| 227 | * | ||
| 228 | */ | ||
| 229 | vidioc_int_priv_start_num = 2000, | ||
| 230 | }; | ||
| 231 | |||
| 232 | /* | ||
| 233 | * | ||
| 234 | * IOCTL wrapper functions for better type checking. | ||
| 235 | * | ||
| 236 | */ | ||
| 237 | |||
| 238 | #define V4L2_INT_WRAPPER_0(name) \ | ||
| 239 | static inline int vidioc_int_##name(struct v4l2_int_device *d) \ | ||
| 240 | { \ | ||
| 241 | return v4l2_int_ioctl_0(d, vidioc_int_##name##_num); \ | ||
| 242 | } \ | ||
| 243 | \ | ||
| 244 | static inline struct v4l2_int_ioctl_desc \ | ||
| 245 | vidioc_int_##name##_cb(int (*func) \ | ||
| 246 | (struct v4l2_int_device *)) \ | ||
| 247 | { \ | ||
| 248 | struct v4l2_int_ioctl_desc desc; \ | ||
| 249 | \ | ||
| 250 | desc.num = vidioc_int_##name##_num; \ | ||
| 251 | desc.func = (v4l2_int_ioctl_func *)func; \ | ||
| 252 | \ | ||
| 253 | return desc; \ | ||
| 254 | } | ||
| 255 | |||
| 256 | #define V4L2_INT_WRAPPER_1(name, arg_type, asterisk) \ | ||
| 257 | static inline int vidioc_int_##name(struct v4l2_int_device *d, \ | ||
| 258 | arg_type asterisk arg) \ | ||
| 259 | { \ | ||
| 260 | return v4l2_int_ioctl_1(d, vidioc_int_##name##_num, \ | ||
| 261 | (void *)(unsigned long)arg); \ | ||
| 262 | } \ | ||
| 263 | \ | ||
| 264 | static inline struct v4l2_int_ioctl_desc \ | ||
| 265 | vidioc_int_##name##_cb(int (*func) \ | ||
| 266 | (struct v4l2_int_device *, \ | ||
| 267 | arg_type asterisk)) \ | ||
| 268 | { \ | ||
| 269 | struct v4l2_int_ioctl_desc desc; \ | ||
| 270 | \ | ||
| 271 | desc.num = vidioc_int_##name##_num; \ | ||
| 272 | desc.func = (v4l2_int_ioctl_func *)func; \ | ||
| 273 | \ | ||
| 274 | return desc; \ | ||
| 275 | } | ||
| 276 | |||
| 277 | V4L2_INT_WRAPPER_1(enum_fmt_cap, struct v4l2_fmtdesc, *); | ||
| 278 | V4L2_INT_WRAPPER_1(g_fmt_cap, struct v4l2_format, *); | ||
| 279 | V4L2_INT_WRAPPER_1(s_fmt_cap, struct v4l2_format, *); | ||
| 280 | V4L2_INT_WRAPPER_1(try_fmt_cap, struct v4l2_format, *); | ||
| 281 | V4L2_INT_WRAPPER_1(queryctrl, struct v4l2_queryctrl, *); | ||
| 282 | V4L2_INT_WRAPPER_1(g_ctrl, struct v4l2_control, *); | ||
| 283 | V4L2_INT_WRAPPER_1(s_ctrl, struct v4l2_control, *); | ||
| 284 | V4L2_INT_WRAPPER_1(cropcap, struct v4l2_cropcap, *); | ||
| 285 | V4L2_INT_WRAPPER_1(g_crop, struct v4l2_crop, *); | ||
| 286 | V4L2_INT_WRAPPER_1(s_crop, struct v4l2_crop, *); | ||
| 287 | V4L2_INT_WRAPPER_1(g_parm, struct v4l2_streamparm, *); | ||
| 288 | V4L2_INT_WRAPPER_1(s_parm, struct v4l2_streamparm, *); | ||
| 289 | V4L2_INT_WRAPPER_1(querystd, v4l2_std_id, *); | ||
| 290 | V4L2_INT_WRAPPER_1(s_std, v4l2_std_id, *); | ||
| 291 | V4L2_INT_WRAPPER_1(s_video_routing, struct v4l2_routing, *); | ||
| 292 | |||
| 293 | V4L2_INT_WRAPPER_0(dev_init); | ||
| 294 | V4L2_INT_WRAPPER_0(dev_exit); | ||
| 295 | V4L2_INT_WRAPPER_1(s_power, enum v4l2_power, ); | ||
| 296 | V4L2_INT_WRAPPER_1(g_priv, void, *); | ||
| 297 | V4L2_INT_WRAPPER_1(g_ifparm, struct v4l2_ifparm, *); | ||
| 298 | V4L2_INT_WRAPPER_1(g_needs_reset, void, *); | ||
| 299 | V4L2_INT_WRAPPER_1(enum_framesizes, struct v4l2_frmsizeenum, *); | ||
| 300 | V4L2_INT_WRAPPER_1(enum_frameintervals, struct v4l2_frmivalenum, *); | ||
| 301 | |||
| 302 | V4L2_INT_WRAPPER_0(reset); | ||
| 303 | V4L2_INT_WRAPPER_0(init); | ||
| 304 | |||
| 305 | #endif | ||
diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h index 44542a20ab81..12ea5a6a4331 100644 --- a/include/media/v4l2-mem2mem.h +++ b/include/media/v4l2-mem2mem.h | |||
| @@ -64,6 +64,9 @@ struct v4l2_m2m_queue_ctx { | |||
| 64 | }; | 64 | }; |
| 65 | 65 | ||
| 66 | struct v4l2_m2m_ctx { | 66 | struct v4l2_m2m_ctx { |
| 67 | /* optional cap/out vb2 queues lock */ | ||
| 68 | struct mutex *q_lock; | ||
| 69 | |||
| 67 | /* private: internal use only */ | 70 | /* private: internal use only */ |
| 68 | struct v4l2_m2m_dev *m2m_dev; | 71 | struct v4l2_m2m_dev *m2m_dev; |
| 69 | 72 | ||
| @@ -229,5 +232,26 @@ static inline void *v4l2_m2m_dst_buf_remove(struct v4l2_m2m_ctx *m2m_ctx) | |||
| 229 | return v4l2_m2m_buf_remove(&m2m_ctx->cap_q_ctx); | 232 | return v4l2_m2m_buf_remove(&m2m_ctx->cap_q_ctx); |
| 230 | } | 233 | } |
| 231 | 234 | ||
| 235 | /* v4l2 ioctl helpers */ | ||
| 236 | |||
| 237 | int v4l2_m2m_ioctl_reqbufs(struct file *file, void *priv, | ||
| 238 | struct v4l2_requestbuffers *rb); | ||
| 239 | int v4l2_m2m_ioctl_create_bufs(struct file *file, void *fh, | ||
| 240 | struct v4l2_create_buffers *create); | ||
| 241 | int v4l2_m2m_ioctl_querybuf(struct file *file, void *fh, | ||
| 242 | struct v4l2_buffer *buf); | ||
| 243 | int v4l2_m2m_ioctl_expbuf(struct file *file, void *fh, | ||
| 244 | struct v4l2_exportbuffer *eb); | ||
| 245 | int v4l2_m2m_ioctl_qbuf(struct file *file, void *fh, | ||
| 246 | struct v4l2_buffer *buf); | ||
| 247 | int v4l2_m2m_ioctl_dqbuf(struct file *file, void *fh, | ||
| 248 | struct v4l2_buffer *buf); | ||
| 249 | int v4l2_m2m_ioctl_streamon(struct file *file, void *fh, | ||
| 250 | enum v4l2_buf_type type); | ||
| 251 | int v4l2_m2m_ioctl_streamoff(struct file *file, void *fh, | ||
| 252 | enum v4l2_buf_type type); | ||
| 253 | int v4l2_m2m_fop_mmap(struct file *file, struct vm_area_struct *vma); | ||
| 254 | unsigned int v4l2_m2m_fop_poll(struct file *file, poll_table *wait); | ||
| 255 | |||
| 232 | #endif /* _MEDIA_V4L2_MEM2MEM_H */ | 256 | #endif /* _MEDIA_V4L2_MEM2MEM_H */ |
| 233 | 257 | ||
diff --git a/include/media/v4l2-of.h b/include/media/v4l2-of.h index 3a8a84124b44..541cea4122e9 100644 --- a/include/media/v4l2-of.h +++ b/include/media/v4l2-of.h | |||
| @@ -53,7 +53,6 @@ struct v4l2_of_bus_parallel { | |||
| 53 | * @port: identifier (value of reg property) of a port this endpoint belongs to | 53 | * @port: identifier (value of reg property) of a port this endpoint belongs to |
| 54 | * @id: identifier (value of reg property) of this endpoint | 54 | * @id: identifier (value of reg property) of this endpoint |
| 55 | * @local_node: pointer to device_node of this endpoint | 55 | * @local_node: pointer to device_node of this endpoint |
| 56 | * @remote: phandle to remote endpoint node | ||
| 57 | * @bus_type: bus type | 56 | * @bus_type: bus type |
| 58 | * @bus: bus configuration data structure | 57 | * @bus: bus configuration data structure |
| 59 | * @head: list head for this structure | 58 | * @head: list head for this structure |
| @@ -62,7 +61,6 @@ struct v4l2_of_endpoint { | |||
| 62 | unsigned int port; | 61 | unsigned int port; |
| 63 | unsigned int id; | 62 | unsigned int id; |
| 64 | const struct device_node *local_node; | 63 | const struct device_node *local_node; |
| 65 | const __be32 *remote; | ||
| 66 | enum v4l2_mbus_type bus_type; | 64 | enum v4l2_mbus_type bus_type; |
| 67 | union { | 65 | union { |
| 68 | struct v4l2_of_bus_parallel parallel; | 66 | struct v4l2_of_bus_parallel parallel; |
| @@ -72,8 +70,8 @@ struct v4l2_of_endpoint { | |||
| 72 | }; | 70 | }; |
| 73 | 71 | ||
| 74 | #ifdef CONFIG_OF | 72 | #ifdef CONFIG_OF |
| 75 | void v4l2_of_parse_endpoint(const struct device_node *node, | 73 | int v4l2_of_parse_endpoint(const struct device_node *node, |
| 76 | struct v4l2_of_endpoint *link); | 74 | struct v4l2_of_endpoint *endpoint); |
| 77 | struct device_node *v4l2_of_get_next_endpoint(const struct device_node *parent, | 75 | struct device_node *v4l2_of_get_next_endpoint(const struct device_node *parent, |
| 78 | struct device_node *previous); | 76 | struct device_node *previous); |
| 79 | struct device_node *v4l2_of_get_remote_port_parent( | 77 | struct device_node *v4l2_of_get_remote_port_parent( |
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index 941055e9d125..bef53ce555d2 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h | |||
| @@ -142,6 +142,7 @@ enum vb2_fileio_flags { | |||
| 142 | /** | 142 | /** |
| 143 | * enum vb2_buffer_state - current video buffer state | 143 | * enum vb2_buffer_state - current video buffer state |
| 144 | * @VB2_BUF_STATE_DEQUEUED: buffer under userspace control | 144 | * @VB2_BUF_STATE_DEQUEUED: buffer under userspace control |
| 145 | * @VB2_BUF_STATE_PREPARING: buffer is being prepared in videobuf | ||
| 145 | * @VB2_BUF_STATE_PREPARED: buffer prepared in videobuf and by the driver | 146 | * @VB2_BUF_STATE_PREPARED: buffer prepared in videobuf and by the driver |
| 146 | * @VB2_BUF_STATE_QUEUED: buffer queued in videobuf, but not in driver | 147 | * @VB2_BUF_STATE_QUEUED: buffer queued in videobuf, but not in driver |
| 147 | * @VB2_BUF_STATE_ACTIVE: buffer queued in driver and possibly used | 148 | * @VB2_BUF_STATE_ACTIVE: buffer queued in driver and possibly used |
| @@ -154,6 +155,7 @@ enum vb2_fileio_flags { | |||
| 154 | */ | 155 | */ |
| 155 | enum vb2_buffer_state { | 156 | enum vb2_buffer_state { |
| 156 | VB2_BUF_STATE_DEQUEUED, | 157 | VB2_BUF_STATE_DEQUEUED, |
| 158 | VB2_BUF_STATE_PREPARING, | ||
| 157 | VB2_BUF_STATE_PREPARED, | 159 | VB2_BUF_STATE_PREPARED, |
| 158 | VB2_BUF_STATE_QUEUED, | 160 | VB2_BUF_STATE_QUEUED, |
| 159 | VB2_BUF_STATE_ACTIVE, | 161 | VB2_BUF_STATE_ACTIVE, |
| @@ -250,10 +252,13 @@ struct vb2_buffer { | |||
| 250 | * receive buffers with @buf_queue callback before | 252 | * receive buffers with @buf_queue callback before |
| 251 | * @start_streaming is called; the driver gets the number | 253 | * @start_streaming is called; the driver gets the number |
| 252 | * of already queued buffers in count parameter; driver | 254 | * of already queued buffers in count parameter; driver |
| 253 | * can return an error if hardware fails or not enough | 255 | * can return an error if hardware fails, in that case all |
| 254 | * buffers has been queued, in such case all buffers that | 256 | * buffers that have been already given by the @buf_queue |
| 255 | * have been already given by the @buf_queue callback are | 257 | * callback are invalidated. |
| 256 | * invalidated. | 258 | * If there were not enough queued buffers to start |
| 259 | * streaming, then this callback returns -ENOBUFS, and the | ||
| 260 | * vb2 core will retry calling @start_streaming when a new | ||
| 261 | * buffer is queued. | ||
| 257 | * @stop_streaming: called when 'streaming' state must be disabled; driver | 262 | * @stop_streaming: called when 'streaming' state must be disabled; driver |
| 258 | * should stop any DMA transactions or wait until they | 263 | * should stop any DMA transactions or wait until they |
| 259 | * finish and give back all buffers it got from buf_queue() | 264 | * finish and give back all buffers it got from buf_queue() |
| @@ -321,6 +326,9 @@ struct v4l2_fh; | |||
| 321 | * @done_wq: waitqueue for processes waiting for buffers ready to be dequeued | 326 | * @done_wq: waitqueue for processes waiting for buffers ready to be dequeued |
| 322 | * @alloc_ctx: memory type/allocator-specific contexts for each plane | 327 | * @alloc_ctx: memory type/allocator-specific contexts for each plane |
| 323 | * @streaming: current streaming state | 328 | * @streaming: current streaming state |
| 329 | * @retry_start_streaming: start_streaming() was called, but there were not enough | ||
| 330 | * buffers queued. If set, then retry calling start_streaming when | ||
| 331 | * queuing a new buffer. | ||
| 324 | * @fileio: file io emulator internal data, used only if emulator is active | 332 | * @fileio: file io emulator internal data, used only if emulator is active |
| 325 | */ | 333 | */ |
| 326 | struct vb2_queue { | 334 | struct vb2_queue { |
| @@ -353,6 +361,7 @@ struct vb2_queue { | |||
| 353 | unsigned int plane_sizes[VIDEO_MAX_PLANES]; | 361 | unsigned int plane_sizes[VIDEO_MAX_PLANES]; |
| 354 | 362 | ||
| 355 | unsigned int streaming:1; | 363 | unsigned int streaming:1; |
| 364 | unsigned int retry_start_streaming:1; | ||
| 356 | 365 | ||
| 357 | struct vb2_fileio_data *fileio; | 366 | struct vb2_fileio_data *fileio; |
| 358 | }; | 367 | }; |
| @@ -491,6 +500,7 @@ int vb2_ioctl_expbuf(struct file *file, void *priv, | |||
| 491 | 500 | ||
| 492 | int vb2_fop_mmap(struct file *file, struct vm_area_struct *vma); | 501 | int vb2_fop_mmap(struct file *file, struct vm_area_struct *vma); |
| 493 | int vb2_fop_release(struct file *file); | 502 | int vb2_fop_release(struct file *file); |
| 503 | int _vb2_fop_release(struct file *file, struct mutex *lock); | ||
| 494 | ssize_t vb2_fop_write(struct file *file, const char __user *buf, | 504 | ssize_t vb2_fop_write(struct file *file, const char __user *buf, |
| 495 | size_t count, loff_t *ppos); | 505 | size_t count, loff_t *ppos); |
| 496 | ssize_t vb2_fop_read(struct file *file, char __user *buf, | 506 | ssize_t vb2_fop_read(struct file *file, char __user *buf, |
diff --git a/include/trace/events/v4l2.h b/include/trace/events/v4l2.h new file mode 100644 index 000000000000..ef94ecad1c94 --- /dev/null +++ b/include/trace/events/v4l2.h | |||
| @@ -0,0 +1,157 @@ | |||
| 1 | #undef TRACE_SYSTEM | ||
| 2 | #define TRACE_SYSTEM v4l2 | ||
| 3 | |||
| 4 | #if !defined(_TRACE_V4L2_H) || defined(TRACE_HEADER_MULTI_READ) | ||
| 5 | #define _TRACE_V4L2_H | ||
| 6 | |||
| 7 | #include <linux/tracepoint.h> | ||
| 8 | |||
| 9 | #define show_type(type) \ | ||
| 10 | __print_symbolic(type, \ | ||
| 11 | { V4L2_BUF_TYPE_VIDEO_CAPTURE, "VIDEO_CAPTURE" }, \ | ||
| 12 | { V4L2_BUF_TYPE_VIDEO_OUTPUT, "VIDEO_OUTPUT" }, \ | ||
| 13 | { V4L2_BUF_TYPE_VIDEO_OVERLAY, "VIDEO_OVERLAY" }, \ | ||
| 14 | { V4L2_BUF_TYPE_VBI_CAPTURE, "VBI_CAPTURE" }, \ | ||
| 15 | { V4L2_BUF_TYPE_VBI_OUTPUT, "VBI_OUTPUT" }, \ | ||
| 16 | { V4L2_BUF_TYPE_SLICED_VBI_CAPTURE, "SLICED_VBI_CAPTURE" }, \ | ||
| 17 | { V4L2_BUF_TYPE_SLICED_VBI_OUTPUT, "SLICED_VBI_OUTPUT" }, \ | ||
| 18 | { V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY, "VIDEO_OUTPUT_OVERLAY" },\ | ||
| 19 | { V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, "VIDEO_CAPTURE_MPLANE" },\ | ||
| 20 | { V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, "VIDEO_OUTPUT_MPLANE" }, \ | ||
| 21 | { V4L2_BUF_TYPE_PRIVATE, "PRIVATE" }) | ||
| 22 | |||
| 23 | #define show_field(field) \ | ||
| 24 | __print_symbolic(field, \ | ||
| 25 | { V4L2_FIELD_ANY, "ANY" }, \ | ||
| 26 | { V4L2_FIELD_NONE, "NONE" }, \ | ||
| 27 | { V4L2_FIELD_TOP, "TOP" }, \ | ||
| 28 | { V4L2_FIELD_BOTTOM, "BOTTOM" }, \ | ||
| 29 | { V4L2_FIELD_INTERLACED, "INTERLACED" }, \ | ||
| 30 | { V4L2_FIELD_SEQ_TB, "SEQ_TB" }, \ | ||
| 31 | { V4L2_FIELD_SEQ_BT, "SEQ_BT" }, \ | ||
| 32 | { V4L2_FIELD_ALTERNATE, "ALTERNATE" }, \ | ||
| 33 | { V4L2_FIELD_INTERLACED_TB, "INTERLACED_TB" }, \ | ||
| 34 | { V4L2_FIELD_INTERLACED_BT, "INTERLACED_BT" }) | ||
| 35 | |||
| 36 | #define show_timecode_type(type) \ | ||
| 37 | __print_symbolic(type, \ | ||
| 38 | { V4L2_TC_TYPE_24FPS, "24FPS" }, \ | ||
| 39 | { V4L2_TC_TYPE_25FPS, "25FPS" }, \ | ||
| 40 | { V4L2_TC_TYPE_30FPS, "30FPS" }, \ | ||
| 41 | { V4L2_TC_TYPE_50FPS, "50FPS" }, \ | ||
| 42 | { V4L2_TC_TYPE_60FPS, "60FPS" }) | ||
| 43 | |||
| 44 | #define show_flags(flags) \ | ||
| 45 | __print_flags(flags, "|", \ | ||
| 46 | { V4L2_BUF_FLAG_MAPPED, "MAPPED" }, \ | ||
| 47 | { V4L2_BUF_FLAG_QUEUED, "QUEUED" }, \ | ||
| 48 | { V4L2_BUF_FLAG_DONE, "DONE" }, \ | ||
| 49 | { V4L2_BUF_FLAG_KEYFRAME, "KEYFRAME" }, \ | ||
| 50 | { V4L2_BUF_FLAG_PFRAME, "PFRAME" }, \ | ||
| 51 | { V4L2_BUF_FLAG_BFRAME, "BFRAME" }, \ | ||
| 52 | { V4L2_BUF_FLAG_ERROR, "ERROR" }, \ | ||
| 53 | { V4L2_BUF_FLAG_TIMECODE, "TIMECODE" }, \ | ||
| 54 | { V4L2_BUF_FLAG_PREPARED, "PREPARED" }, \ | ||
| 55 | { V4L2_BUF_FLAG_NO_CACHE_INVALIDATE, "NO_CACHE_INVALIDATE" }, \ | ||
| 56 | { V4L2_BUF_FLAG_NO_CACHE_CLEAN, "NO_CACHE_CLEAN" }, \ | ||
| 57 | { V4L2_BUF_FLAG_TIMESTAMP_MASK, "TIMESTAMP_MASK" }, \ | ||
| 58 | { V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN, "TIMESTAMP_UNKNOWN" }, \ | ||
| 59 | { V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC, "TIMESTAMP_MONOTONIC" }, \ | ||
| 60 | { V4L2_BUF_FLAG_TIMESTAMP_COPY, "TIMESTAMP_COPY" }) | ||
| 61 | |||
| 62 | #define show_timecode_flags(flags) \ | ||
| 63 | __print_flags(flags, "|", \ | ||
| 64 | { V4L2_TC_FLAG_DROPFRAME, "DROPFRAME" }, \ | ||
| 65 | { V4L2_TC_FLAG_COLORFRAME, "COLORFRAME" }, \ | ||
| 66 | { V4L2_TC_USERBITS_USERDEFINED, "USERBITS_USERDEFINED" }, \ | ||
| 67 | { V4L2_TC_USERBITS_8BITCHARS, "USERBITS_8BITCHARS" }) | ||
| 68 | |||
| 69 | #define V4L2_TRACE_EVENT(event_name) \ | ||
| 70 | TRACE_EVENT(event_name, \ | ||
| 71 | TP_PROTO(int minor, struct v4l2_buffer *buf), \ | ||
| 72 | \ | ||
| 73 | TP_ARGS(minor, buf), \ | ||
| 74 | \ | ||
| 75 | TP_STRUCT__entry( \ | ||
| 76 | __field(int, minor) \ | ||
| 77 | __field(u32, index) \ | ||
| 78 | __field(u32, type) \ | ||
| 79 | __field(u32, bytesused) \ | ||
| 80 | __field(u32, flags) \ | ||
| 81 | __field(u32, field) \ | ||
| 82 | __field(s64, timestamp) \ | ||
| 83 | __field(u32, timecode_type) \ | ||
| 84 | __field(u32, timecode_flags) \ | ||
| 85 | __field(u8, timecode_frames) \ | ||
| 86 | __field(u8, timecode_seconds) \ | ||
| 87 | __field(u8, timecode_minutes) \ | ||
| 88 | __field(u8, timecode_hours) \ | ||
| 89 | __field(u8, timecode_userbits0) \ | ||
| 90 | __field(u8, timecode_userbits1) \ | ||
| 91 | __field(u8, timecode_userbits2) \ | ||
| 92 | __field(u8, timecode_userbits3) \ | ||
| 93 | __field(u32, sequence) \ | ||
| 94 | ), \ | ||
| 95 | \ | ||
| 96 | TP_fast_assign( \ | ||
| 97 | __entry->minor = minor; \ | ||
| 98 | __entry->index = buf->index; \ | ||
| 99 | __entry->type = buf->type; \ | ||
| 100 | __entry->bytesused = buf->bytesused; \ | ||
| 101 | __entry->flags = buf->flags; \ | ||
| 102 | __entry->field = buf->field; \ | ||
| 103 | __entry->timestamp = \ | ||
| 104 | timeval_to_ns(&buf->timestamp); \ | ||
| 105 | __entry->timecode_type = buf->timecode.type; \ | ||
| 106 | __entry->timecode_flags = buf->timecode.flags; \ | ||
| 107 | __entry->timecode_frames = \ | ||
| 108 | buf->timecode.frames; \ | ||
| 109 | __entry->timecode_seconds = \ | ||
| 110 | buf->timecode.seconds; \ | ||
| 111 | __entry->timecode_minutes = \ | ||
| 112 | buf->timecode.minutes; \ | ||
| 113 | __entry->timecode_hours = buf->timecode.hours; \ | ||
| 114 | __entry->timecode_userbits0 = \ | ||
| 115 | buf->timecode.userbits[0]; \ | ||
| 116 | __entry->timecode_userbits1 = \ | ||
| 117 | buf->timecode.userbits[1]; \ | ||
| 118 | __entry->timecode_userbits2 = \ | ||
| 119 | buf->timecode.userbits[2]; \ | ||
| 120 | __entry->timecode_userbits3 = \ | ||
| 121 | buf->timecode.userbits[3]; \ | ||
| 122 | __entry->sequence = buf->sequence; \ | ||
| 123 | ), \ | ||
| 124 | \ | ||
| 125 | TP_printk("minor = %d, index = %u, type = %s, " \ | ||
| 126 | "bytesused = %u, flags = %s, " \ | ||
| 127 | "field = %s, timestamp = %llu, timecode = { " \ | ||
| 128 | "type = %s, flags = %s, frames = %u, " \ | ||
| 129 | "seconds = %u, minutes = %u, hours = %u, " \ | ||
| 130 | "userbits = { %u %u %u %u } }, " \ | ||
| 131 | "sequence = %u", __entry->minor, \ | ||
| 132 | __entry->index, show_type(__entry->type), \ | ||
| 133 | __entry->bytesused, \ | ||
| 134 | show_flags(__entry->flags), \ | ||
| 135 | show_field(__entry->field), \ | ||
| 136 | __entry->timestamp, \ | ||
| 137 | show_timecode_type(__entry->timecode_type), \ | ||
| 138 | show_timecode_flags(__entry->timecode_flags), \ | ||
| 139 | __entry->timecode_frames, \ | ||
| 140 | __entry->timecode_seconds, \ | ||
| 141 | __entry->timecode_minutes, \ | ||
| 142 | __entry->timecode_hours, \ | ||
| 143 | __entry->timecode_userbits0, \ | ||
| 144 | __entry->timecode_userbits1, \ | ||
| 145 | __entry->timecode_userbits2, \ | ||
| 146 | __entry->timecode_userbits3, \ | ||
| 147 | __entry->sequence \ | ||
| 148 | ) \ | ||
| 149 | ) | ||
| 150 | |||
| 151 | V4L2_TRACE_EVENT(v4l2_dqbuf); | ||
| 152 | V4L2_TRACE_EVENT(v4l2_qbuf); | ||
| 153 | |||
| 154 | #endif /* if !defined(_TRACE_V4L2_H) || defined(TRACE_HEADER_MULTI_READ) */ | ||
| 155 | |||
| 156 | /* This part must be outside protection */ | ||
| 157 | #include <trace/define_trace.h> | ||
diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h index ed49574ad757..d847c760e8f0 100644 --- a/include/uapi/linux/media.h +++ b/include/uapi/linux/media.h | |||
| @@ -98,6 +98,7 @@ struct media_entity_desc { | |||
| 98 | 98 | ||
| 99 | #define MEDIA_PAD_FL_SINK (1 << 0) | 99 | #define MEDIA_PAD_FL_SINK (1 << 0) |
| 100 | #define MEDIA_PAD_FL_SOURCE (1 << 1) | 100 | #define MEDIA_PAD_FL_SOURCE (1 << 1) |
| 101 | #define MEDIA_PAD_FL_MUST_CONNECT (1 << 2) | ||
| 101 | 102 | ||
| 102 | struct media_pad_desc { | 103 | struct media_pad_desc { |
| 103 | __u32 entity; /* entity ID */ | 104 | __u32 entity; /* entity ID */ |
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index 1666aabbbb86..2cbe605bbe04 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h | |||
| @@ -164,6 +164,10 @@ enum v4l2_colorfx { | |||
| 164 | * this driver */ | 164 | * this driver */ |
| 165 | #define V4L2_CID_USER_TI_VPE_BASE (V4L2_CID_USER_BASE + 0x1050) | 165 | #define V4L2_CID_USER_TI_VPE_BASE (V4L2_CID_USER_BASE + 0x1050) |
| 166 | 166 | ||
| 167 | /* The base for the saa7134 driver controls. | ||
| 168 | * We reserve 16 controls for this driver. */ | ||
| 169 | #define V4L2_CID_USER_SAA7134_BASE (V4L2_CID_USER_BASE + 0x1060) | ||
| 170 | |||
| 167 | /* MPEG-class control IDs */ | 171 | /* MPEG-class control IDs */ |
| 168 | /* The MPEG controls are applicable to all codec controls | 172 | /* The MPEG controls are applicable to all codec controls |
| 169 | * and the 'MPEG' part of the define is historical */ | 173 | * and the 'MPEG' part of the define is historical */ |
| @@ -554,6 +558,11 @@ enum v4l2_vp8_golden_frame_sel { | |||
| 554 | V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_PREV = 0, | 558 | V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_PREV = 0, |
| 555 | V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_REF_PERIOD = 1, | 559 | V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_REF_PERIOD = 1, |
| 556 | }; | 560 | }; |
| 561 | #define V4L2_CID_MPEG_VIDEO_VPX_MIN_QP (V4L2_CID_MPEG_BASE+507) | ||
| 562 | #define V4L2_CID_MPEG_VIDEO_VPX_MAX_QP (V4L2_CID_MPEG_BASE+508) | ||
| 563 | #define V4L2_CID_MPEG_VIDEO_VPX_I_FRAME_QP (V4L2_CID_MPEG_BASE+509) | ||
| 564 | #define V4L2_CID_MPEG_VIDEO_VPX_P_FRAME_QP (V4L2_CID_MPEG_BASE+510) | ||
| 565 | #define V4L2_CID_MPEG_VIDEO_VPX_PROFILE (V4L2_CID_MPEG_BASE+511) | ||
| 557 | 566 | ||
| 558 | /* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */ | 567 | /* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */ |
| 559 | #define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000) | 568 | #define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000) |
diff --git a/include/uapi/linux/v4l2-mediabus.h b/include/uapi/linux/v4l2-mediabus.h index a9601257bb43..b5c3aab6e82c 100644 --- a/include/uapi/linux/v4l2-mediabus.h +++ b/include/uapi/linux/v4l2-mediabus.h | |||
| @@ -110,6 +110,9 @@ enum v4l2_mbus_pixelcode { | |||
| 110 | 110 | ||
| 111 | /* S5C73M3 sensor specific interleaved UYVY and JPEG */ | 111 | /* S5C73M3 sensor specific interleaved UYVY and JPEG */ |
| 112 | V4L2_MBUS_FMT_S5C_UYVY_JPEG_1X8 = 0x5001, | 112 | V4L2_MBUS_FMT_S5C_UYVY_JPEG_1X8 = 0x5001, |
| 113 | |||
| 114 | /* HSV - next is 0x6002 */ | ||
| 115 | V4L2_MBUS_FMT_AHSV8888_1X32 = 0x6001, | ||
| 113 | }; | 116 | }; |
| 114 | 117 | ||
| 115 | /** | 118 | /** |
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 437f1b0f8937..6ae7bbe988cc 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h | |||
| @@ -207,8 +207,8 @@ enum v4l2_priority { | |||
| 207 | struct v4l2_rect { | 207 | struct v4l2_rect { |
| 208 | __s32 left; | 208 | __s32 left; |
| 209 | __s32 top; | 209 | __s32 top; |
| 210 | __s32 width; | 210 | __u32 width; |
| 211 | __s32 height; | 211 | __u32 height; |
| 212 | }; | 212 | }; |
| 213 | 213 | ||
| 214 | struct v4l2_fract { | 214 | struct v4l2_fract { |
diff --git a/include/uapi/linux/vsp1.h b/include/uapi/linux/vsp1.h new file mode 100644 index 000000000000..e18858f6e865 --- /dev/null +++ b/include/uapi/linux/vsp1.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* | ||
| 2 | * vsp1.h | ||
| 3 | * | ||
| 4 | * Renesas R-Car VSP1 - User-space API | ||
| 5 | * | ||
| 6 | * Copyright (C) 2013 Renesas Corporation | ||
| 7 | * | ||
| 8 | * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com> | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License version 2 as | ||
| 12 | * published by the Free Software Foundation. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __VSP1_USER_H__ | ||
| 16 | #define __VSP1_USER_H__ | ||
| 17 | |||
| 18 | #include <linux/types.h> | ||
| 19 | #include <linux/videodev2.h> | ||
| 20 | |||
| 21 | /* | ||
| 22 | * Private IOCTLs | ||
| 23 | * | ||
| 24 | * VIDIOC_VSP1_LUT_CONFIG - Configure the lookup table | ||
| 25 | */ | ||
| 26 | |||
| 27 | #define VIDIOC_VSP1_LUT_CONFIG \ | ||
| 28 | _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct vsp1_lut_config) | ||
| 29 | |||
| 30 | struct vsp1_lut_config { | ||
| 31 | u32 lut[256]; | ||
| 32 | }; | ||
| 33 | |||
| 34 | #endif /* __VSP1_USER_H__ */ | ||
