added support for disabling atheros reset button to k7.09
authorJohn Crispin <john@openwrt.org>
Sun, 23 Sep 2007 00:37:04 +0000 (00:37 +0000)
committerJohn Crispin <john@openwrt.org>
Sun, 23 Sep 2007 00:37:04 +0000 (00:37 +0000)
SVN-Revision: 8971

target/linux/atheros-2.6/files/arch/mips/atheros/reset.c
target/linux/atheros-2.6/files/include/asm-mips/mach-atheros/reset.h [new file with mode: 0644]

index d62c5e1c4efe0a1ee7c49a8e07b2f4c07f4cc9af..cc2fb251a19fb3e9bad188dcc679b21fd367eb5c 100644 (file)
 #include "ar531x.h"
 #include "ar5315/ar5315.h"
 
 #include "ar531x.h"
 #include "ar5315/ar5315.h"
 
+#define AR531X_RESET_GPIO_IRQ  (AR531X_GPIO_IRQ_BASE + bcfg->resetConfigGpio)
+
 struct event_t {
        struct work_struct wq;
        int set;
        long int jiffies;
 };
 
 struct event_t {
        struct work_struct wq;
        int set;
        long int jiffies;
 };
 
+static struct ar531x_boarddata *bcfg;
+
 extern struct sock *uevent_sock;
 extern u64 uevent_next_seqnum(void);
 static int seen;
 extern struct sock *uevent_sock;
 extern u64 uevent_next_seqnum(void);
 static int seen;
@@ -94,15 +98,24 @@ static irqreturn_t button_handler(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
        return IRQ_HANDLED;
 }
 
+void ar531x_disable_reset_button(void)
+{
+       disable_irq(AR531X_RESET_GPIO_IRQ);     
+}
+
+EXPORT_SYMBOL(ar531x_disable_reset_button);
+
 int __init ar531x_init_reset(void)
 {
 int __init ar531x_init_reset(void)
 {
-       struct ar531x_boarddata *bcfg;
        bcfg = (struct ar531x_boarddata *) board_config;
 
        seen = jiffies;
        bcfg = (struct ar531x_boarddata *) board_config;
 
        seen = jiffies;
-       request_irq(AR531X_GPIO_IRQ_BASE + bcfg->resetConfigGpio, &button_handler, IRQF_SAMPLE_RANDOM, "ar531x_reset", NULL);
+       
+       request_irq(AR531X_RESET_GPIO_IRQ, &button_handler, IRQF_SAMPLE_RANDOM, "ar531x_reset", NULL);
 
        return 0;
 }
 
 
        return 0;
 }
 
+
+
 module_init(ar531x_init_reset);
 module_init(ar531x_init_reset);
diff --git a/target/linux/atheros-2.6/files/include/asm-mips/mach-atheros/reset.h b/target/linux/atheros-2.6/files/include/asm-mips/mach-atheros/reset.h
new file mode 100644 (file)
index 0000000..e9fa4c5
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __AR531X_RESET_H
+#define __AR531X_RESET_H
+
+void ar531x_disable_reset_button(void);
+
+#endif /* __AR531X_RESET_H */