Commit db61ac54 authored by Ben Dooks's avatar Ben Dooks

ARM: H1940: Change mach-h1940 to use gpiolib API

Change  mach-h1940 to use the gpiolib calls instead of s3c2410_gpio
directly.
Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
parent afc84ad1
...@@ -207,7 +207,7 @@ static int h1940_backlight_init(struct device *dev) ...@@ -207,7 +207,7 @@ static int h1940_backlight_init(struct device *dev)
{ {
gpio_request(S3C2410_GPB(0), "Backlight"); gpio_request(S3C2410_GPB(0), "Backlight");
s3c2410_gpio_setpin(S3C2410_GPB(0), 0); gpio_direction_output(S3C2410_GPB(0), 0);
s3c2410_gpio_pullup(S3C2410_GPB(0), 0); s3c2410_gpio_pullup(S3C2410_GPB(0), 0);
s3c2410_gpio_cfgpin(S3C2410_GPB(0), S3C2410_GPB0_TOUT0); s3c2410_gpio_cfgpin(S3C2410_GPB(0), S3C2410_GPB0_TOUT0);
...@@ -216,7 +216,7 @@ static int h1940_backlight_init(struct device *dev) ...@@ -216,7 +216,7 @@ static int h1940_backlight_init(struct device *dev)
static void h1940_backlight_exit(struct device *dev) static void h1940_backlight_exit(struct device *dev)
{ {
s3c2410_gpio_cfgpin(S3C2410_GPB(0), 1/*S3C2410_GPB0_OUTP*/); gpio_direction_output(S3C2410_GPB(0), 1);
} }
static struct platform_pwm_backlight_data backlight_data = { static struct platform_pwm_backlight_data backlight_data = {
...@@ -245,18 +245,18 @@ static void h1940_lcd_power_set(struct plat_lcd_data *pd, ...@@ -245,18 +245,18 @@ static void h1940_lcd_power_set(struct plat_lcd_data *pd,
if (!power) { if (!power) {
/* set to 3ec */ /* set to 3ec */
s3c2410_gpio_setpin(S3C2410_GPC(0), 0); gpio_direction_output(S3C2410_GPC(0), 0);
/* wait for 3ac */ /* wait for 3ac */
do { do {
value = s3c2410_gpio_getpin(S3C2410_GPC(6)); value = gpio_get_value(S3C2410_GPC(6));
} while (value); } while (value);
/* set to 38c */ /* set to 38c */
s3c2410_gpio_setpin(S3C2410_GPC(5), 0); gpio_direction_output(S3C2410_GPC(5), 0);
} else { } else {
/* Set to 3ac */ /* Set to 3ac */
s3c2410_gpio_setpin(S3C2410_GPC(5), 1); gpio_direction_output(S3C2410_GPC(5), 1);
/* Set to 3ad */ /* Set to 3ad */
s3c2410_gpio_setpin(S3C2410_GPC(0), 1); gpio_direction_output(S3C2410_GPC(0), 1);
} }
} }
...@@ -332,6 +332,7 @@ static void __init h1940_init(void) ...@@ -332,6 +332,7 @@ static void __init h1940_init(void)
gpio_request(S3C2410_GPC(5), "LCD power"); gpio_request(S3C2410_GPC(5), "LCD power");
gpio_request(S3C2410_GPC(6), "LCD power"); gpio_request(S3C2410_GPC(6), "LCD power");
gpio_direction_input(S3C2410_GPC(6));
platform_add_devices(h1940_devices, ARRAY_SIZE(h1940_devices)); platform_add_devices(h1940_devices, ARRAY_SIZE(h1940_devices));
} }
......
...@@ -85,10 +85,10 @@ static void smdk2413_udc_pullup(enum s3c2410_udc_cmd_e cmd) ...@@ -85,10 +85,10 @@ static void smdk2413_udc_pullup(enum s3c2410_udc_cmd_e cmd)
switch (cmd) switch (cmd)
{ {
case S3C2410_UDC_P_ENABLE : case S3C2410_UDC_P_ENABLE :
s3c2410_gpio_setpin(S3C2410_GPF(2), 1); gpio_set_value(S3C2410_GPF(2), 1);
break; break;
case S3C2410_UDC_P_DISABLE : case S3C2410_UDC_P_DISABLE :
s3c2410_gpio_setpin(S3C2410_GPF(2), 0); gpio_set_value(S3C2410_GPF(2), 0);
break; break;
case S3C2410_UDC_P_RESET : case S3C2410_UDC_P_RESET :
break; break;
...@@ -134,8 +134,8 @@ static void __init smdk2413_machine_init(void) ...@@ -134,8 +134,8 @@ static void __init smdk2413_machine_init(void)
{ /* Turn off suspend on both USB ports, and switch the { /* Turn off suspend on both USB ports, and switch the
* selectable USB port to USB device mode. */ * selectable USB port to USB device mode. */
s3c2410_gpio_setpin(S3C2410_GPF(2), 0); WARN_ON(gpio_request(S3C2410_GPF(2), "udc pull"));
s3c2410_gpio_cfgpin(S3C2410_GPF(2), S3C2410_GPIO_OUTPUT); gpio_direction_output(S3C2410_GPF(2), 0);
s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST | s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST |
S3C2410_MISCCR_USBSUSPND0 | S3C2410_MISCCR_USBSUSPND0 |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment