点亮led灯程序(驱动部分)
#include <linux/module.h> #include <linux/kernel.h> #include <linux/fs.h> #include <linux/init.h> #include <linux/delay.h> #include <asm/uaccess.h> #include <asm/irq.h> #include <asm/io.h> #include <asm/arch/regs-gpio.h> #include <asm/hardware.h> static struct class *firstdrv_class; static struct class_device *firstdrv_class_dev; volatile unsigned long *gpfcon =NULL; volatile unsigned long *gpfdat =NULL; static int first_drv_init(void); static int first_drv_open(struct inode *inode, struct file *file ) { //printk("first_drv_open\n"); /*配置GPF4,5,6 为输出*/ //初始状态为输入 *gpfcon &= ~((0x3<<(4*2) ) |