aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mmp
diff options
context:
space:
mode:
authorZhou Zhu <zzhu3@marvell.com>2013-02-21 19:42:21 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 20:22:17 -0500
commit74a014f4714264299af7f7c950603c7781e5a6db (patch)
tree167641f869e99a779d39f6f59f95251669f15678 /arch/arm/mach-mmp
parent333893cd09a0b93a75f33ca50a3be174c65c1378 (diff)
ARM: mmp: enable display in ttc_dkb
Enable display in ttc_dkb. Signed-off-by: Zhou Zhu <zzhu3@marvell.com> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com> Cc: Lisa Du <cldu@marvell.com> Cc: Guoqing Li <ligq@marvell.com> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/arm/mach-mmp')
-rw-r--r--arch/arm/mach-mmp/ttc_dkb.c92
1 files changed, 92 insertions, 0 deletions
diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c
index ce55fd8821c4..49b3cf9b6e60 100644
--- a/arch/arm/mach-mmp/ttc_dkb.c
+++ b/arch/arm/mach-mmp/ttc_dkb.c
@@ -19,6 +19,8 @@
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/mfd/88pm860x.h> 20#include <linux/mfd/88pm860x.h>
21#include <linux/platform_data/mv_usb.h> 21#include <linux/platform_data/mv_usb.h>
22#include <linux/spi/spi.h>
23#include <linux/delay.h>
22 24
23#include <asm/mach-types.h> 25#include <asm/mach-types.h>
24#include <asm/mach/arch.h> 26#include <asm/mach/arch.h>
@@ -184,6 +186,92 @@ static struct pxa3xx_nand_platform_data dkb_nand_info = {
184}; 186};
185#endif 187#endif
186 188
189#ifdef CONFIG_MMP_DISP
190/* path config */
191#define CFG_IOPADMODE(iopad) (iopad) /* 0x0 ~ 0xd */
192#define SCLK_SOURCE_SELECT(x) (x << 30) /* 0x0 ~ 0x3 */
193/* link config */
194#define CFG_DUMBMODE(mode) (mode << 28) /* 0x0 ~ 0x6*/
195#define CFG_GRA_SWAPRB(x) (x << 0) /* 1: rbswap enabled */
196static struct mmp_mach_path_config dkb_disp_config[] = {
197 [0] = {
198 .name = "mmp-parallel",
199 .overlay_num = 2,
200 .output_type = PATH_OUT_PARALLEL,
201 .path_config = CFG_IOPADMODE(0x1)
202 | SCLK_SOURCE_SELECT(0x1),
203 .link_config = CFG_DUMBMODE(0x2)
204 | CFG_GRA_SWAPRB(0x1),
205 },
206};
207
208static struct mmp_mach_plat_info dkb_disp_info = {
209 .name = "mmp-disp",
210 .clk_name = "disp0",
211 .path_num = 1,
212 .paths = dkb_disp_config,
213};
214
215static struct mmp_buffer_driver_mach_info dkb_fb_info = {
216 .name = "mmp-fb",
217 .path_name = "mmp-parallel",
218 .overlay_id = 0,
219 .dmafetch_id = 1,
220 .default_pixfmt = PIXFMT_RGB565,
221};
222
223static void dkb_tpo_panel_power(int on)
224{
225 int err;
226 u32 spi_reset = mfp_to_gpio(MFP_PIN_GPIO106);
227
228 if (on) {
229 err = gpio_request(spi_reset, "TPO_LCD_SPI_RESET");
230 if (err) {
231 pr_err("failed to request GPIO for TPO LCD RESET\n");
232 return;
233 }
234 gpio_direction_output(spi_reset, 0);
235 udelay(100);
236 gpio_set_value(spi_reset, 1);
237 gpio_free(spi_reset);
238 } else {
239 err = gpio_request(spi_reset, "TPO_LCD_SPI_RESET");
240 if (err) {
241 pr_err("failed to request LCD RESET gpio\n");
242 return;
243 }
244 gpio_set_value(spi_reset, 0);
245 gpio_free(spi_reset);
246 }
247}
248
249static struct mmp_mach_panel_info dkb_tpo_panel_info = {
250 .name = "tpo-hvga",
251 .plat_path_name = "mmp-parallel",
252 .plat_set_onoff = dkb_tpo_panel_power,
253};
254
255static struct spi_board_info spi_board_info[] __initdata = {
256 {
257 .modalias = "tpo-hvga",
258 .platform_data = &dkb_tpo_panel_info,
259 .bus_num = 5,
260 }
261};
262
263static void __init add_disp(void)
264{
265 pxa_register_device(&pxa910_device_disp,
266 &dkb_disp_info, sizeof(dkb_disp_info));
267 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
268 pxa_register_device(&pxa910_device_fb,
269 &dkb_fb_info, sizeof(dkb_fb_info));
270 pxa_register_device(&pxa910_device_panel,
271 &dkb_tpo_panel_info, sizeof(dkb_tpo_panel_info));
272}
273#endif
274
187static void __init ttc_dkb_init(void) 275static void __init ttc_dkb_init(void)
188{ 276{
189 mfp_config(ARRAY_AND_SIZE(ttc_dkb_pin_config)); 277 mfp_config(ARRAY_AND_SIZE(ttc_dkb_pin_config));
@@ -212,6 +300,10 @@ static void __init ttc_dkb_init(void)
212 pxa168_device_u2ootg.dev.platform_data = &ttc_usb_pdata; 300 pxa168_device_u2ootg.dev.platform_data = &ttc_usb_pdata;
213 platform_device_register(&pxa168_device_u2ootg); 301 platform_device_register(&pxa168_device_u2ootg);
214#endif 302#endif
303
304#ifdef CONFIG_MMP_DISP
305 add_disp();
306#endif
215} 307}
216 308
217MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform") 309MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform")