@@ -126,7 +126,6 @@ struct fimd_context {
126
126
struct fimd_driver_data * driver_data ;
127
127
};
128
128
129
- #ifdef CONFIG_OF
130
129
static const struct of_device_id fimd_driver_dt_match [] = {
131
130
{ .compatible = "samsung,s3c6400-fimd" ,
132
131
.data = & s3c64xx_fimd_driver_data },
@@ -136,21 +135,14 @@ static const struct of_device_id fimd_driver_dt_match[] = {
136
135
.data = & exynos5_fimd_driver_data },
137
136
{},
138
137
};
139
- #endif
140
138
141
139
static inline struct fimd_driver_data * drm_fimd_get_driver_data (
142
140
struct platform_device * pdev )
143
141
{
144
- #ifdef CONFIG_OF
145
142
const struct of_device_id * of_id =
146
143
of_match_device (fimd_driver_dt_match , & pdev -> dev );
147
144
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 ;
154
146
}
155
147
156
148
static bool fimd_display_is_connected (struct device * dev )
@@ -894,37 +886,25 @@ static int fimd_activate(struct fimd_context *ctx, bool enable)
894
886
895
887
static int fimd_get_platform_data (struct fimd_context * ctx , struct device * dev )
896
888
{
897
- if (dev -> of_node ) {
898
- struct videomode * vm ;
899
- int ret ;
889
+ struct videomode * vm ;
890
+ int ret ;
900
891
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 ;
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
908
return 0 ;
929
909
}
930
910
@@ -937,6 +917,9 @@ static int fimd_probe(struct platform_device *pdev)
937
917
int win ;
938
918
int ret = - EINVAL ;
939
919
920
+ if (!dev -> of_node )
921
+ return - ENODEV ;
922
+
940
923
ctx = devm_kzalloc (dev , sizeof (* ctx ), GFP_KERNEL );
941
924
if (!ctx )
942
925
return - ENOMEM ;
@@ -1076,20 +1059,6 @@ static int fimd_runtime_resume(struct device *dev)
1076
1059
}
1077
1060
#endif
1078
1061
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
-
1093
1062
static const struct dev_pm_ops fimd_pm_ops = {
1094
1063
SET_SYSTEM_SLEEP_PM_OPS (fimd_suspend , fimd_resume )
1095
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 = {
1098
1067
struct platform_driver fimd_driver = {
1099
1068
.probe = fimd_probe ,
1100
1069
.remove = fimd_remove ,
1101
- .id_table = fimd_driver_ids ,
1102
1070
.driver = {
1103
1071
.name = "exynos4-fb" ,
1104
1072
.owner = THIS_MODULE ,
1105
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
};
0 commit comments