From patchwork Wed Jan 9 06:59:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 10753573 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 E4DE213BF for ; Wed, 9 Jan 2019 08:16:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8D9528DE0 for ; Wed, 9 Jan 2019 08:16:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD67828E69; Wed, 9 Jan 2019 08:16:18 +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,SUBJ_OBFU_PUNCT_FEW 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 84F3828DE0 for ; Wed, 9 Jan 2019 08:16:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BB5E96F12B; Wed, 9 Jan 2019 08:16:12 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0C8676E25C for ; Wed, 9 Jan 2019 06:59:28 +0000 (UTC) Received: by mail-pf1-x441.google.com with SMTP id b85so3217342pfc.3 for ; Tue, 08 Jan 2019 22:59:28 -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=6AjmQoj4vZga1M05cboJY5gLkKlpnzB8nWkEfzeU72s=; b=XiSX6vM8IxPhHKmsEEIjxrb+TPSNweQODJ2KD9GrP4wJ3GeBiu055YRdNOzRBPyxAP 0VJT0IbwIY/6C5XhQIYeBQCEWYQdcm29YyR3qbJka3tIDXELk/+JWRtzNrDukPT2FHlF VWuHpRYSuCIctVZatgSrs/fRvCvDPDpl+WIXZEUvK2A0SU+z24wrRmMpnwG+jJIdf11X Bil9RcbxocsRlZacoN80LMkd8ZlFu6O7k/eQ8FDQ5kWnFyhZSNwSUGrdn3pc4ks5GIjC W5qzkLPayGr6ZmQHXpfhRAVaqf2Pgb5EX8x5HSVHCBdiKJmTRuJaBc/lz53Yks89Ktcd RqHw== X-Gm-Message-State: AJcUukfzjm31Tvuh6tgjGM3/AiHOoIJAsbT/qjCxr3ZlNM5bBGNFGgaq 6/79fiJT3Vc0vqVpG9E/8tD4Ag== X-Google-Smtp-Source: ALg8bN4tfm8j6CoknFNirnHygNkSos3VA+xBsXL4cGYlnScOGW1mNK6VuEuM5CelRcqIkbU34vpxbw== X-Received: by 2002:a63:ac1a:: with SMTP id v26mr4398523pge.293.1547017167532; Tue, 08 Jan 2019 22:59:27 -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 r80sm119773259pfa.111.2019.01.08.22.59.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Jan 2019 22:59:27 -0800 (PST) From: "Hsin-Yi, Wang" To: linux-arm-kernel@lists.infradead.org Subject: [PATCH resend] drm/panel: panel-innolux: set display off in innolux_panel_unprepare Date: Wed, 9 Jan 2019 14:59:22 +0800 Message-Id: <20190109065922.231753-1-hsinyi@chromium.org> X-Mailer: git-send-email 2.18.1 X-Mailman-Approved-At: Wed, 09 Jan 2019 08:15:57 +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 Reviewed-by: Sean Paul --- Resend for review. --- 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",