From patchwork Mon Jul 31 08:29:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jai Luthra X-Patchwork-Id: 13334025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 870D3C04A94 for ; Mon, 31 Jul 2023 08:31:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uWVC1HAVb4TUqZu0OH4zYMKsRb12wLs+RVM6gTERQJs=; b=aZZBubDnm7XYTk toVCiPay9pkFoGSUcC/DeyZo4VzIlnJKPL2Xr06y+f9L64OScNGY0J3Db277qHzQIyeJVOTFj0omr AWUQwcnECZEHJf9D8OWDSP6/QhNy0rgTRUw8lpooci3mUW5Y7vdI7fz5JoSQdPwn+5p1feMFqurCF 9zPn76ZW7mn+2Ka/wtMZysHD0p6kZcjwVaT/6lv1D5vw9ANQPm56EvK/diAJAO5ZrWZIEMtMrrjxa cj2MVAJLHtUj2SVzeob2kMYhE24UI7uofpnADGHNqAjK0v5+jjjvykjYHgpPDtLVt9Po6pj2mfEEO E8cBOK5m3n6xxJ3uNTFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQOIP-00EXVA-3C; Mon, 31 Jul 2023 08:30:29 +0000 Received: from fllv0015.ext.ti.com ([198.47.19.141]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQOHq-00EXC9-1R for linux-arm-kernel@lists.infradead.org; Mon, 31 Jul 2023 08:29:55 +0000 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 36V8Tnaf054973; Mon, 31 Jul 2023 03:29:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1690792189; bh=30ahlwMEWy8UHgZ6OwU/9F3tt2IrND9+tluitn/vXsc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=vtTEqU6g2L0YeVAk6xhzsP2zyAG1xfK1Wpq3bK/YvAsBVv9GpWm2fEmuRskzJSjEa /m1iQVjbDwj5utzkDQUp/p29cjq3FSxLeiKOfwaZpVZ/TeDfEzjV7177Ps8xxH+Qx4 2ZjWUntT3gYW9xJ2Nu+6Ua4l6EFYAM+tfBhaCV60= Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 36V8TnSw016455 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 31 Jul 2023 03:29:49 -0500 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 31 Jul 2023 03:29:48 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 31 Jul 2023 03:29:48 -0500 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 36V8Tm5R041977; Mon, 31 Jul 2023 03:29:48 -0500 From: Jai Luthra To: Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sakari Ailus , Laurent Pinchart , Tomi Valkeinen CC: , , , , Mauro Carvalho Chehab , Maxime Ripard , , Benoit Parrot , Vaishnav Achath , Vignesh Raghavendra , , , Subject: [PATCH v8 11/16] media: cadence: csi2rx: Fix stream data configuration Date: Mon, 31 Jul 2023 13:59:29 +0530 Message-ID: <20230731-upstream_csi-v8-11-fb7d3661c2c9@ti.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230731-upstream_csi-v8-0-fb7d3661c2c9@ti.com> References: <20230731-upstream_csi-v8-0-fb7d3661c2c9@ti.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2031; i=j-luthra@ti.com; h=from:subject:message-id; bh=wyZ18n/oOpfvaAzrGd/kqAY+gSdA+SWheBFupQKZTHo=; b=owEBbQKS/ZANAwAIAUPekfkkmnFFAcsmYgBkx2xsMI/ZvY7g5YmfZvpkpM/XlvmTsu7Ptd3Jt f2YSlXy/gqJAjMEAAEIAB0WIQRN4NgY5dV16NRar8VD3pH5JJpxRQUCZMdsbAAKCRBD3pH5JJpx RWw6D/sG/kFdmASxlUukMFkSHPWFJRKW4YrrCcqvSp6l0Be/WmCopnhf2H4h6JB3czslnZnlROU ZuWhiBqQKJ8/P4oa6Jm5ZYff9RHk6RTsHMtIEqVS3BfoZWXYrq4TIs4IjKTKZ8imiIk8+q6RUjs Nf6WUNkFPv89cWreU/0KfnYeUnX95nmxhQRgTreXD6DLf5O+o8vD3z/ATHKhyfu77sHl66VIENA NnJOWQHTy+UElFFHG7cwmxBU7BmqRHCSvIw4o5hpe7KcE+g9DNH6q1yBdT4QQGNSH78FvqAQfq4 H7cvONrREv4YXkFs+oY3vOUCd46VadJem5H2pO8YTrofS8/jaVBmz1TT5hdlVAReuXwmyWwVZi7 kwvoQKSa65wVRfHG9UiyYCFnl4crNeDQIpsVJt7yIpyqdmzgSOFMz896A2pIXRP7JdfNjKkkhe1 tcHc2HNwgpUivzzWNvhRnH/QWAM5AAmOH4Uw6/FEjfbVfusP7W8U+Z3CPJrgKoKTcGPqucKGYgM Sk/NNqKMhOW/yNCWyO/c2IZ2COr2mX/6PQGRcw99fcqdpt213OU4dEp4fx3+XGGPqg6X6sZcKdH RDuJllZg+C3xwRTrL3E7ib/CFR6n1tzrAY4j6gX+Um0O62C5OB9AepJ7n6jM/w5OD1lcf+Rkt7I VGeqSln9XYpT7nQ== X-Developer-Key: i=j-luthra@ti.com; a=openpgp; fpr=4DE0D818E5D575E8D45AAFC543DE91F9249A7145 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230731_012954_580170_1C5469C5 X-CRM114-Status: GOOD ( 14.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Pratyush Yadav 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 Signed-off-by: Jai Luthra Reviewed-by: Laurent Pinchart Reviewed-by: Tomi Valkeinen --- v7->v8: No change 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 a17ef88dff82..cde7fd6463e1 100644 --- a/drivers/media/platform/cadence/cdns-csi2rx.c +++ b/drivers/media/platform/cadence/cdns-csi2rx.c @@ -49,7 +49,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) @@ -275,8 +274,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,