0001 .. SPDX-License-Identifier: GPL-2.0
0002
0003 .. include:: <isonum.txt>
0004
0005 The Samsung S5P/Exynos4 FIMC driver
0006 ===================================
0007
0008 Copyright |copy| 2012 - 2013 Samsung Electronics Co., Ltd.
0009
0010 The FIMC (Fully Interactive Mobile Camera) device available in Samsung
0011 SoC Application Processors is an integrated camera host interface, color
0012 space converter, image resizer and rotator. It's also capable of capturing
0013 data from LCD controller (FIMD) through the SoC internal writeback data
0014 path. There are multiple FIMC instances in the SoCs (up to 4), having
0015 slightly different capabilities, like pixel alignment constraints, rotator
0016 availability, LCD writeback support, etc. The driver is located at
0017 drivers/media/platform/samsung/exynos4-is directory.
0018
0019 Supported SoCs
0020 --------------
0021
0022 S5PC100 (mem-to-mem only), S5PV210, Exynos4210
0023
0024 Supported features
0025 ------------------
0026
0027 - camera parallel interface capture (ITU-R.BT601/565);
0028 - camera serial interface capture (MIPI-CSI2);
0029 - memory-to-memory processing (color space conversion, scaling, mirror
0030 and rotation);
0031 - dynamic pipeline re-configuration at runtime (re-attachment of any FIMC
0032 instance to any parallel video input or any MIPI-CSI front-end);
0033 - runtime PM and system wide suspend/resume
0034
0035 Not currently supported
0036 -----------------------
0037
0038 - LCD writeback input
0039 - per frame clock gating (mem-to-mem)
0040
0041 User space interfaces
0042 ---------------------
0043
0044 Media device interface
0045 ~~~~~~~~~~~~~~~~~~~~~~
0046
0047 The driver supports Media Controller API as defined at :ref:`media_controller`.
0048 The media device driver name is "Samsung S5P FIMC".
0049
0050 The purpose of this interface is to allow changing assignment of FIMC instances
0051 to the SoC peripheral camera input at runtime and optionally to control internal
0052 connections of the MIPI-CSIS device(s) to the FIMC entities.
0053
0054 The media device interface allows to configure the SoC for capturing image
0055 data from the sensor through more than one FIMC instance (e.g. for simultaneous
0056 viewfinder and still capture setup).
0057
0058 Reconfiguration is done by enabling/disabling media links created by the driver
0059 during initialization. The internal device topology can be easily discovered
0060 through media entity and links enumeration.
0061
0062 Memory-to-memory video node
0063 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
0064
0065 V4L2 memory-to-memory interface at /dev/video? device node. This is standalone
0066 video device, it has no media pads. However please note the mem-to-mem and
0067 capture video node operation on same FIMC instance is not allowed. The driver
0068 detects such cases but the applications should prevent them to avoid an
0069 undefined behaviour.
0070
0071 Capture video node
0072 ~~~~~~~~~~~~~~~~~~
0073
0074 The driver supports V4L2 Video Capture Interface as defined at
0075 :ref:`devices`.
0076
0077 At the capture and mem-to-mem video nodes only the multi-planar API is
0078 supported. For more details see: :ref:`planar-apis`.
0079
0080 Camera capture subdevs
0081 ~~~~~~~~~~~~~~~~~~~~~~
0082
0083 Each FIMC instance exports a sub-device node (/dev/v4l-subdev?), a sub-device
0084 node is also created per each available and enabled at the platform level
0085 MIPI-CSI receiver device (currently up to two).
0086
0087 sysfs
0088 ~~~~~
0089
0090 In order to enable more precise camera pipeline control through the sub-device
0091 API the driver creates a sysfs entry associated with "s5p-fimc-md" platform
0092 device. The entry path is: /sys/platform/devices/s5p-fimc-md/subdev_conf_mode.
0093
0094 In typical use case there could be a following capture pipeline configuration:
0095 sensor subdev -> mipi-csi subdev -> fimc subdev -> video node
0096
0097 When we configure these devices through sub-device API at user space, the
0098 configuration flow must be from left to right, and the video node is
0099 configured as last one.
0100
0101 When we don't use sub-device user space API the whole configuration of all
0102 devices belonging to the pipeline is done at the video node driver.
0103 The sysfs entry allows to instruct the capture node driver not to configure
0104 the sub-devices (format, crop), to avoid resetting the subdevs' configuration
0105 when the last configuration steps at the video node is performed.
0106
0107 For full sub-device control support (subdevs configured at user space before
0108 starting streaming):
0109
0110 .. code-block:: none
0111
0112 # echo "sub-dev" > /sys/platform/devices/s5p-fimc-md/subdev_conf_mode
0113
0114 For V4L2 video node control only (subdevs configured internally by the host
0115 driver):
0116
0117 .. code-block:: none
0118
0119 # echo "vid-dev" > /sys/platform/devices/s5p-fimc-md/subdev_conf_mode
0120
0121 This is a default option.
0122
0123 5. Device mapping to video and subdev device nodes
0124 --------------------------------------------------
0125
0126 There are associated two video device nodes with each device instance in
0127 hardware - video capture and mem-to-mem and additionally a subdev node for
0128 more precise FIMC capture subsystem control. In addition a separate v4l2
0129 sub-device node is created per each MIPI-CSIS device.
0130
0131 How to find out which /dev/video? or /dev/v4l-subdev? is assigned to which
0132 device?
0133
0134 You can either grep through the kernel log to find relevant information, i.e.
0135
0136 .. code-block:: none
0137
0138 # dmesg | grep -i fimc
0139
0140 (note that udev, if present, might still have rearranged the video nodes),
0141
0142 or retrieve the information from /dev/media? with help of the media-ctl tool:
0143
0144 .. code-block:: none
0145
0146 # media-ctl -p
0147
0148 7. Build
0149 --------
0150
0151 If the driver is built as a loadable kernel module (CONFIG_VIDEO_SAMSUNG_S5P_FIMC=m)
0152 two modules are created (in addition to the core v4l2 modules): s5p-fimc.ko and
0153 optional s5p-csis.ko (MIPI-CSI receiver subdev).