From owner-svn-src-head@freebsd.org Sat Apr 9 11:23:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74BC0B07674; Sat, 9 Apr 2016 11:23:47 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43187124D; Sat, 9 Apr 2016 11:23:47 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u39BNkA9029422; Sat, 9 Apr 2016 11:23:46 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u39BNknO029421; Sat, 9 Apr 2016 11:23:46 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201604091123.u39BNknO029421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sat, 9 Apr 2016 11:23:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297739 - head/sys/arm/allwinner/a20 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Apr 2016 11:23:47 -0000 Author: jmcneill Date: Sat Apr 9 11:23:46 2016 New Revision: 297739 URL: https://svnweb.freebsd.org/changeset/base/297739 Log: Enable PHY regulator when the optional "phy-supply" property is present. Submitted by: Emmanuel Vadot Modified: head/sys/arm/allwinner/a20/a20_if_dwc.c Modified: head/sys/arm/allwinner/a20/a20_if_dwc.c ============================================================================== --- head/sys/arm/allwinner/a20/a20_if_dwc.c Sat Apr 9 10:58:08 2016 (r297738) +++ head/sys/arm/allwinner/a20/a20_if_dwc.c Sat Apr 9 11:23:46 2016 (r297739) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "if_dwc_if.h" @@ -64,6 +65,7 @@ a20_if_dwc_init(device_t dev) const char *tx_parent_name; char *phy_type; clk_t clk_tx, clk_tx_parent; + regulator_t reg; phandle_t node; int error; @@ -96,6 +98,15 @@ a20_if_dwc_init(device_t dev) } } + /* Enable PHY regulator if applicable */ + if (regulator_get_by_ofw_property(dev, "phy-supply", ®) == 0) { + error = regulator_enable(reg); + if (error != 0) { + device_printf(dev, "could not enable PHY regulator\n"); + return (error); + } + } + return (0); }