Chinaunix首页 | 论坛 | 博客
  • 博客访问: 70766
  • 博文数量: 83
  • 博客积分: 1320
  • 博客等级: 中尉
  • 技术积分: 805
  • 用 户 组: 普通用户
  • 注册时间: 2010-07-20 14:54
文章分类

全部博文(83)

文章存档

2010年(83)

我的朋友

分类:

2010-08-09 18:43:04

1.背光设备的结构体:

struct backlight_device {   

     struct backlight_properties props;   //背光设备属性结构体
     struct mutex update_lock;        
     struct mutex ops_lock;
     struct backlight_ops *ops;           //背光设备的相关操作函数
     struct notifier_block fb_notif;
     struct device dev;
};

其中backlight_properties和backlight_ops结构体定义如下:

struct backlight_properties {
    int brightness;        //当前亮度,最大值不能超过max_brightness
    int max_brightness;    //最大亮度,只读
    int power;             //当前的电源模式
    int fb_blank;
};

struct backlight_ops {
    int (*update_status)(struct backlight_device *);    //更新背光设备亮度等属性
    int (*get_brightness)(struct backlight_device *);   //获取背光设备亮度
    int (*check_fb)(struct fb_info *);

2.

在/sys/class/backlight/目录下注册和移除具体的背光设备时调用下面两个函数:

struct backlight_device *backlight_device_register(const char *name,struct device *dev, void *devdata, struct backlight_ops *ops);

void backlight_device_unregister(struct backlight_device *bd);


};

阅读(395) | 评论(0) | 转发(0) |
0

上一篇:INIT_WORK

下一篇:hrtimer

给主人留下些什么吧!~~