1 // SPDX-License-Identifier: GPL-2.0 2 /* 3 * Copyright (c) 2018 MediaTek Inc. 4 * Author: Jitao Shi <jitao.shi@mediatek.com> 5 */ 6 7 #include <linux/delay.h> 8 #include <linux/gpio/consumer.h> 9 #include <linux/module.h> 10 #include <linux/of.h> 11 #include <linux/regulator/consumer.h> 12 13 #include <drm/drm_connector.h> 14 #include <drm/drm_crtc.h> 15 #include <drm/drm_mipi_dsi.h> 16 #include <drm/drm_panel.h> 17 18 #include <video/mipi_display.h> 19 20 struct boe_panel; 21 22 struct panel_desc { 23 const struct drm_display_mode *modes; 24 unsigned int bpc; 25 26 /** 27 * @width_mm: width of the panel's active display area 28 * @height_mm: height of the panel's active display area 29 */ 30 struct { 31 unsigned int width_mm; 32 unsigned int height_mm; 33 } size; 34 35 unsigned long mode_flags; 36 enum mipi_dsi_pixel_format format; 37 int (*init)(struct boe_panel *boe); 38 unsigned int lanes; 39 bool discharge_on_disable; 40 bool lp11_before_reset; 41 }; 42 43 struct boe_panel { 44 struct drm_panel base; 45 struct mipi_dsi_device *dsi; 46 47 const struct panel_desc *desc; 48 49 enum drm_panel_orientation orientation; 50 struct regulator *pp3300; 51 struct regulator *pp1800; 52 struct regulator *avee; 53 struct regulator *avdd; 54 struct gpio_desc *enable_gpio; 55 }; 56 57 static int boe_tv110c9m_init(struct boe_panel *boe) 58 { 59 struct mipi_dsi_multi_context ctx = { .dsi = boe->dsi }; 60 61 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x20); 62 mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01); 63 mipi_dsi_dcs_write_seq_multi(&ctx, 0x05, 0xd9); 64 mipi_dsi_dcs_write_seq_multi(&ctx, 0x07, 0x78); 65 mipi_dsi_dcs_write_seq_multi(&ctx, 0x08, 0x5a); 66 mipi_dsi_dcs_write_seq_multi(&ctx, 0x0d, 0x63); 67 mipi_dsi_dcs_write_seq_multi(&ctx, 0x0e, 0x91); 68 mipi_dsi_dcs_write_seq_multi(&ctx, 0x0f, 0x73); 69 mipi_dsi_dcs_write_seq_multi(&ctx, 0x95, 0xe6); 70 mipi_dsi_dcs_write_seq_multi(&ctx, 0x96, 0xf0); 71 mipi_dsi_dcs_write_seq_multi(&ctx, 0x30, 0x00); 72 mipi_dsi_dcs_write_seq_multi(&ctx, 0x6d, 0x66); 73 mipi_dsi_dcs_write_seq_multi(&ctx, 0x75, 0xa2); 74 mipi_dsi_dcs_write_seq_multi(&ctx, 0x77, 0x3b); 75 76 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x00, 0x08, 0x00, 0x23, 0x00, 0x4d, 0x00, 0x6d, 77 0x00, 0x89, 0x00, 0xa1, 0x00, 0xb6, 0x00, 0xc9); 78 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb1, 0x00, 0xda, 0x01, 0x13, 0x01, 0x3c, 0x01, 0x7e, 79 0x01, 0xab, 0x01, 0xf7, 0x02, 0x2f, 0x02, 0x31); 80 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb2, 0x02, 0x67, 0x02, 0xa6, 0x02, 0xd1, 0x03, 0x08, 81 0x03, 0x2e, 0x03, 0x5b, 0x03, 0x6b, 0x03, 0x7b); 82 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb3, 0x03, 0x8e, 0x03, 0xa2, 0x03, 0xb7, 0x03, 0xe7, 83 0x03, 0xfd, 0x03, 0xff); 84 85 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb4, 0x00, 0x08, 0x00, 0x23, 0x00, 0x4d, 0x00, 0x6d, 86 0x00, 0x89, 0x00, 0xa1, 0x00, 0xb6, 0x00, 0xc9); 87 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb5, 0x00, 0xda, 0x01, 0x13, 0x01, 0x3c, 0x01, 0x7e, 88 0x01, 0xab, 0x01, 0xf7, 0x02, 0x2f, 0x02, 0x31); 89 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb6, 0x02, 0x67, 0x02, 0xa6, 0x02, 0xd1, 0x03, 0x08, 90 0x03, 0x2e, 0x03, 0x5b, 0x03, 0x6b, 0x03, 0x7b); 91 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb7, 0x03, 0x8e, 0x03, 0xa2, 0x03, 0xb7, 0x03, 0xe7, 92 0x03, 0xfd, 0x03, 0xff); 93 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb8, 0x00, 0x08, 0x00, 0x23, 0x00, 0x4d, 0x00, 0x6d, 94 0x00, 0x89, 0x00, 0xa1, 0x00, 0xb6, 0x00, 0xc9); 95 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb9, 0x00, 0xda, 0x01, 0x13, 0x01, 0x3c, 0x01, 0x7e, 96 0x01, 0xab, 0x01, 0xf7, 0x02, 0x2f, 0x02, 0x31); 97 mipi_dsi_dcs_write_seq_multi(&ctx, 0xba, 0x02, 0x67, 0x02, 0xa6, 0x02, 0xd1, 0x03, 0x08, 98 0x03, 0x2e, 0x03, 0x5b, 0x03, 0x6b, 0x03, 0x7b); 99 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbb, 0x03, 0x8e, 0x03, 0xa2, 0x03, 0xb7, 0x03, 0xe7, 100 0x03, 0xfd, 0x03, 0xff); 101 102 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x21); 103 mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01); 104 105 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x45, 0x00, 0x65, 106 0x00, 0x81, 0x00, 0x99, 0x00, 0xae, 0x00, 0xc1); 107 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb1, 0x00, 0xd2, 0x01, 0x0b, 0x01, 0x34, 0x01, 0x76, 108 0x01, 0xa3, 0x01, 0xef, 0x02, 0x27, 0x02, 0x29); 109 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb2, 0x02, 0x5f, 0x02, 0x9e, 0x02, 0xc9, 0x03, 0x00, 110 0x03, 0x26, 0x03, 0x53, 0x03, 0x63, 0x03, 0x73); 111 112 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb3, 0x03, 0x86, 0x03, 0x9a, 0x03, 0xaf, 0x03, 0xdf, 113 0x03, 0xf5, 0x03, 0xe0); 114 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb4, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x45, 0x00, 0x65, 115 0x00, 0x81, 0x00, 0x99, 0x00, 0xae, 0x00, 0xc1); 116 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb5, 0x00, 0xd2, 0x01, 0x0b, 0x01, 0x34, 0x01, 0x76, 117 0x01, 0xa3, 0x01, 0xef, 0x02, 0x27, 0x02, 0x29); 118 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb6, 0x02, 0x5f, 0x02, 0x9e, 0x02, 0xc9, 0x03, 0x00, 119 0x03, 0x26, 0x03, 0x53, 0x03, 0x63, 0x03, 0x73); 120 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb7, 0x03, 0x86, 0x03, 0x9a, 0x03, 0xaf, 0x03, 0xdf, 121 0x03, 0xf5, 0x03, 0xe0); 122 123 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb8, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x45, 0x00, 0x65, 124 0x00, 0x81, 0x00, 0x99, 0x00, 0xae, 0x00, 0xc1); 125 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb9, 0x00, 0xd2, 0x01, 0x0b, 0x01, 0x34, 0x01, 0x76, 126 0x01, 0xa3, 0x01, 0xef, 0x02, 0x27, 0x02, 0x29); 127 mipi_dsi_dcs_write_seq_multi(&ctx, 0xba, 0x02, 0x5f, 0x02, 0x9e, 0x02, 0xc9, 0x03, 0x00, 128 0x03, 0x26, 0x03, 0x53, 0x03, 0x63, 0x03, 0x73); 129 130 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbb, 0x03, 0x86, 0x03, 0x9a, 0x03, 0xaf, 0x03, 0xdf, 131 0x03, 0xf5, 0x03, 0xe0); 132 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x24); 133 mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01); 134 135 mipi_dsi_dcs_write_seq_multi(&ctx, 0x00, 0x00); 136 mipi_dsi_dcs_write_seq_multi(&ctx, 0x01, 0x00); 137 138 mipi_dsi_dcs_write_seq_multi(&ctx, 0x02, 0x1c); 139 mipi_dsi_dcs_write_seq_multi(&ctx, 0x03, 0x1c); 140 141 mipi_dsi_dcs_write_seq_multi(&ctx, 0x04, 0x1d); 142 mipi_dsi_dcs_write_seq_multi(&ctx, 0x05, 0x1d); 143 144 mipi_dsi_dcs_write_seq_multi(&ctx, 0x06, 0x04); 145 mipi_dsi_dcs_write_seq_multi(&ctx, 0x07, 0x04); 146 147 mipi_dsi_dcs_write_seq_multi(&ctx, 0x08, 0x0f); 148 mipi_dsi_dcs_write_seq_multi(&ctx, 0x09, 0x0f); 149 150 mipi_dsi_dcs_write_seq_multi(&ctx, 0x0a, 0x0e); 151 mipi_dsi_dcs_write_seq_multi(&ctx, 0x0b, 0x0e); 152 153 mipi_dsi_dcs_write_seq_multi(&ctx, 0x0c, 0x0d); 154 mipi_dsi_dcs_write_seq_multi(&ctx, 0x0d, 0x0d); 155 156 mipi_dsi_dcs_write_seq_multi(&ctx, 0x0e, 0x0c); 157 mipi_dsi_dcs_write_seq_multi(&ctx, 0x0f, 0x0c); 158 159 mipi_dsi_dcs_write_seq_multi(&ctx, 0x10, 0x08); 160 mipi_dsi_dcs_write_seq_multi(&ctx, 0x11, 0x08); 161 162 mipi_dsi_dcs_write_seq_multi(&ctx, 0x12, 0x00); 163 mipi_dsi_dcs_write_seq_multi(&ctx, 0x13, 0x00); 164 mipi_dsi_dcs_write_seq_multi(&ctx, 0x14, 0x00); 165 mipi_dsi_dcs_write_seq_multi(&ctx, 0x15, 0x00); 166 167 mipi_dsi_dcs_write_seq_multi(&ctx, 0x16, 0x00); 168 mipi_dsi_dcs_write_seq_multi(&ctx, 0x17, 0x00); 169 170 mipi_dsi_dcs_write_seq_multi(&ctx, 0x18, 0x1c); 171 mipi_dsi_dcs_write_seq_multi(&ctx, 0x19, 0x1c); 172 173 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1a, 0x1d); 174 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1b, 0x1d); 175 176 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1c, 0x04); 177 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1d, 0x04); 178 179 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1e, 0x0f); 180 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1f, 0x0f); 181 182 mipi_dsi_dcs_write_seq_multi(&ctx, 0x20, 0x0e); 183 mipi_dsi_dcs_write_seq_multi(&ctx, 0x21, 0x0e); 184 185 mipi_dsi_dcs_write_seq_multi(&ctx, 0x22, 0x0d); 186 mipi_dsi_dcs_write_seq_multi(&ctx, 0x23, 0x0d); 187 188 mipi_dsi_dcs_write_seq_multi(&ctx, 0x24, 0x0c); 189 mipi_dsi_dcs_write_seq_multi(&ctx, 0x25, 0x0c); 190 191 mipi_dsi_dcs_write_seq_multi(&ctx, 0x26, 0x08); 192 mipi_dsi_dcs_write_seq_multi(&ctx, 0x27, 0x08); 193 194 mipi_dsi_dcs_write_seq_multi(&ctx, 0x28, 0x00); 195 mipi_dsi_dcs_write_seq_multi(&ctx, 0x29, 0x00); 196 mipi_dsi_dcs_write_seq_multi(&ctx, 0x2a, 0x00); 197 mipi_dsi_dcs_write_seq_multi(&ctx, 0x2b, 0x00); 198 199 mipi_dsi_dcs_write_seq_multi(&ctx, 0x2d, 0x20); 200 mipi_dsi_dcs_write_seq_multi(&ctx, 0x2f, 0x0a); 201 mipi_dsi_dcs_write_seq_multi(&ctx, 0x30, 0x44); 202 mipi_dsi_dcs_write_seq_multi(&ctx, 0x33, 0x0c); 203 mipi_dsi_dcs_write_seq_multi(&ctx, 0x34, 0x32); 204 205 mipi_dsi_dcs_write_seq_multi(&ctx, 0x37, 0x44); 206 mipi_dsi_dcs_write_seq_multi(&ctx, 0x38, 0x40); 207 mipi_dsi_dcs_write_seq_multi(&ctx, 0x39, 0x00); 208 mipi_dsi_dcs_write_seq_multi(&ctx, 0x3a, 0x5d); 209 mipi_dsi_dcs_write_seq_multi(&ctx, 0x3b, 0x60); 210 mipi_dsi_dcs_write_seq_multi(&ctx, 0x3d, 0x42); 211 mipi_dsi_dcs_write_seq_multi(&ctx, 0x3f, 0x06); 212 mipi_dsi_dcs_write_seq_multi(&ctx, 0x43, 0x06); 213 mipi_dsi_dcs_write_seq_multi(&ctx, 0x47, 0x66); 214 mipi_dsi_dcs_write_seq_multi(&ctx, 0x4a, 0x5d); 215 mipi_dsi_dcs_write_seq_multi(&ctx, 0x4b, 0x60); 216 mipi_dsi_dcs_write_seq_multi(&ctx, 0x4c, 0x91); 217 mipi_dsi_dcs_write_seq_multi(&ctx, 0x4d, 0x21); 218 mipi_dsi_dcs_write_seq_multi(&ctx, 0x4e, 0x43); 219 mipi_dsi_dcs_write_seq_multi(&ctx, 0x51, 0x12); 220 mipi_dsi_dcs_write_seq_multi(&ctx, 0x52, 0x34); 221 mipi_dsi_dcs_write_seq_multi(&ctx, 0x55, 0x82, 0x02); 222 mipi_dsi_dcs_write_seq_multi(&ctx, 0x56, 0x04); 223 mipi_dsi_dcs_write_seq_multi(&ctx, 0x58, 0x21); 224 mipi_dsi_dcs_write_seq_multi(&ctx, 0x59, 0x30); 225 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5a, 0x60); 226 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5b, 0x50); 227 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5e, 0x00, 0x06); 228 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5f, 0x00); 229 mipi_dsi_dcs_write_seq_multi(&ctx, 0x65, 0x82); 230 mipi_dsi_dcs_write_seq_multi(&ctx, 0x7e, 0x20); 231 mipi_dsi_dcs_write_seq_multi(&ctx, 0x7f, 0x3c); 232 mipi_dsi_dcs_write_seq_multi(&ctx, 0x82, 0x04); 233 mipi_dsi_dcs_write_seq_multi(&ctx, 0x97, 0xc0); 234 235 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb6, 0x05, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 236 0x05, 0x05, 0x00, 0x00); 237 mipi_dsi_dcs_write_seq_multi(&ctx, 0x91, 0x44); 238 mipi_dsi_dcs_write_seq_multi(&ctx, 0x92, 0xa9); 239 mipi_dsi_dcs_write_seq_multi(&ctx, 0x93, 0x1a); 240 mipi_dsi_dcs_write_seq_multi(&ctx, 0x94, 0x96); 241 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd7, 0x55); 242 mipi_dsi_dcs_write_seq_multi(&ctx, 0xda, 0x0a); 243 mipi_dsi_dcs_write_seq_multi(&ctx, 0xde, 0x08); 244 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdb, 0x05); 245 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdc, 0xa9); 246 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdd, 0x22); 247 248 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdf, 0x05); 249 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe0, 0xa9); 250 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe1, 0x05); 251 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe2, 0xa9); 252 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe3, 0x05); 253 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe4, 0xa9); 254 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe5, 0x05); 255 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe6, 0xa9); 256 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5c, 0x00); 257 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5d, 0x00); 258 mipi_dsi_dcs_write_seq_multi(&ctx, 0x8d, 0x00); 259 mipi_dsi_dcs_write_seq_multi(&ctx, 0x8e, 0x00); 260 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb5, 0x90); 261 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x25); 262 mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01); 263 mipi_dsi_dcs_write_seq_multi(&ctx, 0x05, 0x00); 264 mipi_dsi_dcs_write_seq_multi(&ctx, 0x19, 0x07); 265 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1f, 0x60); 266 mipi_dsi_dcs_write_seq_multi(&ctx, 0x20, 0x50); 267 mipi_dsi_dcs_write_seq_multi(&ctx, 0x26, 0x60); 268 mipi_dsi_dcs_write_seq_multi(&ctx, 0x27, 0x50); 269 mipi_dsi_dcs_write_seq_multi(&ctx, 0x33, 0x60); 270 mipi_dsi_dcs_write_seq_multi(&ctx, 0x34, 0x50); 271 mipi_dsi_dcs_write_seq_multi(&ctx, 0x3f, 0xe0); 272 mipi_dsi_dcs_write_seq_multi(&ctx, 0x40, 0x00); 273 mipi_dsi_dcs_write_seq_multi(&ctx, 0x44, 0x00); 274 mipi_dsi_dcs_write_seq_multi(&ctx, 0x45, 0x40); 275 mipi_dsi_dcs_write_seq_multi(&ctx, 0x48, 0x60); 276 mipi_dsi_dcs_write_seq_multi(&ctx, 0x49, 0x50); 277 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5b, 0x00); 278 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5c, 0x00); 279 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5d, 0x00); 280 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5e, 0xd0); 281 mipi_dsi_dcs_write_seq_multi(&ctx, 0x61, 0x60); 282 mipi_dsi_dcs_write_seq_multi(&ctx, 0x62, 0x50); 283 mipi_dsi_dcs_write_seq_multi(&ctx, 0xf1, 0x10); 284 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x2a); 285 mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01); 286 287 mipi_dsi_dcs_write_seq_multi(&ctx, 0x64, 0x16); 288 mipi_dsi_dcs_write_seq_multi(&ctx, 0x67, 0x16); 289 mipi_dsi_dcs_write_seq_multi(&ctx, 0x6a, 0x16); 290 291 mipi_dsi_dcs_write_seq_multi(&ctx, 0x70, 0x30); 292 293 mipi_dsi_dcs_write_seq_multi(&ctx, 0xa2, 0xf3); 294 mipi_dsi_dcs_write_seq_multi(&ctx, 0xa3, 0xff); 295 mipi_dsi_dcs_write_seq_multi(&ctx, 0xa4, 0xff); 296 mipi_dsi_dcs_write_seq_multi(&ctx, 0xa5, 0xff); 297 298 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd6, 0x08); 299 300 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x26); 301 mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01); 302 mipi_dsi_dcs_write_seq_multi(&ctx, 0x00, 0xa1); 303 304 mipi_dsi_dcs_write_seq_multi(&ctx, 0x02, 0x31); 305 mipi_dsi_dcs_write_seq_multi(&ctx, 0x04, 0x28); 306 mipi_dsi_dcs_write_seq_multi(&ctx, 0x06, 0x30); 307 mipi_dsi_dcs_write_seq_multi(&ctx, 0x0c, 0x16); 308 mipi_dsi_dcs_write_seq_multi(&ctx, 0x0d, 0x0d); 309 mipi_dsi_dcs_write_seq_multi(&ctx, 0x0f, 0x00); 310 mipi_dsi_dcs_write_seq_multi(&ctx, 0x11, 0x00); 311 mipi_dsi_dcs_write_seq_multi(&ctx, 0x12, 0x50); 312 mipi_dsi_dcs_write_seq_multi(&ctx, 0x13, 0x56); 313 mipi_dsi_dcs_write_seq_multi(&ctx, 0x14, 0x57); 314 mipi_dsi_dcs_write_seq_multi(&ctx, 0x15, 0x00); 315 mipi_dsi_dcs_write_seq_multi(&ctx, 0x16, 0x10); 316 mipi_dsi_dcs_write_seq_multi(&ctx, 0x17, 0xa0); 317 mipi_dsi_dcs_write_seq_multi(&ctx, 0x18, 0x86); 318 mipi_dsi_dcs_write_seq_multi(&ctx, 0x19, 0x0d); 319 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1a, 0x7f); 320 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1b, 0x0c); 321 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1c, 0xbf); 322 mipi_dsi_dcs_write_seq_multi(&ctx, 0x22, 0x00); 323 mipi_dsi_dcs_write_seq_multi(&ctx, 0x23, 0x00); 324 mipi_dsi_dcs_write_seq_multi(&ctx, 0x2a, 0x0d); 325 mipi_dsi_dcs_write_seq_multi(&ctx, 0x2b, 0x7f); 326 327 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1d, 0x00); 328 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1e, 0x65); 329 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1f, 0x65); 330 mipi_dsi_dcs_write_seq_multi(&ctx, 0x24, 0x00); 331 mipi_dsi_dcs_write_seq_multi(&ctx, 0x25, 0x65); 332 mipi_dsi_dcs_write_seq_multi(&ctx, 0x2f, 0x05); 333 mipi_dsi_dcs_write_seq_multi(&ctx, 0x30, 0x65); 334 mipi_dsi_dcs_write_seq_multi(&ctx, 0x31, 0x05); 335 mipi_dsi_dcs_write_seq_multi(&ctx, 0x32, 0x7d); 336 mipi_dsi_dcs_write_seq_multi(&ctx, 0x39, 0x00); 337 mipi_dsi_dcs_write_seq_multi(&ctx, 0x3a, 0x65); 338 mipi_dsi_dcs_write_seq_multi(&ctx, 0x20, 0x01); 339 mipi_dsi_dcs_write_seq_multi(&ctx, 0x33, 0x11); 340 mipi_dsi_dcs_write_seq_multi(&ctx, 0x34, 0x78); 341 mipi_dsi_dcs_write_seq_multi(&ctx, 0x35, 0x16); 342 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc8, 0x04); 343 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc9, 0x9e); 344 mipi_dsi_dcs_write_seq_multi(&ctx, 0xca, 0x4e); 345 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcb, 0x00); 346 347 mipi_dsi_dcs_write_seq_multi(&ctx, 0xa9, 0x49); 348 mipi_dsi_dcs_write_seq_multi(&ctx, 0xaa, 0x4b); 349 mipi_dsi_dcs_write_seq_multi(&ctx, 0xab, 0x48); 350 mipi_dsi_dcs_write_seq_multi(&ctx, 0xac, 0x43); 351 mipi_dsi_dcs_write_seq_multi(&ctx, 0xad, 0x40); 352 mipi_dsi_dcs_write_seq_multi(&ctx, 0xae, 0x50); 353 mipi_dsi_dcs_write_seq_multi(&ctx, 0xaf, 0x44); 354 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x54); 355 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb1, 0x4e); 356 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb2, 0x4d); 357 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb3, 0x4c); 358 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb4, 0x41); 359 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb5, 0x47); 360 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb6, 0x53); 361 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb7, 0x3e); 362 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb8, 0x51); 363 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb9, 0x3c); 364 mipi_dsi_dcs_write_seq_multi(&ctx, 0xba, 0x3b); 365 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbb, 0x46); 366 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbc, 0x45); 367 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbd, 0x55); 368 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbe, 0x3d); 369 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbf, 0x3f); 370 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc0, 0x52); 371 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc1, 0x4a); 372 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc2, 0x39); 373 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc3, 0x4f); 374 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc4, 0x3a); 375 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc5, 0x42); 376 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x27); 377 mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01); 378 379 mipi_dsi_dcs_write_seq_multi(&ctx, 0x56, 0x06); 380 mipi_dsi_dcs_write_seq_multi(&ctx, 0x58, 0x80); 381 mipi_dsi_dcs_write_seq_multi(&ctx, 0x59, 0x75); 382 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5a, 0x00); 383 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5b, 0x02); 384 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5c, 0x00); 385 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5d, 0x00); 386 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5e, 0x20); 387 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5f, 0x10); 388 mipi_dsi_dcs_write_seq_multi(&ctx, 0x60, 0x00); 389 mipi_dsi_dcs_write_seq_multi(&ctx, 0x61, 0x2e); 390 mipi_dsi_dcs_write_seq_multi(&ctx, 0x62, 0x00); 391 mipi_dsi_dcs_write_seq_multi(&ctx, 0x63, 0x01); 392 mipi_dsi_dcs_write_seq_multi(&ctx, 0x64, 0x43); 393 mipi_dsi_dcs_write_seq_multi(&ctx, 0x65, 0x2d); 394 mipi_dsi_dcs_write_seq_multi(&ctx, 0x66, 0x00); 395 mipi_dsi_dcs_write_seq_multi(&ctx, 0x67, 0x01); 396 mipi_dsi_dcs_write_seq_multi(&ctx, 0x68, 0x44); 397 398 mipi_dsi_dcs_write_seq_multi(&ctx, 0x00, 0x00); 399 mipi_dsi_dcs_write_seq_multi(&ctx, 0x78, 0x00); 400 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc3, 0x00); 401 402 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x2a); 403 mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01); 404 405 mipi_dsi_dcs_write_seq_multi(&ctx, 0x22, 0x2f); 406 mipi_dsi_dcs_write_seq_multi(&ctx, 0x23, 0x08); 407 408 mipi_dsi_dcs_write_seq_multi(&ctx, 0x24, 0x00); 409 mipi_dsi_dcs_write_seq_multi(&ctx, 0x25, 0x65); 410 mipi_dsi_dcs_write_seq_multi(&ctx, 0x26, 0xf8); 411 mipi_dsi_dcs_write_seq_multi(&ctx, 0x27, 0x00); 412 mipi_dsi_dcs_write_seq_multi(&ctx, 0x28, 0x1a); 413 mipi_dsi_dcs_write_seq_multi(&ctx, 0x29, 0x00); 414 mipi_dsi_dcs_write_seq_multi(&ctx, 0x2a, 0x1a); 415 mipi_dsi_dcs_write_seq_multi(&ctx, 0x2b, 0x00); 416 mipi_dsi_dcs_write_seq_multi(&ctx, 0x2d, 0x1a); 417 418 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x23); 419 mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01); 420 421 mipi_dsi_dcs_write_seq_multi(&ctx, 0x00, 0x80); 422 mipi_dsi_dcs_write_seq_multi(&ctx, 0x07, 0x00); 423 424 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0xe0); 425 mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01); 426 mipi_dsi_dcs_write_seq_multi(&ctx, 0x14, 0x60); 427 mipi_dsi_dcs_write_seq_multi(&ctx, 0x16, 0xc0); 428 429 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0xf0); 430 mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01); 431 mipi_dsi_dcs_write_seq_multi(&ctx, 0x3a, 0x08); 432 433 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x10); 434 mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01); 435 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb9, 0x01); 436 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x20); 437 mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01); 438 mipi_dsi_dcs_write_seq_multi(&ctx, 0x18, 0x40); 439 440 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x10); 441 mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01); 442 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb9, 0x02); 443 mipi_dsi_dcs_write_seq_multi(&ctx, 0x35, 0x00); 444 mipi_dsi_dcs_write_seq_multi(&ctx, 0x51, 0x00, 0xff); 445 mipi_dsi_dcs_write_seq_multi(&ctx, 0x53, 0x24); 446 mipi_dsi_dcs_write_seq_multi(&ctx, 0x55, 0x00); 447 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbb, 0x13); 448 mipi_dsi_dcs_write_seq_multi(&ctx, 0x3b, 0x03, 0x96, 0x1a, 0x04, 0x04); 449 450 mipi_dsi_msleep(&ctx, 100); 451 452 mipi_dsi_dcs_write_seq_multi(&ctx, 0x11); 453 454 mipi_dsi_msleep(&ctx, 200); 455 456 mipi_dsi_dcs_write_seq_multi(&ctx, 0x29); 457 458 mipi_dsi_msleep(&ctx, 100); 459 460 return 0; 461 }; 462 463 static int inx_hj110iz_init(struct boe_panel *boe) 464 { 465 struct mipi_dsi_multi_context ctx = { .dsi = boe->dsi }; 466 467 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x20); 468 mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01); 469 mipi_dsi_dcs_write_seq_multi(&ctx, 0x05, 0xd1); 470 mipi_dsi_dcs_write_seq_multi(&ctx, 0x06, 0xc0); 471 mipi_dsi_dcs_write_seq_multi(&ctx, 0x07, 0x87); 472 mipi_dsi_dcs_write_seq_multi(&ctx, 0x08, 0x4b); 473 474 mipi_dsi_dcs_write_seq_multi(&ctx, 0x0d, 0x63); 475 mipi_dsi_dcs_write_seq_multi(&ctx, 0x0e, 0x91); 476 mipi_dsi_dcs_write_seq_multi(&ctx, 0x0f, 0x69); 477 mipi_dsi_dcs_write_seq_multi(&ctx, 0x94, 0x00); 478 mipi_dsi_dcs_write_seq_multi(&ctx, 0x95, 0xf5); 479 mipi_dsi_dcs_write_seq_multi(&ctx, 0x96, 0xf5); 480 mipi_dsi_dcs_write_seq_multi(&ctx, 0x9d, 0x00); 481 mipi_dsi_dcs_write_seq_multi(&ctx, 0x9e, 0x00); 482 mipi_dsi_dcs_write_seq_multi(&ctx, 0x69, 0x98); 483 mipi_dsi_dcs_write_seq_multi(&ctx, 0x75, 0xa2); 484 mipi_dsi_dcs_write_seq_multi(&ctx, 0x77, 0xb3); 485 486 mipi_dsi_dcs_write_seq_multi(&ctx, 0x58, 0x43); 487 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x24); 488 mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01); 489 mipi_dsi_dcs_write_seq_multi(&ctx, 0x91, 0x44); 490 mipi_dsi_dcs_write_seq_multi(&ctx, 0x92, 0x4c); 491 mipi_dsi_dcs_write_seq_multi(&ctx, 0x94, 0x86); 492 mipi_dsi_dcs_write_seq_multi(&ctx, 0x60, 0x96); 493 mipi_dsi_dcs_write_seq_multi(&ctx, 0x61, 0xd0); 494 mipi_dsi_dcs_write_seq_multi(&ctx, 0x63, 0x70); 495 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc2, 0xca); 496 497 mipi_dsi_dcs_write_seq_multi(&ctx, 0x00, 0x03); 498 mipi_dsi_dcs_write_seq_multi(&ctx, 0x01, 0x03); 499 mipi_dsi_dcs_write_seq_multi(&ctx, 0x02, 0x03); 500 mipi_dsi_dcs_write_seq_multi(&ctx, 0x03, 0x29); 501 mipi_dsi_dcs_write_seq_multi(&ctx, 0x04, 0x22); 502 mipi_dsi_dcs_write_seq_multi(&ctx, 0x05, 0x22); 503 mipi_dsi_dcs_write_seq_multi(&ctx, 0x06, 0x0b); 504 mipi_dsi_dcs_write_seq_multi(&ctx, 0x07, 0x1d); 505 mipi_dsi_dcs_write_seq_multi(&ctx, 0x08, 0x1c); 506 mipi_dsi_dcs_write_seq_multi(&ctx, 0x09, 0x05); 507 mipi_dsi_dcs_write_seq_multi(&ctx, 0x0a, 0x08); 508 mipi_dsi_dcs_write_seq_multi(&ctx, 0x0b, 0x09); 509 mipi_dsi_dcs_write_seq_multi(&ctx, 0x0c, 0x0a); 510 mipi_dsi_dcs_write_seq_multi(&ctx, 0x0d, 0x0c); 511 mipi_dsi_dcs_write_seq_multi(&ctx, 0x0e, 0x0d); 512 mipi_dsi_dcs_write_seq_multi(&ctx, 0x0f, 0x0e); 513 mipi_dsi_dcs_write_seq_multi(&ctx, 0x10, 0x0f); 514 mipi_dsi_dcs_write_seq_multi(&ctx, 0x11, 0x10); 515 mipi_dsi_dcs_write_seq_multi(&ctx, 0x12, 0x11); 516 mipi_dsi_dcs_write_seq_multi(&ctx, 0x13, 0x04); 517 mipi_dsi_dcs_write_seq_multi(&ctx, 0x14, 0x00); 518 mipi_dsi_dcs_write_seq_multi(&ctx, 0x15, 0x03); 519 mipi_dsi_dcs_write_seq_multi(&ctx, 0x16, 0x03); 520 mipi_dsi_dcs_write_seq_multi(&ctx, 0x17, 0x03); 521 mipi_dsi_dcs_write_seq_multi(&ctx, 0x18, 0x03); 522 mipi_dsi_dcs_write_seq_multi(&ctx, 0x19, 0x29); 523 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1a, 0x22); 524 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1b, 0x22); 525 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1c, 0x0b); 526 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1d, 0x1d); 527 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1e, 0x1c); 528 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1f, 0x05); 529 mipi_dsi_dcs_write_seq_multi(&ctx, 0x20, 0x08); 530 mipi_dsi_dcs_write_seq_multi(&ctx, 0x21, 0x09); 531 mipi_dsi_dcs_write_seq_multi(&ctx, 0x22, 0x0a); 532 mipi_dsi_dcs_write_seq_multi(&ctx, 0x23, 0x0c); 533 mipi_dsi_dcs_write_seq_multi(&ctx, 0x24, 0x0d); 534 mipi_dsi_dcs_write_seq_multi(&ctx, 0x25, 0x0e); 535 mipi_dsi_dcs_write_seq_multi(&ctx, 0x26, 0x0f); 536 mipi_dsi_dcs_write_seq_multi(&ctx, 0x27, 0x10); 537 mipi_dsi_dcs_write_seq_multi(&ctx, 0x28, 0x11); 538 mipi_dsi_dcs_write_seq_multi(&ctx, 0x29, 0x04); 539 mipi_dsi_dcs_write_seq_multi(&ctx, 0x2a, 0x00); 540 mipi_dsi_dcs_write_seq_multi(&ctx, 0x2b, 0x03); 541 542 mipi_dsi_dcs_write_seq_multi(&ctx, 0x2f, 0x0a); 543 mipi_dsi_dcs_write_seq_multi(&ctx, 0x30, 0x35); 544 mipi_dsi_dcs_write_seq_multi(&ctx, 0x37, 0xa7); 545 mipi_dsi_dcs_write_seq_multi(&ctx, 0x39, 0x00); 546 mipi_dsi_dcs_write_seq_multi(&ctx, 0x3a, 0x46); 547 mipi_dsi_dcs_write_seq_multi(&ctx, 0x3b, 0x32); 548 mipi_dsi_dcs_write_seq_multi(&ctx, 0x3d, 0x12); 549 550 mipi_dsi_dcs_write_seq_multi(&ctx, 0x3f, 0x33); 551 mipi_dsi_dcs_write_seq_multi(&ctx, 0x40, 0x31); 552 mipi_dsi_dcs_write_seq_multi(&ctx, 0x41, 0x40); 553 mipi_dsi_dcs_write_seq_multi(&ctx, 0x42, 0x42); 554 mipi_dsi_dcs_write_seq_multi(&ctx, 0x47, 0x77); 555 mipi_dsi_dcs_write_seq_multi(&ctx, 0x48, 0x77); 556 mipi_dsi_dcs_write_seq_multi(&ctx, 0x4a, 0x45); 557 mipi_dsi_dcs_write_seq_multi(&ctx, 0x4b, 0x45); 558 mipi_dsi_dcs_write_seq_multi(&ctx, 0x4c, 0x14); 559 560 mipi_dsi_dcs_write_seq_multi(&ctx, 0x4d, 0x21); 561 mipi_dsi_dcs_write_seq_multi(&ctx, 0x4e, 0x43); 562 mipi_dsi_dcs_write_seq_multi(&ctx, 0x4f, 0x65); 563 mipi_dsi_dcs_write_seq_multi(&ctx, 0x55, 0x06); 564 mipi_dsi_dcs_write_seq_multi(&ctx, 0x56, 0x06); 565 mipi_dsi_dcs_write_seq_multi(&ctx, 0x58, 0x21); 566 mipi_dsi_dcs_write_seq_multi(&ctx, 0x59, 0x70); 567 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5a, 0x46); 568 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5b, 0x32); 569 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5c, 0x88); 570 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5e, 0x00, 0x00); 571 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5f, 0x00); 572 573 mipi_dsi_dcs_write_seq_multi(&ctx, 0x7a, 0xff); 574 mipi_dsi_dcs_write_seq_multi(&ctx, 0x7b, 0xff); 575 mipi_dsi_dcs_write_seq_multi(&ctx, 0x7c, 0x00); 576 mipi_dsi_dcs_write_seq_multi(&ctx, 0x7d, 0x00); 577 mipi_dsi_dcs_write_seq_multi(&ctx, 0x7e, 0x20); 578 mipi_dsi_dcs_write_seq_multi(&ctx, 0x7f, 0x3c); 579 mipi_dsi_dcs_write_seq_multi(&ctx, 0x80, 0x00); 580 mipi_dsi_dcs_write_seq_multi(&ctx, 0x81, 0x00); 581 mipi_dsi_dcs_write_seq_multi(&ctx, 0x82, 0x08); 582 mipi_dsi_dcs_write_seq_multi(&ctx, 0x97, 0x02); 583 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc5, 0x10); 584 585 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd7, 0x55); 586 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd8, 0x55); 587 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd9, 0x23); 588 mipi_dsi_dcs_write_seq_multi(&ctx, 0xda, 0x05); 589 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdb, 0x01); 590 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdc, 0x65); 591 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdd, 0x55); 592 mipi_dsi_dcs_write_seq_multi(&ctx, 0xde, 0x27); 593 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdf, 0x01); 594 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe0, 0x65); 595 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe1, 0x01); 596 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe2, 0x65); 597 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe3, 0x01); 598 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe4, 0x65); 599 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe5, 0x01); 600 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe6, 0x65); 601 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe7, 0x00); 602 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe8, 0x00); 603 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe9, 0x01); 604 mipi_dsi_dcs_write_seq_multi(&ctx, 0xea, 0x65); 605 mipi_dsi_dcs_write_seq_multi(&ctx, 0xeb, 0x01); 606 mipi_dsi_dcs_write_seq_multi(&ctx, 0xee, 0x65); 607 mipi_dsi_dcs_write_seq_multi(&ctx, 0xef, 0x01); 608 mipi_dsi_dcs_write_seq_multi(&ctx, 0xf0, 0x65); 609 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb6, 0x05, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 610 0x05, 0x05, 0x00, 0x00); 611 612 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x25); 613 614 mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01); 615 mipi_dsi_dcs_write_seq_multi(&ctx, 0x05, 0x00); 616 mipi_dsi_dcs_write_seq_multi(&ctx, 0xf1, 0x10); 617 618 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1e, 0x00); 619 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1f, 0x46); 620 mipi_dsi_dcs_write_seq_multi(&ctx, 0x20, 0x32); 621 622 mipi_dsi_dcs_write_seq_multi(&ctx, 0x25, 0x00); 623 mipi_dsi_dcs_write_seq_multi(&ctx, 0x26, 0x46); 624 mipi_dsi_dcs_write_seq_multi(&ctx, 0x27, 0x32); 625 626 mipi_dsi_dcs_write_seq_multi(&ctx, 0x3f, 0x80); 627 mipi_dsi_dcs_write_seq_multi(&ctx, 0x40, 0x00); 628 mipi_dsi_dcs_write_seq_multi(&ctx, 0x43, 0x00); 629 630 mipi_dsi_dcs_write_seq_multi(&ctx, 0x44, 0x46); 631 mipi_dsi_dcs_write_seq_multi(&ctx, 0x45, 0x46); 632 633 mipi_dsi_dcs_write_seq_multi(&ctx, 0x48, 0x46); 634 mipi_dsi_dcs_write_seq_multi(&ctx, 0x49, 0x32); 635 636 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5b, 0x80); 637 638 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5c, 0x00); 639 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5d, 0x46); 640 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5e, 0x32); 641 642 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5f, 0x46); 643 mipi_dsi_dcs_write_seq_multi(&ctx, 0x60, 0x32); 644 645 mipi_dsi_dcs_write_seq_multi(&ctx, 0x61, 0x46); 646 mipi_dsi_dcs_write_seq_multi(&ctx, 0x62, 0x32); 647 mipi_dsi_dcs_write_seq_multi(&ctx, 0x68, 0x0c); 648 649 mipi_dsi_dcs_write_seq_multi(&ctx, 0x6c, 0x0d); 650 mipi_dsi_dcs_write_seq_multi(&ctx, 0x6e, 0x0d); 651 mipi_dsi_dcs_write_seq_multi(&ctx, 0x78, 0x00); 652 mipi_dsi_dcs_write_seq_multi(&ctx, 0x79, 0xc5); 653 mipi_dsi_dcs_write_seq_multi(&ctx, 0x7a, 0x0c); 654 mipi_dsi_dcs_write_seq_multi(&ctx, 0x7b, 0xb0); 655 656 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x26); 657 mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01); 658 659 mipi_dsi_dcs_write_seq_multi(&ctx, 0x00, 0xa1); 660 mipi_dsi_dcs_write_seq_multi(&ctx, 0x02, 0x31); 661 mipi_dsi_dcs_write_seq_multi(&ctx, 0x0a, 0xf4); 662 mipi_dsi_dcs_write_seq_multi(&ctx, 0x04, 0x50); 663 mipi_dsi_dcs_write_seq_multi(&ctx, 0x06, 0x30); 664 mipi_dsi_dcs_write_seq_multi(&ctx, 0x0c, 0x16); 665 mipi_dsi_dcs_write_seq_multi(&ctx, 0x0d, 0x0d); 666 mipi_dsi_dcs_write_seq_multi(&ctx, 0x0f, 0x00); 667 mipi_dsi_dcs_write_seq_multi(&ctx, 0x11, 0x00); 668 mipi_dsi_dcs_write_seq_multi(&ctx, 0x12, 0x50); 669 mipi_dsi_dcs_write_seq_multi(&ctx, 0x13, 0x40); 670 mipi_dsi_dcs_write_seq_multi(&ctx, 0x14, 0x58); 671 mipi_dsi_dcs_write_seq_multi(&ctx, 0x15, 0x00); 672 mipi_dsi_dcs_write_seq_multi(&ctx, 0x16, 0x10); 673 mipi_dsi_dcs_write_seq_multi(&ctx, 0x17, 0xa0); 674 mipi_dsi_dcs_write_seq_multi(&ctx, 0x18, 0x86); 675 mipi_dsi_dcs_write_seq_multi(&ctx, 0x22, 0x00); 676 mipi_dsi_dcs_write_seq_multi(&ctx, 0x23, 0x00); 677 678 mipi_dsi_dcs_write_seq_multi(&ctx, 0x19, 0x0e); 679 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1a, 0x31); 680 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1b, 0x0d); 681 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1c, 0x29); 682 mipi_dsi_dcs_write_seq_multi(&ctx, 0x2a, 0x0e); 683 mipi_dsi_dcs_write_seq_multi(&ctx, 0x2b, 0x31); 684 685 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1d, 0x00); 686 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1e, 0x62); 687 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1f, 0x62); 688 689 mipi_dsi_dcs_write_seq_multi(&ctx, 0x2f, 0x06); 690 mipi_dsi_dcs_write_seq_multi(&ctx, 0x30, 0x62); 691 mipi_dsi_dcs_write_seq_multi(&ctx, 0x31, 0x06); 692 mipi_dsi_dcs_write_seq_multi(&ctx, 0x32, 0x7f); 693 mipi_dsi_dcs_write_seq_multi(&ctx, 0x33, 0x11); 694 mipi_dsi_dcs_write_seq_multi(&ctx, 0x34, 0x89); 695 mipi_dsi_dcs_write_seq_multi(&ctx, 0x35, 0x67); 696 697 mipi_dsi_dcs_write_seq_multi(&ctx, 0x39, 0x0b); 698 mipi_dsi_dcs_write_seq_multi(&ctx, 0x3a, 0x62); 699 mipi_dsi_dcs_write_seq_multi(&ctx, 0x3b, 0x06); 700 701 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc8, 0x04); 702 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc9, 0x89); 703 mipi_dsi_dcs_write_seq_multi(&ctx, 0xca, 0x4e); 704 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcb, 0x00); 705 mipi_dsi_dcs_write_seq_multi(&ctx, 0xa9, 0x3f); 706 mipi_dsi_dcs_write_seq_multi(&ctx, 0xaa, 0x3e); 707 mipi_dsi_dcs_write_seq_multi(&ctx, 0xab, 0x3d); 708 mipi_dsi_dcs_write_seq_multi(&ctx, 0xac, 0x3c); 709 mipi_dsi_dcs_write_seq_multi(&ctx, 0xad, 0x3b); 710 mipi_dsi_dcs_write_seq_multi(&ctx, 0xae, 0x3a); 711 mipi_dsi_dcs_write_seq_multi(&ctx, 0xaf, 0x39); 712 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x38); 713 714 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x27); 715 mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01); 716 717 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd0, 0x11); 718 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd1, 0x54); 719 mipi_dsi_dcs_write_seq_multi(&ctx, 0xde, 0x43); 720 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdf, 0x02); 721 722 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc0, 0x18); 723 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc1, 0x00); 724 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc2, 0x00); 725 mipi_dsi_dcs_write_seq_multi(&ctx, 0x00, 0x00); 726 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc3, 0x00); 727 mipi_dsi_dcs_write_seq_multi(&ctx, 0x56, 0x06); 728 729 mipi_dsi_dcs_write_seq_multi(&ctx, 0x58, 0x80); 730 mipi_dsi_dcs_write_seq_multi(&ctx, 0x59, 0x78); 731 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5a, 0x00); 732 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5b, 0x18); 733 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5c, 0x00); 734 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5d, 0x01); 735 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5e, 0x20); 736 mipi_dsi_dcs_write_seq_multi(&ctx, 0x5f, 0x10); 737 mipi_dsi_dcs_write_seq_multi(&ctx, 0x60, 0x00); 738 mipi_dsi_dcs_write_seq_multi(&ctx, 0x61, 0x1c); 739 mipi_dsi_dcs_write_seq_multi(&ctx, 0x62, 0x00); 740 mipi_dsi_dcs_write_seq_multi(&ctx, 0x63, 0x01); 741 mipi_dsi_dcs_write_seq_multi(&ctx, 0x64, 0x44); 742 mipi_dsi_dcs_write_seq_multi(&ctx, 0x65, 0x1b); 743 mipi_dsi_dcs_write_seq_multi(&ctx, 0x66, 0x00); 744 mipi_dsi_dcs_write_seq_multi(&ctx, 0x67, 0x01); 745 mipi_dsi_dcs_write_seq_multi(&ctx, 0x68, 0x44); 746 747 mipi_dsi_dcs_write_seq_multi(&ctx, 0x98, 0x01); 748 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb4, 0x03); 749 mipi_dsi_dcs_write_seq_multi(&ctx, 0x9b, 0xbe); 750 751 mipi_dsi_dcs_write_seq_multi(&ctx, 0xab, 0x14); 752 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbc, 0x08); 753 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbd, 0x28); 754 755 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x2a); 756 mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01); 757 mipi_dsi_dcs_write_seq_multi(&ctx, 0x22, 0x2f); 758 mipi_dsi_dcs_write_seq_multi(&ctx, 0x23, 0x08); 759 760 mipi_dsi_dcs_write_seq_multi(&ctx, 0x24, 0x00); 761 mipi_dsi_dcs_write_seq_multi(&ctx, 0x25, 0x62); 762 mipi_dsi_dcs_write_seq_multi(&ctx, 0x26, 0xf8); 763 mipi_dsi_dcs_write_seq_multi(&ctx, 0x27, 0x00); 764 mipi_dsi_dcs_write_seq_multi(&ctx, 0x28, 0x1a); 765 mipi_dsi_dcs_write_seq_multi(&ctx, 0x29, 0x00); 766 mipi_dsi_dcs_write_seq_multi(&ctx, 0x2a, 0x1a); 767 mipi_dsi_dcs_write_seq_multi(&ctx, 0x2b, 0x00); 768 mipi_dsi_dcs_write_seq_multi(&ctx, 0x2d, 0x1a); 769 770 mipi_dsi_dcs_write_seq_multi(&ctx, 0x64, 0x96); 771 mipi_dsi_dcs_write_seq_multi(&ctx, 0x65, 0x10); 772 mipi_dsi_dcs_write_seq_multi(&ctx, 0x66, 0x00); 773 mipi_dsi_dcs_write_seq_multi(&ctx, 0x67, 0x96); 774 mipi_dsi_dcs_write_seq_multi(&ctx, 0x68, 0x10); 775 mipi_dsi_dcs_write_seq_multi(&ctx, 0x69, 0x00); 776 mipi_dsi_dcs_write_seq_multi(&ctx, 0x6a, 0x96); 777 mipi_dsi_dcs_write_seq_multi(&ctx, 0x6b, 0x10); 778 mipi_dsi_dcs_write_seq_multi(&ctx, 0x6c, 0x00); 779 mipi_dsi_dcs_write_seq_multi(&ctx, 0x70, 0x92); 780 mipi_dsi_dcs_write_seq_multi(&ctx, 0x71, 0x10); 781 mipi_dsi_dcs_write_seq_multi(&ctx, 0x72, 0x00); 782 mipi_dsi_dcs_write_seq_multi(&ctx, 0x79, 0x96); 783 mipi_dsi_dcs_write_seq_multi(&ctx, 0x7a, 0x10); 784 mipi_dsi_dcs_write_seq_multi(&ctx, 0x88, 0x96); 785 mipi_dsi_dcs_write_seq_multi(&ctx, 0x89, 0x10); 786 787 mipi_dsi_dcs_write_seq_multi(&ctx, 0xa2, 0x3f); 788 mipi_dsi_dcs_write_seq_multi(&ctx, 0xa3, 0x30); 789 mipi_dsi_dcs_write_seq_multi(&ctx, 0xa4, 0xc0); 790 mipi_dsi_dcs_write_seq_multi(&ctx, 0xa5, 0x03); 791 792 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe8, 0x00); 793 794 mipi_dsi_dcs_write_seq_multi(&ctx, 0x97, 0x3c); 795 mipi_dsi_dcs_write_seq_multi(&ctx, 0x98, 0x02); 796 mipi_dsi_dcs_write_seq_multi(&ctx, 0x99, 0x95); 797 mipi_dsi_dcs_write_seq_multi(&ctx, 0x9a, 0x06); 798 mipi_dsi_dcs_write_seq_multi(&ctx, 0x9b, 0x00); 799 mipi_dsi_dcs_write_seq_multi(&ctx, 0x9c, 0x0b); 800 mipi_dsi_dcs_write_seq_multi(&ctx, 0x9d, 0x0a); 801 mipi_dsi_dcs_write_seq_multi(&ctx, 0x9e, 0x90); 802 803 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x25); 804 mipi_dsi_dcs_write_seq_multi(&ctx, 0x13, 0x02); 805 mipi_dsi_dcs_write_seq_multi(&ctx, 0x14, 0xd7); 806 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdb, 0x02); 807 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdc, 0xd7); 808 mipi_dsi_dcs_write_seq_multi(&ctx, 0x17, 0xcf); 809 mipi_dsi_dcs_write_seq_multi(&ctx, 0x19, 0x0f); 810 mipi_dsi_dcs_write_seq_multi(&ctx, 0x1b, 0x5b); 811 812 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x20); 813 814 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x24, 0x00, 0x38, 815 0x00, 0x4c, 0x00, 0x5e, 0x00, 0x6f, 0x00, 0x7e); 816 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb1, 0x00, 0x8c, 0x00, 0xbe, 0x00, 0xe5, 0x01, 0x27, 817 0x01, 0x58, 0x01, 0xa8, 0x01, 0xe8, 0x01, 0xea); 818 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb2, 0x02, 0x28, 0x02, 0x71, 0x02, 0x9e, 0x02, 0xda, 819 0x03, 0x00, 0x03, 0x31, 0x03, 0x40, 0x03, 0x51); 820 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb3, 0x03, 0x62, 0x03, 0x75, 0x03, 0x89, 0x03, 0x9c, 821 0x03, 0xaa, 0x03, 0xb2); 822 823 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb4, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x27, 0x00, 0x3d, 824 0x00, 0x52, 0x00, 0x64, 0x00, 0x75, 0x00, 0x84); 825 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb5, 0x00, 0x93, 0x00, 0xc5, 0x00, 0xec, 0x01, 0x2c, 826 0x01, 0x5d, 0x01, 0xac, 0x01, 0xec, 0x01, 0xee); 827 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb6, 0x02, 0x2b, 0x02, 0x73, 0x02, 0xa0, 0x02, 0xdb, 828 0x03, 0x01, 0x03, 0x31, 0x03, 0x41, 0x03, 0x51); 829 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb7, 0x03, 0x63, 0x03, 0x75, 0x03, 0x89, 0x03, 0x9c, 830 0x03, 0xaa, 0x03, 0xb2); 831 832 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb8, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x2a, 0x00, 0x40, 833 0x00, 0x56, 0x00, 0x68, 0x00, 0x7a, 0x00, 0x89); 834 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb9, 0x00, 0x98, 0x00, 0xc9, 0x00, 0xf1, 0x01, 0x30, 835 0x01, 0x61, 0x01, 0xb0, 0x01, 0xef, 0x01, 0xf1); 836 mipi_dsi_dcs_write_seq_multi(&ctx, 0xba, 0x02, 0x2e, 0x02, 0x76, 0x02, 0xa3, 0x02, 0xdd, 837 0x03, 0x02, 0x03, 0x32, 0x03, 0x42, 0x03, 0x53); 838 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbb, 0x03, 0x66, 0x03, 0x75, 0x03, 0x89, 0x03, 0x9c, 839 0x03, 0xaa, 0x03, 0xb2); 840 841 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x21); 842 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x24, 0x00, 0x38, 843 0x00, 0x4c, 0x00, 0x5e, 0x00, 0x6f, 0x00, 0x7e); 844 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb1, 0x00, 0x8c, 0x00, 0xbe, 0x00, 0xe5, 0x01, 0x27, 845 0x01, 0x58, 0x01, 0xa8, 0x01, 0xe8, 0x01, 0xea); 846 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb2, 0x02, 0x28, 0x02, 0x71, 0x02, 0x9e, 0x02, 0xda, 847 0x03, 0x00, 0x03, 0x31, 0x03, 0x40, 0x03, 0x51); 848 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb3, 0x03, 0x62, 0x03, 0x77, 0x03, 0x90, 0x03, 0xac, 849 0x03, 0xca, 0x03, 0xda); 850 851 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb4, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x27, 0x00, 0x3d, 852 0x00, 0x52, 0x00, 0x64, 0x00, 0x75, 0x00, 0x84); 853 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb5, 0x00, 0x93, 0x00, 0xc5, 0x00, 0xec, 0x01, 0x2c, 854 0x01, 0x5d, 0x01, 0xac, 0x01, 0xec, 0x01, 0xee); 855 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb6, 0x02, 0x2b, 0x02, 0x73, 0x02, 0xa0, 0x02, 0xdb, 856 0x03, 0x01, 0x03, 0x31, 0x03, 0x41, 0x03, 0x51); 857 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb7, 0x03, 0x63, 0x03, 0x77, 0x03, 0x90, 0x03, 0xac, 858 0x03, 0xca, 0x03, 0xda); 859 860 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb8, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x2a, 0x00, 0x40, 861 0x00, 0x56, 0x00, 0x68, 0x00, 0x7a, 0x00, 0x89); 862 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb9, 0x00, 0x98, 0x00, 0xc9, 0x00, 0xf1, 0x01, 0x30, 863 0x01, 0x61, 0x01, 0xb0, 0x01, 0xef, 0x01, 0xf1); 864 mipi_dsi_dcs_write_seq_multi(&ctx, 0xba, 0x02, 0x2e, 0x02, 0x76, 0x02, 0xa3, 0x02, 0xdd, 865 0x03, 0x02, 0x03, 0x32, 0x03, 0x42, 0x03, 0x53); 866 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbb, 0x03, 0x66, 0x03, 0x77, 0x03, 0x90, 0x03, 0xac, 867 0x03, 0xca, 0x03, 0xda); 868 869 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0xf0); 870 mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01); 871 mipi_dsi_dcs_write_seq_multi(&ctx, 0x3a, 0x08); 872 873 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x10); 874 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb9, 0x01); 875 876 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x20); 877 878 mipi_dsi_dcs_write_seq_multi(&ctx, 0x18, 0x40); 879 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x10); 880 881 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb9, 0x02); 882 mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x10); 883 884 mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01); 885 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x01); 886 mipi_dsi_dcs_write_seq_multi(&ctx, 0x35, 0x00); 887 mipi_dsi_dcs_write_seq_multi(&ctx, 0x3b, 0x03, 0xae, 0x1a, 0x04, 0x04); 888 889 mipi_dsi_msleep(&ctx, 100); 890 891 mipi_dsi_dcs_write_seq_multi(&ctx, 0x11); 892 893 mipi_dsi_msleep(&ctx, 200); 894 895 mipi_dsi_dcs_write_seq_multi(&ctx, 0x29); 896 897 mipi_dsi_msleep(&ctx, 100); 898 899 return 0; 900 }; 901 902 static int boe_init(struct boe_panel *boe) 903 { 904 struct mipi_dsi_multi_context ctx = { .dsi = boe->dsi }; 905 906 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x05); 907 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb1, 0xe5); 908 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb3, 0x52); 909 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x00); 910 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb3, 0x88); 911 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x04); 912 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb8, 0x00); 913 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x00); 914 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb6, 0x03); 915 mipi_dsi_dcs_write_seq_multi(&ctx, 0xba, 0x8b); 916 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbf, 0x1a); 917 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc0, 0x0f); 918 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc2, 0x0c); 919 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc3, 0x02); 920 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc4, 0x0c); 921 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc5, 0x02); 922 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x01); 923 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe0, 0x26); 924 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe1, 0x26); 925 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdc, 0x00); 926 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdd, 0x00); 927 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcc, 0x26); 928 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcd, 0x26); 929 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc8, 0x00); 930 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc9, 0x00); 931 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd2, 0x03); 932 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd3, 0x03); 933 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe6, 0x04); 934 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe7, 0x04); 935 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc4, 0x09); 936 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc5, 0x09); 937 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd8, 0x0a); 938 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd9, 0x0a); 939 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc2, 0x0b); 940 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc3, 0x0b); 941 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd6, 0x0c); 942 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd7, 0x0c); 943 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc0, 0x05); 944 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc1, 0x05); 945 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd4, 0x06); 946 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd5, 0x06); 947 mipi_dsi_dcs_write_seq_multi(&ctx, 0xca, 0x07); 948 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcb, 0x07); 949 mipi_dsi_dcs_write_seq_multi(&ctx, 0xde, 0x08); 950 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdf, 0x08); 951 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x02); 952 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc0, 0x00); 953 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc1, 0x0d); 954 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc2, 0x17); 955 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc3, 0x26); 956 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc4, 0x31); 957 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc5, 0x1c); 958 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc6, 0x2c); 959 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc7, 0x33); 960 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc8, 0x31); 961 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc9, 0x37); 962 mipi_dsi_dcs_write_seq_multi(&ctx, 0xca, 0x37); 963 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcb, 0x37); 964 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcc, 0x39); 965 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcd, 0x2e); 966 mipi_dsi_dcs_write_seq_multi(&ctx, 0xce, 0x2f); 967 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcf, 0x2f); 968 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd0, 0x07); 969 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd2, 0x00); 970 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd3, 0x0d); 971 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd4, 0x17); 972 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd5, 0x26); 973 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd6, 0x31); 974 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd7, 0x3f); 975 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd8, 0x3f); 976 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd9, 0x3f); 977 mipi_dsi_dcs_write_seq_multi(&ctx, 0xda, 0x3f); 978 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdb, 0x37); 979 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdc, 0x37); 980 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdd, 0x37); 981 mipi_dsi_dcs_write_seq_multi(&ctx, 0xde, 0x39); 982 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdf, 0x2e); 983 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe0, 0x2f); 984 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe1, 0x2f); 985 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe2, 0x07); 986 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x03); 987 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc8, 0x0b); 988 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc9, 0x07); 989 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc3, 0x00); 990 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe7, 0x00); 991 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc5, 0x2a); 992 mipi_dsi_dcs_write_seq_multi(&ctx, 0xde, 0x2a); 993 mipi_dsi_dcs_write_seq_multi(&ctx, 0xca, 0x43); 994 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc9, 0x07); 995 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe4, 0xc0); 996 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe5, 0x0d); 997 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcb, 0x00); 998 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x06); 999 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb8, 0xa5); 1000 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc0, 0xa5); 1001 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc7, 0x0f); 1002 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd5, 0x32); 1003 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb8, 0x00); 1004 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc0, 0x00); 1005 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbc, 0x00); 1006 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x07); 1007 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb1, 0x00); 1008 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb2, 0x02); 1009 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb3, 0x0f); 1010 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb4, 0x25); 1011 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb5, 0x39); 1012 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb6, 0x4e); 1013 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb7, 0x72); 1014 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb8, 0x97); 1015 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb9, 0xdc); 1016 mipi_dsi_dcs_write_seq_multi(&ctx, 0xba, 0x22); 1017 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbb, 0xa4); 1018 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbc, 0x2b); 1019 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbd, 0x2f); 1020 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbe, 0xa9); 1021 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbf, 0x25); 1022 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc0, 0x61); 1023 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc1, 0x97); 1024 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc2, 0xb2); 1025 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc3, 0xcd); 1026 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc4, 0xd9); 1027 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc5, 0xe7); 1028 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc6, 0xf4); 1029 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc7, 0xfa); 1030 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc8, 0xfc); 1031 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc9, 0x00); 1032 mipi_dsi_dcs_write_seq_multi(&ctx, 0xca, 0x00); 1033 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcb, 0x16); 1034 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcc, 0xaf); 1035 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcd, 0xff); 1036 mipi_dsi_dcs_write_seq_multi(&ctx, 0xce, 0xff); 1037 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x08); 1038 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb1, 0x04); 1039 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb2, 0x05); 1040 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb3, 0x11); 1041 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb4, 0x24); 1042 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb5, 0x39); 1043 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb6, 0x4f); 1044 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb7, 0x72); 1045 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb8, 0x98); 1046 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb9, 0xdc); 1047 mipi_dsi_dcs_write_seq_multi(&ctx, 0xba, 0x23); 1048 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbb, 0xa6); 1049 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbc, 0x2c); 1050 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbd, 0x30); 1051 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbe, 0xaa); 1052 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbf, 0x26); 1053 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc0, 0x62); 1054 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc1, 0x9b); 1055 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc2, 0xb5); 1056 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc3, 0xcf); 1057 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc4, 0xdb); 1058 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc5, 0xe8); 1059 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc6, 0xf5); 1060 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc7, 0xfa); 1061 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc8, 0xfc); 1062 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc9, 0x00); 1063 mipi_dsi_dcs_write_seq_multi(&ctx, 0xca, 0x00); 1064 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcb, 0x16); 1065 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcc, 0xaf); 1066 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcd, 0xff); 1067 mipi_dsi_dcs_write_seq_multi(&ctx, 0xce, 0xff); 1068 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x09); 1069 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb1, 0x04); 1070 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb2, 0x02); 1071 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb3, 0x16); 1072 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb4, 0x24); 1073 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb5, 0x3b); 1074 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb6, 0x4f); 1075 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb7, 0x73); 1076 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb8, 0x99); 1077 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb9, 0xe0); 1078 mipi_dsi_dcs_write_seq_multi(&ctx, 0xba, 0x26); 1079 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbb, 0xad); 1080 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbc, 0x36); 1081 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbd, 0x3a); 1082 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbe, 0xae); 1083 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbf, 0x2a); 1084 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc0, 0x66); 1085 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc1, 0x9e); 1086 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc2, 0xb8); 1087 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc3, 0xd1); 1088 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc4, 0xdd); 1089 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc5, 0xe9); 1090 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc6, 0xf6); 1091 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc7, 0xfa); 1092 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc8, 0xfc); 1093 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc9, 0x00); 1094 mipi_dsi_dcs_write_seq_multi(&ctx, 0xca, 0x00); 1095 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcb, 0x16); 1096 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcc, 0xaf); 1097 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcd, 0xff); 1098 mipi_dsi_dcs_write_seq_multi(&ctx, 0xce, 0xff); 1099 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x0a); 1100 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb1, 0x00); 1101 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb2, 0x02); 1102 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb3, 0x0f); 1103 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb4, 0x25); 1104 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb5, 0x39); 1105 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb6, 0x4e); 1106 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb7, 0x72); 1107 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb8, 0x97); 1108 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb9, 0xdc); 1109 mipi_dsi_dcs_write_seq_multi(&ctx, 0xba, 0x22); 1110 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbb, 0xa4); 1111 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbc, 0x2b); 1112 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbd, 0x2f); 1113 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbe, 0xa9); 1114 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbf, 0x25); 1115 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc0, 0x61); 1116 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc1, 0x97); 1117 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc2, 0xb2); 1118 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc3, 0xcd); 1119 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc4, 0xd9); 1120 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc5, 0xe7); 1121 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc6, 0xf4); 1122 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc7, 0xfa); 1123 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc8, 0xfc); 1124 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc9, 0x00); 1125 mipi_dsi_dcs_write_seq_multi(&ctx, 0xca, 0x00); 1126 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcb, 0x16); 1127 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcc, 0xaf); 1128 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcd, 0xff); 1129 mipi_dsi_dcs_write_seq_multi(&ctx, 0xce, 0xff); 1130 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x0b); 1131 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb1, 0x04); 1132 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb2, 0x05); 1133 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb3, 0x11); 1134 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb4, 0x24); 1135 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb5, 0x39); 1136 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb6, 0x4f); 1137 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb7, 0x72); 1138 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb8, 0x98); 1139 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb9, 0xdc); 1140 mipi_dsi_dcs_write_seq_multi(&ctx, 0xba, 0x23); 1141 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbb, 0xa6); 1142 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbc, 0x2c); 1143 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbd, 0x30); 1144 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbe, 0xaa); 1145 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbf, 0x26); 1146 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc0, 0x62); 1147 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc1, 0x9b); 1148 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc2, 0xb5); 1149 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc3, 0xcf); 1150 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc4, 0xdb); 1151 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc5, 0xe8); 1152 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc6, 0xf5); 1153 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc7, 0xfa); 1154 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc8, 0xfc); 1155 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc9, 0x00); 1156 mipi_dsi_dcs_write_seq_multi(&ctx, 0xca, 0x00); 1157 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcb, 0x16); 1158 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcc, 0xaf); 1159 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcd, 0xff); 1160 mipi_dsi_dcs_write_seq_multi(&ctx, 0xce, 0xff); 1161 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x0c); 1162 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb1, 0x04); 1163 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb2, 0x02); 1164 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb3, 0x16); 1165 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb4, 0x24); 1166 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb5, 0x3b); 1167 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb6, 0x4f); 1168 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb7, 0x73); 1169 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb8, 0x99); 1170 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb9, 0xe0); 1171 mipi_dsi_dcs_write_seq_multi(&ctx, 0xba, 0x26); 1172 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbb, 0xad); 1173 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbc, 0x36); 1174 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbd, 0x3a); 1175 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbe, 0xae); 1176 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbf, 0x2a); 1177 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc0, 0x66); 1178 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc1, 0x9e); 1179 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc2, 0xb8); 1180 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc3, 0xd1); 1181 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc4, 0xdd); 1182 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc5, 0xe9); 1183 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc6, 0xf6); 1184 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc7, 0xfa); 1185 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc8, 0xfc); 1186 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc9, 0x00); 1187 mipi_dsi_dcs_write_seq_multi(&ctx, 0xca, 0x00); 1188 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcb, 0x16); 1189 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcc, 0xaf); 1190 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcd, 0xff); 1191 mipi_dsi_dcs_write_seq_multi(&ctx, 0xce, 0xff); 1192 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x00); 1193 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb3, 0x08); 1194 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x04); 1195 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb8, 0x68); 1196 1197 mipi_dsi_msleep(&ctx, 150); 1198 1199 return 0; 1200 }; 1201 1202 static int auo_kd101n80_45na_init(struct boe_panel *boe) 1203 { 1204 struct mipi_dsi_multi_context ctx = { .dsi = boe->dsi }; 1205 1206 msleep(24); 1207 1208 mipi_dsi_dcs_write_seq_multi(&ctx, 0x11); 1209 1210 mipi_dsi_msleep(&ctx, 120); 1211 1212 mipi_dsi_dcs_write_seq_multi(&ctx, 0x29); 1213 1214 mipi_dsi_msleep(&ctx, 120); 1215 1216 return 0; 1217 }; 1218 1219 static int auo_b101uan08_3_init(struct boe_panel *boe) 1220 { 1221 struct mipi_dsi_multi_context ctx = { .dsi = boe->dsi }; 1222 1223 msleep(24); 1224 1225 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x01); 1226 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc0, 0x48); 1227 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc1, 0x48); 1228 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc2, 0x47); 1229 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc3, 0x47); 1230 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc4, 0x46); 1231 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc5, 0x46); 1232 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc6, 0x45); 1233 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc7, 0x45); 1234 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc8, 0x64); 1235 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc9, 0x64); 1236 mipi_dsi_dcs_write_seq_multi(&ctx, 0xca, 0x4f); 1237 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcb, 0x4f); 1238 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcc, 0x40); 1239 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcd, 0x40); 1240 mipi_dsi_dcs_write_seq_multi(&ctx, 0xce, 0x66); 1241 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcf, 0x66); 1242 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd0, 0x4f); 1243 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd1, 0x4f); 1244 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd2, 0x41); 1245 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd3, 0x41); 1246 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd4, 0x48); 1247 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd5, 0x48); 1248 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd6, 0x47); 1249 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd7, 0x47); 1250 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd8, 0x46); 1251 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd9, 0x46); 1252 mipi_dsi_dcs_write_seq_multi(&ctx, 0xda, 0x45); 1253 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdb, 0x45); 1254 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdc, 0x64); 1255 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdd, 0x64); 1256 mipi_dsi_dcs_write_seq_multi(&ctx, 0xde, 0x4f); 1257 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdf, 0x4f); 1258 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe0, 0x40); 1259 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe1, 0x40); 1260 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe2, 0x66); 1261 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe3, 0x66); 1262 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe4, 0x4f); 1263 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe5, 0x4f); 1264 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe6, 0x41); 1265 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe7, 0x41); 1266 1267 mipi_dsi_msleep(&ctx, 150); 1268 1269 return 0; 1270 }; 1271 1272 static int starry_qfh032011_53g_init(struct boe_panel *boe) 1273 { 1274 struct mipi_dsi_multi_context ctx = { .dsi = boe->dsi }; 1275 1276 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x01); 1277 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc3, 0x4f); 1278 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc4, 0x40); 1279 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc5, 0x40); 1280 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc6, 0x40); 1281 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc7, 0x40); 1282 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc8, 0x4d); 1283 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc9, 0x52); 1284 mipi_dsi_dcs_write_seq_multi(&ctx, 0xca, 0x51); 1285 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcd, 0x5d); 1286 mipi_dsi_dcs_write_seq_multi(&ctx, 0xce, 0x5b); 1287 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcf, 0x4b); 1288 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd0, 0x49); 1289 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd1, 0x47); 1290 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd2, 0x45); 1291 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd3, 0x41); 1292 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd7, 0x50); 1293 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd8, 0x40); 1294 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd9, 0x40); 1295 mipi_dsi_dcs_write_seq_multi(&ctx, 0xda, 0x40); 1296 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdb, 0x40); 1297 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdc, 0x4e); 1298 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdd, 0x52); 1299 mipi_dsi_dcs_write_seq_multi(&ctx, 0xde, 0x51); 1300 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe1, 0x5e); 1301 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe2, 0x5c); 1302 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe3, 0x4c); 1303 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe4, 0x4a); 1304 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe5, 0x48); 1305 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe6, 0x46); 1306 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe7, 0x42); 1307 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x03); 1308 mipi_dsi_dcs_write_seq_multi(&ctx, 0xbe, 0x03); 1309 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcc, 0x44); 1310 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc8, 0x07); 1311 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc9, 0x05); 1312 mipi_dsi_dcs_write_seq_multi(&ctx, 0xca, 0x42); 1313 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcd, 0x3e); 1314 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcf, 0x60); 1315 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd2, 0x04); 1316 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd3, 0x04); 1317 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd4, 0x01); 1318 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd5, 0x00); 1319 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd6, 0x03); 1320 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd7, 0x04); 1321 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd9, 0x01); 1322 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdb, 0x01); 1323 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe4, 0xf0); 1324 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe5, 0x0a); 1325 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x00); 1326 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcc, 0x08); 1327 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc2, 0x08); 1328 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc4, 0x10); 1329 mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x02); 1330 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc0, 0x00); 1331 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc1, 0x0a); 1332 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc2, 0x20); 1333 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc3, 0x24); 1334 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc4, 0x23); 1335 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc5, 0x29); 1336 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc6, 0x23); 1337 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc7, 0x1c); 1338 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc8, 0x19); 1339 mipi_dsi_dcs_write_seq_multi(&ctx, 0xc9, 0x17); 1340 mipi_dsi_dcs_write_seq_multi(&ctx, 0xca, 0x17); 1341 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcb, 0x18); 1342 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcc, 0x1a); 1343 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcd, 0x1e); 1344 mipi_dsi_dcs_write_seq_multi(&ctx, 0xce, 0x20); 1345 mipi_dsi_dcs_write_seq_multi(&ctx, 0xcf, 0x23); 1346 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd0, 0x07); 1347 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd1, 0x00); 1348 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd2, 0x00); 1349 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd3, 0x0a); 1350 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd4, 0x13); 1351 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd5, 0x1c); 1352 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd6, 0x1a); 1353 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd7, 0x13); 1354 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd8, 0x17); 1355 mipi_dsi_dcs_write_seq_multi(&ctx, 0xd9, 0x1c); 1356 mipi_dsi_dcs_write_seq_multi(&ctx, 0xda, 0x19); 1357 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdb, 0x17); 1358 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdc, 0x17); 1359 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdd, 0x18); 1360 mipi_dsi_dcs_write_seq_multi(&ctx, 0xde, 0x1a); 1361 mipi_dsi_dcs_write_seq_multi(&ctx, 0xdf, 0x1e); 1362 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe0, 0x20); 1363 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe1, 0x23); 1364 mipi_dsi_dcs_write_seq_multi(&ctx, 0xe2, 0x07); 1365 mipi_dsi_dcs_write_seq_multi(&ctx, 0X11); 1366 1367 mipi_dsi_msleep(&ctx, 120); 1368 1369 mipi_dsi_dcs_write_seq_multi(&ctx, 0X29); 1370 1371 mipi_dsi_msleep(&ctx, 80); 1372 1373 return 0; 1374 }; 1375 1376 static inline struct boe_panel *to_boe_panel(struct drm_panel *panel) 1377 { 1378 return container_of(panel, struct boe_panel, base); 1379 } 1380 1381 static int boe_panel_disable(struct drm_panel *panel) 1382 { 1383 struct boe_panel *boe = to_boe_panel(panel); 1384 struct mipi_dsi_multi_context ctx = { .dsi = boe->dsi }; 1385 1386 boe->dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; 1387 1388 mipi_dsi_dcs_set_display_off_multi(&ctx); 1389 mipi_dsi_dcs_enter_sleep_mode_multi(&ctx); 1390 1391 mipi_dsi_msleep(&ctx, 150); 1392 1393 return ctx.accum_err; 1394 } 1395 1396 static int boe_panel_unprepare(struct drm_panel *panel) 1397 { 1398 struct boe_panel *boe = to_boe_panel(panel); 1399 1400 if (boe->desc->discharge_on_disable) { 1401 regulator_disable(boe->avee); 1402 regulator_disable(boe->avdd); 1403 usleep_range(5000, 7000); 1404 gpiod_set_value(boe->enable_gpio, 0); 1405 usleep_range(5000, 7000); 1406 regulator_disable(boe->pp1800); 1407 regulator_disable(boe->pp3300); 1408 } else { 1409 gpiod_set_value(boe->enable_gpio, 0); 1410 usleep_range(1000, 2000); 1411 regulator_disable(boe->avee); 1412 regulator_disable(boe->avdd); 1413 usleep_range(5000, 7000); 1414 regulator_disable(boe->pp1800); 1415 regulator_disable(boe->pp3300); 1416 } 1417 1418 return 0; 1419 } 1420 1421 static int boe_panel_prepare(struct drm_panel *panel) 1422 { 1423 struct boe_panel *boe = to_boe_panel(panel); 1424 int ret; 1425 1426 gpiod_set_value(boe->enable_gpio, 0); 1427 usleep_range(1000, 1500); 1428 1429 ret = regulator_enable(boe->pp3300); 1430 if (ret < 0) 1431 return ret; 1432 1433 ret = regulator_enable(boe->pp1800); 1434 if (ret < 0) 1435 return ret; 1436 1437 usleep_range(3000, 5000); 1438 1439 ret = regulator_enable(boe->avdd); 1440 if (ret < 0) 1441 goto poweroff1v8; 1442 ret = regulator_enable(boe->avee); 1443 if (ret < 0) 1444 goto poweroffavdd; 1445 1446 usleep_range(10000, 11000); 1447 1448 if (boe->desc->lp11_before_reset) { 1449 ret = mipi_dsi_dcs_nop(boe->dsi); 1450 if (ret < 0) { 1451 dev_err(&boe->dsi->dev, "Failed to send NOP: %d\n", ret); 1452 goto poweroff; 1453 } 1454 usleep_range(1000, 2000); 1455 } 1456 gpiod_set_value(boe->enable_gpio, 1); 1457 usleep_range(1000, 2000); 1458 gpiod_set_value(boe->enable_gpio, 0); 1459 usleep_range(1000, 2000); 1460 gpiod_set_value(boe->enable_gpio, 1); 1461 usleep_range(6000, 10000); 1462 1463 ret = boe->desc->init(boe); 1464 if (ret < 0) 1465 goto poweroff; 1466 1467 return 0; 1468 1469 poweroff: 1470 gpiod_set_value(boe->enable_gpio, 0); 1471 regulator_disable(boe->avee); 1472 poweroffavdd: 1473 regulator_disable(boe->avdd); 1474 poweroff1v8: 1475 usleep_range(5000, 7000); 1476 regulator_disable(boe->pp1800); 1477 1478 return ret; 1479 } 1480 1481 static int boe_panel_enable(struct drm_panel *panel) 1482 { 1483 msleep(130); 1484 return 0; 1485 } 1486 1487 static const struct drm_display_mode boe_tv110c9m_default_mode = { 1488 .clock = 166594, 1489 .hdisplay = 1200, 1490 .hsync_start = 1200 + 40, 1491 .hsync_end = 1200 + 40 + 8, 1492 .htotal = 1200 + 40 + 8 + 28, 1493 .vdisplay = 2000, 1494 .vsync_start = 2000 + 26, 1495 .vsync_end = 2000 + 26 + 2, 1496 .vtotal = 2000 + 26 + 2 + 148, 1497 .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, 1498 }; 1499 1500 static const struct panel_desc boe_tv110c9m_desc = { 1501 .modes = &boe_tv110c9m_default_mode, 1502 .bpc = 8, 1503 .size = { 1504 .width_mm = 143, 1505 .height_mm = 238, 1506 }, 1507 .lanes = 4, 1508 .format = MIPI_DSI_FMT_RGB888, 1509 .mode_flags = MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_VIDEO 1510 | MIPI_DSI_MODE_VIDEO_HSE 1511 | MIPI_DSI_CLOCK_NON_CONTINUOUS 1512 | MIPI_DSI_MODE_VIDEO_BURST, 1513 .init = boe_tv110c9m_init, 1514 }; 1515 1516 static const struct drm_display_mode inx_hj110iz_default_mode = { 1517 .clock = 168432, 1518 .hdisplay = 1200, 1519 .hsync_start = 1200 + 40, 1520 .hsync_end = 1200 + 40 + 8, 1521 .htotal = 1200 + 40 + 8 + 28, 1522 .vdisplay = 2000, 1523 .vsync_start = 2000 + 26, 1524 .vsync_end = 2000 + 26 + 2, 1525 .vtotal = 2000 + 26 + 2 + 172, 1526 .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, 1527 }; 1528 1529 static const struct panel_desc inx_hj110iz_desc = { 1530 .modes = &inx_hj110iz_default_mode, 1531 .bpc = 8, 1532 .size = { 1533 .width_mm = 143, 1534 .height_mm = 238, 1535 }, 1536 .lanes = 4, 1537 .format = MIPI_DSI_FMT_RGB888, 1538 .mode_flags = MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_VIDEO 1539 | MIPI_DSI_MODE_VIDEO_HSE 1540 | MIPI_DSI_CLOCK_NON_CONTINUOUS 1541 | MIPI_DSI_MODE_VIDEO_BURST, 1542 .init = inx_hj110iz_init, 1543 }; 1544 1545 static const struct drm_display_mode boe_tv101wum_nl6_default_mode = { 1546 .clock = 159425, 1547 .hdisplay = 1200, 1548 .hsync_start = 1200 + 100, 1549 .hsync_end = 1200 + 100 + 40, 1550 .htotal = 1200 + 100 + 40 + 24, 1551 .vdisplay = 1920, 1552 .vsync_start = 1920 + 10, 1553 .vsync_end = 1920 + 10 + 14, 1554 .vtotal = 1920 + 10 + 14 + 4, 1555 }; 1556 1557 static const struct panel_desc boe_tv101wum_nl6_desc = { 1558 .modes = &boe_tv101wum_nl6_default_mode, 1559 .bpc = 8, 1560 .size = { 1561 .width_mm = 135, 1562 .height_mm = 216, 1563 }, 1564 .lanes = 4, 1565 .format = MIPI_DSI_FMT_RGB888, 1566 .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | 1567 MIPI_DSI_MODE_LPM, 1568 .init = boe_init, 1569 .discharge_on_disable = false, 1570 }; 1571 1572 static const struct drm_display_mode auo_kd101n80_45na_default_mode = { 1573 .clock = 157000, 1574 .hdisplay = 1200, 1575 .hsync_start = 1200 + 60, 1576 .hsync_end = 1200 + 60 + 24, 1577 .htotal = 1200 + 60 + 24 + 56, 1578 .vdisplay = 1920, 1579 .vsync_start = 1920 + 16, 1580 .vsync_end = 1920 + 16 + 4, 1581 .vtotal = 1920 + 16 + 4 + 16, 1582 }; 1583 1584 static const struct panel_desc auo_kd101n80_45na_desc = { 1585 .modes = &auo_kd101n80_45na_default_mode, 1586 .bpc = 8, 1587 .size = { 1588 .width_mm = 135, 1589 .height_mm = 216, 1590 }, 1591 .lanes = 4, 1592 .format = MIPI_DSI_FMT_RGB888, 1593 .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | 1594 MIPI_DSI_MODE_LPM, 1595 .init = auo_kd101n80_45na_init, 1596 .discharge_on_disable = true, 1597 }; 1598 1599 static const struct drm_display_mode boe_tv101wum_n53_default_mode = { 1600 .clock = 159916, 1601 .hdisplay = 1200, 1602 .hsync_start = 1200 + 80, 1603 .hsync_end = 1200 + 80 + 24, 1604 .htotal = 1200 + 80 + 24 + 60, 1605 .vdisplay = 1920, 1606 .vsync_start = 1920 + 20, 1607 .vsync_end = 1920 + 20 + 4, 1608 .vtotal = 1920 + 20 + 4 + 10, 1609 .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, 1610 }; 1611 1612 static const struct panel_desc boe_tv101wum_n53_desc = { 1613 .modes = &boe_tv101wum_n53_default_mode, 1614 .bpc = 8, 1615 .size = { 1616 .width_mm = 135, 1617 .height_mm = 216, 1618 }, 1619 .lanes = 4, 1620 .format = MIPI_DSI_FMT_RGB888, 1621 .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | 1622 MIPI_DSI_MODE_LPM, 1623 .init = boe_init, 1624 }; 1625 1626 static const struct drm_display_mode auo_b101uan08_3_default_mode = { 1627 .clock = 159667, 1628 .hdisplay = 1200, 1629 .hsync_start = 1200 + 60, 1630 .hsync_end = 1200 + 60 + 4, 1631 .htotal = 1200 + 60 + 4 + 80, 1632 .vdisplay = 1920, 1633 .vsync_start = 1920 + 34, 1634 .vsync_end = 1920 + 34 + 2, 1635 .vtotal = 1920 + 34 + 2 + 24, 1636 .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, 1637 }; 1638 1639 static const struct panel_desc auo_b101uan08_3_desc = { 1640 .modes = &auo_b101uan08_3_default_mode, 1641 .bpc = 8, 1642 .size = { 1643 .width_mm = 135, 1644 .height_mm = 216, 1645 }, 1646 .lanes = 4, 1647 .format = MIPI_DSI_FMT_RGB888, 1648 .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | 1649 MIPI_DSI_MODE_LPM, 1650 .init = auo_b101uan08_3_init, 1651 .lp11_before_reset = true, 1652 }; 1653 1654 static const struct drm_display_mode boe_tv105wum_nw0_default_mode = { 1655 .clock = 159916, 1656 .hdisplay = 1200, 1657 .hsync_start = 1200 + 80, 1658 .hsync_end = 1200 + 80 + 24, 1659 .htotal = 1200 + 80 + 24 + 60, 1660 .vdisplay = 1920, 1661 .vsync_start = 1920 + 20, 1662 .vsync_end = 1920 + 20 + 4, 1663 .vtotal = 1920 + 20 + 4 + 10, 1664 .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, 1665 }; 1666 1667 static const struct panel_desc boe_tv105wum_nw0_desc = { 1668 .modes = &boe_tv105wum_nw0_default_mode, 1669 .bpc = 8, 1670 .size = { 1671 .width_mm = 141, 1672 .height_mm = 226, 1673 }, 1674 .lanes = 4, 1675 .format = MIPI_DSI_FMT_RGB888, 1676 .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | 1677 MIPI_DSI_MODE_LPM, 1678 .init = boe_init, 1679 .lp11_before_reset = true, 1680 }; 1681 1682 static const struct drm_display_mode starry_qfh032011_53g_default_mode = { 1683 .clock = 165731, 1684 .hdisplay = 1200, 1685 .hsync_start = 1200 + 100, 1686 .hsync_end = 1200 + 100 + 10, 1687 .htotal = 1200 + 100 + 10 + 100, 1688 .vdisplay = 1920, 1689 .vsync_start = 1920 + 14, 1690 .vsync_end = 1920 + 14 + 10, 1691 .vtotal = 1920 + 14 + 10 + 15, 1692 }; 1693 1694 static const struct panel_desc starry_qfh032011_53g_desc = { 1695 .modes = &starry_qfh032011_53g_default_mode, 1696 .bpc = 8, 1697 .size = { 1698 .width_mm = 135, 1699 .height_mm = 216, 1700 }, 1701 .lanes = 4, 1702 .format = MIPI_DSI_FMT_RGB888, 1703 .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | 1704 MIPI_DSI_MODE_LPM, 1705 .init = starry_qfh032011_53g_init, 1706 .lp11_before_reset = true, 1707 }; 1708 1709 static int boe_panel_get_modes(struct drm_panel *panel, 1710 struct drm_connector *connector) 1711 { 1712 struct boe_panel *boe = to_boe_panel(panel); 1713 const struct drm_display_mode *m = boe->desc->modes; 1714 struct drm_display_mode *mode; 1715 1716 mode = drm_mode_duplicate(connector->dev, m); 1717 if (!mode) { 1718 dev_err(panel->dev, "failed to add mode %ux%u@%u\n", 1719 m->hdisplay, m->vdisplay, drm_mode_vrefresh(m)); 1720 return -ENOMEM; 1721 } 1722 1723 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; 1724 drm_mode_set_name(mode); 1725 drm_mode_probed_add(connector, mode); 1726 1727 connector->display_info.width_mm = boe->desc->size.width_mm; 1728 connector->display_info.height_mm = boe->desc->size.height_mm; 1729 connector->display_info.bpc = boe->desc->bpc; 1730 /* 1731 * TODO: Remove once all drm drivers call 1732 * drm_connector_set_orientation_from_panel() 1733 */ 1734 drm_connector_set_panel_orientation(connector, boe->orientation); 1735 1736 return 1; 1737 } 1738 1739 static enum drm_panel_orientation boe_panel_get_orientation(struct drm_panel *panel) 1740 { 1741 struct boe_panel *boe = to_boe_panel(panel); 1742 1743 return boe->orientation; 1744 } 1745 1746 static const struct drm_panel_funcs boe_panel_funcs = { 1747 .disable = boe_panel_disable, 1748 .unprepare = boe_panel_unprepare, 1749 .prepare = boe_panel_prepare, 1750 .enable = boe_panel_enable, 1751 .get_modes = boe_panel_get_modes, 1752 .get_orientation = boe_panel_get_orientation, 1753 }; 1754 1755 static int boe_panel_add(struct boe_panel *boe) 1756 { 1757 struct device *dev = &boe->dsi->dev; 1758 int err; 1759 1760 boe->avdd = devm_regulator_get(dev, "avdd"); 1761 if (IS_ERR(boe->avdd)) 1762 return PTR_ERR(boe->avdd); 1763 1764 boe->avee = devm_regulator_get(dev, "avee"); 1765 if (IS_ERR(boe->avee)) 1766 return PTR_ERR(boe->avee); 1767 1768 boe->pp3300 = devm_regulator_get(dev, "pp3300"); 1769 if (IS_ERR(boe->pp3300)) 1770 return PTR_ERR(boe->pp3300); 1771 1772 boe->pp1800 = devm_regulator_get(dev, "pp1800"); 1773 if (IS_ERR(boe->pp1800)) 1774 return PTR_ERR(boe->pp1800); 1775 1776 boe->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW); 1777 if (IS_ERR(boe->enable_gpio)) { 1778 dev_err(dev, "cannot get reset-gpios %ld\n", 1779 PTR_ERR(boe->enable_gpio)); 1780 return PTR_ERR(boe->enable_gpio); 1781 } 1782 1783 gpiod_set_value(boe->enable_gpio, 0); 1784 1785 boe->base.prepare_prev_first = true; 1786 1787 drm_panel_init(&boe->base, dev, &boe_panel_funcs, 1788 DRM_MODE_CONNECTOR_DSI); 1789 err = of_drm_get_panel_orientation(dev->of_node, &boe->orientation); 1790 if (err < 0) { 1791 dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, err); 1792 return err; 1793 } 1794 1795 err = drm_panel_of_backlight(&boe->base); 1796 if (err) 1797 return err; 1798 1799 boe->base.funcs = &boe_panel_funcs; 1800 boe->base.dev = &boe->dsi->dev; 1801 1802 drm_panel_add(&boe->base); 1803 1804 return 0; 1805 } 1806 1807 static int boe_panel_probe(struct mipi_dsi_device *dsi) 1808 { 1809 struct boe_panel *boe; 1810 int ret; 1811 const struct panel_desc *desc; 1812 1813 boe = devm_kzalloc(&dsi->dev, sizeof(*boe), GFP_KERNEL); 1814 if (!boe) 1815 return -ENOMEM; 1816 1817 desc = of_device_get_match_data(&dsi->dev); 1818 dsi->lanes = desc->lanes; 1819 dsi->format = desc->format; 1820 dsi->mode_flags = desc->mode_flags; 1821 boe->desc = desc; 1822 boe->dsi = dsi; 1823 ret = boe_panel_add(boe); 1824 if (ret < 0) 1825 return ret; 1826 1827 mipi_dsi_set_drvdata(dsi, boe); 1828 1829 ret = mipi_dsi_attach(dsi); 1830 if (ret) 1831 drm_panel_remove(&boe->base); 1832 1833 return ret; 1834 } 1835 1836 static void boe_panel_remove(struct mipi_dsi_device *dsi) 1837 { 1838 struct boe_panel *boe = mipi_dsi_get_drvdata(dsi); 1839 int ret; 1840 1841 ret = mipi_dsi_detach(dsi); 1842 if (ret < 0) 1843 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret); 1844 1845 if (boe->base.dev) 1846 drm_panel_remove(&boe->base); 1847 } 1848 1849 static const struct of_device_id boe_of_match[] = { 1850 { .compatible = "boe,tv101wum-nl6", 1851 .data = &boe_tv101wum_nl6_desc 1852 }, 1853 { .compatible = "auo,kd101n80-45na", 1854 .data = &auo_kd101n80_45na_desc 1855 }, 1856 { .compatible = "boe,tv101wum-n53", 1857 .data = &boe_tv101wum_n53_desc 1858 }, 1859 { .compatible = "auo,b101uan08.3", 1860 .data = &auo_b101uan08_3_desc 1861 }, 1862 { .compatible = "boe,tv105wum-nw0", 1863 .data = &boe_tv105wum_nw0_desc 1864 }, 1865 { .compatible = "boe,tv110c9m-ll3", 1866 .data = &boe_tv110c9m_desc 1867 }, 1868 { .compatible = "innolux,hj110iz-01a", 1869 .data = &inx_hj110iz_desc 1870 }, 1871 { .compatible = "starry,2081101qfh032011-53g", 1872 .data = &starry_qfh032011_53g_desc 1873 }, 1874 { /* sentinel */ } 1875 }; 1876 MODULE_DEVICE_TABLE(of, boe_of_match); 1877 1878 static struct mipi_dsi_driver boe_panel_driver = { 1879 .driver = { 1880 .name = "panel-boe-tv101wum-nl6", 1881 .of_match_table = boe_of_match, 1882 }, 1883 .probe = boe_panel_probe, 1884 .remove = boe_panel_remove, 1885 }; 1886 module_mipi_dsi_driver(boe_panel_driver); 1887 1888 MODULE_AUTHOR("Jitao Shi <jitao.shi@mediatek.com>"); 1889 MODULE_DESCRIPTION("BOE tv101wum-nl6 1200x1920 video mode panel driver"); 1890 MODULE_LICENSE("GPL v2"); 1891