5 * This file contains the definitions for the LCD timings and functions
6 * to control the LCD power / frontlighting via the w100fb driver.
10 #include <linux/module.h>
11 #include <linux/init.h>
12 #include <linux/kernel.h>
13 #include <linux/tty.h>
14 #include <linux/sched.h>
15 #include <linux/delay.h>
17 #include <linux/lcd.h>
18 #include <linux/backlight.h>
20 #include <linux/err.h>
21 #include <linux/platform_device.h>
24 #include <asm/mach-types.h>
25 #include <asm/hardware.h>
26 #include <asm/setup.h>
28 #include <asm/mach/arch.h>
29 #include <asm/arch/pxa-regs.h>
30 #include <asm/arch/eseries-gpio.h>
32 #include <video/w100fb.h>
34 static struct w100_gen_regs e800_lcd_regs
= {
35 .lcd_format
= 0x00008003,
36 .lcdd_cntl1
= 0x02a00000,
37 .lcdd_cntl2
= 0x0003ffff,
38 .genlcd_cntl1
= 0x000ff2a3,
39 .genlcd_cntl2
= 0x000002a3,
40 .genlcd_cntl3
= 0x000102aa,
43 static struct w100_mode e800_lcd_mode
[2] = {
51 .crtc_ss
= 0x80350034,
52 .crtc_ls
= 0x802b0026,
53 .crtc_gs
= 0x80160016,
54 .crtc_vpos_gs
= 0x00020003,
55 .crtc_rev
= 0x0040001d,
56 .crtc_dclk
= 0xe0000000,
57 .crtc_gclk
= 0x82a50049,
58 .crtc_goe
= 0x80ee001c,
59 .crtc_ps1_active
= 0x00000000,
62 .pixclk_divider_rotated
= 6,
63 .pixclk_src
= CLK_SRC_PLL
,
65 .sysclk_src
= CLK_SRC_PLL
,
75 .crtc_ss
= 0xd010000f,
76 .crtc_ls
= 0x80070003,
77 .crtc_gs
= 0x80000000,
78 .crtc_vpos_gs
= 0x01460147,
79 .crtc_rev
= 0x00400003,
80 .crtc_dclk
= 0xa1700030,
81 .crtc_gclk
= 0x814b0008,
82 .crtc_goe
= 0x80cc0015,
83 .crtc_ps1_active
= 0x00000000,
85 .pixclk_divider
= 6, // Wince uses 14 which gives a 7MHz pclk.
86 .pixclk_divider_rotated
= 6, // we want a 14MHz one (much nicer to look at)
87 .pixclk_src
= CLK_SRC_PLL
,
89 .sysclk_src
= CLK_SRC_PLL
,
94 static struct w100_gpio_regs e800_w100_gpio_info
= {
95 .init_data1
= 0xc13fc019,
96 .gpio_dir1
= 0x3e40df7f,
97 .gpio_oe1
= 0x003c3000,
98 .init_data2
= 0x00000000,
99 .gpio_dir2
= 0x00000000,
100 .gpio_oe2
= 0x00000000,
103 static struct w100_mem_info e800_w100_mem_info
= {
104 .ext_cntl
= 0x09640011,
105 .sdram_mode_reg
= 0x00600021,
106 .ext_timing_cntl
= 0x10001545,
107 .io_cntl
= 0x7ddd7333,
111 static void e800_tg_change(struct w100fb_par
*par
) {
114 tmp
= w100fb_gpio_read(W100_GPIO_PORT_A
);
115 if(par
->mode
->xres
== 480)
119 w100fb_gpio_write(W100_GPIO_PORT_A
, tmp
);
122 static struct w100_tg_info e800_tg_info
= {
123 .change
= e800_tg_change
,
126 static struct w100fb_mach_info e800_fb_info
= {
127 .modelist
= e800_lcd_mode
,
129 .regs
= &e800_lcd_regs
,
130 .gpio
= &e800_w100_gpio_info
,
131 .mem
= &e800_w100_mem_info
,
133 .xtal_freq
= 16000000,
136 static struct resource e800_fb_resources
[] = {
140 .flags
= IORESOURCE_MEM
,
144 /* ----------------------- device declarations -------------------------- */
147 static struct platform_device e800_fb_device
= {
151 .platform_data
= &e800_fb_info
,
153 .num_resources
= ARRAY_SIZE(e800_fb_resources
),
154 .resource
= e800_fb_resources
,
158 static struct platform_device e800_lcd_hook_device
= {
159 .name
= "e800-lcd-hook",
161 .parent
= &e800_fb_device
.dev
,
167 static int e800_lcd_init (void) {
170 if (!machine_is_e800 ())
173 if((ret
= platform_device_register(&e800_fb_device
)))
176 // platform_device_register(&e800_lcd_hook_device);
181 static void e800_lcd_exit (void)
183 //FIXME - free the platform dev for the w100 (imageon)
186 module_init (e800_lcd_init
);
187 module_exit (e800_lcd_exit
);
189 MODULE_AUTHOR("Ian Molton <spyro@f2s.com>");
190 MODULE_DESCRIPTION("e800 lcd driver");
191 MODULE_LICENSE("GPLv2");