Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp891644yba; Thu, 18 Apr 2019 11:18:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxn2Z7sdrbsw6w9nwvstGXA/+B6920itUv5pvmen0hfyeV6SxsyuVjwqJ0s8jRVh1dAdXX8 X-Received: by 2002:a65:64c9:: with SMTP id t9mr89163312pgv.221.1555611483961; Thu, 18 Apr 2019 11:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555611483; cv=none; d=google.com; s=arc-20160816; b=DpxLjLdbSxehUloAu3qsQAN96MnxzIbQX+WeYtjvpuA8HaC+u0wNyJyixnHR9gLh3u 2jDRaSN0iz5uc0Vqdber+pYprHRF5H85AB+2fe0+zhSNSdhv3exL7GGuhlPM65UVpQlM 8Kk3jtq/YF70Fqr9EtgtjRSi8L9U5yk9SOCa6FIgvjceWHmzfwKnkFJJi7F6Zs83ND8+ T4b7UsR1pSHW4hIWCfcJM5FjzouyOxh/RmfND9SXcuxaQm0Nt5UnRXwFRkN8j/goEgFB K2/BSD74wC459sT/6WwxPyH6MH1kVd+2plalGvGz0cuSCH4o1ok6AL8k4JwgzZCeTpZy gZKQ== 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=f6+KQwfajn5TEQwFNtxG/oaeyfnRbFetm+c3W1GnLP8=; b=Z2qfSdhcVaUyAkUVvAtjWtPdo4rqcNpq+8lazQr0ANpljbrVKhREVBe6EE3LFPmNGZ KOMDbdfOsJ5B+/tY1DhiUB7EqK4+w3arGoaGRzeldNsWCphFPeHOIX4DByp9YUSTo82U YvmTf6lZbrN1XzceyG/0RVZ2CGfuGcCGkDivzQDfKFlLzb9AJtWKyAx3ePgXcan1PABe zEsEybsmGNOONocgk3j11LPO3qNCCcw+UuAYhWgZctMEwuzEWrDfPsspM+zbhyzhZVse sSBlU2gRbSpucgnzrrErt9NNIFTO9NYXaFifsZvJCb/G5UUj5WTFiEuXsYeHkw6oLsna uuSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FIqpGpik; 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 be8si2687254plb.72.2019.04.18.11.17.48; Thu, 18 Apr 2019 11:18:03 -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=FIqpGpik; 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 S2392132AbfDRSPD (ORCPT + 99 others); Thu, 18 Apr 2019 14:15:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:47108 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391146AbfDRSO6 (ORCPT ); Thu, 18 Apr 2019 14:14:58 -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 4BB6A2186A; Thu, 18 Apr 2019 18:14:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555611297; bh=zg/5/lO66W3xzA8ml9qEl+pZ7U+qu6LZA3n0mlouVzA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FIqpGpikSfkNIuMG5TW501dKnkX84rjQXCq2Qbhrk5rfTeHUaiot1K+35VhToy0yA LgsS/PIEi4vogfI4h4MLXXlEaIVYLktGk4a0lC+3SQSozKgwGR92nBHxRifcPKbE9O 3stIzwZns1PDIpwUWsyNtm66vZ0mPhmYPb3gGjAs= 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 5.0 71/93] drm/panel: panel-innolux: set display off in innolux_panel_unprepare Date: Thu, 18 Apr 2019 19:57:49 +0200 Message-Id: <20190418160444.390220891@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160436.781762249@linuxfoundation.org> References: <20190418160436.781762249@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 ca4ae45dd307..8e5724b63f1f 100644 --- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c +++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c @@ -70,18 +70,12 @@ 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; backlight_disable(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; @@ -95,6 +89,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