blob: 85503fed4e132b6e08ee3fa9a6f6cf8ee1be3b8f [file] [log] [blame]
Roger Quadros03e11102010-05-10 10:35:17 +02001/*
2 * linux/arch/arm/mach-omap2/board-rx51-video.c
3 *
4 * Copyright (C) 2010 Nokia
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/gpio.h>
15#include <linux/spi/spi.h>
16#include <linux/mm.h>
17
18#include <asm/mach-types.h>
Roger Quadros03e11102010-05-10 10:35:17 +020019#include <plat/display.h>
20#include <plat/vram.h>
21#include <plat/mcspi.h>
22
Manjunath Kondaiah G04aeae72010-10-08 09:58:35 -070023#include <mach/board-rx51.h>
24
Roger Quadros03e11102010-05-10 10:35:17 +020025#include "mux.h"
26
27#define RX51_LCD_RESET_GPIO 90
28
29#if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
30
31static int rx51_lcd_enable(struct omap_dss_device *dssdev)
32{
33 gpio_set_value(dssdev->reset_gpio, 1);
34 return 0;
35}
36
37static void rx51_lcd_disable(struct omap_dss_device *dssdev)
38{
39 gpio_set_value(dssdev->reset_gpio, 0);
40}
41
42static struct omap_dss_device rx51_lcd_device = {
43 .name = "lcd",
44 .driver_name = "panel-acx565akm",
45 .type = OMAP_DISPLAY_TYPE_SDI,
46 .phy.sdi.datapairs = 2,
47 .reset_gpio = RX51_LCD_RESET_GPIO,
48 .platform_enable = rx51_lcd_enable,
49 .platform_disable = rx51_lcd_disable,
50};
51
52static struct omap_dss_device *rx51_dss_devices[] = {
53 &rx51_lcd_device,
54};
55
56static struct omap_dss_board_info rx51_dss_board_info = {
57 .num_devices = ARRAY_SIZE(rx51_dss_devices),
58 .devices = rx51_dss_devices,
59 .default_device = &rx51_lcd_device,
60};
61
62struct platform_device rx51_display_device = {
63 .name = "omapdss",
64 .id = -1,
65 .dev = {
66 .platform_data = &rx51_dss_board_info,
67 },
68};
69
70static struct platform_device *rx51_video_devices[] __initdata = {
71 &rx51_display_device,
72};
73
74static int __init rx51_video_init(void)
75{
76 if (!machine_is_nokia_rx51())
77 return 0;
78
79 if (omap_mux_init_gpio(RX51_LCD_RESET_GPIO, OMAP_PIN_OUTPUT)) {
80 pr_err("%s cannot configure MUX for LCD RESET\n", __func__);
81 return 0;
82 }
83
84 if (gpio_request(RX51_LCD_RESET_GPIO, "LCD ACX565AKM reset")) {
85 pr_err("%s failed to get LCD Reset GPIO\n", __func__);
86 return 0;
87 }
88
89 gpio_direction_output(RX51_LCD_RESET_GPIO, 1);
90
91 platform_add_devices(rx51_video_devices,
92 ARRAY_SIZE(rx51_video_devices));
93 return 0;
94}
95
96subsys_initcall(rx51_video_init);
97
98void __init rx51_video_mem_init(void)
99{
100 /*
101 * GFX 864x480x32bpp
102 * VID1/2 1280x720x32bpp double buffered
103 */
104 omap_vram_set_sdram_vram(PAGE_ALIGN(864 * 480 * 4) +
105 2 * PAGE_ALIGN(1280 * 720 * 4 * 2), 0);
106}
107
108#else
109void __init rx51_video_mem_init(void) { }
110#endif /* defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) */