backlight.c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * GMA500 Backlight Interface
  3. *
  4. * Copyright (c) 2009-2011, Intel Corporation.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms and conditions of the GNU General Public License,
  8. * version 2, as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13. * more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along with
  16. * this program; if not, write to the Free Software Foundation, Inc.,
  17. * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  18. *
  19. * Authors: Eric Knopp
  20. *
  21. */
  22. #include "psb_drv.h"
  23. #include "psb_intel_reg.h"
  24. #include "psb_intel_drv.h"
  25. #include "intel_bios.h"
  26. #include "power.h"
  27. int gma_backlight_init(struct drm_device *dev)
  28. {
  29. #ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
  30. struct drm_psb_private *dev_priv = dev->dev_private;
  31. return dev_priv->ops->backlight_init(dev);
  32. #else
  33. return 0;
  34. #endif
  35. }
  36. void gma_backlight_exit(struct drm_device *dev)
  37. {
  38. #ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
  39. struct drm_psb_private *dev_priv = dev->dev_private;
  40. if (dev_priv->backlight_device) {
  41. dev_priv->backlight_device->props.brightness = 0;
  42. backlight_update_status(dev_priv->backlight_device);
  43. backlight_device_unregister(dev_priv->backlight_device);
  44. }
  45. #endif
  46. }