共 18 篇文章 |
|
阅1881 转3 评0 公众公开 12-08-08 14:38 |
否则返回错误码*/int uart_add_one_port(struct uart_driver *drv, struct uart_port *port)4、uart_remove_one_port/* 功能: uart_remove_one_port用于删除一个已添加到串口驱动中的串口端口,通常在驱动卸载时调用该函数* 参数 drv: 串口驱动* port: 要删除的串口端口* 返回值: 成功,返回0; 阅6334 转67 评0 公众公开 12-08-06 16:37 |
miscdevice、platform_device区别miscdevice、platform_device区别?Linux设备模型中:bus_type、device、device_driver《Linux设备驱动程序》的linux设备模型章中说到设备模型中,所有设备都通过总线相连。3、miscdevice、platform_device、platform_driver是否可以作为通用的设备驱动方法,由platform_device注册设备资源platform_driver注册... 阅2635 转6 评0 公众公开 12-08-06 11:34 |
LCD驱动之时钟设置。#define LCD_VSYNC_LEN 9#define LCD_CON5 (S3C2410_LCDCON5_FRM565 |S3C2410_LCDCON5_INVVDEN | S3C2410_LCDCON5_INVVFRAME | S3C2410_LCDCON5_INVVLINE| S3C2410_LCDCON5_INVVCLK | S3C2410_LCDCON5_HWSWP)#define LCD_CON5 (S3C2410_LCDCON5_FRM565 | S3C2410_LCDCON5_INVVDEN | S3C2410_LCDCON5_INVVFRAME | S3C24... 阅3698 转6 评0 公众公开 12-04-24 17:33 |
其中比较重要的就是struct fb_var_screeninfo var; struct fb_fix_screeninfo fix;2、struct fb_var_screeninfo.//下面这函数设置lcd寄存器 s3c2410fb_init_registers(fbinfo); //这个是将lcd的配置写入,这里主要搞清几个结构体的关系 //特别注意fb_info后面还加了一点空间用来保存info的,而info->dev = &... 阅2664 转15 评0 公众公开 12-04-24 17:20 |
ret = request_irq(fbvar->lcd_irq_no, lcd_fb_irq, IRQF_DISABLED, pdev->name, fbvar);/*给fb_info分配空间,大小为my2440fb_var结构的内存,framebuffer_alloc定义在fb.h中在fbsysfs.c中实现*/struct my2440fb_var *fbvar = dev_id;static void my2440fb_write_palette(struct my2440fb_var *fbvar)struct fb_var_screeninfo *var ... 阅1900 转14 评0 公众公开 12-04-23 23:34 |
INPUT驱动查看查看设备结点ls -l /dev/input查看设备信息ls -l /proc/bus/input/cat /proc/bus/input/devices查看input class信息。输入驱动数据结构 struct input_dev *input_dev;在驱动中必须动态分配input_dev结构,这里使用input_allocate_device();初始化input_dev的参数调用 input_register_device()注册,退出时调用 input_unregister_d... 阅1850 转4 评0 公众公开 12-04-10 19:48 |
阅421 转3 评0 公众公开 12-04-10 19:40 |
3、注册信号处理函数 void (*signal(int signum, void (*handler) (int) ) ) (int) 分析此函数: (1)void (*handler) (int) 这是一个函数指针,指向的函数返回值为void,只有一个参数int (2)signal(int signum, void (*handler) (int) )) 这是一个函数,有两个参数, 一个是int型,另一个是函数指针... 阅828 转9 评0 公众公开 12-03-23 12:49 |
2、wait_event_interruptible(button_waitq, ev_press);#define wait_event_interruptible(wq, condition)\({\int __ret = 0;\if (!(condition))\__wait_event_interruptible(wq, condition, __ret);\__ret;\})当条件condition为0是调用__wait_event_interruptible(wq, condition, __ret)进行休眠; 阅195 转3 评0 公众公开 12-03-22 20:50 |