diff options
Diffstat (limited to 'recipes-kernel/linux/linux-3.0/ulcd/0002-WIP-omap-beagleboard-add-bbtoys-ulcd-lite-support.patch')
-rw-r--r-- | recipes-kernel/linux/linux-3.0/ulcd/0002-WIP-omap-beagleboard-add-bbtoys-ulcd-lite-support.patch | 235 |
1 files changed, 235 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-3.0/ulcd/0002-WIP-omap-beagleboard-add-bbtoys-ulcd-lite-support.patch b/recipes-kernel/linux/linux-3.0/ulcd/0002-WIP-omap-beagleboard-add-bbtoys-ulcd-lite-support.patch new file mode 100644 index 00000000..d6aace3c --- /dev/null +++ b/recipes-kernel/linux/linux-3.0/ulcd/0002-WIP-omap-beagleboard-add-bbtoys-ulcd-lite-support.patch | |||
@@ -0,0 +1,235 @@ | |||
1 | From 2ced51c12594c56d15b5376a5ff72aedddf41b6a Mon Sep 17 00:00:00 2001 | ||
2 | From: Jason Kridner <jdk@ti.com> | ||
3 | Date: Mon, 12 Sep 2011 10:28:14 -0400 | ||
4 | Subject: [PATCH 2/2] WIP: omap: beagleboard: add bbtoys ulcd-lite support | ||
5 | |||
6 | Added support for the BeagleBoardToys ULCD-Lite. | ||
7 | * Added ThreeFiveCorp s9700rtwv35tr-01b panel to | ||
8 | panel-generic-dpi driver. | ||
9 | * Added TSC2007 and LCD panel to board file. | ||
10 | |||
11 | Relied heavily on the TSC2007 integration work done by | ||
12 | John Weber and panel timings from Roger Monk. | ||
13 | |||
14 | Signed-off-by: Jason Kridner <jdk@ti.com> | ||
15 | Cc: John Weber <rjohnweber@gmail.com> | ||
16 | Cc: Roger Monk <r-monk@ti.com> | ||
17 | Cc: Joel A Fernandes <agnel.joel@gmail.com> | ||
18 | Cc: Koen Kooi <koen@dominion.thruhere.net> | ||
19 | --- | ||
20 | arch/arm/mach-omap2/board-omap3beagle.c | 112 ++++++++++++++++++++++ | ||
21 | drivers/video/omap2/displays/panel-generic-dpi.c | 25 +++++ | ||
22 | 2 files changed, 137 insertions(+), 0 deletions(-) | ||
23 | |||
24 | diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c | ||
25 | index 9712099..8c0d1a3 100644 | ||
26 | --- a/arch/arm/mach-omap2/board-omap3beagle.c | ||
27 | +++ b/arch/arm/mach-omap2/board-omap3beagle.c | ||
28 | @@ -35,6 +35,7 @@ | ||
29 | #include <linux/i2c/twl.h> | ||
30 | #include <linux/netdevice.h> | ||
31 | #include <linux/if_ether.h> | ||
32 | +#include <linux/i2c/tsc2007.h> | ||
33 | |||
34 | #include <mach/hardware.h> | ||
35 | #include <asm/mach-types.h> | ||
36 | @@ -87,11 +88,15 @@ static struct { | ||
37 | int usb_pwr_level; | ||
38 | int reset_gpio; | ||
39 | int usr_button_gpio; | ||
40 | + char *lcd_driver_name; | ||
41 | + int lcd_pwren; | ||
42 | } beagle_config = { | ||
43 | .mmc1_gpio_wp = -EINVAL, | ||
44 | .usb_pwr_level = GPIOF_OUT_INIT_LOW, | ||
45 | .reset_gpio = 129, | ||
46 | .usr_button_gpio = 4, | ||
47 | + .lcd_driver_name = "", | ||
48 | + .lcd_pwren = 156 | ||
49 | }; | ||
50 | |||
51 | /* | ||
52 | @@ -477,9 +482,53 @@ static struct omap_dss_device beagle_tv_device = { | ||
53 | .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, | ||
54 | }; | ||
55 | |||
56 | +static int beagle_enable_lcd(struct omap_dss_device *dssdev) | ||
57 | +{ | ||
58 | + if (gpio_is_valid(beagle_config.lcd_pwren)) { | ||
59 | + printk(KERN_INFO "%s: Enabling LCD\n", __FUNCTION__); | ||
60 | + gpio_set_value(beagle_config.lcd_pwren, 0); | ||
61 | + } else { | ||
62 | + printk(KERN_INFO "%s: Invalid LCD enable GPIO: %d\n", | ||
63 | + __FUNCTION__, beagle_config.lcd_pwren); | ||
64 | + } | ||
65 | + | ||
66 | + return 0; | ||
67 | +} | ||
68 | + | ||
69 | +static void beagle_disable_lcd(struct omap_dss_device *dssdev) | ||
70 | +{ | ||
71 | + if (gpio_is_valid(beagle_config.lcd_pwren)) { | ||
72 | + printk(KERN_INFO "%s: Disabling LCD\n", __FUNCTION__); | ||
73 | + gpio_set_value(beagle_config.lcd_pwren, 1); | ||
74 | + } else { | ||
75 | + printk(KERN_INFO "%s: Invalid LCD enable GPIO: %d\n", | ||
76 | + __FUNCTION__, beagle_config.lcd_pwren); | ||
77 | + } | ||
78 | + | ||
79 | + return; | ||
80 | +} | ||
81 | + | ||
82 | +static struct panel_generic_dpi_data lcd_panel = { | ||
83 | + .name = "tfc_s9700rtwv35tr-01b", | ||
84 | + .platform_enable = beagle_enable_lcd, | ||
85 | + .platform_disable = beagle_disable_lcd, | ||
86 | +}; | ||
87 | + | ||
88 | +static struct omap_dss_device beagle_lcd_device = { | ||
89 | + .type = OMAP_DISPLAY_TYPE_DPI, | ||
90 | + .name = "lcd", | ||
91 | + .driver_name = "generic_dpi_panel", | ||
92 | + .phy.dpi.data_lines = 24, | ||
93 | + .platform_enable = beagle_enable_lcd, | ||
94 | + .platform_disable = beagle_disable_lcd, | ||
95 | + .reset_gpio = -EINVAL, | ||
96 | + .data = &lcd_panel, | ||
97 | +}; | ||
98 | + | ||
99 | static struct omap_dss_device *beagle_dss_devices[] = { | ||
100 | &beagle_dvi_device, | ||
101 | &beagle_tv_device, | ||
102 | + &beagle_lcd_device, | ||
103 | }; | ||
104 | |||
105 | static struct omap_dss_board_info beagle_dss_data = { | ||
106 | @@ -496,6 +545,11 @@ static void __init beagle_display_init(void) | ||
107 | "DVI reset"); | ||
108 | if (r < 0) | ||
109 | printk(KERN_ERR "Unable to get DVI reset GPIO\n"); | ||
110 | + | ||
111 | + r = gpio_request_one(beagle_config.lcd_pwren, GPIOF_OUT_INIT_LOW, | ||
112 | + "LCD power"); | ||
113 | + if (r < 0) | ||
114 | + printk(KERN_ERR "Unable to get LCD power enable GPIO\n"); | ||
115 | } | ||
116 | |||
117 | #include "sdram-micron-mt46h32m32lf-6.h" | ||
118 | @@ -654,6 +708,53 @@ static struct i2c_board_info __initdata beagle_i2c2_zippy[] = { | ||
119 | static struct i2c_board_info __initdata beagle_i2c2_zippy[] = {}; | ||
120 | #endif | ||
121 | |||
122 | +#if defined(CONFIG_INPUT_TOUCHSCREEN) && \ | ||
123 | + defined(CONFIG_TOUCHSCREEN_TSC2007) | ||
124 | +/* Touchscreen */ | ||
125 | +#define OMAP3BEAGLE_TSC2007_GPIO 157 | ||
126 | +static int omap3beagle_tsc2007_get_pendown_state(void) | ||
127 | +{ | ||
128 | + return !gpio_get_value(OMAP3BEAGLE_TSC2007_GPIO); | ||
129 | +} | ||
130 | + | ||
131 | +static int omap3beagle_tsc2007_init(void) | ||
132 | +{ | ||
133 | + int gpio = OMAP3BEAGLE_TSC2007_GPIO; | ||
134 | + int ret = 0; | ||
135 | + printk(KERN_WARNING "TSC2007_init started"); | ||
136 | + ret = gpio_request(gpio, "tsc2007_pen_down"); | ||
137 | + if (ret < 0) { | ||
138 | + printk(KERN_ERR "Failed to request GPIO %d for " | ||
139 | + "tsc2007 pen down IRQ\n", gpio); | ||
140 | + return ret; | ||
141 | + } | ||
142 | + | ||
143 | + omap_mux_init_gpio(OMAP3BEAGLE_TSC2007_GPIO, OMAP_PIN_INPUT_PULLUP); | ||
144 | + gpio_direction_input(gpio); | ||
145 | + | ||
146 | + irq_set_irq_type(OMAP_GPIO_IRQ(OMAP3BEAGLE_TSC2007_GPIO), IRQ_TYPE_EDGE_FALLING); | ||
147 | + | ||
148 | + return ret; | ||
149 | +} | ||
150 | + | ||
151 | +static struct tsc2007_platform_data tsc2007_info = { | ||
152 | + .model = 2007, | ||
153 | + .x_plate_ohms = 180, | ||
154 | + .get_pendown_state = omap3beagle_tsc2007_get_pendown_state, | ||
155 | + .init_platform_hw = omap3beagle_tsc2007_init, | ||
156 | +}; | ||
157 | + | ||
158 | +static struct i2c_board_info __initdata beagle_i2c2_bbtoys_ulcd[] = { | ||
159 | + { | ||
160 | + I2C_BOARD_INFO("tsc2007", 0x48), | ||
161 | + .irq = OMAP_GPIO_IRQ(OMAP3BEAGLE_TSC2007_GPIO), | ||
162 | + .platform_data = &tsc2007_info, | ||
163 | + }, | ||
164 | +}; | ||
165 | +#else | ||
166 | +static struct i2c_board_info __initdata beagle_i2c2_bbtoys_ulcd[] = {}; | ||
167 | +#endif | ||
168 | + | ||
169 | static int __init omap3_beagle_i2c_init(void) | ||
170 | { | ||
171 | omap3_pmic_get_config(&beagle_twldata, | ||
172 | @@ -823,6 +924,10 @@ static void __init omap3_beagle_init(void) | ||
173 | |||
174 | gpio_buttons[0].gpio = beagle_config.usr_button_gpio; | ||
175 | |||
176 | + /* TODO: set lcd_driver_name by command line or device tree */ | ||
177 | + beagle_config.lcd_driver_name = "tfc_s9700rtwv35tr-01b", | ||
178 | + lcd_panel.name = beagle_config.lcd_driver_name; | ||
179 | + | ||
180 | platform_add_devices(omap3_beagle_devices, | ||
181 | ARRAY_SIZE(omap3_beagle_devices)); | ||
182 | omap_display_init(&beagle_dss_data); | ||
183 | @@ -898,6 +1003,13 @@ static void __init omap3_beagle_init(void) | ||
184 | platform_device_register(&omap_vwlan_device); | ||
185 | } | ||
186 | |||
187 | + if(!strcmp(expansionboard_name, "bbtoys-ulcd")) | ||
188 | + { | ||
189 | + printk(KERN_INFO "Beagle expansionboard: registering bbtoys-ulcd\n"); | ||
190 | + omap_register_i2c_bus(2, 400, beagle_i2c2_bbtoys_ulcd, | ||
191 | + ARRAY_SIZE(beagle_i2c2_bbtoys_ulcd)); | ||
192 | + } | ||
193 | + | ||
194 | usb_musb_init(NULL); | ||
195 | usbhs_init(&usbhs_bdata); | ||
196 | omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions, | ||
197 | diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c | ||
198 | index 9c90f75..82c1ac3 100644 | ||
199 | --- a/drivers/video/omap2/displays/panel-generic-dpi.c | ||
200 | +++ b/drivers/video/omap2/displays/panel-generic-dpi.c | ||
201 | @@ -232,6 +232,31 @@ static struct panel_config generic_dpi_panels[] = { | ||
202 | .power_off_delay = 0, | ||
203 | .name = "powertip_ph480272t", | ||
204 | }, | ||
205 | + | ||
206 | + /* ThreeFiveCorp S9700RTWV35TR-01B */ | ||
207 | + { | ||
208 | + { | ||
209 | + .x_res = 800, | ||
210 | + .y_res = 480, | ||
211 | + | ||
212 | + .pixel_clock = 30000, | ||
213 | + | ||
214 | + .hsw = 49, | ||
215 | + .hfp = 41, | ||
216 | + .hbp = 40, | ||
217 | + | ||
218 | + .vsw = 4, | ||
219 | + .vfp = 14, | ||
220 | + .vbp = 29, | ||
221 | + }, | ||
222 | + .acbi = 0x0, | ||
223 | + .acb = 0x0, | ||
224 | + .config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS | | ||
225 | + OMAP_DSS_LCD_IHS, // | OMAP_DSS_LCD_IEO; - TODO check this - doesn't work with this enabled | ||
226 | + .power_on_delay = 50, | ||
227 | + .power_off_delay = 100, | ||
228 | + .name = "tfc_s9700rtwv35tr-01b", | ||
229 | + }, | ||
230 | }; | ||
231 | |||
232 | struct panel_drv_data { | ||
233 | -- | ||
234 | 1.7.4.1 | ||
235 | |||