backlight.h
上传用户:szlgq88
上传日期:2009-04-28
资源大小:48287k
文件大小:2k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. /*
  2.  * Backlight Lowlevel Control Abstraction
  3.  *
  4.  * Copyright (C) 2003,2004 Hewlett-Packard Company
  5.  *
  6.  */
  7. #ifndef _LINUX_BACKLIGHT_H
  8. #define _LINUX_BACKLIGHT_H
  9. #include <linux/device.h>
  10. #include <linux/notifier.h>
  11. struct backlight_device;
  12. struct fb_info;
  13. /* This structure defines all the properties of a backlight
  14.    (usually attached to a LCD). */
  15. struct backlight_properties {
  16. /* Owner module */
  17. struct module *owner;
  18. /* Get the backlight power status (0: full on, 1..3: power saving
  19.    modes; 4: full off), see FB_BLANK_XXX */
  20. int (*get_power)(struct backlight_device *);
  21. /* Enable or disable power to the LCD (0: on; 4: off, see FB_BLANK_XXX) */
  22. int (*set_power)(struct backlight_device *, int power);
  23. /* Maximal value for brightness (read-only) */
  24. int max_brightness;
  25. /* Get current backlight brightness */
  26. int (*get_brightness)(struct backlight_device *);
  27. /* Set backlight brightness (0..max_brightness) */
  28. int (*set_brightness)(struct backlight_device *, int brightness);
  29. /* Check if given framebuffer device is the one bound to this backlight;
  30.    return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */
  31. int (*check_fb)(struct fb_info *);
  32. };
  33. struct backlight_device {
  34. /* This protects the 'props' field. If 'props' is NULL, the driver that
  35.    registered this device has been unloaded, and if class_get_devdata()
  36.    points to something in the body of that driver, it is also invalid. */
  37. struct semaphore sem;
  38. /* If this is NULL, the backing module is unloaded */
  39. struct backlight_properties *props;
  40. /* The framebuffer notifier block */
  41. struct notifier_block fb_notif;
  42. /* The class device structure */
  43. struct class_device class_dev;
  44. };
  45. extern struct backlight_device *backlight_device_register(const char *name,
  46. void *devdata, struct backlight_properties *bp);
  47. extern void backlight_device_unregister(struct backlight_device *bd);
  48. #define to_backlight_device(obj) container_of(obj, struct backlight_device, class_dev)
  49. #endif