mddihost_e.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* Copyright (c) 2008-2009, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. */
  13. #include <linux/module.h>
  14. #include <linux/kernel.h>
  15. #include <linux/slab.h>
  16. #include <linux/delay.h>
  17. #include <linux/mm.h>
  18. #include <linux/fb.h>
  19. #include <linux/init.h>
  20. #include <linux/ioport.h>
  21. #include <linux/device.h>
  22. #include <linux/dma-mapping.h>
  23. #include "msm_fb.h"
  24. #include "mddihost.h"
  25. #include "mddihosti.h"
  26. #include <linux/clk.h>
  27. #include <mach/clk.h>
  28. extern struct semaphore mddi_host_mutex;
  29. static boolean mddi_host_ext_powered = FALSE;
  30. void mddi_host_start_ext_display(void)
  31. {
  32. down(&mddi_host_mutex);
  33. if (!mddi_host_ext_powered) {
  34. mddi_host_init(MDDI_HOST_EXT);
  35. mddi_host_ext_powered = TRUE;
  36. }
  37. up(&mddi_host_mutex);
  38. }
  39. void mddi_host_stop_ext_display(void)
  40. {
  41. down(&mddi_host_mutex);
  42. if (mddi_host_ext_powered) {
  43. mddi_host_powerdown(MDDI_HOST_EXT);
  44. mddi_host_ext_powered = FALSE;
  45. }
  46. up(&mddi_host_mutex);
  47. }