30ca593bccc0af62d22466c82520c114682df97e
[openwrt/staging/ldir.git] /
1 From 487203abdef24b7d3cdd110f1b1e699fd22aa02c Mon Sep 17 00:00:00 2001
2 From: Jacopo Mondi <jacopo+renesas@jmondi.org>
3 Date: Tue, 16 Jun 2020 16:12:36 +0200
4 Subject: [PATCH]_mbus_config
5 pad ops
6
7 Upstream https://patchwork.linuxtv.org/patch/64669/
8
9 Introduce two new pad operations to allow retrieving and configuring the
10 media bus parameters on a subdevice pad.
11
12 The newly introduced operations aims to replace the s/g_mbus_config video
13 operations, which have been on their way for deprecation since a long
14 time.
15
16 Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
17 ---
18 include/media/v4l2-subdev.h | 27 +++++++++++++++++++++++++++
19 1 file changed, 27 insertions(+)
20
21 --- a/include/media/v4l2-subdev.h
22 +++ b/include/media/v4l2-subdev.h
23 @@ -674,6 +674,29 @@ struct v4l2_subdev_pad_config {
24 *
25 * @set_frame_desc: set the low level media bus frame parameters, @fd array
26 * may be adjusted by the subdev driver to device capabilities.
27 + *
28 + * @get_mbus_config: get the media bus configuration of a remote sub-device.
29 + * The media bus configuration is usually retrieved from the
30 + * firmware interface at sub-device probe time, immediately
31 + * applied to the hardware and eventually adjusted by the
32 + * driver. Remote sub-devices (usually video receivers) shall
33 + * use this operation to query the transmitting end bus
34 + * configuration in order to adjust their own one accordingly.
35 + * Callers should make sure they get the most up-to-date as
36 + * possible configuration from the remote end, likely calling
37 + * this operation as close as possible to stream on time. The
38 + * operation shall fail if the pad index it has been called on
39 + * is not valid.
40 + *
41 + * @set_mbus_config: set the media bus configuration of a remote sub-device.
42 + * This operations is intended to allow, in combination with
43 + * the get_mbus_config operation, the negotiation of media bus
44 + * configuration parameters between media sub-devices. The
45 + * operation shall not fail if the requested configuration is
46 + * not supported, but the driver shall update the content of
47 + * the %config argument to reflect what has been actually
48 + * applied to the hardware. The operation shall fail if the
49 + * pad index it has been called on is not valid.
50 */
51 struct v4l2_subdev_pad_ops {
52 int (*init_cfg)(struct v4l2_subdev *sd,
53 @@ -714,6 +737,10 @@ struct v4l2_subdev_pad_ops {
54 struct v4l2_mbus_frame_desc *fd);
55 int (*set_frame_desc)(struct v4l2_subdev *sd, unsigned int pad,
56 struct v4l2_mbus_frame_desc *fd);
57 + int (*get_mbus_config)(struct v4l2_subdev *sd, unsigned int pad,
58 + struct v4l2_mbus_config *config);
59 + int (*set_mbus_config)(struct v4l2_subdev *sd, unsigned int pad,
60 + struct v4l2_mbus_config *config);
61 };
62
63 /**