Skip to content

Commit f99b018

Browse files
bivvyrkhuangtao
authored andcommitted
drm/panel: Change dlen from u16 to u8
U8_MAX payload length can meet most requirements Change-Id: I77e5780bde72b4229ab36d961dc7498f7c78a468 Signed-off-by: WeiYong Bi <bivvy.bi@rock-chips.com>
1 parent 14c0ac3 commit f99b018

2 files changed

Lines changed: 11 additions & 12 deletions

File tree

Documentation/devicetree/bindings/display/panel/simple-panel.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ Optional properties when compatible is a dsi devices:
2424
- panel-init-sequence: A byte stream formed by simple multiple dcs packets.
2525
byte 0: dcs data type
2626
byte 1: wait number of specified ms after dcs command transmitted
27-
byte 2, 3: 16 bits length in network byte order
28-
byte 4 and beyond: number byte of payload
27+
byte 2: packet payload length
28+
byte 3 and beyond: number byte of payload
2929
- panel-exit-sequence: A byte stream formed by simple multiple dcs packets.
3030
byte 0: dcs data type
3131
byte 1: wait number of specified ms after dcs command transmitted
32-
byte 2, 3: 16 bits length in network byte order
33-
byte 4 and beyond: number byte of payload
32+
byte 2: packet payload length
33+
byte 3 and beyond: number byte of payload
3434

3535
Example:
3636

@@ -64,16 +64,16 @@ Or:
6464
dsi,lanes = <4>;
6565

6666
panel-init-sequence = [
67-
39 00 00 10 b1 6c 15 15 24 E4 11 f1 80 e4
68-
d7 23 80 c0 d2 58
67+
39 00 10 b1 6c 15 15 24 E4 11 f1 80 e4
68+
d7 23 80 c0 d2 58
6969
...
70-
05 78 00 01 11
71-
05 00 00 01 29
70+
05 78 01 11
71+
05 00 01 29
7272
];
7373

7474
panel-exit-sequence = [
75-
05 00 00 01 28
76-
05 78 00 01 10
75+
05 00 01 28
76+
05 78 01 10
7777
];
7878

7979
display-timings {

drivers/gpu/drm/panel/panel-simple.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
struct dsi_ctrl_hdr {
4242
u8 dtype; /* data type */
4343
u8 wait; /* ms */
44-
u16 dlen; /* payload len */
44+
u8 dlen; /* payload len */
4545
} __packed;
4646

4747
struct dsi_cmd_desc {
@@ -151,7 +151,6 @@ static int panel_simple_dsi_parse_dcs_cmds(struct device *dev,
151151
cnt = 0;
152152
while (len > sizeof(*dchdr)) {
153153
dchdr = (struct dsi_ctrl_hdr *)bp;
154-
dchdr->dlen = ntohs(dchdr->dlen);
155154

156155
if (dchdr->dlen > len) {
157156
dev_err(dev, "%s: error, len=%d", __func__,

0 commit comments

Comments
 (0)