anisha agarwal | 0fc661d | 2014-11-26 11:54:32 -0800 | [diff] [blame] | 1 | /* 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 Parasuram | dbe91a4 | 2014-12-29 13:45:30 -0800 | [diff] [blame^] | 33 | #include <rpm-smd.h> |
anisha agarwal | 0fc661d | 2014-11-26 11:54:32 -0800 | [diff] [blame] | 34 | |
| 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 | |
| 43 | static struct msm_fb_panel_data panel; |
Sridhar Parasuram | dbe91a4 | 2014-12-29 13:45:30 -0800 | [diff] [blame^] | 44 | extern int msm_display_init(struct msm_fb_panel_data *pdata); |
| 45 | extern int msm_display_off(); |
anisha agarwal | 0fc661d | 2014-11-26 11:54:32 -0800 | [diff] [blame] | 46 | |
| 47 | void 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 Parasuram | dbe91a4 | 2014-12-29 13:45:30 -0800 | [diff] [blame^] | 64 | panel.fb.base = (void *) QPIC_FB_ADDR; |
anisha agarwal | 0fc661d | 2014-11-26 11:54:32 -0800 | [diff] [blame] | 65 | |
| 66 | rpm_smd_init(); |
| 67 | ret = msm_display_init(&panel); |
| 68 | if (ret) |
| 69 | dprintf(CRITICAL, "%s: ERROR: Display init failed\n", __func__); |
| 70 | } |
| 71 | |
| 72 | void target_display_shutdown(void) |
| 73 | { |
| 74 | msm_display_off(); |
| 75 | rpm_smd_uninit(); |
| 76 | } |