blob: de54ea37814e624c38d4437f37fbfbbfc5292ad1 [file] [log] [blame]
Zohaib Alam929b7fb2014-10-24 15:58:22 -04001/* Copyright (c) 2014, The Linux Foundation. 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
5 * are 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 copyright
9 * notice, this list of conditions and the following disclaimer in
10 * the documentation and/or other materials provided with the
11 * distribution.
12 * * Neither the name of The Linux Foundation 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
19 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
20 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
23 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#include <debug.h>
31#include <err.h>
32#include <msm_panel.h>
33#include "splash.h"
34
35/* PANEL INFO */
36#define QVGA_PANEL_XRES 240
37#define QVGA_PANEL_YRES 320
38#define BPP_16 16
39
40/* FB Base Address */
41#define QPIC_FB_ADDR 0x06D00000
42
43static struct msm_fb_panel_data panel;
44
45void target_display_init(const char *panel_name)
46{
47 uint32_t ret = 0;
48 dprintf(SPEW, "%s: Panel name = %s\n", __func__, panel_name);
49
50 /* Setting panel info */
51 panel.panel_info.xres = QVGA_PANEL_XRES;
52 panel.panel_info.yres = QVGA_PANEL_YRES;
53 panel.panel_info.bpp = BPP_16;
54 panel.panel_info.type = QPIC_PANEL;
55
56 /* Setting FB info */
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_RGB565;
62 panel.fb.base = QPIC_FB_ADDR;
63
64 ret = msm_display_init(&panel);
65 if (ret)
66 dprintf(CRITICAL, "%s: ERROR: Display init failed\n", __func__);
67}
68
69void target_display_shutdown(void)
70{
71 msm_display_off();
72}