1 /* linux/arch/arm/mach-s5pc100/mach-smdkc100.c
3 * Copyright 2009 Samsung Electronics Co.
4 * Author: Byungho Min <bhmin@samsung.com>
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.
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>
21 #include <linux/gpio.h>
22 #include <linux/i2c.h>
24 #include <linux/delay.h>
25 #include <linux/input.h>
27 #include <asm/mach/arch.h>
28 #include <asm/mach/map.h>
31 #include <mach/regs-fb.h>
32 #include <video/platform_lcd.h>
35 #include <asm/mach-types.h>
37 #include <plat/regs-serial.h>
38 #include <plat/gpio-cfg.h>
40 #include <plat/clock.h>
41 #include <plat/devs.h>
43 #include <plat/s5pc100.h>
48 #include <plat/keypad.h>
50 #include <plat/audio.h>
52 /* Following are default values for UCON, ULCON and UFCON UART registers */
53 #define SMDKC100_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
54 S3C2410_UCON_RXILEVEL | \
55 S3C2410_UCON_TXIRQMODE | \
56 S3C2410_UCON_RXIRQMODE | \
57 S3C2410_UCON_RXFIFO_TOI | \
58 S3C2443_UCON_RXERR_IRQEN)
60 #define SMDKC100_ULCON_DEFAULT S3C2410_LCON_CS8
62 #define SMDKC100_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
63 S3C2440_UFCON_RXTRIG8 | \
64 S3C2440_UFCON_TXTRIG16)
66 static struct s3c2410_uartcfg smdkc100_uartcfgs[] __initdata = {
70 .ucon = SMDKC100_UCON_DEFAULT,
71 .ulcon = SMDKC100_ULCON_DEFAULT,
72 .ufcon = SMDKC100_UFCON_DEFAULT,
77 .ucon = SMDKC100_UCON_DEFAULT,
78 .ulcon = SMDKC100_ULCON_DEFAULT,
79 .ufcon = SMDKC100_UFCON_DEFAULT,
84 .ucon = SMDKC100_UCON_DEFAULT,
85 .ulcon = SMDKC100_ULCON_DEFAULT,
86 .ufcon = SMDKC100_UFCON_DEFAULT,
91 .ucon = SMDKC100_UCON_DEFAULT,
92 .ulcon = SMDKC100_ULCON_DEFAULT,
93 .ufcon = SMDKC100_UFCON_DEFAULT,
98 static struct i2c_board_info i2c_devs0[] __initdata = {
99 {I2C_BOARD_INFO("wm8580", 0x1b),},
103 static struct i2c_board_info i2c_devs1[] __initdata = {
106 /* LCD power controller */
107 static void smdkc100_lcd_power_set(struct plat_lcd_data *pd,
111 gpio_direction_output(S5PC100_GPD(0), power);
115 gpio_direction_output(S5PC100_GPH0(6), 1);
117 gpio_direction_output(S5PC100_GPH0(6), 0);
119 gpio_direction_output(S5PC100_GPH0(6), 1);
124 static struct plat_lcd_data smdkc100_lcd_power_data = {
125 .set_power = smdkc100_lcd_power_set,
128 static struct platform_device smdkc100_lcd_powerdev = {
129 .name = "platform-lcd",
130 .dev.parent = &s3c_device_fb.dev,
131 .dev.platform_data = &smdkc100_lcd_power_data,
135 static struct s3c_fb_pd_win smdkc100_fb_win0 = {
136 /* this is to ensure we use win0 */
152 static struct s3c_fb_platdata smdkc100_lcd_pdata __initdata = {
153 .win[0] = &smdkc100_fb_win0,
154 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
155 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
156 .setup_gpio = s5pc100_fb_gpio_setup_24bpp,
159 static struct s3c_ide_platdata smdkc100_ide_pdata __initdata = {
160 .setup_gpio = s5pc100_ide_setup_gpio,
163 static uint32_t smdkc100_keymap[] __initdata = {
164 /* KEY(row, col, keycode) */
165 KEY(0, 3, KEY_1), KEY(0, 4, KEY_2), KEY(0, 5, KEY_3),
166 KEY(0, 6, KEY_4), KEY(0, 7, KEY_5),
167 KEY(1, 3, KEY_A), KEY(1, 4, KEY_B), KEY(1, 5, KEY_C),
168 KEY(1, 6, KEY_D), KEY(1, 7, KEY_E)
171 static struct matrix_keymap_data smdkc100_keymap_data __initdata = {
172 .keymap = smdkc100_keymap,
173 .keymap_size = ARRAY_SIZE(smdkc100_keymap),
176 static struct samsung_keypad_platdata smdkc100_keypad_data __initdata = {
177 .keymap_data = &smdkc100_keymap_data,
182 static struct platform_device *smdkc100_devices[] __initdata = {
193 &smdkc100_lcd_powerdev,
195 &s5pc100_device_iis0,
196 &samsung_device_keypad,
197 &s5pc100_device_ac97,
202 &s5pc100_device_spdif,
205 static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
208 .oversampling_shift = 2,
211 static void __init smdkc100_map_io(void)
213 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
214 s3c24xx_init_clocks(12000000);
215 s3c24xx_init_uarts(smdkc100_uartcfgs, ARRAY_SIZE(smdkc100_uartcfgs));
218 static void __init smdkc100_machine_init(void)
220 s3c24xx_ts_set_platdata(&s3c_ts_platform);
223 s3c_i2c0_set_platdata(NULL);
224 s3c_i2c1_set_platdata(NULL);
225 i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0));
226 i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));
228 s3c_fb_set_platdata(&smdkc100_lcd_pdata);
229 s3c_ide_set_platdata(&smdkc100_ide_pdata);
231 samsung_keypad_set_platdata(&smdkc100_keypad_data);
233 s5pc100_spdif_setup_gpio(S5PC100_SPDIF_GPD);
236 gpio_request(S5PC100_GPD(0), "GPD");
237 gpio_request(S5PC100_GPH0(6), "GPH0");
238 smdkc100_lcd_power_set(&smdkc100_lcd_power_data, 0);
239 platform_add_devices(smdkc100_devices, ARRAY_SIZE(smdkc100_devices));
242 MACHINE_START(SMDKC100, "SMDKC100")
243 /* Maintainer: Byungho Min <bhmin@samsung.com> */
244 .boot_params = S5P_PA_SDRAM + 0x100,
245 .init_irq = s5pc100_init_irq,
246 .map_io = smdkc100_map_io,
247 .init_machine = smdkc100_machine_init,
248 .timer = &s3c24xx_timer,