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: 10011103 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 D1461600CC for ; Tue, 17 Oct 2017 08:09:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F7D1287A0 for ; Tue, 17 Oct 2017 08:09:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 946BB287D1; Tue, 17 Oct 2017 08:09:24 +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.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4C4B9287A0 for ; Tue, 17 Oct 2017 08:09:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=voIqFDuOgveLwog8u4ACNoxIuEr3JK0tAGAP5vRbs0s=; b=beqYhRGZ/N2bYjn/TajtWKz8XN Qe3KrDFybh5M1vq7IlGHOUfprrBVEvCIKsmfJOIqV9gymwbuSjbaKgoxtdmEt5p9ZwhH/PBU5yXTQ L1jCQAlXLL3p7crgGcm3PeBzWHSNfjlGoZmkEJtF3f339dXZY+di9omkmJIzsZQ2E4p3+N3uTZXV7 EnLMXZa0CAmYidcTuzhDJTDO4fFnti7eopxlRUXuSrbESuG+db+VsxTiDV2hWomDDVewmwE7SqX8W W5aEL8UcbIj2yoxNCJ7ipR3pAW3aE1xOVF6e/X6wTqcZ6JZELlt0cP/9SnPZPSwnLzpk/Mu8TqW0m 9ODL+m0w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e4Mvs-0004bN-RC; Tue, 17 Oct 2017 08:09:01 +0000 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e4Mv6-0003st-NQ for linux-arm-kernel@lists.infradead.org; Tue, 17 Oct 2017 08:08:17 +0000 Received: by mail-wm0-x22b.google.com with SMTP id i124so2076833wmf.3 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=LDB5yqxzTycdC51UBcxMFw20Ij6v6cPgfQP0YPwiGbpva66Sf7vJT2KxWXdUukrasW ExhtfDWyEh8nhKCYil69v9ybob3VSLGn5FPudDzdJ+d19kdntL3TqCd3tViJztaMFM5a KEfb8Fsbuo3LGaisWNoZAsVGRNk4+/Nx+sRgs9egW/Tao9t/S9fpGgXnmurVsdRWFyIB ZjgsinJcYLFjtsX6M//vqlqdbhPDadWDVNgihoXZMG2rC1a7YGYhPu6EvWz+E8guUghb pSP+e+5MDi1Y1C6Rw1HB+rNb6Vm55h2YMMPhnkNKz++8ddVFjEuIYFumQfxAM2rfhD/n CUFw== X-Gm-Message-State: AMCzsaVyLtSgWH7QTLibaiOViCSFWINqy43OXv4srFRFkBHLq6TuKEOe tlyolVBskFlJVAlLCftkmz9cEg== 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171017_010813_068241_1636CC93 X-CRM114-Status: GOOD ( 12.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, Neil Armstrong MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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)) {