Skip to content

Commit e31b74b

Browse files
committed
Merge tag 'mediatek-drm-next-20250515' of https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux into drm-next
Mediatek DRM Next - 20250515 1. Prepare for support MT8195/88 HDMIv2 and DDCv2 2. DPI: Cleanups and add support for more formats 3. Cleanups and sanitization 4. Replace custom compare_dev with component_compare_of Signed-off-by: Dave Airlie <[email protected]> From: Chun-Kuang Hu <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2 parents e11c70c + 07c3947 commit e31b74b

File tree

10 files changed

+497
-291
lines changed

10 files changed

+497
-291
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: MediaTek HDMI MT8195 series HDMI Display Data Channel (DDC)
8+
9+
maintainers:
10+
- AngeloGioacchino Del Regno <[email protected]>
11+
12+
13+
properties:
14+
compatible:
15+
oneOf:
16+
- const: mediatek,mt8195-hdmi-ddc
17+
- items:
18+
- const: mediatek,mt8188-hdmi-ddc
19+
- const: mediatek,mt8195-hdmi-ddc
20+
21+
clocks:
22+
maxItems: 1
23+
24+
power-domains:
25+
maxItems: 1
26+
27+
required:
28+
- compatible
29+
- clocks
30+
31+
additionalProperties: false
32+
33+
examples:
34+
- |
35+
hdmi {
36+
hdmi_ddc: i2c {
37+
compatible = "mediatek,mt8195-hdmi-ddc";
38+
clocks = <&clk26m>;
39+
};
40+
};
41+
...
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/display/mediatek/mediatek,mt8195-hdmi.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: MediaTek MT8195 series HDMI-TX Encoder
8+
9+
maintainers:
10+
- AngeloGioacchino Del Regno <[email protected]>
11+
12+
13+
description:
14+
The MediaTek HDMI-TX v2 encoder can generate HDMI format data based on
15+
the HDMI Specification 2.0b.
16+
17+
properties:
18+
compatible:
19+
enum:
20+
- mediatek,mt8188-hdmi-tx
21+
- mediatek,mt8195-hdmi-tx
22+
23+
reg:
24+
maxItems: 1
25+
26+
interrupts:
27+
maxItems: 1
28+
29+
clocks:
30+
items:
31+
- description: HDMI Peripheral Bus (APB) clock
32+
- description: HDCP and HDMI_TOP clock
33+
- description: HDCP, HDMI_TOP and HDMI Audio reference clock
34+
- description: VPP HDMI Split clock
35+
36+
clock-names:
37+
items:
38+
- const: bus
39+
- const: hdcp
40+
- const: hdcp24m
41+
- const: hdmi-split
42+
43+
i2c:
44+
type: object
45+
$ref: /schemas/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml
46+
unevaluatedProperties: false
47+
description: HDMI DDC I2C controller
48+
49+
phys:
50+
maxItems: 1
51+
description: PHY providing clocking TMDS and pixel to controller
52+
53+
phy-names:
54+
items:
55+
- const: hdmi
56+
57+
power-domains:
58+
maxItems: 1
59+
60+
'#sound-dai-cells':
61+
const: 1
62+
63+
ports:
64+
$ref: /schemas/graph.yaml#/properties/ports
65+
66+
properties:
67+
port@0:
68+
$ref: /schemas/graph.yaml#/properties/port
69+
description:
70+
Input port, usually connected to the output port of a DPI
71+
72+
port@1:
73+
$ref: /schemas/graph.yaml#/properties/port
74+
description:
75+
Output port that must be connected either to the input port of
76+
a HDMI connector node containing a ddc-i2c-bus, or to the input
77+
port of an attached bridge chip, such as a SlimPort transmitter.
78+
79+
required:
80+
- port@0
81+
- port@1
82+
83+
required:
84+
- compatible
85+
- reg
86+
- interrupts
87+
- clocks
88+
- clock-names
89+
- power-domains
90+
- phys
91+
- phy-names
92+
- ports
93+
94+
allOf:
95+
- $ref: /schemas/sound/dai-common.yaml#
96+
97+
additionalProperties: false
98+
99+
examples:
100+
- |
101+
#include <dt-bindings/clock/mt8195-clk.h>
102+
#include <dt-bindings/interrupt-controller/arm-gic.h>
103+
#include <dt-bindings/power/mt8195-power.h>
104+
105+
soc {
106+
#address-cells = <2>;
107+
#size-cells = <2>;
108+
109+
hdmi@1c300000 {
110+
compatible = "mediatek,mt8195-hdmi-tx";
111+
reg = <0 0x1c300000 0 0x1000>;
112+
clocks = <&topckgen CLK_TOP_HDMI_APB>,
113+
<&topckgen CLK_TOP_HDCP>,
114+
<&topckgen CLK_TOP_HDCP_24M>,
115+
<&vppsys1 CLK_VPP1_VPP_SPLIT_HDMI>;
116+
clock-names = "bus", "hdcp", "hdcp24m", "hdmi-split";
117+
interrupts = <GIC_SPI 677 IRQ_TYPE_LEVEL_HIGH 0>;
118+
phys = <&hdmi_phy>;
119+
phy-names = "hdmi";
120+
power-domains = <&spm MT8195_POWER_DOMAIN_HDMI_TX>;
121+
pinctrl-names = "default";
122+
pinctrl-0 = <&hdmi_pins>;
123+
#sound-dai-cells = <1>;
124+
125+
hdmitx_ddc: i2c {
126+
compatible = "mediatek,mt8195-hdmi-ddc";
127+
clocks = <&clk26m>;
128+
};
129+
130+
ports {
131+
#address-cells = <1>;
132+
#size-cells = <0>;
133+
134+
port@0 {
135+
reg = <0>;
136+
137+
hdmi_in: endpoint {
138+
remote-endpoint = <&dpi1_out>;
139+
};
140+
};
141+
142+
port@1 {
143+
reg = <1>;
144+
145+
hdmi_out: endpoint {
146+
remote-endpoint = <&hdmi_connector_in>;
147+
};
148+
};
149+
};
150+
};
151+
};

