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>
This commit is contained in:
parent
88c4981542
commit
2d3f173cf7
|
@ -126,7 +126,6 @@ struct fimd_context {
|
||||||
struct fimd_driver_data *driver_data;
|
struct fimd_driver_data *driver_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_OF
|
|
||||||
static const struct of_device_id fimd_driver_dt_match[] = {
|
static const struct of_device_id fimd_driver_dt_match[] = {
|
||||||
{ .compatible = "samsung,s3c6400-fimd",
|
{ .compatible = "samsung,s3c6400-fimd",
|
||||||
.data = &s3c64xx_fimd_driver_data },
|
.data = &s3c64xx_fimd_driver_data },
|
||||||
|
@ -136,21 +135,14 @@ static const struct of_device_id fimd_driver_dt_match[] = {
|
||||||
.data = &exynos5_fimd_driver_data },
|
.data = &exynos5_fimd_driver_data },
|
||||||
{},
|
{},
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline struct fimd_driver_data *drm_fimd_get_driver_data(
|
static inline struct fimd_driver_data *drm_fimd_get_driver_data(
|
||||||
struct platform_device *pdev)
|
struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_OF
|
|
||||||
const struct of_device_id *of_id =
|
const struct of_device_id *of_id =
|
||||||
of_match_device(fimd_driver_dt_match, &pdev->dev);
|
of_match_device(fimd_driver_dt_match, &pdev->dev);
|
||||||
|
|
||||||
if (of_id)
|
return (struct fimd_driver_data *)of_id->data;
|
||||||
return (struct fimd_driver_data *)of_id->data;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return (struct fimd_driver_data *)
|
|
||||||
platform_get_device_id(pdev)->driver_data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool fimd_display_is_connected(struct device *dev)
|
static bool fimd_display_is_connected(struct device *dev)
|
||||||
|
@ -894,37 +886,25 @@ static int fimd_activate(struct fimd_context *ctx, bool enable)
|
||||||
|
|
||||||
static int fimd_get_platform_data(struct fimd_context *ctx, struct device *dev)
|
static int fimd_get_platform_data(struct fimd_context *ctx, struct device *dev)
|
||||||
{
|
{
|
||||||
if (dev->of_node) {
|
struct videomode *vm;
|
||||||
struct videomode *vm;
|
int ret;
|
||||||
int ret;
|
|
||||||
|
|
||||||
vm = &ctx->panel.vm;
|
vm = &ctx->panel.vm;
|
||||||
ret = of_get_videomode(dev->of_node, vm, OF_USE_NATIVE_MODE);
|
ret = of_get_videomode(dev->of_node, vm, OF_USE_NATIVE_MODE);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
DRM_ERROR("failed: of_get_videomode() : %d\n", ret);
|
DRM_ERROR("failed: of_get_videomode() : %d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
|
||||||
|
|
||||||
if (vm->flags & DISPLAY_FLAGS_VSYNC_LOW)
|
|
||||||
ctx->vidcon1 |= VIDCON1_INV_VSYNC;
|
|
||||||
if (vm->flags & DISPLAY_FLAGS_HSYNC_LOW)
|
|
||||||
ctx->vidcon1 |= VIDCON1_INV_HSYNC;
|
|
||||||
if (vm->flags & DISPLAY_FLAGS_DE_LOW)
|
|
||||||
ctx->vidcon1 |= VIDCON1_INV_VDEN;
|
|
||||||
if (vm->flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE)
|
|
||||||
ctx->vidcon1 |= VIDCON1_INV_VCLK;
|
|
||||||
} else {
|
|
||||||
struct exynos_drm_fimd_pdata *pdata = dev->platform_data;
|
|
||||||
if (!pdata) {
|
|
||||||
DRM_ERROR("no platform data specified\n");
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
ctx->vidcon0 = pdata->vidcon0;
|
|
||||||
ctx->vidcon1 = pdata->vidcon1;
|
|
||||||
ctx->default_win = pdata->default_win;
|
|
||||||
ctx->panel = pdata->panel;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (vm->flags & DISPLAY_FLAGS_VSYNC_LOW)
|
||||||
|
ctx->vidcon1 |= VIDCON1_INV_VSYNC;
|
||||||
|
if (vm->flags & DISPLAY_FLAGS_HSYNC_LOW)
|
||||||
|
ctx->vidcon1 |= VIDCON1_INV_HSYNC;
|
||||||
|
if (vm->flags & DISPLAY_FLAGS_DE_LOW)
|
||||||
|
ctx->vidcon1 |= VIDCON1_INV_VDEN;
|
||||||
|
if (vm->flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE)
|
||||||
|
ctx->vidcon1 |= VIDCON1_INV_VCLK;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -937,6 +917,9 @@ static int fimd_probe(struct platform_device *pdev)
|
||||||
int win;
|
int win;
|
||||||
int ret = -EINVAL;
|
int ret = -EINVAL;
|
||||||
|
|
||||||
|
if (!dev->of_node)
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
|
ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
|
||||||
if (!ctx)
|
if (!ctx)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
@ -1076,20 +1059,6 @@ static int fimd_runtime_resume(struct device *dev)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static struct platform_device_id fimd_driver_ids[] = {
|
|
||||||
{
|
|
||||||
.name = "s3c64xx-fb",
|
|
||||||
.driver_data = (unsigned long)&s3c64xx_fimd_driver_data,
|
|
||||||
}, {
|
|
||||||
.name = "exynos4-fb",
|
|
||||||
.driver_data = (unsigned long)&exynos4_fimd_driver_data,
|
|
||||||
}, {
|
|
||||||
.name = "exynos5-fb",
|
|
||||||
.driver_data = (unsigned long)&exynos5_fimd_driver_data,
|
|
||||||
},
|
|
||||||
{},
|
|
||||||
};
|
|
||||||
|
|
||||||
static const struct dev_pm_ops fimd_pm_ops = {
|
static const struct dev_pm_ops fimd_pm_ops = {
|
||||||
SET_SYSTEM_SLEEP_PM_OPS(fimd_suspend, fimd_resume)
|
SET_SYSTEM_SLEEP_PM_OPS(fimd_suspend, fimd_resume)
|
||||||
SET_RUNTIME_PM_OPS(fimd_runtime_suspend, fimd_runtime_resume, NULL)
|
SET_RUNTIME_PM_OPS(fimd_runtime_suspend, fimd_runtime_resume, NULL)
|
||||||
|
@ -1098,11 +1067,10 @@ static const struct dev_pm_ops fimd_pm_ops = {
|
||||||
struct platform_driver fimd_driver = {
|
struct platform_driver fimd_driver = {
|
||||||
.probe = fimd_probe,
|
.probe = fimd_probe,
|
||||||
.remove = fimd_remove,
|
.remove = fimd_remove,
|
||||||
.id_table = fimd_driver_ids,
|
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "exynos4-fb",
|
.name = "exynos4-fb",
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.pm = &fimd_pm_ops,
|
.pm = &fimd_pm_ops,
|
||||||
.of_match_table = of_match_ptr(fimd_driver_dt_match),
|
.of_match_table = fimd_driver_dt_match,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue