aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mxs/mach-mxs.c
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2012-06-25 09:21:46 -0400
committerShawn Guo <shawn.guo@linaro.org>2012-07-03 01:22:37 -0400
commitab2815c3997b179f043a747264d155ab0bc181ad (patch)
treed624be8a71255acaf08cb189ad51266058609e65 /arch/arm/mach-mxs/mach-mxs.c
parent73fc610f9a891fd777040bbb1854ae0b58edee9c (diff)
ARM: mxs: use auxdata to attach mxsfb_platform_data
Use auxdata to attach mxsfb_platform_data for imx23-evk and imx28-evk. We take this as a temporary solution for removing those board files, and it should be updated to use common bindings for struct fb_videomode when it becomes available. Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-mxs/mach-mxs.c')
-rw-r--r--arch/arm/mach-mxs/mach-mxs.c62
1 files changed, 61 insertions, 1 deletions
diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c
index 8d764f20d4b7..87a4829ec083 100644
--- a/arch/arm/mach-mxs/mach-mxs.c
+++ b/arch/arm/mach-mxs/mach-mxs.c
@@ -16,12 +16,57 @@
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/irqdomain.h> 18#include <linux/irqdomain.h>
19#include <linux/mxsfb.h>
19#include <linux/of_irq.h> 20#include <linux/of_irq.h>
20#include <linux/of_platform.h> 21#include <linux/of_platform.h>
21#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
22#include <asm/mach/time.h> 23#include <asm/mach/time.h>
23#include <mach/common.h> 24#include <mach/common.h>
24 25
26static struct fb_videomode mx23evk_video_modes[] = {
27 {
28 .name = "Samsung-LMS430HF02",
29 .refresh = 60,
30 .xres = 480,
31 .yres = 272,
32 .pixclock = 108096, /* picosecond (9.2 MHz) */
33 .left_margin = 15,
34 .right_margin = 8,
35 .upper_margin = 12,
36 .lower_margin = 4,
37 .hsync_len = 1,
38 .vsync_len = 1,
39 .sync = FB_SYNC_DATA_ENABLE_HIGH_ACT |
40 FB_SYNC_DOTCLK_FAILING_ACT,
41 },
42};
43
44static struct fb_videomode mx28evk_video_modes[] = {
45 {
46 .name = "Seiko-43WVF1G",
47 .refresh = 60,
48 .xres = 800,
49 .yres = 480,
50 .pixclock = 29851, /* picosecond (33.5 MHz) */
51 .left_margin = 89,
52 .right_margin = 164,
53 .upper_margin = 23,
54 .lower_margin = 10,
55 .hsync_len = 10,
56 .vsync_len = 10,
57 .sync = FB_SYNC_DATA_ENABLE_HIGH_ACT |
58 FB_SYNC_DOTCLK_FAILING_ACT,
59 },
60};
61
62static struct mxsfb_platform_data mxsfb_pdata __initdata;
63
64static struct of_dev_auxdata mxs_auxdata_lookup[] __initdata = {
65 OF_DEV_AUXDATA("fsl,imx23-lcdif", 0x80030000, NULL, &mxsfb_pdata),
66 OF_DEV_AUXDATA("fsl,imx28-lcdif", 0x80030000, NULL, &mxsfb_pdata),
67 { /* sentinel */ }
68};
69
25static int __init mxs_icoll_add_irq_domain(struct device_node *np, 70static int __init mxs_icoll_add_irq_domain(struct device_node *np,
26 struct device_node *interrupt_parent) 71 struct device_node *interrupt_parent)
27{ 72{
@@ -133,6 +178,14 @@ static void __init update_fec_mac_prop(enum mac_oui oui)
133 } 178 }
134} 179}
135 180
181static void __init imx23_evk_init(void)
182{
183 mxsfb_pdata.mode_list = mx23evk_video_modes;
184 mxsfb_pdata.mode_count = ARRAY_SIZE(mx23evk_video_modes);
185 mxsfb_pdata.default_bpp = 32;
186 mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT;
187}
188
136static void __init imx28_evk_init(void) 189static void __init imx28_evk_init(void)
137{ 190{
138 struct clk *clk; 191 struct clk *clk;
@@ -143,15 +196,22 @@ static void __init imx28_evk_init(void)
143 clk_prepare_enable(clk); 196 clk_prepare_enable(clk);
144 197
145 update_fec_mac_prop(OUI_FSL); 198 update_fec_mac_prop(OUI_FSL);
199
200 mxsfb_pdata.mode_list = mx28evk_video_modes;
201 mxsfb_pdata.mode_count = ARRAY_SIZE(mx28evk_video_modes);
202 mxsfb_pdata.default_bpp = 32;
203 mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT;
146} 204}
147 205
148static void __init mxs_machine_init(void) 206static void __init mxs_machine_init(void)
149{ 207{
150 if (of_machine_is_compatible("fsl,imx28-evk")) 208 if (of_machine_is_compatible("fsl,imx28-evk"))
151 imx28_evk_init(); 209 imx28_evk_init();
210 else if (of_machine_is_compatible("fsl,imx23-evk"))
211 imx23_evk_init();
152 212
153 of_platform_populate(NULL, of_default_bus_match_table, 213 of_platform_populate(NULL, of_default_bus_match_table,
154 NULL, NULL); 214 mxs_auxdata_lookup, NULL);
155} 215}
156 216
157static const char *imx23_dt_compat[] __initdata = { 217static const char *imx23_dt_compat[] __initdata = {