added option to atheros kernel to be able to disable reset button from inside the fon mp3 driver

SVN-Revision: 8969
This commit is contained in:
John Crispin 2007-09-23 00:32:31 +00:00
parent 059b0d3c54
commit d7502c446b
3 changed files with 26 additions and 2 deletions

View file

@ -31,6 +31,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/genhd.h> #include <linux/genhd.h>
#include <linux/device.h> #include <linux/device.h>
#include <asm-mips/mach-atheros/reset.h>
// do we want debuging info ? // do we want debuging info ?
#if 0 #if 0
@ -282,6 +283,10 @@ static int __init mod_init(void){
printk("mp3_drv.ko : Made by John '2B|!2B' Crispin (john@phrozen.org)\n"); printk("mp3_drv.ko : Made by John '2B|!2B' Crispin (john@phrozen.org)\n");
printk("mp3_drv.ko : Starting ...\n"); printk("mp3_drv.ko : Starting ...\n");
printk("disabling atheros reset button irq\n");
ar531x_disable_reset_button();
if(register_chrdev(DEV_MAJOR, DEV_NAME, &modulemp3_fops)) { if(register_chrdev(DEV_MAJOR, DEV_NAME, &modulemp3_fops)) {
printk( "mp3_drv.ko : Error whilst opening %s (%d)\n", DEV_NAME, DEV_MAJOR); printk( "mp3_drv.ko : Error whilst opening %s (%d)\n", DEV_NAME, DEV_MAJOR);
return( -ENODEV ); return( -ENODEV );

View file

@ -10,12 +10,16 @@
#include "ar531x.h" #include "ar531x.h"
#include "ar5315/ar5315.h" #include "ar5315/ar5315.h"
#define AR531X_RESET_GPIO_IRQ (AR531X_GPIO_IRQ_BASE + bcfg->resetConfigGpio)
struct event_t { struct event_t {
struct work_struct wq; struct work_struct wq;
int set; int set;
long int jiffies; long int jiffies;
}; };
static struct ar531x_boarddata *bcfg;
extern struct sock *uevent_sock; extern struct sock *uevent_sock;
extern u64 uevent_next_seqnum(void); extern u64 uevent_next_seqnum(void);
static int seen; 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; bcfg = (struct ar531x_boarddata *) board_config;
seen = jiffies; 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);

View file

@ -0,0 +1,6 @@
#ifndef __AR531X_RESET_H
#define __AR531X_RESET_H
void ar531x_disable_reset_button(void);
#endif /* __AR531X_RESET_H */