From patchwork Mon Jul 23 11:02:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todor Tomov X-Patchwork-Id: 142588 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp5911690ljj; Mon, 23 Jul 2018 04:06:16 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcx60qvtugbhFsZj2svzy4c3qFWQhTxRr2zgWzR9skTap162pLQ01wMN1s0fEe/eq4bam9J X-Received: by 2002:aa7:87d0:: with SMTP id i16-v6mr12768264pfo.82.1532343976108; Mon, 23 Jul 2018 04:06:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532343976; cv=none; d=google.com; s=arc-20160816; b=POnqAVpC8+YfglCWqSJPVg/y+S0qaHqs/T2GnCN72eji7WFjC9g2Sqjb0NEeEbHLxT bnEMx1ttRnYZScF2smqLrI6X19K1SG1vG1a22d+A/5SW/4cgX91GCrfHMbeKrF0D62Tz X8YtXsZe6NMotkmlOQCsYxaNWrWjC3WdSyrUWX9jvC7G7xfajakYytenuNBEZAz/50NK 3P0pP90irwKvdXBBrVPo7fEmMvDOijmpdkk6fYEnVWVMiyeI1qKn9c5cCUb5cXckwrzM NP4P3ZFK2mtc8TSs68Z7IPPxhugtkB15EKqZO4C+8mJLcFz60Xsc9C6mJpv4B1g6terN JpPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=DoLPufLwqwBO0cw1gsKeNxydF0zs3GSN/BreSakVo7g=; b=Bv+VEtBVvCVkdwpGXA+S/MURn44Nrls5LegacNH/Z0L354v2MKgEBaQsIYdGl5GGF4 jrW4zJNVie8Vp5GhZjphyFqTG+athUhBehPCgjB/y68DXNuGOU22t6oABVI2diIs+3EE CY8OAEU3M6L1/5sP4ccXoXVNc7bCvHTX5BL6hDjSnwT1dxkqS2nmMK/5sV0Q8ZzR1tCA T3jd1nKx1jWzksBd7+J15YSefLI+VNOy3KaTvxYHJLs9oW0Boj9wZb0WguI/jQivvTK1 9PeTPXKMk8zs4DgWWfoOLUlWAJqog5GbrCD94Yg+gIqXC5o2CJjTXAO6QyH8gTVErwev bseA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q7-v6si1091863pll.142.2018.07.23.04.06.15; Mon, 23 Jul 2018 04:06:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388227AbeGWMEr (ORCPT + 31 others); Mon, 23 Jul 2018 08:04:47 -0400 Received: from ns.mm-sol.com ([37.157.136.199]:39958 "EHLO extserv.mm-sol.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388102AbeGWMEq (ORCPT ); Mon, 23 Jul 2018 08:04:46 -0400 Received: from mms-0439.qualcomm.mm-sol.com (unknown [37.157.136.206]) by extserv.mm-sol.com (Postfix) with ESMTPSA id 790D1CD5A; Mon, 23 Jul 2018 14:04:02 +0300 (EEST) From: Todor Tomov To: mchehab@kernel.org, sakari.ailus@linux.intel.com, hans.verkuil@cisco.com, laurent.pinchart+renesas@ideasonboard.com, linux-media@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Todor Tomov Subject: [PATCH v3 11/35] media: camss: csid: Configure data type and decode format properly Date: Mon, 23 Jul 2018 14:02:28 +0300 Message-Id: <1532343772-27382-12-git-send-email-todor.tomov@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1532343772-27382-1-git-send-email-todor.tomov@linaro.org> References: <1532343772-27382-1-git-send-email-todor.tomov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/media/platform/qcom/camss/camss-csid.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) -- 2.7.4 diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media/platform/qcom/camss/camss-csid.c index c0fef17..3cde07e 100644 --- a/drivers/media/platform/qcom/camss/camss-csid.c +++ b/drivers/media/platform/qcom/camss/camss-csid.c @@ -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])) 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 = @@ -408,6 +405,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 + @@ -417,6 +417,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; @@ -431,13 +434,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);