1 .. SPDX-License-Identifier: GPL-2.0
3 .. include:: <isonum.txt>
5 The Samsung S5P/EXYNOS4 FIMC driver
6 ===================================
8 Copyright |copy| 2012 - 2013 Samsung Electronics Co., Ltd.
10 The FIMC (Fully Interactive Mobile Camera) device available in Samsung
11 SoC Application Processors is an integrated camera host interface, color
12 space converter, image resizer and rotator. It's also capable of capturing
13 data from LCD controller (FIMD) through the SoC internal writeback data
14 path. There are multiple FIMC instances in the SoCs (up to 4), having
15 slightly different capabilities, like pixel alignment constraints, rotator
16 availability, LCD writeback support, etc. The driver is located at
17 drivers/media/platform/exynos4-is directory.
22 S5PC100 (mem-to-mem only), S5PV210, EXYNOS4210
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, mirror
31 - dynamic pipeline re-configuration at runtime (re-attachment of any FIMC
32 instance to any parallel video input or any MIPI-CSI front-end);
33 - runtime PM and system wide suspend/resume
35 Not currently supported
36 -----------------------
39 - per frame clock gating (mem-to-mem)
45 drivers/media/platform/exynos4-is/media-dev.[ch]
47 - camera capture video device driver
48 drivers/media/platform/exynos4-is/fimc-capture.c
50 - MIPI-CSI2 receiver subdev
51 drivers/media/platform/exynos4-is/mipi-csis.[ch]
53 - video post-processor (mem-to-mem)
54 drivers/media/platform/exynos4-is/fimc-core.c
57 drivers/media/platform/exynos4-is/fimc-core.h
58 drivers/media/platform/exynos4-is/fimc-reg.h
59 drivers/media/platform/exynos4-is/regs-fimc.h
64 Media device interface
65 ~~~~~~~~~~~~~~~~~~~~~~
67 The driver supports Media Controller API as defined at :ref:`media_controller`.
68 The media device driver name is "SAMSUNG S5P FIMC".
70 The purpose of this interface is to allow changing assignment of FIMC instances
71 to the SoC peripheral camera input at runtime and optionally to control internal
72 connections of the MIPI-CSIS device(s) to the FIMC entities.
74 The media device interface allows to configure the SoC for capturing image
75 data from the sensor through more than one FIMC instance (e.g. for simultaneous
76 viewfinder and still capture setup).
77 Reconfiguration is done by enabling/disabling media links created by the driver
78 during initialization. The internal device topology can be easily discovered
79 through media entity and links enumeration.
81 Memory-to-memory video node
82 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
84 V4L2 memory-to-memory interface at /dev/video? device node. This is standalone
85 video device, it has no media pads. However please note the mem-to-mem and
86 capture video node operation on same FIMC instance is not allowed. The driver
87 detects such cases but the applications should prevent them to avoid an
93 The driver supports V4L2 Video Capture Interface as defined at
96 At the capture and mem-to-mem video nodes only the multi-planar API is
97 supported. For more details see: :ref:`planar-apis`.
99 Camera capture subdevs
100 ~~~~~~~~~~~~~~~~~~~~~~
102 Each FIMC instance exports a sub-device node (/dev/v4l-subdev?), a sub-device
103 node is also created per each available and enabled at the platform level
104 MIPI-CSI receiver device (currently up to two).
109 In order to enable more precise camera pipeline control through the sub-device
110 API the driver creates a sysfs entry associated with "s5p-fimc-md" platform
111 device. The entry path is: /sys/platform/devices/s5p-fimc-md/subdev_conf_mode.
113 In typical use case there could be a following capture pipeline configuration:
114 sensor subdev -> mipi-csi subdev -> fimc subdev -> video node
116 When we configure these devices through sub-device API at user space, the
117 configuration flow must be from left to right, and the video node is
118 configured as last one.
119 When we don't use sub-device user space API the whole configuration of all
120 devices belonging to the pipeline is done at the video node driver.
121 The sysfs entry allows to instruct the capture node driver not to configure
122 the sub-devices (format, crop), to avoid resetting the subdevs' configuration
123 when the last configuration steps at the video node is performed.
125 For full sub-device control support (subdevs configured at user space before
130 # echo "sub-dev" > /sys/platform/devices/s5p-fimc-md/subdev_conf_mode
132 For V4L2 video node control only (subdevs configured internally by the host
137 # echo "vid-dev" > /sys/platform/devices/s5p-fimc-md/subdev_conf_mode
139 This is a default option.
141 5. Device mapping to video and subdev device nodes
142 --------------------------------------------------
144 There are associated two video device nodes with each device instance in
145 hardware - video capture and mem-to-mem and additionally a subdev node for
146 more precise FIMC capture subsystem control. In addition a separate v4l2
147 sub-device node is created per each MIPI-CSIS device.
149 How to find out which /dev/video? or /dev/v4l-subdev? is assigned to which
152 You can either grep through the kernel log to find relevant information, i.e.
156 # dmesg | grep -i fimc
158 (note that udev, if present, might still have rearranged the video nodes),
160 or retrieve the information from /dev/media? with help of the media-ctl tool:
169 If the driver is built as a loadable kernel module (CONFIG_VIDEO_SAMSUNG_S5P_FIMC=m)
170 two modules are created (in addition to the core v4l2 modules): s5p-fimc.ko and
171 optional s5p-csis.ko (MIPI-CSI receiver subdev).