1 // SPDX-License-Identifier: GPL-2.0 2 /* 3 * Copyright (C) 2017-2018, Bootlin 4 */ 5 6 #include <linux/delay.h> 7 #include <linux/device.h> 8 #include <linux/err.h> 9 #include <linux/errno.h> 10 #include <linux/kernel.h> 11 #include <linux/module.h> 12 #include <linux/of.h> 13 14 #include <linux/gpio/consumer.h> 15 #include <linux/regulator/consumer.h> 16 17 #include <drm/drm_mipi_dsi.h> 18 #include <drm/drm_modes.h> 19 #include <drm/drm_panel.h> 20 21 #include <video/mipi_display.h> 22 23 enum ili9881c_op { 24 ILI9881C_SWITCH_PAGE, 25 ILI9881C_COMMAND, 26 }; 27 28 struct ili9881c_instr { 29 enum ili9881c_op op; 30 31 union arg { 32 struct cmd { 33 u8 cmd; 34 u8 data; 35 } cmd; 36 u8 page; 37 } arg; 38 }; 39 40 struct ili9881c_desc { 41 const struct ili9881c_instr *init; 42 const size_t init_length; 43 const struct drm_display_mode *mode; 44 const unsigned long mode_flags; 45 u8 default_address_mode; 46 }; 47 48 struct ili9881c { 49 struct drm_panel panel; 50 struct mipi_dsi_device *dsi; 51 const struct ili9881c_desc *desc; 52 53 struct regulator *power; 54 struct gpio_desc *reset; 55 56 enum drm_panel_orientation orientation; 57 u8 address_mode; 58 }; 59 60 #define ILI9881C_SWITCH_PAGE_INSTR(_page) \ 61 { \ 62 .op = ILI9881C_SWITCH_PAGE, \ 63 .arg = { \ 64 .page = (_page), \ 65 }, \ 66 } 67 68 #define ILI9881C_COMMAND_INSTR(_cmd, _data) \ 69 { \ 70 .op = ILI9881C_COMMAND, \ 71 .arg = { \ 72 .cmd = { \ 73 .cmd = (_cmd), \ 74 .data = (_data), \ 75 }, \ 76 }, \ 77 } 78 79 static const struct ili9881c_instr lhr050h41_init[] = { 80 ILI9881C_SWITCH_PAGE_INSTR(3), 81 ILI9881C_COMMAND_INSTR(0x01, 0x00), 82 ILI9881C_COMMAND_INSTR(0x02, 0x00), 83 ILI9881C_COMMAND_INSTR(0x03, 0x73), 84 ILI9881C_COMMAND_INSTR(0x04, 0x03), 85 ILI9881C_COMMAND_INSTR(0x05, 0x00), 86 ILI9881C_COMMAND_INSTR(0x06, 0x06), 87 ILI9881C_COMMAND_INSTR(0x07, 0x06), 88 ILI9881C_COMMAND_INSTR(0x08, 0x00), 89 ILI9881C_COMMAND_INSTR(0x09, 0x18), 90 ILI9881C_COMMAND_INSTR(0x0a, 0x04), 91 ILI9881C_COMMAND_INSTR(0x0b, 0x00), 92 ILI9881C_COMMAND_INSTR(0x0c, 0x02), 93 ILI9881C_COMMAND_INSTR(0x0d, 0x03), 94 ILI9881C_COMMAND_INSTR(0x0e, 0x00), 95 ILI9881C_COMMAND_INSTR(0x0f, 0x25), 96 ILI9881C_COMMAND_INSTR(0x10, 0x25), 97 ILI9881C_COMMAND_INSTR(0x11, 0x00), 98 ILI9881C_COMMAND_INSTR(0x12, 0x00), 99 ILI9881C_COMMAND_INSTR(0x13, 0x00), 100 ILI9881C_COMMAND_INSTR(0x14, 0x00), 101 ILI9881C_COMMAND_INSTR(0x15, 0x00), 102 ILI9881C_COMMAND_INSTR(0x16, 0x0C), 103 ILI9881C_COMMAND_INSTR(0x17, 0x00), 104 ILI9881C_COMMAND_INSTR(0x18, 0x00), 105 ILI9881C_COMMAND_INSTR(0x19, 0x00), 106 ILI9881C_COMMAND_INSTR(0x1a, 0x00), 107 ILI9881C_COMMAND_INSTR(0x1b, 0x00), 108 ILI9881C_COMMAND_INSTR(0x1c, 0x00), 109 ILI9881C_COMMAND_INSTR(0x1d, 0x00), 110 ILI9881C_COMMAND_INSTR(0x1e, 0xC0), 111 ILI9881C_COMMAND_INSTR(0x1f, 0x80), 112 ILI9881C_COMMAND_INSTR(0x20, 0x04), 113 ILI9881C_COMMAND_INSTR(0x21, 0x01), 114 ILI9881C_COMMAND_INSTR(0x22, 0x00), 115 ILI9881C_COMMAND_INSTR(0x23, 0x00), 116 ILI9881C_COMMAND_INSTR(0x24, 0x00), 117 ILI9881C_COMMAND_INSTR(0x25, 0x00), 118 ILI9881C_COMMAND_INSTR(0x26, 0x00), 119 ILI9881C_COMMAND_INSTR(0x27, 0x00), 120 ILI9881C_COMMAND_INSTR(0x28, 0x33), 121 ILI9881C_COMMAND_INSTR(0x29, 0x03), 122 ILI9881C_COMMAND_INSTR(0x2a, 0x00), 123 ILI9881C_COMMAND_INSTR(0x2b, 0x00), 124 ILI9881C_COMMAND_INSTR(0x2c, 0x00), 125 ILI9881C_COMMAND_INSTR(0x2d, 0x00), 126 ILI9881C_COMMAND_INSTR(0x2e, 0x00), 127 ILI9881C_COMMAND_INSTR(0x2f, 0x00), 128 ILI9881C_COMMAND_INSTR(0x30, 0x00), 129 ILI9881C_COMMAND_INSTR(0x31, 0x00), 130 ILI9881C_COMMAND_INSTR(0x32, 0x00), 131 ILI9881C_COMMAND_INSTR(0x33, 0x00), 132 ILI9881C_COMMAND_INSTR(0x34, 0x04), 133 ILI9881C_COMMAND_INSTR(0x35, 0x00), 134 ILI9881C_COMMAND_INSTR(0x36, 0x00), 135 ILI9881C_COMMAND_INSTR(0x37, 0x00), 136 ILI9881C_COMMAND_INSTR(0x38, 0x3C), 137 ILI9881C_COMMAND_INSTR(0x39, 0x00), 138 ILI9881C_COMMAND_INSTR(0x3a, 0x00), 139 ILI9881C_COMMAND_INSTR(0x3b, 0x00), 140 ILI9881C_COMMAND_INSTR(0x3c, 0x00), 141 ILI9881C_COMMAND_INSTR(0x3d, 0x00), 142 ILI9881C_COMMAND_INSTR(0x3e, 0x00), 143 ILI9881C_COMMAND_INSTR(0x3f, 0x00), 144 ILI9881C_COMMAND_INSTR(0x40, 0x00), 145 ILI9881C_COMMAND_INSTR(0x41, 0x00), 146 ILI9881C_COMMAND_INSTR(0x42, 0x00), 147 ILI9881C_COMMAND_INSTR(0x43, 0x00), 148 ILI9881C_COMMAND_INSTR(0x44, 0x00), 149 ILI9881C_COMMAND_INSTR(0x50, 0x01), 150 ILI9881C_COMMAND_INSTR(0x51, 0x23), 151 ILI9881C_COMMAND_INSTR(0x52, 0x45), 152 ILI9881C_COMMAND_INSTR(0x53, 0x67), 153 ILI9881C_COMMAND_INSTR(0x54, 0x89), 154 ILI9881C_COMMAND_INSTR(0x55, 0xab), 155 ILI9881C_COMMAND_INSTR(0x56, 0x01), 156 ILI9881C_COMMAND_INSTR(0x57, 0x23), 157 ILI9881C_COMMAND_INSTR(0x58, 0x45), 158 ILI9881C_COMMAND_INSTR(0x59, 0x67), 159 ILI9881C_COMMAND_INSTR(0x5a, 0x89), 160 ILI9881C_COMMAND_INSTR(0x5b, 0xab), 161 ILI9881C_COMMAND_INSTR(0x5c, 0xcd), 162 ILI9881C_COMMAND_INSTR(0x5d, 0xef), 163 ILI9881C_COMMAND_INSTR(0x5e, 0x11), 164 ILI9881C_COMMAND_INSTR(0x5f, 0x02), 165 ILI9881C_COMMAND_INSTR(0x60, 0x02), 166 ILI9881C_COMMAND_INSTR(0x61, 0x02), 167 ILI9881C_COMMAND_INSTR(0x62, 0x02), 168 ILI9881C_COMMAND_INSTR(0x63, 0x02), 169 ILI9881C_COMMAND_INSTR(0x64, 0x02), 170 ILI9881C_COMMAND_INSTR(0x65, 0x02), 171 ILI9881C_COMMAND_INSTR(0x66, 0x02), 172 ILI9881C_COMMAND_INSTR(0x67, 0x02), 173 ILI9881C_COMMAND_INSTR(0x68, 0x02), 174 ILI9881C_COMMAND_INSTR(0x69, 0x02), 175 ILI9881C_COMMAND_INSTR(0x6a, 0x0C), 176 ILI9881C_COMMAND_INSTR(0x6b, 0x02), 177 ILI9881C_COMMAND_INSTR(0x6c, 0x0F), 178 ILI9881C_COMMAND_INSTR(0x6d, 0x0E), 179 ILI9881C_COMMAND_INSTR(0x6e, 0x0D), 180 ILI9881C_COMMAND_INSTR(0x6f, 0x06), 181 ILI9881C_COMMAND_INSTR(0x70, 0x07), 182 ILI9881C_COMMAND_INSTR(0x71, 0x02), 183 ILI9881C_COMMAND_INSTR(0x72, 0x02), 184 ILI9881C_COMMAND_INSTR(0x73, 0x02), 185 ILI9881C_COMMAND_INSTR(0x74, 0x02), 186 ILI9881C_COMMAND_INSTR(0x75, 0x02), 187 ILI9881C_COMMAND_INSTR(0x76, 0x02), 188 ILI9881C_COMMAND_INSTR(0x77, 0x02), 189 ILI9881C_COMMAND_INSTR(0x78, 0x02), 190 ILI9881C_COMMAND_INSTR(0x79, 0x02), 191 ILI9881C_COMMAND_INSTR(0x7a, 0x02), 192 ILI9881C_COMMAND_INSTR(0x7b, 0x02), 193 ILI9881C_COMMAND_INSTR(0x7c, 0x02), 194 ILI9881C_COMMAND_INSTR(0x7d, 0x02), 195 ILI9881C_COMMAND_INSTR(0x7e, 0x02), 196 ILI9881C_COMMAND_INSTR(0x7f, 0x02), 197 ILI9881C_COMMAND_INSTR(0x80, 0x0C), 198 ILI9881C_COMMAND_INSTR(0x81, 0x02), 199 ILI9881C_COMMAND_INSTR(0x82, 0x0F), 200 ILI9881C_COMMAND_INSTR(0x83, 0x0E), 201 ILI9881C_COMMAND_INSTR(0x84, 0x0D), 202 ILI9881C_COMMAND_INSTR(0x85, 0x06), 203 ILI9881C_COMMAND_INSTR(0x86, 0x07), 204 ILI9881C_COMMAND_INSTR(0x87, 0x02), 205 ILI9881C_COMMAND_INSTR(0x88, 0x02), 206 ILI9881C_COMMAND_INSTR(0x89, 0x02), 207 ILI9881C_COMMAND_INSTR(0x8A, 0x02), 208 ILI9881C_SWITCH_PAGE_INSTR(4), 209 ILI9881C_COMMAND_INSTR(0x6C, 0x15), 210 ILI9881C_COMMAND_INSTR(0x6E, 0x22), 211 ILI9881C_COMMAND_INSTR(0x6F, 0x33), 212 ILI9881C_COMMAND_INSTR(0x3A, 0xA4), 213 ILI9881C_COMMAND_INSTR(0x8D, 0x0D), 214 ILI9881C_COMMAND_INSTR(0x87, 0xBA), 215 ILI9881C_COMMAND_INSTR(0x26, 0x76), 216 ILI9881C_COMMAND_INSTR(0xB2, 0xD1), 217 ILI9881C_SWITCH_PAGE_INSTR(1), 218 ILI9881C_COMMAND_INSTR(0x22, 0x0A), 219 ILI9881C_COMMAND_INSTR(0x53, 0xDC), 220 ILI9881C_COMMAND_INSTR(0x55, 0xA7), 221 ILI9881C_COMMAND_INSTR(0x50, 0x78), 222 ILI9881C_COMMAND_INSTR(0x51, 0x78), 223 ILI9881C_COMMAND_INSTR(0x31, 0x02), 224 ILI9881C_COMMAND_INSTR(0x60, 0x14), 225 ILI9881C_COMMAND_INSTR(0xA0, 0x2A), 226 ILI9881C_COMMAND_INSTR(0xA1, 0x39), 227 ILI9881C_COMMAND_INSTR(0xA2, 0x46), 228 ILI9881C_COMMAND_INSTR(0xA3, 0x0e), 229 ILI9881C_COMMAND_INSTR(0xA4, 0x12), 230 ILI9881C_COMMAND_INSTR(0xA5, 0x25), 231 ILI9881C_COMMAND_INSTR(0xA6, 0x19), 232 ILI9881C_COMMAND_INSTR(0xA7, 0x1d), 233 ILI9881C_COMMAND_INSTR(0xA8, 0xa6), 234 ILI9881C_COMMAND_INSTR(0xA9, 0x1C), 235 ILI9881C_COMMAND_INSTR(0xAA, 0x29), 236 ILI9881C_COMMAND_INSTR(0xAB, 0x85), 237 ILI9881C_COMMAND_INSTR(0xAC, 0x1C), 238 ILI9881C_COMMAND_INSTR(0xAD, 0x1B), 239 ILI9881C_COMMAND_INSTR(0xAE, 0x51), 240 ILI9881C_COMMAND_INSTR(0xAF, 0x22), 241 ILI9881C_COMMAND_INSTR(0xB0, 0x2d), 242 ILI9881C_COMMAND_INSTR(0xB1, 0x4f), 243 ILI9881C_COMMAND_INSTR(0xB2, 0x59), 244 ILI9881C_COMMAND_INSTR(0xB3, 0x3F), 245 ILI9881C_COMMAND_INSTR(0xC0, 0x2A), 246 ILI9881C_COMMAND_INSTR(0xC1, 0x3a), 247 ILI9881C_COMMAND_INSTR(0xC2, 0x45), 248 ILI9881C_COMMAND_INSTR(0xC3, 0x0e), 249 ILI9881C_COMMAND_INSTR(0xC4, 0x11), 250 ILI9881C_COMMAND_INSTR(0xC5, 0x24), 251 ILI9881C_COMMAND_INSTR(0xC6, 0x1a), 252 ILI9881C_COMMAND_INSTR(0xC7, 0x1c), 253 ILI9881C_COMMAND_INSTR(0xC8, 0xaa), 254 ILI9881C_COMMAND_INSTR(0xC9, 0x1C), 255 ILI9881C_COMMAND_INSTR(0xCA, 0x29), 256 ILI9881C_COMMAND_INSTR(0xCB, 0x96), 257 ILI9881C_COMMAND_INSTR(0xCC, 0x1C), 258 ILI9881C_COMMAND_INSTR(0xCD, 0x1B), 259 ILI9881C_COMMAND_INSTR(0xCE, 0x51), 260 ILI9881C_COMMAND_INSTR(0xCF, 0x22), 261 ILI9881C_COMMAND_INSTR(0xD0, 0x2b), 262 ILI9881C_COMMAND_INSTR(0xD1, 0x4b), 263 ILI9881C_COMMAND_INSTR(0xD2, 0x59), 264 ILI9881C_COMMAND_INSTR(0xD3, 0x3F), 265 }; 266 267 static const struct ili9881c_instr k101_im2byl02_init[] = { 268 ILI9881C_SWITCH_PAGE_INSTR(3), 269 ILI9881C_COMMAND_INSTR(0x01, 0x00), 270 ILI9881C_COMMAND_INSTR(0x02, 0x00), 271 ILI9881C_COMMAND_INSTR(0x03, 0x73), 272 ILI9881C_COMMAND_INSTR(0x04, 0x00), 273 ILI9881C_COMMAND_INSTR(0x05, 0x00), 274 ILI9881C_COMMAND_INSTR(0x06, 0x08), 275 ILI9881C_COMMAND_INSTR(0x07, 0x00), 276 ILI9881C_COMMAND_INSTR(0x08, 0x00), 277 ILI9881C_COMMAND_INSTR(0x09, 0x00), 278 ILI9881C_COMMAND_INSTR(0x0A, 0x01), 279 ILI9881C_COMMAND_INSTR(0x0B, 0x01), 280 ILI9881C_COMMAND_INSTR(0x0C, 0x00), 281 ILI9881C_COMMAND_INSTR(0x0D, 0x01), 282 ILI9881C_COMMAND_INSTR(0x0E, 0x01), 283 ILI9881C_COMMAND_INSTR(0x0F, 0x00), 284 ILI9881C_COMMAND_INSTR(0x10, 0x00), 285 ILI9881C_COMMAND_INSTR(0x11, 0x00), 286 ILI9881C_COMMAND_INSTR(0x12, 0x00), 287 ILI9881C_COMMAND_INSTR(0x13, 0x00), 288 ILI9881C_COMMAND_INSTR(0x14, 0x00), 289 ILI9881C_COMMAND_INSTR(0x15, 0x00), 290 ILI9881C_COMMAND_INSTR(0x16, 0x00), 291 ILI9881C_COMMAND_INSTR(0x17, 0x00), 292 ILI9881C_COMMAND_INSTR(0x18, 0x00), 293 ILI9881C_COMMAND_INSTR(0x19, 0x00), 294 ILI9881C_COMMAND_INSTR(0x1A, 0x00), 295 ILI9881C_COMMAND_INSTR(0x1B, 0x00), 296 ILI9881C_COMMAND_INSTR(0x1C, 0x00), 297 ILI9881C_COMMAND_INSTR(0x1D, 0x00), 298 ILI9881C_COMMAND_INSTR(0x1E, 0x40), 299 ILI9881C_COMMAND_INSTR(0x1F, 0xC0), 300 ILI9881C_COMMAND_INSTR(0x20, 0x06), 301 ILI9881C_COMMAND_INSTR(0x21, 0x01), 302 ILI9881C_COMMAND_INSTR(0x22, 0x06), 303 ILI9881C_COMMAND_INSTR(0x23, 0x01), 304 ILI9881C_COMMAND_INSTR(0x24, 0x88), 305 ILI9881C_COMMAND_INSTR(0x25, 0x88), 306 ILI9881C_COMMAND_INSTR(0x26, 0x00), 307 ILI9881C_COMMAND_INSTR(0x27, 0x00), 308 ILI9881C_COMMAND_INSTR(0x28, 0x3B), 309 ILI9881C_COMMAND_INSTR(0x29, 0x03), 310 ILI9881C_COMMAND_INSTR(0x2A, 0x00), 311 ILI9881C_COMMAND_INSTR(0x2B, 0x00), 312 ILI9881C_COMMAND_INSTR(0x2C, 0x00), 313 ILI9881C_COMMAND_INSTR(0x2D, 0x00), 314 ILI9881C_COMMAND_INSTR(0x2E, 0x00), 315 ILI9881C_COMMAND_INSTR(0x2F, 0x00), 316 ILI9881C_COMMAND_INSTR(0x30, 0x00), 317 ILI9881C_COMMAND_INSTR(0x31, 0x00), 318 ILI9881C_COMMAND_INSTR(0x32, 0x00), 319 ILI9881C_COMMAND_INSTR(0x33, 0x00), 320 ILI9881C_COMMAND_INSTR(0x34, 0x00), /* GPWR1/2 non overlap time 2.62us */ 321 ILI9881C_COMMAND_INSTR(0x35, 0x00), 322 ILI9881C_COMMAND_INSTR(0x36, 0x00), 323 ILI9881C_COMMAND_INSTR(0x37, 0x00), 324 ILI9881C_COMMAND_INSTR(0x38, 0x00), 325 ILI9881C_COMMAND_INSTR(0x39, 0x00), 326 ILI9881C_COMMAND_INSTR(0x3A, 0x00), 327 ILI9881C_COMMAND_INSTR(0x3B, 0x00), 328 ILI9881C_COMMAND_INSTR(0x3C, 0x00), 329 ILI9881C_COMMAND_INSTR(0x3D, 0x00), 330 ILI9881C_COMMAND_INSTR(0x3E, 0x00), 331 ILI9881C_COMMAND_INSTR(0x3F, 0x00), 332 ILI9881C_COMMAND_INSTR(0x40, 0x00), 333 ILI9881C_COMMAND_INSTR(0x41, 0x00), 334 ILI9881C_COMMAND_INSTR(0x42, 0x00), 335 ILI9881C_COMMAND_INSTR(0x43, 0x00), 336 ILI9881C_COMMAND_INSTR(0x44, 0x00), 337 ILI9881C_COMMAND_INSTR(0x50, 0x01), 338 ILI9881C_COMMAND_INSTR(0x51, 0x23), 339 ILI9881C_COMMAND_INSTR(0x52, 0x45), 340 ILI9881C_COMMAND_INSTR(0x53, 0x67), 341 ILI9881C_COMMAND_INSTR(0x54, 0x89), 342 ILI9881C_COMMAND_INSTR(0x55, 0xAB), 343 ILI9881C_COMMAND_INSTR(0x56, 0x01), 344 ILI9881C_COMMAND_INSTR(0x57, 0x23), 345 ILI9881C_COMMAND_INSTR(0x58, 0x45), 346 ILI9881C_COMMAND_INSTR(0x59, 0x67), 347 ILI9881C_COMMAND_INSTR(0x5A, 0x89), 348 ILI9881C_COMMAND_INSTR(0x5B, 0xAB), 349 ILI9881C_COMMAND_INSTR(0x5C, 0xCD), 350 ILI9881C_COMMAND_INSTR(0x5D, 0xEF), 351 ILI9881C_COMMAND_INSTR(0x5E, 0x00), 352 ILI9881C_COMMAND_INSTR(0x5F, 0x01), 353 ILI9881C_COMMAND_INSTR(0x60, 0x01), 354 ILI9881C_COMMAND_INSTR(0x61, 0x06), 355 ILI9881C_COMMAND_INSTR(0x62, 0x06), 356 ILI9881C_COMMAND_INSTR(0x63, 0x07), 357 ILI9881C_COMMAND_INSTR(0x64, 0x07), 358 ILI9881C_COMMAND_INSTR(0x65, 0x00), 359 ILI9881C_COMMAND_INSTR(0x66, 0x00), 360 ILI9881C_COMMAND_INSTR(0x67, 0x02), 361 ILI9881C_COMMAND_INSTR(0x68, 0x02), 362 ILI9881C_COMMAND_INSTR(0x69, 0x05), 363 ILI9881C_COMMAND_INSTR(0x6A, 0x05), 364 ILI9881C_COMMAND_INSTR(0x6B, 0x02), 365 ILI9881C_COMMAND_INSTR(0x6C, 0x0D), 366 ILI9881C_COMMAND_INSTR(0x6D, 0x0D), 367 ILI9881C_COMMAND_INSTR(0x6E, 0x0C), 368 ILI9881C_COMMAND_INSTR(0x6F, 0x0C), 369 ILI9881C_COMMAND_INSTR(0x70, 0x0F), 370 ILI9881C_COMMAND_INSTR(0x71, 0x0F), 371 ILI9881C_COMMAND_INSTR(0x72, 0x0E), 372 ILI9881C_COMMAND_INSTR(0x73, 0x0E), 373 ILI9881C_COMMAND_INSTR(0x74, 0x02), 374 ILI9881C_COMMAND_INSTR(0x75, 0x01), 375 ILI9881C_COMMAND_INSTR(0x76, 0x01), 376 ILI9881C_COMMAND_INSTR(0x77, 0x06), 377 ILI9881C_COMMAND_INSTR(0x78, 0x06), 378 ILI9881C_COMMAND_INSTR(0x79, 0x07), 379 ILI9881C_COMMAND_INSTR(0x7A, 0x07), 380 ILI9881C_COMMAND_INSTR(0x7B, 0x00), 381 ILI9881C_COMMAND_INSTR(0x7C, 0x00), 382 ILI9881C_COMMAND_INSTR(0x7D, 0x02), 383 ILI9881C_COMMAND_INSTR(0x7E, 0x02), 384 ILI9881C_COMMAND_INSTR(0x7F, 0x05), 385 ILI9881C_COMMAND_INSTR(0x80, 0x05), 386 ILI9881C_COMMAND_INSTR(0x81, 0x02), 387 ILI9881C_COMMAND_INSTR(0x82, 0x0D), 388 ILI9881C_COMMAND_INSTR(0x83, 0x0D), 389 ILI9881C_COMMAND_INSTR(0x84, 0x0C), 390 ILI9881C_COMMAND_INSTR(0x85, 0x0C), 391 ILI9881C_COMMAND_INSTR(0x86, 0x0F), 392 ILI9881C_COMMAND_INSTR(0x87, 0x0F), 393 ILI9881C_COMMAND_INSTR(0x88, 0x0E), 394 ILI9881C_COMMAND_INSTR(0x89, 0x0E), 395 ILI9881C_COMMAND_INSTR(0x8A, 0x02), 396 ILI9881C_SWITCH_PAGE_INSTR(4), 397 ILI9881C_COMMAND_INSTR(0x3B, 0xC0), /* ILI4003D sel */ 398 ILI9881C_COMMAND_INSTR(0x6C, 0x15), /* Set VCORE voltage = 1.5V */ 399 ILI9881C_COMMAND_INSTR(0x6E, 0x2A), /* di_pwr_reg=0 for power mode 2A, VGH clamp 18V */ 400 ILI9881C_COMMAND_INSTR(0x6F, 0x33), /* pumping ratio VGH=5x VGL=-3x */ 401 ILI9881C_COMMAND_INSTR(0x8D, 0x1B), /* VGL clamp -10V */ 402 ILI9881C_COMMAND_INSTR(0x87, 0xBA), /* ESD */ 403 ILI9881C_COMMAND_INSTR(0x3A, 0x24), /* POWER SAVING */ 404 ILI9881C_COMMAND_INSTR(0x26, 0x76), 405 ILI9881C_COMMAND_INSTR(0xB2, 0xD1), 406 ILI9881C_SWITCH_PAGE_INSTR(1), 407 ILI9881C_COMMAND_INSTR(0x22, 0x0A), /* BGR, SS */ 408 ILI9881C_COMMAND_INSTR(0x31, 0x00), /* Zigzag type3 inversion */ 409 ILI9881C_COMMAND_INSTR(0x40, 0x53), /* ILI4003D sel */ 410 ILI9881C_COMMAND_INSTR(0x43, 0x66), 411 ILI9881C_COMMAND_INSTR(0x53, 0x4C), 412 ILI9881C_COMMAND_INSTR(0x50, 0x87), 413 ILI9881C_COMMAND_INSTR(0x51, 0x82), 414 ILI9881C_COMMAND_INSTR(0x60, 0x15), 415 ILI9881C_COMMAND_INSTR(0x61, 0x01), 416 ILI9881C_COMMAND_INSTR(0x62, 0x0C), 417 ILI9881C_COMMAND_INSTR(0x63, 0x00), 418 ILI9881C_COMMAND_INSTR(0xA0, 0x00), 419 ILI9881C_COMMAND_INSTR(0xA1, 0x13), /* VP251 */ 420 ILI9881C_COMMAND_INSTR(0xA2, 0x23), /* VP247 */ 421 ILI9881C_COMMAND_INSTR(0xA3, 0x14), /* VP243 */ 422 ILI9881C_COMMAND_INSTR(0xA4, 0x16), /* VP239 */ 423 ILI9881C_COMMAND_INSTR(0xA5, 0x29), /* VP231 */ 424 ILI9881C_COMMAND_INSTR(0xA6, 0x1E), /* VP219 */ 425 ILI9881C_COMMAND_INSTR(0xA7, 0x1D), /* VP203 */ 426 ILI9881C_COMMAND_INSTR(0xA8, 0x86), /* VP175 */ 427 ILI9881C_COMMAND_INSTR(0xA9, 0x1E), /* VP144 */ 428 ILI9881C_COMMAND_INSTR(0xAA, 0x29), /* VP111 */ 429 ILI9881C_COMMAND_INSTR(0xAB, 0x74), /* VP80 */ 430 ILI9881C_COMMAND_INSTR(0xAC, 0x19), /* VP52 */ 431 ILI9881C_COMMAND_INSTR(0xAD, 0x17), /* VP36 */ 432 ILI9881C_COMMAND_INSTR(0xAE, 0x4B), /* VP24 */ 433 ILI9881C_COMMAND_INSTR(0xAF, 0x20), /* VP16 */ 434 ILI9881C_COMMAND_INSTR(0xB0, 0x26), /* VP12 */ 435 ILI9881C_COMMAND_INSTR(0xB1, 0x4C), /* VP8 */ 436 ILI9881C_COMMAND_INSTR(0xB2, 0x5D), /* VP4 */ 437 ILI9881C_COMMAND_INSTR(0xB3, 0x3F), /* VP0 */ 438 ILI9881C_COMMAND_INSTR(0xC0, 0x00), /* VN255 GAMMA N */ 439 ILI9881C_COMMAND_INSTR(0xC1, 0x13), /* VN251 */ 440 ILI9881C_COMMAND_INSTR(0xC2, 0x23), /* VN247 */ 441 ILI9881C_COMMAND_INSTR(0xC3, 0x14), /* VN243 */ 442 ILI9881C_COMMAND_INSTR(0xC4, 0x16), /* VN239 */ 443 ILI9881C_COMMAND_INSTR(0xC5, 0x29), /* VN231 */ 444 ILI9881C_COMMAND_INSTR(0xC6, 0x1E), /* VN219 */ 445 ILI9881C_COMMAND_INSTR(0xC7, 0x1D), /* VN203 */ 446 ILI9881C_COMMAND_INSTR(0xC8, 0x86), /* VN175 */ 447 ILI9881C_COMMAND_INSTR(0xC9, 0x1E), /* VN144 */ 448 ILI9881C_COMMAND_INSTR(0xCA, 0x29), /* VN111 */ 449 ILI9881C_COMMAND_INSTR(0xCB, 0x74), /* VN80 */ 450 ILI9881C_COMMAND_INSTR(0xCC, 0x19), /* VN52 */ 451 ILI9881C_COMMAND_INSTR(0xCD, 0x17), /* VN36 */ 452 ILI9881C_COMMAND_INSTR(0xCE, 0x4B), /* VN24 */ 453 ILI9881C_COMMAND_INSTR(0xCF, 0x20), /* VN16 */ 454 ILI9881C_COMMAND_INSTR(0xD0, 0x26), /* VN12 */ 455 ILI9881C_COMMAND_INSTR(0xD1, 0x4C), /* VN8 */ 456 ILI9881C_COMMAND_INSTR(0xD2, 0x5D), /* VN4 */ 457 ILI9881C_COMMAND_INSTR(0xD3, 0x3F), /* VN0 */ 458 }; 459 460 static const struct ili9881c_instr kd050hdfia020_init[] = { 461 ILI9881C_SWITCH_PAGE_INSTR(3), 462 ILI9881C_COMMAND_INSTR(0x01, 0x00), 463 ILI9881C_COMMAND_INSTR(0x02, 0x00), 464 ILI9881C_COMMAND_INSTR(0x03, 0x72), 465 ILI9881C_COMMAND_INSTR(0x04, 0x00), 466 ILI9881C_COMMAND_INSTR(0x05, 0x00), 467 ILI9881C_COMMAND_INSTR(0x06, 0x09), 468 ILI9881C_COMMAND_INSTR(0x07, 0x00), 469 ILI9881C_COMMAND_INSTR(0x08, 0x00), 470 ILI9881C_COMMAND_INSTR(0x09, 0x01), 471 ILI9881C_COMMAND_INSTR(0x0a, 0x00), 472 ILI9881C_COMMAND_INSTR(0x0b, 0x00), 473 ILI9881C_COMMAND_INSTR(0x0c, 0x01), 474 ILI9881C_COMMAND_INSTR(0x0d, 0x00), 475 ILI9881C_COMMAND_INSTR(0x0e, 0x00), 476 ILI9881C_COMMAND_INSTR(0x0f, 0x00), 477 ILI9881C_COMMAND_INSTR(0x10, 0x00), 478 ILI9881C_COMMAND_INSTR(0x11, 0x00), 479 ILI9881C_COMMAND_INSTR(0x12, 0x00), 480 ILI9881C_COMMAND_INSTR(0x13, 0x00), 481 ILI9881C_COMMAND_INSTR(0x14, 0x00), 482 ILI9881C_COMMAND_INSTR(0x15, 0x00), 483 ILI9881C_COMMAND_INSTR(0x16, 0x00), 484 ILI9881C_COMMAND_INSTR(0x17, 0x00), 485 ILI9881C_COMMAND_INSTR(0x18, 0x00), 486 ILI9881C_COMMAND_INSTR(0x19, 0x00), 487 ILI9881C_COMMAND_INSTR(0x1a, 0x00), 488 ILI9881C_COMMAND_INSTR(0x1b, 0x00), 489 ILI9881C_COMMAND_INSTR(0x1c, 0x00), 490 ILI9881C_COMMAND_INSTR(0x1d, 0x00), 491 ILI9881C_COMMAND_INSTR(0x1e, 0x40), 492 ILI9881C_COMMAND_INSTR(0x1f, 0x80), 493 ILI9881C_COMMAND_INSTR(0x20, 0x05), 494 ILI9881C_COMMAND_INSTR(0x20, 0x05), 495 ILI9881C_COMMAND_INSTR(0x21, 0x02), 496 ILI9881C_COMMAND_INSTR(0x22, 0x00), 497 ILI9881C_COMMAND_INSTR(0x23, 0x00), 498 ILI9881C_COMMAND_INSTR(0x24, 0x00), 499 ILI9881C_COMMAND_INSTR(0x25, 0x00), 500 ILI9881C_COMMAND_INSTR(0x26, 0x00), 501 ILI9881C_COMMAND_INSTR(0x27, 0x00), 502 ILI9881C_COMMAND_INSTR(0x28, 0x33), 503 ILI9881C_COMMAND_INSTR(0x29, 0x02), 504 ILI9881C_COMMAND_INSTR(0x2a, 0x00), 505 ILI9881C_COMMAND_INSTR(0x2b, 0x00), 506 ILI9881C_COMMAND_INSTR(0x2c, 0x00), 507 ILI9881C_COMMAND_INSTR(0x2d, 0x00), 508 ILI9881C_COMMAND_INSTR(0x2e, 0x00), 509 ILI9881C_COMMAND_INSTR(0x2f, 0x00), 510 ILI9881C_COMMAND_INSTR(0x30, 0x00), 511 ILI9881C_COMMAND_INSTR(0x31, 0x00), 512 ILI9881C_COMMAND_INSTR(0x32, 0x00), 513 ILI9881C_COMMAND_INSTR(0x32, 0x00), 514 ILI9881C_COMMAND_INSTR(0x33, 0x00), 515 ILI9881C_COMMAND_INSTR(0x34, 0x04), 516 ILI9881C_COMMAND_INSTR(0x35, 0x00), 517 ILI9881C_COMMAND_INSTR(0x36, 0x00), 518 ILI9881C_COMMAND_INSTR(0x37, 0x00), 519 ILI9881C_COMMAND_INSTR(0x38, 0x3C), 520 ILI9881C_COMMAND_INSTR(0x39, 0x00), 521 ILI9881C_COMMAND_INSTR(0x3a, 0x40), 522 ILI9881C_COMMAND_INSTR(0x3b, 0x40), 523 ILI9881C_COMMAND_INSTR(0x3c, 0x00), 524 ILI9881C_COMMAND_INSTR(0x3d, 0x00), 525 ILI9881C_COMMAND_INSTR(0x3e, 0x00), 526 ILI9881C_COMMAND_INSTR(0x3f, 0x00), 527 ILI9881C_COMMAND_INSTR(0x40, 0x00), 528 ILI9881C_COMMAND_INSTR(0x41, 0x00), 529 ILI9881C_COMMAND_INSTR(0x42, 0x00), 530 ILI9881C_COMMAND_INSTR(0x43, 0x00), 531 ILI9881C_COMMAND_INSTR(0x44, 0x00), 532 ILI9881C_COMMAND_INSTR(0x50, 0x01), 533 ILI9881C_COMMAND_INSTR(0x51, 0x23), 534 ILI9881C_COMMAND_INSTR(0x52, 0x45), 535 ILI9881C_COMMAND_INSTR(0x53, 0x67), 536 ILI9881C_COMMAND_INSTR(0x54, 0x89), 537 ILI9881C_COMMAND_INSTR(0x55, 0xab), 538 ILI9881C_COMMAND_INSTR(0x56, 0x01), 539 ILI9881C_COMMAND_INSTR(0x57, 0x23), 540 ILI9881C_COMMAND_INSTR(0x58, 0x45), 541 ILI9881C_COMMAND_INSTR(0x59, 0x67), 542 ILI9881C_COMMAND_INSTR(0x5a, 0x89), 543 ILI9881C_COMMAND_INSTR(0x5b, 0xab), 544 ILI9881C_COMMAND_INSTR(0x5c, 0xcd), 545 ILI9881C_COMMAND_INSTR(0x5d, 0xef), 546 ILI9881C_COMMAND_INSTR(0x5e, 0x11), 547 ILI9881C_COMMAND_INSTR(0x5f, 0x01), 548 ILI9881C_COMMAND_INSTR(0x60, 0x00), 549 ILI9881C_COMMAND_INSTR(0x61, 0x15), 550 ILI9881C_COMMAND_INSTR(0x62, 0x14), 551 ILI9881C_COMMAND_INSTR(0x63, 0x0E), 552 ILI9881C_COMMAND_INSTR(0x64, 0x0F), 553 ILI9881C_COMMAND_INSTR(0x65, 0x0C), 554 ILI9881C_COMMAND_INSTR(0x66, 0x0D), 555 ILI9881C_COMMAND_INSTR(0x67, 0x06), 556 ILI9881C_COMMAND_INSTR(0x68, 0x02), 557 ILI9881C_COMMAND_INSTR(0x69, 0x07), 558 ILI9881C_COMMAND_INSTR(0x6a, 0x02), 559 ILI9881C_COMMAND_INSTR(0x6b, 0x02), 560 ILI9881C_COMMAND_INSTR(0x6c, 0x02), 561 ILI9881C_COMMAND_INSTR(0x6d, 0x02), 562 ILI9881C_COMMAND_INSTR(0x6e, 0x02), 563 ILI9881C_COMMAND_INSTR(0x6f, 0x02), 564 ILI9881C_COMMAND_INSTR(0x70, 0x02), 565 ILI9881C_COMMAND_INSTR(0x71, 0x02), 566 ILI9881C_COMMAND_INSTR(0x72, 0x02), 567 ILI9881C_COMMAND_INSTR(0x73, 0x02), 568 ILI9881C_COMMAND_INSTR(0x74, 0x02), 569 ILI9881C_COMMAND_INSTR(0x75, 0x01), 570 ILI9881C_COMMAND_INSTR(0x76, 0x00), 571 ILI9881C_COMMAND_INSTR(0x77, 0x14), 572 ILI9881C_COMMAND_INSTR(0x78, 0x15), 573 ILI9881C_COMMAND_INSTR(0x79, 0x0E), 574 ILI9881C_COMMAND_INSTR(0x7a, 0x0F), 575 ILI9881C_COMMAND_INSTR(0x7b, 0x0C), 576 ILI9881C_COMMAND_INSTR(0x7c, 0x0D), 577 ILI9881C_COMMAND_INSTR(0x7d, 0x06), 578 ILI9881C_COMMAND_INSTR(0x7e, 0x02), 579 ILI9881C_COMMAND_INSTR(0x7f, 0x07), 580 ILI9881C_COMMAND_INSTR(0x80, 0x02), 581 ILI9881C_COMMAND_INSTR(0x81, 0x02), 582 ILI9881C_COMMAND_INSTR(0x83, 0x02), 583 ILI9881C_COMMAND_INSTR(0x84, 0x02), 584 ILI9881C_COMMAND_INSTR(0x85, 0x02), 585 ILI9881C_COMMAND_INSTR(0x86, 0x02), 586 ILI9881C_COMMAND_INSTR(0x87, 0x02), 587 ILI9881C_COMMAND_INSTR(0x88, 0x02), 588 ILI9881C_COMMAND_INSTR(0x89, 0x02), 589 ILI9881C_COMMAND_INSTR(0x8A, 0x02), 590 ILI9881C_SWITCH_PAGE_INSTR(0x4), 591 ILI9881C_COMMAND_INSTR(0x6C, 0x15), 592 ILI9881C_COMMAND_INSTR(0x6E, 0x2A), 593 ILI9881C_COMMAND_INSTR(0x6F, 0x33), 594 ILI9881C_COMMAND_INSTR(0x3A, 0x94), 595 ILI9881C_COMMAND_INSTR(0x8D, 0x15), 596 ILI9881C_COMMAND_INSTR(0x87, 0xBA), 597 ILI9881C_COMMAND_INSTR(0x26, 0x76), 598 ILI9881C_COMMAND_INSTR(0xB2, 0xD1), 599 ILI9881C_COMMAND_INSTR(0xB5, 0x06), 600 ILI9881C_SWITCH_PAGE_INSTR(0x1), 601 ILI9881C_COMMAND_INSTR(0x22, 0x0A), 602 ILI9881C_COMMAND_INSTR(0x31, 0x00), 603 ILI9881C_COMMAND_INSTR(0x53, 0x90), 604 ILI9881C_COMMAND_INSTR(0x55, 0xA2), 605 ILI9881C_COMMAND_INSTR(0x50, 0xB7), 606 ILI9881C_COMMAND_INSTR(0x51, 0xB7), 607 ILI9881C_COMMAND_INSTR(0x60, 0x22), 608 ILI9881C_COMMAND_INSTR(0x61, 0x00), 609 ILI9881C_COMMAND_INSTR(0x62, 0x19), 610 ILI9881C_COMMAND_INSTR(0x63, 0x10), 611 ILI9881C_COMMAND_INSTR(0xA0, 0x08), 612 ILI9881C_COMMAND_INSTR(0xA1, 0x1A), 613 ILI9881C_COMMAND_INSTR(0xA2, 0x27), 614 ILI9881C_COMMAND_INSTR(0xA3, 0x15), 615 ILI9881C_COMMAND_INSTR(0xA4, 0x17), 616 ILI9881C_COMMAND_INSTR(0xA5, 0x2A), 617 ILI9881C_COMMAND_INSTR(0xA6, 0x1E), 618 ILI9881C_COMMAND_INSTR(0xA7, 0x1F), 619 ILI9881C_COMMAND_INSTR(0xA8, 0x8B), 620 ILI9881C_COMMAND_INSTR(0xA9, 0x1B), 621 ILI9881C_COMMAND_INSTR(0xAA, 0x27), 622 ILI9881C_COMMAND_INSTR(0xAB, 0x78), 623 ILI9881C_COMMAND_INSTR(0xAC, 0x18), 624 ILI9881C_COMMAND_INSTR(0xAD, 0x18), 625 ILI9881C_COMMAND_INSTR(0xAE, 0x4C), 626 ILI9881C_COMMAND_INSTR(0xAF, 0x21), 627 ILI9881C_COMMAND_INSTR(0xB0, 0x27), 628 ILI9881C_COMMAND_INSTR(0xB1, 0x54), 629 ILI9881C_COMMAND_INSTR(0xB2, 0x67), 630 ILI9881C_COMMAND_INSTR(0xB3, 0x39), 631 ILI9881C_COMMAND_INSTR(0xC0, 0x08), 632 ILI9881C_COMMAND_INSTR(0xC1, 0x1A), 633 ILI9881C_COMMAND_INSTR(0xC2, 0x27), 634 ILI9881C_COMMAND_INSTR(0xC3, 0x15), 635 ILI9881C_COMMAND_INSTR(0xC4, 0x17), 636 ILI9881C_COMMAND_INSTR(0xC5, 0x2A), 637 ILI9881C_COMMAND_INSTR(0xC6, 0x1E), 638 ILI9881C_COMMAND_INSTR(0xC7, 0x1F), 639 ILI9881C_COMMAND_INSTR(0xC8, 0x8B), 640 ILI9881C_COMMAND_INSTR(0xC9, 0x1B), 641 ILI9881C_COMMAND_INSTR(0xCA, 0x27), 642 ILI9881C_COMMAND_INSTR(0xCB, 0x78), 643 ILI9881C_COMMAND_INSTR(0xCC, 0x18), 644 ILI9881C_COMMAND_INSTR(0xCD, 0x18), 645 ILI9881C_COMMAND_INSTR(0xCE, 0x4C), 646 ILI9881C_COMMAND_INSTR(0xCF, 0x21), 647 ILI9881C_COMMAND_INSTR(0xD0, 0x27), 648 ILI9881C_COMMAND_INSTR(0xD1, 0x54), 649 ILI9881C_COMMAND_INSTR(0xD2, 0x67), 650 ILI9881C_COMMAND_INSTR(0xD3, 0x39), 651 ILI9881C_SWITCH_PAGE_INSTR(0), 652 ILI9881C_COMMAND_INSTR(0x35, 0x00), 653 ILI9881C_COMMAND_INSTR(0x3A, 0x7), 654 }; 655 656 static const struct ili9881c_instr tl050hdv35_init[] = { 657 ILI9881C_SWITCH_PAGE_INSTR(3), 658 ILI9881C_COMMAND_INSTR(0x01, 0x00), 659 ILI9881C_COMMAND_INSTR(0x02, 0x00), 660 ILI9881C_COMMAND_INSTR(0x03, 0x73), 661 ILI9881C_COMMAND_INSTR(0x04, 0x00), 662 ILI9881C_COMMAND_INSTR(0x05, 0x00), 663 ILI9881C_COMMAND_INSTR(0x06, 0x0a), 664 ILI9881C_COMMAND_INSTR(0x07, 0x00), 665 ILI9881C_COMMAND_INSTR(0x08, 0x00), 666 ILI9881C_COMMAND_INSTR(0x09, 0x01), 667 ILI9881C_COMMAND_INSTR(0x0a, 0x00), 668 ILI9881C_COMMAND_INSTR(0x0b, 0x00), 669 ILI9881C_COMMAND_INSTR(0x0c, 0x01), 670 ILI9881C_COMMAND_INSTR(0x0d, 0x00), 671 ILI9881C_COMMAND_INSTR(0x0e, 0x00), 672 ILI9881C_COMMAND_INSTR(0x0f, 0x1d), 673 ILI9881C_COMMAND_INSTR(0x10, 0x1d), 674 ILI9881C_COMMAND_INSTR(0x15, 0x00), 675 ILI9881C_COMMAND_INSTR(0x16, 0x00), 676 ILI9881C_COMMAND_INSTR(0x17, 0x00), 677 ILI9881C_COMMAND_INSTR(0x18, 0x00), 678 ILI9881C_COMMAND_INSTR(0x19, 0x00), 679 ILI9881C_COMMAND_INSTR(0x1a, 0x00), 680 ILI9881C_COMMAND_INSTR(0x1b, 0x00), 681 ILI9881C_COMMAND_INSTR(0x1c, 0x00), 682 ILI9881C_COMMAND_INSTR(0x1d, 0x00), 683 ILI9881C_COMMAND_INSTR(0x1e, 0x40), 684 ILI9881C_COMMAND_INSTR(0x1f, 0x80), 685 ILI9881C_COMMAND_INSTR(0x20, 0x06), 686 ILI9881C_COMMAND_INSTR(0x21, 0x02), 687 ILI9881C_COMMAND_INSTR(0x28, 0x33), 688 ILI9881C_COMMAND_INSTR(0x29, 0x03), 689 ILI9881C_COMMAND_INSTR(0x2a, 0x00), 690 ILI9881C_COMMAND_INSTR(0x2b, 0x00), 691 ILI9881C_COMMAND_INSTR(0x2c, 0x00), 692 ILI9881C_COMMAND_INSTR(0x2d, 0x00), 693 ILI9881C_COMMAND_INSTR(0x2e, 0x00), 694 ILI9881C_COMMAND_INSTR(0x2f, 0x00), 695 ILI9881C_COMMAND_INSTR(0x35, 0x00), 696 ILI9881C_COMMAND_INSTR(0x36, 0x00), 697 ILI9881C_COMMAND_INSTR(0x37, 0x00), 698 ILI9881C_COMMAND_INSTR(0x38, 0x3C), 699 ILI9881C_COMMAND_INSTR(0x39, 0x00), 700 ILI9881C_COMMAND_INSTR(0x3a, 0x40), 701 ILI9881C_COMMAND_INSTR(0x3b, 0x40), 702 ILI9881C_COMMAND_INSTR(0x3c, 0x00), 703 ILI9881C_COMMAND_INSTR(0x3d, 0x00), 704 ILI9881C_COMMAND_INSTR(0x3e, 0x00), 705 ILI9881C_COMMAND_INSTR(0x3f, 0x00), 706 ILI9881C_COMMAND_INSTR(0x40, 0x00), 707 ILI9881C_COMMAND_INSTR(0x41, 0x00), 708 ILI9881C_COMMAND_INSTR(0x42, 0x00), 709 ILI9881C_COMMAND_INSTR(0x43, 0x00), 710 ILI9881C_COMMAND_INSTR(0x44, 0x00), 711 ILI9881C_COMMAND_INSTR(0x55, 0xab), 712 ILI9881C_COMMAND_INSTR(0x5a, 0x89), 713 ILI9881C_COMMAND_INSTR(0x5b, 0xab), 714 ILI9881C_COMMAND_INSTR(0x5c, 0xcd), 715 ILI9881C_COMMAND_INSTR(0x5d, 0xef), 716 ILI9881C_COMMAND_INSTR(0x5e, 0x11), 717 ILI9881C_COMMAND_INSTR(0x5f, 0x01), 718 ILI9881C_COMMAND_INSTR(0x60, 0x00), 719 ILI9881C_COMMAND_INSTR(0x61, 0x15), 720 ILI9881C_COMMAND_INSTR(0x62, 0x14), 721 ILI9881C_COMMAND_INSTR(0x63, 0x0e), 722 ILI9881C_COMMAND_INSTR(0x64, 0x0f), 723 ILI9881C_COMMAND_INSTR(0x65, 0x0c), 724 ILI9881C_COMMAND_INSTR(0x66, 0x0d), 725 ILI9881C_COMMAND_INSTR(0x67, 0x06), 726 ILI9881C_COMMAND_INSTR(0x68, 0x02), 727 ILI9881C_COMMAND_INSTR(0x69, 0x07), 728 ILI9881C_COMMAND_INSTR(0x6a, 0x02), 729 ILI9881C_COMMAND_INSTR(0x6b, 0x02), 730 ILI9881C_COMMAND_INSTR(0x6c, 0x02), 731 ILI9881C_COMMAND_INSTR(0x6d, 0x02), 732 ILI9881C_COMMAND_INSTR(0x6e, 0x02), 733 ILI9881C_COMMAND_INSTR(0x6f, 0x02), 734 ILI9881C_COMMAND_INSTR(0x70, 0x02), 735 ILI9881C_COMMAND_INSTR(0x71, 0x02), 736 ILI9881C_COMMAND_INSTR(0x72, 0x02), 737 ILI9881C_COMMAND_INSTR(0x73, 0x02), 738 ILI9881C_COMMAND_INSTR(0x74, 0x02), 739 ILI9881C_COMMAND_INSTR(0x75, 0x01), 740 ILI9881C_COMMAND_INSTR(0x76, 0x00), 741 ILI9881C_COMMAND_INSTR(0x77, 0x14), 742 ILI9881C_COMMAND_INSTR(0x78, 0x15), 743 ILI9881C_COMMAND_INSTR(0x79, 0x0e), 744 ILI9881C_COMMAND_INSTR(0x7a, 0x0f), 745 ILI9881C_COMMAND_INSTR(0x7b, 0x0c), 746 ILI9881C_COMMAND_INSTR(0x7c, 0x0d), 747 ILI9881C_COMMAND_INSTR(0x7d, 0x06), 748 ILI9881C_COMMAND_INSTR(0x7e, 0x02), 749 ILI9881C_COMMAND_INSTR(0x7f, 0x07), 750 ILI9881C_COMMAND_INSTR(0x88, 0x02), 751 ILI9881C_COMMAND_INSTR(0x89, 0x02), 752 ILI9881C_COMMAND_INSTR(0x8A, 0x02), 753 ILI9881C_SWITCH_PAGE_INSTR(4), 754 ILI9881C_COMMAND_INSTR(0x38, 0x01), 755 ILI9881C_COMMAND_INSTR(0x39, 0x00), 756 ILI9881C_COMMAND_INSTR(0x6c, 0x15), 757 ILI9881C_COMMAND_INSTR(0x6e, 0x2b), 758 ILI9881C_COMMAND_INSTR(0x6f, 0x33), 759 ILI9881C_COMMAND_INSTR(0x8d, 0x18), 760 ILI9881C_COMMAND_INSTR(0x87, 0xba), 761 ILI9881C_COMMAND_INSTR(0x26, 0x76), 762 ILI9881C_COMMAND_INSTR(0xb2, 0xd1), 763 ILI9881C_COMMAND_INSTR(0xb5, 0x06), 764 ILI9881C_COMMAND_INSTR(0x3a, 0x24), 765 ILI9881C_COMMAND_INSTR(0x35, 0x1f), 766 ILI9881C_COMMAND_INSTR(0x33, 0x14), 767 ILI9881C_COMMAND_INSTR(0x3b, 0x98), 768 ILI9881C_SWITCH_PAGE_INSTR(1), 769 ILI9881C_COMMAND_INSTR(0x22, 0x0a), 770 ILI9881C_COMMAND_INSTR(0x31, 0x00), 771 ILI9881C_COMMAND_INSTR(0x40, 0x33), 772 ILI9881C_COMMAND_INSTR(0x53, 0xa2), 773 ILI9881C_COMMAND_INSTR(0x55, 0x92), 774 ILI9881C_COMMAND_INSTR(0x50, 0x96), 775 ILI9881C_COMMAND_INSTR(0x51, 0x96), 776 ILI9881C_COMMAND_INSTR(0x60, 0x22), 777 ILI9881C_COMMAND_INSTR(0x61, 0x00), 778 ILI9881C_COMMAND_INSTR(0x62, 0x19), 779 ILI9881C_COMMAND_INSTR(0x63, 0x00), 780 ILI9881C_COMMAND_INSTR(0xa0, 0x08), 781 ILI9881C_COMMAND_INSTR(0xa1, 0x11), 782 ILI9881C_COMMAND_INSTR(0xa2, 0x19), 783 ILI9881C_COMMAND_INSTR(0xa3, 0x0d), 784 ILI9881C_COMMAND_INSTR(0xa4, 0x0d), 785 ILI9881C_COMMAND_INSTR(0xa5, 0x1e), 786 ILI9881C_COMMAND_INSTR(0xa6, 0x14), 787 ILI9881C_COMMAND_INSTR(0xa7, 0x17), 788 ILI9881C_COMMAND_INSTR(0xa8, 0x4f), 789 ILI9881C_COMMAND_INSTR(0xa9, 0x1a), 790 ILI9881C_COMMAND_INSTR(0xaa, 0x27), 791 ILI9881C_COMMAND_INSTR(0xab, 0x49), 792 ILI9881C_COMMAND_INSTR(0xac, 0x1a), 793 ILI9881C_COMMAND_INSTR(0xad, 0x18), 794 ILI9881C_COMMAND_INSTR(0xae, 0x4c), 795 ILI9881C_COMMAND_INSTR(0xaf, 0x22), 796 ILI9881C_COMMAND_INSTR(0xb0, 0x27), 797 ILI9881C_COMMAND_INSTR(0xb1, 0x4b), 798 ILI9881C_COMMAND_INSTR(0xb2, 0x60), 799 ILI9881C_COMMAND_INSTR(0xb3, 0x39), 800 ILI9881C_COMMAND_INSTR(0xc0, 0x08), 801 ILI9881C_COMMAND_INSTR(0xc1, 0x11), 802 ILI9881C_COMMAND_INSTR(0xc2, 0x19), 803 ILI9881C_COMMAND_INSTR(0xc3, 0x0d), 804 ILI9881C_COMMAND_INSTR(0xc4, 0x0d), 805 ILI9881C_COMMAND_INSTR(0xc5, 0x1e), 806 ILI9881C_COMMAND_INSTR(0xc6, 0x14), 807 ILI9881C_COMMAND_INSTR(0xc7, 0x17), 808 ILI9881C_COMMAND_INSTR(0xc8, 0x4f), 809 ILI9881C_COMMAND_INSTR(0xc9, 0x1a), 810 ILI9881C_COMMAND_INSTR(0xca, 0x27), 811 ILI9881C_COMMAND_INSTR(0xcb, 0x49), 812 ILI9881C_COMMAND_INSTR(0xcc, 0x1a), 813 ILI9881C_COMMAND_INSTR(0xcd, 0x18), 814 ILI9881C_COMMAND_INSTR(0xce, 0x4c), 815 ILI9881C_COMMAND_INSTR(0xcf, 0x33), 816 ILI9881C_COMMAND_INSTR(0xd0, 0x27), 817 ILI9881C_COMMAND_INSTR(0xd1, 0x4b), 818 ILI9881C_COMMAND_INSTR(0xd2, 0x60), 819 ILI9881C_COMMAND_INSTR(0xd3, 0x39), 820 }; 821 822 static const struct ili9881c_instr w552946ab_init[] = { 823 ILI9881C_SWITCH_PAGE_INSTR(3), 824 ILI9881C_COMMAND_INSTR(0x01, 0x00), 825 ILI9881C_COMMAND_INSTR(0x02, 0x00), 826 ILI9881C_COMMAND_INSTR(0x03, 0x53), 827 ILI9881C_COMMAND_INSTR(0x04, 0x53), 828 ILI9881C_COMMAND_INSTR(0x05, 0x13), 829 ILI9881C_COMMAND_INSTR(0x06, 0x04), 830 ILI9881C_COMMAND_INSTR(0x07, 0x02), 831 ILI9881C_COMMAND_INSTR(0x08, 0x02), 832 ILI9881C_COMMAND_INSTR(0x09, 0x00), 833 ILI9881C_COMMAND_INSTR(0x0A, 0x00), 834 ILI9881C_COMMAND_INSTR(0x0B, 0x00), 835 ILI9881C_COMMAND_INSTR(0x0C, 0x00), 836 ILI9881C_COMMAND_INSTR(0x0D, 0x00), 837 ILI9881C_COMMAND_INSTR(0x0E, 0x00), 838 ILI9881C_COMMAND_INSTR(0x0F, 0x00), 839 840 ILI9881C_COMMAND_INSTR(0x10, 0x00), 841 ILI9881C_COMMAND_INSTR(0x11, 0x00), 842 ILI9881C_COMMAND_INSTR(0x12, 0x00), 843 ILI9881C_COMMAND_INSTR(0x13, 0x00), 844 ILI9881C_COMMAND_INSTR(0x14, 0x00), 845 ILI9881C_COMMAND_INSTR(0x15, 0x08), 846 ILI9881C_COMMAND_INSTR(0x16, 0x10), 847 ILI9881C_COMMAND_INSTR(0x17, 0x00), 848 ILI9881C_COMMAND_INSTR(0x18, 0x08), 849 ILI9881C_COMMAND_INSTR(0x19, 0x00), 850 ILI9881C_COMMAND_INSTR(0x1A, 0x00), 851 ILI9881C_COMMAND_INSTR(0x1B, 0x00), 852 ILI9881C_COMMAND_INSTR(0x1C, 0x00), 853 ILI9881C_COMMAND_INSTR(0x1D, 0x00), 854 ILI9881C_COMMAND_INSTR(0x1E, 0xC0), 855 ILI9881C_COMMAND_INSTR(0x1F, 0x80), 856 857 ILI9881C_COMMAND_INSTR(0x20, 0x02), 858 ILI9881C_COMMAND_INSTR(0x21, 0x09), 859 ILI9881C_COMMAND_INSTR(0x22, 0x00), 860 ILI9881C_COMMAND_INSTR(0x23, 0x00), 861 ILI9881C_COMMAND_INSTR(0x24, 0x00), 862 ILI9881C_COMMAND_INSTR(0x25, 0x00), 863 ILI9881C_COMMAND_INSTR(0x26, 0x00), 864 ILI9881C_COMMAND_INSTR(0x27, 0x00), 865 ILI9881C_COMMAND_INSTR(0x28, 0x55), 866 ILI9881C_COMMAND_INSTR(0x29, 0x03), 867 ILI9881C_COMMAND_INSTR(0x2A, 0x00), 868 ILI9881C_COMMAND_INSTR(0x2B, 0x00), 869 ILI9881C_COMMAND_INSTR(0x2C, 0x00), 870 ILI9881C_COMMAND_INSTR(0x2D, 0x00), 871 ILI9881C_COMMAND_INSTR(0x2E, 0x00), 872 ILI9881C_COMMAND_INSTR(0x2F, 0x00), 873 874 ILI9881C_COMMAND_INSTR(0x30, 0x00), 875 ILI9881C_COMMAND_INSTR(0x31, 0x00), 876 ILI9881C_COMMAND_INSTR(0x32, 0x00), 877 ILI9881C_COMMAND_INSTR(0x33, 0x00), 878 ILI9881C_COMMAND_INSTR(0x34, 0x04), 879 ILI9881C_COMMAND_INSTR(0x35, 0x05), 880 ILI9881C_COMMAND_INSTR(0x36, 0x05), 881 ILI9881C_COMMAND_INSTR(0x37, 0x00), 882 ILI9881C_COMMAND_INSTR(0x38, 0x3C), 883 ILI9881C_COMMAND_INSTR(0x39, 0x35), 884 ILI9881C_COMMAND_INSTR(0x3A, 0x00), 885 ILI9881C_COMMAND_INSTR(0x3B, 0x40), 886 ILI9881C_COMMAND_INSTR(0x3C, 0x00), 887 ILI9881C_COMMAND_INSTR(0x3D, 0x00), 888 ILI9881C_COMMAND_INSTR(0x3E, 0x00), 889 ILI9881C_COMMAND_INSTR(0x3F, 0x00), 890 891 ILI9881C_COMMAND_INSTR(0x40, 0x00), 892 ILI9881C_COMMAND_INSTR(0x41, 0x88), 893 ILI9881C_COMMAND_INSTR(0x42, 0x00), 894 ILI9881C_COMMAND_INSTR(0x43, 0x00), 895 ILI9881C_COMMAND_INSTR(0x44, 0x1F), 896 897 ILI9881C_COMMAND_INSTR(0x50, 0x01), 898 ILI9881C_COMMAND_INSTR(0x51, 0x23), 899 ILI9881C_COMMAND_INSTR(0x52, 0x45), 900 ILI9881C_COMMAND_INSTR(0x53, 0x67), 901 ILI9881C_COMMAND_INSTR(0x54, 0x89), 902 ILI9881C_COMMAND_INSTR(0x55, 0xaB), 903 ILI9881C_COMMAND_INSTR(0x56, 0x01), 904 ILI9881C_COMMAND_INSTR(0x57, 0x23), 905 ILI9881C_COMMAND_INSTR(0x58, 0x45), 906 ILI9881C_COMMAND_INSTR(0x59, 0x67), 907 ILI9881C_COMMAND_INSTR(0x5A, 0x89), 908 ILI9881C_COMMAND_INSTR(0x5B, 0xAB), 909 ILI9881C_COMMAND_INSTR(0x5C, 0xCD), 910 ILI9881C_COMMAND_INSTR(0x5D, 0xEF), 911 ILI9881C_COMMAND_INSTR(0x5E, 0x03), 912 ILI9881C_COMMAND_INSTR(0x5F, 0x14), 913 914 ILI9881C_COMMAND_INSTR(0x60, 0x15), 915 ILI9881C_COMMAND_INSTR(0x61, 0x0C), 916 ILI9881C_COMMAND_INSTR(0x62, 0x0D), 917 ILI9881C_COMMAND_INSTR(0x63, 0x0E), 918 ILI9881C_COMMAND_INSTR(0x64, 0x0F), 919 ILI9881C_COMMAND_INSTR(0x65, 0x10), 920 ILI9881C_COMMAND_INSTR(0x66, 0x11), 921 ILI9881C_COMMAND_INSTR(0x67, 0x08), 922 ILI9881C_COMMAND_INSTR(0x68, 0x02), 923 ILI9881C_COMMAND_INSTR(0x69, 0x0A), 924 ILI9881C_COMMAND_INSTR(0x6A, 0x02), 925 ILI9881C_COMMAND_INSTR(0x6B, 0x02), 926 ILI9881C_COMMAND_INSTR(0x6C, 0x02), 927 ILI9881C_COMMAND_INSTR(0x6D, 0x02), 928 ILI9881C_COMMAND_INSTR(0x6E, 0x02), 929 ILI9881C_COMMAND_INSTR(0x6F, 0x02), 930 931 ILI9881C_COMMAND_INSTR(0x70, 0x02), 932 ILI9881C_COMMAND_INSTR(0x71, 0x02), 933 ILI9881C_COMMAND_INSTR(0x72, 0x06), 934 ILI9881C_COMMAND_INSTR(0x73, 0x02), 935 ILI9881C_COMMAND_INSTR(0x74, 0x02), 936 ILI9881C_COMMAND_INSTR(0x75, 0x14), 937 ILI9881C_COMMAND_INSTR(0x76, 0x15), 938 ILI9881C_COMMAND_INSTR(0x77, 0x0F), 939 ILI9881C_COMMAND_INSTR(0x78, 0x0E), 940 ILI9881C_COMMAND_INSTR(0x79, 0x0D), 941 ILI9881C_COMMAND_INSTR(0x7A, 0x0C), 942 ILI9881C_COMMAND_INSTR(0x7B, 0x11), 943 ILI9881C_COMMAND_INSTR(0x7C, 0x10), 944 ILI9881C_COMMAND_INSTR(0x7D, 0x06), 945 ILI9881C_COMMAND_INSTR(0x7E, 0x02), 946 ILI9881C_COMMAND_INSTR(0x7F, 0x0A), 947 948 ILI9881C_COMMAND_INSTR(0x80, 0x02), 949 ILI9881C_COMMAND_INSTR(0x81, 0x02), 950 ILI9881C_COMMAND_INSTR(0x82, 0x02), 951 ILI9881C_COMMAND_INSTR(0x83, 0x02), 952 ILI9881C_COMMAND_INSTR(0x84, 0x02), 953 ILI9881C_COMMAND_INSTR(0x85, 0x02), 954 ILI9881C_COMMAND_INSTR(0x86, 0x02), 955 ILI9881C_COMMAND_INSTR(0x87, 0x02), 956 ILI9881C_COMMAND_INSTR(0x88, 0x08), 957 ILI9881C_COMMAND_INSTR(0x89, 0x02), 958 ILI9881C_COMMAND_INSTR(0x8A, 0x02), 959 960 ILI9881C_SWITCH_PAGE_INSTR(4), 961 ILI9881C_COMMAND_INSTR(0x00, 0x80), 962 ILI9881C_COMMAND_INSTR(0x70, 0x00), 963 ILI9881C_COMMAND_INSTR(0x71, 0x00), 964 ILI9881C_COMMAND_INSTR(0x66, 0xFE), 965 ILI9881C_COMMAND_INSTR(0x82, 0x15), 966 ILI9881C_COMMAND_INSTR(0x84, 0x15), 967 ILI9881C_COMMAND_INSTR(0x85, 0x15), 968 ILI9881C_COMMAND_INSTR(0x3a, 0x24), 969 ILI9881C_COMMAND_INSTR(0x32, 0xAC), 970 ILI9881C_COMMAND_INSTR(0x8C, 0x80), 971 ILI9881C_COMMAND_INSTR(0x3C, 0xF5), 972 ILI9881C_COMMAND_INSTR(0x88, 0x33), 973 974 ILI9881C_SWITCH_PAGE_INSTR(1), 975 ILI9881C_COMMAND_INSTR(0x22, 0x0A), 976 ILI9881C_COMMAND_INSTR(0x31, 0x00), 977 ILI9881C_COMMAND_INSTR(0x53, 0x78), 978 ILI9881C_COMMAND_INSTR(0x50, 0x5B), 979 ILI9881C_COMMAND_INSTR(0x51, 0x5B), 980 ILI9881C_COMMAND_INSTR(0x60, 0x20), 981 ILI9881C_COMMAND_INSTR(0x61, 0x00), 982 ILI9881C_COMMAND_INSTR(0x62, 0x0D), 983 ILI9881C_COMMAND_INSTR(0x63, 0x00), 984 985 ILI9881C_COMMAND_INSTR(0xA0, 0x00), 986 ILI9881C_COMMAND_INSTR(0xA1, 0x10), 987 ILI9881C_COMMAND_INSTR(0xA2, 0x1C), 988 ILI9881C_COMMAND_INSTR(0xA3, 0x13), 989 ILI9881C_COMMAND_INSTR(0xA4, 0x15), 990 ILI9881C_COMMAND_INSTR(0xA5, 0x26), 991 ILI9881C_COMMAND_INSTR(0xA6, 0x1A), 992 ILI9881C_COMMAND_INSTR(0xA7, 0x1D), 993 ILI9881C_COMMAND_INSTR(0xA8, 0x67), 994 ILI9881C_COMMAND_INSTR(0xA9, 0x1C), 995 ILI9881C_COMMAND_INSTR(0xAA, 0x29), 996 ILI9881C_COMMAND_INSTR(0xAB, 0x5B), 997 ILI9881C_COMMAND_INSTR(0xAC, 0x26), 998 ILI9881C_COMMAND_INSTR(0xAD, 0x28), 999 ILI9881C_COMMAND_INSTR(0xAE, 0x5C), 1000 ILI9881C_COMMAND_INSTR(0xAF, 0x30), 1001 ILI9881C_COMMAND_INSTR(0xB0, 0x31), 1002 ILI9881C_COMMAND_INSTR(0xB1, 0x2E), 1003 ILI9881C_COMMAND_INSTR(0xB2, 0x32), 1004 ILI9881C_COMMAND_INSTR(0xB3, 0x00), 1005 1006 ILI9881C_COMMAND_INSTR(0xC0, 0x00), 1007 ILI9881C_COMMAND_INSTR(0xC1, 0x10), 1008 ILI9881C_COMMAND_INSTR(0xC2, 0x1C), 1009 ILI9881C_COMMAND_INSTR(0xC3, 0x13), 1010 ILI9881C_COMMAND_INSTR(0xC4, 0x15), 1011 ILI9881C_COMMAND_INSTR(0xC5, 0x26), 1012 ILI9881C_COMMAND_INSTR(0xC6, 0x1A), 1013 ILI9881C_COMMAND_INSTR(0xC7, 0x1D), 1014 ILI9881C_COMMAND_INSTR(0xC8, 0x67), 1015 ILI9881C_COMMAND_INSTR(0xC9, 0x1C), 1016 ILI9881C_COMMAND_INSTR(0xCA, 0x29), 1017 ILI9881C_COMMAND_INSTR(0xCB, 0x5B), 1018 ILI9881C_COMMAND_INSTR(0xCC, 0x26), 1019 ILI9881C_COMMAND_INSTR(0xCD, 0x28), 1020 ILI9881C_COMMAND_INSTR(0xCE, 0x5C), 1021 ILI9881C_COMMAND_INSTR(0xCF, 0x30), 1022 ILI9881C_COMMAND_INSTR(0xD0, 0x31), 1023 ILI9881C_COMMAND_INSTR(0xD1, 0x2E), 1024 ILI9881C_COMMAND_INSTR(0xD2, 0x32), 1025 ILI9881C_COMMAND_INSTR(0xD3, 0x00), 1026 ILI9881C_SWITCH_PAGE_INSTR(0), 1027 }; 1028 1029 static const struct ili9881c_instr am8001280g_init[] = { 1030 ILI9881C_SWITCH_PAGE_INSTR(3), 1031 ILI9881C_COMMAND_INSTR(0x01, 0x00), 1032 ILI9881C_COMMAND_INSTR(0x02, 0x00), 1033 ILI9881C_COMMAND_INSTR(0x03, 0x73), 1034 ILI9881C_COMMAND_INSTR(0x04, 0xD3), 1035 ILI9881C_COMMAND_INSTR(0x05, 0x00), 1036 ILI9881C_COMMAND_INSTR(0x06, 0x0A), 1037 ILI9881C_COMMAND_INSTR(0x07, 0x0E), 1038 ILI9881C_COMMAND_INSTR(0x08, 0x00), 1039 ILI9881C_COMMAND_INSTR(0x09, 0x01), 1040 ILI9881C_COMMAND_INSTR(0x0a, 0x01), 1041 ILI9881C_COMMAND_INSTR(0x0b, 0x01), 1042 ILI9881C_COMMAND_INSTR(0x0c, 0x01), 1043 ILI9881C_COMMAND_INSTR(0x0d, 0x01), 1044 ILI9881C_COMMAND_INSTR(0x0e, 0x01), 1045 ILI9881C_COMMAND_INSTR(0x0f, 0x01), 1046 ILI9881C_COMMAND_INSTR(0x10, 0x01), 1047 ILI9881C_COMMAND_INSTR(0x11, 0x00), 1048 ILI9881C_COMMAND_INSTR(0x12, 0x00), 1049 ILI9881C_COMMAND_INSTR(0x13, 0x00), 1050 ILI9881C_COMMAND_INSTR(0x14, 0x00), 1051 ILI9881C_COMMAND_INSTR(0x15, 0x00), 1052 ILI9881C_COMMAND_INSTR(0x16, 0x00), 1053 ILI9881C_COMMAND_INSTR(0x17, 0x00), 1054 ILI9881C_COMMAND_INSTR(0x18, 0x00), 1055 ILI9881C_COMMAND_INSTR(0x19, 0x00), 1056 ILI9881C_COMMAND_INSTR(0x1a, 0x00), 1057 ILI9881C_COMMAND_INSTR(0x1b, 0x00), 1058 ILI9881C_COMMAND_INSTR(0x1c, 0x00), 1059 ILI9881C_COMMAND_INSTR(0x1d, 0x00), 1060 ILI9881C_COMMAND_INSTR(0x1e, 0x40), 1061 ILI9881C_COMMAND_INSTR(0x1f, 0x80), 1062 ILI9881C_COMMAND_INSTR(0x20, 0x06), 1063 ILI9881C_COMMAND_INSTR(0x21, 0x01), 1064 ILI9881C_COMMAND_INSTR(0x22, 0x00), 1065 ILI9881C_COMMAND_INSTR(0x23, 0x00), 1066 ILI9881C_COMMAND_INSTR(0x24, 0x00), 1067 ILI9881C_COMMAND_INSTR(0x25, 0x00), 1068 ILI9881C_COMMAND_INSTR(0x26, 0x00), 1069 ILI9881C_COMMAND_INSTR(0x27, 0x00), 1070 ILI9881C_COMMAND_INSTR(0x28, 0x33), 1071 ILI9881C_COMMAND_INSTR(0x29, 0x03), 1072 ILI9881C_COMMAND_INSTR(0x2a, 0x00), 1073 ILI9881C_COMMAND_INSTR(0x2b, 0x00), 1074 ILI9881C_COMMAND_INSTR(0x2c, 0x00), 1075 ILI9881C_COMMAND_INSTR(0x2d, 0x00), 1076 ILI9881C_COMMAND_INSTR(0x2e, 0x00), 1077 ILI9881C_COMMAND_INSTR(0x2f, 0x00), 1078 ILI9881C_COMMAND_INSTR(0x30, 0x00), 1079 ILI9881C_COMMAND_INSTR(0x31, 0x00), 1080 ILI9881C_COMMAND_INSTR(0x32, 0x00), 1081 ILI9881C_COMMAND_INSTR(0x33, 0x00), 1082 ILI9881C_COMMAND_INSTR(0x34, 0x03), 1083 ILI9881C_COMMAND_INSTR(0x35, 0x00), 1084 ILI9881C_COMMAND_INSTR(0x36, 0x03), 1085 ILI9881C_COMMAND_INSTR(0x37, 0x00), 1086 ILI9881C_COMMAND_INSTR(0x38, 0x00), 1087 ILI9881C_COMMAND_INSTR(0x39, 0x00), 1088 ILI9881C_COMMAND_INSTR(0x3a, 0x40), 1089 ILI9881C_COMMAND_INSTR(0x3b, 0x40), 1090 ILI9881C_COMMAND_INSTR(0x3c, 0x00), 1091 ILI9881C_COMMAND_INSTR(0x3d, 0x00), 1092 ILI9881C_COMMAND_INSTR(0x3e, 0x00), 1093 ILI9881C_COMMAND_INSTR(0x3f, 0x00), 1094 ILI9881C_COMMAND_INSTR(0x40, 0x00), 1095 ILI9881C_COMMAND_INSTR(0x41, 0x00), 1096 ILI9881C_COMMAND_INSTR(0x42, 0x00), 1097 ILI9881C_COMMAND_INSTR(0x43, 0x00), 1098 ILI9881C_COMMAND_INSTR(0x44, 0x00), 1099 1100 ILI9881C_COMMAND_INSTR(0x50, 0x01), 1101 ILI9881C_COMMAND_INSTR(0x51, 0x23), 1102 ILI9881C_COMMAND_INSTR(0x52, 0x45), 1103 ILI9881C_COMMAND_INSTR(0x53, 0x67), 1104 ILI9881C_COMMAND_INSTR(0x54, 0x89), 1105 ILI9881C_COMMAND_INSTR(0x55, 0xab), 1106 ILI9881C_COMMAND_INSTR(0x56, 0x01), 1107 ILI9881C_COMMAND_INSTR(0x57, 0x23), 1108 ILI9881C_COMMAND_INSTR(0x58, 0x45), 1109 ILI9881C_COMMAND_INSTR(0x59, 0x67), 1110 ILI9881C_COMMAND_INSTR(0x5a, 0x89), 1111 ILI9881C_COMMAND_INSTR(0x5b, 0xab), 1112 ILI9881C_COMMAND_INSTR(0x5c, 0xcd), 1113 ILI9881C_COMMAND_INSTR(0x5d, 0xef), 1114 1115 ILI9881C_COMMAND_INSTR(0x5e, 0x11), 1116 ILI9881C_COMMAND_INSTR(0x5f, 0x02), 1117 ILI9881C_COMMAND_INSTR(0x60, 0x00), 1118 ILI9881C_COMMAND_INSTR(0x61, 0x01), 1119 ILI9881C_COMMAND_INSTR(0x62, 0x0D), 1120 ILI9881C_COMMAND_INSTR(0x63, 0x0C), 1121 ILI9881C_COMMAND_INSTR(0x64, 0x0F), 1122 ILI9881C_COMMAND_INSTR(0x65, 0x0E), 1123 ILI9881C_COMMAND_INSTR(0x66, 0x06), 1124 ILI9881C_COMMAND_INSTR(0x67, 0x07), 1125 ILI9881C_COMMAND_INSTR(0x68, 0x02), 1126 ILI9881C_COMMAND_INSTR(0x69, 0x02), 1127 ILI9881C_COMMAND_INSTR(0x6a, 0x08), 1128 ILI9881C_COMMAND_INSTR(0x6b, 0x02), 1129 ILI9881C_COMMAND_INSTR(0x6c, 0x02), 1130 ILI9881C_COMMAND_INSTR(0x6d, 0x02), 1131 ILI9881C_COMMAND_INSTR(0x6e, 0x02), 1132 ILI9881C_COMMAND_INSTR(0x6f, 0x02), 1133 ILI9881C_COMMAND_INSTR(0x70, 0x02), 1134 ILI9881C_COMMAND_INSTR(0x71, 0x02), 1135 ILI9881C_COMMAND_INSTR(0x72, 0x02), 1136 ILI9881C_COMMAND_INSTR(0x73, 0x02), 1137 ILI9881C_COMMAND_INSTR(0x74, 0x02), 1138 ILI9881C_COMMAND_INSTR(0x75, 0x02), 1139 ILI9881C_COMMAND_INSTR(0x76, 0x00), 1140 ILI9881C_COMMAND_INSTR(0x77, 0x01), 1141 ILI9881C_COMMAND_INSTR(0x78, 0x0D), 1142 ILI9881C_COMMAND_INSTR(0x79, 0x0C), 1143 ILI9881C_COMMAND_INSTR(0x7a, 0x0F), 1144 ILI9881C_COMMAND_INSTR(0x7b, 0x0E), 1145 ILI9881C_COMMAND_INSTR(0x7c, 0x06), 1146 ILI9881C_COMMAND_INSTR(0x7d, 0x07), 1147 ILI9881C_COMMAND_INSTR(0x7e, 0x02), 1148 ILI9881C_COMMAND_INSTR(0x7f, 0x02), 1149 ILI9881C_COMMAND_INSTR(0x80, 0x08), 1150 ILI9881C_COMMAND_INSTR(0x81, 0x02), 1151 ILI9881C_COMMAND_INSTR(0x82, 0x02), 1152 ILI9881C_COMMAND_INSTR(0x83, 0x02), 1153 ILI9881C_COMMAND_INSTR(0x84, 0x02), 1154 ILI9881C_COMMAND_INSTR(0x85, 0x02), 1155 ILI9881C_COMMAND_INSTR(0x86, 0x02), 1156 ILI9881C_COMMAND_INSTR(0x87, 0x02), 1157 ILI9881C_COMMAND_INSTR(0x88, 0x02), 1158 ILI9881C_COMMAND_INSTR(0x89, 0x02), 1159 ILI9881C_COMMAND_INSTR(0x8A, 0x02), 1160 1161 ILI9881C_SWITCH_PAGE_INSTR(4), 1162 ILI9881C_COMMAND_INSTR(0x6c, 0x15), 1163 ILI9881C_COMMAND_INSTR(0x6e, 0x30), 1164 ILI9881C_COMMAND_INSTR(0x6f, 0x33), 1165 ILI9881C_COMMAND_INSTR(0x8d, 0x15), 1166 ILI9881C_COMMAND_INSTR(0x3a, 0xa4), 1167 ILI9881C_COMMAND_INSTR(0x87, 0xba), 1168 ILI9881C_COMMAND_INSTR(0x26, 0x76), 1169 ILI9881C_COMMAND_INSTR(0xb2, 0xd1), 1170 1171 ILI9881C_SWITCH_PAGE_INSTR(1), 1172 ILI9881C_COMMAND_INSTR(0x22, 0x0A), 1173 ILI9881C_COMMAND_INSTR(0x31, 0x0B), 1174 ILI9881C_COMMAND_INSTR(0x50, 0xa5), 1175 ILI9881C_COMMAND_INSTR(0x51, 0xa0), 1176 ILI9881C_COMMAND_INSTR(0x53, 0x70), 1177 ILI9881C_COMMAND_INSTR(0x55, 0x7A), 1178 ILI9881C_COMMAND_INSTR(0x60, 0x14), 1179 1180 ILI9881C_COMMAND_INSTR(0xA0, 0x00), 1181 ILI9881C_COMMAND_INSTR(0xA1, 0x53), 1182 ILI9881C_COMMAND_INSTR(0xA2, 0x50), 1183 ILI9881C_COMMAND_INSTR(0xA3, 0x20), 1184 ILI9881C_COMMAND_INSTR(0xA4, 0x27), 1185 ILI9881C_COMMAND_INSTR(0xA5, 0x33), 1186 ILI9881C_COMMAND_INSTR(0xA6, 0x25), 1187 ILI9881C_COMMAND_INSTR(0xA7, 0x25), 1188 ILI9881C_COMMAND_INSTR(0xA8, 0xD4), 1189 ILI9881C_COMMAND_INSTR(0xA9, 0x1A), 1190 ILI9881C_COMMAND_INSTR(0xAA, 0x2B), 1191 ILI9881C_COMMAND_INSTR(0xAB, 0xB5), 1192 ILI9881C_COMMAND_INSTR(0xAC, 0x19), 1193 ILI9881C_COMMAND_INSTR(0xAD, 0x18), 1194 ILI9881C_COMMAND_INSTR(0xAE, 0x53), 1195 ILI9881C_COMMAND_INSTR(0xAF, 0x1A), 1196 ILI9881C_COMMAND_INSTR(0xB0, 0x25), 1197 ILI9881C_COMMAND_INSTR(0xB1, 0x62), 1198 ILI9881C_COMMAND_INSTR(0xB2, 0x6A), 1199 ILI9881C_COMMAND_INSTR(0xB3, 0x31), 1200 1201 ILI9881C_COMMAND_INSTR(0xC0, 0x00), 1202 ILI9881C_COMMAND_INSTR(0xC1, 0x53), 1203 ILI9881C_COMMAND_INSTR(0xC2, 0x50), 1204 ILI9881C_COMMAND_INSTR(0xC3, 0x20), 1205 ILI9881C_COMMAND_INSTR(0xC4, 0x27), 1206 ILI9881C_COMMAND_INSTR(0xC5, 0x33), 1207 ILI9881C_COMMAND_INSTR(0xC6, 0x25), 1208 ILI9881C_COMMAND_INSTR(0xC7, 0x25), 1209 ILI9881C_COMMAND_INSTR(0xC8, 0xD4), 1210 ILI9881C_COMMAND_INSTR(0xC9, 0x1A), 1211 ILI9881C_COMMAND_INSTR(0xCA, 0x2B), 1212 ILI9881C_COMMAND_INSTR(0xCB, 0xB5), 1213 ILI9881C_COMMAND_INSTR(0xCC, 0x19), 1214 ILI9881C_COMMAND_INSTR(0xCD, 0x18), 1215 ILI9881C_COMMAND_INSTR(0xCE, 0x53), 1216 ILI9881C_COMMAND_INSTR(0xCF, 0x1A), 1217 ILI9881C_COMMAND_INSTR(0xD0, 0x25), 1218 ILI9881C_COMMAND_INSTR(0xD1, 0x62), 1219 ILI9881C_COMMAND_INSTR(0xD2, 0x6A), 1220 ILI9881C_COMMAND_INSTR(0xD3, 0x31), 1221 ILI9881C_SWITCH_PAGE_INSTR(0), 1222 ILI9881C_COMMAND_INSTR(MIPI_DCS_WRITE_CONTROL_DISPLAY, 0x2c), 1223 ILI9881C_COMMAND_INSTR(MIPI_DCS_WRITE_POWER_SAVE, 0x00), 1224 }; 1225 1226 static inline struct ili9881c *panel_to_ili9881c(struct drm_panel *panel) 1227 { 1228 return container_of(panel, struct ili9881c, panel); 1229 } 1230 1231 /* 1232 * The panel seems to accept some private DCS commands that map 1233 * directly to registers. 1234 * 1235 * It is organised by page, with each page having its own set of 1236 * registers, and the first page looks like it's holding the standard 1237 * DCS commands. 1238 * 1239 * So before any attempt at sending a command or data, we have to be 1240 * sure if we're in the right page or not. 1241 */ 1242 static int ili9881c_switch_page(struct ili9881c *ctx, u8 page) 1243 { 1244 u8 buf[4] = { 0xff, 0x98, 0x81, page }; 1245 int ret; 1246 1247 ret = mipi_dsi_dcs_write_buffer(ctx->dsi, buf, sizeof(buf)); 1248 if (ret < 0) 1249 return ret; 1250 1251 return 0; 1252 } 1253 1254 static int ili9881c_send_cmd_data(struct ili9881c *ctx, u8 cmd, u8 data) 1255 { 1256 u8 buf[2] = { cmd, data }; 1257 int ret; 1258 1259 ret = mipi_dsi_dcs_write_buffer(ctx->dsi, buf, sizeof(buf)); 1260 if (ret < 0) 1261 return ret; 1262 1263 return 0; 1264 } 1265 1266 static int ili9881c_prepare(struct drm_panel *panel) 1267 { 1268 struct ili9881c *ctx = panel_to_ili9881c(panel); 1269 unsigned int i; 1270 int ret; 1271 1272 /* Power the panel */ 1273 ret = regulator_enable(ctx->power); 1274 if (ret) 1275 return ret; 1276 msleep(5); 1277 1278 /* And reset it */ 1279 gpiod_set_value_cansleep(ctx->reset, 1); 1280 msleep(20); 1281 1282 gpiod_set_value_cansleep(ctx->reset, 0); 1283 msleep(20); 1284 1285 for (i = 0; i < ctx->desc->init_length; i++) { 1286 const struct ili9881c_instr *instr = &ctx->desc->init[i]; 1287 1288 if (instr->op == ILI9881C_SWITCH_PAGE) 1289 ret = ili9881c_switch_page(ctx, instr->arg.page); 1290 else if (instr->op == ILI9881C_COMMAND) 1291 ret = ili9881c_send_cmd_data(ctx, instr->arg.cmd.cmd, 1292 instr->arg.cmd.data); 1293 1294 if (ret) 1295 return ret; 1296 } 1297 1298 ret = ili9881c_switch_page(ctx, 0); 1299 if (ret) 1300 return ret; 1301 1302 if (ctx->address_mode) { 1303 ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_SET_ADDRESS_MODE, 1304 &ctx->address_mode, 1305 sizeof(ctx->address_mode)); 1306 if (ret < 0) 1307 return ret; 1308 } 1309 1310 ret = mipi_dsi_dcs_set_tear_on(ctx->dsi, MIPI_DSI_DCS_TEAR_MODE_VBLANK); 1311 if (ret) 1312 return ret; 1313 1314 ret = mipi_dsi_dcs_exit_sleep_mode(ctx->dsi); 1315 if (ret) 1316 return ret; 1317 1318 return 0; 1319 } 1320 1321 static int ili9881c_enable(struct drm_panel *panel) 1322 { 1323 struct ili9881c *ctx = panel_to_ili9881c(panel); 1324 1325 msleep(120); 1326 1327 mipi_dsi_dcs_set_display_on(ctx->dsi); 1328 1329 return 0; 1330 } 1331 1332 static int ili9881c_disable(struct drm_panel *panel) 1333 { 1334 struct ili9881c *ctx = panel_to_ili9881c(panel); 1335 1336 return mipi_dsi_dcs_set_display_off(ctx->dsi); 1337 } 1338 1339 static int ili9881c_unprepare(struct drm_panel *panel) 1340 { 1341 struct ili9881c *ctx = panel_to_ili9881c(panel); 1342 1343 mipi_dsi_dcs_enter_sleep_mode(ctx->dsi); 1344 regulator_disable(ctx->power); 1345 gpiod_set_value_cansleep(ctx->reset, 1); 1346 1347 return 0; 1348 } 1349 1350 static const struct drm_display_mode lhr050h41_default_mode = { 1351 .clock = 62000, 1352 1353 .hdisplay = 720, 1354 .hsync_start = 720 + 10, 1355 .hsync_end = 720 + 10 + 20, 1356 .htotal = 720 + 10 + 20 + 30, 1357 1358 .vdisplay = 1280, 1359 .vsync_start = 1280 + 10, 1360 .vsync_end = 1280 + 10 + 10, 1361 .vtotal = 1280 + 10 + 10 + 20, 1362 1363 .width_mm = 62, 1364 .height_mm = 110, 1365 }; 1366 1367 static const struct drm_display_mode k101_im2byl02_default_mode = { 1368 .clock = 69700, 1369 1370 .hdisplay = 800, 1371 .hsync_start = 800 + 52, 1372 .hsync_end = 800 + 52 + 8, 1373 .htotal = 800 + 52 + 8 + 48, 1374 1375 .vdisplay = 1280, 1376 .vsync_start = 1280 + 16, 1377 .vsync_end = 1280 + 16 + 6, 1378 .vtotal = 1280 + 16 + 6 + 15, 1379 1380 .width_mm = 135, 1381 .height_mm = 217, 1382 }; 1383 1384 static const struct drm_display_mode kd050hdfia020_default_mode = { 1385 .clock = 62000, 1386 1387 .hdisplay = 720, 1388 .hsync_start = 720 + 10, 1389 .hsync_end = 720 + 10 + 20, 1390 .htotal = 720 + 10 + 20 + 30, 1391 1392 .vdisplay = 1280, 1393 .vsync_start = 1280 + 10, 1394 .vsync_end = 1280 + 10 + 10, 1395 .vtotal = 1280 + 10 + 10 + 20, 1396 1397 .width_mm = 62, 1398 .height_mm = 110, 1399 }; 1400 1401 static const struct drm_display_mode tl050hdv35_default_mode = { 1402 .clock = 59400, 1403 1404 .hdisplay = 720, 1405 .hsync_start = 720 + 18, 1406 .hsync_end = 720 + 18 + 3, 1407 .htotal = 720 + 18 + 3 + 20, 1408 1409 .vdisplay = 1280, 1410 .vsync_start = 1280 + 26, 1411 .vsync_end = 1280 + 26 + 6, 1412 .vtotal = 1280 + 26 + 6 + 28, 1413 1414 .width_mm = 62, 1415 .height_mm = 110, 1416 }; 1417 1418 static const struct drm_display_mode w552946aba_default_mode = { 1419 .clock = 64000, 1420 1421 .hdisplay = 720, 1422 .hsync_start = 720 + 40, 1423 .hsync_end = 720 + 40 + 10, 1424 .htotal = 720 + 40 + 10 + 40, 1425 1426 .vdisplay = 1280, 1427 .vsync_start = 1280 + 22, 1428 .vsync_end = 1280 + 22 + 4, 1429 .vtotal = 1280 + 22 + 4 + 11, 1430 1431 .width_mm = 68, 1432 .height_mm = 121, 1433 }; 1434 1435 static const struct drm_display_mode am8001280g_default_mode = { 1436 .clock = 67911, 1437 1438 .hdisplay = 800, 1439 .hsync_start = 800 + 20, 1440 .hsync_end = 800 + 20 + 32, 1441 .htotal = 800 + 20 + 32 + 20, 1442 1443 .vdisplay = 1280, 1444 .vsync_start = 1280 + 6, 1445 .vsync_end = 1280 + 6 + 8, 1446 .vtotal = 1280 + 6 + 8 + 4, 1447 1448 .width_mm = 94, 1449 .height_mm = 151, 1450 }; 1451 1452 static int ili9881c_get_modes(struct drm_panel *panel, 1453 struct drm_connector *connector) 1454 { 1455 struct ili9881c *ctx = panel_to_ili9881c(panel); 1456 struct drm_display_mode *mode; 1457 1458 mode = drm_mode_duplicate(connector->dev, ctx->desc->mode); 1459 if (!mode) { 1460 dev_err(&ctx->dsi->dev, "failed to add mode %ux%ux@%u\n", 1461 ctx->desc->mode->hdisplay, 1462 ctx->desc->mode->vdisplay, 1463 drm_mode_vrefresh(ctx->desc->mode)); 1464 return -ENOMEM; 1465 } 1466 1467 drm_mode_set_name(mode); 1468 1469 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; 1470 drm_mode_probed_add(connector, mode); 1471 1472 connector->display_info.width_mm = mode->width_mm; 1473 connector->display_info.height_mm = mode->height_mm; 1474 if (ctx->address_mode == 0x3) 1475 connector->display_info.subpixel_order = SubPixelHorizontalBGR; 1476 else 1477 connector->display_info.subpixel_order = SubPixelHorizontalRGB; 1478 1479 /* 1480 * TODO: Remove once all drm drivers call 1481 * drm_connector_set_orientation_from_panel() 1482 */ 1483 drm_connector_set_panel_orientation(connector, ctx->orientation); 1484 1485 return 1; 1486 } 1487 1488 static enum drm_panel_orientation ili9881c_get_orientation(struct drm_panel *panel) 1489 { 1490 struct ili9881c *ctx = panel_to_ili9881c(panel); 1491 1492 return ctx->orientation; 1493 } 1494 1495 static const struct drm_panel_funcs ili9881c_funcs = { 1496 .prepare = ili9881c_prepare, 1497 .unprepare = ili9881c_unprepare, 1498 .enable = ili9881c_enable, 1499 .disable = ili9881c_disable, 1500 .get_modes = ili9881c_get_modes, 1501 .get_orientation = ili9881c_get_orientation, 1502 }; 1503 1504 static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi) 1505 { 1506 struct ili9881c *ctx; 1507 int ret; 1508 1509 ctx = devm_kzalloc(&dsi->dev, sizeof(*ctx), GFP_KERNEL); 1510 if (!ctx) 1511 return -ENOMEM; 1512 mipi_dsi_set_drvdata(dsi, ctx); 1513 ctx->dsi = dsi; 1514 ctx->desc = of_device_get_match_data(&dsi->dev); 1515 1516 drm_panel_init(&ctx->panel, &dsi->dev, &ili9881c_funcs, 1517 DRM_MODE_CONNECTOR_DSI); 1518 1519 ctx->power = devm_regulator_get(&dsi->dev, "power"); 1520 if (IS_ERR(ctx->power)) 1521 return dev_err_probe(&dsi->dev, PTR_ERR(ctx->power), 1522 "Couldn't get our power regulator\n"); 1523 1524 ctx->reset = devm_gpiod_get_optional(&dsi->dev, "reset", GPIOD_OUT_LOW); 1525 if (IS_ERR(ctx->reset)) 1526 return dev_err_probe(&dsi->dev, PTR_ERR(ctx->reset), 1527 "Couldn't get our reset GPIO\n"); 1528 1529 ret = of_drm_get_panel_orientation(dsi->dev.of_node, &ctx->orientation); 1530 if (ret) { 1531 dev_err(&dsi->dev, "%pOF: failed to get orientation: %d\n", 1532 dsi->dev.of_node, ret); 1533 return ret; 1534 } 1535 1536 ctx->address_mode = ctx->desc->default_address_mode; 1537 if (ctx->orientation == DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP) { 1538 ctx->address_mode ^= 0x03; 1539 ctx->orientation = DRM_MODE_PANEL_ORIENTATION_NORMAL; 1540 } 1541 1542 ctx->panel.prepare_prev_first = true; 1543 1544 ret = drm_panel_of_backlight(&ctx->panel); 1545 if (ret) 1546 return ret; 1547 1548 drm_panel_add(&ctx->panel); 1549 1550 dsi->mode_flags = ctx->desc->mode_flags; 1551 dsi->format = MIPI_DSI_FMT_RGB888; 1552 dsi->lanes = 4; 1553 1554 return mipi_dsi_attach(dsi); 1555 } 1556 1557 static void ili9881c_dsi_remove(struct mipi_dsi_device *dsi) 1558 { 1559 struct ili9881c *ctx = mipi_dsi_get_drvdata(dsi); 1560 1561 mipi_dsi_detach(dsi); 1562 drm_panel_remove(&ctx->panel); 1563 } 1564 1565 static const struct ili9881c_desc lhr050h41_desc = { 1566 .init = lhr050h41_init, 1567 .init_length = ARRAY_SIZE(lhr050h41_init), 1568 .mode = &lhr050h41_default_mode, 1569 .mode_flags = MIPI_DSI_MODE_VIDEO_SYNC_PULSE, 1570 }; 1571 1572 static const struct ili9881c_desc k101_im2byl02_desc = { 1573 .init = k101_im2byl02_init, 1574 .init_length = ARRAY_SIZE(k101_im2byl02_init), 1575 .mode = &k101_im2byl02_default_mode, 1576 .mode_flags = MIPI_DSI_MODE_VIDEO_SYNC_PULSE, 1577 }; 1578 1579 static const struct ili9881c_desc kd050hdfia020_desc = { 1580 .init = kd050hdfia020_init, 1581 .init_length = ARRAY_SIZE(kd050hdfia020_init), 1582 .mode = &kd050hdfia020_default_mode, 1583 .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | 1584 MIPI_DSI_MODE_LPM, 1585 }; 1586 1587 static const struct ili9881c_desc tl050hdv35_desc = { 1588 .init = tl050hdv35_init, 1589 .init_length = ARRAY_SIZE(tl050hdv35_init), 1590 .mode = &tl050hdv35_default_mode, 1591 .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | 1592 MIPI_DSI_MODE_LPM, 1593 .default_address_mode = 0x03, 1594 }; 1595 1596 static const struct ili9881c_desc w552946aba_desc = { 1597 .init = w552946ab_init, 1598 .init_length = ARRAY_SIZE(w552946ab_init), 1599 .mode = &w552946aba_default_mode, 1600 .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | 1601 MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET, 1602 }; 1603 1604 static const struct ili9881c_desc am8001280g_desc = { 1605 .init = am8001280g_init, 1606 .init_length = ARRAY_SIZE(am8001280g_init), 1607 .mode = &am8001280g_default_mode, 1608 .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | 1609 MIPI_DSI_CLOCK_NON_CONTINUOUS | MIPI_DSI_MODE_LPM, 1610 }; 1611 1612 static const struct of_device_id ili9881c_of_match[] = { 1613 { .compatible = "bananapi,lhr050h41", .data = &lhr050h41_desc }, 1614 { .compatible = "feixin,k101-im2byl02", .data = &k101_im2byl02_desc }, 1615 { .compatible = "startek,kd050hdfia020", .data = &kd050hdfia020_desc }, 1616 { .compatible = "tdo,tl050hdv35", .data = &tl050hdv35_desc }, 1617 { .compatible = "wanchanglong,w552946aba", .data = &w552946aba_desc }, 1618 { .compatible = "ampire,am8001280g", .data = &am8001280g_desc }, 1619 { } 1620 }; 1621 MODULE_DEVICE_TABLE(of, ili9881c_of_match); 1622 1623 static struct mipi_dsi_driver ili9881c_dsi_driver = { 1624 .probe = ili9881c_dsi_probe, 1625 .remove = ili9881c_dsi_remove, 1626 .driver = { 1627 .name = "ili9881c-dsi", 1628 .of_match_table = ili9881c_of_match, 1629 }, 1630 }; 1631 module_mipi_dsi_driver(ili9881c_dsi_driver); 1632 1633 MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com>"); 1634 MODULE_DESCRIPTION("Ilitek ILI9881C Controller Driver"); 1635 MODULE_LICENSE("GPL v2"); 1636