From patchwork Mon Oct 9 13:09:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jai Luthra X-Patchwork-Id: 13413785 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 5F4A3E95A91 for ; Mon, 9 Oct 2023 14:15:22 +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: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:In-Reply-To:References: List-Owner; bh=ayvd0xSVXShbbsLPp7p/Nc1woYiPBOvvrxIb+EE0BPs=; b=xcnEOYIPrX0q6L U/23X0NRz9DcWDjEeKFVCGTC/ovoTQkVaqfNztlq/rTXQo+6iQiamqa/AnVMoVftW+lEg8OJ8y7Et APQOnXmfsq5AZp73FcdM0HtFOBynui/dMZEBqQ4vgr78MQUF97SgxIL8T/zk/iMHTkocbs2Obv/uf Zmlx2r7O/qLxyVxfRXe6Vk85f6GVwDom7Aznvnyhi0qpy47tQ/B9LEyCgfQt9rh1U50U3X9zWW1W+ RDPwlm7AXpFUZivkzTdHoR0hyjdRlGvIG2HcjYkL+pJWxd5RQvuA2mzZtaSR6z0FGS4lzqpoh6bPQ CB0DhMuBl7vvMN0bJwWQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qpr2V-00Atss-0F; Mon, 09 Oct 2023 14:15:19 +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 1qpq1E-00AlcT-1r for linux-arm-kernel@lists.infradead.org; Mon, 09 Oct 2023 13:10:00 +0000 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 399D9fAO043916; Mon, 9 Oct 2023 08:09:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1696856981; bh=fQWs9VXs/EFMa81HFqVvQ7AcwzMScQmDpt9Y1YYRhMk=; h=From:To:CC:Subject:Date; b=p/mGhrW7POCb77CvH8cZsQhUrKdh7HKGTG3+YKHCnLtZtL/W+t84WHU1wokMd488d XOnI76lBWLXTbSnS78fWKCQjhLXiJJiH7R6jX0KZOjNwMfWrRohz+lpN/4PmF48SfE KNB/5l5OUwg7+4S+4N8C1cnT0rMeVmHBQDZJM8jk= Received: from DLEE111.ent.ti.com (dlee111.ent.ti.com [157.170.170.22]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 399D9ftS071449 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 9 Oct 2023 08:09:41 -0500 Received: from DLEE106.ent.ti.com (157.170.170.36) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 9 Oct 2023 08:09:41 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE106.ent.ti.com (157.170.170.36) 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, 9 Oct 2023 08:09:41 -0500 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 399D9eRs096867; Mon, 9 Oct 2023 08:09:40 -0500 From: Jai Luthra To: Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sakari Ailus , Tomi Valkeinen CC: , , , , Laurent Pinchart , Mauro Carvalho Chehab , Maxime Ripard , , Benoit Parrot , Vaishnav Achath , Vignesh Raghavendra , , , , , Martyn Welch , Julien Massot Subject: [PATCH v10 00/13] CSI2RX support on J721E and AM62 Date: Mon, 9 Oct 2023 18:39:26 +0530 Message-ID: <20231009-upstream_csi-v10-0-330aaed24c5d@ti.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3391; i=j-luthra@ti.com; h=from:subject:message-id; bh=6YGZtFyLIzU9xYOZ/JJLwmb/7XGFfjk+RveyXJjS2nw=; b=owEBbQKS/ZANAwAIAUPekfkkmnFFAcsmYgBlI/skdArrfMKehbiPmcy636DiM4e+idllKz77B sSNd5JRpRaJAjMEAAEIAB0WIQRN4NgY5dV16NRar8VD3pH5JJpxRQUCZSP7JAAKCRBD3pH5JJpx RfPuD/9QLFpHfGxt3gFLdDGUQLLc92KraeVRH+cB8LdHpysbP99Rni3apobEqrlecbl0GkxUlRc VXI2Ssy+nHjaPPepEo1vUkLdgL4qNxIGax7GpezITmf2NCzv0tbpX6h2zlgSDpgWAnKWV96BG8P uC3H6EJTNbr3LstBbMoyGSxwDL241fCjw33vSJ/LaVblt1E8VgLh06BqzntLaOW4TvBda0ufCBw hVxNsjU+G5rjDlBX2T5YvkFDQpg118KF2oSn7BBzX7iBsMsli6+P6mjfxco1ADqxOqmQ8ZkB/Zv 93sHjLOFIqQRZoMZ0gqBAu3inGNqV/FZ3+sD1SHUgQuB0fEhtXrhv+v0QojbQOaFdlvi82Ejtin nFpG7VeV/G0Bp5e8+qtEyEI4AFcFZJ3YYqMUJ44FpILHrSsPP6DiCGozdQKADOaJN678Wct+tkU oU0mrsaKyTEDmh0Nr6z8YObqgZqhMX8+nGt0G9/5Q/nbY+3xA7IrYMSpUxbX1tcyjhKhbSHpTNc rnexX7IJUG1Jf9G2xX6dajXr1H65ftoJi2BFd9fknHbCqogfx6Ex7QjLRn2aT3MIB5D58iHDE9X nx4+VBPVcj2JAHE8XIFwYRVxPFBMpN+YFGIP+3PlbU6n2E503nVBJaYo5A560baW37pIl3BFQbo YwF0bNj3PJblriA== 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-20231009_060956_701163_7DC2A039 X-CRM114-Status: GOOD ( 16.11 ) 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 Hi, This series adds support for CSI2 capture on J721E. It includes some fixes to the Cadence CSI2RX driver, and adds the TI CSI2RX wrapper driver. J721E CSI2RX driver can also be extended to support multi-stream capture, filtering different CSI Virtual Channels (VC) or Data Types (DT) to different DMA channels. A WIP series based on v7 is available for reference at https://github.com/jailuthra/linux/commits/csi_multi_wip I will rebase the multi-stream patches on the current series (v10) and post them after this series is merged. Signed-off-by: Jai Luthra --- Changes in v10: =============== Range-diff: https://gist.github.com/jailuthra/dab73c3949a6271cf3d0fd3d3b111c5b For [05/13] media: cadence: csi2rx: Add get_fmt and set_fmt pad ops - Remove redundant checks in set_fmt() as we ensure pad is SINK For [13/13] media: ti: Add CSI2RX support for J721E - Fix bug around YUV422 pixel ordering in setup_shim(). Now we passthrough the incoming order of pixels over MIPI (U->Y->V->Y etc.) when storing in memory - Only allocate 32KiB of memory for the drain buffer, which is the upper bound of the PSI-L endpoint's internal FIFO storage (2048 x 128-bits) - Allocate drain buffer in probe() instead of start_streaming() - Set other colorspace/encoding properties in the initial device format - Make the module compilable with COMPILE_TEST if Cadence dependencies are missing - Address Laurent's review comments around naming and other minor comments - Address Tomi's comments around better explaining the scenarios where DMA drain is required - Change module/patch authorship to myself - Link to v9: https://lore.kernel.org/r/20230811-upstream_csi-v9-0-8943f7a68a81@ti.com --- Jai Luthra (2): media: dt-bindings: cadence-csi2rx: Add TI compatible string media: ti: Add CSI2RX support for J721E Pratyush Yadav (11): media: dt-bindings: Make sure items in data-lanes are unique media: cadence: csi2rx: Unregister v4l2 async notifier media: cadence: csi2rx: Cleanup media entity properly media: cadence: csi2rx: Add get_fmt and set_fmt pad ops media: cadence: csi2rx: Configure DPHY using link freq media: cadence: csi2rx: Soft reset the streams before starting capture media: cadence: csi2rx: Set the STOP bit when stopping a stream media: cadence: csi2rx: Fix stream data configuration media: cadence: csi2rx: Populate subdev devnode media: cadence: csi2rx: Add link validation media: dt-bindings: Add TI J721E CSI2RX .../devicetree/bindings/media/cdns,csi2rx.yaml | 1 + .../bindings/media/ti,j721e-csi2rx-shim.yaml | 100 ++ .../bindings/media/video-interfaces.yaml | 1 + MAINTAINERS | 7 + drivers/media/platform/cadence/cdns-csi2rx.c | 176 ++- drivers/media/platform/ti/Kconfig | 12 + drivers/media/platform/ti/Makefile | 1 + drivers/media/platform/ti/j721e-csi2rx/Makefile | 2 + .../media/platform/ti/j721e-csi2rx/j721e-csi2rx.c | 1159 ++++++++++++++++++++ 9 files changed, 1452 insertions(+), 7 deletions(-) --- base-commit: 2a860505b617cf8fda4ebff6cf05d3f774145440 change-id: 20230727-upstream_csi-acbeabe038d8 Best regards,