diff options
author | Holger Freyther <zecke@openmoko.org> | 2008-11-19 17:09:38 +0000 |
---|---|---|
committer | Andy Green <agreen@pads.home.warmcat.com> | 2008-11-19 17:09:38 +0000 |
commit | ab0a466054d12647d906cf3a9ac9cb19cbd7607b (patch) | |
tree | 28270cfdc9a73ac7c42ea52f6e15e352d9577933 /drivers/leds | |
parent | 77739f17fbae2718f4de551969e5c3b47b041978 (diff) |
[neo] Every access to GPIO bank B has to go through the shadow code
- Any setting of any PIN on bank B will undo the LED setting.
Introduce neo1973_gpb_set_pin to set the PIN in a way not losing
the LED or any other shadowed setting.
- Update users of GPBXY for gta01 and gta02.
Signed-Off-By: Holger Freyther <zecke@openmoko.org>
Diffstat (limited to 'drivers/leds')
-rw-r--r-- | drivers/leds/leds-neo1973-gta02.c | 12 | ||||
-rw-r--r-- | drivers/leds/leds-neo1973-vibrator.c | 7 |
2 files changed, 10 insertions, 9 deletions
diff --git a/drivers/leds/leds-neo1973-gta02.c b/drivers/leds/leds-neo1973-gta02.c index 343550ae498..952ad691d69 100644 --- a/drivers/leds/leds-neo1973-gta02.c +++ b/drivers/leds/leds-neo1973-gta02.c @@ -20,6 +20,7 @@ #include <asm/arch/pwm.h> #include <asm/arch/gta02.h> #include <asm/plat-s3c/regs-timer.h> +#include <asm/plat-s3c24xx/neo1973.h> #define MAX_LEDS 3 #define COUNTER 256 @@ -60,14 +61,13 @@ static void gta02led_set(struct led_classdev *led_cdev, * value == 0 -> 0% duty cycle (zero power) */ mutex_lock(&lp->mutex); + if (lp->has_pwm) { - s3c2410_pwm_duty_cycle(value, &lp->pwm); + s3c2410_pwm_duty_cycle(value, &lp->pwm); } else { - if (value) - s3c2410_gpio_setpin(lp->gpio, 1); - else - s3c2410_gpio_setpin(lp->gpio, 0); + neo1973_gpb_setpin(lp->gpio, value ? 1 : 0); } + mutex_unlock(&lp->mutex); } @@ -164,7 +164,7 @@ static int __init gta02led_probe(struct platform_device *pdev) case S3C2410_GPB3: lp->has_pwm = 0; s3c2410_gpio_cfgpin(lp->gpio, S3C2410_GPIO_OUTPUT); - s3c2410_gpio_setpin(lp->gpio, 0); + neo1973_gpb_add_shadow_gpio(lp->gpio); break; default: break; diff --git a/drivers/leds/leds-neo1973-vibrator.c b/drivers/leds/leds-neo1973-vibrator.c index f31302d2ca9..647e8603430 100644 --- a/drivers/leds/leds-neo1973-vibrator.c +++ b/drivers/leds/leds-neo1973-vibrator.c @@ -24,6 +24,7 @@ #include <asm/plat-s3c/regs-timer.h> #include <asm/arch-s3c2410/fiq_ipc_gta02.h> +#include <asm/plat-s3c24xx/neo1973.h> #define COUNTER 64 @@ -56,9 +57,9 @@ static void neo1973_vib_vib_set(struct led_classdev *led_cdev, s3c2410_pwm_duty_cycle(value / 4, &vp->pwm); else { if (value) - s3c2410_gpio_setpin(vp->gpio, 1); + neo1973_gpb_setpin(vp->gpio, 1); else - s3c2410_gpio_setpin(vp->gpio, 0); + neo1973_gpb_setpin(vp->gpio, 0); } mutex_unlock(&vp->mutex); @@ -131,7 +132,7 @@ static int __init neo1973_vib_probe(struct platform_device *pdev) platform_set_drvdata(pdev, &neo1973_vib_led); if (machine_is_neo1973_gta02()) { /* use FIQ to control GPIO */ - s3c2410_gpio_setpin(neo1973_vib_led.gpio, 0); /* off */ + neo1973_gpb_setpin(neo1973_vib_led.gpio, 0); /* off */ s3c2410_gpio_cfgpin(neo1973_vib_led.gpio, S3C2410_GPIO_OUTPUT); /* safe, kmalloc'd copy needed for FIQ ISR */ fiq_ipc.vib_gpio_pin = neo1973_vib_led.gpio; |