summaryrefslogtreecommitdiff
path: root/drivers/media/platform/ti-vpe
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2021-06-14 13:23:37 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-07-12 14:22:10 +0200
commit2e7e09a902c6e4121a91a2f9d597228474cabe4c (patch)
tree7795ec5ac05ffb544a6cce30119f6b57c6bd3537 /drivers/media/platform/ti-vpe
parent8bfd1af2fdd193017c1bdbae7c3f5aab027e5282 (diff)
media: ti-vpe: cal: remove cal_camerarx->fmtinfo
struct cal_camerarx has fmtinfo field which is used to point to the current active input format. The only place where the field is used is cal_camerarx_get_ext_link_freq(). With multiple streams the whole concept of single input format is not valid anymore, so lets remove the field by looking up the format in cal_camerarx_get_ext_link_freq(), making it easier to handle the multistream-case in the following patches. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/platform/ti-vpe')
-rw-r--r--drivers/media/platform/ti-vpe/cal-camerarx.c12
-rw-r--r--drivers/media/platform/ti-vpe/cal.h1
2 files changed, 8 insertions, 5 deletions
diff --git a/drivers/media/platform/ti-vpe/cal-camerarx.c b/drivers/media/platform/ti-vpe/cal-camerarx.c
index 7940e47964af..82392499e663 100644
--- a/drivers/media/platform/ti-vpe/cal-camerarx.c
+++ b/drivers/media/platform/ti-vpe/cal-camerarx.c
@@ -49,9 +49,16 @@ static s64 cal_camerarx_get_ext_link_freq(struct cal_camerarx *phy)
{
struct v4l2_fwnode_bus_mipi_csi2 *mipi_csi2 = &phy->endpoint.bus.mipi_csi2;
u32 num_lanes = mipi_csi2->num_data_lanes;
- u32 bpp = phy->fmtinfo->bpp;
+ const struct cal_format_info *fmtinfo;
+ u32 bpp;
s64 freq;
+ fmtinfo = cal_format_by_code(phy->formats[CAL_CAMERARX_PAD_SINK].code);
+ if (!fmtinfo)
+ return -EINVAL;
+
+ bpp = fmtinfo->bpp;
+
freq = v4l2_get_link_freq(phy->source->ctrl_handler, bpp, 2 * num_lanes);
if (freq < 0) {
phy_err(phy, "failed to get link freq for subdev '%s'\n",
@@ -728,9 +735,6 @@ static int cal_camerarx_sd_set_fmt(struct v4l2_subdev *sd,
format->which);
*fmt = format->format;
- if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE)
- phy->fmtinfo = fmtinfo;
-
return 0;
}
diff --git a/drivers/media/platform/ti-vpe/cal.h b/drivers/media/platform/ti-vpe/cal.h
index ee42c9c48fa1..7d9a2d697fc4 100644
--- a/drivers/media/platform/ti-vpe/cal.h
+++ b/drivers/media/platform/ti-vpe/cal.h
@@ -163,7 +163,6 @@ struct cal_camerarx {
struct v4l2_subdev subdev;
struct media_pad pads[2];
struct v4l2_mbus_framefmt formats[2];
- const struct cal_format_info *fmtinfo;
};
struct cal_dev {