Chinaunix首页 | 论坛 | 博客
  • 博客访问: 720833
  • 博文数量: 118
  • 博客积分: 1437
  • 博客等级: 上尉
  • 技术积分: 1155
  • 用 户 组: 普通用户
  • 注册时间: 2009-02-22 20:23
文章分类

全部博文(118)

文章存档

2022年(32)

2017年(3)

2014年(4)

2013年(1)

2011年(2)

2010年(16)

2009年(60)

我的朋友

分类: LINUX

2009-04-02 16:49:59

最近一直再弄2410触摸屏的驱动,在读tsdev.c这个文件很多不懂得地方。需要搞清楚,到底触摸屏的设备文件是哪个?mouse0?还是input0?还是ts0?那主设备号,和次设备号又是多少?
这个函数好像是动态创建设备文件的,但是我的cramfs文件系统,还不可写,怎么处理?

Name

class_device_create — creates a class device and registers it with sysfs

Synopsis

struct class_device * class_device_create (struct class *  cls,
 struct class_device *  parent,
 dev_t  devt,
 struct device *  device,
 const char *  fmt,
   ...);

Arguments

cls

pointer to the struct class that this device should be registered to.

parent

pointer to the parent struct class_device of this new device, if any.

devt

the dev_t for the char device to be added.

device

a pointer to a struct device that is assiociated with this class device.

fmt

string for the class device's name

...

variable arguments

Description

This function can be used by char device classes. A struct class_device will be created in sysfs, registered to the specified class. A “dev” file will be created, showing the dev_t for the device, if the dev_t is not 0,0. If a pointer to a parent struct class_device is passed in, the newly created struct class_device will be a child of that device in sysfs. The pointer to the struct class_device will be returned from the call. Any further sysfs files that might be required can be created using this pointer.

Note

the struct class passed to this function must have previously been created with a call to class_create.


阅读(884) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~