From owner-svn-src-projects@FreeBSD.ORG Tue Feb 21 06:11:30 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06D9B1065672; Tue, 21 Feb 2012 06:11:30 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE28E8FC12; Tue, 21 Feb 2012 06:11:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1L6BToA085824; Tue, 21 Feb 2012 06:11:29 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1L6BTPP085822; Tue, 21 Feb 2012 06:11:29 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202210611.q1L6BTPP085822@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 21 Feb 2012 06:11:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231963 - projects/armv6/sys/arm/ti X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2012 06:11:30 -0000 Author: gonzo Date: Tue Feb 21 06:11:29 2012 New Revision: 231963 URL: http://svn.freebsd.org/changeset/base/231963 Log: Partially enable voltage regulator support. Actual regulator name should be obtained from FDT blob Modified: projects/armv6/sys/arm/ti/omap_mmc.c Modified: projects/armv6/sys/arm/ti/omap_mmc.c ============================================================================== --- projects/armv6/sys/arm/ti/omap_mmc.c Tue Feb 21 06:10:35 2012 (r231962) +++ projects/armv6/sys/arm/ti/omap_mmc.c Tue Feb 21 06:11:29 2012 (r231963) @@ -87,10 +87,8 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef TWL_SUPPORTED -#include -#include -#endif +#include +#include #ifdef DEBUG #define omap_mmc_dbg(sc, fmt, args...) \ @@ -119,10 +117,8 @@ struct omap_mmc_softc { device_t sc_gpio_dev; int sc_wp_gpio_pin; /* GPIO pin for MMC write protect */ -#ifdef TWL_SUPPORTED device_t sc_vreg_dev; const char* sc_vreg_name; -#endif struct mtx sc_mtx; @@ -944,11 +940,9 @@ omap_mmc_update_ios(device_t brdev, devi omap_mmc_write_4(sc, MMCHS_HCTL, hctl_reg); -#ifdef TWL_SUPPORTED /* Set the desired voltage on the regulator */ if (sc->sc_vreg_dev && sc->sc_vreg_name) twl_vreg_set_voltage(sc->sc_vreg_dev, sc->sc_vreg_name, mv); -#endif /* Enable the bus power */ omap_mmc_write_4(sc, MMCHS_HCTL, (hctl_reg | MMCHS_HCTL_SDBP)); @@ -964,11 +958,9 @@ omap_mmc_update_ios(device_t brdev, devi hctl_reg = omap_mmc_read_4(sc, MMCHS_HCTL); omap_mmc_write_4(sc, MMCHS_HCTL, (hctl_reg & ~MMCHS_HCTL_SDBP)); -#ifdef TWL_SUPPORTED /* Turn the power off on the voltage regulator */ if (sc->sc_vreg_dev && sc->sc_vreg_name) twl_vreg_set_voltage(sc->sc_vreg_dev, sc->sc_vreg_name, 0); -#endif } else if (ios->power_mode == power_on) { /* Force a card re-initialisation sequence */ @@ -1611,19 +1603,18 @@ omap_mmc_attach(device_t dev) GPIO_PIN_INPUT); } -#ifdef TWL_SUPPORTED /* Get the TWL voltage regulator device, we need this to for setting the * voltage of the bus on certain OMAP platforms. */ - if (resource_string_value("omap_mmc", unit, "vreg", &sc->sc_vreg_name) != 0){ + sc->sc_vreg_name = NULL; + + /* TODO: add voltage regulator knob to FDT */ +#ifdef notyet + sc->sc_vreg_dev = devclass_get_device(devclass_find("twl_vreg"), 0); + if (sc->sc_vreg_dev == NULL) { + device_printf(dev, "Error: failed to get the votlage regulator" + " device\n"); sc->sc_vreg_name = NULL; - } else { - sc->sc_vreg_dev = devclass_get_device(devclass_find("twl_vreg"), 0); - if (sc->sc_vreg_dev == NULL) { - device_printf(dev, "Error: failed to get the votlage regulator" - " device\n"); - sc->sc_vreg_name = NULL; - } } #endif