From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751350AbdAVHOZ (ORCPT ); Sun, 22 Jan 2017 02:14:25 -0500 Received: from regular1.263xmail.com ([211.150.99.132]:50299 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750813AbdAVHOR (ORCPT ); Sun, 22 Jan 2017 02:14:17 -0500 X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-RL-SENDER: zyw@rock-chips.com X-FST-TO: linux-kernel@vger.kernel.org X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: zyw@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Subject: Re: [PATCH v2 09/26] drm/rockchip: dw-mipi-dsi: respect message flags To: John Keeping , Mark Yao References: <20170121163128.22240-1-john@metanate.com> <20170121163128.22240-10-john@metanate.com> Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org From: Chris Zhong Message-ID: <58845BBC.3040105@rock-chips.com> Date: Sun, 22 Jan 2017 15:14:04 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20170121163128.22240-10-john@metanate.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi John Reviewed-by: Chris Zhong On 01/22/2017 12:31 AM, John Keeping wrote: > Instead of always sending commands in LP mode, respect the > MIPI_DSI_MSG_USE_LPM flag to decide how to send each message. Also > request acks if MIPI_DSI_MSG_REQ_ACK is set. > > Signed-off-by: John Keeping > --- > Unchanged in v2 > --- > drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c > index 92dbc3e56603..15d33c3c8cb7 100644 > --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c > +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c > @@ -542,6 +542,19 @@ static int dw_mipi_dsi_host_detach(struct mipi_dsi_host *host, > return 0; > } > > +static void dw_mipi_message_config(struct dw_mipi_dsi *dsi, > + const struct mipi_dsi_msg *msg) > +{ > + u32 val = 0; > + > + if (msg->flags & MIPI_DSI_MSG_REQ_ACK) > + val |= EN_ACK_RQST; > + if (msg->flags & MIPI_DSI_MSG_USE_LPM) > + val |= CMD_MODE_ALL_LP; > + > + dsi_write(dsi, DSI_CMD_MODE_CFG, val); > +} > + > static int dw_mipi_dsi_gen_pkt_hdr_write(struct dw_mipi_dsi *dsi, u32 hdr_val) > { > int ret; > @@ -634,6 +647,8 @@ static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host, > struct dw_mipi_dsi *dsi = host_to_dsi(host); > int ret; > > + dw_mipi_message_config(dsi, msg); > + > switch (msg->type) { > case MIPI_DSI_DCS_SHORT_WRITE: > case MIPI_DSI_DCS_SHORT_WRITE_PARAM: > @@ -745,7 +760,6 @@ static void dw_mipi_dsi_command_mode_config(struct dw_mipi_dsi *dsi) > { > dsi_write(dsi, DSI_TO_CNT_CFG, HSTX_TO_CNT(1000) | LPRX_TO_CNT(1000)); > dsi_write(dsi, DSI_BTA_TO_CNT, 0xd00); > - dsi_write(dsi, DSI_CMD_MODE_CFG, CMD_MODE_ALL_LP); > dsi_write(dsi, DSI_MODE_CFG, ENABLE_CMD_MODE); > } >