blob: ba42932f99ec74be648a72ab68ab34f3bcd67dc6 [file] [log] [blame]
anisha agarwal0fc661d2014-11-26 11:54:32 -08001/* 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>
Sridhar Parasuramdbe91a42014-12-29 13:45:30 -080033#include <rpm-smd.h>
anisha agarwal0fc661d2014-11-26 11:54:32 -080034
35/* PANEL INFO */
36#define HVGA_PANEL_XRES 320
37#define HVGA_PANEL_YRES 480
38#define BPP_16 16
39
40/* FB Base Address */
41#define QPIC_FB_ADDR 0x80000000
42
43static struct msm_fb_panel_data panel;
Sridhar Parasuramdbe91a42014-12-29 13:45:30 -080044extern int msm_display_init(struct msm_fb_panel_data *pdata);
45extern int msm_display_off();
anisha agarwal0fc661d2014-11-26 11:54:32 -080046
47void target_display_init(const char *panel_name)
48{
49 uint32_t ret = 0;
50 dprintf(SPEW, "%s: Panel name = %s\n", __func__, panel_name);
51
52 /* Setting panel info */
53 panel.panel_info.xres = HVGA_PANEL_XRES;
54 panel.panel_info.yres = HVGA_PANEL_YRES;
55 panel.panel_info.bpp = BPP_16;
56 panel.panel_info.type = QPIC_PANEL;
57
58 /* Setting FB info */
59 panel.fb.width = panel.panel_info.xres;
60 panel.fb.height = panel.panel_info.yres;
61 panel.fb.stride = panel.panel_info.xres;
62 panel.fb.bpp = panel.panel_info.bpp;
63 panel.fb.format = FB_FORMAT_RGB565;
Sridhar Parasuramdbe91a42014-12-29 13:45:30 -080064 panel.fb.base = (void *) QPIC_FB_ADDR;
anisha agarwal0fc661d2014-11-26 11:54:32 -080065
anisha agarwal0fc661d2014-11-26 11:54:32 -080066 ret = msm_display_init(&panel);
67 if (ret)
68 dprintf(CRITICAL, "%s: ERROR: Display init failed\n", __func__);
69}
70
71void target_display_shutdown(void)
72{
73 msm_display_off();
anisha agarwal0fc661d2014-11-26 11:54:32 -080074}