| /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. |
| * |
| * Redistribution and use in source and binary forms, with or without |
| * modification, are permitted provided that the following conditions are |
| * met: |
| * * Redistributions of source code must retain the above copyright |
| * notice, this list of conditions and the following disclaimer. |
| * * Redistributions in binary form must reproduce the above |
| * copyright notice, this list of conditions and the following |
| * disclaimer in the documentation and/or other materials provided |
| * with the distribution. |
| * * Neither the name of The Linux Foundation nor the names of its |
| * contributors may be used to endorse or promote products derived |
| * from this software without specific prior written permission. |
| * |
| * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED |
| * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT |
| * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS |
| * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
| * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
| * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN |
| * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| * |
| */ |
| |
| #include <stdint.h> |
| #include <msm_panel.h> |
| #include <mipi_dsi.h> |
| #include <sys/types.h> |
| #include <err.h> |
| #include <reg.h> |
| #include <debug.h> |
| #include <target/display.h> |
| #include <platform/iomap.h> |
| |
| #define WVGA_MIPI_FB_WIDTH 480 |
| #define WVGA_MIPI_FB_HEIGHT 854 |
| |
| #define OTM8018B_PANEL_FRAME_RATE 60 |
| #define OTM8018B_PANEL_NUM_OF_LANES 2 |
| #define OTM8018B_PANEL_LANE_SWAP 1 |
| #define OTM8018B_PANEL_T_CLK_PRE 0x41b |
| #define OTM8018B_PANEL_T_CLK_POST 0x0 |
| #define OTM8018B_PANEL_BPP 24 |
| #define OTM8018B_PANEL_CLK_RATE 499000000 |
| |
| #define MIPI_HSYNC_PULSE_WIDTH 8 |
| #define MIPI_HSYNC_BACK_PORCH_DCLK 54 |
| #define MIPI_HSYNC_FRONT_PORCH_DCLK 80 |
| #define MIPI_VSYNC_PULSE_WIDTH 2 |
| #define MIPI_VSYNC_BACK_PORCH_LINES 16 |
| #define MIPI_VSYNC_FRONT_PORCH_LINES 12 |
| |
| static char disp_on0[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0x00, 0xFF, 0xFF |
| }; |
| |
| static char disp_on1[8] = { |
| 0x04, 0x00, 0x29, 0xC0, |
| 0xFF, 0x80, 0x09, 0x01 |
| }; |
| static char disp_on2[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0x80, 0xFF, 0xFF |
| }; |
| static char disp_on3[8] = { |
| 0x03, 0x00, 0x29, 0xC0, |
| 0xFF, 0x80, 0x09, 0xFF |
| }; |
| |
| static char disp_on4[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0x80, 0xFF, 0xFF |
| }; |
| static char disp_on5[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0xD6, 0x48, 0xFF, 0xFF |
| }; |
| |
| static char disp_on6[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0x03, 0xFF, 0xFF |
| }; |
| static char disp_on7[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0xFF, 0x01, 0xFF, 0xFF |
| }; |
| |
| static char disp_on8[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0xB4, 0xFF, 0xFF |
| }; |
| |
| static char disp_on9[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0xC0, 0x10, 0xFF, 0xFF |
| }; |
| |
| static char disp_on10[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0x82, 0xFF, 0xFF |
| }; |
| static char disp_on11[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0xC5, 0xA3, 0xFF, 0xFF |
| }; |
| static char disp_on12[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0x90, 0xFF, 0xFF |
| }; |
| static char disp_on13[8] = { |
| 0x03, 0x00, 0x29, 0xC0, |
| 0xC5, 0x96, 0x87, 0xFF |
| }; |
| static char disp_on14[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0x00, 0xFF, 0xFF |
| }; |
| static char disp_on15[8] = { |
| 0x03, 0x00, 0x29, 0xC0, |
| 0xD8, 0x74, 0x72, 0xFF |
| }; |
| static char disp_on16[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0x00, 0xFF, 0xFF |
| }; |
| static char disp_on17[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0xD9, 0x56, 0xFF, 0xFF |
| }; |
| static char disp_on18[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0x00, 0xFF, 0xFF |
| }; |
| static char disp_on19[24] = { |
| 0x11, 0x00, 0x29, 0xC0, |
| 0xE1, 0x00, 0x06, 0x0A, |
| 0x07, 0x03, 0x16, 0x08, |
| 0x0A, 0x04, 0x06, 0x07, |
| 0x08, 0x0F, 0x23, 0x22, |
| 0x05, 0xff, 0xff, 0xff |
| }; |
| static char disp_on20[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0x00, 0xFF, 0xFF |
| }; |
| static char disp_on21[24] = { |
| 0x11, 0x00, 0x29, 0xC0, |
| 0xE2, 0x00, 0x06, 0x0A, |
| 0x07, 0x03, 0x16, 0x08, |
| 0x0A, 0x04, 0x06, 0x07, |
| 0x08, 0x0F, 0x23, 0x22, |
| 0x05, 0xff, 0xff, 0xff |
| }; |
| static char disp_on22[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0x81, 0xFF, 0xFF |
| }; |
| static char disp_on23[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0xC1, 0x77, 0xFF, 0xFF |
| }; |
| static char disp_on24[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0xA0, 0xFF, 0xFF |
| }; |
| static char disp_on25[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0xC1, 0xEA, 0xFF, 0xFF |
| }; |
| static char disp_on26[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0xA1, 0xFF, 0xFF |
| }; |
| static char disp_on27[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0xC1, 0x08, 0xFF, 0xFF |
| }; |
| static char disp_on28[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0x89, 0xFF, 0xFF |
| }; |
| static char disp_on29[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0xC4, 0x08, 0xFF, 0xFF |
| }; |
| static char disp_on30[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0x81, 0xFF, 0xFF |
| }; |
| static char disp_on31[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0xC4, 0x83, 0xFF, 0xFF |
| }; |
| static char disp_on32[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0x92, 0xFF, 0xFF |
| }; |
| static char disp_on33[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0xC5, 0x01, 0xFF, 0xFF |
| }; |
| static char disp_on34[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0xB1, 0xFF, 0xFF |
| }; |
| static char disp_on35[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0xC5, 0xA9, 0xFF, 0xFF |
| }; |
| static char disp_on36[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0x92, 0xFF, 0xFF |
| }; |
| static char disp_on37[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0xB3, 0x45, 0xFF, 0xFF |
| }; |
| static char disp_on38[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0x90, 0xFF, 0xFF |
| }; |
| static char disp_on39[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0xB3, 0x02, 0xFF, 0xFF |
| }; |
| static char disp_on40[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0x80, 0xFF, 0xFF |
| }; |
| static char disp_on41[12] = { |
| 0x06, 0x00, 0x29, 0xC0, |
| 0xC0, 0x00, 0x58, 0x00, |
| 0x14, 0x16, 0xff, 0xff |
| }; |
| static char disp_on42[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0x80, 0xFF, 0xFF |
| }; |
| static char disp_on43[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0xC4, 0x30, 0xFF, 0xFF |
| }; |
| static char disp_on44[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0x90, 0xFF, 0xFF |
| }; |
| static char disp_on45[12] = { |
| 0x07, 0x00, 0x29, 0xC0, |
| 0xC0, 0x00, 0x44, 0x00, |
| 0x00, 0x00, 0x03, 0xff |
| }; |
| static char disp_on46[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0xA6, 0xFF, 0xFF |
| }; |
| static char disp_on47[8] = { |
| 0x04, 0x00, 0x29, 0xC0, |
| 0xC1, 0x01, 0x00, 0x00 |
| }; |
| static char disp_on48[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0x80, 0xFF, 0xFF |
| }; |
| static char disp_on49[20] = { |
| 0x0D, 0x00, 0x29, 0xC0, |
| 0xCE, 0x87, 0x03, 0x00, |
| 0x85, 0x03, 0x00, 0x86, |
| 0x03, 0x00, 0x84, 0x03, |
| 0x00, 0xff, 0xff, 0xff |
| }; |
| static char disp_on50[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0xA0, 0xFF, 0xFF |
| }; |
| static char disp_on51[20] = { |
| 0x0F, 0x00, 0x29, 0xC0, |
| 0xCE, 0x38, 0x03, 0x03, |
| 0x58, 0x00, 0x00, 0x00, |
| 0x38, 0x02, 0x03, 0x59, |
| 0x00, 0x00, 0x00, 0xff |
| }; |
| static char disp_on52[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0xB0, 0xFF, 0xFF |
| }; |
| static char disp_on53[20] = { |
| 0x0F, 0x00, 0x29, 0xC0, |
| 0xCE, 0x38, 0x01, 0x03, |
| 0x5A, 0x00, 0x00, 0x00, |
| 0x38, 0x00, 0x03, 0x5B, |
| 0x00, 0x00, 0x00, 0xff |
| }; |
| static char disp_on54[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0xC0, 0xFF, 0xFF |
| }; |
| static char disp_on55[20] = { |
| 0x0F, 0x00, 0x29, 0xC0, |
| 0xCE, 0x30, 0x00, 0x03, |
| 0x5C, 0x00, 0x00, 0x00, |
| 0x30, 0x01, 0x03, 0x5D, |
| 0x00, 0x00, 0x00, 0xff |
| }; |
| static char disp_on56[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0xD0, 0xFF, 0xFF |
| }; |
| static char disp_on57[20] = { |
| 0x0F, 0x00, 0x29, 0xC0, |
| 0xCE, 0x30, 0x02, 0x03, |
| 0x5E, 0x00, 0x00, 0x00, |
| 0x30, 0x03, 0x03, 0x5F, |
| 0x00, 0x00, 0x00, 0xff |
| }; |
| static char disp_on58[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0xC7, 0xFF, 0xFF |
| }; |
| static char disp_on59[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0xCF, 0x00, 0xFF, 0xFF |
| }; |
| static char disp_on60[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0xC9, 0xFF, 0xFF |
| }; |
| static char disp_on61[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0xCF, 0x00, 0xFF, 0xFF |
| }; |
| static char disp_on62[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0xD0, 0xFF, 0xFF |
| }; |
| static char disp_on63[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0xCF, 0x00, 0xFF, 0xFF |
| }; |
| static char disp_on64[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0xC4, 0xFF, 0xFF |
| }; |
| static char disp_on65[12] = { |
| 0x07, 0x00, 0x29, 0xC0, |
| 0xCB, 0x04, 0x04, 0x04, |
| 0x04, 0x04, 0x04, 0xff |
| }; |
| static char disp_on66[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0xD9, 0xFF, 0xFF |
| }; |
| static char disp_on67[12] = { |
| 0x07, 0x00, 0x29, 0xC0, |
| 0xCB, 0x04, 0x04, 0x04, |
| 0x04, 0x04, 0x04, 0xff |
| }; |
| static char disp_on68[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0x84, 0xFF, 0xFF |
| }; |
| static char disp_on69[12] = { |
| 0x07, 0x00, 0x29, 0xC0, |
| 0xCC, 0x0C, 0x0A, 0x10, |
| 0x0E, 0x03, 0x04, 0xFF |
| }; |
| static char disp_on70[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0x9E, 0xFF, 0xFF |
| }; |
| static char disp_on71[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0xCC, 0x0B, 0xFF, 0xFF |
| }; |
| static char disp_on72[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0xA0, 0xFF, 0xFF |
| }; |
| static char disp_on73[12] = { |
| 0x06, 0x00, 0x29, 0xC0, |
| 0xCC, 0x09, 0x0F, 0x0D, |
| 0x01, 0x02, 0xFF, 0xFF |
| }; |
| static char disp_on74[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0xB4, 0xFF, 0xFF |
| }; |
| static char disp_on75[12] = { |
| 0x07, 0x00, 0x29, 0xC0, |
| 0xCC, 0x0D, 0x0F, 0x09, |
| 0x0B, 0x02, 0x01, 0xFF |
| }; |
| static char disp_on76[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0xCE, 0xFF, 0xFF |
| }; |
| static char disp_on77[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0xCC, 0x0E, 0xFF, 0xFF |
| }; |
| static char disp_on78[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0xD0, 0xFF, 0xFF |
| }; |
| static char disp_on79[12] = { |
| 0x06, 0x00, 0x29, 0xC0, |
| 0xCC, 0x10, 0x0A, 0x0C, |
| 0x04, 0x03, 0xFF, 0xFF |
| }; |
| static char disp_on80[8] = { |
| 0x02, 0x00, 0x29, 0xC0, |
| 0x00, 0x00, 0xFF, 0xFF |
| }; |
| static char disp_on81[8] = { |
| 0x04, 0x00, 0x29, 0xC0, |
| 0xFF, 0xFF, 0xFF, 0xFF |
| }; |
| static char disp_on82[4] = { |
| 0x11, 0x00, 0x05, 0x80 |
| }; |
| static char disp_on83[4] = { |
| 0x29, 0x00, 0x05, 0x80 |
| }; |
| |
| static struct mipi_dsi_cmd otm8018b_wvga_panel_video_mode_cmds[] = { |
| {sizeof(disp_on0), (char *)disp_on0}, |
| {sizeof(disp_on1), (char *)disp_on1}, |
| {sizeof(disp_on2), (char *)disp_on2}, |
| {sizeof(disp_on3), (char *)disp_on3}, |
| {sizeof(disp_on4), (char *)disp_on4}, |
| {sizeof(disp_on5), (char *)disp_on5}, |
| {sizeof(disp_on6), (char *)disp_on6}, |
| {sizeof(disp_on7), (char *)disp_on7}, |
| {sizeof(disp_on8), (char *)disp_on8}, |
| {sizeof(disp_on9), (char *)disp_on9}, |
| {sizeof(disp_on10), (char *)disp_on10}, |
| {sizeof(disp_on11), (char *)disp_on11}, |
| {sizeof(disp_on12), (char *)disp_on12}, |
| {sizeof(disp_on13), (char *)disp_on13}, |
| {sizeof(disp_on14), (char *)disp_on14}, |
| {sizeof(disp_on15), (char *)disp_on15}, |
| {sizeof(disp_on16), (char *)disp_on16}, |
| {sizeof(disp_on17), (char *)disp_on17}, |
| {sizeof(disp_on18), (char *)disp_on18}, |
| {sizeof(disp_on19), (char *)disp_on19}, |
| {sizeof(disp_on20), (char *)disp_on20}, |
| {sizeof(disp_on21), (char *)disp_on21}, |
| {sizeof(disp_on22), (char *)disp_on22}, |
| {sizeof(disp_on23), (char *)disp_on23}, |
| {sizeof(disp_on24), (char *)disp_on24}, |
| {sizeof(disp_on25), (char *)disp_on25}, |
| {sizeof(disp_on26), (char *)disp_on26}, |
| {sizeof(disp_on27), (char *)disp_on27}, |
| {sizeof(disp_on28), (char *)disp_on28}, |
| {sizeof(disp_on29), (char *)disp_on29}, |
| {sizeof(disp_on30), (char *)disp_on30}, |
| {sizeof(disp_on31), (char *)disp_on31}, |
| {sizeof(disp_on32), (char *)disp_on32}, |
| {sizeof(disp_on33), (char *)disp_on33}, |
| {sizeof(disp_on34), (char *)disp_on34}, |
| {sizeof(disp_on35), (char *)disp_on35}, |
| {sizeof(disp_on36), (char *)disp_on36}, |
| {sizeof(disp_on37), (char *)disp_on37}, |
| {sizeof(disp_on38), (char *)disp_on38}, |
| {sizeof(disp_on39), (char *)disp_on39}, |
| {sizeof(disp_on40), (char *)disp_on40}, |
| {sizeof(disp_on41), (char *)disp_on41}, |
| {sizeof(disp_on42), (char *)disp_on42}, |
| {sizeof(disp_on43), (char *)disp_on43}, |
| {sizeof(disp_on44), (char *)disp_on44}, |
| {sizeof(disp_on45), (char *)disp_on45}, |
| {sizeof(disp_on46), (char *)disp_on46}, |
| {sizeof(disp_on47), (char *)disp_on47}, |
| {sizeof(disp_on48), (char *)disp_on48}, |
| {sizeof(disp_on49), (char *)disp_on49}, |
| {sizeof(disp_on50), (char *)disp_on50}, |
| {sizeof(disp_on51), (char *)disp_on51}, |
| {sizeof(disp_on52), (char *)disp_on52}, |
| {sizeof(disp_on53), (char *)disp_on53}, |
| {sizeof(disp_on54), (char *)disp_on54}, |
| {sizeof(disp_on55), (char *)disp_on55}, |
| {sizeof(disp_on56), (char *)disp_on56}, |
| {sizeof(disp_on57), (char *)disp_on57}, |
| {sizeof(disp_on58), (char *)disp_on58}, |
| {sizeof(disp_on59), (char *)disp_on59}, |
| {sizeof(disp_on60), (char *)disp_on60}, |
| {sizeof(disp_on61), (char *)disp_on61}, |
| {sizeof(disp_on62), (char *)disp_on62}, |
| {sizeof(disp_on63), (char *)disp_on63}, |
| {sizeof(disp_on64), (char *)disp_on64}, |
| {sizeof(disp_on65), (char *)disp_on65}, |
| {sizeof(disp_on66), (char *)disp_on66}, |
| {sizeof(disp_on67), (char *)disp_on67}, |
| {sizeof(disp_on68), (char *)disp_on68}, |
| {sizeof(disp_on69), (char *)disp_on69}, |
| {sizeof(disp_on70), (char *)disp_on70}, |
| {sizeof(disp_on71), (char *)disp_on71}, |
| {sizeof(disp_on72), (char *)disp_on72}, |
| {sizeof(disp_on73), (char *)disp_on73}, |
| {sizeof(disp_on74), (char *)disp_on74}, |
| {sizeof(disp_on75), (char *)disp_on75}, |
| {sizeof(disp_on76), (char *)disp_on76}, |
| {sizeof(disp_on77), (char *)disp_on77}, |
| {sizeof(disp_on78), (char *)disp_on78}, |
| {sizeof(disp_on79), (char *)disp_on79}, |
| {sizeof(disp_on80), (char *)disp_on80}, |
| {sizeof(disp_on81), (char *)disp_on81}, |
| {sizeof(disp_on82), (char *)disp_on82}, |
| {sizeof(disp_on83), (char *)disp_on83}, |
| }; |
| |
| int mipi_otm8018b_video_wvga_config(void *pdata) |
| { |
| int ret = NO_ERROR; |
| /* 2 Lanes -- Enables Data Lane0, 1 */ |
| unsigned char lane_en = 3; |
| unsigned long low_pwr_stop_mode = 0; |
| |
| /* Needed or else will have blank line at top of display */ |
| unsigned char eof_bllp_pwr = 0x9; |
| |
| unsigned char interleav = 0; |
| struct lcdc_panel_info *lcdc = NULL; |
| struct msm_panel_info *pinfo = (struct msm_panel_info *) pdata; |
| |
| if (pinfo == NULL) |
| return ERR_INVALID_ARGS; |
| |
| lcdc = &(pinfo->lcdc); |
| if (lcdc == NULL) |
| return ERR_INVALID_ARGS; |
| |
| ret = mdss_dsi_video_mode_config((pinfo->xres), |
| (pinfo->yres), |
| (pinfo->xres), |
| (pinfo->yres), |
| (lcdc->h_front_porch), |
| (lcdc->h_back_porch + lcdc->h_pulse_width), |
| (lcdc->v_front_porch), |
| (lcdc->v_back_porch + lcdc->v_pulse_width), |
| (lcdc->h_pulse_width), |
| (lcdc->v_pulse_width), |
| pinfo->mipi.dst_format, |
| pinfo->mipi.traffic_mode, |
| lane_en, |
| low_pwr_stop_mode, |
| eof_bllp_pwr, |
| interleav, |
| MIPI_DSI0_BASE); |
| return ret; |
| } |
| |
| int mipi_otm8018b_video_wvga_on() |
| { |
| int ret = NO_ERROR; |
| return ret; |
| } |
| |
| int mipi_otm8018b_video_wvga_off() |
| { |
| int ret = NO_ERROR; |
| return ret; |
| } |
| |
| static struct mdss_dsi_phy_ctrl dsi_video_mode_phy_db = { |
| {0x02, 0x08, 0x05, 0x00, 0x20, 0x03}, |
| {0x8B, 0x1F, 0x05, 0x00, 0x45, 0x4A, |
| 0x19, 0x23, 0x23, 0x03, 0x04, 0x00}, |
| {0x7f, 0x00, 0x00, 0x00}, |
| {0xff, 0x06}, |
| {0x03, 0x03, 0x00, 0x00, 0x0f, 0x00}, |
| { 0x80, 0x45, 0x00, 0x00, 0x00, 0x01, 0x66, 0x00, 0x00, |
| 0x80, 0x45, 0x00, 0x00, 0x00, 0x01, 0x66, 0x00, 0x00, |
| 0x80, 0x45, 0x00, 0x00, 0x00, 0x01, 0x66, 0x00, 0x00, |
| 0x80, 0x45, 0x00, 0x00, 0x00, 0x01, 0x66, 0x00, 0x00, |
| 0x40, 0x67, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, 0x00}, |
| }; |
| |
| void mipi_otm8018b_video_wvga_init(struct msm_panel_info *pinfo) |
| { |
| if (!pinfo) |
| return; |
| |
| pinfo->xres = WVGA_MIPI_FB_WIDTH; |
| pinfo->yres = WVGA_MIPI_FB_HEIGHT; |
| pinfo->lcdc.h_back_porch = MIPI_HSYNC_BACK_PORCH_DCLK; |
| pinfo->lcdc.h_front_porch = MIPI_HSYNC_FRONT_PORCH_DCLK; |
| pinfo->lcdc.h_pulse_width = MIPI_HSYNC_PULSE_WIDTH; |
| pinfo->lcdc.v_back_porch = MIPI_VSYNC_BACK_PORCH_LINES; |
| pinfo->lcdc.v_front_porch = MIPI_VSYNC_FRONT_PORCH_LINES; |
| pinfo->lcdc.v_pulse_width = MIPI_VSYNC_PULSE_WIDTH; |
| pinfo->mipi.num_of_lanes = OTM8018B_PANEL_NUM_OF_LANES; |
| pinfo->mipi.frame_rate = OTM8018B_PANEL_FRAME_RATE; |
| |
| pinfo->type = MIPI_VIDEO_PANEL; |
| pinfo->wait_cycle = 0; |
| pinfo->bpp = OTM8018B_PANEL_BPP; |
| pinfo->clk_rate = OTM8018B_PANEL_CLK_RATE; |
| |
| pinfo->mipi.mode = DSI_VIDEO_MODE; |
| pinfo->mipi.traffic_mode = 2; |
| pinfo->mipi.dst_format = DSI_VIDEO_DST_FORMAT_RGB888; |
| pinfo->mipi.mdss_dsi_phy_db = &dsi_video_mode_phy_db; |
| pinfo->mipi.tx_eot_append = TRUE; |
| |
| pinfo->mipi.lane_swap = OTM8018B_PANEL_LANE_SWAP; |
| pinfo->mipi.t_clk_post = OTM8018B_PANEL_T_CLK_POST; |
| pinfo->mipi.t_clk_pre = OTM8018B_PANEL_T_CLK_PRE; |
| pinfo->mipi.panel_cmds = otm8018b_wvga_panel_video_mode_cmds; |
| pinfo->mipi.num_of_panel_cmds = |
| ARRAY_SIZE(otm8018b_wvga_panel_video_mode_cmds); |
| |
| pinfo->on = mipi_otm8018b_video_wvga_on; |
| pinfo->off = mipi_otm8018b_video_wvga_off; |
| pinfo->config = mipi_otm8018b_video_wvga_config; |
| |
| return; |
| }; |