aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s3c2410/mach-h1940.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-s3c2410/mach-h1940.c')
-rw-r--r--arch/arm/mach-s3c2410/mach-h1940.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index fbedd0760941..779b45b3f80f 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -46,16 +46,17 @@
46#include <mach/h1940.h> 46#include <mach/h1940.h>
47#include <mach/h1940-latch.h> 47#include <mach/h1940-latch.h>
48#include <mach/fb.h> 48#include <mach/fb.h>
49#include <mach/ts.h>
50#include <plat/udc.h> 49#include <plat/udc.h>
51#include <plat/iic.h> 50#include <plat/iic.h>
52 51
52#include <plat/gpio-cfg.h>
53#include <plat/clock.h> 53#include <plat/clock.h>
54#include <plat/devs.h> 54#include <plat/devs.h>
55#include <plat/cpu.h> 55#include <plat/cpu.h>
56#include <plat/pll.h> 56#include <plat/pll.h>
57#include <plat/pm.h> 57#include <plat/pm.h>
58#include <plat/mci.h> 58#include <plat/mci.h>
59#include <plat/ts.h>
59 60
60static struct map_desc h1940_iodesc[] __initdata = { 61static struct map_desc h1940_iodesc[] __initdata = {
61 [0] = { 62 [0] = {
@@ -145,6 +146,7 @@ static struct s3c2410_ts_mach_info h1940_ts_cfg __initdata = {
145 .delay = 10000, 146 .delay = 10000,
146 .presc = 49, 147 .presc = 49,
147 .oversampling_shift = 2, 148 .oversampling_shift = 2,
149 .cfg_gpio = s3c24xx_ts_cfg_gpio,
148}; 150};
149 151
150/** 152/**
@@ -162,8 +164,8 @@ static struct s3c2410fb_display h1940_lcd __initdata = {
162 .xres = 240, 164 .xres = 240,
163 .yres = 320, 165 .yres = 320,
164 .bpp = 16, 166 .bpp = 16,
165 .left_margin = 20, 167 .left_margin = 8,
166 .right_margin = 8, 168 .right_margin = 20,
167 .hsync_len = 4, 169 .hsync_len = 4,
168 .upper_margin = 8, 170 .upper_margin = 8,
169 .lower_margin = 7, 171 .lower_margin = 7,
@@ -207,16 +209,16 @@ static int h1940_backlight_init(struct device *dev)
207{ 209{
208 gpio_request(S3C2410_GPB(0), "Backlight"); 210 gpio_request(S3C2410_GPB(0), "Backlight");
209 211
210 s3c2410_gpio_setpin(S3C2410_GPB(0), 0); 212 gpio_direction_output(S3C2410_GPB(0), 0);
211 s3c2410_gpio_pullup(S3C2410_GPB(0), 0); 213 s3c_gpio_setpull(S3C2410_GPB(0), S3C_GPIO_PULL_NONE);
212 s3c2410_gpio_cfgpin(S3C2410_GPB(0), S3C2410_GPB0_TOUT0); 214 s3c_gpio_cfgpin(S3C2410_GPB(0), S3C2410_GPB0_TOUT0);
213 215
214 return 0; 216 return 0;
215} 217}
216 218
217static void h1940_backlight_exit(struct device *dev) 219static void h1940_backlight_exit(struct device *dev)
218{ 220{
219 s3c2410_gpio_cfgpin(S3C2410_GPB(0), 1/*S3C2410_GPB0_OUTP*/); 221 gpio_direction_output(S3C2410_GPB(0), 1);
220} 222}
221 223
222static struct platform_pwm_backlight_data backlight_data = { 224static struct platform_pwm_backlight_data backlight_data = {
@@ -245,18 +247,18 @@ static void h1940_lcd_power_set(struct plat_lcd_data *pd,
245 247
246 if (!power) { 248 if (!power) {
247 /* set to 3ec */ 249 /* set to 3ec */
248 s3c2410_gpio_setpin(S3C2410_GPC(0), 0); 250 gpio_direction_output(S3C2410_GPC(0), 0);
249 /* wait for 3ac */ 251 /* wait for 3ac */
250 do { 252 do {
251 value = s3c2410_gpio_getpin(S3C2410_GPC(6)); 253 value = gpio_get_value(S3C2410_GPC(6));
252 } while (value); 254 } while (value);
253 /* set to 38c */ 255 /* set to 38c */
254 s3c2410_gpio_setpin(S3C2410_GPC(5), 0); 256 gpio_direction_output(S3C2410_GPC(5), 0);
255 } else { 257 } else {
256 /* Set to 3ac */ 258 /* Set to 3ac */
257 s3c2410_gpio_setpin(S3C2410_GPC(5), 1); 259 gpio_direction_output(S3C2410_GPC(5), 1);
258 /* Set to 3ad */ 260 /* Set to 3ad */
259 s3c2410_gpio_setpin(S3C2410_GPC(0), 1); 261 gpio_direction_output(S3C2410_GPC(0), 1);
260 } 262 }
261} 263}
262 264
@@ -271,7 +273,6 @@ static struct platform_device h1940_lcd_powerdev = {
271}; 273};
272 274
273static struct platform_device *h1940_devices[] __initdata = { 275static struct platform_device *h1940_devices[] __initdata = {
274 &s3c_device_ts,
275 &s3c_device_ohci, 276 &s3c_device_ohci,
276 &s3c_device_lcd, 277 &s3c_device_lcd,
277 &s3c_device_wdt, 278 &s3c_device_wdt,
@@ -285,6 +286,8 @@ static struct platform_device *h1940_devices[] __initdata = {
285 &s3c_device_timer[0], 286 &s3c_device_timer[0],
286 &h1940_backlight, 287 &h1940_backlight,
287 &h1940_lcd_powerdev, 288 &h1940_lcd_powerdev,
289 &s3c_device_adc,
290 &s3c_device_ts,
288}; 291};
289 292
290static void __init h1940_map_io(void) 293static void __init h1940_map_io(void)
@@ -332,12 +335,13 @@ static void __init h1940_init(void)
332 gpio_request(S3C2410_GPC(5), "LCD power"); 335 gpio_request(S3C2410_GPC(5), "LCD power");
333 gpio_request(S3C2410_GPC(6), "LCD power"); 336 gpio_request(S3C2410_GPC(6), "LCD power");
334 337
338 gpio_direction_input(S3C2410_GPC(6));
335 339
336 platform_add_devices(h1940_devices, ARRAY_SIZE(h1940_devices)); 340 platform_add_devices(h1940_devices, ARRAY_SIZE(h1940_devices));
337} 341}
338 342
339MACHINE_START(H1940, "IPAQ-H1940") 343MACHINE_START(H1940, "IPAQ-H1940")
340 /* Maintainer: Ben Dooks <ben@fluff.org> */ 344 /* Maintainer: Ben Dooks <ben-linux@fluff.org> */
341 .phys_io = S3C2410_PA_UART, 345 .phys_io = S3C2410_PA_UART,
342 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, 346 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
343 .boot_params = S3C2410_SDRAM_PA + 0x100, 347 .boot_params = S3C2410_SDRAM_PA + 0x100,