[PATCH 02/13] drm/msm/hdmi: Create separate Makefile/Kconfig

Archit Taneja architt at codeaurora.org
Wed Jan 20 23:09:30 PST 2016


The msm Makefile and Kconfig are getting conjusted. HDMI is going to
have more configs and files in the future to manage, which will make
managing these harder.

Move hdmi related stuff into separate Kconfig and Makefile.

Signed-off-by: Archit Taneja <architt at codeaurora.org>
---
 drivers/gpu/drm/msm/Kconfig       |  1 +
 drivers/gpu/drm/msm/Makefile      | 10 +---------
 drivers/gpu/drm/msm/hdmi/Kconfig  |  7 +++++++
 drivers/gpu/drm/msm/hdmi/Makefile |  4 ++++
 drivers/gpu/drm/msm/msm_drv.h     | 16 ++++++++++++++++
 5 files changed, 29 insertions(+), 9 deletions(-)
 create mode 100644 drivers/gpu/drm/msm/hdmi/Kconfig
 create mode 100644 drivers/gpu/drm/msm/hdmi/Makefile

diff --git a/drivers/gpu/drm/msm/Kconfig b/drivers/gpu/drm/msm/Kconfig
index 27d3aed..d432380 100644
--- a/drivers/gpu/drm/msm/Kconfig
+++ b/drivers/gpu/drm/msm/Kconfig
@@ -24,3 +24,4 @@ config DRM_MSM_REGISTER_LOGGING
 	  logging can be switched on via msm.reglog=y module param.
 
 source "drivers/gpu/drm/msm/dsi/Kconfig"
+source "drivers/gpu/drm/msm/hdmi/Kconfig"
diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile
index 7ac7221..66b7ec4 100644
--- a/drivers/gpu/drm/msm/Makefile
+++ b/drivers/gpu/drm/msm/Makefile
@@ -5,15 +5,6 @@ msm-y := \
 	adreno/adreno_gpu.o \
 	adreno/a3xx_gpu.o \
 	adreno/a4xx_gpu.o \
-	hdmi/hdmi.o \
-	hdmi/hdmi_audio.o \
-	hdmi/hdmi_bridge.o \
-	hdmi/hdmi_connector.o \
-	hdmi/hdmi_hdcp.o \
-	hdmi/hdmi_i2c.o \
-	hdmi/hdmi_phy_8960.o \
-	hdmi/hdmi_phy_8x60.o \
-	hdmi/hdmi_phy_8x74.o \
 	edp/edp.o \
 	edp/edp_aux.o \
 	edp/edp_bridge.o \
@@ -56,5 +47,6 @@ msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o
 msm-$(CONFIG_COMMON_CLK) += mdp/mdp4/mdp4_lvds_pll.o
 
 obj-$(CONFIG_DRM_MSM_DSI) += dsi/
+obj-$(CONFIG_DRM_MSM_HDMI) += hdmi/
 
 obj-$(CONFIG_DRM_MSM)	+= msm.o
diff --git a/drivers/gpu/drm/msm/hdmi/Kconfig b/drivers/gpu/drm/msm/hdmi/Kconfig
new file mode 100644
index 0000000..4b24e1e
--- /dev/null
+++ b/drivers/gpu/drm/msm/hdmi/Kconfig
@@ -0,0 +1,7 @@
+config DRM_MSM_HDMI
+	bool "Enable HDMI support in MSM DRM driver"
+	depends on DRM_MSM
+	default y
+	help
+	  Choose this option if you have a need for HDMI connector
+	  support.
diff --git a/drivers/gpu/drm/msm/hdmi/Makefile b/drivers/gpu/drm/msm/hdmi/Makefile
new file mode 100644
index 0000000..3810388
--- /dev/null
+++ b/drivers/gpu/drm/msm/hdmi/Makefile
@@ -0,0 +1,4 @@
+ccflags-y := -Iinclude/drm -Idrivers/gpu/drm/msm
+
+obj-y := hdmi.o hdmi_audio.o hdmi_bridge.o hdmi_connector.o hdmi_hdcp.o \
+	 hdmi_i2c.o hdmi_phy_8960.o hdmi_phy_8x60.o hdmi_phy_8x74.o
diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
index c1e7bba..ba13ab6 100644
--- a/drivers/gpu/drm/msm/msm_drv.h
+++ b/drivers/gpu/drm/msm/msm_drv.h
@@ -242,10 +242,26 @@ struct drm_framebuffer *msm_framebuffer_create(struct drm_device *dev,
 struct drm_fb_helper *msm_fbdev_init(struct drm_device *dev);
 
 struct hdmi;
+#ifdef CONFIG_DRM_MSM_HDMI
 int hdmi_modeset_init(struct hdmi *hdmi, struct drm_device *dev,
 		struct drm_encoder *encoder);
 void __init hdmi_register(void);
 void __exit hdmi_unregister(void);
+#else
+static inline int hdmi_modeset_init(struct hdmi *hdmi, struct drm_device *dev,
+				    struct drm_encoder *encoder)
+{
+	return -EINVAL;
+}
+
+static inline void __init hdmi_register(void)
+{
+}
+
+static inline void __exit hdmi_unregister(void)
+{
+}
+#endif
 
 struct msm_edp;
 void __init msm_edp_register(void);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation



More information about the dri-devel mailing list