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: 13434 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id B371123E1A for ; Mon, 10 Dec 2012 08:56:22 +0000 (UTC) Received: from mail-ie0-f176.google.com (mail-ie0-f176.google.com [209.85.223.176]) by fiordland.canonical.com (Postfix) with ESMTP id 6A07AA18908 for ; Mon, 10 Dec 2012 08:56:22 +0000 (UTC) Received: by mail-ie0-f176.google.com with SMTP id 13so7409239iea.7 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=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=JC8DQ2xp08PW5sywWPFZdKnXoLflOGddKqP1yhAqpdY=; b=pu62rctzLPxDio+TaexmY6K2PI6R9aGWiApG8N4PtsbnJwi3yM9vgJykpXe/HykA7u uPE8tU2/GnzCmLkO6JZt8Z4os8Ip7fKDqEU33qIoYz1W6DbWrfr0swsdDipLZVFpJwWl tsdAPRHUeNPud6Zw5j+Bat9MidX64kP4jyxza6wrIFJRosNHoFcyW4i42ylDy1n683oX NOTCLbojY24obT9tCQIrMY7P0K9wkGU7g8fJebqsNZwudJuDSdcytQyh6N4DBSmWIb1L gxTUMbUW30EO1nJnYez5FuKRhTYrgcZPb28Bmuu/HwAuQQn9GZMgddESwNCERRdNGHNx O+pw== Received: by 10.50.173.34 with SMTP id bh2mr5787685igc.70.1355129781877; Mon, 10 Dec 2012 00:56:21 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp54746igt; Mon, 10 Dec 2012 00:56:21 -0800 (PST) Received: by 10.180.76.203 with SMTP id m11mr9353719wiw.6.1355129780854; Mon, 10 Dec 2012 00:56:20 -0800 (PST) Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by mx.google.com with ESMTPS id c23si13580319wej.140.2012.12.10.00.56.20 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 10 Dec 2012 00:56:20 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.175 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.175; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.175 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-wi0-f175.google.com with SMTP id hm11so865952wib.8 for ; Mon, 10 Dec 2012 00:56:20 -0800 (PST) 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 Cc: arnd@arndb.de, linus.walleij@stericsson.com, ulf.hansson@linaro.org, Lee Jones , Mark Brown 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: ALoCoQmM32LKpEo0AbvDni8NjSE7EeG4lMbyCJcqv6Y8wr3eLf8DYoeO2hTkI+UYNBb3dw0gB3uf 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) {