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: 10095709 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 CBBCB60329 for ; Wed, 6 Dec 2017 11:56:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BCC2429BA9 for ; Wed, 6 Dec 2017 11:56:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B069E29BAE; Wed, 6 Dec 2017 11:56:07 +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 509B629BA9 for ; Wed, 6 Dec 2017 11:56:07 +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=ZqACwSDDl35lSOAH/SSVQjaRHn JR5Z9/Km3xV3mOqCAQQJCnWMvBAz2t2Wlr3kAoVAL44NxibrFGpNzi/hSe2u1YOm67Bc1H75iQgmI dkLjUo1XI8dAWOZTWIsGqo8jneQ7znVmumMfHXAimYZfjjMYwWAt+QeYEvBQUntVZtiULHCR0Vdd3 vzu+DB+zS4dSDq1i0EZBcTUlOOuwNJP+dYDaBnrYzuu/iR0GEOqYswDv0fHAvCbUDu07W49Ffz6DQ bfBWiXt1w22A9NVO15X/3zYxOr+Or3J86YCM4jKok11icpa87zMoTntMd34oJLzZpB/SYsMDCa9yP HXB6y6KQ==; 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 1eMYIy-0004sA-3X; Wed, 06 Dec 2017 11:56:00 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eMYHw-0002Vi-5h for linux-arm-kernel@lists.infradead.org; Wed, 06 Dec 2017 11:55:02 +0000 Received: by mail-wm0-x241.google.com with SMTP id b76so6675194wmg.1 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=YTX20xFWisDNCZfeJ522Xeuu5610vQP1mrsFNCeLTw4UmCw1gFYcGjLQT0hTNietO7 lfmxjvI5uYxuzhc/4B7x+YpArQyqRk1zJtISr0u6H6p8S2/4bk2JYexJdcsAhRH7G683 qIqcahjkjTaYppNhPZT8ncJ2yMSldphdYQ/GVXODr8bIuBoTkus4pOcbya9RkzomuO1L pqkOBWFCCUpWRHrfdJdfnYPbTnTKbpcOFRA3O6IPhXoVpPe9Dmhpj+efv8K709sTfC36 r0Jmlf7zcpf0EhGtq6uT+jx/56XB9GeWmU+ckaemFQSiJKs9G5CgOwYAr60W/0Tx/729 n1ig== X-Gm-Message-State: AKGB3mJ9dS8wbXOAcb9YNXggfYC7/YhBytGJ1bUHaG+XRYGA3+4DQjJh EXI5E21s0u8v2y0v+BCsmjK4PA== 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171206_035456_492374_EF585BC4 X-CRM114-Status: GOOD ( 11.84 ) 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)) {