提交 c628e788 编写于 作者: T Todor Tomov 提交者: Mauro Carvalho Chehab

media: camss: csid: Configure data type and decode format properly

The CSID decodes the input data stream. When the input comes from
the Test Generator the format of the stream is set on the source
media pad. When the input comes from the CSIPHY the format is the
one on the sink media pad. Use the proper format for each case.
Signed-off-by: NTodor Tomov <todor.tomov@linaro.org>
Signed-off-by: NHans Verkuil <hansverk@cisco.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
上级 7066647c
...@@ -384,9 +384,6 @@ static int csid_set_stream(struct v4l2_subdev *sd, int enable) ...@@ -384,9 +384,6 @@ static int csid_set_stream(struct v4l2_subdev *sd, int enable)
!media_entity_remote_pad(&csid->pads[MSM_CSID_PAD_SINK])) !media_entity_remote_pad(&csid->pads[MSM_CSID_PAD_SINK]))
return -ENOLINK; return -ENOLINK;
dt = csid_get_fmt_entry(csid->fmt[MSM_CSID_PAD_SRC].code)->
data_type;
if (tg->enabled) { if (tg->enabled) {
/* Config Test Generator */ /* Config Test Generator */
struct v4l2_mbus_framefmt *f = struct v4l2_mbus_framefmt *f =
...@@ -408,6 +405,9 @@ static int csid_set_stream(struct v4l2_subdev *sd, int enable) ...@@ -408,6 +405,9 @@ static int csid_set_stream(struct v4l2_subdev *sd, int enable)
writel_relaxed(val, csid->base + writel_relaxed(val, csid->base +
CAMSS_CSID_TG_DT_n_CGG_0(0)); CAMSS_CSID_TG_DT_n_CGG_0(0));
dt = csid_get_fmt_entry(
csid->fmt[MSM_CSID_PAD_SRC].code)->data_type;
/* 5:0 data type */ /* 5:0 data type */
val = dt; val = dt;
writel_relaxed(val, csid->base + writel_relaxed(val, csid->base +
...@@ -417,6 +417,9 @@ static int csid_set_stream(struct v4l2_subdev *sd, int enable) ...@@ -417,6 +417,9 @@ static int csid_set_stream(struct v4l2_subdev *sd, int enable)
val = tg->payload_mode; val = tg->payload_mode;
writel_relaxed(val, csid->base + writel_relaxed(val, csid->base +
CAMSS_CSID_TG_DT_n_CGG_2(0)); CAMSS_CSID_TG_DT_n_CGG_2(0));
df = csid_get_fmt_entry(
csid->fmt[MSM_CSID_PAD_SRC].code)->decode_format;
} else { } else {
struct csid_phy_config *phy = &csid->phy; struct csid_phy_config *phy = &csid->phy;
...@@ -431,13 +434,16 @@ static int csid_set_stream(struct v4l2_subdev *sd, int enable) ...@@ -431,13 +434,16 @@ static int csid_set_stream(struct v4l2_subdev *sd, int enable)
writel_relaxed(val, writel_relaxed(val,
csid->base + CAMSS_CSID_CORE_CTRL_1); csid->base + CAMSS_CSID_CORE_CTRL_1);
dt = csid_get_fmt_entry(
csid->fmt[MSM_CSID_PAD_SINK].code)->data_type;
df = csid_get_fmt_entry(
csid->fmt[MSM_CSID_PAD_SINK].code)->decode_format;
} }
/* Config LUT */ /* Config LUT */
dt_shift = (cid % 4) * 8; dt_shift = (cid % 4) * 8;
df = csid_get_fmt_entry(csid->fmt[MSM_CSID_PAD_SINK].code)->
decode_format;
val = readl_relaxed(csid->base + CAMSS_CSID_CID_LUT_VC_n(vc)); val = readl_relaxed(csid->base + CAMSS_CSID_CID_LUT_VC_n(vc));
val &= ~(0xff << dt_shift); val &= ~(0xff << dt_shift);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册