From patchwork Mon Dec 10 08:55:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 1856061 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 3E7F03FCF2 for ; Mon, 10 Dec 2012 09:00:15 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1ThzAQ-0008E3-33; Mon, 10 Dec 2012 08:56:50 +0000 Received: from mail-wi0-f173.google.com ([209.85.212.173]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Thz9y-00088u-Q9 for linux-arm-kernel@lists.infradead.org; Mon, 10 Dec 2012 08:56:23 +0000 Received: by mail-wi0-f173.google.com with SMTP id hn17so808577wib.0 for ; Mon, 10 Dec 2012 00:56:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=YR6X2HmrdtnnkOce1TnVOM+9X3mxD9nhFe6sznQ7ylQ=; b=UFErUZzVEz+jyBnAuauakzyJZ6eEaC62e6QzTKgOzQKirUW1SrqsQmHqul8Rf34yIl redUSTrrQtRFmQ0nMA2cYQdPFCxEXM4xqRIvYRuNmpv/PMONBkZTa3VBeLLy/4lSfEPp lzU/z4BtstTIHCqlZA4TspRHYXSHIKHhwNWXf7jMSIdNL+I6xQ0oZfMRNSL6gpxvAp/5 9Xyx2/wzT9/YXVeJEt6k7kO8PO7BUIYz2kCtM0ucH1JX5xxantSmLeHJKPckcGFTTfI8 oZPiayz3wgMYoEFcwWG4VtAuQPxIgV2q5Dgtp4aXhEOPcslzNgxVfX1hgDP3x1nM7KhW d2Xg== Received: by 10.180.99.227 with SMTP id et3mr9354751wib.6.1355129781752; Mon, 10 Dec 2012 00:56:21 -0800 (PST) Received: from localhost.localdomain (cpc1-aztw13-0-0-cust473.18-1.cable.virginmedia.com. [77.102.241.218]) by mx.google.com with ESMTPS id fv2sm9173114wib.4.2012.12.10.00.56.20 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 10 Dec 2012 00:56:21 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/12] regulator: gpio-regulator: Only read GPIO [dis|en]able pin if not always-on Date: Mon, 10 Dec 2012 08:55:51 +0000 Message-Id: <1355129761-8088-3-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1355129761-8088-1-git-send-email-lee.jones@linaro.org> References: <1355129761-8088-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQmWW6UMao1ttxbZlkrKkxsW1oXsnbzRvetAAY337UOnyCZE6u27mH+IPuw/MHaMfcDa7RPJ X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121210_035623_006888_2ACB7318 X-CRM114-Status: GOOD ( 12.30 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.173 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: ulf.hansson@linaro.org, Mark Brown , Lee Jones , linus.walleij@stericsson.com, arnd@arndb.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org If a regulator is specified as always-on, then it can't have an enable/disable pin, as it can't be turned off. Cc: Mark Brown Signed-off-by: Lee Jones --- drivers/regulator/gpio-regulator.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c index 1a71be2..3afa46a 100644 --- a/drivers/regulator/gpio-regulator.c +++ b/drivers/regulator/gpio-regulator.c @@ -160,7 +160,14 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np) of_property_read_u32(np, "startup-delay-us", &config->startup_delay); - config->enable_gpio = of_get_named_gpio(np, "enable-gpio", 0); + if (!config->init_data->constraints.always_on) { + config->enable_gpio = of_get_named_gpio(np, "enable-gpio", 0); + if (config->enable_gpio < 0) { + dev_err(dev, "Couldn't get 'enable-gpio' (%d)\n", + config->enable_gpio); + return ERR_PTR(config->enable_gpio); + } + } /* Fetch GPIOs. */ for (i = 0; ; i++)