drivers/gpu/drm/mediatek/Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@ mediatek-drm-y := mtk_crtc.o \
2121

2222
obj-$(CONFIG_DRM_MEDIATEK) += mediatek-drm.o
2323

24-
mediatek-drm-hdmi-objs := mtk_cec.o \
25-
mtk_hdmi.o \
26-
mtk_hdmi_ddc.o
27-
28-
obj-$(CONFIG_DRM_MEDIATEK_HDMI) += mediatek-drm-hdmi.o
24+
obj-$(CONFIG_DRM_MEDIATEK_HDMI) += mtk_cec.o
25+
obj-$(CONFIG_DRM_MEDIATEK_HDMI) += mtk_hdmi.o
26+
obj-$(CONFIG_DRM_MEDIATEK_HDMI) += mtk_hdmi_ddc.o
2927

3028
obj-$(CONFIG_DRM_MEDIATEK_DP) += mtk_dp.o

drivers/gpu/drm/mediatek/mtk_cec.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <linux/platform_device.h>
1313

1414
#include "mtk_cec.h"
15-
#include "mtk_hdmi.h"
1615
#include "mtk_drm_drv.h"
1716

1817
#define TR_CONFIG 0x00
@@ -102,6 +101,7 @@ void mtk_cec_set_hpd_event(struct device *dev,
102101
cec->hpd_event = hpd_event;
103102
spin_unlock_irqrestore(&cec->lock, flags);
104103
}
104+
EXPORT_SYMBOL_NS_GPL(mtk_cec_set_hpd_event, "DRM_MTK_HDMI_V1");
105105

106106
bool mtk_cec_hpd_high(struct device *dev)
107107
{
@@ -112,6 +112,7 @@ bool mtk_cec_hpd_high(struct device *dev)
112112

113113
return (status & (HDMI_PORD | HDMI_HTPLG)) == (HDMI_PORD | HDMI_HTPLG);
114114
}
115+
EXPORT_SYMBOL_NS_GPL(mtk_cec_hpd_high, "DRM_MTK_HDMI_V1");
115116

116117
static void mtk_cec_htplg_irq_init(struct mtk_cec *cec)
117118
{
@@ -247,3 +248,7 @@ struct platform_driver mtk_cec_driver = {
247248
.of_match_table = mtk_cec_of_ids,
248249
},
249250
};
251+
module_platform_driver(mtk_cec_driver);
252+
253+
MODULE_DESCRIPTION("MediaTek HDMI CEC Driver");
254+
MODULE_LICENSE("GPL");

drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -492,11 +492,6 @@ static const struct of_device_id mtk_ovl_adaptor_comp_dt_ids[] = {
492492
{ /* sentinel */ }
493493
};
494494

495-
static int compare_of(struct device *dev, void *data)
496-
{
497-
return dev->of_node == data;
498-
}
499-
500495
static int ovl_adaptor_of_get_ddp_comp_type(struct device_node *node,
501496
enum mtk_ovl_adaptor_comp_type *ctype)
502497
{
@@ -567,7 +562,7 @@ static int ovl_adaptor_comp_init(struct device *dev, struct component_match **ma
567562

568563
priv->ovl_adaptor_comp[id] = &comp_pdev->dev;
569564

570-
drm_of_component_match_add(dev, match, compare_of, node);
565+
drm_of_component_match_add(dev, match, component_compare_of, node);
571566
dev_dbg(dev, "Adding component match for %pOF\n", node);
572567
}
573568

0 commit comments

Comments
 (0)