pcm970-baseboard.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de)
  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. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program; if not, write to the Free Software
  15. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  16. * MA 02110-1301, USA.
  17. */
  18. #include <linux/platform_device.h>
  19. #include <asm/mach/arch.h>
  20. #include <mach/hardware.h>
  21. #include <mach/common.h>
  22. #include <mach/imxfb.h>
  23. #include <mach/iomux.h>
  24. #include "devices.h"
  25. static int mxc_fb_pins[] = {
  26. PA5_PF_LSCLK, PA6_PF_LD0, PA7_PF_LD1, PA8_PF_LD2,
  27. PA9_PF_LD3, PA10_PF_LD4, PA11_PF_LD5, PA12_PF_LD6,
  28. PA13_PF_LD7, PA14_PF_LD8, PA15_PF_LD9, PA16_PF_LD10,
  29. PA17_PF_LD11, PA18_PF_LD12, PA19_PF_LD13, PA20_PF_LD14,
  30. PA21_PF_LD15, PA22_PF_LD16, PA23_PF_LD17, PA24_PF_REV,
  31. PA25_PF_CLS, PA26_PF_PS, PA27_PF_SPL_SPR, PA28_PF_HSYNC,
  32. PA29_PF_VSYNC, PA30_PF_CONTRAST, PA31_PF_OE_ACD
  33. };
  34. static int pcm038_fb_init(struct platform_device *pdev)
  35. {
  36. return mxc_gpio_setup_multiple_pins(mxc_fb_pins,
  37. ARRAY_SIZE(mxc_fb_pins), "FB");
  38. }
  39. static int pcm038_fb_exit(struct platform_device *pdev)
  40. {
  41. mxc_gpio_release_multiple_pins(mxc_fb_pins, ARRAY_SIZE(mxc_fb_pins));
  42. return 0;
  43. }
  44. /*
  45. * Connected is a portrait Sharp-QVGA display
  46. * of type: LQ035Q7DH06
  47. */
  48. static struct imx_fb_platform_data pcm038_fb_data = {
  49. .pixclock = 188679, /* in ps (5.3MHz) */
  50. .xres = 240,
  51. .yres = 320,
  52. .bpp = 16,
  53. .hsync_len = 7,
  54. .left_margin = 5,
  55. .right_margin = 16,
  56. .vsync_len = 1,
  57. .upper_margin = 7,
  58. .lower_margin = 9,
  59. .fixed_screen_cpu = 0,
  60. /*
  61. * - HSYNC active high
  62. * - VSYNC active high
  63. * - clk notenabled while idle
  64. * - clock not inverted
  65. * - data not inverted
  66. * - data enable low active
  67. * - enable sharp mode
  68. */
  69. .pcr = 0xFA0080C0,
  70. .pwmr = 0x00A903FF,
  71. .lscr1 = 0x00120300,
  72. .dmacr = 0x00020010,
  73. .init = pcm038_fb_init,
  74. .exit = pcm038_fb_exit,
  75. };
  76. /*
  77. * system init for baseboard usage. Will be called by pcm038 init.
  78. *
  79. * Add platform devices present on this baseboard and init
  80. * them from CPU side as far as required to use them later on
  81. */
  82. void __init pcm970_baseboard_init(void)
  83. {
  84. mxc_register_device(&mxc_fb_device, &pcm038_fb_data);
  85. }