From patchwork Fri Dec 21 03:39:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 10740097 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EE08413BF for ; Fri, 21 Dec 2018 08:45:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DEEA828403 for ; Fri, 21 Dec 2018 08:45:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C664328417; Fri, 21 Dec 2018 08:45:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6CAD128403 for ; Fri, 21 Dec 2018 08:45:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F33E36F554; Fri, 21 Dec 2018 08:45:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by gabe.freedesktop.org (Postfix) with ESMTPS id CB3206EAF9 for ; Fri, 21 Dec 2018 03:39:52 +0000 (UTC) Received: by mail-pg1-x543.google.com with SMTP id z10so1842566pgp.7 for ; Thu, 20 Dec 2018 19:39:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=bJ2V06NMTy+xKzXTskQidTBx2BRu4+3E8mCUEpdOR+s=; b=Gc17Rk4IaPtEe0A7v52Qe1nQe+qYWKqCQ2/h1jWcaE++rVMjvdY9zpqlVmtF1LEW8O Vn+eVBaSkxgzkLtzPrjNdjjgxE2u+WnNnLGwkF/kFgG3SS/VJNY8AQeo7jtWb5LwP+uO 3uzC0/TLVxKnzsqoE/gIY1xRIKmM0ntocAPsz9yPnSuipSV9C/ZcKkWaHoE2Ud4OcEuN ipeFoenry8+K6F/UXpX25B2DpW7aE1uQi7qS7L/t7G5qtgYfJtWeLykGHYUSUVAouc72 /MFMsCC4qrlWRdAtlJrdwZrQ8Vb2LGcEwq5lK27aaXqLCwefJr124eGN+w4hLMrfN7I1 ZW3Q== X-Gm-Message-State: AJcUuket7YL6xRuSe10On1kW7XgrP090wV6an6XqVHu+qXka0KCe9X5e hE5v7Za3StPuZq9ccCR1El4dRA== X-Google-Smtp-Source: ALg8bN7APAmFGqjomZcpt/9bqbSIfcH852JAUIrOH7tvP7UpwbiMu8MQJtgnZ0perF/JjfgCCrVlQg== X-Received: by 2002:a63:451a:: with SMTP id s26mr852194pga.150.1545363592366; Thu, 20 Dec 2018 19:39:52 -0800 (PST) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:b852:bd51:9305:4261]) by smtp.gmail.com with ESMTPSA id v184sm32063902pfb.182.2018.12.20.19.39.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Dec 2018 19:39:51 -0800 (PST) From: "Hsin-Yi, Wang" To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] panel-innolux: set display off in innolux_panel_unprepare Date: Fri, 21 Dec 2018 11:39:25 +0800 Message-Id: <20181221033925.42179-1-hsinyi@chromium.org> X-Mailer: git-send-email 2.18.1 X-Mailman-Approved-At: Fri, 21 Dec 2018 08:44:55 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Thierry Reding , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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",