From patchwork Fri Nov 24 14:26:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 13467713 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 17474C61DF4 for ; Fri, 24 Nov 2023 14:26:26 +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:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=GwGw5A5atDWHRyDSPNGvORQyXsbCuHKE9Bt4megry6c=; b=jbndhB1sYW6ET8lEjZAJUPDP7Z 6I/sPh/wqoEq2WGRCdKou9lS8xzwvSU+FNWJuVcqc6ciIEQMk0WFiylFt77E9c5GE+UR/E20fN6iS Hga/2HKRO1wMOJujSXTOipsFrd0Y3v8HpJ+TPsf6EAUlgzIiXhOuEQ/RUH3b4dZTd+ePJnIk6oy1q QYIyKLt0lYOyGMTGEApyzqTxmFCY7DaQAKzfL3tdJQZm7pe1iqWPCLi7vs7DxjG7FRbSLd5QE1072 ZXj45+/j7GKiAB5FMCloV+AwjvKzr+wAJG9H7VjkPWhL0dOMOPFvhr3RHdHS8xJ7eWtb+gC16LP1F Ys9QHBVg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r6X8T-007Ozd-0I; Fri, 24 Nov 2023 14:26:25 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r6X8Q-007Oyc-1u for linux-mediatek@lists.infradead.org; Fri, 24 Nov 2023 14:26:24 +0000 Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0A0AE2E7; Fri, 24 Nov 2023 15:25:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1700835948; bh=uISx97yy7PS/5tZo3HMpu2UerRFS+Z6/L0jul6kTsBk=; h=From:To:Cc:Subject:Date:From; b=ZhwKEzfERMGvADlIgXgs18fhPHlAqy7USMMlUCBP6+OntQL3Y0bEd62UFSVVwkSVw Zju3unqJDensIMzJ+nALQZpZDVC6ZXbM1OaATFYp2OVoeX4+ht/jNSZWQDlx7gZEqP QiNDN6QeUaJ1XBKspslIF9i7Lshd6RXvt7WDtMgM= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: Paul Elder , Hans Verkuil , Matthias Brugger , AngeloGioacchino Del Regno , Julien Stephan , Sakari Ailus , linux-mediatek@lists.infradead.org, Rob Herring , Krzysztof Kozlowski , Conor Dooley , devicetree@vger.kernel.org Subject: [PATCH v8 0/3] media: i2c: Add driver for THine THP7312 ISP Date: Fri, 24 Nov 2023 16:26:22 +0200 Message-ID: <20231124142625.25979-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231124_062622_770172_EE1BD203 X-CRM114-Status: GOOD ( 15.21 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Hello, This patch series adds a new driver for the THine THP7312 ISP. It has been tested on an OLogic Pumpkin i350, which has a Mediatek MT8365 SoC, with the THine THSCG101 camera module. Technically the driver itself (and its bindings) have no dependencies, but to run/test this on the Pumpkin i350 with the mainline kernel, a number of patches are needed to support the board and the MT8365 SoC. Some of those patches are on their way to mainline, and some, like the Pumpkin i350 board device tree, will require more work. For convenience and reference, the needed patches are available in [1]. Example overlays for DT integration of the THP7312 are available in that branch, in arch/arm64/boot/dts/mediatek/mt8365-pumpkin-csi0-thp7312-imx258.dtso and arch/arm64/boot/dts/mediatek/mt8365-pumpkin-csi1-thp7312-imx258.dtso. Compared to v7, usage of an uninitialized variable, reported by smatch, has been fixed. The series is based on top of the latest media tree, with all the V4L2 dependencies finally merged for v6.8. The driver still depends on the "[RESEND PATCH v4 1/1] device property: Add fwnode_name_eq()" path previously submitted to the linux-media mailing list ([2]), which I will include in the pull request. If anyone wants to check it out, the tag I will use for the pull request is available from [3]. [1] https://git.kernel.org/pub/scm/linux/kernel/git/pinchartl/linux.git/log/?h=mtk/v6.7/pumpkin/camera [2] https://lore.kernel.org/linux-media/20231106073141.1250344-1-sakari.ailus@linux.intel.com [3] https://git.kernel.org/pub/scm/linux/kernel/git/pinchartl/linux.git/log/?h=media-thp7312-next-20231124 Below is the mandatory v4l2-compliance report. v4l2-compliance 1.25.0-5097, 64 bits, 64-bit time_t v4l2-compliance SHA: b79e00a74fde 2023-09-13 07:19:23 Compliance test for device /dev/v4l-subdev2: Driver Info: Driver version : 6.7.0 Capabilities : 0x00000000 Required ioctls: test VIDIOC_SUDBEV_QUERYCAP: OK test invalid ioctls: OK Allow for multiple opens: test second /dev/v4l-subdev2 open: OK test VIDIOC_SUBDEV_QUERYCAP: OK test for unlimited opens: OK Debug ioctls: [ 994.389651] thp7312 2-0061: ================= START STATUS ================= [ 994.390610] thp7312 2-0061: Focus, Automatic Continuous: true [ 994.391614] thp7312 2-0061: Focus, Absolute: 0 [ 994.392240] thp7312 2-0061: Auto-Focus Method: 2 [ 994.392875] thp7312 2-0061: White Balance, Automatic: true [ 994.393616] thp7312 2-0061: Red Balance: 64 [ 994.394193] thp7312 2-0061: Blue Balance: 50 [ 994.394778] thp7312 2-0061: Brightness: 0 [ 994.395328] thp7312 2-0061: Saturation: 10 [ 994.395957] thp7312 2-0061: Contrast: 10 [ 994.396504] thp7312 2-0061: Sharpness: 8 [ 994.397046] thp7312 2-0061: Horizontal Flip: false [ 994.397687] thp7312 2-0061: Vertical Flip: false [ 994.398297] thp7312 2-0061: Auto Exposure, Bias: 0 [ 994.398929] thp7312 2-0061: Power Line Frequency: 50 Hz [ 994.399660] thp7312 2-0061: Link Frequency: 387500000 [ 994.400340] thp7312 2-0061: Camera Orientation: Front [ 994.401009] thp7312 2-0061: Camera Sensor Rotation: 0 [ 994.401673] thp7312 2-0061: Low Light Compensation: false [ 994.402381] thp7312 2-0061: Noise Reduction Auto: true [ 994.403055] thp7312 2-0061: Noise Reduction Level: 0 [ 994.403748] thp7312 2-0061: ================== END STATUS ================== test VIDIOC_LOG_STATUS: OK Input ioctls: test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported) test VIDIOC_ENUMAUDIO: OK (Not Supported) test VIDIOC_G/S/ENUMINPUT: OK (Not Supported) test VIDIOC_G/S_AUDIO: OK (Not Supported) Inputs: 0 Audio Inputs: 0 Tuners: 0 Output ioctls: test VIDIOC_G/S_MODULATOR: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_ENUMAUDOUT: OK (Not Supported) test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported) test VIDIOC_G/S_AUDOUT: OK (Not Supported) Outputs: 0 Audio Outputs: 0 Modulators: 0 Input/Output configuration ioctls: test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported) test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported) test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported) test VIDIOC_G/S_EDID: OK (Not Supported) Control ioctls: test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK test VIDIOC_QUERYCTRL: OK test VIDIOC_G/S_CTRL: OK test VIDIOC_G/S/TRY_EXT_CTRLS: OK test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK test VIDIOC_G/S_JPEGCOMP: OK (Not Supported) Standard Controls: 20 Private Controls: 4 Format ioctls: test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK (Not Supported) test VIDIOC_G/S_PARM: OK (Not Supported) test VIDIOC_G_FBUF: OK (Not Supported) test VIDIOC_G_FMT: OK (Not Supported) test VIDIOC_TRY_FMT: OK (Not Supported) test VIDIOC_S_FMT: OK (Not Supported) test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported) test Cropping: OK (Not Supported) test Composing: OK (Not Supported) test Scaling: OK (Not Supported) Codec ioctls: test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) test VIDIOC_G_ENC_INDEX: OK (Not Supported) test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported) Buffer ioctls: test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK (Not Supported) test VIDIOC_EXPBUF: OK (Not Supported) test Requests: OK (Not Supported) Total for device /dev/v4l-subdev2: 43, Succeeded: 43, Failed: 0, Warnings: 0 Laurent Pinchart (1): media: uapi: Add controls for the THP7312 ISP Paul Elder (2): dt-bindings: media: Add bindings for THine THP7312 ISP media: i2c: Add driver for THine THP7312 .../bindings/media/i2c/thine,thp7312.yaml | 224 ++ .../userspace-api/media/drivers/index.rst | 1 + .../userspace-api/media/drivers/thp7312.rst | 39 + MAINTAINERS | 11 + drivers/media/i2c/Kconfig | 16 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/thp7312.c | 2237 +++++++++++++++++ include/uapi/linux/thp7312.h | 19 + include/uapi/linux/v4l2-controls.h | 6 + 9 files changed, 2554 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/i2c/thine,thp7312.yaml create mode 100644 Documentation/userspace-api/media/drivers/thp7312.rst create mode 100644 drivers/media/i2c/thp7312.c create mode 100644 include/uapi/linux/thp7312.h base-commit: a00b3f296eac3d43328615c3113e1a74143fc67a prerequisite-patch-id: 3dc1549c51cc7ff0257c09d6dc599c8f6e87e1d5