Commit 5c0701a0 authored by Jacopo Mondi's avatar Jacopo Mondi Committed by Hans Verkuil

media: imx: csis: Store pads format separately

As the formats on the sink and source pad might be different store
them separately.

The pad format is used to configure the image width and height in
mipi_csis_system_enable(). As the csis cannot downscale, using the sink
or the source one isn't relevant.
Signed-off-by: default avatarJacopo Mondi <jacopo@jmondi.org>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent 88c63ac7
...@@ -330,7 +330,7 @@ struct csi_state { ...@@ -330,7 +330,7 @@ struct csi_state {
struct mutex lock; /* Protect csis_fmt, format_mbus and state */ struct mutex lock; /* Protect csis_fmt, format_mbus and state */
const struct csis_pix_format *csis_fmt; const struct csis_pix_format *csis_fmt;
struct v4l2_mbus_framefmt format_mbus; struct v4l2_mbus_framefmt format_mbus[CSIS_PADS_NUM];
u32 state; u32 state;
spinlock_t slock; /* Protect events */ spinlock_t slock; /* Protect events */
...@@ -535,7 +535,7 @@ static void mipi_csis_system_enable(struct csi_state *state, int on) ...@@ -535,7 +535,7 @@ static void mipi_csis_system_enable(struct csi_state *state, int on)
/* Called with the state.lock mutex held */ /* Called with the state.lock mutex held */
static void __mipi_csis_set_format(struct csi_state *state) static void __mipi_csis_set_format(struct csi_state *state)
{ {
struct v4l2_mbus_framefmt *mf = &state->format_mbus; struct v4l2_mbus_framefmt *mf = &state->format_mbus[CSIS_PAD_SINK];
u32 val; u32 val;
/* Color format */ /* Color format */
...@@ -967,7 +967,7 @@ mipi_csis_get_format(struct csi_state *state, ...@@ -967,7 +967,7 @@ mipi_csis_get_format(struct csi_state *state,
if (which == V4L2_SUBDEV_FORMAT_TRY) if (which == V4L2_SUBDEV_FORMAT_TRY)
return v4l2_subdev_get_try_format(&state->sd, sd_state, pad); return v4l2_subdev_get_try_format(&state->sd, sd_state, pad);
return &state->format_mbus; return &state->format_mbus[pad];
} }
static int mipi_csis_init_cfg(struct v4l2_subdev *sd, static int mipi_csis_init_cfg(struct v4l2_subdev *sd,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment