Skip to content

Commit a481bf2

Browse files
ckhu-mediatekChun-Kuang Hu
authored andcommitted
drm/mediatek: Separate mtk_hdmi_phy to an independent module
mtk_hdmi_phy is a part of mtk_hdmi module, but phy driver should be an independent module rather than be part of drm module, so separate the phy driver to an independent module. Signed-off-by: CK Hu <ck.hu@mediatek.com> Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org> Tested-by: Frank Wunderlich <frank-w@public-files.de>
1 parent 96f51a4 commit a481bf2

6 files changed

Lines changed: 17 additions & 8 deletions

File tree

drivers/gpu/drm/mediatek/Kconfig

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ config DRM_MEDIATEK_HDMI
2424
tristate "DRM HDMI Support for Mediatek SoCs"
2525
depends on DRM_MEDIATEK
2626
select SND_SOC_HDMI_CODEC if SND_SOC
27-
select GENERIC_PHY
27+
select PHY_MTK_HDMI
2828
help
2929
DRM/KMS HDMI driver for Mediatek SoCs
30+
31+
config PHY_MTK_HDMI
32+
tristate "MediaTek HDMI-PHY Driver"
33+
depends on ARCH_MEDIATEK && OF
34+
select GENERIC_PHY
35+
help
36+
Support HDMI PHY for Mediatek SoCs.

drivers/gpu/drm/mediatek/Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ obj-$(CONFIG_DRM_MEDIATEK) += mediatek-drm.o
1919

2020
mediatek-drm-hdmi-objs := mtk_cec.o \
2121
mtk_hdmi.o \
22-
mtk_hdmi_ddc.o \
23-
mtk_mt2701_hdmi_phy.o \
24-
mtk_mt8173_hdmi_phy.o \
25-
mtk_hdmi_phy.o
22+
mtk_hdmi_ddc.o
2623

2724
obj-$(CONFIG_DRM_MEDIATEK_HDMI) += mediatek-drm-hdmi.o
25+
26+
phy-mtk-hdmi-drv-objs := mtk_hdmi_phy.o \
27+
mtk_mt2701_hdmi_phy.o \
28+
mtk_mt8173_hdmi_phy.o
29+
30+
obj-$(CONFIG_PHY_MTK_HDMI) += phy-mtk-hdmi-drv.o

drivers/gpu/drm/mediatek/mtk_hdmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/io.h>
1313
#include <linux/kernel.h>
1414
#include <linux/mfd/syscon.h>
15+
#include <linux/module.h>
1516
#include <linux/mutex.h>
1617
#include <linux/of_platform.h>
1718
#include <linux/of.h>
@@ -1832,7 +1833,6 @@ static struct platform_driver mtk_hdmi_driver = {
18321833
};
18331834

18341835
static struct platform_driver * const mtk_hdmi_drivers[] = {
1835-
&mtk_hdmi_phy_driver,
18361836
&mtk_hdmi_ddc_driver,
18371837
&mtk_cec_driver,
18381838
&mtk_hdmi_driver,

drivers/gpu/drm/mediatek/mtk_hdmi.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66
#ifndef _MTK_HDMI_CTRL_H
77
#define _MTK_HDMI_CTRL_H
8-
#include "mtk_hdmi_phy.h"
98

109
struct platform_driver;
1110

drivers/gpu/drm/mediatek/mtk_hdmi_phy.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ struct platform_driver mtk_hdmi_phy_driver = {
205205
.of_match_table = mtk_hdmi_phy_match,
206206
},
207207
};
208+
module_platform_driver(mtk_hdmi_phy_driver);
208209

209210
MODULE_DESCRIPTION("MediaTek HDMI PHY Driver");
210211
MODULE_LICENSE("GPL v2");

drivers/gpu/drm/mediatek/mtk_hdmi_phy.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ void mtk_hdmi_phy_mask(struct mtk_hdmi_phy *hdmi_phy, u32 offset,
4949
u32 val, u32 mask);
5050
struct mtk_hdmi_phy *to_mtk_hdmi_phy(struct clk_hw *hw);
5151

52-
extern struct platform_driver mtk_hdmi_phy_driver;
5352
extern struct mtk_hdmi_phy_conf mtk_hdmi_phy_8173_conf;
5453
extern struct mtk_hdmi_phy_conf mtk_hdmi_phy_2701_conf;
5554

0 commit comments

Comments
 (0)