diff options
author | Ajay Kumar <ajaykumar.rs@samsung.com> | 2013-02-21 23:53:01 +0000 |
---|---|---|
committer | Minkyu Kang <mk7.kang@samsung.com> | 2013-03-27 21:17:29 +0900 |
commit | c23f3157d69bbb6c044256870f745f195b12431e (patch) | |
tree | ba493f75e0b8d6d1403b33e9893a05459c40c3e7 /drivers/video/exynos_fimd.c | |
parent | d7377b5193d23c71f59aa310ee5202a073f790ea (diff) |
video: exynos_fb: add DT support for FIMD driver
Add function to parse FIMD data from device tree.
The driver still supports non-DT case.
Define panel_info statically in some file if you are not using DT.
If you have defined DT node for FIMD, panel_info will be filled
using the bindings of FIMD DT node.
Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Diffstat (limited to 'drivers/video/exynos_fimd.c')
-rw-r--r-- | drivers/video/exynos_fimd.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/video/exynos_fimd.c b/drivers/video/exynos_fimd.c index 675d9e17758..33599499ee2 100644 --- a/drivers/video/exynos_fimd.c +++ b/drivers/video/exynos_fimd.c @@ -25,11 +25,15 @@ #include <asm/io.h> #include <lcd.h> #include <div64.h> +#include <fdtdec.h> +#include <libfdt.h> #include <asm/arch/clk.h> #include <asm/arch/clock.h> #include <asm/arch/cpu.h> #include "exynos_fb.h" +DECLARE_GLOBAL_DATA_PTR; + static unsigned long *lcd_base_addr; static vidinfo_t *pvid; static struct exynos_fb *fimd_ctrl; @@ -264,6 +268,19 @@ void exynos_fimd_lcd_init(vidinfo_t *vid) { unsigned int cfg = 0, rgb_mode; unsigned int offset; +#ifdef CONFIG_OF_CONTROL + unsigned int node; + + node = fdtdec_next_compatible(gd->fdt_blob, + 0, COMPAT_SAMSUNG_EXYNOS_FIMD); + if (node <= 0) + debug("exynos_fb: Can't get device node for fimd\n"); + + fimd_ctrl = (struct exynos_fb *)fdtdec_get_addr(gd->fdt_blob, + node, "reg"); + if (fimd_ctrl == NULL) + debug("Can't get the FIMD base address\n"); +#endif fimd_ctrl = (struct exynos_fb *)samsung_get_base_fimd(); offset = exynos_fimd_get_base_offset(); |