aboutsummaryrefslogtreecommitdiffstats
path: root/include/media/v4l2-subdev.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/media/v4l2-subdev.h')
-rw-r--r--include/media/v4l2-subdev.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 2ecd7377153b..b137a5e1151a 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -21,6 +21,7 @@
21#ifndef _V4L2_SUBDEV_H 21#ifndef _V4L2_SUBDEV_H
22#define _V4L2_SUBDEV_H 22#define _V4L2_SUBDEV_H
23 23
24#include <linux/types.h>
24#include <linux/v4l2-subdev.h> 25#include <linux/v4l2-subdev.h>
25#include <media/media-entity.h> 26#include <media/media-entity.h>
26#include <media/v4l2-common.h> 27#include <media/v4l2-common.h>
@@ -45,6 +46,7 @@ struct v4l2_fh;
45struct v4l2_subdev; 46struct v4l2_subdev;
46struct v4l2_subdev_fh; 47struct v4l2_subdev_fh;
47struct tuner_setup; 48struct tuner_setup;
49struct v4l2_mbus_frame_desc;
48 50
49/* decode_vbi_line */ 51/* decode_vbi_line */
50struct v4l2_decode_vbi_line { 52struct v4l2_decode_vbi_line {
@@ -226,6 +228,36 @@ struct v4l2_subdev_audio_ops {
226 int (*s_stream)(struct v4l2_subdev *sd, int enable); 228 int (*s_stream)(struct v4l2_subdev *sd, int enable);
227}; 229};
228 230
231/* Indicates the @length field specifies maximum data length. */
232#define V4L2_MBUS_FRAME_DESC_FL_LEN_MAX (1U << 0)
233/* Indicates user defined data format, i.e. non standard frame format. */
234#define V4L2_MBUS_FRAME_DESC_FL_BLOB (1U << 1)
235
236/**
237 * struct v4l2_mbus_frame_desc_entry - media bus frame description structure
238 * @flags: V4L2_MBUS_FRAME_DESC_FL_* flags
239 * @pixelcode: media bus pixel code, valid if FRAME_DESC_FL_BLOB is not set
240 * @length: number of octets per frame, valid for compressed or unspecified
241 * formats
242 */
243struct v4l2_mbus_frame_desc_entry {
244 u16 flags;
245 u32 pixelcode;
246 u32 length;
247};
248
249#define V4L2_FRAME_DESC_ENTRY_MAX 4
250
251/**
252 * struct v4l2_mbus_frame_desc - media bus data frame description
253 * @entry: frame descriptors array
254 * @num_entries: number of entries in @entry array
255 */
256struct v4l2_mbus_frame_desc {
257 struct v4l2_mbus_frame_desc_entry entry[V4L2_FRAME_DESC_ENTRY_MAX];
258 unsigned short num_entries;
259};
260
229/* 261/*
230 s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by 262 s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by
231 video input devices. 263 video input devices.
@@ -274,6 +306,10 @@ struct v4l2_subdev_audio_ops {
274 s_mbus_config: set a certain mediabus configuration. This operation is added 306 s_mbus_config: set a certain mediabus configuration. This operation is added
275 for compatibility with soc-camera drivers and should not be used by new 307 for compatibility with soc-camera drivers and should not be used by new
276 software. 308 software.
309
310 s_rx_buffer: set a host allocated memory buffer for the subdev. The subdev
311 can adjust @size to a lower value and must not write more data to the
312 buffer starting at @data than the original value of @size.
277 */ 313 */
278struct v4l2_subdev_video_ops { 314struct v4l2_subdev_video_ops {
279 int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); 315 int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config);
@@ -327,6 +363,8 @@ struct v4l2_subdev_video_ops {
327 struct v4l2_mbus_config *cfg); 363 struct v4l2_mbus_config *cfg);
328 int (*s_mbus_config)(struct v4l2_subdev *sd, 364 int (*s_mbus_config)(struct v4l2_subdev *sd,
329 const struct v4l2_mbus_config *cfg); 365 const struct v4l2_mbus_config *cfg);
366 int (*s_rx_buffer)(struct v4l2_subdev *sd, void *buf,
367 unsigned int *size);
330}; 368};
331 369
332/* 370/*
@@ -455,6 +493,12 @@ struct v4l2_subdev_ir_ops {
455 struct v4l2_subdev_ir_parameters *params); 493 struct v4l2_subdev_ir_parameters *params);
456}; 494};
457 495
496/**
497 * struct v4l2_subdev_pad_ops - v4l2-subdev pad level operations
498 * @get_frame_desc: get the current low level media bus frame parameters.
499 * @get_frame_desc: set the low level media bus frame parameters, @fd array
500 * may be adjusted by the subdev driver to device capabilities.
501 */
458struct v4l2_subdev_pad_ops { 502struct v4l2_subdev_pad_ops {
459 int (*enum_mbus_code)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, 503 int (*enum_mbus_code)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
460 struct v4l2_subdev_mbus_code_enum *code); 504 struct v4l2_subdev_mbus_code_enum *code);
@@ -483,6 +527,10 @@ struct v4l2_subdev_pad_ops {
483 struct v4l2_subdev_format *source_fmt, 527 struct v4l2_subdev_format *source_fmt,
484 struct v4l2_subdev_format *sink_fmt); 528 struct v4l2_subdev_format *sink_fmt);
485#endif /* CONFIG_MEDIA_CONTROLLER */ 529#endif /* CONFIG_MEDIA_CONTROLLER */
530 int (*get_frame_desc)(struct v4l2_subdev *sd, unsigned int pad,
531 struct v4l2_mbus_frame_desc *fd);
532 int (*set_frame_desc)(struct v4l2_subdev *sd, unsigned int pad,
533 struct v4l2_mbus_frame_desc *fd);
486}; 534};
487 535
488struct v4l2_subdev_ops { 536struct v4l2_subdev_ops {