drm/exynos: hdmi: move hdmiphy related code to hdmiphy driver
Subsystems (5)
PATCH 1/1 drm/exynos: hdmi: move hdmiphy related code to hdmiphy driver
Right now hdmiphy operations and configs are kept inside hdmi driver. hdmiphy related code is tightly coupled with hdmi ip driver. Physicaly they are different devices and should be instantiated independently.
In terms of versions/mapping/configurations Hdmi and hdmiphy are independent of each other. It seems logical to isolate them and maintained independently.
This implementations is tested for:
1) Resolutions supported by exynos4 and 5 hdmi.
2) Runtime PM and S2R scenarions for exynos5.
This patch is dependent on the patch, posted at
http://www.mail-archive.com/[email protected]/msg34861.html
v2:
1) Moved hdmi subsystem registration to drm-common-hdmi.
2) removed __func__ as DRM_DEBUG_KMS print it by default.
3) removed devname from "hdmiphy" clock as it needs to be accessed by hdmi and hdmiphy driver.
---
It is based on exynos-drm-next branch atgit://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git
arch/arm/mach-exynos/clock-exynos5.c | 1 - drivers/gpu/drm/exynos/exynos_drm_drv.c | 25 +- drivers/gpu/drm/exynos/exynos_drm_drv.h | 14 +- drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 109 +++++- drivers/gpu/drm/exynos/exynos_drm_hdmi.h | 20 + drivers/gpu/drm/exynos/exynos_hdmi.c | 372 ++----------------- drivers/gpu/drm/exynos/exynos_hdmi.h | 1 - drivers/gpu/drm/exynos/exynos_hdmiphy.c | 585 +++++++++++++++++++++++++++++- drivers/gpu/drm/exynos/regs-hdmiphy.h | 61 ++++ 9 files changed, 783 insertions(+), 405 deletions(-) create mode 100644 drivers/gpu/drm/exynos/regs-hdmiphy.h
arch/arm/mach-exynos/clock-exynos5.c +0 -1
@@ -690,7 +690,6 @@ static struct clk exynos5_init_clocks_off[] = { .ctrlbit = (1 << 6), }, { .name = "hdmiphy", - .devname = "exynos5-hdmi", .enable = exynos5_clk_hdmiphy_ctrl, .ctrlbit = (1 << 0), }, {
drivers/gpu/drm/exynos/exynos_drm_drv.c +3 -22
@@ -331,19 +331,9 @@ static int __init exynos_drm_init(void)#endif #ifdef CONFIG_DRM_EXYNOS_HDMI - ret =platform_driver_register (&hdmi_driver); + ret =exynos_common_hdmi_register ();if (ret <0 ) goto out_hdmi; - ret =platform_driver_register (&mixer_driver); -if (ret <0 ) - goto out_mixer; - ret =platform_driver_register (&exynos_drm_common_hdmi_driver); -if (ret <0 ) - goto out_common_hdmi; - - ret =exynos_platform_device_hdmi_register (); -if (ret <0 ) - goto out_common_hdmi_dev;#endif #ifdef CONFIG_DRM_EXYNOS_VIDI
@@ -430,13 +420,7 @@ out_vidi:#endif #ifdef CONFIG_DRM_EXYNOS_HDMI -exynos_platform_device_hdmi_unregister (); -out_common_hdmi_dev: -platform_driver_unregister (&exynos_drm_common_hdmi_driver); -out_common_hdmi: -platform_driver_unregister (&mixer_driver); -out_mixer: -platform_driver_unregister (&hdmi_driver); +exynos_common_hdmi_unregister (); out_hdmi:#endif
@@ -476,10 +460,7 @@ static void __exit exynos_drm_exit(void)#endif #ifdef CONFIG_DRM_EXYNOS_HDMI -exynos_platform_device_hdmi_unregister (); -platform_driver_unregister (&exynos_drm_common_hdmi_driver); -platform_driver_unregister (&mixer_driver); -platform_driver_unregister (&hdmi_driver); +exynos_common_hdmi_unregister ();#endif #ifdef CONFIG_DRM_EXYNOS_VIDI
drivers/gpu/drm/exynos/exynos_drm_drv.h +6 -8
@@ -319,20 +319,18 @@ int exynos_drm_subdrv_open(struct drm_device *dev, struct drm_file *file);void exynos_drm_subdrv_close (struct drm_device *dev,struct drm_file *file);/* -* this function registers exynos drm hdmi platform device. It ensures only one -* instance of the device is created. +* this function registers exynos drm hdmi platform driver and singleton +* device. It also registers subdrivers like mixer, hdmi and hdmiphy. */ -extern int exynos_platform_device_hdmi_register (void ); +extern int exynos_common_hdmi_register (void );/* -* this function unregisters exynos drm hdmi platform device if it exists. +* this function unregisters exynos drm hdmi platform driver and device, +* subdrivers for mixer, hdmi and hdmiphy. */ -void exynos_platform_device_hdmi_unregister (void ); +void exynos_common_hdmi_unregister (void );extern struct platform_driver fimd_driver; -extern struct platform_driver hdmi_driver; -extern struct platform_driver mixer_driver; -extern struct platform_driver exynos_drm_common_hdmi_driver;extern struct platform_driver vidi_driver;extern struct platform_driver g2d_driver;extern struct platform_driver fimc_driver;
drivers/gpu/drm/exynos/exynos_drm_hdmi.c +96 -13
197 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_drm_hdmi.h +20 -0
@@ -39,10 +39,19 @@ struct exynos_hdmi_ops {void (*mode_set)(void *ctx,struct drm_display_mode *mode);void (*get_max_resol)(void *ctx,unsigned int *width,unsigned int *height); +void (*prepare)(void *ctx);void (*commit)(void *ctx);void (*dpms)(void *ctx,int mode); }; +struct exynos_hdmiphy_ops { +int (*check_timing)(void *ctx,struct drm_display_mode *mode); +void (*mode_set)(void *ctx,struct drm_display_mode *mode); +void (*prepare)(void *ctx); +int (*config_apply)(void *ctx); +void (*dpms)(void *ctx,int mode); +}; +struct exynos_mixer_ops {/* manager */ int (*iommu_on)(void *ctx,bool enable);
@@ -60,8 +69,19 @@ struct exynos_mixer_ops { int (*check_timing)(void *ctx, struct drm_display_mode *mode); }; +extern struct platform_driver hdmi_driver; +extern struct platform_driver mixer_driver; + +/* +* these functions registers/unregisters exynos drm hdmiphy driver. +*/ +extern int exynos_hdmiphy_driver_register (void ); +extern void exynos_hdmiphy_driver_unregister (void ); + +void exynos_hdmiphy_drv_attach (struct exynos_drm_hdmi_context *ctx);void exynos_hdmi_drv_attach (struct exynos_drm_hdmi_context *ctx);void exynos_mixer_drv_attach (struct exynos_drm_hdmi_context *ctx); +void exynos_hdmiphy_ops_register (struct exynos_hdmiphy_ops *ops);void exynos_hdmi_ops_register (struct exynos_hdmi_ops *ops);void exynos_mixer_ops_register (struct exynos_mixer_ops *ops);#endif
drivers/gpu/drm/exynos/exynos_hdmi.c +22 -350
502 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_hdmi.h +0 -1
@@ -15,7 +15,6 @@#define _EXYNOS_HDMI_H_void hdmi_attach_ddc_client (struct i2c_client *ddc); -void hdmi_attach_hdmiphy_client (struct i2c_client *hdmiphy);extern struct i2c_driver hdmiphy_driver;extern struct i2c_driver ddc_driver;
drivers/gpu/drm/exynos/exynos_hdmiphy.c +575 -10
629 lines not on this page · raw message
drivers/gpu/drm/exynos/regs-hdmiphy.h new file +61 -0
61 lines not on this page · raw message
Signature · 1 line
1.7.10.4