From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751575AbdAVIhx (ORCPT ); Sun, 22 Jan 2017 03:37:53 -0500 Received: from regular1.263xmail.com ([211.150.99.134]:44600 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751203AbdAVIhr (ORCPT ); Sun, 22 Jan 2017 03:37:47 -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: 103.29.142.67 X-LOGIN-NAME: zyw@rock-chips.com X-UNIQUE-TAG: <2d40cbf0a851a3193b494bbde5bb6c25> X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Subject: Re: [PATCH v2 13/26] drm/rockchip: dw-mipi-dsi: allow commands in panel_disable To: John Keeping , Mark Yao References: <20170121163128.22240-1-john@metanate.com> <20170121163128.22240-14-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: <58846F3C.40904@rock-chips.com> Date: Sun, 22 Jan 2017 16:37:16 +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-14-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 On 01/22/2017 12:31 AM, John Keeping wrote: > Panel drivers may want to sent commands during the disable function, for > example MIPI_DCS_SET_DISPLAY_OFF before the video signal ends. In order > to send commands we need to write to registers, so pclk must be enabled. > > While changing this, remove the unnecessary code after the panel > unprepare call which seems to be a workaround for a specific panel and > thus belongs in the panel driver. > > Signed-off-by: John Keeping > --- > Unchanged in v2 > --- > drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 12 ++---------- > 1 file changed, 2 insertions(+), 10 deletions(-) > > diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c > index 7ada6d8ed143..290282e86d16 100644 > --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c > +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c > @@ -846,24 +846,16 @@ static void dw_mipi_dsi_encoder_disable(struct drm_encoder *encoder) > { > struct dw_mipi_dsi *dsi = encoder_to_dsi(encoder); > > - drm_panel_disable(dsi->panel); > - > if (clk_prepare_enable(dsi->pclk)) { > dev_err(dsi->dev, "%s: Failed to enable pclk\n", __func__); > return; > } > > + drm_panel_disable(dsi->panel); > + > dw_mipi_dsi_set_mode(dsi, DW_MIPI_DSI_CMD_MODE); > drm_panel_unprepare(dsi->panel); > - dw_mipi_dsi_set_mode(dsi, DW_MIPI_DSI_VID_MODE); > > - /* > - * This is necessary to make sure the peripheral will be driven > - * normally when the display is enabled again later. > - */ > - msleep(120); > - > - dw_mipi_dsi_set_mode(dsi, DW_MIPI_DSI_CMD_MODE); This workaround is from[0], I also think it should be deleted. [0] http://www.spinics.net/lists/dri-devel/msg77192.html Reviewed-by: Chris Zhong > dw_mipi_dsi_disable(dsi); > clk_disable_unprepare(dsi->pclk); > }