aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s5p64x0/mach-smdk6450.c
diff options
context:
space:
mode:
authorAjay Kumar <ajaykumar.rs@samsung.com>2011-09-26 18:53:20 -0400
committerKukjin Kim <kgene.kim@samsung.com>2011-10-04 06:01:04 -0400
commit7301794c87e508f5919a70d109ea8e79562815ff (patch)
treef423125f150843c20d25c657734de7204658ca8c /arch/arm/mach-s5p64x0/mach-smdk6450.c
parent1030e5c56258969f96417faa8f77881b8c671b93 (diff)
ARM: S5P6450: Add LCD-LTE480 and enable Framebuffer support
This patch: -- Adds platform device support for LCD-LTE480. -- Adds platform data for FB with win_mode and default_bpp. -- Enables FB device support and platform-lcd support. -- Adds SPCON settings for LCD. Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s5p64x0/mach-smdk6450.c')
-rw-r--r--arch/arm/mach-s5p64x0/mach-smdk6450.c75
1 files changed, 75 insertions, 0 deletions
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6450.c b/arch/arm/mach-s5p64x0/mach-smdk6450.c
index 33f2adf8f3fe..92b5de1465b7 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6450.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6450.c
@@ -23,6 +23,9 @@
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/pwm_backlight.h> 25#include <linux/pwm_backlight.h>
26#include <linux/fb.h>
27
28#include <video/platform_lcd.h>
26 29
27#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
28#include <asm/mach/map.h> 31#include <asm/mach/map.h>
@@ -47,6 +50,8 @@
47#include <plat/ts.h> 50#include <plat/ts.h>
48#include <plat/s5p-time.h> 51#include <plat/s5p-time.h>
49#include <plat/backlight.h> 52#include <plat/backlight.h>
53#include <plat/fb.h>
54#include <plat/regs-fb.h>
50 55
51#define SMDK6450_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 56#define SMDK6450_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
52 S3C2410_UCON_RXILEVEL | \ 57 S3C2410_UCON_RXILEVEL | \
@@ -110,6 +115,59 @@ static struct s3c2410_uartcfg smdk6450_uartcfgs[] __initdata = {
110#endif 115#endif
111}; 116};
112 117
118/* Frame Buffer */
119static struct s3c_fb_pd_win smdk6450_fb_win0 = {
120 .win_mode = {
121 .left_margin = 8,
122 .right_margin = 13,
123 .upper_margin = 7,
124 .lower_margin = 5,
125 .hsync_len = 3,
126 .vsync_len = 1,
127 .xres = 800,
128 .yres = 480,
129 },
130 .max_bpp = 32,
131 .default_bpp = 24,
132};
133
134static struct s3c_fb_platdata smdk6450_lcd_pdata __initdata = {
135 .win[0] = &smdk6450_fb_win0,
136 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
137 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
138 .setup_gpio = s5p64x0_fb_gpio_setup_24bpp,
139};
140
141/* LCD power controller */
142static void smdk6450_lte480_reset_power(struct plat_lcd_data *pd,
143 unsigned int power)
144{
145 int err;
146
147 if (power) {
148 err = gpio_request(S5P6450_GPN(5), "GPN");
149 if (err) {
150 printk(KERN_ERR "failed to request GPN for lcd reset\n");
151 return;
152 }
153
154 gpio_direction_output(S5P6450_GPN(5), 1);
155 gpio_set_value(S5P6450_GPN(5), 0);
156 gpio_set_value(S5P6450_GPN(5), 1);
157 gpio_free(S5P6450_GPN(5));
158 }
159}
160
161static struct plat_lcd_data smdk6450_lcd_power_data = {
162 .set_power = smdk6450_lte480_reset_power,
163};
164
165static struct platform_device smdk6450_lcd_lte480wv = {
166 .name = "platform-lcd",
167 .dev.parent = &s3c_device_fb.dev,
168 .dev.platform_data = &smdk6450_lcd_power_data,
169};
170
113static struct platform_device *smdk6450_devices[] __initdata = { 171static struct platform_device *smdk6450_devices[] __initdata = {
114 &s3c_device_adc, 172 &s3c_device_adc,
115 &s3c_device_rtc, 173 &s3c_device_rtc,
@@ -119,6 +177,9 @@ static struct platform_device *smdk6450_devices[] __initdata = {
119 &s3c_device_wdt, 177 &s3c_device_wdt,
120 &samsung_asoc_dma, 178 &samsung_asoc_dma,
121 &s5p6450_device_iis0, 179 &s5p6450_device_iis0,
180 &s3c_device_fb,
181 &smdk6450_lcd_lte480wv,
182
122 /* s5p6450_device_spi0 will be added */ 183 /* s5p6450_device_spi0 will be added */
123}; 184};
124 185
@@ -172,6 +233,17 @@ static void __init smdk6450_map_io(void)
172 s5p_set_timer_source(S5P_PWM3, S5P_PWM4); 233 s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
173} 234}
174 235
236static void s5p6450_set_lcd_interface(void)
237{
238 unsigned int cfg;
239
240 /* select TFT LCD type (RGB I/F) */
241 cfg = __raw_readl(S5P64X0_SPCON0);
242 cfg &= ~S5P64X0_SPCON0_LCD_SEL_MASK;
243 cfg |= S5P64X0_SPCON0_LCD_SEL_RGB;
244 __raw_writel(cfg, S5P64X0_SPCON0);
245}
246
175static void __init smdk6450_machine_init(void) 247static void __init smdk6450_machine_init(void)
176{ 248{
177 s3c24xx_ts_set_platdata(&s3c_ts_platform); 249 s3c24xx_ts_set_platdata(&s3c_ts_platform);
@@ -185,6 +257,9 @@ static void __init smdk6450_machine_init(void)
185 257
186 samsung_bl_set(&smdk6450_bl_gpio_info, &smdk6450_bl_data); 258 samsung_bl_set(&smdk6450_bl_gpio_info, &smdk6450_bl_data);
187 259
260 s5p6450_set_lcd_interface();
261 s3c_fb_set_platdata(&smdk6450_lcd_pdata);
262
188 platform_add_devices(smdk6450_devices, ARRAY_SIZE(smdk6450_devices)); 263 platform_add_devices(smdk6450_devices, ARRAY_SIZE(smdk6450_devices));
189} 264}
190 265