Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1400611pxb; Fri, 21 Jan 2022 17:43:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJx5HMbLLcITMTygBPI06xy+yIUtEn/emwnwTHghNlUAdcCkTV6FCsTC5dUrhBauhWkAC4yr X-Received: by 2002:a17:902:b110:b0:14a:197:dfea with SMTP id q16-20020a170902b11000b0014a0197dfeamr6083883plr.142.1642815822547; Fri, 21 Jan 2022 17:43:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642815822; cv=none; d=google.com; s=arc-20160816; b=ZcjZrZF83dM0SvLur+0PnnVwWOk3FerClmA8MfQ8nr5lguw9PtcwM6IxDydkBSrbN8 4Nfy2p3XiYDF9J/5rn1qivBP+hs70kQegslfIvGBHaSdiYraf815NcUJ53LhLjuw1Dpo YwaXOlUzNUplSwUkgYejHgVr8D4C/TD96OyzubPUtI9LaWjOm3v5UlKgBO4xgg0hd+B0 TdNRcIIIAnJMYS1N9E9hq2w5uauGMv8w7r3Gk6wCR+tI7HcuPNHw+4LJGbKoPmOP9BDj zgt+yTHnrNW0AafheT04nj+qiHvKh6bbR/cC80QNJRYr+MekbPoSklrsoe+UyKfPEr9L buug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=geTKBI8WcaqTTS2xGO8mgqJx5isSEGQvCDZZMic/QRg=; b=0ph1CXAvplHQfHObWu6rgVa7osl9xfuqdyuy5+42ywe1njLjutOmNU2CrYXA60oOG2 g3v7TgIo41YIAPHboEVBKve5tg82v3R00e+IuLZjtdIFVCR/k2bm6NREKtJTJt4Q8RpY gw5n4OLFG0TZ05SNjAMgrs2/gD0tsboEFnRmX/q9GYRq2TkYJmvmiXlKTBXn9FZKyGyg Y1kjkerEb9fb2lEOoI6noMPm1OZTH4KZdXUnjuzbnmXXpeK3JTIZgNa0+45qjgEXFhlp GPUL8b58/Mqe4ysqgPm7gm3HNrsOOwYrwf3l8CwN3OuK+9gdcu8xKzH6xeKwgJI1XoTx mXiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=sq4zjGum; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q2si6971517pga.370.2022.01.21.17.43.30; Fri, 21 Jan 2022 17:43:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=sq4zjGum; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381201AbiAUO35 (ORCPT + 99 others); Fri, 21 Jan 2022 09:29:57 -0500 Received: from lelv0142.ext.ti.com ([198.47.23.249]:51340 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381116AbiAUO3k (ORCPT ); Fri, 21 Jan 2022 09:29:40 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 20LETaRT090854; Fri, 21 Jan 2022 08:29:36 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1642775376; bh=geTKBI8WcaqTTS2xGO8mgqJx5isSEGQvCDZZMic/QRg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=sq4zjGumCoKtxJMSsf2jj2nwE3D0WD6omJqEiaSVD8O/SagQGCHw/68Xugx0ABXct fn46LRvJC3ZcE2rCUB5637GD7MAfefaBoegYvTWb2+X2ICiZ1VAWWVaS8LaqDFhBGc SCpbsJ8g2rR8Wunhtqa2/IcM1xS5XZn3sbApPV6s= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 20LETad1065089 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 21 Jan 2022 08:29:36 -0600 Received: from DFLE110.ent.ti.com (10.64.6.31) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Fri, 21 Jan 2022 08:29:35 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Fri, 21 Jan 2022 08:29:35 -0600 Received: from pratyush-4F-325.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 20LET4Hs072129; Fri, 21 Jan 2022 08:29:32 -0600 From: Pratyush Yadav To: Mauro Carvalho Chehab CC: Pratyush Yadav , Laurent Pinchart , Nikhil Devshatwar , Tomi Valkeinen , Benoit Parrot , Maxime Ripard , Rob Herring , Sakari Ailus , =?UTF-8?q?Niklas=20S=C3=B6derlund?= , , , Subject: [PATCH v6 07/14] media: cadence: csi2rx: Fix stream data configuration Date: Fri, 21 Jan 2022 19:58:57 +0530 Message-ID: <20220121142904.4091481-8-p.yadav@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220121142904.4091481-1-p.yadav@ti.com> References: <20220121142904.4091481-1-p.yadav@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Firstly, there is no VC_EN bit present in the STREAM_DATA_CFG register. Bit 31 is part of the VL_SELECT field. Remove it completely. Secondly, it makes little sense to enable ith virtual channel for ith stream. Sure, there might be a use-case that demands it. But there might also be a use case that demands all streams to use the 0th virtual channel. Prefer this case over the former because it is less arbitrary and also makes it very clear what the limitations of the current driver is instead of giving a false impression that multiple virtual channels are supported. Signed-off-by: Pratyush Yadav Reviewed-by: Laurent Pinchart --- (no changes since v1) drivers/media/platform/cadence/cdns-csi2rx.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c index 5cc18fe0f1b9..f072e5111240 100644 --- a/drivers/media/platform/cadence/cdns-csi2rx.c +++ b/drivers/media/platform/cadence/cdns-csi2rx.c @@ -48,7 +48,6 @@ #define CSI2RX_STREAM_STATUS_RDY BIT(31) #define CSI2RX_STREAM_DATA_CFG_REG(n) (CSI2RX_STREAM_BASE(n) + 0x008) -#define CSI2RX_STREAM_DATA_CFG_EN_VC_SELECT BIT(31) #define CSI2RX_STREAM_DATA_CFG_VC_SELECT(n) BIT((n) + 16) #define CSI2RX_STREAM_CFG_REG(n) (CSI2RX_STREAM_BASE(n) + 0x00c) @@ -270,8 +269,11 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx) writel(CSI2RX_STREAM_CFG_FIFO_MODE_LARGE_BUF, csi2rx->base + CSI2RX_STREAM_CFG_REG(i)); - writel(CSI2RX_STREAM_DATA_CFG_EN_VC_SELECT | - CSI2RX_STREAM_DATA_CFG_VC_SELECT(i), + /* + * Enable one virtual channel. When multiple virtual channels + * are supported this will have to be changed. + */ + writel(CSI2RX_STREAM_DATA_CFG_VC_SELECT(0), csi2rx->base + CSI2RX_STREAM_DATA_CFG_REG(i)); writel(CSI2RX_STREAM_CTRL_START, -- 2.34.1