From patchwork Wed Jul 25 16:38:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todor Tomov X-Patchwork-Id: 142894 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1031060ljj; Wed, 25 Jul 2018 09:41:49 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfGfwpkNaZFrbaJyf3sM6/VDrYbaDBVvq7D/wuzqobgGSRIoDS2A7BmeL6B5kE3nZZvlq12 X-Received: by 2002:a62:9849:: with SMTP id q70-v6mr22814673pfd.178.1532536909366; Wed, 25 Jul 2018 09:41:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532536909; cv=none; d=google.com; s=arc-20160816; b=W1sy1bXc9HA97Qxo6QBPozBYzqDZhxx9BbGpuzFZ8NCMtlggkHf1ad5KogpVTPK/kQ EtyTPb0sBrFC7Iql49vuadz5uwGdXEwOcJpGiT+y8ZAO5tsnS4ErxOiJdYm2URVMAl3J oOumgVw7Vac2s1rUNSANNA1/yB6Y1pPCeRc3LUILSSNqzkpU9M0FaomsvAtIgEAYZ333 OYuXj6R7anIXRhL9Hha5lOTEx1XhD/EDYge2tfpGqcv3f9MZhe2uD+89EWvLsy3ZQSlD O41PH0G0oR3WeYzMP7ORNh8CPGlR9GnV+QDevhacGoi5XNuctlw6Pss1LY4pDIzVsUcE WYmw== 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=tsz/DDKtpPNupW4P0uXLuAwvA6gnvUhbGQ2oYOCb3nU2D1URj447bPQX3x3c9xaW35 DM0/pNS7wMVdJkKZeWfwMYgSVWQ19Gkbgkgh3gNKmFVWy4OZldhImm4KT59t0VfuwFjU anTVzbUvP7Bg6Td8/rZdbQ6B/AZ02v3ZHnekXnAapBAz9ZU+PPf9g27ApI8z0EiQojLG Z6eRI0c5g5gnce1D8qlQDBMAT4jGI1UkTNBK5+FfC0MsCtnnwn5nAJFrng2YccmARygb 2KQ0KKdYoE1w6uTVsVmsL57PQwzbXWSLKnp6GQe8Dy3p2Tb1Nr2Ue7yN2O7dO0xPjUta Xchg== 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 g9-v6si13826574pgu.294.2018.07.25.09.41.49; Wed, 25 Jul 2018 09:41:49 -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 S1730147AbeGYRv0 (ORCPT + 31 others); Wed, 25 Jul 2018 13:51:26 -0400 Received: from ns.mm-sol.com ([37.157.136.199]:35603 "EHLO extserv.mm-sol.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729501AbeGYRv0 (ORCPT ); Wed, 25 Jul 2018 13:51:26 -0400 Received: from mms-0439.qualcomm.mm-sol.com (unknown [37.157.136.206]) by extserv.mm-sol.com (Postfix) with ESMTPSA id 0F67CCD5D; Wed, 25 Jul 2018 19:38:54 +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 v4 11/34] media: camss: csid: Configure data type and decode format properly Date: Wed, 25 Jul 2018 19:38:20 +0300 Message-Id: <1532536723-19062-12-git-send-email-todor.tomov@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1532536723-19062-1-git-send-email-todor.tomov@linaro.org> References: <1532536723-19062-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);