From patchwork Thu Jul 5 13:32:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todor Tomov X-Patchwork-Id: 141173 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1955211ljj; Thu, 5 Jul 2018 06:40:25 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcXY0BjIhZtOSi3kthjzHTG6Sky4RHFA+10vKfD4+29Wp+v/DGz/hWAP2JX1du59+SkxdEv X-Received: by 2002:a17:902:bc85:: with SMTP id bb5-v6mr6243912plb.229.1530798025414; Thu, 05 Jul 2018 06:40:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530798025; cv=none; d=google.com; s=arc-20160816; b=DkQxC7ttcbxo5Bsu/WNN/z3ixXmR2rMMe+0dYjLRIzegPK/cGsM+nebyv8WR31pdBx XCfY6B4ak4nYJXpnAzVhPPwFlRpW2dVKqu7Ra9IXKGOM8ojLNv+jQ2+a0E8ixz/lzRgX az8qee++iGxL0+qVmsYrk9G7FFoDgnJ8YOHgTysZ8jMBzKo5kYGL+yteRX0t31VTr+KR mgUxiVrqkQCjj2M3UgCGnaDbHYVN/xYHDcxuaVUIJx/gU9ryTZpFOOYJbYWCLfxOJCKa OYtGZEjr+6L1v5tUJE80GwJbw08RMM1unuS7CaoPCkxNihABvF7hWOJYNLR9qvvvAmw/ dKaA== 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=zxdCW3j5DnFfuY1MMfoemWolI6DrPL//0KftWoSkWz94ZUpR0LU2UY6LiBc+peZCso Pv1ZMIX5um2jzKkhNYV7i1LrLckawhXLC34XivxPWn5k7H+2c3wOxztqkQ/dfM4rtpwU ZwaIob/weU8utLIdvU7BMwy8R6jDh51vW6mqh+P91Qg9fqej1x2n6YzKmY6Vbt9N2nd1 0WOaa5aA7dbcoJkyB1dF9RlCMrxI0Ote4c/Uqv1tmY79qS7KGnDceksEDBP9tJZcrsyX b1XwmOt0eVIGoZUKIv3JSXNyVIiMp4OD4EjFfMAONS1BRk3aC0rvcfvJP5Dh62H+lw69 zM4g== 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 z13-v6si5600110pgc.409.2018.07.05.06.40.25; Thu, 05 Jul 2018 06:40:25 -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 S1754415AbeGENkW (ORCPT + 31 others); Thu, 5 Jul 2018 09:40:22 -0400 Received: from ns.mm-sol.com ([37.157.136.199]:41314 "EHLO extserv.mm-sol.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753715AbeGENdV (ORCPT ); Thu, 5 Jul 2018 09:33:21 -0400 Received: from mms-0439.qualcomm.mm-sol.com (unknown [37.157.136.206]) by extserv.mm-sol.com (Postfix) with ESMTPSA id 33582CD52; Thu, 5 Jul 2018 16:33:17 +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 v2 10/34] media: camss: csid: Configure data type and decode format properly Date: Thu, 5 Jul 2018 16:32:41 +0300 Message-Id: <1530797585-8555-11-git-send-email-todor.tomov@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530797585-8555-1-git-send-email-todor.tomov@linaro.org> References: <1530797585-8555-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);