aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorSachin Kamat <sachin.kamat@linaro.org>2013-08-28 01:17:58 -0400
committerInki Dae <inki.dae@samsung.com>2013-09-05 00:43:46 -0400
commit2d3f173cf7c2e032004f950718316e64fb1866eb (patch)
treee1bca6d57eff38b2768fbedd9163f51e6821941a /drivers/gpu
parent88c49815429d9a4dbb95e31212ee65a8f7df6d00 (diff)
drm/exynos: Remove non-DT support in exynos_drm_fimd
Since commit 383ffda2fa ("ARM: EXYNOS: no more support non-DT for EXYNOS SoCs"), Exynos platform is DT only. Hence remove all the conditional macros and make the driver DT only. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fimd.c74
1 files changed, 21 insertions, 53 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 130dea50c3e1..868a14d52995 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -126,7 +126,6 @@ struct fimd_context {
126 struct fimd_driver_data *driver_data; 126 struct fimd_driver_data *driver_data;
127}; 127};
128 128
129#ifdef CONFIG_OF
130static const struct of_device_id fimd_driver_dt_match[] = { 129static const struct of_device_id fimd_driver_dt_match[] = {
131 { .compatible = "samsung,s3c6400-fimd", 130 { .compatible = "samsung,s3c6400-fimd",
132 .data = &s3c64xx_fimd_driver_data }, 131 .data = &s3c64xx_fimd_driver_data },
@@ -136,21 +135,14 @@ static const struct of_device_id fimd_driver_dt_match[] = {
136 .data = &exynos5_fimd_driver_data }, 135 .data = &exynos5_fimd_driver_data },
137 {}, 136 {},
138}; 137};
139#endif
140 138
141static inline struct fimd_driver_data *drm_fimd_get_driver_data( 139static inline struct fimd_driver_data *drm_fimd_get_driver_data(
142 struct platform_device *pdev) 140 struct platform_device *pdev)
143{ 141{
144#ifdef CONFIG_OF
145 const struct of_device_id *of_id = 142 const struct of_device_id *of_id =
146 of_match_device(fimd_driver_dt_match, &pdev->dev); 143 of_match_device(fimd_driver_dt_match, &pdev->dev);
147 144
148 if (of_id) 145 return (struct fimd_driver_data *)of_id->data;
149 return (struct fimd_driver_data *)of_id->data;
150#endif
151
152 return (struct fimd_driver_data *)
153 platform_get_device_id(pdev)->driver_data;
154} 146}
155 147
156static bool fimd_display_is_connected(struct device *dev) 148static bool fimd_display_is_connected(struct device *dev)
@@ -894,37 +886,25 @@ static int fimd_activate(struct fimd_context *ctx, bool enable)
894 886
895static int fimd_get_platform_data(struct fimd_context *ctx, struct device *dev) 887static int fimd_get_platform_data(struct fimd_context *ctx, struct device *dev)
896{ 888{
897 if (dev->of_node) { 889 struct videomode *vm;
898 struct videomode *vm; 890 int ret;
899 int ret;
900 891
901 vm = &ctx->panel.vm; 892 vm = &ctx->panel.vm;
902 ret = of_get_videomode(dev->of_node, vm, OF_USE_NATIVE_MODE); 893 ret = of_get_videomode(dev->of_node, vm, OF_USE_NATIVE_MODE);
903 if (ret) { 894 if (ret) {
904 DRM_ERROR("failed: of_get_videomode() : %d\n", ret); 895 DRM_ERROR("failed: of_get_videomode() : %d\n", ret);
905 return ret; 896 return ret;
906 }
907
908 if (vm->flags & DISPLAY_FLAGS_VSYNC_LOW)
909 ctx->vidcon1 |= VIDCON1_INV_VSYNC;
910 if (vm->flags & DISPLAY_FLAGS_HSYNC_LOW)
911 ctx->vidcon1 |= VIDCON1_INV_HSYNC;
912 if (vm->flags & DISPLAY_FLAGS_DE_LOW)
913 ctx->vidcon1 |= VIDCON1_INV_VDEN;
914 if (vm->flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE)
915 ctx->vidcon1 |= VIDCON1_INV_VCLK;
916 } else {
917 struct exynos_drm_fimd_pdata *pdata = dev->platform_data;
918 if (!pdata) {
919 DRM_ERROR("no platform data specified\n");
920 return -EINVAL;
921 }
922 ctx->vidcon0 = pdata->vidcon0;
923 ctx->vidcon1 = pdata->vidcon1;
924 ctx->default_win = pdata->default_win;
925 ctx->panel = pdata->panel;
926 } 897 }
927 898
899 if (vm->flags & DISPLAY_FLAGS_VSYNC_LOW)
900 ctx->vidcon1 |= VIDCON1_INV_VSYNC;
901 if (vm->flags & DISPLAY_FLAGS_HSYNC_LOW)
902 ctx->vidcon1 |= VIDCON1_INV_HSYNC;
903 if (vm->flags & DISPLAY_FLAGS_DE_LOW)
904 ctx->vidcon1 |= VIDCON1_INV_VDEN;
905 if (vm->flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE)
906 ctx->vidcon1 |= VIDCON1_INV_VCLK;
907
928 return 0; 908 return 0;
929} 909}
930 910
@@ -937,6 +917,9 @@ static int fimd_probe(struct platform_device *pdev)
937 int win; 917 int win;
938 int ret = -EINVAL; 918 int ret = -EINVAL;
939 919
920 if (!dev->of_node)
921 return -ENODEV;
922
940 ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); 923 ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
941 if (!ctx) 924 if (!ctx)
942 return -ENOMEM; 925 return -ENOMEM;
@@ -1076,20 +1059,6 @@ static int fimd_runtime_resume(struct device *dev)
1076} 1059}
1077#endif 1060#endif
1078 1061
1079static struct platform_device_id fimd_driver_ids[] = {
1080 {
1081 .name = "s3c64xx-fb",
1082 .driver_data = (unsigned long)&s3c64xx_fimd_driver_data,
1083 }, {
1084 .name = "exynos4-fb",
1085 .driver_data = (unsigned long)&exynos4_fimd_driver_data,
1086 }, {
1087 .name = "exynos5-fb",
1088 .driver_data = (unsigned long)&exynos5_fimd_driver_data,
1089 },
1090 {},
1091};
1092
1093static const struct dev_pm_ops fimd_pm_ops = { 1062static const struct dev_pm_ops fimd_pm_ops = {
1094 SET_SYSTEM_SLEEP_PM_OPS(fimd_suspend, fimd_resume) 1063 SET_SYSTEM_SLEEP_PM_OPS(fimd_suspend, fimd_resume)
1095 SET_RUNTIME_PM_OPS(fimd_runtime_suspend, fimd_runtime_resume, NULL) 1064 SET_RUNTIME_PM_OPS(fimd_runtime_suspend, fimd_runtime_resume, NULL)
@@ -1098,11 +1067,10 @@ static const struct dev_pm_ops fimd_pm_ops = {
1098struct platform_driver fimd_driver = { 1067struct platform_driver fimd_driver = {
1099 .probe = fimd_probe, 1068 .probe = fimd_probe,
1100 .remove = fimd_remove, 1069 .remove = fimd_remove,
1101 .id_table = fimd_driver_ids,
1102 .driver = { 1070 .driver = {
1103 .name = "exynos4-fb", 1071 .name = "exynos4-fb",
1104 .owner = THIS_MODULE, 1072 .owner = THIS_MODULE,
1105 .pm = &fimd_pm_ops, 1073 .pm = &fimd_pm_ops,
1106 .of_match_table = of_match_ptr(fimd_driver_dt_match), 1074 .of_match_table = fimd_driver_dt_match,
1107 }, 1075 },
1108}; 1076};