1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Broadcom BM2835 V4L2 driver
4  *
5  * Copyright © 2013 Raspberry Pi (Trading) Ltd.
6  *
7  * Authors: Vincent Sanders <vincent.sanders@collabora.co.uk>
8  *          Dave Stevenson <dsteve@broadcom.com>
9  *          Simon Mellor <simellor@broadcom.com>
10  *          Luke Diamand <luked@broadcom.com>
11  */
12 
13 /* MMAL_PORT_TYPE_T */
14 enum mmal_port_type {
15 	MMAL_PORT_TYPE_UNKNOWN = 0,  /**< Unknown port type */
16 	MMAL_PORT_TYPE_CONTROL,      /**< Control port */
17 	MMAL_PORT_TYPE_INPUT,        /**< Input port */
18 	MMAL_PORT_TYPE_OUTPUT,       /**< Output port */
19 	MMAL_PORT_TYPE_CLOCK,        /**< Clock port */
20 };
21 
22 /** The port is pass-through and doesn't need buffer headers allocated */
23 #define MMAL_PORT_CAPABILITY_PASSTHROUGH                       0x01
24 /** The port wants to allocate the buffer payloads.
25  * This signals a preference that payload allocation should be done
26  * on this port for efficiency reasons.
27  */
28 #define MMAL_PORT_CAPABILITY_ALLOCATION                        0x02
29 /** The port supports format change events.
30  * This applies to input ports and is used to let the client know
31  * whether the port supports being reconfigured via a format
32  * change event (i.e. without having to disable the port).
33  */
34 #define MMAL_PORT_CAPABILITY_SUPPORTS_EVENT_FORMAT_CHANGE      0x04
35 
36 /* mmal port structure (MMAL_PORT_T)
37  *
38  * most elements are informational only, the pointer values for
39  * interogation messages are generally provided as additional
40  * structures within the message. When used to set values only the
41  * buffer_num, buffer_size and userdata parameters are writable.
42  */
43 struct mmal_port {
44 	u32 priv; /* Private member used by the framework */
45 	u32 name; /* Port name. Used for debugging purposes (RO) */
46 
47 	u32 type;      /* Type of the port (RO) enum mmal_port_type */
48 	u16 index;     /* Index of the port in its type list (RO) */
49 	u16 index_all; /* Index of the port in the list of all ports (RO) */
50 
51 	u32 is_enabled; /* Indicates whether the port is enabled or not (RO) */
52 	u32 format; /* Format of the elementary stream */
53 
54 	u32 buffer_num_min; /* Minimum number of buffers the port
55 			     *   requires (RO).  This is set by the
56 			     *   component.
57 			     */
58 
59 	u32 buffer_size_min; /* Minimum size of buffers the port
60 			      * requires (RO).  This is set by the
61 			      * component.
62 			      */
63 
64 	u32 buffer_alignment_min; /* Minimum alignment requirement for
65 				   * the buffers (RO).  A value of
66 				   * zero means no special alignment
67 				   * requirements.  This is set by the
68 				   * component.
69 				   */
70 
71 	u32 buffer_num_recommended;  /* Number of buffers the port
72 				      * recommends for optimal
73 				      * performance (RO).  A value of
74 				      * zero means no special
75 				      * recommendation.  This is set
76 				      * by the component.
77 				      */
78 
79 	u32 buffer_size_recommended; /* Size of buffers the port
80 				      * recommends for optimal
81 				      * performance (RO).  A value of
82 				      * zero means no special
83 				      * recommendation.  This is set
84 				      * by the component.
85 				      */
86 
87 	u32 buffer_num; /* Actual number of buffers the port will use.
88 			 * This is set by the client.
89 			 */
90 
91 	u32 buffer_size; /* Actual maximum size of the buffers that
92 			  * will be sent to the port. This is set by
93 			  * the client.
94 			  */
95 
96 	u32 component; /* Component this port belongs to (Read Only) */
97 
98 	u32 userdata; /* Field reserved for use by the client */
99 
100 	u32 capabilities; /* Flags describing the capabilities of a
101 			   * port (RO).  Bitwise combination of \ref
102 			   * portcapabilities "Port capabilities"
103 			   * values.
104 			   */
105 
106 };
107