blob: e6bce1ebddb4f08eae8b9972819c487576feb2c5 [file] [log] [blame]
Channagoud Kadabi539ef722012-03-29 16:02:50 +05301/* Copyright (c) 2012, Code Aurora Forum. All rights reserved.
2 *
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions are
5 * met:
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above
9 * copyright notice, this list of conditions and the following
10 * disclaimer in the documentation and/or other materials provided
11 * with the distribution.
12 * * Neither the name of Code Aurora Forum, Inc. nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 */
29#include <debug.h>
30#include <msm_panel.h>
31#include <target/display.h>
32#include <target/board.h>
33
34static struct msm_fb_panel_data panel;
35static uint8_t display_enabled;
36
37extern int msm_display_init(struct msm_fb_panel_data *pdata);
38extern int msm_display_off();
39extern int mipi_renesas_panel_dsi_config(int);
40extern int mipi_nt35510_panel_dsi_config(int);
41
42void display_init(void)
43{
44 unsigned mach_type;
45 mach_type = board_machtype();
46
47 dprintf(SPEW, "display_init\n");
48
49 switch (mach_type) {
50 case MSM7X27A_SURF:
51 case MSM8X25_SURF:
52 case MSM7X27A_FFA:
53 mipi_renesas_video_fwvga_init(&(panel.panel_info));
54 panel.clk_func = NULL;
55 panel.power_func = mipi_renesas_panel_dsi_config;
56 panel.fb.base = MIPI_FB_ADDR;
57 panel.fb.width = panel.panel_info.xres;
58 panel.fb.height = panel.panel_info.yres;
59 panel.fb.stride = panel.panel_info.xres;
60 panel.fb.bpp = panel.panel_info.bpp;
61 panel.fb.format = FB_FORMAT_RGB888;
62 panel.mdp_rev = MDP_REV_303;
63 break;
64 case MSM7X25A_SURF:
65 case MSM7X25A_FFA:
66 mipi_renesas_video_hvga_init(&(panel.panel_info));
67 panel.clk_func = NULL;
68 panel.power_func = mipi_renesas_panel_dsi_config;
69 panel.fb.base = MIPI_FB_ADDR;
70 panel.fb.width = panel.panel_info.xres;
71 panel.fb.height = panel.panel_info.yres;
72 panel.fb.stride = panel.panel_info.xres;
73 panel.fb.bpp = panel.panel_info.bpp;
74 panel.fb.format = FB_FORMAT_RGB888;
75 panel.mdp_rev = MDP_REV_303;
76 break;
77 case MSM7X27A_EVB:
78 case MSM8X25_EVB:
Aparna Mallavarapu287d89c2012-05-11 14:27:03 +053079 case MSM8X25_EVT:
Channagoud Kadabi539ef722012-03-29 16:02:50 +053080 mipi_nt35510_video_wvga_init(&(panel.panel_info));
81 panel.clk_func = NULL;
82 panel.power_func = mipi_nt35510_panel_dsi_config;
83 panel.fb.base = MIPI_FB_ADDR;
84 panel.fb.width = panel.panel_info.xres;
85 panel.fb.height = panel.panel_info.yres;
86 panel.fb.stride = panel.panel_info.xres;
87 panel.fb.bpp = panel.panel_info.bpp;
88 panel.fb.format = FB_FORMAT_RGB888;
89 panel.mdp_rev = MDP_REV_303;
90 break;
91 default:
92 return;
93 };
94
95 if (msm_display_init(&panel)) {
96 printf(CRITICAL, "Display init failed!\n");
97 return;
98 }
99 display_image_on_screen();
100 display_enabled = 1;
101}
102
103void display_shutdown(void)
104{
105 dprintf(SPEW, "display_shutdown()\n");
106 if (display_enabled)
107 msm_display_off();
108}