setup-fb-24bpp.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* linux/arch/arm/plat-s5pv210/setup-fb-24bpp.c
  2. *
  3. * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
  4. * http://www.samsung.com/
  5. *
  6. * Base s5pv210 setup information for 24bpp LCD framebuffer
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #include <linux/kernel.h>
  13. #include <linux/types.h>
  14. #include <linux/fb.h>
  15. #include <linux/gpio.h>
  16. #include <mach/map.h>
  17. #include <plat/fb.h>
  18. #include <mach/regs-clock.h>
  19. #include <plat/gpio-cfg.h>
  20. static void s5pv210_fb_cfg_gpios(unsigned int base, unsigned int nr)
  21. {
  22. s3c_gpio_cfgrange_nopull(base, nr, S3C_GPIO_SFN(2));
  23. for (; nr > 0; nr--, base++)
  24. s5p_gpio_set_drvstr(base, S5P_GPIO_DRVSTR_LV4);
  25. }
  26. void s5pv210_fb_gpio_setup_24bpp(void)
  27. {
  28. s5pv210_fb_cfg_gpios(S5PV210_GPF0(0), 8);
  29. s5pv210_fb_cfg_gpios(S5PV210_GPF1(0), 8);
  30. s5pv210_fb_cfg_gpios(S5PV210_GPF2(0), 8);
  31. s5pv210_fb_cfg_gpios(S5PV210_GPF3(0), 4);
  32. /* Set DISPLAY_CONTROL register for Display path selection.
  33. *
  34. * ouput | RGB | I80 | ITU
  35. * -----------------------------------
  36. * 00 | MIE | FIMD | FIMD
  37. * 01 | MDNIE | MDNIE | FIMD
  38. * 10 | FIMD | FIMD | FIMD
  39. * 11 | FIMD | FIMD | FIMD
  40. */
  41. writel(0x2, S5P_MDNIE_SEL);
  42. }