154 lines · plain
1.. SPDX-License-Identifier: GPL-2.02 3.. include:: <isonum.txt>4 5The Samsung S5P/Exynos4 FIMC driver6===================================7 8Copyright |copy| 2012 - 2013 Samsung Electronics Co., Ltd.9 10The FIMC (Fully Interactive Mobile Camera) device available in Samsung11SoC Application Processors is an integrated camera host interface, color12space converter, image resizer and rotator. It's also capable of capturing13data from LCD controller (FIMD) through the SoC internal writeback data14path. There are multiple FIMC instances in the SoCs (up to 4), having15slightly different capabilities, like pixel alignment constraints, rotator16availability, LCD writeback support, etc. The driver is located at17drivers/media/platform/samsung/exynos4-is directory.18 19Supported SoCs20--------------21 22S5PC100 (mem-to-mem only), S5PV210, Exynos421023 24Supported features25------------------26 27- camera parallel interface capture (ITU-R.BT601/565);28- camera serial interface capture (MIPI-CSI2);29- memory-to-memory processing (color space conversion, scaling, mirror30 and rotation);31- dynamic pipeline re-configuration at runtime (re-attachment of any FIMC32 instance to any parallel video input or any MIPI-CSI front-end);33- runtime PM and system wide suspend/resume34 35Not currently supported36-----------------------37 38- LCD writeback input39- per frame clock gating (mem-to-mem)40 41User space interfaces42---------------------43 44Media device interface45~~~~~~~~~~~~~~~~~~~~~~46 47The driver supports Media Controller API as defined at :ref:`media_controller`.48The media device driver name is "Samsung S5P FIMC".49 50The purpose of this interface is to allow changing assignment of FIMC instances51to the SoC peripheral camera input at runtime and optionally to control internal52connections of the MIPI-CSIS device(s) to the FIMC entities.53 54The media device interface allows to configure the SoC for capturing image55data from the sensor through more than one FIMC instance (e.g. for simultaneous56viewfinder and still capture setup).57 58Reconfiguration is done by enabling/disabling media links created by the driver59during initialization. The internal device topology can be easily discovered60through media entity and links enumeration.61 62Memory-to-memory video node63~~~~~~~~~~~~~~~~~~~~~~~~~~~64 65V4L2 memory-to-memory interface at /dev/video? device node. This is standalone66video device, it has no media pads. However please note the mem-to-mem and67capture video node operation on same FIMC instance is not allowed. The driver68detects such cases but the applications should prevent them to avoid an69undefined behaviour.70 71Capture video node72~~~~~~~~~~~~~~~~~~73 74The driver supports V4L2 Video Capture Interface as defined at75:ref:`devices`.76 77At the capture and mem-to-mem video nodes only the multi-planar API is78supported. For more details see: :ref:`planar-apis`.79 80Camera capture subdevs81~~~~~~~~~~~~~~~~~~~~~~82 83Each FIMC instance exports a sub-device node (/dev/v4l-subdev?), a sub-device84node is also created per each available and enabled at the platform level85MIPI-CSI receiver device (currently up to two).86 87sysfs88~~~~~89 90In order to enable more precise camera pipeline control through the sub-device91API the driver creates a sysfs entry associated with "s5p-fimc-md" platform92device. The entry path is: /sys/platform/devices/s5p-fimc-md/subdev_conf_mode.93 94In typical use case there could be a following capture pipeline configuration:95sensor subdev -> mipi-csi subdev -> fimc subdev -> video node96 97When we configure these devices through sub-device API at user space, the98configuration flow must be from left to right, and the video node is99configured as last one.100 101When we don't use sub-device user space API the whole configuration of all102devices belonging to the pipeline is done at the video node driver.103The sysfs entry allows to instruct the capture node driver not to configure104the sub-devices (format, crop), to avoid resetting the subdevs' configuration105when the last configuration steps at the video node is performed.106 107For full sub-device control support (subdevs configured at user space before108starting streaming):109 110.. code-block:: none111 112 # echo "sub-dev" > /sys/platform/devices/s5p-fimc-md/subdev_conf_mode113 114For V4L2 video node control only (subdevs configured internally by the host115driver):116 117.. code-block:: none118 119 # echo "vid-dev" > /sys/platform/devices/s5p-fimc-md/subdev_conf_mode120 121This is a default option.122 1235. Device mapping to video and subdev device nodes124--------------------------------------------------125 126There are associated two video device nodes with each device instance in127hardware - video capture and mem-to-mem and additionally a subdev node for128more precise FIMC capture subsystem control. In addition a separate v4l2129sub-device node is created per each MIPI-CSIS device.130 131How to find out which /dev/video? or /dev/v4l-subdev? is assigned to which132device?133 134You can either grep through the kernel log to find relevant information, i.e.135 136.. code-block:: none137 138 # dmesg | grep -i fimc139 140(note that udev, if present, might still have rearranged the video nodes),141 142or retrieve the information from /dev/media? with help of the media-ctl tool:143 144.. code-block:: none145 146 # media-ctl -p147 1487. Build149--------150 151If the driver is built as a loadable kernel module (CONFIG_VIDEO_SAMSUNG_S5P_FIMC=m)152two modules are created (in addition to the core v4l2 modules): s5p-fimc.ko and153optional s5p-csis.ko (MIPI-CSI receiver subdev).154