mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 10:49:33 +00:00
drm/exynos: support device tree for fimd
This adds the of_match_table to exynos-drm fimd driver to be probed from the device tree. Changelog v2: - fix build error without CONFIG_OF. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
This commit is contained in:
parent
ca555e5ab7
commit
d636ead86f
1 changed files with 21 additions and 0 deletions
|
@ -17,6 +17,7 @@
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/clk.h>
|
#include <linux/clk.h>
|
||||||
|
#include <linux/of_device.h>
|
||||||
#include <linux/pm_runtime.h>
|
#include <linux/pm_runtime.h>
|
||||||
|
|
||||||
#include <video/samsung_fimd.h>
|
#include <video/samsung_fimd.h>
|
||||||
|
@ -106,9 +107,28 @@ struct fimd_context {
|
||||||
struct exynos_drm_panel_info *panel;
|
struct exynos_drm_panel_info *panel;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef CONFIG_OF
|
||||||
|
static const struct of_device_id fimd_driver_dt_match[] = {
|
||||||
|
{ .compatible = "samsung,exynos4-fimd",
|
||||||
|
.data = &exynos4_fimd_driver_data },
|
||||||
|
{ .compatible = "samsung,exynos5-fimd",
|
||||||
|
.data = &exynos5_fimd_driver_data },
|
||||||
|
{},
|
||||||
|
};
|
||||||
|
MODULE_DEVICE_TABLE(of, fimd_driver_dt_match);
|
||||||
|
#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 =
|
||||||
|
of_match_device(fimd_driver_dt_match, &pdev->dev);
|
||||||
|
|
||||||
|
if (of_id)
|
||||||
|
return (struct fimd_driver_data *)of_id->data;
|
||||||
|
#endif
|
||||||
|
|
||||||
return (struct fimd_driver_data *)
|
return (struct fimd_driver_data *)
|
||||||
platform_get_device_id(pdev)->driver_data;
|
platform_get_device_id(pdev)->driver_data;
|
||||||
}
|
}
|
||||||
|
@ -1091,5 +1111,6 @@ struct platform_driver fimd_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),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue