本文共 2163 字,大约阅读时间需要 7 分钟。
作用: 创建设备节点
替代函数: 消除了 2.6 内核中的class_device_create() 函数注意事项: #include <asm/device.h>mdev_create() 类似作用: 卸载设备节点
替代函数: 消除了 2.6 内核中的class_device_destroy() 函数注意事项: #include <asm/device.h>device_create() 配合使用**作用:**申请 USB 缓冲区,确保内存与硬件缓存一致性
替代函数: 消除了 2.6 内核中的usb_buffer_alloc() 函数注意事项: #include <asm/usb.h>作用: 释放 USB 缓冲区
替代函数: 消除了 2.6 内核中的usb_buffer_free() 函数注意事项: #include <asm/usb.h>作用: 获取块设备中的一个申请(主要用于读写块设备扇区)
替代函数: 消除了 2.6 内核中的elv_next_request() 函数注意事项: request 结构体的处理作用: 完成当前获取的请求结构体
替代函数: 消除了 2.6 内核中的end_request() 函数注意事项: error 为 0 表示读写扇区成功,error < 0 表示失败改动方向: 2.6 内核下的 net_device 结构体成员(与操作相关)已移至 net_device_ops 结构体下
net_device->hard_start_xmit(); // 发包函数net_device->tx_timeout(); // 发包超时处理函数
net_device->net_device_ops->ndo_start_xmit(); // 发包函数net_device->net_device_ops->ndo_tx_timeout(); // 发包超时处理函数
替代宏: S3C2410_GPA(0) ~ S3C2410_GPM(0)
#include <asm/arch/gpio.h>替代宏: static DEFINE_SEMAPHORE(name);
DECLARE_MUTEX(name) 宏struct semaphore name;// 在初始化函数中调用:sema_init(&name, 0)
将内核位置改为:
KERN_DIR = /work/system/linux-3.4.2
根据错误信息,修改 first_drv.c:
// #include // #include
class_device_create() 为 device_create()class_device_unregister() 为 device_unregister()#include
make uImagemake modules
drivers/video 下的文件添加到 nfs 文件系统中insmod cfbcopyarea.koinsmod cfbfillrect.koinsmod cfbimgblt.koinsmod 9th_lcd.ko
echo "Hello, World!" > /dev/lcdcat /dev/lcd
make cleanmake
make install
"selected device is not a touchscreen I understand" 错误,请检查触摸屏设备配置是否正确#define EV_VERSION 0x010001
以上内容可根据实际需求进行扩展和调整,建议在实际操作前进行充分测试。
转载地址:http://mtzfk.baihongyu.com/