代码改变世界

随笔档案-2012年8月8日

sysfs接口函数的建立_DEVICE_ATTR

2012-08-08 15:02 by superlcc, 23855 阅读, 收藏,
摘要: sysfs接口函数到建立_DEVICE_ATTR最近在弄Sensor驱动,看过一个某厂家的成品驱动,里面实现的全都是sysfs接口,hal层利用sysfs生成的接口,对Sensor进行操作。说道sysfs接口,就不得不提到函数宏DEVICE_ATTR原型是#define DEVICE_ATTR(_name, _mode, _show, _store) \struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)函数宏DEVICE_ATTR内封装的是__ATTR(_name,_mode,_show, 阅读全文

request_threaded_irq

2012-08-08 14:49 by superlcc, 2027 阅读, 收藏,
摘要: Namerequest_threaded_irq — allocate an interrupt lineSynopsisintfsfuncrequest_threaded_irq(unsigned intirq,irq_handler_thandler,irq_handler_tthread_fn,unsigned longirqflags,const char *devname,void *dev_id);ArgumentsirqInterrupt line to allocatehandlerFunction to be called when the IRQ occurs. Prima 阅读全文