liquidLevelOperation.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /*
  2. * Copyright 2012 Freescale Semiconductor, Inc.
  3. * Copyright 2012 Linaro Ltd.
  4. *
  5. * The code contained herein is licensed under the GNU General Public
  6. * License. You may obtain a copy of the GNU General Public License
  7. * Version 2 or later at the following locations:
  8. *
  9. * http://www.opensource.org/licenses/gpl-license.html
  10. * http://www.gnu.org/copyleft/gpl.html
  11. */
  12. #include <linux/clk.h>
  13. #include <linux/clkdev.h>
  14. #include <linux/can/platform/flexcan.h>
  15. #include <linux/delay.h>
  16. #include <linux/err.h>
  17. #include <linux/gpio.h>
  18. #include <linux/init.h>
  19. #include <linux/micrel_phy.h>
  20. #include <linux/mxsfb.h>
  21. #include <linux/of_platform.h>
  22. #include <linux/phy.h>
  23. #include <linux/pinctrl/consumer.h>
  24. #include <asm/mach/arch.h>
  25. #include <asm/mach/time.h>
  26. #include <mach/common.h>
  27. #include <mach/digctl.h>
  28. #include <mach/mxs.h>
  29. static struct fb_videomode mx23evk_video_modes[] = {
  30. {
  31. .name = "Samsung-LMS430HF02",
  32. .refresh = 60,
  33. .xres = 480,
  34. .yres = 272,
  35. .pixclock = 108096, /* picosecond (9.2 MHz) */
  36. .left_margin = 15,
  37. .right_margin = 8,
  38. .upper_margin = 12,
  39. .lower_margin = 4,
  40. .hsync_len = 1,
  41. .vsync_len = 1,
  42. .sync = FB_SYNC_DATA_ENABLE_HIGH_ACT |
  43. FB_SYNC_DOTCLK_FAILING_ACT,
  44. },
  45. };
  46. static struct fb_videomode mx28evk_video_modes[] = {
  47. {
  48. .name = "Seiko-43WVF1G",
  49. .refresh = 60,
  50. .xres = 800,
  51. .yres = 480,
  52. .pixclock = 29851, /* picosecond (33.5 MHz) */
  53. .left_margin = 89,
  54. .right_margin = 164,
  55. .upper_margin = 23,
  56. .lower_margin = 10,
  57. .hsync_len = 10,
  58. .vsync_len = 10,
  59. .sync = FB_SYNC_DATA_ENABLE_HIGH_ACT |
  60. FB_SYNC_DOTCLK_FAILING_ACT,
  61. },
  62. };
  63. static struct fb_videomode m28evk_video_modes[] = {
  64. {
  65. .name = "Ampire AM-800480R2TMQW-T01H",
  66. .refresh = 60,
  67. .xres = 800,
  68. .yres = 480,
  69. .pixclock = 30066, /* picosecond (33.26 MHz) */
  70. .left_margin = 0,
  71. .right_margin = 256,
  72. .upper_margin = 0,
  73. .lower_margin = 45,
  74. .hsync_len = 1,
  75. .vsync_len = 1,
  76. .sync = FB_SYNC_DATA_ENABLE_HIGH_ACT,
  77. },
  78. };
  79. static struct fb_videomode apx4devkit_video_modes[] = {
  80. {
  81. .name = "HannStar PJ70112A",
  82. .refresh = 60,
  83. .xres = 800,
  84. .yres = 480,
  85. .pixclock = 33333, /* picosecond (30.00 MHz) */
  86. .left_margin = 88,
  87. .right_margin = 40,
  88. .upper_margin = 32,
  89. .lower_margin = 13,
  90. .hsync_len = 48,
  91. .vsync_len = 3,
  92. .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT |
  93. FB_SYNC_DATA_ENABLE_HIGH_ACT |
  94. FB_SYNC_DOTCLK_FAILING_ACT,
  95. },
  96. };
  97. static struct fb_videomode apf28dev_video_modes[] = {
  98. {
  99. .name = "LW700",
  100. .refresh = 60,
  101. .xres = 800,
  102. .yres = 480,
  103. .pixclock = 30303, /* picosecond */
  104. .left_margin = 96,
  105. .right_margin = 96, /* at least 3 & 1 */
  106. .upper_margin = 0x14,
  107. .lower_margin = 0x15,
  108. .hsync_len = 64,
  109. .vsync_len = 4,
  110. .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT |
  111. FB_SYNC_DATA_ENABLE_HIGH_ACT |
  112. FB_SYNC_DOTCLK_FAILING_ACT,
  113. },
  114. };
  115. static struct mxsfb_platform_data mxsfb_pdata __initdata;
  116. /*
  117. * MX28EVK_FLEXCAN_SWITCH is shared between both flexcan controllers
  118. */
  119. #define MX28EVK_FLEXCAN_SWITCH MXS_GPIO_NR(2, 13)
  120. static int flexcan0_en, flexcan1_en;
  121. static void mx28evk_flexcan_switch(void)
  122. {
  123. if (flexcan0_en || flexcan1_en)
  124. gpio_set_value(MX28EVK_FLEXCAN_SWITCH, 1);
  125. else