From patchwork Thu Nov 28 15:37:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 11266299 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 500341393 for ; Thu, 28 Nov 2019 15:38:28 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 37C6021781 for ; Thu, 28 Nov 2019 15:38:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 37C6021781 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 61DB96E84A; Thu, 28 Nov 2019 15:38:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id 508B96E822 for ; Thu, 28 Nov 2019 15:38:02 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id z7so28212317wrl.13 for ; Thu, 28 Nov 2019 07:38:02 -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:in-reply-to :references:mime-version:content-transfer-encoding; bh=DZWNjGPJrA9TiLgOiM42Wa6pCMxexw+xtFbZOuu9Dj0=; b=P0RluODebqO0qRfqM1iy6XdAkSq++zXIpm77sivraQaOttmA+3Qir0GsFiXx7T5W6E VLrPj3T+u5dL78QXHTlkXr1nedQgsMcW/ieb/wTBoKr6DwHBEqSB/DUcYF+LPV1J9OML yGash2eaJQnPswNucAPthFq4Uzm51xkmMMV9WdViLVP4EfmShVhNj2HDODSPF7rnPnZp sTNxEOBrsYuW5fRtVTa2TqCjmb3dEQTXrFL4EFryizBB59SrnrB3CSQAyfmipRRTkoqi eg/81jw1mb0yp5aqjiOB+ZRmnSKWFxcHk1EJiVI+0DLPIgDyHxFDZZZQ5wJQGup/ZYPK kxUg== X-Gm-Message-State: APjAAAUcsEsBPYzBV6qgRF5CTZHCNqNA/zTGaD2pjx8wdFX8avOBisLN 4ox/F9pMhu0JsAtXt4BPILI= X-Google-Smtp-Source: APXvYqxY00AlQiRyW3tG6/BnHI8I8iDyWl6zJrMYZ8i9WUIigDI2zW81I6BGYQR6FwxL4UuWXDfaJg== X-Received: by 2002:a5d:46c7:: with SMTP id g7mr13891032wrs.11.1574955480883; Thu, 28 Nov 2019 07:38:00 -0800 (PST) Received: from localhost (pD9E518ED.dip0.t-ipconnect.de. [217.229.24.237]) by smtp.gmail.com with ESMTPSA id 72sm24285631wrl.73.2019.11.28.07.37.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 07:38:00 -0800 (PST) From: Thierry Reding To: Thierry Reding Subject: [PATCH 9/9] drm/tegra: sor: Make the +5V HDMI supply optional Date: Thu, 28 Nov 2019 16:37:41 +0100 Message-Id: <20191128153741.2380419-10-thierry.reding@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191128153741.2380419-1-thierry.reding@gmail.com> References: <20191128153741.2380419-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DZWNjGPJrA9TiLgOiM42Wa6pCMxexw+xtFbZOuu9Dj0=; b=fBM1fnaSHGPaWj2oDBplza3m7QMiLpkQd4blnANTy09QOm9ZAmdZs+MxmnNEnUhauM Nrqgw71rQIAn9ttijEmzZoCTxxtAuxFfcDRthNbgBOOr71OkD6KrO+auVhP//1d4TAYS TCSvmrKJ8qQXRWv7U1XOEuEGjEaArFMentcrB2fpRZM1tANAmPDI8u64a+h8UsWnOSz3 Xeg41ALMwyGoZcL743L9UOzL5F/WaOmV6+2MNY7oa8Nfxm/w4ctoyXrZSQTZ96icQQyB u+wq/C90LEzesgf6O5fZLysT6CmHNf9im0svPqvmJHVZDjyE+5JkV0At652rkmy06Mfr N0gA== 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: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Thierry Reding The SOR supports multiple display modes, but only when driving an HDMI monitor does it make sense to control the +5V power supply. eDP and DP don't need this, so make it optional. This fixes a crash observed during system suspend/resume. Signed-off-by: Thierry Reding Acked-by: Daniel Vetter --- drivers/gpu/drm/tegra/sor.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c index 2200f4cd397a..a68d3b36b972 100644 --- a/drivers/gpu/drm/tegra/sor.c +++ b/drivers/gpu/drm/tegra/sor.c @@ -3970,15 +3970,29 @@ static int tegra_sor_runtime_resume(struct device *dev) static int tegra_sor_suspend(struct device *dev) { struct tegra_sor *sor = dev_get_drvdata(dev); + int err; + + if (sor->hdmi_supply) { + err = regulator_disable(sor->hdmi_supply); + if (err < 0) + return err; + } - return regulator_disable(sor->hdmi_supply); + return 0; } static int tegra_sor_resume(struct device *dev) { struct tegra_sor *sor = dev_get_drvdata(dev); + int err; + + if (sor->hdmi_supply) { + err = regulator_enable(sor->hdmi_supply); + if (err < 0) + return err; + } - return regulator_enable(sor->hdmi_supply); + return 0; } static const struct dev_pm_ops tegra_sor_pm_ops = {