Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp890542yba; Thu, 18 Apr 2019 11:16:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1nF0oHqV4nUSZc9RxiB9EtIrBaCqhRMlUdywVt1d8Wsk4RvZ6eUIUzSGsuyAWxforqXWv X-Received: by 2002:a62:1c07:: with SMTP id c7mr97652531pfc.159.1555611409128; Thu, 18 Apr 2019 11:16:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555611409; cv=none; d=google.com; s=arc-20160816; b=0C8JqB/45eajTTY1zxauRP2h0WZr1sNNVrJLji2kfh3m3JMjWNW/GBilvWp7jSACKQ tGcNfUqf+q35EUw33IIMYBcw3AY+ftEj7VF5r0uL+pmvb1XKEO1A6ppFSHep9ckqrvMX PMEMONLDhCwkx+1FwJTItBBSGC6hiiQL0yT4APpgJ0LDcfmu73Jrzdpcbw4UXsMW59SC Wy5MtJvorIMBsrPPsNpwuZPcWQtooBm6zgJa0gbXRDa0JyR0xZpXJ/TExHRiZW0xqm0h LtOhbxfHMaCtth1qNrikTji62jyn2C3bVJl1MtBu5RIWGSq6eno65nLDxMJn+2dlK/d+ jN7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=R6RlTU0EiTvWyXFHS8FAQnNeib/iQWhcHbXPdJivI64=; b=SJzWNEFf893xo1oTjT1c4Clh0bHkZPoT1WHnOQgohSEJEliwTdIHPTlnZ4zsW08fYF JubNuTjM/76b4LnZVEZ6Mfvl338iAkU76RkjRE+tLv+3AsIE0L6LwmWuf3h1vMWSQCjE x0Ite/DB9XHrBmYrKCtivnb2M483q6r6w2fn1UtZWB/FItwuWfv7TAkLJefn/loXi5xj wSq+IK9GWlqRjk3/Txv483Or2jN5lgc+AbqkJqxfVOqK0DYgx2gko2hjaY0gNUg58Nea Z7q3fwPWhxeR0irv/rkc7dFObpVT2LcRMVT6T9YX4sculBjlXIWFhP0YJvyiiNN93Du9 CO+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VXgXAvFU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s83si2477324pgs.420.2019.04.18.11.16.33; Thu, 18 Apr 2019 11:16:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VXgXAvFU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392128AbfDRSO7 (ORCPT + 99 others); Thu, 18 Apr 2019 14:14:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:47064 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392076AbfDRSOz (ORCPT ); Thu, 18 Apr 2019 14:14:55 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 95D6D206B6; Thu, 18 Apr 2019 18:14:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555611295; bh=w2ar1zzQGS+MbihlOwPDJJzFGQOf4tudb6KXMChNcrY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VXgXAvFUBb3r+fMgw+GEMYyU2cVKpzRzA2TGmS1+jxDDB4UwZ8hSY1JI/5SkkKE/x vHmIo5Ap3rSrgbK/1Wdpv8wmMy82jvI5+28EWCz16d9ICBpFB1A4kdbRug6AIhqZr2 UQNi88WgtePfs+gUkNGLqyvDz9AxQf80pJ0OJdJs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Hsin-Yi, Wang" , Sean Paul , Sasha Levin Subject: [PATCH 4.14 61/92] drm/panel: panel-innolux: set display off in innolux_panel_unprepare Date: Thu, 18 Apr 2019 19:57:19 +0200 Message-Id: <20190418160435.471416028@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160430.325165109@linuxfoundation.org> References: <20190418160430.325165109@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 46f3ceaffa81e846677bca8668e0ad40e643cffd ] Move mipi_dsi_dcs_set_display_off() from innolux_panel_disable() to innolux_panel_unprepare(), so they are consistent with innolux_panel_enable() and innolux_panel_prepare(). This also fixes some mode check and irq timeout issue in MTK dsi code. Since some dsi code (e.g. mtk_dsi) have following call trace: 1. drm_panel_disable(), which calls innolux_panel_disable() 2. switch to cmd mode 3. drm_panel_unprepare(), which calls innolux_panel_unprepare() However, mtk_dsi needs to be in cmd mode to be able to send commands (e.g. mipi_dsi_dcs_set_display_off() and mipi_dsi_dcs_enter_sleep_mode()), so we need these functions to be called after the switch to cmd mode happens, i.e. in innolux_panel_unprepare. Signed-off-by: Hsin-Yi, Wang Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20190109065922.231753-1-hsinyi@chromium.org Signed-off-by: Sasha Levin --- drivers/gpu/drm/panel/panel-innolux-p079zca.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c b/drivers/gpu/drm/panel/panel-innolux-p079zca.c index 6ba93449fcfb..58b67e0cc385 100644 --- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c +++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c @@ -40,7 +40,6 @@ static inline struct innolux_panel *to_innolux_panel(struct drm_panel *panel) static int innolux_panel_disable(struct drm_panel *panel) { struct innolux_panel *innolux = to_innolux_panel(panel); - int err; if (!innolux->enabled) return 0; @@ -48,11 +47,6 @@ static int innolux_panel_disable(struct drm_panel *panel) innolux->backlight->props.power = FB_BLANK_POWERDOWN; backlight_update_status(innolux->backlight); - err = mipi_dsi_dcs_set_display_off(innolux->link); - if (err < 0) - DRM_DEV_ERROR(panel->dev, "failed to set display off: %d\n", - err); - innolux->enabled = false; return 0; @@ -66,6 +60,11 @@ static int innolux_panel_unprepare(struct drm_panel *panel) if (!innolux->prepared) return 0; + err = mipi_dsi_dcs_set_display_off(innolux->link); + if (err < 0) + DRM_DEV_ERROR(panel->dev, "failed to set display off: %d\n", + err); + err = mipi_dsi_dcs_enter_sleep_mode(innolux->link); if (err < 0) { DRM_DEV_ERROR(panel->dev, "failed to enter sleep mode: %d\n", -- 2.19.1