Skip to content

Commit 2d3f173

Browse files
Sachin Kamatdaeinki
authored andcommitted
drm/exynos: Remove non-DT support in exynos_drm_fimd
Since commit 383ffda ("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 <[email protected]> Signed-off-by: Inki Dae <[email protected]>
1 parent 88c4981 commit 2d3f173

File tree

1 file changed

+21
-53
lines changed

1 file changed

+21
-53
lines changed

drivers/gpu/drm/exynos/exynos_drm_fimd.c

Lines changed: 21 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ struct fimd_context {
126126
struct fimd_driver_data *driver_data;
127127
};
128128

129-
#ifdef CONFIG_OF
130129
static const struct of_device_id fimd_driver_dt_match[] = {
131130
{ .compatible = "samsung,s3c6400-fimd",
132131
.data = &s3c64xx_fimd_driver_data },
@@ -136,21 +135,14 @@ static const struct of_device_id fimd_driver_dt_match[] = {
136135
.data = &exynos5_fimd_driver_data },
137136
{},
138137
};
139-
#endif
140138

141139
static inline struct fimd_driver_data *drm_fimd_get_driver_data(
142140
struct platform_device *pdev)
143141
{
144-
#ifdef CONFIG_OF
145142
const struct of_device_id *of_id =
146143
of_match_device(fimd_driver_dt_match, &pdev->dev);
147144

148-
if (of_id)
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;
145+
return (struct fimd_driver_data *)of_id->data;
154146
}
155147

156148
static bool fimd_display_is_connected(struct device *dev)
@@ -894,37 +886,25 @@ static int fimd_activate(struct fimd_context *ctx, bool enable)
894886

895887
static int fimd_get_platform_data(struct fimd_context *ctx, struct device *dev)
896888
{
897-
if (dev->of_node) {
898-
struct videomode *vm;
899-
int ret;
889+
struct videomode *vm;
890+
int ret;
900891

901-
vm = &ctx->panel.vm;
902-
ret = of_get_videomode(dev->of_node, vm, OF_USE_NATIVE_MODE);
903-
if (ret) {
904-
DRM_ERROR("failed: of_get_videomode() : %d\n", ret);
905-
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;
892+
vm = &ctx->panel.vm;
893+
ret = of_get_videomode(dev->of_node, vm, OF_USE_NATIVE_MODE);
894+
if (ret) {
895+
DRM_ERROR("failed: of_get_videomode() : %d\n", ret);
896+
return ret;
926897
}
927898

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+
928908
return 0;
929909
}
930910

@@ -937,6 +917,9 @@ static int fimd_probe(struct platform_device *pdev)
937917
int win;
938918
int ret = -EINVAL;
939919

920+
if (!dev->of_node)
921+
return -ENODEV;
922+
940923
ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
941924
if (!ctx)
942925
return -ENOMEM;
@@ -1076,20 +1059,6 @@ static int fimd_runtime_resume(struct device *dev)
10761059
}
10771060
#endif
10781061

1079-
static 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-
10931062
static const struct dev_pm_ops fimd_pm_ops = {
10941063
SET_SYSTEM_SLEEP_PM_OPS(fimd_suspend, fimd_resume)
10951064
SET_RUNTIME_PM_OPS(fimd_runtime_suspend, fimd_runtime_resume, NULL)
@@ -1098,11 +1067,10 @@ static const struct dev_pm_ops fimd_pm_ops = {
10981067
struct platform_driver fimd_driver = {
10991068
.probe = fimd_probe,
11001069
.remove = fimd_remove,
1101-
.id_table = fimd_driver_ids,
11021070
.driver = {
11031071
.name = "exynos4-fb",
11041072
.owner = THIS_MODULE,
11051073
.pm = &fimd_pm_ops,
1106-
.of_match_table = of_match_ptr(fimd_driver_dt_match),
1074+
.of_match_table = fimd_driver_dt_match,
11071075
},
11081076
};

0 commit comments

Comments
 (0)