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