1 | The aim of this series is to add another capture source, SoC | 1 | v6 changes: |
---|---|---|---|
2 | Display(GFX), for video. | 2 | - Replace aspeed-video.txt with aspeed,video-engine.yaml. |
3 | 3 | v5 changes: | |
4 | - Remove dts. | ||
5 | - Add doc, aspeed,video.yaml. | ||
6 | - Simplify aspeed_regmap_lookup. | ||
4 | v4 changes: | 7 | v4 changes: |
5 | - Use scoped/cleanup to make aspeed_regmap_lookup simpler. | 8 | - Use scoped/cleanup to make aspeed_regmap_lookup simpler. |
6 | - Update dts | 9 | - Update dts |
7 | v3 changes: | 10 | v3 changes: |
8 | - Update for enum_input. | 11 | - Update for enum_input. |
9 | v2 changes: | 12 | v2 changes: |
10 | - Update patch subject and comments. | 13 | - Update patch subject and comments. |
11 | 14 | ||
12 | Jammy Huang (2): | 15 | Jammy Huang (2): |
13 | ARM: dts: aspeed: Add properties of scu and gfx for video | 16 | dt-bindings: media: convert aspeed-video.txt to dt-schema |
14 | media: aspeed: Allow to capture from SoC display (GFX) | 17 | media: aspeed: Allow to capture from SoC display (GFX) |
15 | 18 | ||
16 | arch/arm/boot/dts/aspeed/aspeed-g6.dtsi | 2 + | 19 | .../bindings/media/aspeed,video-engine.yaml | 78 ++++++++ |
17 | drivers/media/platform/aspeed/aspeed-video.c | 192 ++++++++++++++++--- | 20 | .../bindings/media/aspeed-video.txt | 33 --- |
18 | include/uapi/linux/aspeed-video.h | 7 + | 21 | drivers/media/platform/aspeed/aspeed-video.c | 189 +++++++++++++++--- |
19 | 3 files changed, 173 insertions(+), 28 deletions(-) | 22 | include/uapi/linux/aspeed-video.h | 7 + |
23 | 4 files changed, 246 insertions(+), 61 deletions(-) | ||
24 | create mode 100644 Documentation/devicetree/bindings/media/aspeed,video-engine.yaml | ||
25 | delete mode 100644 Documentation/devicetree/bindings/media/aspeed-video.txt | ||
20 | 26 | ||
21 | 27 | ||
22 | base-commit: e9d22f7a6655941fc8b2b942ed354ec780936b3e | 28 | base-commit: 47ac09b91befbb6a235ab620c32af719f8208399 |
23 | -- | 29 | -- |
24 | 2.25.1 | 30 | 2.25.1 | diff view generated by jsdifflib |
1 | To have video support capture from SoC display(GFX), these properties | 1 | Convert the ASPEED SoCs video txt bindings to dt-schema. |
---|---|---|---|
2 | are added to allow video to control related registers. | ||
3 | 2 | ||
4 | Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com> | 3 | Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com> |
5 | --- | 4 | --- |
6 | arch/arm/boot/dts/aspeed/aspeed-g6.dtsi | 2 ++ | 5 | .../bindings/media/aspeed,video-engine.yaml | 78 +++++++++++++++++++ |
7 | 1 file changed, 2 insertions(+) | 6 | .../bindings/media/aspeed-video.txt | 33 -------- |
7 | 2 files changed, 78 insertions(+), 33 deletions(-) | ||
8 | create mode 100644 Documentation/devicetree/bindings/media/aspeed,video-engine.yaml | ||
9 | delete mode 100644 Documentation/devicetree/bindings/media/aspeed-video.txt | ||
8 | 10 | ||
9 | diff --git a/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi b/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi | 11 | diff --git a/Documentation/devicetree/bindings/media/aspeed,video-engine.yaml b/Documentation/devicetree/bindings/media/aspeed,video-engine.yaml |
10 | index XXXXXXX..XXXXXXX 100644 | 12 | new file mode 100644 |
11 | --- a/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi | 13 | index XXXXXXX..XXXXXXX |
12 | +++ b/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi | 14 | --- /dev/null |
13 | @@ -XXX,XX +XXX,XX @@ video: video@1e700000 { | 15 | +++ b/Documentation/devicetree/bindings/media/aspeed,video-engine.yaml |
14 | <&syscon ASPEED_CLK_GATE_ECLK>; | 16 | @@ -XXX,XX +XXX,XX @@ |
15 | clock-names = "vclk", "eclk"; | 17 | +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) |
16 | interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; | 18 | +%YAML 1.2 |
17 | + aspeed,scu = <&syscon>; | 19 | +--- |
18 | + aspeed,gfx = <&gfx>; | 20 | +$id: http://devicetree.org/schemas/media/aspeed,video-engine.yaml# |
19 | status = "disabled"; | 21 | +$schema: http://devicetree.org/meta-schemas/core.yaml# |
20 | }; | 22 | + |
21 | 23 | +title: ASPEED Video Engine | |
24 | + | ||
25 | +maintainers: | ||
26 | + - Eddie James <eajames@linux.ibm.com> | ||
27 | + - Jammy Huang <jammy_huang@aspeedtech.com> | ||
28 | + | ||
29 | +description: | ||
30 | + The Video Engine (VE) embedded in the ASPEED SOCs can be configured to | ||
31 | + capture and compress video data from digital or analog sources. | ||
32 | + | ||
33 | +properties: | ||
34 | + compatible: | ||
35 | + enum: | ||
36 | + - aspeed,ast2400-video-engine | ||
37 | + - aspeed,ast2500-video-engine | ||
38 | + - aspeed,ast2600-video-engine | ||
39 | + | ||
40 | + reg: | ||
41 | + maxItems: 1 | ||
42 | + | ||
43 | + clocks: | ||
44 | + maxItems: 2 | ||
45 | + | ||
46 | + clock-names: | ||
47 | + items: | ||
48 | + - const: vclk | ||
49 | + - const: eclk | ||
50 | + | ||
51 | + resets: | ||
52 | + maxItems: 1 | ||
53 | + | ||
54 | + interrupts: | ||
55 | + maxItems: 1 | ||
56 | + | ||
57 | + memory-region: | ||
58 | + description: | | ||
59 | + Phandle to a memory region to allocate from, as defined in | ||
60 | + Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt | ||
61 | + | ||
62 | + aspeed,scu: | ||
63 | + $ref: /schemas/types.yaml#/definitions/phandle | ||
64 | + description: | | ||
65 | + Specifies the scu node that is needed if video wants to capture | ||
66 | + from sources other than Host VGA. | ||
67 | + | ||
68 | + aspeed,gfx: | ||
69 | + $ref: /schemas/types.yaml#/definitions/phandle | ||
70 | + description: | | ||
71 | + Specifies the Soc Display(gfx) node that needs to be queried to get | ||
72 | + related information if video wants to use gfx as capture source. | ||
73 | + | ||
74 | +required: | ||
75 | + - compatible | ||
76 | + - reg | ||
77 | + - clocks | ||
78 | + - clock-names | ||
79 | + - interrupts | ||
80 | + | ||
81 | +additionalProperties: false | ||
82 | + | ||
83 | +examples: | ||
84 | + - | | ||
85 | + video-engine@1e700000 { | ||
86 | + compatible = "aspeed,ast2600-video-engine"; | ||
87 | + reg = <0x1e700000 0x1000>; | ||
88 | + clocks = <&syscon ASPEED_CLK_GATE_VCLK>, | ||
89 | + <&syscon ASPEED_CLK_GATE_ECLK>; | ||
90 | + clock-names = "vclk", "eclk"; | ||
91 | + interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; | ||
92 | + aspeed,scu = <&syscon>; | ||
93 | + aspeed,gfx = <&gfx>; | ||
94 | + }; | ||
95 | diff --git a/Documentation/devicetree/bindings/media/aspeed-video.txt b/Documentation/devicetree/bindings/media/aspeed-video.txt | ||
96 | deleted file mode 100644 | ||
97 | index XXXXXXX..XXXXXXX | ||
98 | --- a/Documentation/devicetree/bindings/media/aspeed-video.txt | ||
99 | +++ /dev/null | ||
100 | @@ -XXX,XX +XXX,XX @@ | ||
101 | -* Device tree bindings for Aspeed Video Engine | ||
102 | - | ||
103 | -The Video Engine (VE) embedded in the Aspeed AST2400/2500/2600 SOCs can | ||
104 | -capture and compress video data from digital or analog sources. | ||
105 | - | ||
106 | -Required properties: | ||
107 | - - compatible: "aspeed,ast2400-video-engine" or | ||
108 | - "aspeed,ast2500-video-engine" or | ||
109 | - "aspeed,ast2600-video-engine" | ||
110 | - - reg: contains the offset and length of the VE memory region | ||
111 | - - clocks: clock specifiers for the syscon clocks associated with | ||
112 | - the VE (ordering must match the clock-names property) | ||
113 | - - clock-names: "vclk" and "eclk" | ||
114 | - - resets: reset specifier for the syscon reset associated with | ||
115 | - the VE | ||
116 | - - interrupts: the interrupt associated with the VE on this platform | ||
117 | - | ||
118 | -Optional properties: | ||
119 | - - memory-region: | ||
120 | - phandle to a memory region to allocate from, as defined in | ||
121 | - Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt | ||
122 | - | ||
123 | -Example: | ||
124 | - | ||
125 | -video-engine@1e700000 { | ||
126 | - compatible = "aspeed,ast2500-video-engine"; | ||
127 | - reg = <0x1e700000 0x20000>; | ||
128 | - clocks = <&syscon ASPEED_CLK_GATE_VCLK>, <&syscon ASPEED_CLK_GATE_ECLK>; | ||
129 | - clock-names = "vclk", "eclk"; | ||
130 | - resets = <&syscon ASPEED_RESET_VIDEO>; | ||
131 | - interrupts = <7>; | ||
132 | - memory-region = <&video_engine_memory>; | ||
133 | -}; | ||
22 | -- | 134 | -- |
23 | 2.25.1 | 135 | 2.25.1 | diff view generated by jsdifflib |
... | ... | ||
---|---|---|---|
31 | } | 31 | } |
32 | 32 | ||
33 | Link: https://github.com/AspeedTech-BMC/openbmc/releases | 33 | Link: https://github.com/AspeedTech-BMC/openbmc/releases |
34 | Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com> | 34 | Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com> |
35 | --- | 35 | --- |
36 | drivers/media/platform/aspeed/aspeed-video.c | 192 ++++++++++++++++--- | 36 | drivers/media/platform/aspeed/aspeed-video.c | 189 ++++++++++++++++--- |
37 | include/uapi/linux/aspeed-video.h | 7 + | 37 | include/uapi/linux/aspeed-video.h | 7 + |
38 | 2 files changed, 171 insertions(+), 28 deletions(-) | 38 | 2 files changed, 168 insertions(+), 28 deletions(-) |
39 | 39 | ||
40 | diff --git a/drivers/media/platform/aspeed/aspeed-video.c b/drivers/media/platform/aspeed/aspeed-video.c | 40 | diff --git a/drivers/media/platform/aspeed/aspeed-video.c b/drivers/media/platform/aspeed/aspeed-video.c |
41 | index XXXXXXX..XXXXXXX 100644 | 41 | index XXXXXXX..XXXXXXX 100644 |
42 | --- a/drivers/media/platform/aspeed/aspeed-video.c | 42 | --- a/drivers/media/platform/aspeed/aspeed-video.c |
43 | +++ b/drivers/media/platform/aspeed/aspeed-video.c | 43 | +++ b/drivers/media/platform/aspeed/aspeed-video.c |
... | ... | ||
428 | + * conflict. | 428 | + * conflict. |
429 | + */ | 429 | + */ |
430 | +static struct regmap *aspeed_regmap_lookup(struct device_node *np, const char *property) | 430 | +static struct regmap *aspeed_regmap_lookup(struct device_node *np, const char *property) |
431 | +{ | 431 | +{ |
432 | + struct device_node *syscon_np __free(device_node) = of_parse_phandle(np, property, 0); | 432 | + struct device_node *syscon_np __free(device_node) = of_parse_phandle(np, property, 0); |
433 | + struct regmap *regmap; | ||
434 | + | 433 | + |
435 | + if (!syscon_np) | 434 | + if (!syscon_np) |
436 | + return ERR_PTR(-ENODEV); | 435 | + return ERR_PTR(-ENODEV); |
437 | + | 436 | + |
438 | + regmap = device_node_to_regmap(syscon_np); | 437 | + return device_node_to_regmap(syscon_np); |
439 | + | ||
440 | + return regmap; | ||
441 | +} | 438 | +} |
442 | + | 439 | + |
443 | static int aspeed_video_init(struct aspeed_video *video) | 440 | static int aspeed_video_init(struct aspeed_video *video) |
444 | { | 441 | { |
445 | int irq; | 442 | int irq; |
... | ... | diff view generated by jsdifflib |