From patchwork Sun Nov 17 02:40:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 11248009 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AEC40159A for ; Sun, 17 Nov 2019 07:11:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8DA4020871 for ; Sun, 17 Nov 2019 07:11:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726124AbfKQHLD (ORCPT ); Sun, 17 Nov 2019 02:11:03 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:50904 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726082AbfKQHLD (ORCPT ); Sun, 17 Nov 2019 02:11:03 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 53B9D28FCA8 Received: by earth.universe (Postfix, from userid 1000) id 5DA953C0CB2; Sun, 17 Nov 2019 03:41:40 +0100 (CET) From: Sebastian Reichel To: Sebastian Reichel , Laurent Pinchart , Tomi Valkeinen Cc: Tony Lindgren , Merlijn Wajer , "H. Nikolaus Schaller" , linux-omap@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@collabora.com, Sebastian Reichel Subject: [RFCv1 38/42] drm/omap: panel-dsi-cm: do not power on/off twice Date: Sun, 17 Nov 2019 03:40:24 +0100 Message-Id: <20191117024028.2233-39-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191117024028.2233-1-sebastian.reichel@collabora.com> References: <20191117024028.2233-1-sebastian.reichel@collabora.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Make sure, that we only power on/off the device once. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 90132d1d1f5d..7f6b1129862a 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -290,6 +290,9 @@ static int dsicm_power_on(struct panel_drv_data *ddata) u8 id1, id2, id3; int r; + if (ddata->enabled) + return 0; + r = regulator_bulk_enable(DCS_REGULATOR_SUPPLY_NUM, ddata->supplies); if (r) { dev_err(&ddata->dsi->dev, "failed to enable supplies: %d\n", r); @@ -354,6 +357,9 @@ static int dsicm_power_off(struct panel_drv_data *ddata) { int r; + if (!ddata->enabled) + return 0; + ddata->enabled = 0; r = mipi_dsi_dcs_set_display_off(ddata->dsi);