From patchwork Wed Dec 6 11:54:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 10095693 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 6815660329 for ; Wed, 6 Dec 2017 11:54:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A8A129BA9 for ; Wed, 6 Dec 2017 11:54:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F4B929BAE; Wed, 6 Dec 2017 11:54:45 +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 14DB929BA9 for ; Wed, 6 Dec 2017 11:54:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0B35F6E193; Wed, 6 Dec 2017 11:54:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id CFF4A6E0B5 for ; Wed, 6 Dec 2017 11:54:38 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id i11so6586547wmf.4 for ; Wed, 06 Dec 2017 03:54:38 -0800 (PST) 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=0iLL5S3MxPPkIBs+xl+aSUdBujSvF4TVoLkG4xTU+sCdOqz3v/KRiL8LS9jiRAyVTy GhsnU/KLo7ELvEvzEqw3cQMfpUmAO7xU7yYYBohWFxyQCK2NsUz01lxIF5V6wOp8KJfc VlU1daXeC3kOgn76oF+jwG78bKhVUXle4OOXqwbE1pNIGDqUxQd7XuZEUk7IghdFjk2a C4Tbzrlvm7bX/0ULiCzd2XjT6D+oh7zuyUitd2bc5qIALiAA2/qLANZypOPIoEWFQ+Rx vitDywiFWaTTHWk7NUny66AACBCS/zYr1LdNuwr5Ai5mmRVRqVxNj8R7NSaymkymHPvK qZcQ== 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=ftKGNpzF/++DBMfSNkkYuY6hoAYpAxPWNBSm7Bs2ty3At13thggIbdyXZMVudnx7jh fDt544HXisik/AgBVcA1+XksoT6Q/kI14+kMazjs8egkswFlaX6FUjEYeGl33LpyUBh9 7cl1ip+WD6CN2muMFvnbnRM0OkM0Py63SyplvlLDFDFa4PgV3hzoMgKwfQEba0f6t+mQ KlakenUOOtSbEuqA35fGrpMo3Aq78dS5GvN/g78vM6Zt2dRYt+zuzjpjmZtK0Gd0Cmyk pUYyfIgZg/NSxvzKCBkjmgAaLaaK0Gpv/IMPrTLT4ZNIpfKshW9lbU3XjCnXyTueprBl 48Tw== X-Gm-Message-State: AKGB3mIq4VDVzN6f9qrzpdEK545o9yFe0DUexQ1eVrn4jA21Nsc+VEDb LXMIDO41oRrjxS7riaJIQZFpcQ== X-Google-Smtp-Source: AGs4zMYOcUjyItUVOGZPLwNhUNF1gBpFFY3eOXpu1+R43llq9Nx4sFBVuY0WPjEdED92pGBFYeMZag== X-Received: by 10.28.54.3 with SMTP id d3mr14170250wma.79.1512561277274; Wed, 06 Dec 2017 03:54:37 -0800 (PST) Received: from localhost.localdomain ([2a01:e35:2e4f:a3d0:31c2:ed55:b111:7ef8]) by smtp.gmail.com with ESMTPSA id k11sm2931875wmi.18.2017.12.06.03.54.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Dec 2017 03:54:36 -0800 (PST) From: Neil Armstrong To: airlied@linux.ie Subject: [RESEND PATCH 3/4] drm/meson: dw_hdmi: Add support for an optional external 5V regulator Date: Wed, 6 Dec 2017 12:54:27 +0100 Message-Id: <1512561268-29806-4-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512561268-29806-1-git-send-email-narmstrong@baylibre.com> References: <1512561268-29806-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)) {