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/leds-neo1973-gta02.c | |
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/leds-neo1973-gta02.c')
-rw-r--r-- | drivers/leds/leds-neo1973-gta02.c | 12 |
1 files changed, 6 insertions, 6 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; |