Root/
Source at commit fad288aff22be8618aeb6baa5c980f721226a5e1 created 13 years 25 days ago. By Peter Zotov, MIPS: JZ47xx: Fix a few naming issues. | |
---|---|
1 | /* |
2 | * Copyright (C) 2010 Lars-Peter Clausen <lars@metafoo.de> |
3 | * |
4 | * This program is free software; you can redistribute it and/or modify |
5 | * it under the terms of the GNU General Public License version 2 or later |
6 | * as published by the Free Software Foundation. |
7 | */ |
8 | |
9 | #include <linux/kernel.h> |
10 | #include <linux/init.h> |
11 | #include <linux/gpio.h> |
12 | |
13 | #include <asm/mach-jz4740/platform.h> |
14 | |
15 | #include <linux/input.h> |
16 | #include <linux/power_supply.h> |
17 | #include <linux/pwm_backlight.h> |
18 | |
19 | #include "../clock.h" |
20 | |
21 | #include <asm/mach-jz4740/jz4740_fb.h> |
22 | #include <asm/mach-jz4740/jz4740_nand.h> |
23 | |
24 | /* NAND */ |
25 | static struct nand_ecclayout id800wt_ecclayout = { |
26 | .oobfree = { |
27 | { |
28 | .offset = 2, |
29 | .length = 4, |
30 | }, |
31 | { |
32 | .offset = 42, |
33 | .length = 22, |
34 | }, |
35 | } |
36 | }; |
37 | |
38 | static struct mtd_partition id800wt_partitions[] = { |
39 | { .name = "NAND BOOT partition", |
40 | .offset = 0 * 0x100000, |
41 | .size = 2 * 0x100000, |
42 | }, |
43 | { .name = "NAND KERNEL partition", |
44 | .offset = 2 * 0x100000, |
45 | .size = 4 * 0x100000, |
46 | }, |
47 | { .name = "NAND ROOTFS partition", |
48 | .offset = 6 * 0x100000, |
49 | .size = 498 * 0x100000, |
50 | }, |
51 | }; |
52 | |
53 | static struct jz_nand_platform_data id800wt_nand_pdata = { |
54 | .ecc_layout = &id800wt_ecclayout, |
55 | .partitions = id800wt_partitions, |
56 | .num_partitions = ARRAY_SIZE(id800wt_partitions), |
57 | .busy_gpio = JZ_GPIO_PORTC(30), |
58 | }; |
59 | |
60 | /* Display */ |
61 | static struct fb_videomode id800wt_video_modes[] = { |
62 | { |
63 | .name = "800x600", |
64 | .xres = 800, |
65 | .yres = 600, |
66 | .refresh = 40, |
67 | .left_margin = 0, |
68 | .right_margin = 255, |
69 | .upper_margin = 0, |
70 | .lower_margin = 35, |
71 | .hsync_len = 1, |
72 | .vsync_len = 1, |
73 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, |
74 | .vmode = FB_VMODE_NONINTERLACED, |
75 | }, |
76 | }; |
77 | |
78 | static struct jz4740_fb_platform_data id800wt_fb_pdata = { |
79 | .width = 60, |
80 | .height = 45, |
81 | .num_modes = ARRAY_SIZE(id800wt_video_modes), |
82 | .modes = id800wt_video_modes, |
83 | .bpp = 16, |
84 | .lcd_type = JZ_LCD_TYPE_SPECIAL_TFT_1, |
85 | .pixclk_falling_edge = 1, |
86 | .special_tft_config = { |
87 | .spl = JZ4740_FB_SPECIAL_TFT_CONFIG(1051, 1053), |
88 | .cls = JZ4740_FB_SPECIAL_TFT_CONFIG(631, 744), |
89 | .ps = JZ4740_FB_SPECIAL_TFT_CONFIG(0, 45), |
90 | .rev = JZ4740_FB_SPECIAL_TFT_CONFIG(0, 0), |
91 | }, |
92 | }; |
93 | |
94 | /* Backlight */ |
95 | static int id800wt_backlight_invert(struct device *dev, int brightness) |
96 | { |
97 | return 255 - brightness; |
98 | } |
99 | |
100 | static struct platform_pwm_backlight_data id800wt_backlight_data = { |
101 | .pwm_id = 7, |
102 | .max_brightness = 255, |
103 | .dft_brightness = 255, |
104 | .pwm_period_ns = 8000000, |
105 | .notify = id800wt_backlight_invert, |
106 | }; |
107 | |
108 | static struct platform_device id800wt_backlight_device = { |
109 | .name = "pwm-backlight", |
110 | .id = -1, |
111 | .dev = { |
112 | .platform_data = &id800wt_backlight_data, |
113 | .parent = &jz4740_framebuffer_device.dev, |
114 | }, |
115 | }; |
116 | |
117 | static struct platform_device *jz_platform_devices[] __initdata = { |
118 | &jz4740_usb_ohci_device, |
119 | &jz4740_udc_device, |
120 | &jz4740_nand_device, |
121 | &jz4740_framebuffer_device, |
122 | &jz4740_i2s_device, |
123 | &jz4740_codec_device, |
124 | &jz4740_pcm_device, |
125 | &jz4740_rtc_device, |
126 | &jz4740_adc_device, |
127 | &id800wt_backlight_device, |
128 | }; |
129 | |
130 | static int __init id800wt_init_platform_devices(void) |
131 | { |
132 | jz4740_framebuffer_device.dev.platform_data = &id800wt_fb_pdata; |
133 | jz4740_nand_device.dev.platform_data = &id800wt_nand_pdata; |
134 | |
135 | jz4740_serial_device_register(); |
136 | |
137 | jz_gpio_enable_pullup(JZ_GPIO_LCD_PS); |
138 | jz_gpio_enable_pullup(JZ_GPIO_LCD_REV); |
139 | |
140 | return platform_add_devices(jz_platform_devices, |
141 | ARRAY_SIZE(jz_platform_devices)); |
142 | } |
143 | |
144 | struct jz4740_clock_board_data jz4740_clock_bdata = { |
145 | .ext_rate = 12000000, |
146 | .rtc_rate = 32768, |
147 | }; |
148 | |
149 | static int __init id800wt_board_setup(void) |
150 | { |
151 | printk("Sungale pictureframe id800wt setup\n"); |
152 | |
153 | if (id800wt_init_platform_devices()) |
154 | panic("Failed to initalize platform devices\n"); |
155 | |
156 | return 0; |
157 | } |
158 | arch_initcall(id800wt_board_setup); |
159 |
Branches:
ben-wpan
ben-wpan-stefan
javiroman/ks7010
jz-2.6.34
jz-2.6.34-rc5
jz-2.6.34-rc6
jz-2.6.34-rc7
jz-2.6.35
jz-2.6.36
jz-2.6.37
jz-2.6.38
jz-2.6.39
jz-3.0
jz-3.1
jz-3.11
jz-3.12
jz-3.13
jz-3.15
jz-3.16
jz-3.18-dt
jz-3.2
jz-3.3
jz-3.4
jz-3.5
jz-3.6
jz-3.6-rc2-pwm
jz-3.9
jz-3.9-clk
jz-3.9-rc8
jz47xx
jz47xx-2.6.38
master
Tags:
od-2011-09-04
od-2011-09-18
v2.6.34-rc5
v2.6.34-rc6
v2.6.34-rc7
v3.9