[PATCH 29/74] media: qcom: camss: vfe: Specify number of pads via line->num_pads
From: Bryan O'Donoghue
Date: Mon Oct 05 2026 - 13:27:19 EST
We will need more pads to support the pix path - allow the code to specify
the number of pads via variable instead of via fixed define.
Signed-off-by: Bryan O'Donoghue <bod@xxxxxxxxxx>
---
drivers/media/platform/qcom/camss/camss-vfe.c | 4 +++-
drivers/media/platform/qcom/camss/camss-vfe.h | 8 +++++---
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c
index 35ab3203d75af..3fe0139f82d16 100644
--- a/drivers/media/platform/qcom/camss/camss-vfe.c
+++ b/drivers/media/platform/qcom/camss/camss-vfe.c
@@ -2050,6 +2050,8 @@ int msm_vfe_subdev_init(struct camss *camss, struct vfe_device *vfe,
l->output[0].wm_num = 1;
l->output[0].wm[0].bus_client = l->id;
+ l->num_pads = MSM_VFE_PAD_NUM_RDI;
+
init_completion(&l->output[0].sof);
init_completion(&l->output[0].reg_update);
@@ -2231,7 +2233,7 @@ int msm_vfe_register_entities(struct vfe_device *vfe,
sd->entity.function = MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER;
sd->entity.ops = &vfe_media_ops;
- ret = media_entity_pads_init(&sd->entity, MSM_VFE_PADS_NUM,
+ ret = media_entity_pads_init(&sd->entity, vfe->line[i].num_pads,
pads);
if (ret < 0) {
dev_err(dev, "Failed to init media entity: %d\n", ret);
diff --git a/drivers/media/platform/qcom/camss/camss-vfe.h b/drivers/media/platform/qcom/camss/camss-vfe.h
index 8bc07fe7798e1..8fee26a0dc2e6 100644
--- a/drivers/media/platform/qcom/camss/camss-vfe.h
+++ b/drivers/media/platform/qcom/camss/camss-vfe.h
@@ -21,7 +21,8 @@
#define MSM_VFE_PAD_SINK 0
#define MSM_VFE_PAD_SRC 1
-#define MSM_VFE_PADS_NUM 2
+#define MSM_VFE_PAD_NUM_RDI 2
+#define MSM_VFE_MAX_PADS MSM_VFE_PAD_NUM_RDI
#define MSM_VFE_NUM_OUTPUTS 1
#define MSM_VFE_IMAGE_MASTERS_NUM 7
@@ -141,8 +142,9 @@ struct vfe_line {
enum vfe_line_id id;
bool is_pix;
struct v4l2_subdev subdev;
- struct media_pad pads[MSM_VFE_PADS_NUM];
- struct v4l2_mbus_framefmt fmt[MSM_VFE_PADS_NUM];
+ struct media_pad pads[MSM_VFE_MAX_PADS];
+ struct v4l2_mbus_framefmt fmt[MSM_VFE_MAX_PADS];
+ u32 num_pads;
struct v4l2_rect compose;
struct v4l2_rect crop;
struct vfe_output output[MSM_VFE_NUM_OUTPUTS];
--
2.55.0