From patchwork Mon Oct 7 08:34:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 2995131 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B24979F243 for ; Mon, 7 Oct 2013 09:00:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7ED19201C8 for ; Mon, 7 Oct 2013 09:00:35 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 36915201C7 for ; Mon, 7 Oct 2013 09:00:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 30C0BE7123 for ; Mon, 7 Oct 2013 02:00:34 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-bk0-f47.google.com (mail-bk0-f47.google.com [209.85.214.47]) by gabe.freedesktop.org (Postfix) with ESMTP id CA1AAE6796 for ; Mon, 7 Oct 2013 01:37:15 -0700 (PDT) Received: by mail-bk0-f47.google.com with SMTP id mx12so2457238bkb.34 for ; Mon, 07 Oct 2013 01:37:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WsFhc3cG4J6f+oEDvqpnNWT1FbpWNzfOfZFiW0jQXXw=; b=jQify/kYm4udmRl4qwdlCPEBzfZbSJONxKGX040sX00Sxr7VxU0Qjsg34dVA/kPqm5 PZDHHgh0JremgzW3bLSDen5cLZTBeK8ch5pCpRnxW0ovwHS9sOruLH/u0HIuMEpm2pGJ wvVEfMUbOFj2KcB0Gfg6Gto2OGQ54u+JFN6htc0TbRKea29TDjuQCXFdtp9hnV17sqAp L2q79XEAdnvZag/AAARRjciOi/TsBntWAlQrqdk9faC83RgZiCdxGgdscAuu2RW+GQi3 tBjdKFVL/8AljxzFSwg+rKIP7w5DFJEPAf4n34q2G2T/dZ4mIeCQPRbx84udRrpHTrsQ Y9aQ== X-Received: by 10.205.14.69 with SMTP id pp5mr25773574bkb.14.1381135034955; Mon, 07 Oct 2013 01:37:14 -0700 (PDT) Received: from localhost (port-46445.pppoe.wtnet.de. [46.59.230.36]) by mx.google.com with ESMTPSA id on10sm16323513bkb.13.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Oct 2013 01:37:14 -0700 (PDT) From: Thierry Reding To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 19/27] host1x: hdmi: Enable VDD earlier for hotplug/DDC Date: Mon, 7 Oct 2013 10:34:36 +0200 Message-Id: <1381134884-5816-20-git-send-email-treding@nvidia.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1381134884-5816-1-git-send-email-treding@nvidia.com> References: <1381134884-5816-1-git-send-email-treding@nvidia.com> Cc: linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, Mikko Perttunen X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mikko Perttunen The VDD regulator used to be enabled only at tegra_output_hdmi_enable, which is called after a sink is detected. However, the HDMI hotplug pin works by returning the voltage supplied by the VDD pin, so this meant that the hotplug pin was never asserted and the sink was not detected unless the VDD regulator was set to be always on. This patch moves the enable to the tegra_hdmi_init() function to make sure the regulator will get enabled and therefore ensure proper hotplug detection. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding --- drivers/gpu/drm/tegra/hdmi.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c index 3808226..9bd912c 100644 --- a/drivers/gpu/drm/tegra/hdmi.c +++ b/drivers/gpu/drm/tegra/hdmi.c @@ -699,12 +699,6 @@ static int tegra_output_hdmi_enable(struct tegra_output *output) h_back_porch = mode->htotal - mode->hsync_end; h_front_porch = mode->hsync_start - mode->hdisplay; - err = regulator_enable(hdmi->vdd); - if (err < 0) { - dev_err(hdmi->dev, "failed to enable VDD regulator: %d\n", err); - return err; - } - err = regulator_enable(hdmi->pll); if (err < 0) { dev_err(hdmi->dev, "failed to enable PLL regulator: %d\n", err); @@ -926,7 +920,6 @@ static int tegra_output_hdmi_disable(struct tegra_output *output) tegra_periph_reset_assert(hdmi->clk); clk_disable(hdmi->clk); regulator_disable(hdmi->pll); - regulator_disable(hdmi->vdd); return 0; } @@ -1231,6 +1224,13 @@ static int tegra_hdmi_init(struct host1x_client *client) struct tegra_hdmi *hdmi = host1x_client_to_hdmi(client); int err; + err = regulator_enable(hdmi->vdd); + if (err < 0) { + dev_err(client->dev, "failed to enable VDD regulator: %d\n", + err); + return err; + } + hdmi->output.type = TEGRA_OUTPUT_HDMI; hdmi->output.dev = client->dev; hdmi->output.ops = &hdmi_ops; @@ -1274,6 +1274,8 @@ static int tegra_hdmi_exit(struct host1x_client *client) return err; } + regulator_disable(hdmi->vdd); + return 0; }