aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/vsp1/vsp1_lif.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/platform/vsp1/vsp1_lif.c')
-rw-r--r--drivers/media/platform/vsp1/vsp1_lif.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/media/platform/vsp1/vsp1_lif.c b/drivers/media/platform/vsp1/vsp1_lif.c
index 0217393f22df..a720063f38c5 100644
--- a/drivers/media/platform/vsp1/vsp1_lif.c
+++ b/drivers/media/platform/vsp1/vsp1_lif.c
@@ -104,7 +104,7 @@ static int lif_set_format(struct v4l2_subdev *subdev,
104 return 0; 104 return 0;
105} 105}
106 106
107static struct v4l2_subdev_pad_ops lif_pad_ops = { 107static const struct v4l2_subdev_pad_ops lif_pad_ops = {
108 .init_cfg = vsp1_entity_init_cfg, 108 .init_cfg = vsp1_entity_init_cfg,
109 .enum_mbus_code = lif_enum_mbus_code, 109 .enum_mbus_code = lif_enum_mbus_code,
110 .enum_frame_size = lif_enum_frame_size, 110 .enum_frame_size = lif_enum_frame_size,
@@ -112,7 +112,7 @@ static struct v4l2_subdev_pad_ops lif_pad_ops = {
112 .set_fmt = lif_set_format, 112 .set_fmt = lif_set_format,
113}; 113};
114 114
115static struct v4l2_subdev_ops lif_ops = { 115static const struct v4l2_subdev_ops lif_ops = {
116 .pad = &lif_pad_ops, 116 .pad = &lif_pad_ops,
117}; 117};
118 118
@@ -122,7 +122,7 @@ static struct v4l2_subdev_ops lif_ops = {
122 122
123static void lif_configure(struct vsp1_entity *entity, 123static void lif_configure(struct vsp1_entity *entity,
124 struct vsp1_pipeline *pipe, 124 struct vsp1_pipeline *pipe,
125 struct vsp1_dl_list *dl) 125 struct vsp1_dl_list *dl, bool full)
126{ 126{
127 const struct v4l2_mbus_framefmt *format; 127 const struct v4l2_mbus_framefmt *format;
128 struct vsp1_lif *lif = to_lif(&entity->subdev); 128 struct vsp1_lif *lif = to_lif(&entity->subdev);
@@ -130,6 +130,9 @@ static void lif_configure(struct vsp1_entity *entity,
130 unsigned int obth = 400; 130 unsigned int obth = 400;
131 unsigned int lbth = 200; 131 unsigned int lbth = 200;
132 132
133 if (!full)
134 return;
135
133 format = vsp1_entity_get_pad_format(&lif->entity, lif->entity.config, 136 format = vsp1_entity_get_pad_format(&lif->entity, lif->entity.config,
134 LIF_PAD_SOURCE); 137 LIF_PAD_SOURCE);
135 138
@@ -165,7 +168,12 @@ struct vsp1_lif *vsp1_lif_create(struct vsp1_device *vsp1)
165 lif->entity.ops = &lif_entity_ops; 168 lif->entity.ops = &lif_entity_ops;
166 lif->entity.type = VSP1_ENTITY_LIF; 169 lif->entity.type = VSP1_ENTITY_LIF;
167 170
168 ret = vsp1_entity_init(vsp1, &lif->entity, "lif", 2, &lif_ops); 171 /* The LIF is never exposed to userspace, but media entity registration
172 * requires a function to be set. Use PROC_VIDEO_PIXEL_FORMATTER just to
173 * avoid triggering a WARN_ON(), the value won't be seen anywhere.
174 */
175 ret = vsp1_entity_init(vsp1, &lif->entity, "lif", 2, &lif_ops,
176 MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER);
169 if (ret < 0) 177 if (ret < 0)
170 return ERR_PTR(ret); 178 return ERR_PTR(ret);
171 179