X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/0cb4d5d1417df3ad237fdcdf5bb978faef253a9c..0dd225201a15d54ac6a166185eb6b8a057ac846d:/package/fonera-mp3-drv/src/mp3_drv.c diff --git a/package/fonera-mp3-drv/src/mp3_drv.c b/package/fonera-mp3-drv/src/mp3_drv.c index 960944418..82863ac41 100644 --- a/package/fonera-mp3-drv/src/mp3_drv.c +++ b/package/fonera-mp3-drv/src/mp3_drv.c @@ -31,6 +31,7 @@ #include #include #include +#include // do we want debuging info ? #if 0 @@ -101,11 +102,12 @@ static DECLARE_COMPLETION(mp3_exit); static int mp3_playback_thread(void *data){ int j; unsigned long timeout; + unsigned char empty = 0; printk("started kthread\n"); daemonize("kmp3"); while(mp3_buffering_status != MP3_PLAY_FINISHED){ if((mp3_buffering_status == MP3_PLAYING) || (mp3_buffering_status == MP3_BUFFER_FINISHED)){ - while(VS1011_NEEDS_DATA){ + while((VS1011_NEEDS_DATA) && (!empty)){ if(mp3_buffer_offset_read == MP3_BUFFER_SIZE){ mp3_buffer_offset_read = 0; } @@ -115,6 +117,7 @@ static int mp3_playback_thread(void *data){ printk("mp3_drv.ko : finished playing\n"); mp3_buffering_status = MP3_PLAY_FINISHED; } else { + empty = 1; printk("mp3_drv.ko : buffer empty ?\n"); if(mp3_buffering_status != MP3_PLAY_FINISHED){ } @@ -128,8 +131,9 @@ static int mp3_playback_thread(void *data){ } } } + empty = 0; timeout = 1; - timeout = wait_event_interruptible_timeout(wq, (timeout==0), timeout); + timeout = wait_event_interruptible_timeout(wq, (timeout==0), timeout); } complete_and_exit(&mp3_exit, 0); } @@ -279,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 : Starting ...\n"); + printk("disabling atheros reset button irq\n"); + + ar531x_disable_reset_button(); + if(register_chrdev(DEV_MAJOR, DEV_NAME, &modulemp3_fops)) { printk( "mp3_drv.ko : Error whilst opening %s (%d)\n", DEV_NAME, DEV_MAJOR); return( -ENODEV );