backlight_dummy.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (C) 2010 Michael Buesch <m@bues.ch>
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version 2
  7. * of the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. */
  14. #include "backlight_dummy.h"
  15. #include "util.h"
  16. static int backlight_dummy_max_brightness(struct backlight *b)
  17. {
  18. return 0;
  19. }
  20. static void backlight_dummy_destroy(struct backlight *b)
  21. {
  22. struct backlight_dummy *bd = container_of(b, struct backlight_dummy, backlight);
  23. free(bd);
  24. }
  25. static struct backlight * backlight_dummy_probe(void)
  26. {
  27. struct backlight_dummy *bd;
  28. bd = zalloc(sizeof(*bd));
  29. if (!bd)
  30. return NULL;
  31. backlight_init(&bd->backlight, "dummy");
  32. bd->backlight.max_brightness = backlight_dummy_max_brightness;
  33. bd->backlight.destroy = backlight_dummy_destroy;
  34. return &bd->backlight;
  35. }
  36. BACKLIGHT_PROBE(dummy, backlight_dummy_probe);