3 * This file contains the definitions for the LCD timings and functions
4 * to control the LCD power / frontlighting via the w100fb driver.
6 * (c) 2005 Ian Molton <spyro@f2s.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
14 #include <linux/module.h>
15 #include <linux/device.h>
17 #include <linux/err.h>
18 #include <linux/platform_device.h>
20 #include <asm/mach-types.h>
22 #include <video/w100fb.h>
25 **potential** shutdown routine - to be investigated
26 devmem2 0x0c010528 w 0xff3fff00
27 devmem2 0x0c010190 w 0x7FFF8000
28 devmem2 0x0c0101b0 w 0x00FF0000
29 devmem2 0x0c01008c w 0x00000000
30 devmem2 0x0c010080 w 0x000000bf
31 devmem2 0x0c010098 w 0x00000015
32 devmem2 0x0c010088 w 0x4b000204
33 devmem2 0x0c010098 w 0x0000001d
36 static struct w100_gen_regs e740_lcd_regs = {
37 .lcd_format = 0x00008023,
38 .lcdd_cntl1 = 0x0f000000,
39 .lcdd_cntl2 = 0x0003ffff,
40 .genlcd_cntl1 = 0x00ffff03,
41 .genlcd_cntl2 = 0x003c0f03,
42 .genlcd_cntl3 = 0x000143aa,
45 static struct w100_mode e740_lcd_mode = {
52 .crtc_ss = 0x80140013,
53 .crtc_ls = 0x81150110,
54 .crtc_gs = 0x80050005,
55 .crtc_vpos_gs = 0x000a0009,
56 .crtc_rev = 0x0040010a,
57 .crtc_dclk = 0xa906000a,
58 .crtc_gclk = 0x80050108,
59 .crtc_goe = 0x80050108,
62 .pixclk_divider_rotated = 4,
63 .pixclk_src = CLK_SRC_XTAL,
65 .sysclk_src = CLK_SRC_PLL,
66 .crtc_ps1_active = 0x41060010,
70 static struct w100_gpio_regs e740_w100_gpio_info = {
71 .init_data1 = 0x21002103,
72 .gpio_dir1 = 0xffffdeff,
73 .gpio_oe1 = 0x03c00643,
74 .init_data2 = 0x003f003f,
75 .gpio_dir2 = 0xffffffff,
76 .gpio_oe2 = 0x000000ff,
79 static struct w100fb_mach_info e740_fb_info = {
80 .modelist = &e740_lcd_mode,
82 .regs = &e740_lcd_regs,
83 .gpio = &e740_w100_gpio_info,
84 .xtal_freq = 14318000,
88 static struct resource e740_fb_resources[] = {
92 .flags = IORESOURCE_MEM,
96 /* ----------------------- device declarations -------------------------- */
99 static struct platform_device e740_fb_device = {
103 .platform_data = &e740_fb_info,
105 .num_resources = ARRAY_SIZE(e740_fb_resources),
106 .resource = e740_fb_resources,
109 static int e740_lcd_init(void)
113 if (!machine_is_e740())
116 return platform_device_register(&e740_fb_device);
119 module_init(e740_lcd_init);
121 MODULE_AUTHOR("Ian Molton <spyro@f2s.com>");
122 MODULE_DESCRIPTION("e740 lcd driver");
123 MODULE_LICENSE("GPLv2");