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

[ Upstream commit c628e78899ff8006b5f9d8206da54ed3bb994342 ]

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: Todor Tomov <todor.tomov@linaro.org>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Todor Tomov 2018-07-25 12:38:20 -04:00 committed by Greg Kroah-Hartman
parent cb71229f64
commit 3b99098965

View File

@ -392,9 +392,6 @@ static int csid_set_stream(struct v4l2_subdev *sd, int enable)
!media_entity_remote_pad(&csid->pads[MSM_CSID_PAD_SINK]))
return -ENOLINK;
dt = csid_get_fmt_entry(csid->fmt[MSM_CSID_PAD_SRC].code)->
data_type;
if (tg->enabled) {
/* Config Test Generator */
struct v4l2_mbus_framefmt *f =
@ -416,6 +413,9 @@ static int csid_set_stream(struct v4l2_subdev *sd, int enable)
writel_relaxed(val, csid->base +
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 */
val = dt;
writel_relaxed(val, csid->base +
@ -425,6 +425,9 @@ static int csid_set_stream(struct v4l2_subdev *sd, int enable)
val = tg->payload_mode;
writel_relaxed(val, csid->base +
CAMSS_CSID_TG_DT_n_CGG_2(0));
df = csid_get_fmt_entry(
csid->fmt[MSM_CSID_PAD_SRC].code)->decode_format;
} else {
struct csid_phy_config *phy = &csid->phy;
@ -439,13 +442,16 @@ static int csid_set_stream(struct v4l2_subdev *sd, int enable)
writel_relaxed(val,
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 */
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 &= ~(0xff << dt_shift);