2010年(83)
分类:
2010-08-09 18:43:04
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);
};