From patchwork Tue Oct 17 10:54:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 734878 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB771CDB483 for ; Tue, 17 Oct 2023 10:54:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343754AbjJQKy2 (ORCPT ); Tue, 17 Oct 2023 06:54:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234846AbjJQKy1 (ORCPT ); Tue, 17 Oct 2023 06:54:27 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A01A8F0 for ; Tue, 17 Oct 2023 03:54:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697540065; x=1729076065; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KwDff5sG1NRZj1g945uvs/MVhFJTv5pO+16/21zU7wo=; b=RKvoAjjRQWq5MU2ASxwOqWoId9w2+NZmpKncb+cEUUJZoSM76kLbRvs8 Z9Lf1SreXb4CbcB2jaqCxAHKDwJxESl0pmHhCwbwKMC9q7nb+1kGiZpwK W5u9bCL5VbElOQXp31ZtPAG9YtKSKuauM+Q2X328KbC0FictQX6ZPx4WR Qczwa3m5uQcRrfQ81CagM/yQlh7Og92z9VnEZzc85xC7elg1MhWZg1OrG k2H7UcYQS7PDPOaIR6R2am332914h4BG0Dw4yUEZpaypqRwMt2OjNBpgQ edjqNSjIQ3nEIf7uD09LsGABO/A0mGe5Y4OL36cLEQkozEPW9yN/ZlCn2 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="449973941" X-IronPort-AV: E=Sophos;i="6.03,231,1694761200"; d="scan'208";a="449973941" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2023 03:54:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="929749715" X-IronPort-AV: E=Sophos;i="6.03,231,1694761200"; d="scan'208";a="929749715" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2023 03:54:23 -0700 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 54FA612072F; Tue, 17 Oct 2023 13:54:20 +0300 (EEST) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: laurent.pinchart@ideasonboard.com, jacopo.mondi@ideasonboard.com, dave.stevenson@raspberrypi.com, kieran.bingham@ideasonboard.com Subject: [PATCH 1/3] media: Documentation: Document how link frequencies can be chosen Date: Tue, 17 Oct 2023 13:54:17 +0300 Message-Id: <20231017105419.557486-2-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231017105419.557486-1-sakari.ailus@linux.intel.com> References: <20231017105419.557486-1-sakari.ailus@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Document how link frequencies can be selected for the link-frequencies property. Signed-off-by: Sakari Ailus --- Documentation/driver-api/media/camera-sensor.rst | 14 ++++++++++++++ .../userspace-api/media/drivers/camera-sensor.rst | 2 ++ 2 files changed, 16 insertions(+) diff --git a/Documentation/driver-api/media/camera-sensor.rst b/Documentation/driver-api/media/camera-sensor.rst index 6456145f96ed..0de5c86cbd1f 100644 --- a/Documentation/driver-api/media/camera-sensor.rst +++ b/Documentation/driver-api/media/camera-sensor.rst @@ -29,6 +29,20 @@ used in the system. Using another frequency may cause harmful effects elsewhere. Therefore only the pre-determined frequencies are configurable by the user. +On choosing link frequencies +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Choosing link frequencies for a board is generally a part of the hardware design +process as one needs to ensure an EMC-safe frequency the sensor supports with +the given external clock frequency exists. On development systems this may be +less than an immediate concern, so more or less anything that sensor and the +rest of the applicable hardware supports can be used. + +If the sensor's PLL tree is not documented and all that is available are +register lists, even knowing the frequency a driver uses may be difficult. This +could still be :ref:`calculated from the number of lanes, sensor's output image +size, blanking values and frame rate `. + ACPI ~~~~ diff --git a/Documentation/userspace-api/media/drivers/camera-sensor.rst b/Documentation/userspace-api/media/drivers/camera-sensor.rst index 919a50e8b9d9..7ffed5c2338c 100644 --- a/Documentation/userspace-api/media/drivers/camera-sensor.rst +++ b/Documentation/userspace-api/media/drivers/camera-sensor.rst @@ -54,6 +54,8 @@ less all modern raw camera sensors. The frame interval is calculated using the following equation:: +.. _media_camera_raw_frame_interval: + frame interval = (analogue crop width + horizontal blanking) * (analogue crop height + vertical blanking) / pixel rate From patchwork Tue Oct 17 10:54:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 736096 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87F08CDB482 for ; Tue, 17 Oct 2023 10:54:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343755AbjJQKy3 (ORCPT ); Tue, 17 Oct 2023 06:54:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343752AbjJQKy2 (ORCPT ); Tue, 17 Oct 2023 06:54:28 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68E4DF7 for ; Tue, 17 Oct 2023 03:54:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697540066; x=1729076066; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KK+/ngxS1QlO1CIYeGaHUFVbor7X7a5HzfPlewRZSPo=; b=gCsAwOvblge+iN8oXeqzKNi2aB8lRhRGujmIx4ILoFA9OaFJWZWSvW6L jN4RfggkYJABRpz48Uar5AK9dk+JIwvBky/jaOf5W1WSXmsRaCmYdgVWx EQ1m0afCOpwH26JaJypy7MMOUdoePL9Fu59FD/0bQrYnWVCl9vO/K6Coz lIi7yJqeLgUqKAWZX256fs0m4BuPLMf7f+DFCrHv+fgoghY8sGW56ouxx b2ggKGmCOWFaTAOjmTG/H3cj9akdQ61jCLI/8gLQ0pER7JBKrPcJSKHaf TnNTUbfrcQf9izEJK8fFyn5aMyUzTDG0bz+Tj2ft4fh3ksAS1mn2e4kxq Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="449973946" X-IronPort-AV: E=Sophos;i="6.03,231,1694761200"; d="scan'208";a="449973946" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2023 03:54:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="929749718" X-IronPort-AV: E=Sophos;i="6.03,231,1694761200"; d="scan'208";a="929749718" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2023 03:54:23 -0700 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 1DCB11207A3; Tue, 17 Oct 2023 13:54:21 +0300 (EEST) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: laurent.pinchart@ideasonboard.com, jacopo.mondi@ideasonboard.com, dave.stevenson@raspberrypi.com, kieran.bingham@ideasonboard.com Subject: [PATCH 2/3] media: Documentation: BT.601 is not a bus Date: Tue, 17 Oct 2023 13:54:18 +0300 Message-Id: <20231017105419.557486-3-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231017105419.557486-1-sakari.ailus@linux.intel.com> References: <20231017105419.557486-1-sakari.ailus@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org BT.601 is not actually a bus specification, leaving parallel bus without a specification to refer to. Fix this. Signed-off-by: Sakari Ailus --- Documentation/driver-api/media/camera-sensor.rst | 4 ++-- Documentation/driver-api/media/tx-rx.rst | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Documentation/driver-api/media/camera-sensor.rst b/Documentation/driver-api/media/camera-sensor.rst index 0de5c86cbd1f..19f2feeecc91 100644 --- a/Documentation/driver-api/media/camera-sensor.rst +++ b/Documentation/driver-api/media/camera-sensor.rst @@ -9,8 +9,8 @@ This document covers the in-kernel APIs only. For the best practices on userspace API implementation in camera sensor drivers, please see :ref:`media_using_camera_sensor_drivers`. -CSI-2 and parallel (BT.601 and BT.656) busses ---------------------------------------------- +CSI-2 and parallel and BT.656 buses +----------------------------------- Please see :ref:`transmitter-receiver`. diff --git a/Documentation/driver-api/media/tx-rx.rst b/Documentation/driver-api/media/tx-rx.rst index e1e9258dd862..7e115e3c4735 100644 --- a/Documentation/driver-api/media/tx-rx.rst +++ b/Documentation/driver-api/media/tx-rx.rst @@ -25,9 +25,8 @@ the host SoC. It is defined by the `MIPI alliance`_. Parallel ^^^^^^^^ -`BT.601`_ and `BT.656`_ are the most common parallel busses. +The parallel bus and its `BT.656`_ variant are the most common parallel busses. -.. _`BT.601`: https://en.wikipedia.org/wiki/Rec._601 .. _`BT.656`: https://en.wikipedia.org/wiki/ITU-R_BT.656 Transmitter drivers From patchwork Tue Oct 17 10:54:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 734877 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C054ECDB483 for ; Tue, 17 Oct 2023 10:54:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343489AbjJQKyg (ORCPT ); Tue, 17 Oct 2023 06:54:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343757AbjJQKy3 (ORCPT ); Tue, 17 Oct 2023 06:54:29 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 845A1F5 for ; Tue, 17 Oct 2023 03:54:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697540067; x=1729076067; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UOEcj39cZGrl7bSsx0TerIC5fl86aTzJT1zhyxdC7A8=; b=ZKKaHQMp/bxLcBtGz15fvBvPhN2OqTPS5nRNCZXvS6IEJJ9wwHMBBlhQ sVr7bMZwKHY5N7ArIFh0jMZa6jIVgsiMkfzwBWqt+QvqQF115f8420VmL 8Nl6U7av1rXaf/1sVP3z9/Z6cx91TViItBox93caMnqIeAadDX+Krx3/D +y62frgqMf8YDtlRNBAUVhfMnl2x98O5k3kb6aQ99VyDtv9SZaDnlBQwg pjuhPzhQv6L64S7vp6Lz/DCKZL7i5rcB2k6GNCsFsASvL6YFmiJWfp/HP fSSBeNMuYbrTt74Y6KqeEnqQM0AQ+e4+SpFzh6SWwwczi0g7eLRwEeYZN Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="449973955" X-IronPort-AV: E=Sophos;i="6.03,231,1694761200"; d="scan'208";a="449973955" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2023 03:54:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="929749728" X-IronPort-AV: E=Sophos;i="6.03,231,1694761200"; d="scan'208";a="929749728" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2023 03:54:25 -0700 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id E55FC1207CA; Tue, 17 Oct 2023 13:54:21 +0300 (EEST) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: laurent.pinchart@ideasonboard.com, jacopo.mondi@ideasonboard.com, dave.stevenson@raspberrypi.com, kieran.bingham@ideasonboard.com Subject: [PATCH 3/3] media: Documentation: LP-11 and LP-111 are states, not modes Date: Tue, 17 Oct 2023 13:54:19 +0300 Message-Id: <20231017105419.557486-4-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231017105419.557486-1-sakari.ailus@linux.intel.com> References: <20231017105419.557486-1-sakari.ailus@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org LP-11 and LP-111 are CSI-2 bus states, not modes. Fix this. Signed-off-by: Sakari Ailus --- Documentation/driver-api/media/tx-rx.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Documentation/driver-api/media/tx-rx.rst b/Documentation/driver-api/media/tx-rx.rst index 7e115e3c4735..bc1b94cffdd9 100644 --- a/Documentation/driver-api/media/tx-rx.rst +++ b/Documentation/driver-api/media/tx-rx.rst @@ -89,13 +89,13 @@ where pixel rate on the camera sensor's pixel array which is indicated by the :ref:`V4L2_CID_PIXEL_RATE ` control. -LP-11 and LP-111 modes -^^^^^^^^^^^^^^^^^^^^^^ +LP-11 and LP-111 states +^^^^^^^^^^^^^^^^^^^^^^^ -As part of transitioning to high speed mode, a CSI-2 transmitter typically +As part of transitioning to high speed state, a CSI-2 transmitter typically briefly sets the bus to LP-11 or LP-111 state, depending on the PHY. This period may be as short as 100 µs, during which the receiver observes this state and -proceeds its own part of high speed mode transition. +proceeds its own part of high speed state transition. Most receivers are capable of autonomously handling this once the software has configured them to do so, but there are receivers which require software @@ -104,7 +104,7 @@ in software, especially when there is no interrupt telling something is happening. One way to address this is to configure the transmitter side explicitly to LP-11 -or LP-111 mode, which requires support from the transmitter hardware. This is +or LP-111 state, which requires support from the transmitter hardware. This is not universally available. Many devices return to this state once streaming is stopped while the state after power-on is LP-00 or LP-000. @@ -115,11 +115,11 @@ transitioning to streaming state, but not yet start streaming. Similarly, the to call ``.post_streamoff()`` for each successful call of ``.pre_streamon()``. In the context of CSI-2, the ``.pre_streamon()`` callback is used to transition -the transmitter to the LP-11 or LP-111 mode. This also requires powering on the +the transmitter to the LP-11 or LP-111 state. This also requires powering on the device, so this should be only done when it is needed. -Receiver drivers that do not need explicit LP-11 or LP-111 mode setup are waived -from calling the two callbacks. +Receiver drivers that do not need explicit LP-11 or LP-111 state setup are +waived from calling the two callbacks. Stopping the transmitter ^^^^^^^^^^^^^^^^^^^^^^^^