aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McNeil <sean@mcneil.com>2008-11-19 17:11:00 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-11-19 17:11:00 +0000
commit6ace15281cc7c8ab74d34ec392d02ed413685c47 (patch)
treecde21a40d727f851be6fd0e035577dbb655c9cfb
parentf4f5a38fe5482109d835ab81b61b34be5e30cb2e (diff)
clean-leds-remove-pwm-stuff.patch
Remove unsued PWM stuff around LEDs. Signed-off-by: Sean McNeil <sean@mcneil.com>
-rw-r--r--drivers/leds/leds-neo1973-gta02.c56
1 files changed, 2 insertions, 54 deletions
diff --git a/drivers/leds/leds-neo1973-gta02.c b/drivers/leds/leds-neo1973-gta02.c
index 4b8687d0427..706f99fc6b3 100644
--- a/drivers/leds/leds-neo1973-gta02.c
+++ b/drivers/leds/leds-neo1973-gta02.c
@@ -17,7 +17,6 @@
#include <linux/leds.h>
#include <mach/hardware.h>
#include <asm/mach-types.h>
-#include <asm/arch/pwm.h>
#include <asm/arch/gta02.h>
#include <asm/plat-s3c/regs-timer.h>
#include <asm/plat-s3c24xx/neo1973.h>
@@ -29,9 +28,7 @@ struct gta02_led_priv
{
spinlock_t lock;
struct led_classdev cdev;
- struct s3c2410_pwm pwm;
unsigned int gpio;
- unsigned int has_pwm;
};
struct gta02_led_bundle
@@ -56,19 +53,8 @@ static void gta02led_set(struct led_classdev *led_cdev,
unsigned long flags;
struct gta02_led_priv *lp = to_priv(led_cdev);
- /*
- * value == 255 -> 99% duty cycle (full power)
- * value == 128 -> 50% duty cycle (medium power)
- * value == 0 -> 0% duty cycle (zero power)
- */
spin_lock_irqsave(&lp->lock, flags);
-
- if (lp->has_pwm) {
- s3c2410_pwm_duty_cycle(value, &lp->pwm);
- } else {
- neo1973_gpb_setpin(lp->gpio, value ? 1 : 0);
- }
-
+ neo1973_gpb_setpin(lp->gpio, value ? 1 : 0);
spin_unlock_irqrestore(&lp->lock, flags);
}
@@ -128,42 +114,8 @@ static int __init gta02led_probe(struct platform_device *pdev)
switch (lp->gpio) {
case S3C2410_GPB0:
- lp->has_pwm = 1;
- lp->pwm.timerid = PWM0;
- s3c2410_gpio_cfgpin(lp->gpio, S3C2410_GPB0_TOUT0);
- break;
case S3C2410_GPB1:
- lp->has_pwm = 1;
- lp->pwm.timerid = PWM1;
- s3c2410_gpio_cfgpin(lp->gpio, S3C2410_GPB1_TOUT1);
- break;
case S3C2410_GPB2:
- lp->has_pwm = 1;
- lp->pwm.timerid = PWM2;
- s3c2410_gpio_cfgpin(lp->gpio, S3C2410_GPB2_TOUT2);
- break;
- case S3C2410_GPB3:
- lp->has_pwm = 1;
- lp->pwm.timerid = PWM3;
- s3c2410_gpio_cfgpin(lp->gpio, S3C2410_GPB3_TOUT3);
- break;
- default:
- break;
- }
-
- lp->pwm.prescaler = 0;
- lp->pwm.divider = S3C2410_TCFG1_MUX3_DIV8;
- lp->pwm.counter = COUNTER;
- lp->pwm.comparer = COUNTER;
- s3c2410_pwm_enable(&lp->pwm);
- s3c2410_pwm_start(&lp->pwm);
-
- switch (lp->gpio) {
- case S3C2410_GPB0:
- case S3C2410_GPB1:
- case S3C2410_GPB2:
- case S3C2410_GPB3:
- lp->has_pwm = 0;
s3c2410_gpio_cfgpin(lp->gpio, S3C2410_GPIO_OUTPUT);
neo1973_gpb_add_shadow_gpio(lp->gpio);
break;
@@ -187,11 +139,7 @@ static int gta02led_remove(struct platform_device *pdev)
for (i = 0; i < bundle->num_leds; i++) {
struct gta02_led_priv *lp = &bundle->led[i];
- if (lp->has_pwm)
- s3c2410_pwm_disable(&lp->pwm);
- else
- gta02led_set(&lp->cdev, 0);
-
+ gta02led_set(&lp->cdev, 0);
led_classdev_unregister(&lp->cdev);
}