diff options
author | Ian Molton <spyro@f2s.com> | 2008-08-19 08:01:28 -0400 |
---|---|---|
committer | Ian Molton <spyro@f2s.com> | 2008-08-19 08:44:07 -0400 |
commit | 0ec3cf69304d2e35ad29da3aa9ab43c3dd97677c (patch) | |
tree | 5c4cfa67f4f015da30aa7a49071c74f314c0c8d6 /arch | |
parent | 7dc964148c2850e5df84fc17807ba48edb628c88 (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')
-rw-r--r-- | arch/arm/mach-pxa/Makefile | 8 | ||||
-rw-r--r-- | arch/arm/mach-pxa/e400.c | 32 | ||||
-rw-r--r-- | arch/arm/mach-pxa/e400_lcd.c | 56 | ||||
-rw-r--r-- | arch/arm/mach-pxa/e740.c | 86 | ||||
-rw-r--r-- | arch/arm/mach-pxa/e740_lcd.c | 123 | ||||
-rw-r--r-- | arch/arm/mach-pxa/e750.c | 88 | ||||
-rw-r--r-- | arch/arm/mach-pxa/e750_lcd.c | 109 | ||||
-rw-r--r-- | arch/arm/mach-pxa/e800.c | 139 | ||||
-rw-r--r-- | arch/arm/mach-pxa/e800_lcd.c | 159 |
9 files changed, 349 insertions, 451 deletions
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile index 38db581b9fc5..b536a50c150e 100644 --- a/arch/arm/mach-pxa/Makefile +++ b/arch/arm/mach-pxa/Makefile | |||
@@ -40,10 +40,10 @@ obj-$(CONFIG_MACH_MAGICIAN) += magician.o | |||
40 | obj-$(CONFIG_ARCH_PXA_ESERIES) += eseries.o eseries_udc.o | 40 | obj-$(CONFIG_ARCH_PXA_ESERIES) += eseries.o eseries_udc.o |
41 | obj-$(CONFIG_MACH_E330) += e330.o | 41 | obj-$(CONFIG_MACH_E330) += e330.o |
42 | obj-$(CONFIG_MACH_E350) += e350.o | 42 | obj-$(CONFIG_MACH_E350) += e350.o |
43 | obj-$(CONFIG_MACH_E740) += e740.o e740_lcd.o | 43 | obj-$(CONFIG_MACH_E740) += e740.o |
44 | obj-$(CONFIG_MACH_E750) += e750.o e750_lcd.o | 44 | obj-$(CONFIG_MACH_E750) += e750.o |
45 | obj-$(CONFIG_MACH_E400) += e400.o e400_lcd.o | 45 | obj-$(CONFIG_MACH_E400) += e400.o |
46 | obj-$(CONFIG_MACH_E800) += e800.o e800_lcd.o | 46 | obj-$(CONFIG_MACH_E800) += e800.o |
47 | obj-$(CONFIG_MACH_PALMTX) += palmtx.o | 47 | obj-$(CONFIG_MACH_PALMTX) += palmtx.o |
48 | 48 | ||
49 | ifeq ($(CONFIG_MACH_ZYLONITE),y) | 49 | ifeq ($(CONFIG_MACH_ZYLONITE),y) |
diff --git a/arch/arm/mach-pxa/e400.c b/arch/arm/mach-pxa/e400.c index 405e6dcfc3ce..0bcf9ece3d33 100644 --- a/arch/arm/mach-pxa/e400.c +++ b/arch/arm/mach-pxa/e400.c | |||
@@ -17,12 +17,41 @@ | |||
17 | #include <asm/mach/arch.h> | 17 | #include <asm/mach/arch.h> |
18 | #include <asm/mach-types.h> | 18 | #include <asm/mach-types.h> |
19 | 19 | ||
20 | #include <mach/pxa-regs.h> | ||
20 | #include <mach/mfp-pxa25x.h> | 21 | #include <mach/mfp-pxa25x.h> |
21 | #include <mach/hardware.h> | 22 | #include <mach/hardware.h> |
22 | 23 | ||
24 | #include <mach/pxafb.h> | ||
25 | |||
23 | #include "generic.h" | 26 | #include "generic.h" |
24 | #include "eseries.h" | 27 | #include "eseries.h" |
25 | 28 | ||
29 | /* ------------------------ E400 LCD definitions ------------------------ */ | ||
30 | |||
31 | static struct pxafb_mode_info e400_pxafb_mode_info = { | ||
32 | .pixclock = 140703, | ||
33 | .xres = 240, | ||
34 | .yres = 320, | ||
35 | .bpp = 16, | ||
36 | .hsync_len = 4, | ||
37 | .left_margin = 28, | ||
38 | .right_margin = 8, | ||
39 | .vsync_len = 3, | ||
40 | .upper_margin = 5, | ||
41 | .lower_margin = 6, | ||
42 | .sync = 0, | ||
43 | }; | ||
44 | |||
45 | static struct pxafb_mach_info e400_pxafb_mach_info = { | ||
46 | .modes = &e400_pxafb_mode_info, | ||
47 | .num_modes = 1, | ||
48 | .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act, | ||
49 | .lccr3 = 0, | ||
50 | .pxafb_backlight_power = NULL, | ||
51 | }; | ||
52 | |||
53 | /* ------------------------ E400 MFP config ----------------------------- */ | ||
54 | |||
26 | static unsigned long e400_pin_config[] __initdata = { | 55 | static unsigned long e400_pin_config[] __initdata = { |
27 | /* Chip selects */ | 56 | /* Chip selects */ |
28 | GPIO15_nCS_1, /* CS1 - Flash */ | 57 | GPIO15_nCS_1, /* CS1 - Flash */ |
@@ -41,9 +70,12 @@ static unsigned long e400_pin_config[] __initdata = { | |||
41 | GPIO0_GPIO | WAKEUP_ON_EDGE_RISE, | 70 | GPIO0_GPIO | WAKEUP_ON_EDGE_RISE, |
42 | }; | 71 | }; |
43 | 72 | ||
73 | /* ---------------------------------------------------------------------- */ | ||
74 | |||
44 | static void __init e400_init(void) | 75 | static void __init e400_init(void) |
45 | { | 76 | { |
46 | pxa2xx_mfp_config(ARRAY_AND_SIZE(e400_pin_config)); | 77 | pxa2xx_mfp_config(ARRAY_AND_SIZE(e400_pin_config)); |
78 | set_pxa_fb_info(&e400_pxafb_mach_info); | ||
47 | } | 79 | } |
48 | 80 | ||
49 | MACHINE_START(E400, "Toshiba e400") | 81 | MACHINE_START(E400, "Toshiba e400") |
diff --git a/arch/arm/mach-pxa/e400_lcd.c b/arch/arm/mach-pxa/e400_lcd.c deleted file mode 100644 index 263884165f57..000000000000 --- a/arch/arm/mach-pxa/e400_lcd.c +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | /* | ||
2 | * e400_lcd.c | ||
3 | * | ||
4 | * (c) 2005 Ian Molton <spyro@f2s.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | */ | ||
11 | |||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/module.h> | ||
15 | |||
16 | #include <asm/mach-types.h> | ||
17 | #include <mach/pxa-regs.h> | ||
18 | #include <mach/pxafb.h> | ||
19 | |||
20 | static struct pxafb_mode_info e400_pxafb_mode_info = { | ||
21 | .pixclock = 140703, | ||
22 | .xres = 240, | ||
23 | .yres = 320, | ||
24 | .bpp = 16, | ||
25 | .hsync_len = 4, | ||
26 | .left_margin = 28, | ||
27 | .right_margin = 8, | ||
28 | .vsync_len = 3, | ||
29 | .upper_margin = 5, | ||
30 | .lower_margin = 6, | ||
31 | .sync = 0, | ||
32 | }; | ||
33 | |||
34 | static struct pxafb_mach_info e400_pxafb_mach_info = { | ||
35 | .modes = &e400_pxafb_mode_info, | ||
36 | .num_modes = 1, | ||
37 | .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act, | ||
38 | .lccr3 = 0, | ||
39 | .pxafb_backlight_power = NULL, | ||
40 | }; | ||
41 | |||
42 | static int __init e400_lcd_init(void) | ||
43 | { | ||
44 | if (!machine_is_e400()) | ||
45 | return -ENODEV; | ||
46 | |||
47 | set_pxa_fb_info(&e400_pxafb_mach_info); | ||
48 | return 0; | ||
49 | } | ||
50 | |||
51 | module_init(e400_lcd_init); | ||
52 | |||
53 | MODULE_AUTHOR("Ian Molton <spyro@f2s.com>"); | ||
54 | MODULE_DESCRIPTION("e400 lcd driver"); | ||
55 | MODULE_LICENSE("GPLv2"); | ||
56 | |||
diff --git a/arch/arm/mach-pxa/e740.c b/arch/arm/mach-pxa/e740.c index 560a8a2ebff0..ef0c3c80e791 100644 --- a/arch/arm/mach-pxa/e740.c +++ b/arch/arm/mach-pxa/e740.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,80 @@ | |||
23 | #include "generic.h" | 28 | #include "generic.h" |
24 | #include "eseries.h" | 29 | #include "eseries.h" |
25 | 30 | ||
31 | |||
32 | /* ------------------------ e740 video support --------------------------- */ | ||
33 | |||
34 | static struct w100_gen_regs e740_lcd_regs = { | ||
35 | .lcd_format = 0x00008023, | ||
36 | .lcdd_cntl1 = 0x0f000000, | ||
37 | .lcdd_cntl2 = 0x0003ffff, | ||
38 | .genlcd_cntl1 = 0x00ffff03, | ||
39 | .genlcd_cntl2 = 0x003c0f03, | ||
40 | .genlcd_cntl3 = 0x000143aa, | ||
41 | }; | ||
42 | |||
43 | static struct w100_mode e740_lcd_mode = { | ||
44 | .xres = 240, | ||
45 | .yres = 320, | ||
46 | .left_margin = 20, | ||
47 | .right_margin = 28, | ||
48 | .upper_margin = 9, | ||
49 | .lower_margin = 8, | ||
50 | .crtc_ss = 0x80140013, | ||
51 | .crtc_ls = 0x81150110, | ||
52 | .crtc_gs = 0x80050005, | ||
53 | .crtc_vpos_gs = 0x000a0009, | ||
54 | .crtc_rev = 0x0040010a, | ||
55 | .crtc_dclk = 0xa906000a, | ||
56 | .crtc_gclk = 0x80050108, | ||
57 | .crtc_goe = 0x80050108, | ||
58 | .pll_freq = 57, | ||
59 | .pixclk_divider = 4, | ||
60 | .pixclk_divider_rotated = 4, | ||
61 | .pixclk_src = CLK_SRC_XTAL, | ||
62 | .sysclk_divider = 1, | ||
63 | .sysclk_src = CLK_SRC_PLL, | ||
64 | .crtc_ps1_active = 0x41060010, | ||
65 | }; | ||
66 | |||
67 | static struct w100_gpio_regs e740_w100_gpio_info = { | ||
68 | .init_data1 = 0x21002103, | ||
69 | .gpio_dir1 = 0xffffdeff, | ||
70 | .gpio_oe1 = 0x03c00643, | ||
71 | .init_data2 = 0x003f003f, | ||
72 | .gpio_dir2 = 0xffffffff, | ||
73 | .gpio_oe2 = 0x000000ff, | ||
74 | }; | ||
75 | |||
76 | static struct w100fb_mach_info e740_fb_info = { | ||
77 | .modelist = &e740_lcd_mode, | ||
78 | .num_modes = 1, | ||
79 | .regs = &e740_lcd_regs, | ||
80 | .gpio = &e740_w100_gpio_info, | ||
81 | .xtal_freq = 14318000, | ||
82 | .xtal_dbl = 1, | ||
83 | }; | ||
84 | |||
85 | static struct resource e740_fb_resources[] = { | ||
86 | [0] = { | ||
87 | .start = 0x0c000000, | ||
88 | .end = 0x0cffffff, | ||
89 | .flags = IORESOURCE_MEM, | ||
90 | }, | ||
91 | }; | ||
92 | |||
93 | static struct platform_device e740_fb_device = { | ||
94 | .name = "w100fb", | ||
95 | .id = -1, | ||
96 | .dev = { | ||
97 | .platform_data = &e740_fb_info, | ||
98 | }, | ||
99 | .num_resources = ARRAY_SIZE(e740_fb_resources), | ||
100 | .resource = e740_fb_resources, | ||
101 | }; | ||
102 | |||
103 | /* --------------------------- MFP Pin config -------------------------- */ | ||
104 | |||
26 | static unsigned long e740_pin_config[] __initdata = { | 105 | static unsigned long e740_pin_config[] __initdata = { |
27 | /* Chip selects */ | 106 | /* Chip selects */ |
28 | GPIO15_nCS_1, /* CS1 - Flash */ | 107 | GPIO15_nCS_1, /* CS1 - Flash */ |
@@ -62,9 +141,16 @@ static unsigned long e740_pin_config[] __initdata = { | |||
62 | GPIO0_GPIO | WAKEUP_ON_EDGE_RISE, | 141 | GPIO0_GPIO | WAKEUP_ON_EDGE_RISE, |
63 | }; | 142 | }; |
64 | 143 | ||
144 | /* ----------------------------------------------------------------------- */ | ||
145 | |||
146 | static struct platform_device *devices[] __initdata = { | ||
147 | &e740_fb_device, | ||
148 | }; | ||
149 | |||
65 | static void __init e740_init(void) | 150 | static void __init e740_init(void) |
66 | { | 151 | { |
67 | pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config)); | 152 | pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config)); |
153 | platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
68 | } | 154 | } |
69 | 155 | ||
70 | MACHINE_START(E740, "Toshiba e740") | 156 | MACHINE_START(E740, "Toshiba e740") |
diff --git a/arch/arm/mach-pxa/e740_lcd.c b/arch/arm/mach-pxa/e740_lcd.c deleted file mode 100644 index 26bd599af178..000000000000 --- a/arch/arm/mach-pxa/e740_lcd.c +++ /dev/null | |||
@@ -1,123 +0,0 @@ | |||
1 | /* e740_lcd.c | ||
2 | * | ||
3 | * This file contains the definitions for the LCD timings and functions | ||
4 | * to control the LCD power / frontlighting via the w100fb driver. | ||
5 | * | ||
6 | * (c) 2005 Ian Molton <spyro@f2s.com> | ||
7 | * | ||
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. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #include <linux/module.h> | ||
15 | #include <linux/device.h> | ||
16 | #include <linux/fb.h> | ||
17 | #include <linux/err.h> | ||
18 | #include <linux/platform_device.h> | ||
19 | |||
20 | #include <asm/mach-types.h> | ||
21 | |||
22 | #include <video/w100fb.h> | ||
23 | |||
24 | /* | ||
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 | ||
34 | */ | ||
35 | |||
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, | ||
43 | }; | ||
44 | |||
45 | static struct w100_mode e740_lcd_mode = { | ||
46 | .xres = 240, | ||
47 | .yres = 320, | ||
48 | .left_margin = 20, | ||
49 | .right_margin = 28, | ||
50 | .upper_margin = 9, | ||
51 | .lower_margin = 8, | ||
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, | ||
60 | .pll_freq = 57, | ||
61 | .pixclk_divider = 4, | ||
62 | .pixclk_divider_rotated = 4, | ||
63 | .pixclk_src = CLK_SRC_XTAL, | ||
64 | .sysclk_divider = 1, | ||
65 | .sysclk_src = CLK_SRC_PLL, | ||
66 | .crtc_ps1_active = 0x41060010, | ||
67 | }; | ||
68 | |||
69 | |||
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, | ||
77 | }; | ||
78 | |||
79 | static struct w100fb_mach_info e740_fb_info = { | ||
80 | .modelist = &e740_lcd_mode, | ||
81 | .num_modes = 1, | ||
82 | .regs = &e740_lcd_regs, | ||
83 | .gpio = &e740_w100_gpio_info, | ||
84 | .xtal_freq = 14318000, | ||
85 | .xtal_dbl = 1, | ||
86 | }; | ||
87 | |||
88 | static struct resource e740_fb_resources[] = { | ||
89 | [0] = { | ||
90 | .start = 0x0c000000, | ||
91 | .end = 0x0cffffff, | ||
92 | .flags = IORESOURCE_MEM, | ||
93 | }, | ||
94 | }; | ||
95 | |||
96 | /* ----------------------- device declarations -------------------------- */ | ||
97 | |||
98 | |||
99 | static struct platform_device e740_fb_device = { | ||
100 | .name = "w100fb", | ||
101 | .id = -1, | ||
102 | .dev = { | ||
103 | .platform_data = &e740_fb_info, | ||
104 | }, | ||
105 | .num_resources = ARRAY_SIZE(e740_fb_resources), | ||
106 | .resource = e740_fb_resources, | ||
107 | }; | ||
108 | |||
109 | static int e740_lcd_init(void) | ||
110 | { | ||
111 | int ret; | ||
112 | |||
113 | if (!machine_is_e740()) | ||
114 | return -ENODEV; | ||
115 | |||
116 | return platform_device_register(&e740_fb_device); | ||
117 | } | ||
118 | |||
119 | module_init(e740_lcd_init); | ||
120 | |||
121 | MODULE_AUTHOR("Ian Molton <spyro@f2s.com>"); | ||
122 | MODULE_DESCRIPTION("e740 lcd driver"); | ||
123 | MODULE_LICENSE("GPLv2"); | ||
diff --git a/arch/arm/mach-pxa/e750.c b/arch/arm/mach-pxa/e750.c index bb6f814d5642..7e9a21dddd4d 100644 --- a/arch/arm/mach-pxa/e750.c +++ b/arch/arm/mach-pxa/e750.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,88 @@ | |||
23 | #include "generic.h" | 28 | #include "generic.h" |
24 | #include "eseries.h" | 29 | #include "eseries.h" |
25 | 30 | ||
31 | /* ---------------------- E750 LCD definitions -------------------- */ | ||
32 | |||
33 | static struct w100_gen_regs e750_lcd_regs = { | ||
34 | .lcd_format = 0x00008003, | ||
35 | .lcdd_cntl1 = 0x00000000, | ||
36 | .lcdd_cntl2 = 0x0003ffff, | ||
37 | .genlcd_cntl1 = 0x00fff003, | ||
38 | .genlcd_cntl2 = 0x003c0f03, | ||
39 | .genlcd_cntl3 = 0x000143aa, | ||
40 | }; | ||
41 | |||
42 | static struct w100_mode e750_lcd_mode = { | ||
43 | .xres = 240, | ||
44 | .yres = 320, | ||
45 | .left_margin = 21, | ||
46 | .right_margin = 22, | ||
47 | .upper_margin = 5, | ||
48 | .lower_margin = 4, | ||
49 | .crtc_ss = 0x80150014, | ||
50 | .crtc_ls = 0x8014000d, | ||
51 | .crtc_gs = 0xc1000005, | ||
52 | .crtc_vpos_gs = 0x00020147, | ||
53 | .crtc_rev = 0x0040010a, | ||
54 | .crtc_dclk = 0xa1700030, | ||
55 | .crtc_gclk = 0x80cc0015, | ||
56 | .crtc_goe = 0x80cc0015, | ||
57 | .crtc_ps1_active = 0x61060017, | ||
58 | .pll_freq = 57, | ||
59 | .pixclk_divider = 4, | ||
60 | .pixclk_divider_rotated = 4, | ||
61 | .pixclk_src = CLK_SRC_XTAL, | ||
62 | .sysclk_divider = 1, | ||
63 | .sysclk_src = CLK_SRC_PLL, | ||
64 | }; | ||
65 | |||
66 | static struct w100_gpio_regs e750_w100_gpio_info = { | ||
67 | .init_data1 = 0x01192f1b, | ||
68 | .gpio_dir1 = 0xd5ffdeff, | ||
69 | .gpio_oe1 = 0x000020bf, | ||
70 | .init_data2 = 0x010f010f, | ||
71 | .gpio_dir2 = 0xffffffff, | ||
72 | .gpio_oe2 = 0x000001cf, | ||
73 | }; | ||
74 | |||
75 | static struct w100fb_mach_info e750_fb_info = { | ||
76 | .modelist = &e750_lcd_mode, | ||
77 | .num_modes = 1, | ||
78 | .regs = &e750_lcd_regs, | ||
79 | .gpio = &e750_w100_gpio_info, | ||
80 | .xtal_freq = 14318000, | ||
81 | .xtal_dbl = 1, | ||
82 | }; | ||
83 | |||
84 | static struct resource e750_fb_resources[] = { | ||
85 | [0] = { | ||
86 | .start = 0x0c000000, | ||
87 | .end = 0x0cffffff, | ||
88 | .flags = IORESOURCE_MEM, | ||
89 | }, | ||
90 | }; | ||
91 | |||
92 | static struct platform_device e750_fb_device = { | ||
93 | .name = "w100fb", | ||
94 | .id = -1, | ||
95 | .dev = { | ||
96 | .platform_data = &e750_fb_info, | ||
97 | }, | ||
98 | .num_resources = ARRAY_SIZE(e750_fb_resources), | ||
99 | .resource = e750_fb_resources, | ||
100 | }; | ||
101 | |||
102 | /* ----------------------------------------------------------------------- */ | ||
103 | |||
104 | static struct platform_device *devices[] __initdata = { | ||
105 | &e750_fb_device, | ||
106 | }; | ||
107 | |||
108 | static void __init e750_init(void) | ||
109 | { | ||
110 | platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
111 | } | ||
112 | |||
26 | MACHINE_START(E750, "Toshiba e750") | 113 | MACHINE_START(E750, "Toshiba e750") |
27 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | 114 | /* Maintainer: Ian Molton (spyro@f2s.com) */ |
28 | .phys_io = 0x40000000, | 115 | .phys_io = 0x40000000, |
@@ -31,6 +118,7 @@ MACHINE_START(E750, "Toshiba e750") | |||
31 | .map_io = pxa_map_io, | 118 | .map_io = pxa_map_io, |
32 | .init_irq = pxa25x_init_irq, | 119 | .init_irq = pxa25x_init_irq, |
33 | .fixup = eseries_fixup, | 120 | .fixup = eseries_fixup, |
121 | .init_machine = e750_init, | ||
34 | .timer = &pxa_timer, | 122 | .timer = &pxa_timer, |
35 | MACHINE_END | 123 | MACHINE_END |
36 | 124 | ||
diff --git a/arch/arm/mach-pxa/e750_lcd.c b/arch/arm/mach-pxa/e750_lcd.c deleted file mode 100644 index 75edc3b5390f..000000000000 --- a/arch/arm/mach-pxa/e750_lcd.c +++ /dev/null | |||
@@ -1,109 +0,0 @@ | |||
1 | /* e750_lcd.c | ||
2 | * | ||
3 | * This file contains the definitions for the LCD timings and functions | ||
4 | * to control the LCD power / frontlighting via the w100fb driver. | ||
5 | * | ||
6 | * (c) 2005 Ian Molton <spyro@f2s.com> | ||
7 | * | ||
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. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #include <linux/module.h> | ||
15 | #include <linux/device.h> | ||
16 | #include <linux/fb.h> | ||
17 | #include <linux/err.h> | ||
18 | #include <linux/platform_device.h> | ||
19 | |||
20 | #include <asm/mach-types.h> | ||
21 | |||
22 | #include <video/w100fb.h> | ||
23 | |||
24 | static struct w100_gen_regs e750_lcd_regs = { | ||
25 | .lcd_format = 0x00008003, | ||
26 | .lcdd_cntl1 = 0x00000000, | ||
27 | .lcdd_cntl2 = 0x0003ffff, | ||
28 | .genlcd_cntl1 = 0x00fff003, | ||
29 | .genlcd_cntl2 = 0x003c0f03, | ||
30 | .genlcd_cntl3 = 0x000143aa, | ||
31 | }; | ||
32 | |||
33 | static struct w100_mode e750_lcd_mode = { | ||
34 | .xres = 240, | ||
35 | .yres = 320, | ||
36 | .left_margin = 21, | ||
37 | .right_margin = 22, | ||
38 | .upper_margin = 5, | ||
39 | .lower_margin = 4, | ||
40 | .crtc_ss = 0x80150014, | ||
41 | .crtc_ls = 0x8014000d, | ||
42 | .crtc_gs = 0xc1000005, | ||
43 | .crtc_vpos_gs = 0x00020147, | ||
44 | .crtc_rev = 0x0040010a, | ||
45 | .crtc_dclk = 0xa1700030, | ||
46 | .crtc_gclk = 0x80cc0015, | ||
47 | .crtc_goe = 0x80cc0015, | ||
48 | .crtc_ps1_active = 0x61060017, | ||
49 | .pll_freq = 57, | ||
50 | .pixclk_divider = 4, | ||
51 | .pixclk_divider_rotated = 4, | ||
52 | .pixclk_src = CLK_SRC_XTAL, | ||
53 | .sysclk_divider = 1, | ||
54 | .sysclk_src = CLK_SRC_PLL, | ||
55 | }; | ||
56 | |||
57 | |||
58 | static struct w100_gpio_regs e750_w100_gpio_info = { | ||
59 | .init_data1 = 0x01192f1b, | ||
60 | .gpio_dir1 = 0xd5ffdeff, | ||
61 | .gpio_oe1 = 0x000020bf, | ||
62 | .init_data2 = 0x010f010f, | ||
63 | .gpio_dir2 = 0xffffffff, | ||
64 | .gpio_oe2 = 0x000001cf, | ||
65 | }; | ||
66 | |||
67 | static struct w100fb_mach_info e750_fb_info = { | ||
68 | .modelist = &e750_lcd_mode, | ||
69 | .num_modes = 1, | ||
70 | .regs = &e750_lcd_regs, | ||
71 | .gpio = &e750_w100_gpio_info, | ||
72 | .xtal_freq = 14318000, | ||
73 | .xtal_dbl = 1, | ||
74 | }; | ||
75 | |||
76 | static struct resource e750_fb_resources[] = { | ||
77 | [0] = { | ||
78 | .start = 0x0c000000, | ||
79 | .end = 0x0cffffff, | ||
80 | .flags = IORESOURCE_MEM, | ||
81 | }, | ||
82 | }; | ||
83 | |||
84 | /* ----------------------- device declarations -------------------------- */ | ||
85 | |||
86 | |||
87 | static struct platform_device e750_fb_device = { | ||
88 | .name = "w100fb", | ||
89 | .id = -1, | ||
90 | .dev = { | ||
91 | .platform_data = &e750_fb_info, | ||
92 | }, | ||
93 | .num_resources = ARRAY_SIZE(e750_fb_resources), | ||
94 | .resource = e750_fb_resources, | ||
95 | }; | ||
96 | |||
97 | static int e750_lcd_init(void) | ||
98 | { | ||
99 | if (!machine_is_e750()) | ||
100 | return -ENODEV; | ||
101 | |||
102 | return platform_device_register(&e750_fb_device); | ||
103 | } | ||
104 | |||
105 | module_init(e750_lcd_init); | ||
106 | |||
107 | MODULE_AUTHOR("Ian Molton <spyro@f2s.com>"); | ||
108 | MODULE_DESCRIPTION("e750 lcd driver"); | ||
109 | MODULE_LICENSE("GPLv2"); | ||
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 | |||
33 | static 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 | |||
42 | static 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 | |||
92 | static 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 | |||
101 | static 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 | |||
109 | static 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 | |||
121 | static struct w100_tg_info e800_tg_info = { | ||
122 | .change = e800_tg_change, | ||
123 | }; | ||
124 | |||
125 | static 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 | |||
135 | static struct resource e800_fb_resources[] = { | ||
136 | [0] = { | ||
137 | .start = 0x0c000000, | ||
138 | .end = 0x0cffffff, | ||
139 | .flags = IORESOURCE_MEM, | ||
140 | }, | ||
141 | }; | ||
142 | |||
143 | static 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 | |||
155 | static struct platform_device *devices[] __initdata = { | ||
156 | &e800_fb_device, | ||
157 | }; | ||
158 | |||
159 | static void __init e800_init(void) | ||
160 | { | ||
161 | platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
162 | } | ||
163 | |||
26 | MACHINE_START(E800, "Toshiba e800") | 164 | MACHINE_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, |
35 | MACHINE_END | 174 | MACHINE_END |
36 | 175 | ||
diff --git a/arch/arm/mach-pxa/e800_lcd.c b/arch/arm/mach-pxa/e800_lcd.c deleted file mode 100644 index e6aeab0ebc22..000000000000 --- a/arch/arm/mach-pxa/e800_lcd.c +++ /dev/null | |||
@@ -1,159 +0,0 @@ | |||
1 | /* e800_lcd.c | ||
2 | * | ||
3 | * This file contains the definitions for the LCD timings and functions | ||
4 | * to control the LCD power / frontlighting via the w100fb driver. | ||
5 | * | ||
6 | * (c) 2005 Ian Molton <spyro@f2s.com> | ||
7 | * | ||
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. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #include <linux/module.h> | ||
15 | #include <linux/device.h> | ||
16 | #include <linux/fb.h> | ||
17 | #include <linux/err.h> | ||
18 | #include <linux/platform_device.h> | ||
19 | |||
20 | #include <asm/mach-types.h> | ||
21 | |||
22 | #include <video/w100fb.h> | ||
23 | |||
24 | static struct w100_gen_regs e800_lcd_regs = { | ||
25 | .lcd_format = 0x00008003, | ||
26 | .lcdd_cntl1 = 0x02a00000, | ||
27 | .lcdd_cntl2 = 0x0003ffff, | ||
28 | .genlcd_cntl1 = 0x000ff2a3, | ||
29 | .genlcd_cntl2 = 0x000002a3, | ||
30 | .genlcd_cntl3 = 0x000102aa, | ||
31 | }; | ||
32 | |||
33 | static struct w100_mode e800_lcd_mode[2] = { | ||
34 | [0] = { | ||
35 | .xres = 480, | ||
36 | .yres = 640, | ||
37 | .left_margin = 52, | ||
38 | .right_margin = 148, | ||
39 | .upper_margin = 2, | ||
40 | .lower_margin = 6, | ||
41 | .crtc_ss = 0x80350034, | ||
42 | .crtc_ls = 0x802b0026, | ||
43 | .crtc_gs = 0x80160016, | ||
44 | .crtc_vpos_gs = 0x00020003, | ||
45 | .crtc_rev = 0x0040001d, | ||
46 | .crtc_dclk = 0xe0000000, | ||
47 | .crtc_gclk = 0x82a50049, | ||
48 | .crtc_goe = 0x80ee001c, | ||
49 | .crtc_ps1_active = 0x00000000, | ||
50 | .pll_freq = 128, | ||
51 | .pixclk_divider = 4, | ||
52 | .pixclk_divider_rotated = 6, | ||
53 | .pixclk_src = CLK_SRC_PLL, | ||
54 | .sysclk_divider = 0, | ||
55 | .sysclk_src = CLK_SRC_PLL, | ||
56 | }, | ||
57 | [1] = { | ||
58 | .xres = 240, | ||
59 | .yres = 320, | ||
60 | .left_margin = 15, | ||
61 | .right_margin = 88, | ||
62 | .upper_margin = 0, | ||
63 | .lower_margin = 7, | ||
64 | .crtc_ss = 0xd010000f, | ||
65 | .crtc_ls = 0x80070003, | ||
66 | .crtc_gs = 0x80000000, | ||
67 | .crtc_vpos_gs = 0x01460147, | ||
68 | .crtc_rev = 0x00400003, | ||
69 | .crtc_dclk = 0xa1700030, | ||
70 | .crtc_gclk = 0x814b0008, | ||
71 | .crtc_goe = 0x80cc0015, | ||
72 | .crtc_ps1_active = 0x00000000, | ||
73 | .pll_freq = 100, | ||
74 | .pixclk_divider = 6, /* Wince uses 14 which gives a 7MHz pclk. */ | ||
75 | .pixclk_divider_rotated = 6, /* we want a 14MHz one (much nicer to look at) */ | ||
76 | .pixclk_src = CLK_SRC_PLL, | ||
77 | .sysclk_divider = 0, | ||
78 | .sysclk_src = CLK_SRC_PLL, | ||
79 | } | ||
80 | }; | ||
81 | |||
82 | |||
83 | static struct w100_gpio_regs e800_w100_gpio_info = { | ||
84 | .init_data1 = 0xc13fc019, | ||
85 | .gpio_dir1 = 0x3e40df7f, | ||
86 | .gpio_oe1 = 0x003c3000, | ||
87 | .init_data2 = 0x00000000, | ||
88 | .gpio_dir2 = 0x00000000, | ||
89 | .gpio_oe2 = 0x00000000, | ||
90 | }; | ||
91 | |||
92 | static struct w100_mem_info e800_w100_mem_info = { | ||
93 | .ext_cntl = 0x09640011, | ||
94 | .sdram_mode_reg = 0x00600021, | ||
95 | .ext_timing_cntl = 0x10001545, | ||
96 | .io_cntl = 0x7ddd7333, | ||
97 | .size = 0x1fffff, | ||
98 | }; | ||
99 | |||
100 | static void e800_tg_change(struct w100fb_par *par) | ||
101 | { | ||
102 | unsigned long tmp; | ||
103 | |||
104 | tmp = w100fb_gpio_read(W100_GPIO_PORT_A); | ||
105 | if (par->mode->xres == 480) | ||
106 | tmp |= 0x100; | ||
107 | else | ||
108 | tmp &= ~0x100; | ||
109 | w100fb_gpio_write(W100_GPIO_PORT_A, tmp); | ||
110 | } | ||
111 | |||
112 | static struct w100_tg_info e800_tg_info = { | ||
113 | .change = e800_tg_change, | ||
114 | }; | ||
115 | |||
116 | static struct w100fb_mach_info e800_fb_info = { | ||
117 | .modelist = e800_lcd_mode, | ||
118 | .num_modes = 2, | ||
119 | .regs = &e800_lcd_regs, | ||
120 | .gpio = &e800_w100_gpio_info, | ||
121 | .mem = &e800_w100_mem_info, | ||
122 | .tg = &e800_tg_info, | ||
123 | .xtal_freq = 16000000, | ||
124 | }; | ||
125 | |||
126 | static struct resource e800_fb_resources[] = { | ||
127 | [0] = { | ||
128 | .start = 0x0c000000, | ||
129 | .end = 0x0cffffff, | ||
130 | .flags = IORESOURCE_MEM, | ||
131 | }, | ||
132 | }; | ||
133 | |||
134 | /* ----------------------- device declarations -------------------------- */ | ||
135 | |||
136 | |||
137 | static struct platform_device e800_fb_device = { | ||
138 | .name = "w100fb", | ||
139 | .id = -1, | ||
140 | .dev = { | ||
141 | .platform_data = &e800_fb_info, | ||
142 | }, | ||
143 | .num_resources = ARRAY_SIZE(e800_fb_resources), | ||
144 | .resource = e800_fb_resources, | ||
145 | }; | ||
146 | |||
147 | static int e800_lcd_init(void) | ||
148 | { | ||
149 | if (!machine_is_e800()) | ||
150 | return -ENODEV; | ||
151 | |||
152 | return platform_device_register(&e800_fb_device); | ||
153 | } | ||
154 | |||
155 | module_init(e800_lcd_init); | ||
156 | |||
157 | MODULE_AUTHOR("Ian Molton <spyro@f2s.com>"); | ||
158 | MODULE_DESCRIPTION("e800 lcd driver"); | ||
159 | MODULE_LICENSE("GPLv2"); | ||