[Armadeus-commitlog] SF.net SVN: armadeus: [785] trunk/target/linux/modules/fpga
Brought to you by:
sszy
|
From: <Fa...@us...> - 2008-04-02 15:05:18
|
Revision: 785
http://armadeus.svn.sourceforge.net/armadeus/?rev=785&view=rev
Author: FabM
Date: 2008-04-02 08:05:24 -0700 (Wed, 02 Apr 2008)
Log Message:
-----------
[LINUX][DRIVERS] adding GPL, and correct some mistakes
Modified Paths:
--------------
trunk/target/linux/modules/fpga/Wb_button/button.c
trunk/target/linux/modules/fpga/Wb_button/button.h
trunk/target/linux/modules/fpga/Wb_led/led.c
trunk/target/linux/modules/fpga/Wb_led/led.h
trunk/target/linux/modules/fpga/fpga_devtools/fpga-loader.h
Modified: trunk/target/linux/modules/fpga/Wb_button/button.c
===================================================================
--- trunk/target/linux/modules/fpga/Wb_button/button.c 2008-04-02 12:28:13 UTC (rev 784)
+++ trunk/target/linux/modules/fpga/Wb_button/button.c 2008-04-02 15:05:24 UTC (rev 785)
@@ -1,6 +1,24 @@
-/* button.c
- * Driver for bus_led fpga IP
+/*
+ ***********************************************************************
+ *
+ * (c) Copyright 2007 Armadeus project
* Fabien Marteau <fab...@ar...>
+ * Driver for Wb_button IP
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ **********************************************************************
*/
#include "button.h"
@@ -33,12 +51,16 @@
struct button_dev *ldev = dev_id;
u16 data;
- /* wake up reading process */
- if(ldev->reading)up(&ldev->sem);
- /* acknowledge irq_mngr */
- data=1;
- BUG_ON((button_fpga_write(ldev->fpga_virtual_base_address + FPGA_IRQ_ACK,&data,ldev))<0);
+ button_fpga_read(ldev->fpga_virtual_base_address + FPGA_IRQ_PEND,&data,ldev);
+ if(data&WB_BUTTON_IRQ){
+ /* wake up reading process */
+ if(ldev->reading)up(&ldev->sem);
+ /* acknowledge irq_mngr */
+ button_fpga_write(ldev->fpga_virtual_base_address + FPGA_IRQ_ACK,&data,ldev);
+ }
+ PDEBUG("Interrupt raised %x\n",data);
+
return IRQ_HANDLED;
}
@@ -114,6 +136,10 @@
return -ENOMEM;
}
+ /* initiate mutex locked */
+ sdev->reading = 0;
+ init_MUTEX_LOCKED(&sdev->sem);
+
/* Get the major and minor device numbers */
PDEBUG("Get the major and minor device numbers\n");
if(button_major){
@@ -141,25 +167,24 @@
/* Requested I/O memory */
sdev->fpga_virtual_base_address = (void*)IMX_CS1_VIRT;
- /* irq registering */
- if(request_irq(IRQ_GPIOA(1),(irq_handler_t)fpga_interrupt,IRQF_SHARED,FPGA_IRQ_NAME,sdev)<0){
- printk(KERN_ERR "Can't request fpga irq\n");
+ /* irq unmask */
+ data=1;
+ if((result=button_fpga_write(sdev->fpga_virtual_base_address + FPGA_IRQ_MASK,&data,sdev))<0)
goto error;
- }
+
/* irq acknowledge */
data=1;
if((result=button_fpga_write(sdev->fpga_virtual_base_address + FPGA_IRQ_ACK,&data,sdev))<0)
goto error;
- /* irq unmask */
- data=1;
- if((result=button_fpga_write(sdev->fpga_virtual_base_address + FPGA_IRQ_MASK,&data,sdev))<0)
+
+ /* irq registering */
+ printk(KERN_INFO "button: fpga irq shared gpioa 1\n");
+ if(request_irq(IRQ_GPIOA(1),(irq_handler_t)fpga_interrupt,IRQF_SHARED,FPGA_IRQ_NAME,sdev)<0){
+ printk(KERN_ERR "Can't request fpga irq\n");
goto error;
+ }
- /* initiate mutex locked */
- sdev->reading = 0;
- init_MUTEX_LOCKED(&sdev->sem);
-
/* OK module inserted ! */
buttondev = sdev;
printk(KERN_INFO "button module insered\n");
Modified: trunk/target/linux/modules/fpga/Wb_button/button.h
===================================================================
--- trunk/target/linux/modules/fpga/Wb_button/button.h 2008-04-02 12:28:13 UTC (rev 784)
+++ trunk/target/linux/modules/fpga/Wb_button/button.h 2008-04-02 15:05:24 UTC (rev 785)
@@ -1,7 +1,24 @@
-/* button.h
+/*
+ ***********************************************************************
+ *
+ * (c) Copyright 2007 Armadeus project
+ * Fabien Marteau <fab...@ar...>
* Driver for Wb_button IP
- * Fabien Marteau <fab...@ar...>
- * 28 mars 2008
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ **********************************************************************
*/
@@ -46,13 +63,13 @@
#endif
/* for debugging messages*/
-#define BUTTON_DEBUG
+/*#define BUTTON_DEBUG*/
#undef PDEBUG
#ifdef BUTTON_DEBUG
# ifdef __KERNEL__
/* for kernel spage */
-# define PDEBUG(fmt,args...) printk(KERN_DEBUG "button : " fmt, ##args)
+# define PDEBUG(fmt,args...) printk(KERN_INFO "button : " fmt, ##args)
# else
/* for user space */
# define PDEBUG(fmt,args...) printk(stderr, fmt, ##args)
Modified: trunk/target/linux/modules/fpga/Wb_led/led.c
===================================================================
--- trunk/target/linux/modules/fpga/Wb_led/led.c 2008-04-02 12:28:13 UTC (rev 784)
+++ trunk/target/linux/modules/fpga/Wb_led/led.c 2008-04-02 15:05:24 UTC (rev 785)
@@ -1,6 +1,24 @@
-/* led.c
- * Driver for bus_led fpga IP
+/*
+ ***********************************************************************
+ *
+ * (c) Copyright 2008 Armadeus project
* Fabien Marteau <fab...@ar...>
+ * Driver for Wb_led fpga IP
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ **********************************************************************
*/
#include "led.h"
Modified: trunk/target/linux/modules/fpga/Wb_led/led.h
===================================================================
--- trunk/target/linux/modules/fpga/Wb_led/led.h 2008-04-02 12:28:13 UTC (rev 784)
+++ trunk/target/linux/modules/fpga/Wb_led/led.h 2008-04-02 15:05:24 UTC (rev 785)
@@ -1,6 +1,24 @@
-/* led.h
- * Driver for bus_led IP
+/*
+ ***********************************************************************
+ *
+ * (c) Copyright 2007 Armadeus project
* Fabien Marteau <fab...@ar...>
+ * Driver for Wb_led IP
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ **********************************************************************
*/
Modified: trunk/target/linux/modules/fpga/fpga_devtools/fpga-loader.h
===================================================================
--- trunk/target/linux/modules/fpga/fpga_devtools/fpga-loader.h 2008-04-02 12:28:13 UTC (rev 784)
+++ trunk/target/linux/modules/fpga/fpga_devtools/fpga-loader.h 2008-04-02 15:05:24 UTC (rev 785)
@@ -1,26 +1,26 @@
-/*
- ***********************************************************************
- *
- * (c) Copyright 2006 Armadeus project
- * Julien Boibessot <jul...@ar...>
- * Nicolas Colombain <nic...@ar...>
- * Generic Xilinx FPGA loader
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- **********************************************************************
- */
+/*
+ ***********************************************************************
+ *
+ * (c) Copyright 2006 Armadeus project
+ * Julien Boibessot <jul...@ar...>
+ * Nicolas Colombain <nic...@ar...>
+ * Generic Xilinx FPGA loader
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ **********************************************************************
+ */
#ifndef __FPGA_LOADER_H__
#define __FPGA_LOADER_H__
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|