mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
lcd_extern: add mipi default driver [2/2]
PD#164036: lcd_extern: add mipi default driver Change-Id: Id120299c2434a3cce9b154064cd0c7e5dd0bbe8e Signed-off-by: Weiming Liu <weiming.liu@amlogic.com>
This commit is contained in:
@@ -14423,6 +14423,10 @@ M: nengwen.chen <nengwen.chen@amlogic.com>
|
||||
F: drivers/amlogic/atv_demod/*
|
||||
F: include/linux/amlogic/aml_atvdemod.h
|
||||
|
||||
AMLOGIC ADD EXT MIPI DEFAULT DRIVER
|
||||
M: Weiming Liu <weiming.liu@amlogic.com>
|
||||
F: drivers/amlogic/media/vout/lcd/lcd_extern/mipi_default.c
|
||||
|
||||
AMLOGIC G12A X2 U211 buildroot dts
|
||||
M: wenbiao zhang <wenbiao.zhang@amlogic.com>
|
||||
F: arch/arm64/boot/dts/amlogic/g12a_s905y2_u221_buildroot.dts
|
||||
|
||||
@@ -232,94 +232,418 @@
|
||||
|
||||
extern_0{
|
||||
index = <0>;
|
||||
extern_name = "ext_default";
|
||||
status = "disabled";
|
||||
type = <0>; /*0=i2c, 1=spi, 2=mipi*/
|
||||
i2c_address = <0x37>; /*7bit i2c address*/
|
||||
i2c_second_address = <0xff>; /*0xff for none*/
|
||||
i2c_bus = "i2c_bus_c";
|
||||
cmd_size = <4>;
|
||||
|
||||
/* init on/off: (type, value..., delay),
|
||||
* must match cmd_size for every group
|
||||
* type: 0x00=cmd(bit[3:0]=1 for second_addr),
|
||||
* 0xf0=gpio, 0xff=ending
|
||||
* value: i2c or spi cmd, or gpio index & level,
|
||||
* fill 0x0 for no use
|
||||
* delay: unit ms
|
||||
*/
|
||||
init_on = <0x00 0x00 0x00 0x00
|
||||
0x00 0x08 0x01 0x00
|
||||
0x00 0x10 0x3F 0x00
|
||||
0x00 0x11 0x00 0x00
|
||||
0x00 0x12 0x00 0x00
|
||||
0x00 0x13 0xE4 0x00
|
||||
0x00 0x14 0x02 0x00
|
||||
0x00 0x15 0x02 0x00
|
||||
0x00 0x16 0x24 0x00
|
||||
0x00 0x17 0x00 0x00
|
||||
0x00 0x18 0x21 0x00
|
||||
0x00 0x20 0x3F 0x00
|
||||
0x00 0x21 0xFF 0x00
|
||||
0x00 0x22 0x00 0x00
|
||||
0x00 0x23 0x00 0x00
|
||||
0x00 0x24 0x00 0x00
|
||||
0x00 0x25 0x00 0x00
|
||||
0x00 0x26 0xE4 0x00
|
||||
0x00 0x27 0x00 0x00
|
||||
0x00 0x28 0x28 0x00
|
||||
0x00 0x29 0x01 0x00
|
||||
0x00 0x2A 0x00 0x00
|
||||
0x00 0x2B 0x01 0x00
|
||||
0x00 0x2C 0x0E 0x00
|
||||
0x00 0x2D 0x00 0x00
|
||||
0x00 0x2E 0x18 0x00
|
||||
0x00 0x2F 0x02 0x00
|
||||
0x00 0x30 0x02 0x00
|
||||
0x00 0x31 0x00 0x00
|
||||
0x00 0x32 0x63 0x00
|
||||
0x00 0x40 0x00 0x00
|
||||
0x00 0x41 0x00 0x00
|
||||
0x00 0x42 0x00 0x00
|
||||
0x00 0x12 0x00 0x00
|
||||
0x00 0x13 0xE4 0x00
|
||||
0x00 0x14 0x02 0x00
|
||||
0x00 0x15 0x00 0x00
|
||||
0x00 0x16 0x0D 0x00
|
||||
0x00 0x17 0x00 0x00
|
||||
0x00 0x18 0x21 0x00
|
||||
0x00 0x41 0x06 0x00
|
||||
0x00 0x00 0x01 0x00
|
||||
0x00 0x08 0x00 0x00
|
||||
0x00 0x10 0x00 0x00
|
||||
0x00 0x11 0x0F 0x00
|
||||
0xff 0x00 0x00 0x00>; /*ending*/
|
||||
init_off = <0x00 0x00 0x01 0x00
|
||||
0x00 0x08 0x00 0x00
|
||||
0x00 0x10 0x00 0x00
|
||||
0x00 0x11 0x0F 0x00
|
||||
0xff 0x00 0x00 0x00>; /*ending*/
|
||||
extern_name = "mipi_default";/*default*/
|
||||
status = "okay";
|
||||
type = <2>; /* 0=i2c, 1=spi, 2=mipi */
|
||||
cmd_size = <0xff>;
|
||||
init_on = <
|
||||
0xff 10
|
||||
0x05 1 0x11
|
||||
0xff 120 /* delay 120ms */
|
||||
0x05 1 0x29
|
||||
0xff 0xff>; /*ending*/
|
||||
init_off = <
|
||||
0x05 1 0x28 /* display off */
|
||||
0xff 10 /* delay 10ms */
|
||||
0x05 1 0x10 /* sleep in */
|
||||
0xff 150 /* delay 150ms */
|
||||
0xff 0xff>; /*ending*/
|
||||
};
|
||||
|
||||
extern_1{
|
||||
index = <1>;
|
||||
extern_name = "mipi_TV070WSM";
|
||||
extern_name = "mipi_default";/*TV070WSM*/
|
||||
status = "okay";
|
||||
type = <2>; /* 0=i2c, 1=spi, 2=mipi */
|
||||
cmd_size = <0xff>;
|
||||
init_on = <
|
||||
0xff 10
|
||||
0x15 2 0x62 0x01
|
||||
0x39 5 0xff 0xaa 0x55 0x25 0x01
|
||||
0x15 2 0xfc 0x08
|
||||
0xff 1 /* delay */
|
||||
0x15 2 0xfc 0x00
|
||||
0x39 5 0xff 0xaa 0x55 0x25 0x00
|
||||
0xff 20 /* delay */
|
||||
0x39 6 0xf0 0x55 0xaa 0x52 0x08 0x00
|
||||
0x39 3 0xb1 0x68 0x41
|
||||
0x15 2 0xb5 0x88
|
||||
0x15 2 0xb6 0x0f
|
||||
0x39 5 0xb8 0x01 0x01 0x12 0x01
|
||||
0x39 3 0xbb 0x11 0x11
|
||||
0x39 3 0xbc 0x05 0x05
|
||||
0x15 2 0xc7 0x03
|
||||
0x39 6 0xbd 0x03 0x02 0x19 0x17 0x00
|
||||
0x15 2 0xc8 0x80
|
||||
0x39 6 0xf0 0x55 0xaa 0x52 0x08 0x01
|
||||
0x39 3 0xB2 0x01 0x01
|
||||
0x39 3 0xB3 0x28 0x28
|
||||
0x39 3 0xB4 0x14 0x14
|
||||
0x39 3 0xB8 0x05 0x05
|
||||
0x39 3 0xB9 0x45 0x45
|
||||
0x39 3 0xBA 0x25 0x25
|
||||
0x39 3 0xBC 0x88 0x00
|
||||
0x39 3 0xBD 0x88 0x00
|
||||
0x39 6 0xF0 0x55 0xAA 0x52 0x08 0x02
|
||||
0x15 2 0xEE 0x00
|
||||
0x39 17 0xB0 0x00 0x4B 0x00 0x5C 0x00
|
||||
0x79 0x00 0x94 0x00 0xA6 0x00 0xD8
|
||||
0x00 0xF2 0x01 0x19
|
||||
0x39 17 0xB1 0x01 0x39 0x01 0x77 0x01
|
||||
0xA2 0x01 0xF2 0x02 0x32 0x02 0x34
|
||||
0x02 0x6D 0x02 0xA2
|
||||
0x39 17 0xB2 0x02 0xC7 0x02 0xF2 0x03
|
||||
0x18 0x03 0x43 0x03 0x65 0x03 0x86
|
||||
0x03 0x8F 0x03 0x94
|
||||
0x39 5 0xB3 0x03 0x96 0x03 0x98
|
||||
0x39 17 0xB4 0x00 0x84 0x00 0x91 0x00
|
||||
0xA4 0x00 0xB6 0x00 0xCA 0x00 0xE9
|
||||
0x01 0x02 0x01 0x2A
|
||||
0x39 17 0xB5 0x01 0x49 0x01 0x82 0x01
|
||||
0xAF 0x01 0xF7 0x02 0x36 0x02 0x38
|
||||
0x02 0x70 0x02 0xA6
|
||||
0x39 17 0xB6 0x02 0xC8 0x02 0xF5 0x03
|
||||
0x1A 0x03 0x43 0x03 0x62 0x03 0x82
|
||||
0x03 0x8F 0x03 0x94
|
||||
0x39 5 0xB7 0x03 0x96 0x03 0x98
|
||||
0x39 17 0xB8 0x01 0x22 0x01 0x27 0x01
|
||||
0x2E 0x01 0x38 0x01 0x40 0x01 0x53
|
||||
0x01 0x60 0x01 0x7B
|
||||
0x39 17 0xB9 0x01 0x8C 0x01 0xB5 0x01
|
||||
0xD3 0x02 0x11 0x02 0x49 0x02 0x4A
|
||||
0x02 0x7F 0x02 0xB1
|
||||
0x39 17 0xBA 0x02 0xD1 0x03 0x00 0x03
|
||||
0x22 0x03 0x49 0x03 0x60 0x03 0x7A
|
||||
0x03 0x8B 0x03 0x8F
|
||||
0x39 5 0xBB 0x03 0x93 0x03 0x9A
|
||||
0x39 17 0xBC 0x00 0x37 0x00 0x48 0x00
|
||||
0x65 0x00 0x80 0x00 0x92 0x00 0xC4
|
||||
0x00 0xDE 0x01 0x05
|
||||
0x39 17 0xBD 0x01 0x31 0x01 0x6F 0x01
|
||||
0x9E 0x01 0xEE 0x02 0x32 0x02 0x34
|
||||
0x02 0x71 0x02 0xA7
|
||||
0x39 17 0xBE 0x02 0xD3 0x02 0xFE 0x03
|
||||
0x24 0x03 0x4F 0x03 0x71 0x03 0x92
|
||||
0x03 0x9B 0x03 0xA0
|
||||
0x39 5 0xBF 0x03 0xA6 0x03 0xA8
|
||||
0x39 17 0xC0 0x00 0x70 0x00 0x7D 0x00
|
||||
0x90 0x00 0xA4 0x00 0xB6 0x00 0xD5
|
||||
0x00 0xEE 0x01 0x16
|
||||
0x39 17 0xC1 0x01 0x41 0x01 0x7A 0x01
|
||||
0xAB 0x01 0xF3 0x02 0x36 0x02 0x38
|
||||
0x02 0x74 0x02 0xAA
|
||||
0x39 17 0xC2 0x02 0xD4 0x03 0x01 0x03
|
||||
0x26 0x03 0x4F 0x03 0x6E 0x03 0x8E
|
||||
0x03 0x9B 0x03 0xA0
|
||||
0x39 5 0xC3 0x03 0xA6 0x03 0xA8
|
||||
0x39 17 0xC4 0x01 0x0E 0x01 0x13 0x01
|
||||
0x1A 0x01 0x24 0x01 0x2C 0x01 0x3F
|
||||
0x01 0x4C 0x01 0x67
|
||||
0x39 17 0xC5 0x01 0x84 0x01 0xAD 0x01
|
||||
0xCF 0x02 0x0D 0x02 0x49 0x02 0x4A
|
||||
0x02 0x83 0x02 0xB5
|
||||
0x39 17 0xC6 0x02 0xDD 0x03 0x0C 0x03
|
||||
0x2E 0x03 0x55 0x03 0x6B 0x03 0x86
|
||||
0x03 0x97 0x03 0x9B
|
||||
0x39 5 0xC7 0x03 0xA1 0x03 0xA8
|
||||
0x39 6 0xF0 0x55 0xAA 0x52 0x08 0x04
|
||||
0x39 6 0xB1 0x03 0x02 0x02 0x02 0x00
|
||||
0x39 6 0xF0 0x55 0xAA 0x52 0x08 0x06
|
||||
0x39 3 0xB0 0x11 0x11
|
||||
0x39 3 0xB1 0x13 0x13
|
||||
0x39 3 0xB2 0x03 0x03
|
||||
0x39 3 0xB3 0x34 0x34
|
||||
0x39 3 0xB4 0x34 0x34
|
||||
0x39 3 0xB5 0x34 0x34
|
||||
0x39 3 0xB6 0x34 0x34
|
||||
0x39 3 0xB7 0x34 0x34
|
||||
0x39 3 0xB8 0x34 0x34
|
||||
0x39 3 0xB9 0x34 0x34
|
||||
0x39 3 0xBA 0x34 0x34
|
||||
0x39 3 0xBB 0x34 0x34
|
||||
0x39 3 0xBC 0x34 0x34
|
||||
0x39 3 0xBD 0x34 0x34
|
||||
0x39 3 0xBE 0x34 0x34
|
||||
0x39 3 0xBF 0x34 0x34
|
||||
0x39 3 0xC0 0x34 0x34
|
||||
0x39 3 0xC1 0x02 0x02
|
||||
0x39 3 0xC2 0x12 0x12
|
||||
0x39 3 0xC3 0x10 0x10
|
||||
0x39 3 0xE5 0x34 0x34
|
||||
0x39 6 0xD8 0x00 0x00 0x00 0x00 0x00
|
||||
0x39 6 0xD9 0x00 0x00 0x00 0x00 0x00
|
||||
0x39 6 0xF0 0x55 0xAA 0x52 0x08 0x05
|
||||
0x15 2 0xC0 0x03
|
||||
0x15 2 0xC1 0x02
|
||||
0x39 3 0xC8 0x01 0x20
|
||||
0x15 2 0xE5 0x03
|
||||
0x15 2 0xE6 0x03
|
||||
0x15 2 0xE7 0x03
|
||||
0x15 2 0xE8 0x03
|
||||
0x15 2 0xE9 0x03
|
||||
0x39 5 0xD1 0x03 0x00 0x3D 0x00
|
||||
0x39 6 0xF0 0x55 0xAA 0x52 0x08 0x03
|
||||
0x39 3 0xB0 0x11 0x00
|
||||
0x39 3 0xB1 0x11 0x00
|
||||
0x39 6 0xB2 0x03 0x00 0x00 0x00 0x00
|
||||
0x39 6 0xB3 0x03 0x00 0x00 0x00 0x00
|
||||
0x39 6 0xBA 0x31 0x00 0x00 0x00 0x00
|
||||
0x15 2 0x35 0x00
|
||||
0x15 2 0x51 0xFF
|
||||
0x15 2 0x53 0x2C
|
||||
0x15 2 0x55 0x03
|
||||
0x05 1 0x11
|
||||
0xff 120 /* delay 120ms */
|
||||
0x05 1 0x29
|
||||
0xff 130 /* delay 130ms */
|
||||
0xFF 0xFF>; /*ending*/
|
||||
init_off = <
|
||||
0x05 1 0x28 /* display off */
|
||||
0xff 10 /* delay 10ms */
|
||||
0x05 1 0x10 /* sleep in */
|
||||
0xff 150 /* delay 150ms */
|
||||
0xff 0xff>; /*ending*/
|
||||
};
|
||||
|
||||
extern_2{
|
||||
index = <2>;
|
||||
extern_name = "mipi_ST7701";
|
||||
extern_name = "mipi_default";/*ST7701*/
|
||||
status = "okay";
|
||||
type = <2>; /* 0=i2c, 1=spi, 2=mipi */
|
||||
init_on = <
|
||||
0x13 1 0x11
|
||||
0xff 200
|
||||
0x29 6 0xff 0x77 0x01 0x00 0x00 0x10
|
||||
0x29 3 0xc0 0xe9 0x03
|
||||
0x29 3 0xc1 0x11 0x02
|
||||
0x29 3 0xc2 0x31 0x08
|
||||
0x29 17 0xb0 0x00 0x06 0x11 0x12 0x18
|
||||
0x0a 0x0a 0x09 0x09 0x1d 0x09 0x14
|
||||
0x10 0x0e 0x11 0x19
|
||||
0x29 17 0xb1 0x00 0x06 0x11 0x11 0x15
|
||||
0x09 0x0b 0x09 0x09 0x23 0x09 0x17
|
||||
0x14 0x18 0x1e 0x19
|
||||
0x29 6 0xff 0x77 0x01 0x00 0x00 0x11
|
||||
0x23 2 0xb0 0x4d
|
||||
|
||||
0x23 2 0xb1 0x3a
|
||||
0x23 2 0xb2 0x07
|
||||
0x23 2 0xb3 0x80
|
||||
0x23 2 0xb5 0x47
|
||||
0x23 2 0xb7 0x8a
|
||||
0x23 2 0xb8 0x21
|
||||
0x23 2 0xc1 0x78
|
||||
0x23 2 0xc2 0x78
|
||||
0x23 2 0xd0 0x88
|
||||
|
||||
0xff 100
|
||||
0x29 4 0xe0 0x00 0x00 0x02
|
||||
0x29 12 0xe1 0x08 0x00 0x0a 0x00 0x07
|
||||
0x00 0x09 0x00 0x00 0x33 0x33
|
||||
0x29 14 0xe2 0x00 0x00 0x00 0x00 0x00
|
||||
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
|
||||
0x29 5 0xe3 0x00 0x00 0x33 0x33
|
||||
0x29 3 0xe4 0x44 0x44
|
||||
0x29 17 0xe5 0x0e 0x60 0xaf 0xaf 0x10
|
||||
0x60 0xaf 0xaf 0x0a 0x60 0xaf 0xaf
|
||||
0x0c 0x60 0xaf 0xaf
|
||||
0x29 5 0xe6 0x00 0x00 0x33 0x33
|
||||
0x29 3 0xe7 0x44 0x44
|
||||
0x29 17 0xe8 0x0d 0x60 0xa0 0xa0 0x0f
|
||||
0x60 0xaf 0xaf 0x09 0x60 0xaf 0xaf
|
||||
0x0b 0x60 0xaf 0xaf
|
||||
0x29 8 0xeb 0x02 0x01 0xe4 0xe4 0x44 0x00 0x40
|
||||
0x29 3 0xec 0x02 0x01
|
||||
0x29 17 0xed 0xab 0x89 0x76 0x54 0x01
|
||||
0xff 0xff 0xff 0xff 0xff 0xff 0x10
|
||||
0x45 0x67 0x98 0xba
|
||||
|
||||
0xff 10
|
||||
0x29 6 0xff 0x77 0x01 0x00 0x00 0x00
|
||||
0x13 1 0x29
|
||||
0xff 200
|
||||
0xff 0xff>; /*ending*/
|
||||
init_off = <
|
||||
0x05 1 0x28 /* display off */
|
||||
0xff 10 /* delay 10ms */
|
||||
0x05 1 0x10 /* sleep in */
|
||||
0xff 150 /* delay 150ms */
|
||||
0xff 0xff>; /*ending*/
|
||||
};
|
||||
|
||||
extern_3{
|
||||
index = <3>;
|
||||
extern_name = "mipi_P070ACB";
|
||||
extern_name = "mipi_default";/*P070ACB*/
|
||||
status = "okay";
|
||||
type = <2>; /* 0=i2c, 1=spi, 2=mipi */
|
||||
cmd_size = <0xff>;
|
||||
init_on = <
|
||||
0x29 5 0xFF 0xAA 0x55 0x25 0x01
|
||||
0x23 2 0xFC 0x08
|
||||
0xFF 1 /* delay(ms) */
|
||||
0x23 2 0xFC 0x00
|
||||
0xFF 1 /* delay(ms) */
|
||||
0x23 2 0x6F 0x21
|
||||
0x23 2 0xF7 0x01
|
||||
0xFF 1 /* delay(ms) */
|
||||
0x23 2 0x6F 0x21
|
||||
0x23 2 0xF7 0x00
|
||||
0xFF 1 /* delay(ms) */
|
||||
|
||||
0x23 2 0x6F 0x1A
|
||||
0x23 2 0xF7 0x05
|
||||
0xFF 1 /* delay(ms) */
|
||||
|
||||
0x29 5 0xFF 0xAA 0x55 0x25 0x00
|
||||
|
||||
0x29 6 0xF0 0x55 0xAA 0x52 0x08 0x00
|
||||
0x29 3 0xB1 0x68 0x41
|
||||
0x23 2 0xB5 0x88
|
||||
0x29 6 0xBD 0x02 0xB0 0x0C 0x14 0x00
|
||||
0x23 2 0xC8 0x80
|
||||
|
||||
0x29 6 0xF0 0x55 0xAA 0x52 0x08 0x01
|
||||
0x29 3 0xB3 0x2D 0x2D
|
||||
0x29 3 0xB4 0x19 0x19
|
||||
0x23 2 0xB5 0x06
|
||||
|
||||
0x29 3 0xB9 0x36 0x36
|
||||
0x29 3 0xBA 0x26 0x26
|
||||
0x29 3 0xBC 0xA8 0x01
|
||||
0x29 3 0xBD 0xAB 0x01
|
||||
0x23 2 0xC0 0x0C
|
||||
|
||||
0x29 6 0xF0 0x55 0xAA 0x52 0x08 0x02
|
||||
0x23 2 0xEE 0x02
|
||||
0x29 7 0xB0 0x00 0x50 0x00 0x52 0x00 0x73
|
||||
0x23 2 0x6F 0x06
|
||||
0x29 7 0xB0 0x00 0x8F 0x00 0xA5 0x00 0xCA
|
||||
0x23 2 0x6F 0x0C
|
||||
0x29 5 0xB0 0x00 0xEA 0x01 0x1B
|
||||
0x29 7 0xB1 0x01 0x42 0x01 0x82 0x01 0xB3
|
||||
0x23 2 0x6F 0x06
|
||||
0x29 7 0xB1 0x02 0x00 0x02 0x41 0x02 0x42
|
||||
0x23 2 0x6F 0x0C
|
||||
0x29 5 0xB1 0x02 0x78 0x02 0xB5
|
||||
0x29 7 0xB2 0x02 0xDA 0x03 0x12 0x03 0x3A
|
||||
0x23 2 0x6F 0x06
|
||||
0x29 7 0xB2 0x03 0x6E 0x03 0x8D 0x03 0xB1
|
||||
0x23 2 0x6F 0x0C
|
||||
0x29 5 0xB2 0x03 0xCA 0x03 0xE8
|
||||
0x29 5 0xB3 0x03 0xF4 0x03 0xFF
|
||||
|
||||
0x29 7 0xBC 0x00 0x05 0x00 0x52 0x00 0x73
|
||||
0x23 2 0x6F 0x06
|
||||
0x29 7 0xBC 0x00 0x8F 0x00 0xA5 0x00 0xCA
|
||||
0x23 2 0x6F 0x0C
|
||||
0x29 5 0xBC 0x00 0xEA 0x01 0x1B
|
||||
0x29 7 0xBD 0x01 0x42 0x01 0x82 0x01 0xB3
|
||||
0x23 2 0x6F 0x06
|
||||
0x29 7 0xBD 0x02 0x00 0x02 0x41 0x02 0x42
|
||||
0x23 2 0x6F 0x0C
|
||||
0x29 5 0xBD 0x02 0x78 0x02 0xB5
|
||||
0x29 7 0xBE 0x02 0xDA 0x03 0x12 0x03 0x3A
|
||||
0x23 2 0x6F 0x06
|
||||
0x29 7 0xBE 0x03 0x6E 0x03 0x8D 0x03 0xB1
|
||||
0x23 2 0x6F 0x0C
|
||||
0x29 5 0xBE 0x03 0xCA 0x03 0xE8
|
||||
0x29 5 0xBF 0x03 0xF4 0x03 0xFF
|
||||
|
||||
0x29 6 0xF0 0x55 0xAA 0x52 0x08 0x03
|
||||
0x29 6 0xB2 0x05 0x00 0x00 0x00 0x00
|
||||
0x29 6 0xB6 0x05 0x00 0x00 0x00 0x00
|
||||
0x29 6 0xB7 0x05 0x00 0x00 0x00 0x00
|
||||
0x29 6 0xBA 0x57 0x00 0x00 0x00 0x00
|
||||
0x29 6 0xBB 0x57 0x00 0x00 0x00 0x00
|
||||
0x29 5 0xC0 0x00 0x34 0x00 0x00
|
||||
0x29 5 0xC1 0x00 0x00 0x34 0x00
|
||||
0x23 2 0xC4 0x40
|
||||
|
||||
0x29 6 0xF0 0x55 0xAA 0x52 0x08 0x05
|
||||
0x29 3 0xB0 0x17 0x06
|
||||
0x29 3 0xB1 0x17 0x06
|
||||
0x29 3 0xB2 0x17 0x06
|
||||
0x29 3 0xB3 0x17 0x06
|
||||
0x29 3 0xB4 0x17 0x06
|
||||
|
||||
0x29 6 0xBD 0x03 0x01 0x03 0x03 0x01
|
||||
0x23 2 0xC0 0x05
|
||||
0x23 2 0xC4 0x82
|
||||
0x23 2 0xC5 0xA2
|
||||
0x29 3 0xC8 0x03 0x30
|
||||
0x29 3 0xC9 0x03 0x31
|
||||
0x29 4 0xCC 0x00 0x00 0x3C
|
||||
0x29 4 0xCD 0x00 0x00 0x3C
|
||||
0x29 6 0xD1 0x00 0x44 0x09 0x00 0x00
|
||||
0x29 6 0xD2 0x00 0x04 0x0B 0x00 0x00
|
||||
|
||||
0x29 6 0xF0 0x55 0xAA 0x52 0x08 0x06
|
||||
0x29 3 0xB0 0x0B 0x2D
|
||||
0x29 3 0xB1 0x2D 0x09
|
||||
0x29 3 0xB2 0x2A 0x29
|
||||
0x29 3 0xB3 0x34 0x1B
|
||||
0x29 3 0xB4 0x19 0x17
|
||||
0x29 3 0xB5 0x15 0x13
|
||||
0x29 3 0xB6 0x11 0x01
|
||||
0x29 3 0xB7 0x34 0x34
|
||||
0x29 3 0xB8 0x34 0x2D
|
||||
0x29 3 0xB9 0x2D 0x34
|
||||
0x29 3 0xBA 0x2D 0x2D
|
||||
0x29 3 0xBB 0x34 0x34
|
||||
0x29 3 0xBC 0x34 0x34
|
||||
0x29 3 0xBD 0x00 0x10
|
||||
0x29 3 0xBE 0x12 0x14
|
||||
0x29 3 0xBF 0x16 0x18
|
||||
|
||||
0x29 3 0xC0 0x1A 0x34
|
||||
0x29 3 0xC1 0x29 0x2A
|
||||
0x29 3 0xC2 0x08 0x2D
|
||||
0x29 3 0xC3 0x2D 0x0A
|
||||
0x29 3 0xC4 0x0A 0x2D
|
||||
0x29 3 0xC5 0x2D 0x00
|
||||
0x29 3 0xC6 0x2A 0x29
|
||||
0x29 3 0xC7 0x34 0x14
|
||||
0x29 3 0xC8 0x16 0x18
|
||||
0x29 3 0xC9 0x1A 0x10
|
||||
0x29 3 0xCA 0x12 0x08
|
||||
0x29 3 0xCB 0x34 0x34
|
||||
0x29 3 0xCC 0x34 0x2D
|
||||
0x29 3 0xCD 0x2D 0x34
|
||||
0x29 3 0xCE 0x2D 0x2D
|
||||
0x29 3 0xCF 0x34 0x34
|
||||
|
||||
0x29 3 0xD0 0x34 0x34
|
||||
0x29 3 0xD1 0x09 0x13
|
||||
0x29 3 0xD2 0x11 0x1B
|
||||
0x29 3 0xD3 0x19 0x17
|
||||
0x29 3 0xD4 0x15 0x34
|
||||
0x29 3 0xD5 0x29 0x2A
|
||||
0x29 3 0xD6 0x01 0x2D
|
||||
0x29 3 0xD7 0x2D 0x0B
|
||||
0x29 6 0xD8 0x00 0x00 0x00 0x00 0x00
|
||||
0x29 6 0xD9 0x00 0x00 0x00 0x00 0x00
|
||||
|
||||
0x29 3 0xE5 0x34 0x34
|
||||
0x29 3 0xE6 0x34 0x34
|
||||
0x23 2 0xE7 0x00
|
||||
0x29 3 0xE8 0x34 0x34
|
||||
0x29 3 0xE9 0x34 0x34
|
||||
0x23 2 0xEA 0x00
|
||||
|
||||
0x29 6 0xF0 0x55 0xAA 0x52 0x00 0x00
|
||||
|
||||
0x13 1 0x35
|
||||
0x13 1 0x11
|
||||
0xFF 120 /* delay(ms) */
|
||||
0x13 1 0x29
|
||||
0xFF 20 /* delay(ms) */
|
||||
0xFF 0xFF>; /*ending*/
|
||||
init_off = <
|
||||
0x05 1 0x28 /* display off */
|
||||
0xff 10 /* delay 10ms */
|
||||
0x05 1 0x10 /* sleep in */
|
||||
0xff 150 /* delay 150ms */
|
||||
0xff 0xff>; /*ending*/
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -271,9 +271,6 @@ CONFIG_AMLOGIC_LCD=y
|
||||
CONFIG_AMLOGIC_LCD_TV=y
|
||||
CONFIG_AMLOGIC_LCD_TABLET=y
|
||||
CONFIG_AMLOGIC_LCD_EXTERN=y
|
||||
CONFIG_AMLOGIC_LCD_EXTERN_MIPI_TV070WSM=y
|
||||
CONFIG_AMLOGIC_LCD_EXTERN_MIPI_P070ACB=y
|
||||
CONFIG_AMLOGIC_LCD_EXTERN_MIPI_TL050FHV02CT=y
|
||||
CONFIG_AMLOGIC_BACKLIGHT=y
|
||||
CONFIG_AMLOGIC_BL_EXTERN=y
|
||||
CONFIG_AMLOGIC_BL_EXTERN_I2C_LP8556=y
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
obj-$(CONFIG_AMLOGIC_LCD_EXTERN) += lcd_extern.o ext_default.o
|
||||
obj-$(CONFIG_AMLOGIC_LCD_EXTERN) += lcd_extern.o ext_default.o mipi_default.o
|
||||
obj-$(CONFIG_AMLOGIC_LCD_EXTERN_I2C_T5800Q) += i2c_T5800Q.o
|
||||
obj-$(CONFIG_AMLOGIC_LCD_EXTERN_SPI_LD070WS2) += spi_LD070WS2.o
|
||||
obj-$(CONFIG_AMLOGIC_LCD_EXTERN_I2C_DLPC3439) += i2c_DLPC3439.o
|
||||
@@ -6,4 +6,4 @@ obj-$(CONFIG_AMLOGIC_LCD_EXTERN_MIPI_KD080D13) += mipi_KD080D13.o
|
||||
obj-$(CONFIG_AMLOGIC_LCD_EXTERN_MIPI_TV070WSM) += mipi_TV070WSM.o
|
||||
obj-$(CONFIG_AMLOGIC_LCD_EXTERN_MIPI_ST7701) += mipi_ST7701.o
|
||||
obj-$(CONFIG_AMLOGIC_LCD_EXTERN_MIPI_P070ACB) += mipi_P070ACB.o
|
||||
obj-$(CONFIG_AMLOGIC_LCD_EXTERN_MIPI_TL050FHV02CT) += mipi_TL050FHV02CT.o
|
||||
obj-$(CONFIG_AMLOGIC_LCD_EXTERN_MIPI_TL050FHV02CT) += mipi_TL050FHV02CT.o
|
||||
@@ -410,57 +410,175 @@ static int lcd_extern_init_table_dynamic_size_load_dts(
|
||||
sprintf(propname, "init_off");
|
||||
}
|
||||
|
||||
i = 0;
|
||||
while ((i + 2) < max_len) { /* type & cmd_size detect */
|
||||
/* step1: type */
|
||||
ret = of_property_read_u32_index(of_node, propname, i, &val);
|
||||
if (ret) {
|
||||
EXTERR("get %s %s type failed, step %d\n",
|
||||
extconf->name, propname, step);
|
||||
init_table[i] = LCD_EXTERN_INIT_END;
|
||||
return -1;
|
||||
}
|
||||
init_table[i] = (unsigned char)val;
|
||||
type = init_table[i];
|
||||
if (type == LCD_EXTERN_INIT_END)
|
||||
break;
|
||||
/* step2: cmd_size */
|
||||
ret = of_property_read_u32_index(
|
||||
of_node, propname, (i+1), &val);
|
||||
if (ret) {
|
||||
EXTERR("get %s %s cmd_size failed, step %d\n",
|
||||
extconf->name, propname, step);
|
||||
init_table[i] = LCD_EXTERN_INIT_END;
|
||||
return -1;
|
||||
}
|
||||
init_table[i+1] = (unsigned char)val;
|
||||
cmd_size = init_table[i+1];
|
||||
if (cmd_size == 0) {
|
||||
i += 2;
|
||||
continue;
|
||||
}
|
||||
if ((i + 2 + cmd_size) > max_len)
|
||||
break;
|
||||
/* step3: data */
|
||||
for (j = 0; j < cmd_size; j++) {
|
||||
switch (extconf->type) {
|
||||
case LCD_EXTERN_I2C:
|
||||
case LCD_EXTERN_SPI:
|
||||
i = 0;
|
||||
while ((i + 1) < max_len) { /* type & cmd_size detect */
|
||||
/* step1: type */
|
||||
ret = of_property_read_u32_index(
|
||||
of_node, propname, (i+2+j), &val);
|
||||
of_node, propname, i, &val);
|
||||
if (ret) {
|
||||
EXTERR("get %s %s data failed, step %d\n",
|
||||
EXTERR("get %s %s type failed, step %d\n",
|
||||
extconf->name, propname, step);
|
||||
init_table[i] = LCD_EXTERN_INIT_END;
|
||||
return -1;
|
||||
}
|
||||
init_table[i+2+j] = (unsigned char)val;
|
||||
init_table[i] = (unsigned char)val;
|
||||
type = init_table[i];
|
||||
if (type == LCD_EXTERN_INIT_END)
|
||||
break;
|
||||
/* step2: cmd_size */
|
||||
ret = of_property_read_u32_index(
|
||||
of_node, propname, (i+1), &val);
|
||||
if (ret) {
|
||||
EXTERR("get %s %s cmd_size failed, step %d\n",
|
||||
extconf->name, propname, step);
|
||||
init_table[i] = LCD_EXTERN_INIT_END;
|
||||
return -1;
|
||||
}
|
||||
init_table[i+1] = (unsigned char)val;
|
||||
cmd_size = init_table[i+1];
|
||||
if (cmd_size == 0) {
|
||||
i += 2;
|
||||
continue;
|
||||
}
|
||||
if ((i + 2 + cmd_size) > max_len) {
|
||||
EXTERR("%s %s cmd_size out of max, step %d\n",
|
||||
extconf->name, propname, step);
|
||||
init_table[i] = LCD_EXTERN_INIT_END;
|
||||
init_table[i+1] = 0;
|
||||
break;
|
||||
}
|
||||
/* step3: data */
|
||||
for (j = 0; j < cmd_size; j++) {
|
||||
ret = of_property_read_u32_index(
|
||||
of_node, propname, (i+2+j), &val);
|
||||
if (ret) {
|
||||
EXTERR("get %s%s data failed,step%d\n",
|
||||
extconf->name, propname, step);
|
||||
init_table[i] = LCD_EXTERN_INIT_END;
|
||||
return -1;
|
||||
}
|
||||
init_table[i+2+j] = (unsigned char)val;
|
||||
}
|
||||
if (type == LCD_EXTERN_INIT_GPIO) {
|
||||
/* gpio probe */
|
||||
index = init_table[i+2];
|
||||
if (index < LCD_EXTERN_GPIO_NUM_MAX)
|
||||
lcd_extern_gpio_probe(index);
|
||||
}
|
||||
step++;
|
||||
i += (cmd_size + 2);
|
||||
}
|
||||
if (type == LCD_EXTERN_INIT_GPIO) {
|
||||
/* gpio probe */
|
||||
index = init_table[i+2];
|
||||
if (index < LCD_EXTERN_GPIO_NUM_MAX)
|
||||
lcd_extern_gpio_probe(index);
|
||||
break;
|
||||
case LCD_EXTERN_MIPI:
|
||||
i = 0;
|
||||
while ((i + 1) < max_len) { /* type & cmd_size detect */
|
||||
ret = of_property_read_u32_index(
|
||||
of_node, propname, i, &val);
|
||||
if (ret) {
|
||||
EXTERR("get %s %s type failed\n",
|
||||
extconf->name, propname);
|
||||
init_table[i] = 0xff;
|
||||
init_table[i+1] = 0xff;
|
||||
return -1;
|
||||
}
|
||||
init_table[i] = (unsigned char)val;
|
||||
type = (unsigned char)val;
|
||||
if (type == 0xff) {
|
||||
ret = of_property_read_u32_index(
|
||||
of_node, propname, (i+1), &val);
|
||||
if (ret) {
|
||||
EXTERR("get %s %s cmd_size failed\n",
|
||||
extconf->name, propname);
|
||||
init_table[i] = 0xff;
|
||||
init_table[i+1] = 0xff;
|
||||
return -1;
|
||||
}
|
||||
init_table[i+1] = (unsigned char)val;
|
||||
cmd_size = init_table[i+1];
|
||||
if (cmd_size == 0xff)
|
||||
break;
|
||||
i += 2;
|
||||
} else if (type == 0xf0) {
|
||||
ret = of_property_read_u32_index(
|
||||
of_node, propname, (i+1), &val);
|
||||
if (ret) {
|
||||
EXTERR("get %s %s type failed\n",
|
||||
extconf->name, propname);
|
||||
init_table[i+1] = 0xff;
|
||||
return -1;
|
||||
}
|
||||
/* gpio probe */
|
||||
init_table[i+1] = val;
|
||||
cmd_size = val;
|
||||
if (cmd_size < 3) {
|
||||
EXTERR("%s %s invalid cmd_size gpio\n",
|
||||
extconf->name, propname);
|
||||
return -1;
|
||||
}
|
||||
if ((i + 2 + cmd_size) >= max_len) {
|
||||
EXTERR("%s %s cmd_size out of max\n",
|
||||
extconf->name, propname);
|
||||
init_table[i] = 0xff;
|
||||
init_table[i+1] = 0xff;
|
||||
return -1;
|
||||
}
|
||||
for (j = 0; j < cmd_size; j++) {
|
||||
ret = of_property_read_u32_index(
|
||||
of_node, propname,
|
||||
(i+2+j), &val);
|
||||
if (ret) {
|
||||
EXTERR("get %s %s failed\n",
|
||||
extconf->name,
|
||||
propname);
|
||||
init_table[i] = 0xff;
|
||||
init_table[i+1] = 0xff;
|
||||
return -1;
|
||||
}
|
||||
init_table[i+2+j] = (unsigned char)val;
|
||||
}
|
||||
index = init_table[i+2];
|
||||
if (index < LCD_EXTERN_GPIO_NUM_MAX)
|
||||
lcd_extern_gpio_probe(index);
|
||||
i += (cmd_size + 2);
|
||||
} else {
|
||||
ret = of_property_read_u32_index(
|
||||
of_node, propname, (i+1), &val);
|
||||
init_table[i+1] = val;
|
||||
cmd_size = val;
|
||||
if (cmd_size == 0) {
|
||||
i += 2;
|
||||
continue;
|
||||
}
|
||||
if ((i + 2 + cmd_size) >= max_len) {
|
||||
EXTERR("%s %s cmd_size out of max\n",
|
||||
extconf->name, propname);
|
||||
init_table[i] = 0xff;
|
||||
init_table[i+1] = 0xff;
|
||||
return -1;
|
||||
}
|
||||
for (j = 0; j < cmd_size; j++) {
|
||||
ret = of_property_read_u32_index(
|
||||
of_node, propname,
|
||||
(i+2+j), &val);
|
||||
if (ret) {
|
||||
EXTERR("%s %s failed\n",
|
||||
extconf->name,
|
||||
propname);
|
||||
init_table[i] = 0xff;
|
||||
init_table[i+1] = 0xff;
|
||||
return -1;
|
||||
}
|
||||
init_table[i+2+j] = (unsigned char)val;
|
||||
}
|
||||
i += (cmd_size + 2);
|
||||
}
|
||||
}
|
||||
step++;
|
||||
i += (cmd_size + 2);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -487,7 +605,13 @@ static int lcd_extern_init_table_fixed_size_load_dts(
|
||||
}
|
||||
|
||||
i = 0;
|
||||
while ((i + cmd_size) <= max_len) { /* group detect */
|
||||
while (i < max_len) { /* group detect */
|
||||
if ((i + cmd_size) >= max_len) {
|
||||
EXTERR("%s %s cmd_size out of max\n",
|
||||
extconf->name, propname);
|
||||
init_table[i] = LCD_EXTERN_INIT_END;
|
||||
break;
|
||||
}
|
||||
for (j = 0; j < cmd_size; j++) {
|
||||
ret = of_property_read_u32_index(
|
||||
of_node, propname, (i+j), &val);
|
||||
@@ -523,6 +647,7 @@ static int lcd_extern_get_config_dts(struct device_node *of_node,
|
||||
|
||||
extconf->index = LCD_EXTERN_INDEX_INVALID;
|
||||
extconf->type = LCD_EXTERN_MAX;
|
||||
extconf->status = 0;
|
||||
extconf->table_init_loaded = 0;
|
||||
|
||||
ret = of_property_read_u32(of_node, "index", &val);
|
||||
@@ -531,6 +656,11 @@ static int lcd_extern_get_config_dts(struct device_node *of_node,
|
||||
return -1;
|
||||
}
|
||||
extconf->index = (unsigned char)val;
|
||||
if (extconf->index == LCD_EXTERN_INDEX_INVALID) {
|
||||
if (lcd_debug_print_flag)
|
||||
EXTPR("index %d is invalid\n", extconf->index);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = of_property_read_string(of_node, "status", &str);
|
||||
if (ret) {
|
||||
@@ -757,6 +887,31 @@ static int lcd_extern_get_config_dts(struct device_node *of_node,
|
||||
extconf->table_init_loaded = 1;
|
||||
break;
|
||||
case LCD_EXTERN_MIPI:
|
||||
ret = of_property_read_u32(of_node, "cmd_size", &val);
|
||||
if (ret) {
|
||||
EXTPR("%s no cmd_size\n", extconf->name);
|
||||
extconf->cmd_size = 0;
|
||||
} else {
|
||||
extconf->cmd_size = (unsigned char)val;
|
||||
}
|
||||
if (lcd_debug_print_flag) {
|
||||
EXTPR("%s(%d) cmd_size=%d\n",
|
||||
extconf->name, extconf->index,
|
||||
extconf->cmd_size);
|
||||
}
|
||||
if (extconf->cmd_size != LCD_EXTERN_CMD_SIZE_DYNAMIC) {
|
||||
EXTERR("cmd_size %d is invalid\n",
|
||||
extconf->cmd_size);
|
||||
break;
|
||||
}
|
||||
ret = lcd_extern_init_table_dynamic_size_load_dts(
|
||||
of_node, extconf, 1);
|
||||
if (ret)
|
||||
break;
|
||||
ret = lcd_extern_init_table_dynamic_size_load_dts(
|
||||
of_node, extconf, 0);
|
||||
if (ret == 0)
|
||||
extconf->table_init_loaded = 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -798,66 +953,197 @@ static int lcd_extern_init_table_dynamic_size_load_unifykey(
|
||||
sprintf(propname, "init_off");
|
||||
buf = p + extconf->table_init_on_cnt;
|
||||
}
|
||||
switch (extconf->type) {
|
||||
case LCD_EXTERN_I2C:
|
||||
case LCD_EXTERN_SPI:
|
||||
i = 0;
|
||||
while ((i + 1) < max_len) { /* type & cmd_size detect */
|
||||
/* step1: type */
|
||||
len += 1;
|
||||
ret = lcd_unifykey_len_check(key_len, len);
|
||||
if (ret) {
|
||||
EXTERR("get %s %s failed\n",
|
||||
extconf->name, propname);
|
||||
init_table[i] = LCD_EXTERN_INIT_END;
|
||||
return -1;
|
||||
}
|
||||
init_table[i] = *(buf + LCD_UKEY_EXT_INIT + i);
|
||||
if (init_table[i] == LCD_EXTERN_INIT_END)
|
||||
break;
|
||||
|
||||
i = 0;
|
||||
while (i < max_len) { /* type & cmd_size detect */
|
||||
/* step1: type */
|
||||
len += 1;
|
||||
ret = lcd_unifykey_len_check(key_len, len);
|
||||
if (ret) {
|
||||
EXTERR("get %s %s failed\n",
|
||||
extconf->name, propname);
|
||||
init_table[i] = LCD_EXTERN_INIT_END;
|
||||
return -1;
|
||||
}
|
||||
init_table[i] = *(buf + LCD_UKEY_EXT_INIT + i);
|
||||
if (init_table[i] == LCD_EXTERN_INIT_END)
|
||||
break;
|
||||
/* step2: cmd_size */
|
||||
len += 1;
|
||||
ret = lcd_unifykey_len_check(key_len, len);
|
||||
if (ret) {
|
||||
EXTERR("get %s %s failed\n",
|
||||
extconf->name, propname);
|
||||
init_table[i] = LCD_EXTERN_INIT_END;
|
||||
init_table[i+1] = 0;
|
||||
return -1;
|
||||
}
|
||||
init_table[i+1] = *(buf + LCD_UKEY_EXT_INIT + i + 1);
|
||||
cmd_size = init_table[i+1];
|
||||
if (cmd_size == 0) {
|
||||
i += 2;
|
||||
continue;
|
||||
}
|
||||
if ((i + 2 + cmd_size) > max_len) {
|
||||
EXTERR("%s %s cmd_size out of max\n",
|
||||
extconf->name, propname);
|
||||
init_table[i] = LCD_EXTERN_INIT_END;
|
||||
init_table[i+1] = 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* step2: cmd_size */
|
||||
len += 1;
|
||||
ret = lcd_unifykey_len_check(key_len, len);
|
||||
if (ret) {
|
||||
EXTERR("get %s %s failed\n",
|
||||
extconf->name, propname);
|
||||
init_table[i] = LCD_EXTERN_INIT_END;
|
||||
return -1;
|
||||
/* step3: data */
|
||||
len += cmd_size;
|
||||
ret = lcd_unifykey_len_check(key_len, len);
|
||||
if (ret) {
|
||||
EXTERR("get %s %s failed\n",
|
||||
extconf->name, propname);
|
||||
init_table[i] = LCD_EXTERN_INIT_END;
|
||||
for (j = 0; j < cmd_size; j++)
|
||||
init_table[i+2+j] = 0x0;
|
||||
return -1;
|
||||
}
|
||||
for (j = 0; j < cmd_size; j++) {
|
||||
init_table[i+2+j] =
|
||||
*(buf + LCD_UKEY_EXT_INIT + i + 2 + j);
|
||||
}
|
||||
if (init_table[i] == LCD_EXTERN_INIT_END) {
|
||||
break;
|
||||
} else if (init_table[i] == LCD_EXTERN_INIT_GPIO) {
|
||||
/* gpio probe */
|
||||
index = init_table[i+1];
|
||||
if (index < LCD_EXTERN_GPIO_NUM_MAX)
|
||||
lcd_extern_gpio_probe(index);
|
||||
}
|
||||
i += (cmd_size + 2);
|
||||
}
|
||||
init_table[i+1] = *(buf + LCD_UKEY_EXT_INIT + i + 1);
|
||||
cmd_size = init_table[i+1];
|
||||
if (cmd_size == 0) {
|
||||
i += 2;
|
||||
continue;
|
||||
if (flag)
|
||||
extconf->table_init_on_cnt = i + 2;
|
||||
break;
|
||||
case LCD_EXTERN_MIPI:
|
||||
i = 0;
|
||||
while ((i + 1) < max_len) { /* type & cmd_size detect */
|
||||
/* step1: type */
|
||||
len += 1;
|
||||
ret = lcd_unifykey_len_check(key_len, len);
|
||||
if (ret) {
|
||||
EXTERR("get %s %s failed\n",
|
||||
extconf->name, propname);
|
||||
init_table[i] = 0xff;
|
||||
init_table[i+1] = 0xff;
|
||||
return -1;
|
||||
}
|
||||
init_table[i] = *(buf + LCD_UKEY_EXT_INIT + i);
|
||||
if (init_table[i] == 0xff) {
|
||||
len += 1;
|
||||
ret = lcd_unifykey_len_check(key_len, len);
|
||||
if (ret) {
|
||||
EXTERR("get %s %s failed\n",
|
||||
extconf->name, propname);
|
||||
init_table[i+1] = 0xff;
|
||||
init_table[i+1] = 0xff;
|
||||
return -1;
|
||||
}
|
||||
init_table[i+1] =
|
||||
*(buf + LCD_UKEY_EXT_INIT + i + 1);
|
||||
cmd_size = init_table[i+1];
|
||||
if (cmd_size == 0xff)
|
||||
break;
|
||||
i += 2;
|
||||
} else if (init_table[i] == 0xf0) {
|
||||
len += 1;
|
||||
ret = lcd_unifykey_len_check(key_len, len);
|
||||
if (ret) {
|
||||
EXTERR("get %s %s failed\n",
|
||||
extconf->name, propname);
|
||||
init_table[i+1] = 0xff;
|
||||
init_table[i+1] = 0xff;
|
||||
return -1;
|
||||
}
|
||||
init_table[i+1] =
|
||||
*(buf + LCD_UKEY_EXT_INIT + i + 1);
|
||||
/* gpio probe */
|
||||
cmd_size = *(buf + LCD_UKEY_EXT_INIT + i + 1);
|
||||
if (cmd_size < 3) {
|
||||
EXTERR("%s %s wrong cmd_size %d gpio\n",
|
||||
extconf->name, propname,
|
||||
cmd_size);
|
||||
return -1;
|
||||
}
|
||||
if ((i + 2 + cmd_size) >= max_len) {
|
||||
EXTERR("%s %s cmd_size out of max\n",
|
||||
extconf->name, propname);
|
||||
init_table[i] = 0xff;
|
||||
init_table[i+1] = 0xff;
|
||||
return -1;
|
||||
}
|
||||
len += cmd_size;
|
||||
ret = lcd_unifykey_len_check(key_len, len);
|
||||
if (ret) {
|
||||
EXTERR("get %s %s failed\n",
|
||||
extconf->name, propname);
|
||||
init_table[i] = LCD_EXTERN_INIT_END;
|
||||
for (j = 0; j < cmd_size; j++)
|
||||
init_table[i+2+j] = 0x0;
|
||||
return -1;
|
||||
}
|
||||
for (j = 0; j < cmd_size; j++) {
|
||||
init_table[i+2+j] = *(buf +
|
||||
LCD_UKEY_EXT_INIT + i + 2 + j);
|
||||
}
|
||||
index = init_table[i+2];
|
||||
if (index < LCD_EXTERN_GPIO_NUM_MAX)
|
||||
lcd_extern_gpio_probe(index);
|
||||
i += (cmd_size + 2);
|
||||
} else {
|
||||
len += 1;
|
||||
ret = lcd_unifykey_len_check(key_len, len);
|
||||
if (ret) {
|
||||
EXTERR("get %s %s failed\n",
|
||||
extconf->name, propname);
|
||||
init_table[i+1] = 0xff;
|
||||
return -1;
|
||||
}
|
||||
init_table[i+1] = *(buf + LCD_UKEY_EXT_INIT
|
||||
+ i + 1);
|
||||
cmd_size = *(buf + LCD_UKEY_EXT_INIT + i + 1);
|
||||
if (cmd_size == 0) {
|
||||
i += 2;
|
||||
continue;
|
||||
}
|
||||
if ((i + 2 + cmd_size) >= max_len) {
|
||||
EXTERR("%s %s cmd_size out of max\n",
|
||||
extconf->name, propname);
|
||||
init_table[i] = 0xff;
|
||||
init_table[i+1] = 0xff;
|
||||
return -1;
|
||||
}
|
||||
len += cmd_size;
|
||||
ret = lcd_unifykey_len_check(key_len, len);
|
||||
if (ret) {
|
||||
EXTERR("get %s %s failed\n",
|
||||
extconf->name, propname);
|
||||
init_table[i] = LCD_EXTERN_INIT_END;
|
||||
for (j = 0; j < cmd_size; j++)
|
||||
init_table[i+2+j] = 0xff;
|
||||
return -1;
|
||||
}
|
||||
for (j = 0; j < cmd_size; j++) {
|
||||
init_table[i+2+j] = *(buf +
|
||||
LCD_UKEY_EXT_INIT + i + 2 + j);
|
||||
}
|
||||
i += (cmd_size + 2);
|
||||
}
|
||||
}
|
||||
if ((i + 2 + cmd_size) > max_len)
|
||||
break;
|
||||
|
||||
/* step3: data */
|
||||
len += cmd_size;
|
||||
ret = lcd_unifykey_len_check(key_len, len);
|
||||
if (ret) {
|
||||
EXTERR("get %s %s failed\n",
|
||||
extconf->name, propname);
|
||||
init_table[i] = LCD_EXTERN_INIT_END;
|
||||
for (j = 0; j < cmd_size; j++)
|
||||
init_table[i+2+j] = 0x0;
|
||||
return -1;
|
||||
}
|
||||
for (j = 0; j < cmd_size; j++)
|
||||
init_table[i+2+j] = *(buf +
|
||||
LCD_UKEY_EXT_INIT + i + 2 + j);
|
||||
if (init_table[i] == LCD_EXTERN_INIT_END) {
|
||||
break;
|
||||
} else if (init_table[i] == LCD_EXTERN_INIT_GPIO) {
|
||||
/* gpio probe */
|
||||
index = init_table[i+1];
|
||||
if (index < LCD_EXTERN_GPIO_NUM_MAX)
|
||||
lcd_extern_gpio_probe(index);
|
||||
}
|
||||
i += (cmd_size + 2);
|
||||
if (flag)
|
||||
extconf->table_init_on_cnt = i + 2;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (flag)
|
||||
extconf->table_init_on_cnt = i + 2;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -887,6 +1173,12 @@ static int lcd_extern_init_table_fixed_size_load_unifykey(
|
||||
|
||||
i = 0;
|
||||
while (i < max_len) {
|
||||
if ((i + cmd_size) >= max_len) {
|
||||
EXTERR("%s %s cmd_size out of max\n",
|
||||
extconf->name, propname);
|
||||
init_table[i] = LCD_EXTERN_INIT_END;
|
||||
return -1;
|
||||
}
|
||||
len += cmd_size;
|
||||
ret = lcd_unifykey_len_check(key_len, len);
|
||||
if (ret) {
|
||||
@@ -969,6 +1261,13 @@ static int lcd_extern_get_config_unifykey(struct lcd_extern_config_s *extconf)
|
||||
extconf->type = *(p + LCD_UKEY_EXT_TYPE);
|
||||
extconf->status = *(p + LCD_UKEY_EXT_STATUS);
|
||||
|
||||
if (extconf->index == LCD_EXTERN_INDEX_INVALID) {
|
||||
if (lcd_debug_print_flag)
|
||||
EXTPR("index %d is invalid\n", extconf->index);
|
||||
kfree(para);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* type: 10byte */
|
||||
switch (extconf->type) {
|
||||
case LCD_EXTERN_I2C:
|
||||
@@ -1049,8 +1348,23 @@ static int lcd_extern_get_config_unifykey(struct lcd_extern_config_s *extconf)
|
||||
extconf->table_init_loaded = 1;
|
||||
break;
|
||||
case LCD_EXTERN_MIPI:
|
||||
/* init */
|
||||
/* to do */
|
||||
extconf->cmd_size = *(p + LCD_UKEY_EXT_TYPE_VAL_0);
|
||||
if (lcd_debug_print_flag) {
|
||||
EXTPR("%s cmd_size=%d\n",
|
||||
extconf->name, extconf->cmd_size);
|
||||
}
|
||||
if (extconf->cmd_size != LCD_EXTERN_CMD_SIZE_DYNAMIC) {
|
||||
EXTERR("cmd_size %d is invalid\n", extconf->cmd_size);
|
||||
break;
|
||||
}
|
||||
ret = lcd_extern_init_table_dynamic_size_load_unifykey(
|
||||
extconf, p, key_len, len, 1);
|
||||
if (ret)
|
||||
break;
|
||||
ret = lcd_extern_init_table_dynamic_size_load_unifykey(
|
||||
extconf, p, key_len, len, 0);
|
||||
if (ret == 0)
|
||||
extconf->table_init_loaded = 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -1162,14 +1476,11 @@ static int lcd_extern_add_i2c(struct aml_lcd_extern_driver_s *ext_drv)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (strcmp(ext_drv->config.name, "ext_default") == 0) {
|
||||
#ifdef LCD_EXTERN_DEFAULT_ENABLE
|
||||
if (ext_drv->config.index == 0) {
|
||||
ret = aml_lcd_extern_default_probe(ext_drv);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (strcmp(ext_drv->config.name, "i2c_T5800Q") == 0) {
|
||||
} else if (strcmp(ext_drv->config.name, "i2c_T5800Q") == 0) {
|
||||
#ifdef CONFIG_AMLOGIC_LCD_EXTERN_I2C_T5800Q
|
||||
ret = aml_lcd_extern_i2c_T5800Q_probe(ext_drv);
|
||||
#endif
|
||||
@@ -1196,14 +1507,11 @@ static int lcd_extern_add_spi(struct aml_lcd_extern_driver_s *ext_drv)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (strcmp(ext_drv->config.name, "ext_default") == 0) {
|
||||
#ifdef LCD_EXTERN_DEFAULT_ENABLE
|
||||
if (ext_drv->config.index == 0) {
|
||||
ret = aml_lcd_extern_default_probe(ext_drv);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (strcmp(ext_drv->config.name, "spi_LD070WS2") == 0) {
|
||||
} else if (strcmp(ext_drv->config.name, "spi_LD070WS2") == 0) {
|
||||
#ifdef CONFIG_AMLOGIC_LCD_EXTERN_SPI_LD070WS2
|
||||
ret = aml_lcd_extern_spi_LD070WS2_probe(ext_drv);
|
||||
#endif
|
||||
@@ -1218,14 +1526,9 @@ static int lcd_extern_add_mipi(struct aml_lcd_extern_driver_s *ext_drv)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
#ifdef LCD_EXTERN_DEFAULT_ENABLE
|
||||
if (ext_drv->config.index == 0) {
|
||||
ret = aml_lcd_extern_default_probe(ext_drv);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (strcmp(ext_drv->config.name, "mipi_N070ICN") == 0) {
|
||||
if (strcmp(ext_drv->config.name, "mipi_default") == 0) {
|
||||
ret = aml_lcd_extern_mipi_default_probe(ext_drv);
|
||||
} else if (strcmp(ext_drv->config.name, "mipi_N070ICN") == 0) {
|
||||
#ifdef CONFIG_AMLOGIC_LCD_EXTERN_MIPI_N070ICN
|
||||
ret = aml_lcd_extern_mipi_N070ICN_probe(ext_drv);
|
||||
#endif
|
||||
@@ -1292,6 +1595,7 @@ static int lcd_extern_add_driver(struct lcd_extern_config_s *extconf)
|
||||
strcpy(ext_drv->config.name, extconf->name);
|
||||
ext_drv->config.type = extconf->type;
|
||||
ext_drv->config.status = extconf->status;
|
||||
ext_drv->config.cmd_size = extconf->cmd_size;
|
||||
ext_drv->config.table_init_on = NULL;
|
||||
ext_drv->config.table_init_off = NULL;
|
||||
ext_drv->config.table_init_loaded = extconf->table_init_loaded;
|
||||
@@ -1329,7 +1633,6 @@ static int lcd_extern_add_driver(struct lcd_extern_config_s *extconf)
|
||||
ext_drv->config.i2c_sck_gpio_off = extconf->i2c_sck_gpio_off;
|
||||
ext_drv->config.i2c_sda_gpio = extconf->i2c_sda_gpio;
|
||||
ext_drv->config.i2c_sda_gpio_off = extconf->i2c_sda_gpio_off;
|
||||
ext_drv->config.cmd_size = extconf->cmd_size;
|
||||
ret = lcd_extern_add_i2c(ext_drv);
|
||||
break;
|
||||
case LCD_EXTERN_SPI:
|
||||
@@ -1338,7 +1641,6 @@ static int lcd_extern_add_driver(struct lcd_extern_config_s *extconf)
|
||||
ext_drv->config.spi_gpio_data = extconf->spi_gpio_data;
|
||||
ext_drv->config.spi_clk_freq = extconf->spi_clk_freq;
|
||||
ext_drv->config.spi_clk_pol = extconf->spi_clk_pol;
|
||||
ext_drv->config.cmd_size = extconf->cmd_size;
|
||||
ret = lcd_extern_add_spi(ext_drv);
|
||||
break;
|
||||
case LCD_EXTERN_MIPI:
|
||||
@@ -1397,21 +1699,70 @@ static void lcd_extern_init_table_dynamic_size_print(
|
||||
}
|
||||
|
||||
i = 0;
|
||||
while (i < max_len) {
|
||||
if (init_table[i] == LCD_EXTERN_INIT_END)
|
||||
break;
|
||||
|
||||
cmd_size = init_table[i+1];
|
||||
k = snprintf(str, EXT_LEN_MAX, " 0x%02x %d",
|
||||
init_table[i], cmd_size);
|
||||
if (cmd_size > 0) {
|
||||
for (j = 0; j < cmd_size; j++) {
|
||||
k += snprintf(str+k, EXT_LEN_MAX, " 0x%02x",
|
||||
init_table[i+2+j]);
|
||||
switch (econf->type) {
|
||||
case LCD_EXTERN_I2C:
|
||||
case LCD_EXTERN_SPI:
|
||||
while ((i + 1) < max_len) {
|
||||
if (init_table[i] == LCD_EXTERN_INIT_END) {
|
||||
pr_info(" 0x%02x,%d,\n",
|
||||
init_table[i], init_table[i+1]);
|
||||
break;
|
||||
}
|
||||
|
||||
cmd_size = init_table[i+1];
|
||||
k = snprintf(str, EXT_LEN_MAX, " 0x%02x,%d,",
|
||||
init_table[i], cmd_size);
|
||||
if (cmd_size > 0) {
|
||||
for (j = 0; j < cmd_size; j++) {
|
||||
k += snprintf(str+k, EXT_LEN_MAX,
|
||||
"0x%02x,",
|
||||
init_table[i+2+j]);
|
||||
}
|
||||
}
|
||||
pr_info("%s\n", str);
|
||||
i += (cmd_size + 2);
|
||||
}
|
||||
pr_info("%s\n", str);
|
||||
i += (cmd_size + 2);
|
||||
break;
|
||||
case LCD_EXTERN_MIPI:
|
||||
while ((i + 1) < max_len) {
|
||||
if (init_table[i] == 0xff) { /* ctrl flag */
|
||||
cmd_size = 0;
|
||||
if (init_table[i+1] == 0xff) {
|
||||
pr_info(" 0x%02x,0x%02x,\n",
|
||||
init_table[i], init_table[i+1]);
|
||||
break;
|
||||
}
|
||||
pr_info(" 0x%02x,%d,\n",
|
||||
init_table[i], init_table[i+1]);
|
||||
} else if (init_table[i] == 0xf0) { /* gpio */
|
||||
cmd_size = init_table[i+DSI_CMD_SIZE_INDEX];
|
||||
k = snprintf(str, EXT_LEN_MAX, " 0x%02x,%d,",
|
||||
init_table[i], cmd_size);
|
||||
for (j = 0; j < cmd_size; j++) {
|
||||
k += snprintf(str+k, EXT_LEN_MAX,
|
||||
"%d,", init_table[i+2+j]);
|
||||
}
|
||||
pr_info("%s\n", str);
|
||||
} else if ((init_table[i] & 0xf) == 0x0) {
|
||||
pr_info(" init_%s wrong data_type: 0x%02x\n",
|
||||
flag ? "on" : "off", init_table[i]);
|
||||
break;
|
||||
} else {
|
||||
cmd_size = init_table[i+DSI_CMD_SIZE_INDEX];
|
||||
k = snprintf(str, EXT_LEN_MAX, " 0x%02x,%d,",
|
||||
init_table[i], cmd_size);
|
||||
for (j = 0; j < cmd_size; j++) {
|
||||
k += snprintf(str+k, EXT_LEN_MAX,
|
||||
"0x%02x,",
|
||||
init_table[i+2+j]);
|
||||
}
|
||||
pr_info("%s\n", str);
|
||||
}
|
||||
i += (cmd_size + 2);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
kfree(str);
|
||||
}
|
||||
@@ -1447,15 +1798,15 @@ static void lcd_extern_init_table_fixed_size_print(
|
||||
|
||||
i = 0;
|
||||
while (i < max_len) {
|
||||
if (init_table[i] == LCD_EXTERN_INIT_END)
|
||||
break;
|
||||
|
||||
k = snprintf(str, EXT_LEN_MAX, " ");
|
||||
for (j = 0; j < cmd_size; j++) {
|
||||
k += snprintf(str+k, EXT_LEN_MAX, " 0x%02x",
|
||||
init_table[i+j]);
|
||||
}
|
||||
pr_info("%s\n", str);
|
||||
|
||||
if (init_table[i] == LCD_EXTERN_INIT_END)
|
||||
break;
|
||||
i += cmd_size;
|
||||
}
|
||||
kfree(str);
|
||||
@@ -1517,7 +1868,12 @@ static void lcd_extern_config_dump(struct aml_lcd_extern_driver_s *ext_drv)
|
||||
}
|
||||
break;
|
||||
case LCD_EXTERN_MIPI:
|
||||
pr_info("type: mipi(%d)\n", econf->type);
|
||||
pr_info("type: mipi(%d)\n", econf->type);
|
||||
pr_info("cmd_size: %d\n", econf->cmd_size);
|
||||
if (econf->cmd_size != LCD_EXTERN_CMD_SIZE_DYNAMIC)
|
||||
break;
|
||||
lcd_extern_init_table_dynamic_size_print(econf, 1);
|
||||
lcd_extern_init_table_dynamic_size_print(econf, 0);
|
||||
break;
|
||||
default:
|
||||
pr_info("not support extern_type\n");
|
||||
|
||||
@@ -87,6 +87,8 @@ extern int aml_lcd_extern_mipi_p070acb_probe(
|
||||
extern int aml_lcd_extern_mipi_tl050fhv02ct_probe(
|
||||
struct aml_lcd_extern_driver_s *ext_drv);
|
||||
#endif
|
||||
extern int aml_lcd_extern_mipi_default_probe(
|
||||
struct aml_lcd_extern_driver_s *ext_drv);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
88
drivers/amlogic/media/vout/lcd/lcd_extern/mipi_default.c
Normal file
88
drivers/amlogic/media/vout/lcd/lcd_extern/mipi_default.c
Normal file
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* drivers/amlogic/media/vout/lcd/lcd_extern/mipi_default.c
|
||||
*
|
||||
* Copyright (C) 2017 Amlogic, Inc. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/amlogic/media/vout/lcd/lcd_extern.h>
|
||||
#include "lcd_extern.h"
|
||||
|
||||
|
||||
#define LCD_EXTERN_INDEX 0
|
||||
#define LCD_EXTERN_NAME "mipi_default"
|
||||
#define LCD_EXTERN_TYPE LCD_EXTERN_MIPI
|
||||
|
||||
/******************** mipi command ********************/
|
||||
/**format: data_type, num, data**/
|
||||
/*special: data_type=0xff, num<0xff means delay ms, num=0xff means ending.*/
|
||||
static unsigned char mipi_init_on_table[] = {
|
||||
0x05, 1, 0x11,
|
||||
0xff, 200,
|
||||
0x05, 1, 0x29,
|
||||
0xff, 20,
|
||||
0xFF, 0xFF, /* ending flag */
|
||||
};
|
||||
|
||||
static unsigned char mipi_init_off_table[] = {
|
||||
0x05, 1, 0x28, /* display off */
|
||||
0xFF, 10, /* delay 10ms */
|
||||
0x05, 1, 0x10, /* sleep in */
|
||||
0xFF, 150, /* delay 150ms */
|
||||
0xFF, 0xFF, /* ending flag */
|
||||
};
|
||||
|
||||
static int lcd_extern_driver_update(struct aml_lcd_extern_driver_s *ext_drv)
|
||||
{
|
||||
if (ext_drv == NULL) {
|
||||
EXTERR("%s driver is null\n", LCD_EXTERN_NAME);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (ext_drv->config.type == LCD_EXTERN_MAX) { //default for no dt
|
||||
ext_drv->config.index = LCD_EXTERN_INDEX;
|
||||
ext_drv->config.type = LCD_EXTERN_TYPE;
|
||||
strcpy(ext_drv->config.name, LCD_EXTERN_NAME);
|
||||
|
||||
ext_drv->config.table_init_on = &mipi_init_on_table[0];
|
||||
ext_drv->config.table_init_off = &mipi_init_off_table[0];
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int aml_lcd_extern_mipi_default_get_default_index(void)
|
||||
{
|
||||
return LCD_EXTERN_INDEX;
|
||||
}
|
||||
|
||||
int aml_lcd_extern_mipi_default_probe(
|
||||
struct aml_lcd_extern_driver_s *ext_drv)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
ret = lcd_extern_driver_update(ext_drv);
|
||||
|
||||
if (lcd_debug_print_flag)
|
||||
EXTPR("%s: %d\n", __func__, ret);
|
||||
return ret;
|
||||
}
|
||||
@@ -112,68 +112,38 @@ static void mipi_dsi_init_table_print(struct dsi_config_s *dconf, int on_off)
|
||||
}
|
||||
i = 0;
|
||||
n = 0;
|
||||
while (i < n_max) {
|
||||
while ((i + 1) < n_max) {
|
||||
if (dsi_table[i] == 0xff) { /* ctrl flag */
|
||||
n = 2;
|
||||
n = 0;
|
||||
if (dsi_table[i+1] == 0xff) {
|
||||
pr_info(" 0x%02x,0x%02x,\n",
|
||||
dsi_table[i], dsi_table[i+1]);
|
||||
break;
|
||||
} else {
|
||||
pr_info(" 0x%02x,%d,\n",
|
||||
dsi_table[i], dsi_table[i+1]);
|
||||
}
|
||||
pr_info(" 0x%02x,%d,\n",
|
||||
dsi_table[i], dsi_table[i+1]);
|
||||
} else if (dsi_table[i] == 0xf0) { /* gpio */
|
||||
n = (DSI_CMD_SIZE_INDEX + 1) +
|
||||
dsi_table[i+DSI_CMD_SIZE_INDEX];
|
||||
len = 0;
|
||||
n = dsi_table[i+DSI_CMD_SIZE_INDEX];
|
||||
len = sprintf(str, " 0x%02x,%d,", dsi_table[i], n);
|
||||
for (j = 0; j < n; j++) {
|
||||
if (j == 0) {
|
||||
len += sprintf(str+len, "0x%02x,",
|
||||
dsi_table[i]);
|
||||
} else {
|
||||
len += sprintf(str+len, "%d,",
|
||||
dsi_table[i+j]);
|
||||
}
|
||||
len += sprintf(str+len, "%d,",
|
||||
dsi_table[i+2+j]);
|
||||
}
|
||||
if (len > 0)
|
||||
pr_info(" %s\n", str);
|
||||
} else if (dsi_table[i] == 0xfc) { /* check state */
|
||||
n = (DSI_CMD_SIZE_INDEX + 1) +
|
||||
dsi_table[i+DSI_CMD_SIZE_INDEX];
|
||||
len = 0;
|
||||
for (j = 0; j < n; j++) {
|
||||
if (j == DSI_CMD_SIZE_INDEX) {
|
||||
len += sprintf(str+len, "%d,",
|
||||
dsi_table[i+j]);
|
||||
} else {
|
||||
len += sprintf(str+len, "0x%02x,",
|
||||
dsi_table[i+j]);
|
||||
}
|
||||
}
|
||||
if (len > 0)
|
||||
pr_info(" %s\n", str);
|
||||
pr_info("%s\n", str);
|
||||
} else if ((dsi_table[i] & 0xf) == 0x0) {
|
||||
pr_info("dsi_init_%s wrong data_type: 0x%02x\n",
|
||||
pr_info(" dsi_init_%s wrong data_type: 0x%02x\n",
|
||||
on_off ? "on" : "off", dsi_table[i]);
|
||||
break;
|
||||
} else {
|
||||
n = (DSI_CMD_SIZE_INDEX + 1) +
|
||||
dsi_table[i+DSI_CMD_SIZE_INDEX];
|
||||
len = 0;
|
||||
n = dsi_table[i+DSI_CMD_SIZE_INDEX];
|
||||
len = sprintf(str, " 0x%02x,%d,", dsi_table[i], n);
|
||||
for (j = 0; j < n; j++) {
|
||||
if (j == DSI_CMD_SIZE_INDEX) {
|
||||
len += sprintf(str+len, "%d,",
|
||||
dsi_table[i+j]);
|
||||
} else {
|
||||
len += sprintf(str+len, "0x%02x,",
|
||||
dsi_table[i+j]);
|
||||
}
|
||||
len += sprintf(str+len, "0x%02x,",
|
||||
dsi_table[i+2+j]);
|
||||
}
|
||||
if (len > 0)
|
||||
pr_info(" %s\n", str);
|
||||
pr_info("%s\n", str);
|
||||
}
|
||||
i += n;
|
||||
i += (n + 2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -333,7 +303,7 @@ int lcd_mipi_dsi_init_table_detect(struct device_node *m_node,
|
||||
return -1;
|
||||
}
|
||||
i = 0;
|
||||
while (i < n_max) {
|
||||
while ((i + 1) < n_max) {
|
||||
ret = of_property_read_u32_index(m_node, propname, i, &val);
|
||||
if (val == 0xff) {
|
||||
ret = of_property_read_u32_index(m_node,
|
||||
@@ -350,19 +320,25 @@ int lcd_mipi_dsi_init_table_detect(struct device_node *m_node,
|
||||
/* cmd size */
|
||||
ret = of_property_read_u32_index(m_node,
|
||||
propname, (i + DSI_CMD_SIZE_INDEX), &val);
|
||||
if (val > n_max)
|
||||
break;
|
||||
if (val < 3) {
|
||||
LCDERR("get %s wrong cmd_size %d for gpio\n",
|
||||
propname, val);
|
||||
break;
|
||||
}
|
||||
if ((i + 2 + val) >= n_max) {
|
||||
LCDERR("get %s cmd_size out of max for gpio\n",
|
||||
propname);
|
||||
break;
|
||||
}
|
||||
i = i + (DSI_CMD_SIZE_INDEX + 1) + (val & 0xff);
|
||||
} else if (val == 0xfc) { /* check state */
|
||||
ret = of_property_read_u32_index(m_node,
|
||||
propname, (i + DSI_CMD_SIZE_INDEX), &val);
|
||||
if (val > n_max)
|
||||
if ((i + 2 + val) >= n_max) {
|
||||
LCDERR("get %s cmd_size out of max for check\n",
|
||||
propname);
|
||||
break;
|
||||
}
|
||||
|
||||
ret = of_property_read_u32_index(m_node, propname,
|
||||
(i + DSI_CMD_SIZE_INDEX + 1), ¶[0]);
|
||||
@@ -380,8 +356,11 @@ int lcd_mipi_dsi_init_table_detect(struct device_node *m_node,
|
||||
} else {
|
||||
ret = of_property_read_u32_index(m_node,
|
||||
propname, (i + DSI_CMD_SIZE_INDEX), &val);
|
||||
if (val > n_max)
|
||||
if ((i + 2 + val) >= n_max) {
|
||||
LCDERR("get %s cmd_size out of max\n",
|
||||
propname);
|
||||
break;
|
||||
}
|
||||
i = i + (DSI_CMD_SIZE_INDEX + 1) + (val & 0xff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ enum lcd_extern_i2c_bus_e {
|
||||
|
||||
#define LCD_EXTERN_SPI_CLK_FREQ_DFT 10000 /* default 10k */
|
||||
|
||||
#define LCD_EXTERN_INIT_ON_MAX 500
|
||||
#define LCD_EXTERN_INIT_ON_MAX 1500
|
||||
#define LCD_EXTERN_INIT_OFF_MAX 100
|
||||
|
||||
#define LCD_EXTERN_INIT_CMD 0x00
|
||||
|
||||
Reference in New Issue
Block a user