X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/f770cc114f7c8843c06715df3cf0a789c3f0e49c..20abafaaf5fdb4dd7cb1e09a028b1c2c689557b7:/target/linux/danube/files/drivers/char/danube_led.c diff --git a/target/linux/danube/files/drivers/char/danube_led.c b/target/linux/danube/files/drivers/char/danube_led.c index 38ac4c170..86a92d599 100644 --- a/target/linux/danube/files/drivers/char/danube_led.c +++ b/target/linux/danube/files/drivers/char/danube_led.c @@ -29,7 +29,7 @@ #include #include #include -#include +#include #define DANUBE_LED_CLK_EDGE DANUBE_LED_FALLING //#define DANUBE_LED_CLK_EDGE DANUBE_LED_RISING @@ -87,24 +87,6 @@ danube_led_setup_gpio (void) } } -static void -danube_led_enable (void) -{ - int err = 1000000; - - writel(readl(DANUBE_PMU_PWDCR) & ~DANUBE_PMU_PWDCR_LED, DANUBE_PMU_PWDCR); - while (--err && (readl(DANUBE_PMU_PWDSR) & DANUBE_PMU_PWDCR_LED)) {} - - if (!err) - panic("Activating LED in PMU failed!"); -} - -static inline void -danube_led_disable (void) -{ - writel(readl(DANUBE_PMU_PWDCR) | DANUBE_PMU_PWDCR_LED, DANUBE_PMU_PWDCR); -} - static int led_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { @@ -187,7 +169,7 @@ danube_led_init (void) writel(readl(DANUBE_LED_CON0) | DANUBE_LED_ADSL_SRC, DANUBE_LED_CON0); /* per default, the leds are turned on */ - danube_led_enable(); + danube_pmu_enable(DANUBE_PMU_PWDCR_LED); danube_led_major = register_chrdev(0, "danube_led", &danube_led_fops);