aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-exynos4/mach-smdkc210.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-exynos4/mach-smdkc210.c')
-rw-r--r--arch/arm/mach-exynos4/mach-smdkc210.c86
1 files changed, 86 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos4/mach-smdkc210.c b/arch/arm/mach-exynos4/mach-smdkc210.c
index e645f7a955f0..a7c65e05c1eb 100644
--- a/arch/arm/mach-exynos4/mach-smdkc210.c
+++ b/arch/arm/mach-exynos4/mach-smdkc210.c
@@ -9,24 +9,33 @@
9*/ 9*/
10 10
11#include <linux/serial_core.h> 11#include <linux/serial_core.h>
12#include <linux/delay.h>
12#include <linux/gpio.h> 13#include <linux/gpio.h>
14#include <linux/lcd.h>
13#include <linux/mmc/host.h> 15#include <linux/mmc/host.h>
14#include <linux/platform_device.h> 16#include <linux/platform_device.h>
15#include <linux/smsc911x.h> 17#include <linux/smsc911x.h>
16#include <linux/io.h> 18#include <linux/io.h>
17#include <linux/i2c.h> 19#include <linux/i2c.h>
20#include <linux/pwm_backlight.h>
18 21
19#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
20#include <asm/mach-types.h> 23#include <asm/mach-types.h>
21 24
25#include <video/platform_lcd.h>
26
22#include <plat/regs-serial.h> 27#include <plat/regs-serial.h>
23#include <plat/regs-srom.h> 28#include <plat/regs-srom.h>
29#include <plat/regs-fb-v4.h>
24#include <plat/exynos4.h> 30#include <plat/exynos4.h>
25#include <plat/cpu.h> 31#include <plat/cpu.h>
26#include <plat/devs.h> 32#include <plat/devs.h>
33#include <plat/fb.h>
27#include <plat/sdhci.h> 34#include <plat/sdhci.h>
28#include <plat/iic.h> 35#include <plat/iic.h>
29#include <plat/pd.h> 36#include <plat/pd.h>
37#include <plat/gpio-cfg.h>
38#include <plat/backlight.h>
30 39
31#include <mach/map.h> 40#include <mach/map.h>
32 41
@@ -111,6 +120,67 @@ static struct s3c_sdhci_platdata smdkc210_hsmmc3_pdata __initdata = {
111 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, 120 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
112}; 121};
113 122
123static void lcd_lte480wv_set_power(struct plat_lcd_data *pd,
124 unsigned int power)
125{
126 if (power) {
127#if !defined(CONFIG_BACKLIGHT_PWM)
128 gpio_request_one(EXYNOS4_GPD0(1), GPIOF_OUT_INIT_HIGH, "GPD0");
129 gpio_free(EXYNOS4_GPD0(1));
130#endif
131 /* fire nRESET on power up */
132 gpio_request(EXYNOS4_GPX0(6), "GPX0");
133
134 gpio_direction_output(EXYNOS4_GPX0(6), 1);
135 mdelay(100);
136
137 gpio_set_value(EXYNOS4_GPX0(6), 0);
138 mdelay(10);
139
140 gpio_set_value(EXYNOS4_GPX0(6), 1);
141 mdelay(10);
142
143 gpio_free(EXYNOS4_GPX0(6));
144 } else {
145#if !defined(CONFIG_BACKLIGHT_PWM)
146 gpio_request_one(EXYNOS4_GPD0(1), GPIOF_OUT_INIT_LOW, "GPD0");
147 gpio_free(EXYNOS4_GPD0(1));
148#endif
149 }
150}
151
152static struct plat_lcd_data smdkc210_lcd_lte480wv_data = {
153 .set_power = lcd_lte480wv_set_power,
154};
155
156static struct platform_device smdkc210_lcd_lte480wv = {
157 .name = "platform-lcd",
158 .dev.parent = &s5p_device_fimd0.dev,
159 .dev.platform_data = &smdkc210_lcd_lte480wv_data,
160};
161
162static struct s3c_fb_pd_win smdkc210_fb_win0 = {
163 .win_mode = {
164 .left_margin = 13,
165 .right_margin = 8,
166 .upper_margin = 7,
167 .lower_margin = 5,
168 .hsync_len = 3,
169 .vsync_len = 1,
170 .xres = 800,
171 .yres = 480,
172 },
173 .max_bpp = 32,
174 .default_bpp = 24,
175};
176
177static struct s3c_fb_platdata smdkc210_lcd0_pdata __initdata = {
178 .win[0] = &smdkc210_fb_win0,
179 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
180 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
181 .setup_gpio = exynos4_fimd0_gpio_setup_24bpp,
182};
183
114static struct resource smdkc210_smsc911x_resources[] = { 184static struct resource smdkc210_smsc911x_resources[] = {
115 [0] = { 185 [0] = {
116 .start = EXYNOS4_PA_SROM_BANK(1), 186 .start = EXYNOS4_PA_SROM_BANK(1),
@@ -165,6 +235,8 @@ static struct platform_device *smdkc210_devices[] __initdata = {
165 &exynos4_device_pd[PD_GPS], 235 &exynos4_device_pd[PD_GPS],
166 &exynos4_device_sysmmu, 236 &exynos4_device_sysmmu,
167 &samsung_asoc_dma, 237 &samsung_asoc_dma,
238 &s5p_device_fimd0,
239 &smdkc210_lcd_lte480wv,
168 &smdkc210_smsc911x, 240 &smdkc210_smsc911x,
169}; 241};
170 242
@@ -191,6 +263,17 @@ static void __init smdkc210_smsc911x_init(void)
191 (0x1 << S5P_SROM_BCX__TACS__SHIFT), S5P_SROM_BC1); 263 (0x1 << S5P_SROM_BCX__TACS__SHIFT), S5P_SROM_BC1);
192} 264}
193 265
266/* LCD Backlight data */
267static struct samsung_bl_gpio_info smdkc210_bl_gpio_info = {
268 .no = EXYNOS4_GPD0(1),
269 .func = S3C_GPIO_SFN(2),
270};
271
272static struct platform_pwm_backlight_data smdkc210_bl_data = {
273 .pwm_id = 1,
274 .pwm_period_ns = 1000,
275};
276
194static void __init smdkc210_map_io(void) 277static void __init smdkc210_map_io(void)
195{ 278{
196 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 279 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
@@ -210,6 +293,9 @@ static void __init smdkc210_machine_init(void)
210 s3c_sdhci2_set_platdata(&smdkc210_hsmmc2_pdata); 293 s3c_sdhci2_set_platdata(&smdkc210_hsmmc2_pdata);
211 s3c_sdhci3_set_platdata(&smdkc210_hsmmc3_pdata); 294 s3c_sdhci3_set_platdata(&smdkc210_hsmmc3_pdata);
212 295
296 samsung_bl_set(&smdkc210_bl_gpio_info, &smdkc210_bl_data);
297 s5p_fimd0_set_platdata(&smdkc210_lcd0_pdata);
298
213 platform_add_devices(smdkc210_devices, ARRAY_SIZE(smdkc210_devices)); 299 platform_add_devices(smdkc210_devices, ARRAY_SIZE(smdkc210_devices));
214} 300}
215 301