From patchwork Mon Jul 29 14:47:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Stephan X-Patchwork-Id: 13745171 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 C4813C3DA61 for ; Mon, 29 Jul 2024 14:59:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To: Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject: 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=7VN27lnGUNsVwhKI93/YGx82K/xOtrW+XHUZkxMgX6Y=; b=VNfRYs+sYzxHAi FfICeyltZvTWPP0O4I15MkP2Nbno2rGfmNWxtDAje1WrCLEHCeiH/BAhIVdENWeWDhBHf5jIIuhWI oW6/x8ovr+4cwU8h+0UUccclv67JUDjCCC0lgaPVCazwbS/CgmiQ9U+27s+oMcYX2Rbcf2k0sEGBC Ine8NKEYUG6clt16EdBZokTgS4aKdw0yq6eDZQcXB0ZaT/B6YZGensj1CyBoqOuogd4wrjfzQf6BX KGdovXCqY1jxsfM7xCtGONnlfERYshtnfaKCR5sr4ay4g94kMN/ZQ6i9Zc2RuPMRjKwaXNdDci4hV OXVfVdRgrojQENKJ4DXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYRqk-0000000BmHl-2l7O; Mon, 29 Jul 2024 14:59:46 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYRfY-0000000Biy4-0FgH for linux-arm-kernel@lists.infradead.org; Mon, 29 Jul 2024 14:48:14 +0000 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-428141be2ddso17488615e9.2 for ; Mon, 29 Jul 2024 07:48:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1722264490; x=1722869290; darn=lists.infradead.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=7VN27lnGUNsVwhKI93/YGx82K/xOtrW+XHUZkxMgX6Y=; b=BZRyCk/N9/MTG9jZ0CkUFyUIUjM0gLt+A91ULsBQP8qVoXXTCZMrlEcaYYaL7UovIy ldDSi8qqrrKsHtd9pt5hQBqQrHuw6lo1Lg8URscFAwMydG0aNqRYs9LYmDqCaaKs/5Ep g8hKPO5gE7jPb/6S5wrNYgnBqezXqoFGMaRJ5qdqkIwEGpGLnFZQGqtmAOGbzb2tlN91 k6ekfHUcyKzhmux+MNuH0GvJ0az1sniGZ3TQrsAhVKkzajmTVYDjghC71egECp3MgN8u beOYyAJMiRzFHFg7/Phg00sxsk6t/ql2O6ENlVZDLu2Vyr6Zhv/vRreIkzVOT63N7cp1 n0tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722264490; x=1722869290; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7VN27lnGUNsVwhKI93/YGx82K/xOtrW+XHUZkxMgX6Y=; b=Ez/aN5OrMx1XJuN6TcIb4sFNt/Bqw+JP+IdB5kZTAiEgiL9WOV8jK0DGbXBVcz8yV2 rI57gfSodAFYg0iXfd5EyFib/NBQwCO3krXZQFhnTY18I5QTF9LgQNKD1foAoKm3NMik BUmzBA2HI6EINDTx3431ZhjNxL13lh4Nb2Ky1Dk4cEa8iKHeHBWMEr6YPn7AnX9lJMSt axWXp0mHoQ+9v/aRo7jYX4ToGFSX5Yz/gbv97vMY9P0x0el/XUuQdYnGYaBCg/4R62Ek ITDu17CTepfjBiQvNcwoXXe/ET5A2CdRS4UWvWZAHv2xY+bWRdX4mMsOxmIqSVlAt5qb dzvA== X-Forwarded-Encrypted: i=1; AJvYcCWd9YpU9z7m5upvuP9+OFv+HHeyxvHiEBzzNqwNfOsRkvrA469K7b/JAr80NAyDvEvlrmAj7Tro/oXhq8ZhGBjC1RLvKUR7sF+ODfqiRW6D0m0XqXE= X-Gm-Message-State: AOJu0YwFs75ss1P6hKwZhdBh7f60/N1zCBFFtADxPes9lvaa9mqbUSLW gcIEQXYAYz1Caxg04+eskGxL1c6JohJRM5aUN6jJgXK8PxSC9ZLjyMvWfJjDMw4AS6YH0Od1TZ6 7a+c= X-Google-Smtp-Source: AGHT+IGRl6/MNLY2ZSmQMwTK/Pc+WFeT2/juGGW0MYOhUlv5eI7dtyXMyHhwMeLTTvCkHpcOzEmo7w== X-Received: by 2002:a05:600c:3511:b0:428:3b5:816b with SMTP id 5b1f17b1804b1-42811d6e2ddmr55999485e9.3.1722264489790; Mon, 29 Jul 2024 07:48:09 -0700 (PDT) Received: from [192.168.42.0] (2a02-842a-d52e-6101-6fd0-06c4-5d68-f0a5.rev.sfr.net. [2a02:842a:d52e:6101:6fd0:6c4:5d68:f0a5]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-428057b645dsm180091705e9.43.2024.07.29.07.48.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jul 2024 07:48:09 -0700 (PDT) From: Julien Stephan Subject: [PATCH v6 0/5] Add Mediatek ISP3.0 Date: Mon, 29 Jul 2024 16:47:59 +0200 Message-Id: <20240729-add-mtk-isp-3-0-support-v6-0-c374c9e0c672@baylibre.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAKCrp2YC/4WNQQ6CMBBFr0Jm7ZhaKKAr72FYtGWQiUKbFomEc HcLF/Dv3k/++ytECkwRbtkKgWaO7MYE5SkD2+vxSchtYpBCFqISBeq2xWF6IUePOQqMH+9dmFC LWl+r2mqbl5DWPlDH38P8aBL3HCcXluNoVnv73zmrBKazexRZebkbvbzZBDpbN0CzbdsPq2hQX 8EAAAA= To: Laurent Pinchart , Andy Hsieh , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Julien Stephan , Louis Kuo , Phi-Bang Nguyen , Florian Sylvestre , Paul Elder X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240729_074812_132551_139FF4C4 X-CRM114-Status: GOOD ( 20.64 ) 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 This series adds the support of the Mediatek ISP3.0 found on some Mediatek SoCs such as the mt8365. The driver is divided into 2 parts: * SENINF: the sensor interface * CAMSV: this driver provides a path to bypass the SoC ISP so that image data coming from the SENINF can go directly into memory without any image processing. This allows the use of an external ISP or camera sensor directly. The SENINF driver is based on previous work done by Louis Kuo available as an RFC here: https://lore.kernel.org/all/20200708104023.3225-1-louis.kuo@mediatek.com/ This series depends on the following series for the phy [1] Changes in v6: - remove unneeded "link" tag from commits bindings: - remove labels from example node - remove complexity for phy and phy-name properties driver: - fix some comments from CK : - remove unneeded variables - rename irqlock to buf_list_lock for clarity - remove unneeded lock/unlock around hw_enable/hw_disable - Link to v5: https://lore.kernel.org/r/20240704-add-mtk-isp-3-0-support-v5-0-bfccccc5ec21@baylibre.com Changes on v5: drivers: - rebase on 6.10-rc1 - fix various comments from all reviews (mostly style issues and minor code refactor) - add a function to calculate the clock divider for the master sensor clock: NOTE: setting this register seems to have no effect at all, currently checking with mediatek apps engineer (OOO until 17/04) bindings: - camsv: update description - seninf: fix phy definition and example indentation - use generic name for node example dts: - sort nodes by addresses - use lower case for hexadecimal Changes in v4: - fix suspend/resume deadlock - fix various locking issues reported by Laurent Pinchart on v3 - run LOCKDEP - add missing include reported by kernel-test-robot for non mediatek arch and COMPILE_TEST=y - use atomic poll inside mtk_camsv30_setup - drop second lane support as it was not used - remove useless members in structs - fix media entity initialization - initialize correct pad for camsv video device - add isp support in mt8365.dtsi - rebase on 6.7 Changes in v3: - fix a lot of formatting issues/coding style issues found in camsv/seninf reported by Angelo on v2 - fix camsv/seninf binding file error reported by Rob Changes in v2: - renamed clock `cam_seninf` to `camsys` - renamed clock `top_mux_seninf` to `top_mux` - moved phy properties from port nodes to top level - remove patternProperties - specify power management dependency in the cover letter description to fix missing include in dt-binding example - change '$ref' properties on some endpoint nodes from '$ref: video-interfaces.yaml#' to '$ref: /schemas/graph.yaml#/$defs/endpoint-base' where applicable Best Julien Stephan Signed-off-by: Julien Stephan --- Julien Stephan (1): arm64: dts: mediatek: mt8365: Add support for camera Louis Kuo (2): dt-bindings: media: add mediatek ISP3.0 sensor interface media: platform: mediatek: isp_30: add mediatek ISP3.0 sensor interface Phi-bang Nguyen (2): dt-bindings: media: add mediatek ISP3.0 camsv media: platform: mediatek: isp_30: add mediatek ISP3.0 camsv .../bindings/media/mediatek,mt8365-camsv.yaml | 109 ++ .../bindings/media/mediatek,mt8365-seninf.yaml | 259 ++++ MAINTAINERS | 10 + arch/arm64/boot/dts/mediatek/mt8365.dtsi | 125 ++ drivers/media/platform/mediatek/Kconfig | 1 + drivers/media/platform/mediatek/Makefile | 1 + drivers/media/platform/mediatek/isp/Kconfig | 2 + drivers/media/platform/mediatek/isp/Makefile | 3 + drivers/media/platform/mediatek/isp/isp_30/Kconfig | 35 + .../media/platform/mediatek/isp/isp_30/Makefile | 4 + .../platform/mediatek/isp/isp_30/camsv/Makefile | 7 + .../platform/mediatek/isp/isp_30/camsv/mtk_camsv.c | 327 ++++ .../platform/mediatek/isp/isp_30/camsv/mtk_camsv.h | 192 +++ .../mediatek/isp/isp_30/camsv/mtk_camsv30_hw.c | 413 +++++ .../mediatek/isp/isp_30/camsv/mtk_camsv30_regs.h | 60 + .../mediatek/isp/isp_30/camsv/mtk_camsv_video.c | 742 +++++++++ .../platform/mediatek/isp/isp_30/seninf/Makefile | 5 + .../mediatek/isp/isp_30/seninf/mtk_seninf.c | 1576 ++++++++++++++++++++ .../mediatek/isp/isp_30/seninf/mtk_seninf_reg.h | 117 ++ 19 files changed, 3988 insertions(+) --- base-commit: 99b9aaac4abdf30968b2ce9c9848951290fbde92 change-id: 20240704-add-mtk-isp-3-0-support-a08a978cac36 Best regards,