Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3235826rdh; Mon, 27 Nov 2023 09:10:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IG2en2pbapTked+DaR7f9ll4JIQ1ai1EXs2vZBy+6ljpedceyqShLav7zPDrzFsQ5s9rPe4 X-Received: by 2002:a05:6870:5ba3:b0:1fa:3c4b:edc0 with SMTP id em35-20020a0568705ba300b001fa3c4bedc0mr6715134oab.59.1701105016016; Mon, 27 Nov 2023 09:10:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701105016; cv=none; d=google.com; s=arc-20160816; b=v9mUg5TsXocjHtVH4ClKHTVGI0Iw39VqlOZUMd/mxRVRqUTl1zbB2fBK01/RzoLyoS Ry9a5Zzu4Gcdr+IVklhcT4WPpGSwqe1dF0nkTefzqEKufxKPc0VtzNIbB/D0IidKFS7F OdAuyGVvBoAn+d6DypW/99hSWWLR++kiGiAKV5KvZ07rzTP+qnJbHy7byInr6Tn4d4PG KIzT2UwHoFeARRzyOvJL7Lx3Fa2/S8tMDchG6kz5bBxKmo8itXLDCfMSaqRR7Hn/qEj/ xnprnfe14Q/GsQGS+Yzllv1Uljenxc7JGDKXvlEZHtDZ1bMJoIpDf2TFd2tGsmYga8g1 ZYNA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=scaZiRNa51OlJfNVswXDrj5I08uYQmb4qOjuwQApPR8=; fh=kwRLauNNA7AUU9qwhDiUKIYDbQIWr+6F6n6IDvqw4uY=; b=N6vjdwULIJhq7ffopVRJ8KOIAgTd9u8APp64X3B0ESUUbWL2QREA1Jn2oCTb9qYdhB 6g+a92dPKvtPaUVJ4tkxWRwVq2jpekL0e/6Q4+GVQDHJgxaNnBv8/BhNeJgeBowut/3k HTCQeJya1jbQywSCfsB5zUPFfBZESwUbT+v/I688lSx8paBFzwOdWVsDwWpKV4EUWHl9 LunkqV/xBwCp/kgZSIFoj1wfVmIDJvzzSe++Vd4jfxVSN63sxqiY4oCf96Ej+ygcF9/e AUbShQ/SA140iL9wmlG6nolyhxXH+cHyjCPUYLTqWhLR3EIEjpw2me9Bj3VySj3CY5Ri RWpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=u16ZdZOp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id py8-20020a056871470800b001f95dabef8bsi4103379oab.116.2023.11.27.09.10.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 09:10:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=u16ZdZOp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id DB81B805D573; Mon, 27 Nov 2023 09:10:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234855AbjK0RJ4 (ORCPT + 99 others); Mon, 27 Nov 2023 12:09:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234792AbjK0RJj (ORCPT ); Mon, 27 Nov 2023 12:09:39 -0500 Received: from mx08-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDB3619A2; Mon, 27 Nov 2023 09:09:43 -0800 (PST) Received: from pps.filterd (m0369457.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 3ARDqXKF029391; Mon, 27 Nov 2023 18:09:21 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=selector1; bh=scaZiRN a51OlJfNVswXDrj5I08uYQmb4qOjuwQApPR8=; b=u16ZdZOpX4aVKwEtlsk700+ Y0bfUzgc5SFiUuRqjkCtD2JWAP0vDCN8rFRTFWn6P0icBhQo9cvO5XJkMCwoQiIa rWDR9x39zzWeysM4aBNxoeQmR5PS21ef+GULgAQmJFR6MXvmaiWuf31n/9vWusuv Dvs3hJ2NAyIVABk3Izbi87rBhwZiFYOTl1eQ9Xv5/JUsEuC2bgf4WQs2Q9iMZFqZ TXSNIp90VXaKrOutgvD+Pu8svNDof1CQx8e+8fSISsirKJLvhnKfIcDNzypjIgm+ jIApj+gznSr4gMoptKc6JvAZ1POB9NBSSbWa8zAElwfRiHTyv+qCu5/WsaETHdA= = Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3ukvrp5v8x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Nov 2023 18:09:21 +0100 (CET) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 6154510002A; Mon, 27 Nov 2023 18:08:41 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 5600824B880; Mon, 27 Nov 2023 18:08:41 +0100 (CET) Received: from localhost (10.129.178.213) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 27 Nov 2023 18:08:41 +0100 From: Alain Volmat To: Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maxime Coquelin , Alexandre Torgue , Russell King , Philipp Zabel CC: Sakari Ailus , Laurent Pinchart , Dan Scally , Alain Volmat , , , , , Subject: [PATCH v9 0/5] Add support for DCMIPP camera interface of STMicroelectronics STM32 SoC series Date: Mon, 27 Nov 2023 18:08:14 +0100 Message-ID: <20231127170828.1426117-1-alain.volmat@foss.st.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.129.178.213] X-ClientProxiedBy: SHFCAS1NODE2.st.com (10.75.129.73) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-27_15,2023-11-27_01,2023-05-22_02 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 27 Nov 2023 09:10:13 -0800 (PST) This patchset introduces support for Digital Camera Memory Interface Pixel Processor (DCMIPP) of STMicroelectronics STM32 SoC series. This initial support implements a single capture pipe allowing RGB565, YUV, Y, RAW8 and JPEG capture with frame skipping, prescaling and cropping. DCMIPP is exposed through 3 subdevices: - dcmipp_dump_parallel: parallel interface handling - dcmipp_dump_postproc: frame skipping, prescaling and cropping control - dcmipp_dump_capture: video device capture node v9: - serie rebased on top of master branch of tree sailus/media_tree.git in order to use init_state instead of init_cfg ops - addition of link_validate in subdevs & video capture device (bytecap) - use local variable rtsc within probe for reset_controller v8: - serie rebased on top of master branch of tree sailus/media_tree.git in order to use v4l2_subdev_state_* functions v7: - correct byteproc set_fmt handling and compose/crop/fmt handling - replace few v4l2_subdev_get_try_* into v4l2_subdev_get_pad_* - correct ordering within dcmipp_remove v6: - correct copyright year in all files - correct Kconfig (removal of OF addition of select VIDEO_V4L2_SUBDEV_API/MEDIA_CONTROLLER - add missing mutex_destroy in error handling - rely on fwnode_graph_get_endpoint_by_id instead of fwnode_graph_get_next_endpoint - rely on device_get_match_data instead of of_device_get_match_data - use local variable for pads_flag initialization v5: - removal of dcmipp_frame_size & dcmipp_frame_stride and use v4l2_fill_pixfmt - correct typos & avoid check of available buffer at start_streaming time since this is done by vb2 framework - avoid set of pad format in dcmipp_par_ent_init and dcmipp_byteproc_ent_init since done via init_cfg - reorder bound functions - use v4l2_subdev_get_fmt in parallel and byteproc subdevs - correct struct dcmipp_ent_device comments - removal of dcmipp_hdw_pixel_alignment in bytecap subdev since not applicable in this byte mode pipeline v4: - rework of mutex / spinlock handling - addition of dma mask setting - removal of __maybe_unused, use pm_ptr and new declaration macros - driver now only generate a single stm32-dcmipp.ko module instead of several as before - removal of the component framework usage - various small fixes (function names, lowercase values, indentation, print formats) - register name removal in register access function, only dev_dbg with address & values are kept - removal of VB2_READ and CAP_READWRITE - usage of subdev active state mechanism and removal of locally stored format/compose/crop - addition of port { } within the stm32mp135.dtsi v3: - Have same To & Cc in all patches emails of the serie so that everybody has coherent view of the serie - bindings: correct wording, clock-names & label removal - driver: replace of_graph call with fwnode_graph - driver: use defined bus-type when calling v4l2_fwnode_endpoint_parse - driver: remove clock name - dtsi: remove clock-names property v2: - removal of pclk-max-frequency from yaml example dts - codying-style fixes - correction in enum functions (format, mbus, frame_size ...) handling - drop of v4l2_pipeline_pm_ calls, and specific open/close handler of vdev - video dev s_stream handling updated to call s_stream of remote subdev instead of loop until sensor subdev - code update following media_pipeline & v4l2_async_ api changes since v1 - removal of IP reset call upon error - removal of link_validate handlers - addition of V4L2_CAP_IO_MC device_caps - removal of the frame skip control for the time being, will be added back in another commit once control method will be agreed - change byteproc entity type to MEDIA_ENT_F_PROC_VIDEO_SCALER - various fixes from Dan & Sakari remarks Alain Volmat (2): dt-bindings: media: add bindings for stm32 dcmipp media: MAINTAINERS: add entry for STM32 DCMIPP driver Hugues Fruchet (3): media: stm32-dcmipp: STM32 DCMIPP camera interface driver ARM: dts: stm32: add dcmipp support to stm32mp135 ARM: multi_v7_defconfig: enable STM32 DCMIPP media support .../bindings/media/st,stm32-dcmipp.yaml | 89 ++ MAINTAINERS | 5 +- arch/arm/boot/dts/st/stm32mp135.dtsi | 11 + arch/arm/configs/multi_v7_defconfig | 1 + drivers/media/platform/st/stm32/Kconfig | 16 + drivers/media/platform/st/stm32/Makefile | 1 + .../platform/st/stm32/stm32-dcmipp/Makefile | 4 + .../st/stm32/stm32-dcmipp/dcmipp-bytecap.c | 956 ++++++++++++++++++ .../st/stm32/stm32-dcmipp/dcmipp-byteproc.c | 565 +++++++++++ .../st/stm32/stm32-dcmipp/dcmipp-common.c | 111 ++ .../st/stm32/stm32-dcmipp/dcmipp-common.h | 216 ++++ .../st/stm32/stm32-dcmipp/dcmipp-core.c | 604 +++++++++++ .../st/stm32/stm32-dcmipp/dcmipp-parallel.c | 440 ++++++++ 13 files changed, 3018 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/media/st,stm32-dcmipp.yaml create mode 100644 drivers/media/platform/st/stm32/stm32-dcmipp/Makefile create mode 100644 drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c create mode 100644 drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c create mode 100644 drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-common.c create mode 100644 drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-common.h create mode 100644 drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c create mode 100644 drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-parallel.c -- 2.25.1