display.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright (C) 2006 James Simmons <jsimmons@infradead.org>
  3. *
  4. * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or (at
  9. * your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  19. *
  20. * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  21. */
  22. #ifndef _LINUX_DISPLAY_H
  23. #define _LINUX_DISPLAY_H
  24. #include <linux/device.h>
  25. struct display_device;
  26. /* This structure defines all the properties of a Display. */
  27. struct display_driver {
  28. int (*set_contrast)(struct display_device *, unsigned int);
  29. int (*get_contrast)(struct display_device *);
  30. void (*suspend)(struct display_device *, pm_message_t state);
  31. void (*resume)(struct display_device *);
  32. int (*probe)(struct display_device *, void *);
  33. int (*remove)(struct display_device *);
  34. int max_contrast;
  35. };
  36. struct display_device {
  37. struct module *owner; /* Owner module */
  38. struct display_driver *driver;
  39. struct device *parent; /* This is the parent */
  40. struct device *dev; /* This is this display device */
  41. struct mutex lock;
  42. void *priv_data;
  43. char type[16];
  44. char *name;
  45. int idx;
  46. };
  47. extern struct display_device *display_device_register(struct display_driver *driver,
  48. struct device *dev, void *devdata);
  49. extern void display_device_unregister(struct display_device *dev);
  50. extern int probe_edid(struct display_device *dev, void *devdata);
  51. #define to_display_device(obj) container_of(obj, struct display_device, class_dev)
  52. #endif