@@ -876,6 +876,8 @@ static int fimd_probe(struct platform_device *pdev)
struct fimd_context *ctx;
struct exynos_drm_subdrv *subdrv;
struct exynos_drm_fimd_pdata *pdata;
+ struct fb_videomode *fbmode;
+ struct device *disp_dev = &pdev->dev;
struct exynos_drm_panel_info *panel;
struct resource *res;
int win;
@@ -883,10 +885,31 @@ static int fimd_probe(struct platform_device *pdev)
DRM_DEBUG_KMS("%s\n", __FILE__);
- pdata = pdev->dev.platform_data;
- if (!pdata) {
- dev_err(dev, "no platform data specified\n");
- return -EINVAL;
+ if (pdev->dev.of_node) {
+ pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+ if (!pdata) {
+ DRM_ERROR("memory allocation for pdata failed\n");
+ return -ENOMEM;
+ }
+
+ fbmode = devm_kzalloc(dev, sizeof(*fbmode), GFP_KERNEL);
+ if (!fbmode) {
+ DRM_ERROR("memory allocation for fbmode failed\n");
+ return -ENOMEM;
+ }
+
+ ret = of_get_fb_videomode(disp_dev->of_node, fbmode, -1);
+ if (ret) {
+ DRM_ERROR("failed to get fb_videomode\n");
+ return -EINVAL;
+ }
+ pdata->panel.timing = (struct fb_videomode) *fbmode;
+ } else {
+ pdata = pdev->dev.platform_data;
+ if (!pdata) {
+ DRM_ERROR("no platform data specified\n");
+ return -EINVAL;
+ }
}
panel = &pdata->panel;