162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright (C) 2017-2018, Bootlin
462306a36Sopenharmony_ci */
562306a36Sopenharmony_ci
662306a36Sopenharmony_ci#include <linux/delay.h>
762306a36Sopenharmony_ci#include <linux/device.h>
862306a36Sopenharmony_ci#include <linux/err.h>
962306a36Sopenharmony_ci#include <linux/errno.h>
1062306a36Sopenharmony_ci#include <linux/kernel.h>
1162306a36Sopenharmony_ci#include <linux/module.h>
1262306a36Sopenharmony_ci#include <linux/of.h>
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci#include <linux/gpio/consumer.h>
1562306a36Sopenharmony_ci#include <linux/regulator/consumer.h>
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci#include <drm/drm_mipi_dsi.h>
1862306a36Sopenharmony_ci#include <drm/drm_modes.h>
1962306a36Sopenharmony_ci#include <drm/drm_panel.h>
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci#include <video/mipi_display.h>
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_cienum ili9881c_op {
2462306a36Sopenharmony_ci	ILI9881C_SWITCH_PAGE,
2562306a36Sopenharmony_ci	ILI9881C_COMMAND,
2662306a36Sopenharmony_ci};
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_cistruct ili9881c_instr {
2962306a36Sopenharmony_ci	enum ili9881c_op	op;
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci	union arg {
3262306a36Sopenharmony_ci		struct cmd {
3362306a36Sopenharmony_ci			u8	cmd;
3462306a36Sopenharmony_ci			u8	data;
3562306a36Sopenharmony_ci		} cmd;
3662306a36Sopenharmony_ci		u8	page;
3762306a36Sopenharmony_ci	} arg;
3862306a36Sopenharmony_ci};
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_cistruct ili9881c_desc {
4162306a36Sopenharmony_ci	const struct ili9881c_instr *init;
4262306a36Sopenharmony_ci	const size_t init_length;
4362306a36Sopenharmony_ci	const struct drm_display_mode *mode;
4462306a36Sopenharmony_ci	const unsigned long mode_flags;
4562306a36Sopenharmony_ci};
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_cistruct ili9881c {
4862306a36Sopenharmony_ci	struct drm_panel	panel;
4962306a36Sopenharmony_ci	struct mipi_dsi_device	*dsi;
5062306a36Sopenharmony_ci	const struct ili9881c_desc	*desc;
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ci	struct regulator	*power;
5362306a36Sopenharmony_ci	struct gpio_desc	*reset;
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ci	enum drm_panel_orientation	orientation;
5662306a36Sopenharmony_ci};
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_ci#define ILI9881C_SWITCH_PAGE_INSTR(_page)	\
5962306a36Sopenharmony_ci	{					\
6062306a36Sopenharmony_ci		.op = ILI9881C_SWITCH_PAGE,	\
6162306a36Sopenharmony_ci		.arg = {			\
6262306a36Sopenharmony_ci			.page = (_page),	\
6362306a36Sopenharmony_ci		},				\
6462306a36Sopenharmony_ci	}
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ci#define ILI9881C_COMMAND_INSTR(_cmd, _data)		\
6762306a36Sopenharmony_ci	{						\
6862306a36Sopenharmony_ci		.op = ILI9881C_COMMAND,		\
6962306a36Sopenharmony_ci		.arg = {				\
7062306a36Sopenharmony_ci			.cmd = {			\
7162306a36Sopenharmony_ci				.cmd = (_cmd),		\
7262306a36Sopenharmony_ci				.data = (_data),	\
7362306a36Sopenharmony_ci			},				\
7462306a36Sopenharmony_ci		},					\
7562306a36Sopenharmony_ci	}
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_cistatic const struct ili9881c_instr lhr050h41_init[] = {
7862306a36Sopenharmony_ci	ILI9881C_SWITCH_PAGE_INSTR(3),
7962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x01, 0x00),
8062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x02, 0x00),
8162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x03, 0x73),
8262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x04, 0x03),
8362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x05, 0x00),
8462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x06, 0x06),
8562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x07, 0x06),
8662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x08, 0x00),
8762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x09, 0x18),
8862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x0a, 0x04),
8962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x0b, 0x00),
9062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x0c, 0x02),
9162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x0d, 0x03),
9262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x0e, 0x00),
9362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x0f, 0x25),
9462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x10, 0x25),
9562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x11, 0x00),
9662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x12, 0x00),
9762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x13, 0x00),
9862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x14, 0x00),
9962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x15, 0x00),
10062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x16, 0x0C),
10162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x17, 0x00),
10262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x18, 0x00),
10362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x19, 0x00),
10462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x1a, 0x00),
10562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x1b, 0x00),
10662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x1c, 0x00),
10762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x1d, 0x00),
10862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x1e, 0xC0),
10962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x1f, 0x80),
11062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x20, 0x04),
11162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x21, 0x01),
11262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x22, 0x00),
11362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x23, 0x00),
11462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x24, 0x00),
11562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x25, 0x00),
11662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x26, 0x00),
11762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x27, 0x00),
11862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x28, 0x33),
11962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x29, 0x03),
12062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x2a, 0x00),
12162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x2b, 0x00),
12262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x2c, 0x00),
12362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x2d, 0x00),
12462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x2e, 0x00),
12562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x2f, 0x00),
12662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x30, 0x00),
12762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x31, 0x00),
12862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x32, 0x00),
12962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x33, 0x00),
13062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x34, 0x04),
13162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x35, 0x00),
13262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x36, 0x00),
13362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x37, 0x00),
13462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x38, 0x3C),
13562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x39, 0x00),
13662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3a, 0x00),
13762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3b, 0x00),
13862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3c, 0x00),
13962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3d, 0x00),
14062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3e, 0x00),
14162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3f, 0x00),
14262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x40, 0x00),
14362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x41, 0x00),
14462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x42, 0x00),
14562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x43, 0x00),
14662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x44, 0x00),
14762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x50, 0x01),
14862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x51, 0x23),
14962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x52, 0x45),
15062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x53, 0x67),
15162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x54, 0x89),
15262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x55, 0xab),
15362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x56, 0x01),
15462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x57, 0x23),
15562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x58, 0x45),
15662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x59, 0x67),
15762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x5a, 0x89),
15862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x5b, 0xab),
15962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x5c, 0xcd),
16062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x5d, 0xef),
16162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x5e, 0x11),
16262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x5f, 0x02),
16362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x60, 0x02),
16462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x61, 0x02),
16562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x62, 0x02),
16662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x63, 0x02),
16762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x64, 0x02),
16862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x65, 0x02),
16962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x66, 0x02),
17062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x67, 0x02),
17162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x68, 0x02),
17262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x69, 0x02),
17362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6a, 0x0C),
17462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6b, 0x02),
17562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6c, 0x0F),
17662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6d, 0x0E),
17762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6e, 0x0D),
17862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6f, 0x06),
17962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x70, 0x07),
18062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x71, 0x02),
18162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x72, 0x02),
18262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x73, 0x02),
18362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x74, 0x02),
18462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x75, 0x02),
18562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x76, 0x02),
18662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x77, 0x02),
18762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x78, 0x02),
18862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x79, 0x02),
18962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x7a, 0x02),
19062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x7b, 0x02),
19162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x7c, 0x02),
19262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x7d, 0x02),
19362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x7e, 0x02),
19462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x7f, 0x02),
19562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x80, 0x0C),
19662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x81, 0x02),
19762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x82, 0x0F),
19862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x83, 0x0E),
19962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x84, 0x0D),
20062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x85, 0x06),
20162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x86, 0x07),
20262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x87, 0x02),
20362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x88, 0x02),
20462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x89, 0x02),
20562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x8A, 0x02),
20662306a36Sopenharmony_ci	ILI9881C_SWITCH_PAGE_INSTR(4),
20762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6C, 0x15),
20862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6E, 0x22),
20962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6F, 0x33),
21062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3A, 0xA4),
21162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x8D, 0x0D),
21262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x87, 0xBA),
21362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x26, 0x76),
21462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xB2, 0xD1),
21562306a36Sopenharmony_ci	ILI9881C_SWITCH_PAGE_INSTR(1),
21662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x22, 0x0A),
21762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x53, 0xDC),
21862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x55, 0xA7),
21962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x50, 0x78),
22062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x51, 0x78),
22162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x31, 0x02),
22262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x60, 0x14),
22362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA0, 0x2A),
22462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA1, 0x39),
22562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA2, 0x46),
22662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA3, 0x0e),
22762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA4, 0x12),
22862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA5, 0x25),
22962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA6, 0x19),
23062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA7, 0x1d),
23162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA8, 0xa6),
23262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA9, 0x1C),
23362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xAA, 0x29),
23462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xAB, 0x85),
23562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xAC, 0x1C),
23662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xAD, 0x1B),
23762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xAE, 0x51),
23862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xAF, 0x22),
23962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xB0, 0x2d),
24062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xB1, 0x4f),
24162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xB2, 0x59),
24262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xB3, 0x3F),
24362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC0, 0x2A),
24462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC1, 0x3a),
24562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC2, 0x45),
24662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC3, 0x0e),
24762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC4, 0x11),
24862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC5, 0x24),
24962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC6, 0x1a),
25062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC7, 0x1c),
25162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC8, 0xaa),
25262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC9, 0x1C),
25362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xCA, 0x29),
25462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xCB, 0x96),
25562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xCC, 0x1C),
25662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xCD, 0x1B),
25762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xCE, 0x51),
25862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xCF, 0x22),
25962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xD0, 0x2b),
26062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xD1, 0x4b),
26162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xD2, 0x59),
26262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xD3, 0x3F),
26362306a36Sopenharmony_ci};
26462306a36Sopenharmony_ci
26562306a36Sopenharmony_cistatic const struct ili9881c_instr k101_im2byl02_init[] = {
26662306a36Sopenharmony_ci	ILI9881C_SWITCH_PAGE_INSTR(3),
26762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x01, 0x00),
26862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x02, 0x00),
26962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x03, 0x73),
27062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x04, 0x00),
27162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x05, 0x00),
27262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x06, 0x08),
27362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x07, 0x00),
27462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x08, 0x00),
27562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x09, 0x00),
27662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x0A, 0x01),
27762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x0B, 0x01),
27862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x0C, 0x00),
27962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x0D, 0x01),
28062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x0E, 0x01),
28162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x0F, 0x00),
28262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x10, 0x00),
28362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x11, 0x00),
28462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x12, 0x00),
28562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x13, 0x00),
28662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x14, 0x00),
28762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x15, 0x00),
28862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x16, 0x00),
28962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x17, 0x00),
29062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x18, 0x00),
29162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x19, 0x00),
29262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x1A, 0x00),
29362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x1B, 0x00),
29462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x1C, 0x00),
29562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x1D, 0x00),
29662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x1E, 0x40),
29762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x1F, 0xC0),
29862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x20, 0x06),
29962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x21, 0x01),
30062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x22, 0x06),
30162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x23, 0x01),
30262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x24, 0x88),
30362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x25, 0x88),
30462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x26, 0x00),
30562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x27, 0x00),
30662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x28, 0x3B),
30762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x29, 0x03),
30862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x2A, 0x00),
30962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x2B, 0x00),
31062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x2C, 0x00),
31162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x2D, 0x00),
31262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x2E, 0x00),
31362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x2F, 0x00),
31462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x30, 0x00),
31562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x31, 0x00),
31662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x32, 0x00),
31762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x33, 0x00),
31862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x34, 0x00), /* GPWR1/2 non overlap time 2.62us */
31962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x35, 0x00),
32062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x36, 0x00),
32162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x37, 0x00),
32262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x38, 0x00),
32362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x39, 0x00),
32462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3A, 0x00),
32562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3B, 0x00),
32662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3C, 0x00),
32762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3D, 0x00),
32862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3E, 0x00),
32962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3F, 0x00),
33062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x40, 0x00),
33162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x41, 0x00),
33262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x42, 0x00),
33362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x43, 0x00),
33462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x44, 0x00),
33562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x50, 0x01),
33662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x51, 0x23),
33762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x52, 0x45),
33862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x53, 0x67),
33962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x54, 0x89),
34062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x55, 0xAB),
34162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x56, 0x01),
34262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x57, 0x23),
34362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x58, 0x45),
34462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x59, 0x67),
34562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x5A, 0x89),
34662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x5B, 0xAB),
34762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x5C, 0xCD),
34862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x5D, 0xEF),
34962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x5E, 0x00),
35062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x5F, 0x01),
35162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x60, 0x01),
35262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x61, 0x06),
35362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x62, 0x06),
35462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x63, 0x07),
35562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x64, 0x07),
35662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x65, 0x00),
35762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x66, 0x00),
35862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x67, 0x02),
35962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x68, 0x02),
36062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x69, 0x05),
36162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6A, 0x05),
36262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6B, 0x02),
36362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6C, 0x0D),
36462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6D, 0x0D),
36562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6E, 0x0C),
36662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6F, 0x0C),
36762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x70, 0x0F),
36862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x71, 0x0F),
36962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x72, 0x0E),
37062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x73, 0x0E),
37162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x74, 0x02),
37262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x75, 0x01),
37362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x76, 0x01),
37462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x77, 0x06),
37562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x78, 0x06),
37662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x79, 0x07),
37762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x7A, 0x07),
37862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x7B, 0x00),
37962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x7C, 0x00),
38062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x7D, 0x02),
38162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x7E, 0x02),
38262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x7F, 0x05),
38362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x80, 0x05),
38462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x81, 0x02),
38562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x82, 0x0D),
38662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x83, 0x0D),
38762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x84, 0x0C),
38862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x85, 0x0C),
38962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x86, 0x0F),
39062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x87, 0x0F),
39162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x88, 0x0E),
39262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x89, 0x0E),
39362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x8A, 0x02),
39462306a36Sopenharmony_ci	ILI9881C_SWITCH_PAGE_INSTR(4),
39562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3B, 0xC0), /* ILI4003D sel */
39662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6C, 0x15), /* Set VCORE voltage = 1.5V */
39762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6E, 0x2A), /* di_pwr_reg=0 for power mode 2A, VGH clamp 18V */
39862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6F, 0x33), /* pumping ratio VGH=5x VGL=-3x */
39962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x8D, 0x1B), /* VGL clamp -10V */
40062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x87, 0xBA), /* ESD */
40162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3A, 0x24), /* POWER SAVING */
40262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x26, 0x76),
40362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xB2, 0xD1),
40462306a36Sopenharmony_ci	ILI9881C_SWITCH_PAGE_INSTR(1),
40562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x22, 0x0A), /* BGR, SS */
40662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x31, 0x00), /* Zigzag type3 inversion */
40762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x40, 0x53), /* ILI4003D sel */
40862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x43, 0x66),
40962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x53, 0x4C),
41062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x50, 0x87),
41162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x51, 0x82),
41262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x60, 0x15),
41362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x61, 0x01),
41462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x62, 0x0C),
41562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x63, 0x00),
41662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA0, 0x00),
41762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA1, 0x13), /* VP251 */
41862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA2, 0x23), /* VP247 */
41962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA3, 0x14), /* VP243 */
42062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA4, 0x16), /* VP239 */
42162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA5, 0x29), /* VP231 */
42262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA6, 0x1E), /* VP219 */
42362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA7, 0x1D), /* VP203 */
42462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA8, 0x86), /* VP175 */
42562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA9, 0x1E), /* VP144 */
42662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xAA, 0x29), /* VP111 */
42762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xAB, 0x74), /* VP80 */
42862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xAC, 0x19), /* VP52 */
42962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xAD, 0x17), /* VP36 */
43062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xAE, 0x4B), /* VP24 */
43162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xAF, 0x20), /* VP16 */
43262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xB0, 0x26), /* VP12 */
43362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xB1, 0x4C), /* VP8 */
43462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xB2, 0x5D), /* VP4 */
43562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xB3, 0x3F), /* VP0 */
43662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC0, 0x00), /* VN255 GAMMA N */
43762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC1, 0x13), /* VN251 */
43862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC2, 0x23), /* VN247 */
43962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC3, 0x14), /* VN243 */
44062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC4, 0x16), /* VN239 */
44162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC5, 0x29), /* VN231 */
44262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC6, 0x1E), /* VN219 */
44362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC7, 0x1D), /* VN203 */
44462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC8, 0x86), /* VN175 */
44562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC9, 0x1E), /* VN144 */
44662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xCA, 0x29), /* VN111 */
44762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xCB, 0x74), /* VN80 */
44862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xCC, 0x19), /* VN52 */
44962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xCD, 0x17), /* VN36 */
45062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xCE, 0x4B), /* VN24 */
45162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xCF, 0x20), /* VN16 */
45262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xD0, 0x26), /* VN12 */
45362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xD1, 0x4C), /* VN8 */
45462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xD2, 0x5D), /* VN4 */
45562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xD3, 0x3F), /* VN0 */
45662306a36Sopenharmony_ci};
45762306a36Sopenharmony_ci
45862306a36Sopenharmony_cistatic const struct ili9881c_instr tl050hdv35_init[] = {
45962306a36Sopenharmony_ci	ILI9881C_SWITCH_PAGE_INSTR(3),
46062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x01, 0x00),
46162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x02, 0x00),
46262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x03, 0x73),
46362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x04, 0x00),
46462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x05, 0x00),
46562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x06, 0x0a),
46662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x07, 0x00),
46762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x08, 0x00),
46862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x09, 0x01),
46962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x0a, 0x00),
47062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x0b, 0x00),
47162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x0c, 0x01),
47262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x0d, 0x00),
47362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x0e, 0x00),
47462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x0f, 0x1d),
47562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x10, 0x1d),
47662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x15, 0x00),
47762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x16, 0x00),
47862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x17, 0x00),
47962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x18, 0x00),
48062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x19, 0x00),
48162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x1a, 0x00),
48262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x1b, 0x00),
48362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x1c, 0x00),
48462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x1d, 0x00),
48562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x1e, 0x40),
48662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x1f, 0x80),
48762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x20, 0x06),
48862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x21, 0x02),
48962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x28, 0x33),
49062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x29, 0x03),
49162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x2a, 0x00),
49262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x2b, 0x00),
49362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x2c, 0x00),
49462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x2d, 0x00),
49562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x2e, 0x00),
49662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x2f, 0x00),
49762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x35, 0x00),
49862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x36, 0x00),
49962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x37, 0x00),
50062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x38, 0x3C),
50162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x39, 0x00),
50262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3a, 0x40),
50362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3b, 0x40),
50462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3c, 0x00),
50562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3d, 0x00),
50662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3e, 0x00),
50762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3f, 0x00),
50862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x40, 0x00),
50962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x41, 0x00),
51062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x42, 0x00),
51162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x43, 0x00),
51262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x44, 0x00),
51362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x55, 0xab),
51462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x5a, 0x89),
51562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x5b, 0xab),
51662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x5c, 0xcd),
51762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x5d, 0xef),
51862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x5e, 0x11),
51962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x5f, 0x01),
52062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x60, 0x00),
52162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x61, 0x15),
52262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x62, 0x14),
52362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x63, 0x0e),
52462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x64, 0x0f),
52562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x65, 0x0c),
52662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x66, 0x0d),
52762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x67, 0x06),
52862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x68, 0x02),
52962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x69, 0x07),
53062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6a, 0x02),
53162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6b, 0x02),
53262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6c, 0x02),
53362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6d, 0x02),
53462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6e, 0x02),
53562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6f, 0x02),
53662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x70, 0x02),
53762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x71, 0x02),
53862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x72, 0x02),
53962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x73, 0x02),
54062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x74, 0x02),
54162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x75, 0x01),
54262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x76, 0x00),
54362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x77, 0x14),
54462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x78, 0x15),
54562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x79, 0x0e),
54662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x7a, 0x0f),
54762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x7b, 0x0c),
54862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x7c, 0x0d),
54962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x7d, 0x06),
55062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x7e, 0x02),
55162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x7f, 0x07),
55262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x88, 0x02),
55362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x89, 0x02),
55462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x8A, 0x02),
55562306a36Sopenharmony_ci	ILI9881C_SWITCH_PAGE_INSTR(4),
55662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x38, 0x01),
55762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x39, 0x00),
55862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6c, 0x15),
55962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6e, 0x2b),
56062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6f, 0x33),
56162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x8d, 0x18),
56262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x87, 0xba),
56362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x26, 0x76),
56462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xb2, 0xd1),
56562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xb5, 0x06),
56662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3a, 0x24),
56762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x35, 0x1f),
56862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x33, 0x14),
56962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3b, 0x98),
57062306a36Sopenharmony_ci	ILI9881C_SWITCH_PAGE_INSTR(1),
57162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x22, 0x0a),
57262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x31, 0x00),
57362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x40, 0x33),
57462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x53, 0xa2),
57562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x55, 0x92),
57662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x50, 0x96),
57762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x51, 0x96),
57862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x60, 0x22),
57962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x61, 0x00),
58062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x62, 0x19),
58162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x63, 0x00),
58262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xa0, 0x08),
58362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xa1, 0x11),
58462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xa2, 0x19),
58562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xa3, 0x0d),
58662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xa4, 0x0d),
58762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xa5, 0x1e),
58862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xa6, 0x14),
58962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xa7, 0x17),
59062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xa8, 0x4f),
59162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xa9, 0x1a),
59262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xaa, 0x27),
59362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xab, 0x49),
59462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xac, 0x1a),
59562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xad, 0x18),
59662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xae, 0x4c),
59762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xaf, 0x22),
59862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xb0, 0x27),
59962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xb1, 0x4b),
60062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xb2, 0x60),
60162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xb3, 0x39),
60262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xc0, 0x08),
60362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xc1, 0x11),
60462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xc2, 0x19),
60562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xc3, 0x0d),
60662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xc4, 0x0d),
60762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xc5, 0x1e),
60862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xc6, 0x14),
60962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xc7, 0x17),
61062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xc8, 0x4f),
61162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xc9, 0x1a),
61262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xca, 0x27),
61362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xcb, 0x49),
61462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xcc, 0x1a),
61562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xcd, 0x18),
61662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xce, 0x4c),
61762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xcf, 0x33),
61862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xd0, 0x27),
61962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xd1, 0x4b),
62062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xd2, 0x60),
62162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xd3, 0x39),
62262306a36Sopenharmony_ci	ILI9881C_SWITCH_PAGE_INSTR(0),
62362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x36, 0x03),
62462306a36Sopenharmony_ci};
62562306a36Sopenharmony_ci
62662306a36Sopenharmony_cistatic const struct ili9881c_instr w552946ab_init[] = {
62762306a36Sopenharmony_ci	ILI9881C_SWITCH_PAGE_INSTR(3),
62862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x01, 0x00),
62962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x02, 0x00),
63062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x03, 0x53),
63162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x04, 0x53),
63262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x05, 0x13),
63362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x06, 0x04),
63462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x07, 0x02),
63562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x08, 0x02),
63662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x09, 0x00),
63762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x0A, 0x00),
63862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x0B, 0x00),
63962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x0C, 0x00),
64062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x0D, 0x00),
64162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x0E, 0x00),
64262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x0F, 0x00),
64362306a36Sopenharmony_ci
64462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x10, 0x00),
64562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x11, 0x00),
64662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x12, 0x00),
64762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x13, 0x00),
64862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x14, 0x00),
64962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x15, 0x08),
65062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x16, 0x10),
65162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x17, 0x00),
65262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x18, 0x08),
65362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x19, 0x00),
65462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x1A, 0x00),
65562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x1B, 0x00),
65662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x1C, 0x00),
65762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x1D, 0x00),
65862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x1E, 0xC0),
65962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x1F, 0x80),
66062306a36Sopenharmony_ci
66162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x20, 0x02),
66262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x21, 0x09),
66362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x22, 0x00),
66462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x23, 0x00),
66562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x24, 0x00),
66662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x25, 0x00),
66762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x26, 0x00),
66862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x27, 0x00),
66962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x28, 0x55),
67062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x29, 0x03),
67162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x2A, 0x00),
67262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x2B, 0x00),
67362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x2C, 0x00),
67462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x2D, 0x00),
67562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x2E, 0x00),
67662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x2F, 0x00),
67762306a36Sopenharmony_ci
67862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x30, 0x00),
67962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x31, 0x00),
68062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x32, 0x00),
68162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x33, 0x00),
68262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x34, 0x04),
68362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x35, 0x05),
68462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x36, 0x05),
68562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x37, 0x00),
68662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x38, 0x3C),
68762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x39, 0x35),
68862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3A, 0x00),
68962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3B, 0x40),
69062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3C, 0x00),
69162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3D, 0x00),
69262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3E, 0x00),
69362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3F, 0x00),
69462306a36Sopenharmony_ci
69562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x40, 0x00),
69662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x41, 0x88),
69762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x42, 0x00),
69862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x43, 0x00),
69962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x44, 0x1F),
70062306a36Sopenharmony_ci
70162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x50, 0x01),
70262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x51, 0x23),
70362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x52, 0x45),
70462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x53, 0x67),
70562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x54, 0x89),
70662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x55, 0xaB),
70762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x56, 0x01),
70862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x57, 0x23),
70962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x58, 0x45),
71062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x59, 0x67),
71162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x5A, 0x89),
71262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x5B, 0xAB),
71362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x5C, 0xCD),
71462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x5D, 0xEF),
71562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x5E, 0x03),
71662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x5F, 0x14),
71762306a36Sopenharmony_ci
71862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x60, 0x15),
71962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x61, 0x0C),
72062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x62, 0x0D),
72162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x63, 0x0E),
72262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x64, 0x0F),
72362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x65, 0x10),
72462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x66, 0x11),
72562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x67, 0x08),
72662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x68, 0x02),
72762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x69, 0x0A),
72862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6A, 0x02),
72962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6B, 0x02),
73062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6C, 0x02),
73162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6D, 0x02),
73262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6E, 0x02),
73362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x6F, 0x02),
73462306a36Sopenharmony_ci
73562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x70, 0x02),
73662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x71, 0x02),
73762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x72, 0x06),
73862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x73, 0x02),
73962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x74, 0x02),
74062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x75, 0x14),
74162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x76, 0x15),
74262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x77, 0x0F),
74362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x78, 0x0E),
74462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x79, 0x0D),
74562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x7A, 0x0C),
74662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x7B, 0x11),
74762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x7C, 0x10),
74862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x7D, 0x06),
74962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x7E, 0x02),
75062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x7F, 0x0A),
75162306a36Sopenharmony_ci
75262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x80, 0x02),
75362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x81, 0x02),
75462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x82, 0x02),
75562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x83, 0x02),
75662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x84, 0x02),
75762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x85, 0x02),
75862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x86, 0x02),
75962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x87, 0x02),
76062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x88, 0x08),
76162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x89, 0x02),
76262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x8A, 0x02),
76362306a36Sopenharmony_ci
76462306a36Sopenharmony_ci	ILI9881C_SWITCH_PAGE_INSTR(4),
76562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x00, 0x80),
76662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x70, 0x00),
76762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x71, 0x00),
76862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x66, 0xFE),
76962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x82, 0x15),
77062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x84, 0x15),
77162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x85, 0x15),
77262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3a, 0x24),
77362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x32, 0xAC),
77462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x8C, 0x80),
77562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x3C, 0xF5),
77662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x88, 0x33),
77762306a36Sopenharmony_ci
77862306a36Sopenharmony_ci	ILI9881C_SWITCH_PAGE_INSTR(1),
77962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x22, 0x0A),
78062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x31, 0x00),
78162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x53, 0x78),
78262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x50, 0x5B),
78362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x51, 0x5B),
78462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x60, 0x20),
78562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x61, 0x00),
78662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x62, 0x0D),
78762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0x63, 0x00),
78862306a36Sopenharmony_ci
78962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA0, 0x00),
79062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA1, 0x10),
79162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA2, 0x1C),
79262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA3, 0x13),
79362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA4, 0x15),
79462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA5, 0x26),
79562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA6, 0x1A),
79662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA7, 0x1D),
79762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA8, 0x67),
79862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xA9, 0x1C),
79962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xAA, 0x29),
80062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xAB, 0x5B),
80162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xAC, 0x26),
80262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xAD, 0x28),
80362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xAE, 0x5C),
80462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xAF, 0x30),
80562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xB0, 0x31),
80662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xB1, 0x2E),
80762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xB2, 0x32),
80862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xB3, 0x00),
80962306a36Sopenharmony_ci
81062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC0, 0x00),
81162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC1, 0x10),
81262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC2, 0x1C),
81362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC3, 0x13),
81462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC4, 0x15),
81562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC5, 0x26),
81662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC6, 0x1A),
81762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC7, 0x1D),
81862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC8, 0x67),
81962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xC9, 0x1C),
82062306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xCA, 0x29),
82162306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xCB, 0x5B),
82262306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xCC, 0x26),
82362306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xCD, 0x28),
82462306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xCE, 0x5C),
82562306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xCF, 0x30),
82662306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xD0, 0x31),
82762306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xD1, 0x2E),
82862306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xD2, 0x32),
82962306a36Sopenharmony_ci	ILI9881C_COMMAND_INSTR(0xD3, 0x00),
83062306a36Sopenharmony_ci	ILI9881C_SWITCH_PAGE_INSTR(0),
83162306a36Sopenharmony_ci};
83262306a36Sopenharmony_ci
83362306a36Sopenharmony_cistatic inline struct ili9881c *panel_to_ili9881c(struct drm_panel *panel)
83462306a36Sopenharmony_ci{
83562306a36Sopenharmony_ci	return container_of(panel, struct ili9881c, panel);
83662306a36Sopenharmony_ci}
83762306a36Sopenharmony_ci
83862306a36Sopenharmony_ci/*
83962306a36Sopenharmony_ci * The panel seems to accept some private DCS commands that map
84062306a36Sopenharmony_ci * directly to registers.
84162306a36Sopenharmony_ci *
84262306a36Sopenharmony_ci * It is organised by page, with each page having its own set of
84362306a36Sopenharmony_ci * registers, and the first page looks like it's holding the standard
84462306a36Sopenharmony_ci * DCS commands.
84562306a36Sopenharmony_ci *
84662306a36Sopenharmony_ci * So before any attempt at sending a command or data, we have to be
84762306a36Sopenharmony_ci * sure if we're in the right page or not.
84862306a36Sopenharmony_ci */
84962306a36Sopenharmony_cistatic int ili9881c_switch_page(struct ili9881c *ctx, u8 page)
85062306a36Sopenharmony_ci{
85162306a36Sopenharmony_ci	u8 buf[4] = { 0xff, 0x98, 0x81, page };
85262306a36Sopenharmony_ci	int ret;
85362306a36Sopenharmony_ci
85462306a36Sopenharmony_ci	ret = mipi_dsi_dcs_write_buffer(ctx->dsi, buf, sizeof(buf));
85562306a36Sopenharmony_ci	if (ret < 0)
85662306a36Sopenharmony_ci		return ret;
85762306a36Sopenharmony_ci
85862306a36Sopenharmony_ci	return 0;
85962306a36Sopenharmony_ci}
86062306a36Sopenharmony_ci
86162306a36Sopenharmony_cistatic int ili9881c_send_cmd_data(struct ili9881c *ctx, u8 cmd, u8 data)
86262306a36Sopenharmony_ci{
86362306a36Sopenharmony_ci	u8 buf[2] = { cmd, data };
86462306a36Sopenharmony_ci	int ret;
86562306a36Sopenharmony_ci
86662306a36Sopenharmony_ci	ret = mipi_dsi_dcs_write_buffer(ctx->dsi, buf, sizeof(buf));
86762306a36Sopenharmony_ci	if (ret < 0)
86862306a36Sopenharmony_ci		return ret;
86962306a36Sopenharmony_ci
87062306a36Sopenharmony_ci	return 0;
87162306a36Sopenharmony_ci}
87262306a36Sopenharmony_ci
87362306a36Sopenharmony_cistatic int ili9881c_prepare(struct drm_panel *panel)
87462306a36Sopenharmony_ci{
87562306a36Sopenharmony_ci	struct ili9881c *ctx = panel_to_ili9881c(panel);
87662306a36Sopenharmony_ci	unsigned int i;
87762306a36Sopenharmony_ci	int ret;
87862306a36Sopenharmony_ci
87962306a36Sopenharmony_ci	/* Power the panel */
88062306a36Sopenharmony_ci	ret = regulator_enable(ctx->power);
88162306a36Sopenharmony_ci	if (ret)
88262306a36Sopenharmony_ci		return ret;
88362306a36Sopenharmony_ci	msleep(5);
88462306a36Sopenharmony_ci
88562306a36Sopenharmony_ci	/* And reset it */
88662306a36Sopenharmony_ci	gpiod_set_value(ctx->reset, 1);
88762306a36Sopenharmony_ci	msleep(20);
88862306a36Sopenharmony_ci
88962306a36Sopenharmony_ci	gpiod_set_value(ctx->reset, 0);
89062306a36Sopenharmony_ci	msleep(20);
89162306a36Sopenharmony_ci
89262306a36Sopenharmony_ci	for (i = 0; i < ctx->desc->init_length; i++) {
89362306a36Sopenharmony_ci		const struct ili9881c_instr *instr = &ctx->desc->init[i];
89462306a36Sopenharmony_ci
89562306a36Sopenharmony_ci		if (instr->op == ILI9881C_SWITCH_PAGE)
89662306a36Sopenharmony_ci			ret = ili9881c_switch_page(ctx, instr->arg.page);
89762306a36Sopenharmony_ci		else if (instr->op == ILI9881C_COMMAND)
89862306a36Sopenharmony_ci			ret = ili9881c_send_cmd_data(ctx, instr->arg.cmd.cmd,
89962306a36Sopenharmony_ci						      instr->arg.cmd.data);
90062306a36Sopenharmony_ci
90162306a36Sopenharmony_ci		if (ret)
90262306a36Sopenharmony_ci			return ret;
90362306a36Sopenharmony_ci	}
90462306a36Sopenharmony_ci
90562306a36Sopenharmony_ci	ret = ili9881c_switch_page(ctx, 0);
90662306a36Sopenharmony_ci	if (ret)
90762306a36Sopenharmony_ci		return ret;
90862306a36Sopenharmony_ci
90962306a36Sopenharmony_ci	ret = mipi_dsi_dcs_set_tear_on(ctx->dsi, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
91062306a36Sopenharmony_ci	if (ret)
91162306a36Sopenharmony_ci		return ret;
91262306a36Sopenharmony_ci
91362306a36Sopenharmony_ci	ret = mipi_dsi_dcs_exit_sleep_mode(ctx->dsi);
91462306a36Sopenharmony_ci	if (ret)
91562306a36Sopenharmony_ci		return ret;
91662306a36Sopenharmony_ci
91762306a36Sopenharmony_ci	return 0;
91862306a36Sopenharmony_ci}
91962306a36Sopenharmony_ci
92062306a36Sopenharmony_cistatic int ili9881c_enable(struct drm_panel *panel)
92162306a36Sopenharmony_ci{
92262306a36Sopenharmony_ci	struct ili9881c *ctx = panel_to_ili9881c(panel);
92362306a36Sopenharmony_ci
92462306a36Sopenharmony_ci	msleep(120);
92562306a36Sopenharmony_ci
92662306a36Sopenharmony_ci	mipi_dsi_dcs_set_display_on(ctx->dsi);
92762306a36Sopenharmony_ci
92862306a36Sopenharmony_ci	return 0;
92962306a36Sopenharmony_ci}
93062306a36Sopenharmony_ci
93162306a36Sopenharmony_cistatic int ili9881c_disable(struct drm_panel *panel)
93262306a36Sopenharmony_ci{
93362306a36Sopenharmony_ci	struct ili9881c *ctx = panel_to_ili9881c(panel);
93462306a36Sopenharmony_ci
93562306a36Sopenharmony_ci	return mipi_dsi_dcs_set_display_off(ctx->dsi);
93662306a36Sopenharmony_ci}
93762306a36Sopenharmony_ci
93862306a36Sopenharmony_cistatic int ili9881c_unprepare(struct drm_panel *panel)
93962306a36Sopenharmony_ci{
94062306a36Sopenharmony_ci	struct ili9881c *ctx = panel_to_ili9881c(panel);
94162306a36Sopenharmony_ci
94262306a36Sopenharmony_ci	mipi_dsi_dcs_enter_sleep_mode(ctx->dsi);
94362306a36Sopenharmony_ci	regulator_disable(ctx->power);
94462306a36Sopenharmony_ci	gpiod_set_value(ctx->reset, 1);
94562306a36Sopenharmony_ci
94662306a36Sopenharmony_ci	return 0;
94762306a36Sopenharmony_ci}
94862306a36Sopenharmony_ci
94962306a36Sopenharmony_cistatic const struct drm_display_mode lhr050h41_default_mode = {
95062306a36Sopenharmony_ci	.clock		= 62000,
95162306a36Sopenharmony_ci
95262306a36Sopenharmony_ci	.hdisplay	= 720,
95362306a36Sopenharmony_ci	.hsync_start	= 720 + 10,
95462306a36Sopenharmony_ci	.hsync_end	= 720 + 10 + 20,
95562306a36Sopenharmony_ci	.htotal		= 720 + 10 + 20 + 30,
95662306a36Sopenharmony_ci
95762306a36Sopenharmony_ci	.vdisplay	= 1280,
95862306a36Sopenharmony_ci	.vsync_start	= 1280 + 10,
95962306a36Sopenharmony_ci	.vsync_end	= 1280 + 10 + 10,
96062306a36Sopenharmony_ci	.vtotal		= 1280 + 10 + 10 + 20,
96162306a36Sopenharmony_ci
96262306a36Sopenharmony_ci	.width_mm	= 62,
96362306a36Sopenharmony_ci	.height_mm	= 110,
96462306a36Sopenharmony_ci};
96562306a36Sopenharmony_ci
96662306a36Sopenharmony_cistatic const struct drm_display_mode k101_im2byl02_default_mode = {
96762306a36Sopenharmony_ci	.clock		= 69700,
96862306a36Sopenharmony_ci
96962306a36Sopenharmony_ci	.hdisplay	= 800,
97062306a36Sopenharmony_ci	.hsync_start	= 800 + 52,
97162306a36Sopenharmony_ci	.hsync_end	= 800 + 52 + 8,
97262306a36Sopenharmony_ci	.htotal		= 800 + 52 + 8 + 48,
97362306a36Sopenharmony_ci
97462306a36Sopenharmony_ci	.vdisplay	= 1280,
97562306a36Sopenharmony_ci	.vsync_start	= 1280 + 16,
97662306a36Sopenharmony_ci	.vsync_end	= 1280 + 16 + 6,
97762306a36Sopenharmony_ci	.vtotal		= 1280 + 16 + 6 + 15,
97862306a36Sopenharmony_ci
97962306a36Sopenharmony_ci	.width_mm	= 135,
98062306a36Sopenharmony_ci	.height_mm	= 217,
98162306a36Sopenharmony_ci};
98262306a36Sopenharmony_ci
98362306a36Sopenharmony_cistatic const struct drm_display_mode tl050hdv35_default_mode = {
98462306a36Sopenharmony_ci	.clock		= 59400,
98562306a36Sopenharmony_ci
98662306a36Sopenharmony_ci	.hdisplay	= 720,
98762306a36Sopenharmony_ci	.hsync_start	= 720 + 18,
98862306a36Sopenharmony_ci	.hsync_end	= 720 + 18 + 3,
98962306a36Sopenharmony_ci	.htotal		= 720 + 18 + 3 + 20,
99062306a36Sopenharmony_ci
99162306a36Sopenharmony_ci	.vdisplay	= 1280,
99262306a36Sopenharmony_ci	.vsync_start	= 1280 + 26,
99362306a36Sopenharmony_ci	.vsync_end	= 1280 + 26 + 6,
99462306a36Sopenharmony_ci	.vtotal		= 1280 + 26 + 6 + 28,
99562306a36Sopenharmony_ci
99662306a36Sopenharmony_ci	.width_mm	= 62,
99762306a36Sopenharmony_ci	.height_mm	= 110,
99862306a36Sopenharmony_ci};
99962306a36Sopenharmony_ci
100062306a36Sopenharmony_cistatic const struct drm_display_mode w552946aba_default_mode = {
100162306a36Sopenharmony_ci	.clock		= 64000,
100262306a36Sopenharmony_ci
100362306a36Sopenharmony_ci	.hdisplay	= 720,
100462306a36Sopenharmony_ci	.hsync_start	= 720 + 40,
100562306a36Sopenharmony_ci	.hsync_end	= 720 + 40 + 10,
100662306a36Sopenharmony_ci	.htotal		= 720 + 40 + 10 + 40,
100762306a36Sopenharmony_ci
100862306a36Sopenharmony_ci	.vdisplay	= 1280,
100962306a36Sopenharmony_ci	.vsync_start	= 1280 + 22,
101062306a36Sopenharmony_ci	.vsync_end	= 1280 + 22 + 4,
101162306a36Sopenharmony_ci	.vtotal		= 1280 + 22 + 4 + 11,
101262306a36Sopenharmony_ci
101362306a36Sopenharmony_ci	.width_mm	= 68,
101462306a36Sopenharmony_ci	.height_mm	= 121,
101562306a36Sopenharmony_ci};
101662306a36Sopenharmony_ci
101762306a36Sopenharmony_cistatic int ili9881c_get_modes(struct drm_panel *panel,
101862306a36Sopenharmony_ci			      struct drm_connector *connector)
101962306a36Sopenharmony_ci{
102062306a36Sopenharmony_ci	struct ili9881c *ctx = panel_to_ili9881c(panel);
102162306a36Sopenharmony_ci	struct drm_display_mode *mode;
102262306a36Sopenharmony_ci
102362306a36Sopenharmony_ci	mode = drm_mode_duplicate(connector->dev, ctx->desc->mode);
102462306a36Sopenharmony_ci	if (!mode) {
102562306a36Sopenharmony_ci		dev_err(&ctx->dsi->dev, "failed to add mode %ux%ux@%u\n",
102662306a36Sopenharmony_ci			ctx->desc->mode->hdisplay,
102762306a36Sopenharmony_ci			ctx->desc->mode->vdisplay,
102862306a36Sopenharmony_ci			drm_mode_vrefresh(ctx->desc->mode));
102962306a36Sopenharmony_ci		return -ENOMEM;
103062306a36Sopenharmony_ci	}
103162306a36Sopenharmony_ci
103262306a36Sopenharmony_ci	drm_mode_set_name(mode);
103362306a36Sopenharmony_ci
103462306a36Sopenharmony_ci	mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
103562306a36Sopenharmony_ci	drm_mode_probed_add(connector, mode);
103662306a36Sopenharmony_ci
103762306a36Sopenharmony_ci	connector->display_info.width_mm = mode->width_mm;
103862306a36Sopenharmony_ci	connector->display_info.height_mm = mode->height_mm;
103962306a36Sopenharmony_ci
104062306a36Sopenharmony_ci	/*
104162306a36Sopenharmony_ci	 * TODO: Remove once all drm drivers call
104262306a36Sopenharmony_ci	 * drm_connector_set_orientation_from_panel()
104362306a36Sopenharmony_ci	 */
104462306a36Sopenharmony_ci	drm_connector_set_panel_orientation(connector, ctx->orientation);
104562306a36Sopenharmony_ci
104662306a36Sopenharmony_ci	return 1;
104762306a36Sopenharmony_ci}
104862306a36Sopenharmony_ci
104962306a36Sopenharmony_cistatic enum drm_panel_orientation ili9881c_get_orientation(struct drm_panel *panel)
105062306a36Sopenharmony_ci{
105162306a36Sopenharmony_ci	struct ili9881c *ctx = panel_to_ili9881c(panel);
105262306a36Sopenharmony_ci
105362306a36Sopenharmony_ci	return ctx->orientation;
105462306a36Sopenharmony_ci}
105562306a36Sopenharmony_ci
105662306a36Sopenharmony_cistatic const struct drm_panel_funcs ili9881c_funcs = {
105762306a36Sopenharmony_ci	.prepare	= ili9881c_prepare,
105862306a36Sopenharmony_ci	.unprepare	= ili9881c_unprepare,
105962306a36Sopenharmony_ci	.enable		= ili9881c_enable,
106062306a36Sopenharmony_ci	.disable	= ili9881c_disable,
106162306a36Sopenharmony_ci	.get_modes	= ili9881c_get_modes,
106262306a36Sopenharmony_ci	.get_orientation = ili9881c_get_orientation,
106362306a36Sopenharmony_ci};
106462306a36Sopenharmony_ci
106562306a36Sopenharmony_cistatic int ili9881c_dsi_probe(struct mipi_dsi_device *dsi)
106662306a36Sopenharmony_ci{
106762306a36Sopenharmony_ci	struct ili9881c *ctx;
106862306a36Sopenharmony_ci	int ret;
106962306a36Sopenharmony_ci
107062306a36Sopenharmony_ci	ctx = devm_kzalloc(&dsi->dev, sizeof(*ctx), GFP_KERNEL);
107162306a36Sopenharmony_ci	if (!ctx)
107262306a36Sopenharmony_ci		return -ENOMEM;
107362306a36Sopenharmony_ci	mipi_dsi_set_drvdata(dsi, ctx);
107462306a36Sopenharmony_ci	ctx->dsi = dsi;
107562306a36Sopenharmony_ci	ctx->desc = of_device_get_match_data(&dsi->dev);
107662306a36Sopenharmony_ci
107762306a36Sopenharmony_ci	drm_panel_init(&ctx->panel, &dsi->dev, &ili9881c_funcs,
107862306a36Sopenharmony_ci		       DRM_MODE_CONNECTOR_DSI);
107962306a36Sopenharmony_ci
108062306a36Sopenharmony_ci	ctx->power = devm_regulator_get(&dsi->dev, "power");
108162306a36Sopenharmony_ci	if (IS_ERR(ctx->power))
108262306a36Sopenharmony_ci		return dev_err_probe(&dsi->dev, PTR_ERR(ctx->power),
108362306a36Sopenharmony_ci				     "Couldn't get our power regulator\n");
108462306a36Sopenharmony_ci
108562306a36Sopenharmony_ci	ctx->reset = devm_gpiod_get_optional(&dsi->dev, "reset", GPIOD_OUT_LOW);
108662306a36Sopenharmony_ci	if (IS_ERR(ctx->reset))
108762306a36Sopenharmony_ci		return dev_err_probe(&dsi->dev, PTR_ERR(ctx->reset),
108862306a36Sopenharmony_ci				     "Couldn't get our reset GPIO\n");
108962306a36Sopenharmony_ci
109062306a36Sopenharmony_ci	ret = of_drm_get_panel_orientation(dsi->dev.of_node, &ctx->orientation);
109162306a36Sopenharmony_ci	if (ret) {
109262306a36Sopenharmony_ci		dev_err(&dsi->dev, "%pOF: failed to get orientation: %d\n",
109362306a36Sopenharmony_ci			dsi->dev.of_node, ret);
109462306a36Sopenharmony_ci		return ret;
109562306a36Sopenharmony_ci	}
109662306a36Sopenharmony_ci
109762306a36Sopenharmony_ci	ret = drm_panel_of_backlight(&ctx->panel);
109862306a36Sopenharmony_ci	if (ret)
109962306a36Sopenharmony_ci		return ret;
110062306a36Sopenharmony_ci
110162306a36Sopenharmony_ci	drm_panel_add(&ctx->panel);
110262306a36Sopenharmony_ci
110362306a36Sopenharmony_ci	dsi->mode_flags = ctx->desc->mode_flags;
110462306a36Sopenharmony_ci	dsi->format = MIPI_DSI_FMT_RGB888;
110562306a36Sopenharmony_ci	dsi->lanes = 4;
110662306a36Sopenharmony_ci
110762306a36Sopenharmony_ci	return mipi_dsi_attach(dsi);
110862306a36Sopenharmony_ci}
110962306a36Sopenharmony_ci
111062306a36Sopenharmony_cistatic void ili9881c_dsi_remove(struct mipi_dsi_device *dsi)
111162306a36Sopenharmony_ci{
111262306a36Sopenharmony_ci	struct ili9881c *ctx = mipi_dsi_get_drvdata(dsi);
111362306a36Sopenharmony_ci
111462306a36Sopenharmony_ci	mipi_dsi_detach(dsi);
111562306a36Sopenharmony_ci	drm_panel_remove(&ctx->panel);
111662306a36Sopenharmony_ci}
111762306a36Sopenharmony_ci
111862306a36Sopenharmony_cistatic const struct ili9881c_desc lhr050h41_desc = {
111962306a36Sopenharmony_ci	.init = lhr050h41_init,
112062306a36Sopenharmony_ci	.init_length = ARRAY_SIZE(lhr050h41_init),
112162306a36Sopenharmony_ci	.mode = &lhr050h41_default_mode,
112262306a36Sopenharmony_ci	.mode_flags = MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
112362306a36Sopenharmony_ci};
112462306a36Sopenharmony_ci
112562306a36Sopenharmony_cistatic const struct ili9881c_desc k101_im2byl02_desc = {
112662306a36Sopenharmony_ci	.init = k101_im2byl02_init,
112762306a36Sopenharmony_ci	.init_length = ARRAY_SIZE(k101_im2byl02_init),
112862306a36Sopenharmony_ci	.mode = &k101_im2byl02_default_mode,
112962306a36Sopenharmony_ci	.mode_flags = MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
113062306a36Sopenharmony_ci};
113162306a36Sopenharmony_ci
113262306a36Sopenharmony_cistatic const struct ili9881c_desc tl050hdv35_desc = {
113362306a36Sopenharmony_ci	.init = tl050hdv35_init,
113462306a36Sopenharmony_ci	.init_length = ARRAY_SIZE(tl050hdv35_init),
113562306a36Sopenharmony_ci	.mode = &tl050hdv35_default_mode,
113662306a36Sopenharmony_ci	.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
113762306a36Sopenharmony_ci		      MIPI_DSI_MODE_LPM,
113862306a36Sopenharmony_ci};
113962306a36Sopenharmony_ci
114062306a36Sopenharmony_cistatic const struct ili9881c_desc w552946aba_desc = {
114162306a36Sopenharmony_ci	.init = w552946ab_init,
114262306a36Sopenharmony_ci	.init_length = ARRAY_SIZE(w552946ab_init),
114362306a36Sopenharmony_ci	.mode = &w552946aba_default_mode,
114462306a36Sopenharmony_ci	.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
114562306a36Sopenharmony_ci		      MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET,
114662306a36Sopenharmony_ci};
114762306a36Sopenharmony_ci
114862306a36Sopenharmony_cistatic const struct of_device_id ili9881c_of_match[] = {
114962306a36Sopenharmony_ci	{ .compatible = "bananapi,lhr050h41", .data = &lhr050h41_desc },
115062306a36Sopenharmony_ci	{ .compatible = "feixin,k101-im2byl02", .data = &k101_im2byl02_desc },
115162306a36Sopenharmony_ci	{ .compatible = "tdo,tl050hdv35", .data = &tl050hdv35_desc },
115262306a36Sopenharmony_ci	{ .compatible = "wanchanglong,w552946aba", .data = &w552946aba_desc },
115362306a36Sopenharmony_ci	{ }
115462306a36Sopenharmony_ci};
115562306a36Sopenharmony_ciMODULE_DEVICE_TABLE(of, ili9881c_of_match);
115662306a36Sopenharmony_ci
115762306a36Sopenharmony_cistatic struct mipi_dsi_driver ili9881c_dsi_driver = {
115862306a36Sopenharmony_ci	.probe		= ili9881c_dsi_probe,
115962306a36Sopenharmony_ci	.remove		= ili9881c_dsi_remove,
116062306a36Sopenharmony_ci	.driver = {
116162306a36Sopenharmony_ci		.name		= "ili9881c-dsi",
116262306a36Sopenharmony_ci		.of_match_table	= ili9881c_of_match,
116362306a36Sopenharmony_ci	},
116462306a36Sopenharmony_ci};
116562306a36Sopenharmony_cimodule_mipi_dsi_driver(ili9881c_dsi_driver);
116662306a36Sopenharmony_ci
116762306a36Sopenharmony_ciMODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com>");
116862306a36Sopenharmony_ciMODULE_DESCRIPTION("Ilitek ILI9881C Controller Driver");
116962306a36Sopenharmony_ciMODULE_LICENSE("GPL v2");
1170