From patchwork Tue Oct 17 08:07:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 10011087 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E3D0F600CC for ; Tue, 17 Oct 2017 08:07:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D56EA22376 for ; Tue, 17 Oct 2017 08:07:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA547287C7; Tue, 17 Oct 2017 08:07:57 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 88C3F22376 for ; Tue, 17 Oct 2017 08:07:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C75876E603; Tue, 17 Oct 2017 08:07:54 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 36F426E5E1 for ; Tue, 17 Oct 2017 08:07:52 +0000 (UTC) Received: by mail-wm0-x22d.google.com with SMTP id q132so2080393wmd.2 for ; Tue, 17 Oct 2017 01:07:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xSp0GqeiEgeDCr3WeL37CnGggUiDVSbY5bBRsC2d5X8=; b=EWU5d47zSb7bgvlMOY8Uh20qX7JCMTmULw4x2aNo6xQnbJlshTm+JJiLiWEOvSgiOd hK+AeaELU/KDMmVBePrikqpKuVoCAc1eIrMxpIgFQIVrPH0A5cfdKYnFJzjkomz427vc jtH4GCpp+Qr+LTpU10cC2hi9id7L1i+TdUb254anEDfXJifpqKWnV/Rj7DDG347xQRXX kjukHp3phWRlj0cDVKdG47APRw1/ugoqauB+c33fH8yRPYDOcDnwKkMucVKwpVoaG9S5 cwlhfbPhS21GlzNkYPdBAuHOEaxU0q8CRDolw7jlquhpebCDM5gE9Ze2YWc/b2ZGkGoX upJg== 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; bh=xSp0GqeiEgeDCr3WeL37CnGggUiDVSbY5bBRsC2d5X8=; b=cijrlBI2T9YVQwzkMaSvIDwOVDxo+Ki7DgbYjNSUfW+qD81I+ZCupp5chSL/RoK1pw UtLvTdWQhFIyfXU3+V1CDFVWKiyDrhLSJq0auKyEQf1+VEvVyVSZ3TLp7vkdWFufa89M 48Xz4aFD61ZFJGZtX9s6ouNEe8t/wWSJNFTDNYKzDBy3a3ZGGKxgNdBhdIjGk3Cug0RF FQd6khHVPAnjwRX2Pra540dduzw8Itye5DC/tcpsH+DtHKVTcU1J2piIDDiX0YnMI2l9 NDJQwHQ/8pQE9Z7pf8ka8wYUYXkQwJJr8k5BsiduK8zCfulNvHl5o52qmHuG6k8gd6rN sGAA== X-Gm-Message-State: AMCzsaXfe/nSwyGuu0lAwW+uv8M3OkB4o0GyoNBwCrgZDNvpfGAi063Z 64TDewCNtpUWfBMlxTM85UHP7Q== X-Google-Smtp-Source: ABhQp+QGnNuCMZ452X+TQX/iuGRia/fA8Cp1NFbW9ZmDaTYSgEqv+ppTA8SOcjdF5VLmXNz03grEZw== X-Received: by 10.28.88.21 with SMTP id m21mr2646595wmb.111.1508227670757; Tue, 17 Oct 2017 01:07:50 -0700 (PDT) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id 188sm7798687wmg.45.2017.10.17.01.07.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Oct 2017 01:07:50 -0700 (PDT) From: Neil Armstrong To: airlied@linux.ie Subject: [PATCH 3/4] drm/meson: dw_hdmi: Add support for an optional external 5V regulator Date: Tue, 17 Oct 2017 10:07:43 +0200 Message-Id: <1508227664-11171-4-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508227664-11171-1-git-send-email-narmstrong@baylibre.com> References: <1508227664-11171-1-git-send-email-narmstrong@baylibre.com> Cc: linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, Neil Armstrong X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP On reference boards and derivatives, the HDMI Logic is powered by an external 5V regulator. This regulator was set by the Vendor U-Boot, add optional support for it. Signed-off-by: Neil Armstrong --- drivers/gpu/drm/meson/meson_dw_hdmi.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c index cef4144..17de3af 100644 --- a/drivers/gpu/drm/meson/meson_dw_hdmi.c +++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -137,6 +138,7 @@ struct meson_dw_hdmi { struct reset_control *hdmitx_phy; struct clk *hdmi_pclk; struct clk *venci_clk; + struct regulator *hdmi_supply; u32 irq_stat; }; #define encoder_to_meson_dw_hdmi(x) \ @@ -751,6 +753,17 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master, dw_plat_data = &meson_dw_hdmi->dw_plat_data; encoder = &meson_dw_hdmi->encoder; + meson_dw_hdmi->hdmi_supply = devm_regulator_get_optional(dev, "hdmi"); + if (IS_ERR(meson_dw_hdmi->hdmi_supply)) { + if (PTR_ERR(meson_dw_hdmi->hdmi_supply) == -EPROBE_DEFER) + return -EPROBE_DEFER; + meson_dw_hdmi->hdmi_supply = NULL; + } else { + ret = regulator_enable(meson_dw_hdmi->hdmi_supply); + if (ret) + return ret; + } + meson_dw_hdmi->hdmitx_apb = devm_reset_control_get_exclusive(dev, "hdmitx_apb"); if (IS_ERR(meson_dw_hdmi->hdmitx_apb)) {