From patchwork Mon Dec 10 08:55:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 1856051 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 D2D2E3FCF2 for ; Mon, 10 Dec 2012 09:00:03 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1ThzAF-0008D0-D9; Mon, 10 Dec 2012 08:56:39 +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-00088i-7P for linux-arm-kernel@lists.infradead.org; Mon, 10 Dec 2012 08:56:22 +0000 Received: by mail-wi0-f173.google.com with SMTP id hn17so808570wib.0 for ; Mon, 10 Dec 2012 00:56:20 -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=JC8DQ2xp08PW5sywWPFZdKnXoLflOGddKqP1yhAqpdY=; b=HikCU4G9SjSy6OZArJ/LKC77koDR6DNBH2mjeAbddnRZ9XHzluHInK+S9Jn35fvIVk ZxjLr4ooUVW2BbRchVfVjZONMMAkvUbRHENaMZKukDQZZ+lyZDcLj6eS9B/ahn8Tj8/h x3Yprni/YQl8rud1N6GGbZTGTmuw89bRMVM/Qc4re0W7hxNVfc9fuxWTvLtox/yjK5nT 4ibgMC6ckvoLqdof4DbtJka+VboXKRM3saqfvjKKqYx28H6iVtmpdMdN5ZuwJppJWwyI z7MBmjrs66OFM2SF/0eUjYD/622GGA8TZKw6b4oT7clauri5LWhSbjyIXYKZDbQR1xGy qfIQ== Received: by 10.216.54.129 with SMTP id i1mr4945059wec.183.1355129780291; Mon, 10 Dec 2012 00:56:20 -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.18 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 10 Dec 2012 00:56:19 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/12] regulator: gpio-regulator: Demote GPIO Regulator driver to start later Date: Mon, 10 Dec 2012 08:55:50 +0000 Message-Id: <1355129761-8088-2-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: ALoCoQl/NlvyCNp/83I9sFdyvBJy/jx4WQATI7m+0UgLvHWURQwiE9+RM/73GUVbqKYmoR74jSi8 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121210_035622_432073_F7ADD306 X-CRM114-Status: GOOD ( 16.49 ) 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 We have quite a complicated hurdle we need to over-come, and this patch aims to rectify it the best way possible. We're attempting to move some MMC related voltage level-shifters out of platform code and over to the new GPIO Regulator framework. The aim of this change is to void the requirement for two separate call-backs; one from the TC35892 GPIO controller which sets up MMC level-shifter GPIOs and another from the MMCI driver to toggle the lines at the appropriate times. The issues come from device bring-up order during boot, and -EPROBE_DEFER cannot help for this particular use-case. In its current configuration the GPIO Regulator starts first. It parses the Device Tree for 'enable' and 'voltage_select' GPIOs, then requests them. However, the TC35892 GPIO controller isn't up yet so it defers probe(). By the time it re-probes, the MMCI driver has finished its probe and should have toggled the 'enable' and 'voltage_select' lines a few times already by now. The normal course of action would be to defer the MMCI driver too, but these IOS level-shifter regulators aren't present on all platforms, so deferring until one is found would be incorrect. So the best solution is to demote the GPIO Regulator driver, so it starts later than the TC35892 GPIO controller, which is also configured to start at subsys_initcall() time, but before deferred probing time, which starts at late_initcall(), after many of the drivers requiring these regulators would have already started. Cc: Mark Brown Signed-off-by: Lee Jones --- drivers/regulator/gpio-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c index 3ee79c8..1a71be2 100644 --- a/drivers/regulator/gpio-regulator.c +++ b/drivers/regulator/gpio-regulator.c @@ -383,7 +383,7 @@ static int __init gpio_regulator_init(void) { return platform_driver_register(&gpio_regulator_driver); } -subsys_initcall(gpio_regulator_init); +fs_initcall(gpio_regulator_init); static void __exit gpio_regulator_exit(void) {