035-pxafb-definition.patch 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. Index: linux-2.6.21.7/arch/arm/mach-pxa/gumstix.c
  2. ===================================================================
  3. --- linux-2.6.21.7.orig/arch/arm/mach-pxa/gumstix.c
  4. +++ linux-2.6.21.7/arch/arm/mach-pxa/gumstix.c
  5. @@ -25,6 +25,7 @@
  6. #include <asm/arch/udc.h>
  7. #include <asm/arch/mmc.h>
  8. #include <asm/arch/pxa-regs.h>
  9. +#include <asm/arch/pxafb.h>
  10. #include <asm/arch/gumstix.h>
  11. #include "generic.h"
  12. @@ -90,6 +91,89 @@ static struct platform_device gum_audio_
  13. .id = -1,
  14. };
  15. +
  16. +#if defined(CONFIG_FB_PXA_SHARP_LQ043_PSP) || defined(CONFIG_FB_PXA_SAMSUNG_LTE430WQ_F0C)
  17. +static void gumstix_lcd_backlight(int on_or_off)
  18. +{
  19. + if(on_or_off)
  20. + {
  21. + pxa_gpio_mode(17 | GPIO_IN);
  22. + } else {
  23. + GPCR(17) = GPIO_bit(17);
  24. + pxa_gpio_mode(17 | GPIO_OUT);
  25. + GPCR(17) = GPIO_bit(17);
  26. + }
  27. +}
  28. +#endif
  29. +
  30. +
  31. +#ifdef CONFIG_FB_PXA_ALPS_CDOLLAR
  32. +static struct pxafb_mode_info gumstix_fb_mode = {
  33. + .pixclock = 300000,
  34. + .xres = 240,
  35. + .yres = 320,
  36. + .bpp = 16,
  37. + .hsync_len = 2,
  38. + .left_margin = 1,
  39. + .right_margin = 1,
  40. + .vsync_len = 3,
  41. + .upper_margin = 0,
  42. + .lower_margin = 0,
  43. + .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
  44. +};
  45. +
  46. +static struct pxafb_mach_info gumstix_fb_info = {
  47. + .modes = &gumstix_fb_mode,
  48. + .num_modes = 1,
  49. + .lccr0 = LCCR0_Pas | LCCR0_Sngl | LCCR0_Color,
  50. + .lccr3 = 0,
  51. +};
  52. +#elif defined(CONFIG_FB_PXA_SHARP_LQ043_PSP)
  53. +static struct pxafb_mode_info gumstix_fb_mode = {
  54. + .pixclock = 110000,
  55. + .xres = 480,
  56. + .yres = 272,
  57. + .bpp = 16,
  58. + .hsync_len = 41,
  59. + .left_margin = 2,
  60. + .right_margin = 2,
  61. + .vsync_len = 10,
  62. + .upper_margin = 2,
  63. + .lower_margin = 2,
  64. + .sync = 0, // Hsync and Vsync both active low
  65. +};
  66. +
  67. +static struct pxafb_mach_info gumstix_fb_info = {
  68. + .modes = &gumstix_fb_mode,
  69. + .num_modes = 1,
  70. + .lccr0 = LCCR0_Act | LCCR0_Sngl | LCCR0_Color,
  71. + .lccr3 = LCCR3_OutEnH | LCCR3_PixFlEdg | (3 << 30),
  72. + .pxafb_backlight_power = &gumstix_lcd_backlight,
  73. +};
  74. +#elif defined(CONFIG_FB_PXA_SAMSUNG_LTE430WQ_F0C)
  75. +static struct pxafb_mode_info gumstix_fb_mode = {
  76. + .pixclock = 108696, // 9.2MHz typical DOTCLK from datasheet
  77. + .xres = 480,
  78. + .hsync_len = 41, // HLW from datasheet: 41 typ
  79. + .left_margin = 4, // HBP - HLW from datasheet: 45 - 41 = 4
  80. + .right_margin = 8, // HFP from datasheet: 8 typ
  81. + .yres = 272,
  82. + .vsync_len = 10, // VLW from datasheet: 10 typ
  83. + .upper_margin = 2, // VBP - VLW from datasheet: 12 - 10 = 2
  84. + .lower_margin = 4, // VFP from datasheet: 4 typ
  85. + .bpp = 16,
  86. + .sync = 0, // Hsync and Vsync both active low
  87. +};
  88. +
  89. +static struct pxafb_mach_info gumstix_fb_info = {
  90. + .modes = &gumstix_fb_mode,
  91. + .num_modes = 1,
  92. + .lccr0 = LCCR0_Act | LCCR0_Sngl | LCCR0_Color,
  93. + .lccr3 = LCCR3_OutEnH | LCCR3_PixFlEdg | (3 << 30),
  94. + .pxafb_backlight_power = &gumstix_lcd_backlight,
  95. +};
  96. +#endif
  97. +
  98. static struct platform_device *devices[] __initdata = {
  99. &gum_audio_device,
  100. };
  101. @@ -98,6 +182,9 @@ static void __init gumstix_init(void)
  102. {
  103. pxa_set_mci_info(&gumstix_mci_platform_data);
  104. pxa_set_udc_info(&gumstix_udc_info);
  105. +#if defined(CONFIG_FB_PXA_ALPS_CDOLLAR) | defined(CONFIG_FB_PXA_SHARP_LQ043_PSP) | defined(CONFIG_FB_PXA_SAMSUNG_LTE430WQ_F0C)
  106. + set_pxa_fb_info(&gumstix_fb_info);
  107. +#endif
  108. (void) platform_add_devices(devices, ARRAY_SIZE(devices));
  109. }
  110. Index: linux-2.6.21.7/drivers/video/Kconfig
  111. ===================================================================
  112. --- linux-2.6.21.7.orig/drivers/video/Kconfig
  113. +++ linux-2.6.21.7/drivers/video/Kconfig
  114. @@ -1495,6 +1495,37 @@ config FB_PXA
  115. If unsure, say N.
  116. +choice
  117. + depends on FB_PXA
  118. + prompt "LCD Panel"
  119. + default FB_PXA_SAMSUNG_LTE430WQ_F0C
  120. +
  121. +config FB_PXA_ALPS_CDOLLAR
  122. + boolean "Chris Dollar's ALPS screen"
  123. + ---help---
  124. + Enable definitions (over-ridable on the kernel command line if
  125. + "PXA LCD command line parameters" is also selected) for an ALPS
  126. + screen which Chris Dollar uses
  127. +
  128. +config FB_PXA_SHARP_LQ043_PSP
  129. + boolean "SHARP LQ043... series"
  130. + ---help---
  131. + Enable definitions (over-ridable on the kernel command line if
  132. + "PXA LCD command line parameters" is also selected) for a SHARP
  133. + LQ043... screen, such as the one used by the PSP. These screens are
  134. + the ones normally sold by gumstix with its boards.
  135. +
  136. +config FB_PXA_SAMSUNG_LTE430WQ_F0C
  137. + boolean "Samsung LTE430WQ-F0C (standard gumstix LCD)"
  138. + ---help---
  139. + Enable definitions for a Samsung LTE430WQ-F0C LCD panel, such as the ones resold
  140. + by gumstix for use with their "LCD-Ready" boards.
  141. +
  142. +config FB_PXA_NONEOFTHEABOVE
  143. + boolean "None of the above"
  144. +
  145. +endchoice
  146. +
  147. config FB_PXA_PARAMETERS
  148. bool "PXA LCD command line parameters"
  149. default n
  150. Index: linux-2.6.21.7/drivers/video/pxafb.c
  151. ===================================================================
  152. --- linux-2.6.21.7.orig/drivers/video/pxafb.c
  153. +++ linux-2.6.21.7/drivers/video/pxafb.c
  154. @@ -22,6 +22,7 @@
  155. *
  156. */
  157. +#include <linux/autoconf.h>
  158. #include <linux/module.h>
  159. #include <linux/moduleparam.h>
  160. #include <linux/kernel.h>
  161. @@ -789,7 +790,13 @@ static void pxafb_setup_gpio(struct pxaf
  162. pxa_gpio_mode(GPIO74_LCD_FCLK_MD);
  163. pxa_gpio_mode(GPIO75_LCD_LCLK_MD);
  164. pxa_gpio_mode(GPIO76_LCD_PCLK_MD);
  165. +#ifdef CONFIG_FB_PXA_SHARP_LQ043_PSP
  166. + /* DISP must be always high while screen is on */
  167. + pxa_gpio_mode(GPIO77_LCD_ACBIAS | GPIO_OUT);
  168. + GPSR(GPIO77_LCD_ACBIAS) = GPIO_bit(GPIO77_LCD_ACBIAS);
  169. +#else
  170. pxa_gpio_mode(GPIO77_LCD_ACBIAS_MD);
  171. +#endif
  172. }
  173. static void pxafb_enable_controller(struct pxafb_info *fbi)