Padmanabhan Komanduru | 8d0f0d2 | 2014-03-22 00:11:29 +0530 | [diff] [blame] | 1 | /* Copyright (c) 2013-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 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 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 "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 | #ifndef _TARGET_MSM8916_DISPLAY_H |
| 30 | #define _TARGET_MSM8916_DISPLAY_H |
| 31 | |
| 32 | /*---------------------------------------------------------------------------*/ |
| 33 | /* HEADER files */ |
| 34 | /*---------------------------------------------------------------------------*/ |
| 35 | #include <display_resource.h> |
| 36 | |
| 37 | /*---------------------------------------------------------------------------*/ |
| 38 | /* GPIO configuration */ |
| 39 | /*---------------------------------------------------------------------------*/ |
| 40 | static struct gpio_pin reset_gpio = { |
| 41 | "msmgpio", 25, 3, 1, 0, 1 |
| 42 | }; |
| 43 | |
| 44 | static struct gpio_pin enable_gpio = { |
| 45 | "msmgpio", 97, 3, 1, 0, 1 |
| 46 | }; |
| 47 | |
| 48 | static struct gpio_pin bkl_gpio = { |
| 49 | "msmgpio", 98, 3, 1, 0, 1 |
| 50 | }; |
| 51 | |
Vineet Bajaj | 3c958dc | 2014-11-07 17:01:29 +0530 | [diff] [blame] | 52 | static struct gpio_pin bkl_gpio_1 = { |
| 53 | "msmgpio", 75, 3, 1, 0, 1 |
| 54 | }; |
| 55 | |
| 56 | static struct gpio_pin bkl_gpio_2 = { |
| 57 | "msmgpio", 77, 3, 1, 0, 1 |
| 58 | }; |
| 59 | |
Mao Flynn | 895b9e7 | 2014-04-15 10:59:14 +0800 | [diff] [blame] | 60 | static struct gpio_pin enp_gpio = { |
| 61 | "msmgpio", 97, 3, 1, 0, 1 |
| 62 | }; |
| 63 | |
| 64 | static struct gpio_pin enn_gpio = { |
| 65 | "msmgpio", 32, 3, 1, 0, 1 |
| 66 | }; |
| 67 | |
Padmanabhan Komanduru | 8d0f0d2 | 2014-03-22 00:11:29 +0530 | [diff] [blame] | 68 | static struct gpio_pin te_gpio = { |
| 69 | 0, 0, 0, 0, 0, 0 |
| 70 | }; |
| 71 | |
| 72 | static struct gpio_pin pwm_gpio = { |
| 73 | 0, 0, 0, 0, 0, 0 |
| 74 | }; |
| 75 | |
Mao Flynn | 732e3c2 | 2014-07-02 17:39:02 +0800 | [diff] [blame] | 76 | static struct gpio_pin bkl_gpio_skuk = { |
| 77 | "msmgpio", 1, 3, 1, 0, 1 |
| 78 | }; |
| 79 | |
| 80 | static struct gpio_pin enp_gpio_skuk = { |
| 81 | "msmgpio", 97, 3, 1, 0, 1 |
| 82 | }; |
| 83 | |
| 84 | static struct gpio_pin enn_gpio_skuk = { |
| 85 | "msmgpio", 98, 3, 1, 0, 1 |
| 86 | }; |
| 87 | |
Gustavo Solaira | fb6fdd6 | 2014-09-30 08:15:32 -0300 | [diff] [blame] | 88 | static struct gpio_pin enable_gpio_skut1 = { |
| 89 | "msmgpio", 8, 3, 1, 0, 1 |
| 90 | }; |
| 91 | |
Padmanabhan Komanduru | 8d0f0d2 | 2014-03-22 00:11:29 +0530 | [diff] [blame] | 92 | /*---------------------------------------------------------------------------*/ |
Padmanabhan Komanduru | 8d0f0d2 | 2014-03-22 00:11:29 +0530 | [diff] [blame] | 93 | /* Target Physical configuration */ |
| 94 | /*---------------------------------------------------------------------------*/ |
| 95 | |
| 96 | static const uint32_t panel_strength_ctrl[] = { |
| 97 | 0xff, 0x06 |
| 98 | }; |
| 99 | |
| 100 | static const char panel_bist_ctrl[] = { |
| 101 | 0x00, 0x00, 0xb1, 0xff, 0x00, 0x00 |
| 102 | }; |
| 103 | |
Padmanabhan Komanduru | b088f92 | 2014-10-28 23:55:20 +0530 | [diff] [blame] | 104 | extern uint32_t panel_regulator_settings[7]; |
| 105 | |
| 106 | static const uint32_t dcdc_regulator_settings[] = { |
| 107 | 0x03, 0x08, 0x07, 0x00, 0x20, 0x07, 0x01 |
| 108 | }; |
| 109 | |
| 110 | static const uint32_t ldo_regulator_settings[] = { |
| 111 | 0x00, 0x01, 0x01, 0x00, 0x20, 0x07, 0x00 |
Padmanabhan Komanduru | 8d0f0d2 | 2014-03-22 00:11:29 +0530 | [diff] [blame] | 112 | }; |
| 113 | |
| 114 | static const char panel_lane_config[] = { |
| 115 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x97, |
| 116 | 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x97, |
| 117 | 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x97, |
| 118 | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x01, 0x97, |
| 119 | 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xbb |
| 120 | }; |
| 121 | |
| 122 | static const uint32_t panel_physical_ctrl[] = { |
| 123 | 0x5f, 0x00, 0x00, 0x10 |
| 124 | }; |
| 125 | |
| 126 | /*---------------------------------------------------------------------------*/ |
| 127 | /* Other Configuration */ |
| 128 | /*---------------------------------------------------------------------------*/ |
| 129 | #define DISPLAY_CMDLINE_PREFIX " mdss_mdp.panel=" |
| 130 | |
| 131 | #define MIPI_FB_ADDR 0x83200000 |
| 132 | |
| 133 | #define MIPI_HSYNC_PULSE_WIDTH 12 |
| 134 | #define MIPI_HSYNC_BACK_PORCH_DCLK 32 |
| 135 | #define MIPI_HSYNC_FRONT_PORCH_DCLK 144 |
| 136 | |
| 137 | #define MIPI_VSYNC_PULSE_WIDTH 4 |
| 138 | #define MIPI_VSYNC_BACK_PORCH_LINES 3 |
| 139 | #define MIPI_VSYNC_FRONT_PORCH_LINES 9 |
| 140 | |
Mao Flynn | 895b9e7 | 2014-04-15 10:59:14 +0800 | [diff] [blame] | 141 | enum qrd_subtype |
| 142 | { |
| 143 | HW_PLATFORM_SUBTYPE_DEFAULT = 0, |
Vineet Bajaj | c122141 | 2014-11-07 18:15:34 +0530 | [diff] [blame^] | 144 | HW_PLATFORM_SUBTYPE_CDP_1 = 1, |
| 145 | HW_PLATFORM_SUBTYPE_MTP_3 = 3, |
Mao Flynn | 895b9e7 | 2014-04-15 10:59:14 +0800 | [diff] [blame] | 146 | HW_PLATFORM_SUBTYPE_SKUH = 4, |
Mao Flynn | 732e3c2 | 2014-07-02 17:39:02 +0800 | [diff] [blame] | 147 | HW_PLATFORM_SUBTYPE_SKUI = 5, /* msm8916 */ |
| 148 | HW_PLATFORM_SUBTYPE_SKUK = 5, /* msm8939 */ |
Gustavo Solaira | fb6fdd6 | 2014-09-30 08:15:32 -0300 | [diff] [blame] | 149 | HW_PLATFORM_SUBTYPE_SKUT1 = 0x40, /* msm8916 */ |
Mao Flynn | 895b9e7 | 2014-04-15 10:59:14 +0800 | [diff] [blame] | 150 | }; |
| 151 | |
Vineet Bajaj | 3c958dc | 2014-11-07 17:01:29 +0530 | [diff] [blame] | 152 | |
| 153 | enum { |
| 154 | JDI_1080P_VIDEO_PANEL, |
| 155 | NT35590_720P_VIDEO_PANEL, |
| 156 | NT35590_720P_CMD_PANEL, |
| 157 | INNOLUX_720P_VIDEO_PANEL, |
| 158 | OTM8019A_FWVGA_VIDEO_PANEL, |
| 159 | OTM1283A_720P_VIDEO_PANEL, |
| 160 | NT35596_1080P_VIDEO_PANEL, |
| 161 | SHARP_WQXGA_DUALDSI_VIDEO_PANEL, |
| 162 | JDI_FHD_VIDEO_PANEL, |
| 163 | HX8379A_FWVGA_VIDEO_PANEL, |
| 164 | HX8394D_720P_VIDEO_PANEL, |
| 165 | NT35521_WXGA_VIDEO_PANEL, |
| 166 | UNKNOWN_PANEL |
| 167 | }; |
| 168 | |
| 169 | uint32_t get_panel_id(void); |
| 170 | |
Padmanabhan Komanduru | 8d0f0d2 | 2014-03-22 00:11:29 +0530 | [diff] [blame] | 171 | #endif |