aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/e800.c
diff options
context:
space:
mode:
authorIan Molton <spyro@f2s.com>2008-08-19 08:01:28 -0400
committerIan Molton <spyro@f2s.com>2008-08-19 08:44:07 -0400
commit0ec3cf69304d2e35ad29da3aa9ab43c3dd97677c (patch)
tree5c4cfa67f4f015da30aa7a49071c74f314c0c8d6 /arch/arm/mach-pxa/e800.c
parent7dc964148c2850e5df84fc17807ba48edb628c88 (diff)
[ARM] eseries: move LCD defs into machine files
This patch removes the seperate files used for the LCD definitions on e-series and places the definitions into the machine specific files. Signed-off-by: Ian Molton <spyro@f2s.com>
Diffstat (limited to 'arch/arm/mach-pxa/e800.c')
-rw-r--r--arch/arm/mach-pxa/e800.c139
1 files changed, 139 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/e800.c b/arch/arm/mach-pxa/e800.c
index 77ebe91c3e65..2f5e9061954b 100644
--- a/arch/arm/mach-pxa/e800.c
+++ b/arch/arm/mach-pxa/e800.c
@@ -12,6 +12,11 @@
12 12
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/device.h>
16#include <linux/platform_device.h>
17#include <linux/fb.h>
18
19#include <video/w100fb.h>
15 20
16#include <asm/setup.h> 21#include <asm/setup.h>
17#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
@@ -23,6 +28,139 @@
23#include "generic.h" 28#include "generic.h"
24#include "eseries.h" 29#include "eseries.h"
25 30
31/* ------------------------ e800 LCD definitions ------------------------- */
32
33static struct w100_gen_regs e800_lcd_regs = {
34 .lcd_format = 0x00008003,
35 .lcdd_cntl1 = 0x02a00000,
36 .lcdd_cntl2 = 0x0003ffff,
37 .genlcd_cntl1 = 0x000ff2a3,
38 .genlcd_cntl2 = 0x000002a3,
39 .genlcd_cntl3 = 0x000102aa,
40};
41
42static struct w100_mode e800_lcd_mode[2] = {
43 [0] = {
44 .xres = 480,
45 .yres = 640,
46 .left_margin = 52,
47 .right_margin = 148,
48 .upper_margin = 2,
49 .lower_margin = 6,
50 .crtc_ss = 0x80350034,
51 .crtc_ls = 0x802b0026,
52 .crtc_gs = 0x80160016,
53 .crtc_vpos_gs = 0x00020003,
54 .crtc_rev = 0x0040001d,
55 .crtc_dclk = 0xe0000000,
56 .crtc_gclk = 0x82a50049,
57 .crtc_goe = 0x80ee001c,
58 .crtc_ps1_active = 0x00000000,
59 .pll_freq = 128,
60 .pixclk_divider = 4,
61 .pixclk_divider_rotated = 6,
62 .pixclk_src = CLK_SRC_PLL,
63 .sysclk_divider = 0,
64 .sysclk_src = CLK_SRC_PLL,
65 },
66 [1] = {
67 .xres = 240,
68 .yres = 320,
69 .left_margin = 15,
70 .right_margin = 88,
71 .upper_margin = 0,
72 .lower_margin = 7,
73 .crtc_ss = 0xd010000f,
74 .crtc_ls = 0x80070003,
75 .crtc_gs = 0x80000000,
76 .crtc_vpos_gs = 0x01460147,
77 .crtc_rev = 0x00400003,
78 .crtc_dclk = 0xa1700030,
79 .crtc_gclk = 0x814b0008,
80 .crtc_goe = 0x80cc0015,
81 .crtc_ps1_active = 0x00000000,
82 .pll_freq = 100,
83 .pixclk_divider = 6, /* Wince uses 14 which gives a */
84 .pixclk_divider_rotated = 6, /* 7MHz Pclk. We use a 14MHz one */
85 .pixclk_src = CLK_SRC_PLL,
86 .sysclk_divider = 0,
87 .sysclk_src = CLK_SRC_PLL,
88 }
89};
90
91
92static struct w100_gpio_regs e800_w100_gpio_info = {
93 .init_data1 = 0xc13fc019,
94 .gpio_dir1 = 0x3e40df7f,
95 .gpio_oe1 = 0x003c3000,
96 .init_data2 = 0x00000000,
97 .gpio_dir2 = 0x00000000,
98 .gpio_oe2 = 0x00000000,
99};
100
101static struct w100_mem_info e800_w100_mem_info = {
102 .ext_cntl = 0x09640011,
103 .sdram_mode_reg = 0x00600021,
104 .ext_timing_cntl = 0x10001545,
105 .io_cntl = 0x7ddd7333,
106 .size = 0x1fffff,
107};
108
109static void e800_tg_change(struct w100fb_par *par)
110{
111 unsigned long tmp;
112
113 tmp = w100fb_gpio_read(W100_GPIO_PORT_A);
114 if (par->mode->xres == 480)
115 tmp |= 0x100;
116 else
117 tmp &= ~0x100;
118 w100fb_gpio_write(W100_GPIO_PORT_A, tmp);
119}
120
121static struct w100_tg_info e800_tg_info = {
122 .change = e800_tg_change,
123};
124
125static struct w100fb_mach_info e800_fb_info = {
126 .modelist = e800_lcd_mode,
127 .num_modes = 2,
128 .regs = &e800_lcd_regs,
129 .gpio = &e800_w100_gpio_info,
130 .mem = &e800_w100_mem_info,
131 .tg = &e800_tg_info,
132 .xtal_freq = 16000000,
133};
134
135static struct resource e800_fb_resources[] = {
136 [0] = {
137 .start = 0x0c000000,
138 .end = 0x0cffffff,
139 .flags = IORESOURCE_MEM,
140 },
141};
142
143static struct platform_device e800_fb_device = {
144 .name = "w100fb",
145 .id = -1,
146 .dev = {
147 .platform_data = &e800_fb_info,
148 },
149 .num_resources = ARRAY_SIZE(e800_fb_resources),
150 .resource = e800_fb_resources,
151};
152
153/* ----------------------------------------------------------------------- */
154
155static struct platform_device *devices[] __initdata = {
156 &e800_fb_device,
157};
158
159static void __init e800_init(void)
160{
161 platform_add_devices(devices, ARRAY_SIZE(devices));
162}
163
26MACHINE_START(E800, "Toshiba e800") 164MACHINE_START(E800, "Toshiba e800")
27 /* Maintainer: Ian Molton (spyro@f2s.com) */ 165 /* Maintainer: Ian Molton (spyro@f2s.com) */
28 .phys_io = 0x40000000, 166 .phys_io = 0x40000000,
@@ -31,6 +169,7 @@ MACHINE_START(E800, "Toshiba e800")
31 .map_io = pxa_map_io, 169 .map_io = pxa_map_io,
32 .init_irq = pxa25x_init_irq, 170 .init_irq = pxa25x_init_irq,
33 .fixup = eseries_fixup, 171 .fixup = eseries_fixup,
172 .init_machine = e800_init,
34 .timer = &pxa_timer, 173 .timer = &pxa_timer,
35MACHINE_END 174MACHINE_END
36 175