Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[deliverable/linux.git] / arch / arm / mach-s5pc100 / mach-smdkc100.c
CommitLineData
e119766f
BM
1/* linux/arch/arm/mach-s5pc100/mach-smdkc100.c
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Author: Byungho Min <bhmin@samsung.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/types.h>
14#include <linux/interrupt.h>
15#include <linux/list.h>
16#include <linux/timer.h>
17#include <linux/init.h>
18#include <linux/serial_core.h>
19#include <linux/platform_device.h>
20#include <linux/io.h>
21#include <linux/gpio.h>
22#include <linux/i2c.h>
23#include <linux/fb.h>
24#include <linux/delay.h>
2211f28c 25#include <linux/input.h>
baa0c060 26#include <linux/pwm_backlight.h>
e119766f
BM
27
28#include <asm/mach/arch.h>
29#include <asm/mach/map.h>
30
31#include <mach/map.h>
baa0c060
BG
32#include <mach/regs-gpio.h>
33
079b0324 34#include <video/platform_lcd.h>
5a213a55 35#include <video/samsung_fimd.h>
e119766f
BM
36
37#include <asm/irq.h>
38#include <asm/mach-types.h>
39
40#include <plat/regs-serial.h>
079b0324 41#include <plat/gpio-cfg.h>
e119766f
BM
42
43#include <plat/clock.h>
44#include <plat/devs.h>
45#include <plat/cpu.h>
079b0324 46#include <plat/fb.h>
436d42c6
AB
47#include <linux/platform_data/i2c-s3c2410.h>
48#include <linux/platform_data/ata-samsung_cf.h>
327b9030 49#include <plat/adc.h>
2211f28c 50#include <plat/keypad.h>
436d42c6
AB
51#include <linux/platform_data/touchscreen-s3c2410.h>
52#include <linux/platform_data/asoc-s3c.h>
1cad6766 53#include <plat/backlight.h>
e119766f 54
dd4153d9
KK
55#include "common.h"
56
13e51fad 57/* Following are default values for UCON, ULCON and UFCON UART registers */
c8def085 58#define SMDKC100_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
13e51fad
MS
59 S3C2410_UCON_RXILEVEL | \
60 S3C2410_UCON_TXIRQMODE | \
61 S3C2410_UCON_RXIRQMODE | \
62 S3C2410_UCON_RXFIFO_TOI | \
63 S3C2443_UCON_RXERR_IRQEN)
64
c8def085 65#define SMDKC100_ULCON_DEFAULT S3C2410_LCON_CS8
13e51fad 66
c8def085 67#define SMDKC100_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
13e51fad
MS
68 S3C2440_UFCON_RXTRIG8 | \
69 S3C2440_UFCON_TXTRIG16)
e119766f
BM
70
71static struct s3c2410_uartcfg smdkc100_uartcfgs[] __initdata = {
72 [0] = {
73 .hwport = 0,
74 .flags = 0,
c8def085
KK
75 .ucon = SMDKC100_UCON_DEFAULT,
76 .ulcon = SMDKC100_ULCON_DEFAULT,
77 .ufcon = SMDKC100_UFCON_DEFAULT,
e119766f
BM
78 },
79 [1] = {
80 .hwport = 1,
81 .flags = 0,
c8def085
KK
82 .ucon = SMDKC100_UCON_DEFAULT,
83 .ulcon = SMDKC100_ULCON_DEFAULT,
84 .ufcon = SMDKC100_UFCON_DEFAULT,
e119766f
BM
85 },
86 [2] = {
87 .hwport = 2,
88 .flags = 0,
c8def085
KK
89 .ucon = SMDKC100_UCON_DEFAULT,
90 .ulcon = SMDKC100_ULCON_DEFAULT,
91 .ufcon = SMDKC100_UFCON_DEFAULT,
e119766f
BM
92 },
93 [3] = {
94 .hwport = 3,
95 .flags = 0,
c8def085
KK
96 .ucon = SMDKC100_UCON_DEFAULT,
97 .ulcon = SMDKC100_ULCON_DEFAULT,
98 .ufcon = SMDKC100_UFCON_DEFAULT,
e119766f
BM
99 },
100};
101
067f131d
KP
102/* I2C0 */
103static struct i2c_board_info i2c_devs0[] __initdata = {
b0f39c25 104 {I2C_BOARD_INFO("wm8580", 0x1b),},
067f131d
KP
105};
106
107/* I2C1 */
108static struct i2c_board_info i2c_devs1[] __initdata = {
109};
110
079b0324
KP
111/* LCD power controller */
112static void smdkc100_lcd_power_set(struct plat_lcd_data *pd,
113 unsigned int power)
114{
079b0324
KP
115 if (power) {
116 /* module reset */
117 gpio_direction_output(S5PC100_GPH0(6), 1);
118 mdelay(100);
119 gpio_direction_output(S5PC100_GPH0(6), 0);
120 mdelay(10);
121 gpio_direction_output(S5PC100_GPH0(6), 1);
122 mdelay(10);
123 }
124}
125
126static struct plat_lcd_data smdkc100_lcd_power_data = {
127 .set_power = smdkc100_lcd_power_set,
128};
129
130static struct platform_device smdkc100_lcd_powerdev = {
131 .name = "platform-lcd",
132 .dev.parent = &s3c_device_fb.dev,
133 .dev.platform_data = &smdkc100_lcd_power_data,
134};
135
136/* Frame Buffer */
137static struct s3c_fb_pd_win smdkc100_fb_win0 = {
079b0324
KP
138 .max_bpp = 32,
139 .default_bpp = 16,
79d3c41a
TA
140 .xres = 800,
141 .yres = 480,
142};
143
144static struct fb_videomode smdkc100_lcd_timing = {
145 .left_margin = 8,
146 .right_margin = 13,
147 .upper_margin = 7,
148 .lower_margin = 5,
149 .hsync_len = 3,
150 .vsync_len = 1,
151 .xres = 800,
152 .yres = 480,
153 .refresh = 80,
079b0324
KP
154};
155
156static struct s3c_fb_platdata smdkc100_lcd_pdata __initdata = {
157 .win[0] = &smdkc100_fb_win0,
79d3c41a 158 .vtiming = &smdkc100_lcd_timing,
079b0324
KP
159 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
160 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
161 .setup_gpio = s5pc100_fb_gpio_setup_24bpp,
162};
163
66194a74
AK
164static struct s3c_ide_platdata smdkc100_ide_pdata __initdata = {
165 .setup_gpio = s5pc100_ide_setup_gpio,
166};
167
2211f28c
NKC
168static uint32_t smdkc100_keymap[] __initdata = {
169 /* KEY(row, col, keycode) */
170 KEY(0, 3, KEY_1), KEY(0, 4, KEY_2), KEY(0, 5, KEY_3),
171 KEY(0, 6, KEY_4), KEY(0, 7, KEY_5),
172 KEY(1, 3, KEY_A), KEY(1, 4, KEY_B), KEY(1, 5, KEY_C),
173 KEY(1, 6, KEY_D), KEY(1, 7, KEY_E)
174};
175
176static struct matrix_keymap_data smdkc100_keymap_data __initdata = {
177 .keymap = smdkc100_keymap,
178 .keymap_size = ARRAY_SIZE(smdkc100_keymap),
179};
180
181static struct samsung_keypad_platdata smdkc100_keypad_data __initdata = {
182 .keymap_data = &smdkc100_keymap_data,
183 .rows = 2,
184 .cols = 8,
185};
186
e119766f 187static struct platform_device *smdkc100_devices[] __initdata = {
327b9030 188 &s3c_device_adc,
c4023617 189 &s3c_device_cfcon,
067f131d
KP
190 &s3c_device_i2c0,
191 &s3c_device_i2c1,
079b0324 192 &s3c_device_fb,
0c318628
KP
193 &s3c_device_hsmmc0,
194 &s3c_device_hsmmc1,
195 &s3c_device_hsmmc2,
327b9030 196 &s3c_device_ts,
c4023617 197 &s3c_device_wdt,
079b0324 198 &smdkc100_lcd_powerdev,
99c56e0c 199 &s5pc100_device_iis0,
2211f28c 200 &samsung_device_keypad,
99c56e0c 201 &s5pc100_device_ac97,
fa9ce742 202 &s3c_device_rtc,
db94a2f4
SN
203 &s5p_device_fimc0,
204 &s5p_device_fimc1,
205 &s5p_device_fimc2,
068b432d 206 &s5pc100_device_spdif,
e119766f
BM
207};
208
1cad6766
BG
209/* LCD Backlight data */
210static struct samsung_bl_gpio_info smdkc100_bl_gpio_info = {
211 .no = S5PC100_GPD(0),
212 .func = S3C_GPIO_SFN(2),
213};
214
215static struct platform_pwm_backlight_data smdkc100_bl_data = {
216 .pwm_id = 0,
217};
218
e119766f
BM
219static void __init smdkc100_map_io(void)
220{
dd4153d9 221 s5pc100_init_io(NULL, 0);
e119766f
BM
222 s3c24xx_init_clocks(12000000);
223 s3c24xx_init_uarts(smdkc100_uartcfgs, ARRAY_SIZE(smdkc100_uartcfgs));
224}
225
226static void __init smdkc100_machine_init(void)
227{
0804765a 228 s3c24xx_ts_set_platdata(NULL);
327b9030 229
067f131d
KP
230 /* I2C */
231 s3c_i2c0_set_platdata(NULL);
232 s3c_i2c1_set_platdata(NULL);
233 i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0));
234 i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));
235
079b0324 236 s3c_fb_set_platdata(&smdkc100_lcd_pdata);
66194a74 237 s3c_ide_set_platdata(&smdkc100_ide_pdata);
079b0324 238
2211f28c 239 samsung_keypad_set_platdata(&smdkc100_keypad_data);
079b0324 240
068b432d
SY
241 s5pc100_spdif_setup_gpio(S5PC100_SPDIF_GPD);
242
079b0324 243 /* LCD init */
079b0324
KP
244 gpio_request(S5PC100_GPH0(6), "GPH0");
245 smdkc100_lcd_power_set(&smdkc100_lcd_power_data, 0);
1cad6766
BG
246
247 samsung_bl_set(&smdkc100_bl_gpio_info, &smdkc100_bl_data);
248
e119766f
BM
249 platform_add_devices(smdkc100_devices, ARRAY_SIZE(smdkc100_devices));
250}
251
252MACHINE_START(SMDKC100, "SMDKC100")
253 /* Maintainer: Byungho Min <bhmin@samsung.com> */
02350a1f 254 .atag_offset = 0x100,
e119766f
BM
255 .init_irq = s5pc100_init_irq,
256 .map_io = smdkc100_map_io,
257 .init_machine = smdkc100_machine_init,
6bb27d73 258 .init_time = s3c24xx_timer_init,
5497d2e1 259 .restart = s5pc100_restart,
e119766f 260MACHINE_END
This page took 0.239697 seconds and 5 git commands to generate.