@@ -33,13 +33,13 @@ drm-msm-y := \
msm_rd.o \
msm_ringbuffer.o
-drm-msm-$(CONFIG_DRM_MSM_DSI) += mdp/mdp4/mdp4_dsi_encoder.o \
+drm-msm-$(CONFIG_DRM_MSM_DSI_MODULE) += mdp/mdp4/mdp4_dsi_encoder.o \
mdp/mdp5/mdp5_cmd_encoder.o
drm-msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o
drm-msm-$(CONFIG_COMMON_CLK) += mdp/mdp4/mdp4_lvds_pll.o
-obj-$(CONFIG_DRM_MSM_DSI) += dsi/
+obj-$(CONFIG_DRM_MSM_DSI_MODULE) += dsi/
obj-$(CONFIG_DRM_MSM_HDMI) += hdmi/
obj-$(CONFIG_DRM_MSM_EDP) += edp/
@@ -1,5 +1,5 @@
config DRM_MSM_DSI
- bool "Enable DSI support in MSM DRM driver"
+ tristate "Enable DSI support in MSM DRM driver"
depends on DRM_MSM
select DRM_PANEL
select DRM_MIPI_DSI
@@ -8,6 +8,11 @@ config DRM_MSM_DSI
Choose this option if you have a need for MIPI DSI connector
support.
+config DRM_MSM_DSI_MODULE
+ tristate
+ default y if DRM_MSM=y && DRM_MSM_DSI=m
+ default DRM_MSM_DSI
+
if DRM_MSM_DSI
config DRM_MSM_DSI_PLL
@@ -1,13 +1,15 @@
ccflags-y := -Iinclude/drm -Idrivers/gpu/drm/msm -Idrivers/gpu/drm/msm/dsi
-obj-y := dsi.o dsi_cfg.o dsi_host.o dsi_manager.o phy/dsi_phy.o
+obj-$(CONFIG_DRM_MSM_DSI_MODULE) += drm-msm-dsi.o
-obj-$(CONFIG_DRM_MSM_DSI_28NM_PHY) += phy/dsi_phy_28nm.o
-obj-$(CONFIG_DRM_MSM_DSI_20NM_PHY) += phy/dsi_phy_20nm.o
-obj-$(CONFIG_DRM_MSM_DSI_28NM_8960_PHY) += phy/dsi_phy_28nm_8960.o
+drm-msm-dsi-y := dsi.o dsi_cfg.o dsi_host.o dsi_manager.o phy/dsi_phy.o
+
+drm-msm-dsi-$(CONFIG_DRM_MSM_DSI_28NM_PHY) += phy/dsi_phy_28nm.o
+drm-msm-dsi-$(CONFIG_DRM_MSM_DSI_20NM_PHY) += phy/dsi_phy_20nm.o
+drm-msm-dsi-$(CONFIG_DRM_MSM_DSI_28NM_8960_PHY) += phy/dsi_phy_28nm_8960.o
ifeq ($(CONFIG_DRM_MSM_DSI_PLL),y)
-obj-y += pll/dsi_pll.o
-obj-$(CONFIG_DRM_MSM_DSI_28NM_PHY) += pll/dsi_pll_28nm.o
-obj-$(CONFIG_DRM_MSM_DSI_28NM_8960_PHY) += pll/dsi_pll_28nm_8960.o
+drm-msm-dsi-y += pll/dsi_pll.o
+drm-msm-dsi-$(CONFIG_DRM_MSM_DSI_28NM_PHY) += pll/dsi_pll_28nm.o
+drm-msm-dsi-$(CONFIG_DRM_MSM_DSI_28NM_8960_PHY) += pll/dsi_pll_28nm_8960.o
endif
@@ -10,7 +10,7 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
-
+#include <linux/module.h>
#include "dsi.h"
struct drm_encoder *msm_dsi_get_encoder(struct msm_dsi *msm_dsi)
@@ -178,6 +178,7 @@ void __init msm_dsi_register(void)
msm_dsi_phy_driver_register();
platform_driver_register(&dsi_driver);
}
+EXPORT_SYMBOL_GPL(msm_dsi_register);
void __exit msm_dsi_unregister(void)
{
@@ -185,6 +186,7 @@ void __exit msm_dsi_unregister(void)
msm_dsi_phy_driver_unregister();
platform_driver_unregister(&dsi_driver);
}
+EXPORT_SYMBOL_GPL(msm_dsi_unregister);
int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev,
struct drm_encoder *encoders[MSM_DSI_ENCODER_NUM])
@@ -262,4 +264,4 @@ fail:
return ret;
}
-
+EXPORT_SYMBOL_GPL(msm_dsi_modeset_init);
@@ -217,7 +217,7 @@ struct drm_encoder *mdp4_lcdc_encoder_init(struct drm_device *dev,
struct drm_connector *mdp4_lvds_connector_init(struct drm_device *dev,
struct device_node *panel_node, struct drm_encoder *encoder);
-#ifdef CONFIG_DRM_MSM_DSI
+#if IS_ENABLED(CONFIG_DRM_MSM_DSI)
struct drm_encoder *mdp4_dsi_encoder_init(struct drm_device *dev);
#else
static inline struct drm_encoder *mdp4_dsi_encoder_init(struct drm_device *dev)
@@ -224,7 +224,7 @@ int mdp5_encoder_set_split_display(struct drm_encoder *encoder,
int mdp5_encoder_get_linecount(struct drm_encoder *encoder);
u32 mdp5_encoder_get_framecount(struct drm_encoder *encoder);
-#ifdef CONFIG_DRM_MSM_DSI
+#if IS_ENABLED(CONFIG_DRM_MSM_DSI)
struct drm_encoder *mdp5_cmd_encoder_init(struct drm_device *dev,
struct mdp5_interface *intf, struct mdp5_ctl *ctl);
int mdp5_cmd_encoder_set_split_display(struct drm_encoder *encoder,
@@ -294,7 +294,7 @@ enum msm_dsi_encoder_id {
MSM_DSI_CMD_ENCODER_ID = 1,
MSM_DSI_ENCODER_NUM = 2
};
-#ifdef CONFIG_DRM_MSM_DSI
+#if IS_ENABLED(CONFIG_DRM_MSM_DSI)
void __init msm_dsi_register(void);
void __exit msm_dsi_unregister(void);
int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev,
Moving around the Makefile for DSI caused a link error with the main driver referring to a builtin module that has no exported symbols: drivers/gpu/built-in.o: In function `msm_drm_register': :(.init.text+0x654): undefined reference to `msm_dsi_register' This changes the DSI symbol to a 'tristate' so we can build it as a module, and exports the symbols as necessary. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/gpu/drm/msm/Makefile | 4 ++-- drivers/gpu/drm/msm/dsi/Kconfig | 7 ++++++- drivers/gpu/drm/msm/dsi/Makefile | 16 +++++++++------- drivers/gpu/drm/msm/dsi/dsi.c | 6 ++++-- drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h | 2 +- drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.h | 2 +- drivers/gpu/drm/msm/msm_drv.h | 2 +- 7 files changed, 24 insertions(+), 15 deletions(-)