aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2012-05-17 13:33:30 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-10-05 20:28:01 -0400
commit291031192426bfc6ad4ab2eb9fa986025a926598 (patch)
treef843ccc0680e304dc143f61134e0f52b403b77ca /include
parenta375e1dfefdb951e0591394ac1796d88a712877f (diff)
[media] V4L: Add [get/set]_frame_desc subdev callbacks
Add subdev callbacks for setting up parameters of the frame on media bus that are not exposed to user space directly. This is just an initial, mostly stub implementation. struct v4l2_mbus_frame_desc is intended to be extended with sub-structures specific to a particular hardware media bus. For now these new callbacks are used only to query or specify maximum size of a compressed or hybrid (container) media bus frame in octets. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/media/v4l2-subdev.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index abf1a0e50333..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.
@@ -461,6 +493,12 @@ struct v4l2_subdev_ir_ops {
461 struct v4l2_subdev_ir_parameters *params); 493 struct v4l2_subdev_ir_parameters *params);
462}; 494};
463 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 */
464struct v4l2_subdev_pad_ops { 502struct v4l2_subdev_pad_ops {
465 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,
466 struct v4l2_subdev_mbus_code_enum *code); 504 struct v4l2_subdev_mbus_code_enum *code);
@@ -489,6 +527,10 @@ struct v4l2_subdev_pad_ops {
489 struct v4l2_subdev_format *source_fmt, 527 struct v4l2_subdev_format *source_fmt,
490 struct v4l2_subdev_format *sink_fmt); 528 struct v4l2_subdev_format *sink_fmt);
491#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);
492}; 534};
493 535
494struct v4l2_subdev_ops { 536struct v4l2_subdev_ops {