From: WeiYong Bi Date: Fri, 14 Apr 2017 06:49:21 +0000 (+0800) Subject: drm/panel: Change dlen from u16 to u8 X-Git-Tag: firefly_0821_release~9 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=firefly-linux-kernel-4.4.55.git;a=commitdiff_plain;h=f99b018e7bbfb4edfeba5a18ad6f291da1eda7c5;hp=14c0ac324068534d9c256bd8dd2f54e0a8173e24 drm/panel: Change dlen from u16 to u8 U8_MAX payload length can meet most requirements Change-Id: I77e5780bde72b4229ab36d961dc7498f7c78a468 Signed-off-by: WeiYong Bi --- diff --git a/Documentation/devicetree/bindings/display/panel/simple-panel.txt b/Documentation/devicetree/bindings/display/panel/simple-panel.txt index 346b80b64931..02adef125f1a 100644 --- a/Documentation/devicetree/bindings/display/panel/simple-panel.txt +++ b/Documentation/devicetree/bindings/display/panel/simple-panel.txt @@ -24,13 +24,13 @@ Optional properties when compatible is a dsi devices: - panel-init-sequence: A byte stream formed by simple multiple dcs packets. byte 0: dcs data type byte 1: wait number of specified ms after dcs command transmitted - byte 2, 3: 16 bits length in network byte order - byte 4 and beyond: number byte of payload + byte 2: packet payload length + byte 3 and beyond: number byte of payload - panel-exit-sequence: A byte stream formed by simple multiple dcs packets. byte 0: dcs data type byte 1: wait number of specified ms after dcs command transmitted - byte 2, 3: 16 bits length in network byte order - byte 4 and beyond: number byte of payload + byte 2: packet payload length + byte 3 and beyond: number byte of payload Example: @@ -64,16 +64,16 @@ Or: dsi,lanes = <4>; panel-init-sequence = [ - 39 00 00 10 b1 6c 15 15 24 E4 11 f1 80 e4 - d7 23 80 c0 d2 58 + 39 00 10 b1 6c 15 15 24 E4 11 f1 80 e4 + d7 23 80 c0 d2 58 ... - 05 78 00 01 11 - 05 00 00 01 29 + 05 78 01 11 + 05 00 01 29 ]; panel-exit-sequence = [ - 05 00 00 01 28 - 05 78 00 01 10 + 05 00 01 28 + 05 78 01 10 ]; display-timings { diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 25b6d9a8c971..20a4bb6b548c 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -41,7 +41,7 @@ struct dsi_ctrl_hdr { u8 dtype; /* data type */ u8 wait; /* ms */ - u16 dlen; /* payload len */ + u8 dlen; /* payload len */ } __packed; struct dsi_cmd_desc { @@ -151,7 +151,6 @@ static int panel_simple_dsi_parse_dcs_cmds(struct device *dev, cnt = 0; while (len > sizeof(*dchdr)) { dchdr = (struct dsi_ctrl_hdr *)bp; - dchdr->dlen = ntohs(dchdr->dlen); if (dchdr->dlen > len) { dev_err(dev, "%s: error, len=%d", __func__,