1# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/media/samsung,s5p-mfc.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Samsung Exynos Multi Format Codec (MFC)
8
9maintainers:
10  - Marek Szyprowski <m.szyprowski@samsung.com>
11  - Aakarsh Jain <aakarsh.jain@samsung.com>
12
13description:
14  Multi Format Codec (MFC) is the IP present in Samsung SoCs which
15  supports high resolution decoding and encoding functionalities.
16
17properties:
18  compatible:
19    oneOf:
20      - enum:
21          - samsung,exynos5433-mfc        # Exynos5433
22          - samsung,mfc-v5                # Exynos4
23          - samsung,mfc-v6                # Exynos5
24          - samsung,mfc-v7                # Exynos5420
25          - samsung,mfc-v8                # Exynos5800
26          - samsung,mfc-v10               # Exynos7880
27      - items:
28          - enum:
29              - samsung,exynos3250-mfc    # Exynos3250
30          - const: samsung,mfc-v7         # Fall back for Exynos3250
31
32  reg:
33    maxItems: 1
34
35  clocks:
36    minItems: 1
37    maxItems: 3
38
39  clock-names:
40    minItems: 1
41    maxItems: 3
42
43  interrupts:
44    maxItems: 1
45
46  iommus:
47    minItems: 1
48    maxItems: 2
49
50  iommu-names:
51    minItems: 1
52    maxItems: 2
53
54  power-domains:
55    maxItems: 1
56
57  memory-region:
58    minItems: 1
59    maxItems: 2
60
61required:
62  - compatible
63  - reg
64  - clocks
65  - clock-names
66  - interrupts
67
68additionalProperties: false
69
70allOf:
71  - if:
72      properties:
73        compatible:
74          contains:
75            enum:
76              - samsung,exynos3250-mfc
77    then:
78      properties:
79        clocks:
80          maxItems: 2
81        clock-names:
82          items:
83            - const: mfc
84            - const: sclk_mfc
85        iommus:
86          maxItems: 1
87        iommus-names: false
88
89  - if:
90      properties:
91        compatible:
92          contains:
93            enum:
94              - samsung,exynos5433-mfc
95    then:
96      properties:
97        clocks:
98          maxItems: 3
99        clock-names:
100          items:
101            - const: pclk
102            - const: aclk
103            - const: aclk_xiu
104        iommus:
105          maxItems: 2
106        iommus-names:
107          items:
108            - const: left
109            - const: right
110
111  - if:
112      properties:
113        compatible:
114          contains:
115            enum:
116              - samsung,mfc-v5
117    then:
118      properties:
119        clocks:
120          maxItems: 2
121        clock-names:
122          items:
123            - const: mfc
124            - const: sclk_mfc
125        iommus:
126          maxItems: 2
127        iommus-names:
128          items:
129            - const: left
130            - const: right
131
132  - if:
133      properties:
134        compatible:
135          contains:
136            enum:
137              - samsung,mfc-v6
138              - samsung,mfc-v8
139    then:
140      properties:
141        clocks:
142          maxItems: 1
143        clock-names:
144          items:
145            - const: mfc
146        iommus:
147          maxItems: 2
148        iommus-names:
149          items:
150            - const: left
151            - const: right
152
153  - if:
154      properties:
155        compatible:
156          contains:
157            enum:
158              - samsung,mfc-v7
159    then:
160      properties:
161        clocks:
162          minItems: 1
163          maxItems: 2
164        iommus:
165          minItems: 1
166          maxItems: 2
167
168examples:
169  - |
170    #include <dt-bindings/clock/exynos4.h>
171    #include <dt-bindings/clock/exynos-audss-clk.h>
172    #include <dt-bindings/interrupt-controller/arm-gic.h>
173    #include <dt-bindings/interrupt-controller/irq.h>
174
175    codec@13400000 {
176        compatible = "samsung,mfc-v5";
177        reg = <0x13400000 0x10000>;
178        interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
179        power-domains = <&pd_mfc>;
180        clocks = <&clock CLK_MFC>, <&clock CLK_SCLK_MFC>;
181        clock-names = "mfc", "sclk_mfc";
182        iommus = <&sysmmu_mfc_l>, <&sysmmu_mfc_r>;
183        iommu-names = "left", "right";
184    };
185