Skip to content

Commit 538af6e

Browse files
Aakarsh Jainkrzk
authored andcommitted
dt-bindings: media: s5p-mfc: convert bindings to json-schema
Convert s5p-mfc bindings to DT schema format using json-schema. Signed-off-by: Aakarsh Jain <aakarsh.jain@samsung.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230328114729.61436-1-aakarsh.jain@samsung.com Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
1 parent 514a935 commit 538af6e

2 files changed

Lines changed: 184 additions & 78 deletions

File tree

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +0,0 @@
1-
* Samsung Multi Format Codec (MFC)
2-
3-
Multi Format Codec (MFC) is the IP present in Samsung SoCs which
4-
supports high resolution decoding and encoding functionalities.
5-
The MFC device driver is a v4l2 driver which can encode/decode
6-
video raw/elementary streams and has support for all popular
7-
video codecs.
8-
9-
Required properties:
10-
- compatible : value should be either one among the following
11-
(a) "samsung,mfc-v5" for MFC v5 present in Exynos4 SoCs
12-
(b) "samsung,mfc-v6" for MFC v6 present in Exynos5 SoCs
13-
(c) "samsung,exynos3250-mfc", "samsung,mfc-v7" for MFC v7
14-
present in Exynos3250 SoC
15-
(d) "samsung,mfc-v7" for MFC v7 present in Exynos5420 SoC
16-
(e) "samsung,mfc-v8" for MFC v8 present in Exynos5800 SoC
17-
(f) "samsung,exynos5433-mfc" for MFC v8 present in Exynos5433 SoC
18-
(g) "samsung,mfc-v10" for MFC v10 present in Exynos7880 SoC
19-
20-
- reg : Physical base address of the IP registers and length of memory
21-
mapped region.
22-
23-
- interrupts : MFC interrupt number to the CPU.
24-
- clocks : from common clock binding: handle to mfc clock.
25-
- clock-names : from common clock binding: must contain "mfc",
26-
corresponding to entry in the clocks property.
27-
28-
Optional properties:
29-
- power-domains : power-domain property defined with a phandle
30-
to respective power domain.
31-
- memory-region : from reserved memory binding: phandles to two reserved
32-
memory regions, first is for "left" mfc memory bus interfaces,
33-
second if for the "right" mfc memory bus, used when no SYSMMU
34-
support is available; used only by MFC v5 present in Exynos4 SoCs
35-
36-
Obsolete properties:
37-
- samsung,mfc-r, samsung,mfc-l : support removed, please use memory-region
38-
property instead
39-
40-
41-
Example:
42-
SoC specific DT entry:
43-
44-
mfc: codec@13400000 {
45-
compatible = "samsung,mfc-v5";
46-
reg = <0x13400000 0x10000>;
47-
interrupts = <0 94 0>;
48-
power-domains = <&pd_mfc>;
49-
clocks = <&clock 273>;
50-
clock-names = "mfc";
51-
};
52-
53-
Reserved memory specific DT entry for given board (see reserved memory binding
54-
for more information):
55-
56-
reserved-memory {
57-
#address-cells = <1>;
58-
#size-cells = <1>;
59-
ranges;
60-
61-
mfc_left: region@51000000 {
62-
compatible = "shared-dma-pool";
63-
no-map;
64-
reg = <0x51000000 0x800000>;
65-
};
66-
67-
mfc_right: region@43000000 {
68-
compatible = "shared-dma-pool";
69-
no-map;
70-
reg = <0x43000000 0x800000>;
71-
};
72-
};
73-
74-
Board specific DT entry:
75-
76-
codec@13400000 {
77-
memory-region = <&mfc_left>, <&mfc_right>;
78-
};
Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
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+
7+
title: Samsung Exynos Multi Format Codec (MFC)
8+
9+
maintainers:
10+
- Marek Szyprowski <m.szyprowski@samsung.com>
11+
- Aakarsh Jain <aakarsh.jain@samsung.com>
12+
13+
description:
14+
Multi Format Codec (MFC) is the IP present in Samsung SoCs which
15+
supports high resolution decoding and encoding functionalities.
16+
17+
properties:
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+
61+
required:
62+
- compatible
63+
- reg
64+
- clocks
65+
- clock-names
66+
- interrupts
67+
68+
additionalProperties: false
69+
70+
allOf:
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+
168+
examples:
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+
};

0 commit comments

Comments
 (0)