Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: Documentation: v4l: Rework LP-11 documentation, add callbacks

Rework LP-11 and LP-111 mode documentation to make it more understandable
and useful. This involves adding pre_streamon and post_streamon callbacks
that make it possible to explicitly transition the transmitter to either
mode.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Sakari Ailus and committed by
Mauro Carvalho Chehab
013c35b2 e5a466d4

+26 -10
+26 -10
Documentation/driver-api/media/tx-rx.rst
··· 93 93 LP-11 and LP-111 modes 94 94 ^^^^^^^^^^^^^^^^^^^^^^ 95 95 96 - The transmitter drivers must, if possible, configure the CSI-2 transmitter to 97 - *LP-11 or LP-111 mode* whenever the transmitter is powered on but not active, 98 - and maintain *LP-11 or LP-111 mode* until stream on. Only at stream on time 99 - should the transmitter activate the clock on the clock lane and transition to 100 - *HS mode*. 96 + As part of transitioning to high speed mode, a CSI-2 transmitter typically 97 + briefly sets the bus to LP-11 or LP-111 state, depending on the PHY. This period 98 + may be as short as 100 µs, during which the receiver observes this state and 99 + proceeds its own part of high speed mode transition. 101 100 102 - Some transmitters do this automatically but some have to be explicitly 103 - programmed to do so, and some are unable to do so altogether due to 104 - hardware constraints. 101 + Most receivers are capable of autonomously handling this once the software has 102 + configured them to do so, but there are receivers which require software 103 + involvement in observing LP-11 or LP-111 state. 100 µs is a brief period to hit 104 + in software, especially when there is no interrupt telling something is 105 + happening. 105 106 106 - The receiver thus need to be configured to expect LP-11 or LP-111 mode from the 107 - transmitter before the transmitter driver's ``.s_stream()`` op is called. 107 + One way to address this is to configure the transmitter side explicitly to LP-11 108 + or LP-111 mode, which requires support from the transmitter hardware. This is 109 + not universally available. Many devices return to this state once streaming is 110 + stopped while the state after power-on is LP-00 or LP-000. 111 + 112 + The ``.pre_streamon()`` callback may be used to prepare a transmitter for 113 + transitioning to streaming state, but not yet start streaming. Similarly, the 114 + ``.post_streamoff()`` callback is used to undo what was done by the 115 + ``.pre_streamon()`` callback. The caller of ``.pre_streamon()`` is thus required 116 + to call ``.post_streamoff()`` for each successful call of ``.pre_streamon()``. 117 + 118 + In the context of CSI-2, the ``.pre_streamon()`` callback is used to transition 119 + the transmitter to the LP-11 or LP-111 mode. This also requires powering on the 120 + device, so this should be only done when it is needed. 121 + 122 + Receiver drivers that do not need explicit LP-11 or LP-111 mode setup are waived 123 + from calling the two callbacks. 108 124 109 125 Stopping the transmitter 110 126 ^^^^^^^^^^^^^^^^^^^^^^^^