linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 01/12] regulator: gpio-regulator: Demote GPIO Regulator driver to start later
Date: Mon, 10 Dec 2012 08:55:50 +0000	[thread overview]
Message-ID: <1355129761-8088-2-git-send-email-lee.jones@linaro.org> (raw)
In-Reply-To: <1355129761-8088-1-git-send-email-lee.jones@linaro.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 <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 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)
 {
-- 
1.7.9.5

  reply	other threads:[~2012-12-10  8:55 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-10  8:55 [PATCH 00/12] Functionality add and bug-fixes related to MMCI regulators Lee Jones
2012-12-10  8:55 ` Lee Jones [this message]
2012-12-10 14:07   ` [PATCH 01/12] regulator: gpio-regulator: Demote GPIO Regulator driver to start later Mark Brown
2012-12-10 14:28     ` Lee Jones
2012-12-10 14:31       ` Mark Brown
2012-12-13 11:55         ` Lee Jones
2012-12-14  2:53           ` Mark Brown
2012-12-10  8:55 ` [PATCH 02/12] regulator: gpio-regulator: Only read GPIO [dis|en]able pin if not always-on Lee Jones
2012-12-10 14:10   ` Mark Brown
2012-12-13 11:48     ` Lee Jones
2012-12-14  2:46       ` Mark Brown
2012-12-10  8:55 ` [PATCH 03/12] regulator: gpio-regulator: Fix logical error in for() loop Lee Jones
2012-12-10 14:12   ` Mark Brown
2012-12-10  8:55 ` [PATCH 04/12] regulator: gpio-regulator: gpio_set_value should use cansleep Lee Jones
2012-12-10 14:13   ` Mark Brown
2012-12-10  8:55 ` [PATCH 05/12] mmc: mmci: Move ios_handler functionality into the driver Lee Jones
2012-12-10  8:55 ` [PATCH 06/12] ARM: ux500: Set correct MMCI regulator voltages in the ux5x0 Device Tree Lee Jones
2012-12-11  9:17   ` Linus Walleij
2012-12-11  9:37     ` Ulf Hansson
2012-12-11  9:54       ` Lee Jones
2012-12-10  8:55 ` [PATCH 07/12] ARM: ux500: Specify the ux5x0 MMCI regulator's on/off GPIO as high-enable Lee Jones
2012-12-11  9:17   ` Linus Walleij
2012-12-10  8:55 ` [PATCH 08/12] ARM: ux500: Specify which IOS regulator to use for MMCI Lee Jones
2012-12-11  9:18   ` Linus Walleij
2012-12-10  8:55 ` [PATCH 09/12] ARM: ux500: Use the correct name when supplying a GPIO enable pin Lee Jones
2012-12-11  9:18   ` Linus Walleij
2012-12-10  8:55 ` [PATCH 10/12] ARM: ux500: Setup correct settling time for the MMCI regulator Lee Jones
2012-12-11  9:18   ` Linus Walleij
2012-12-10  8:56 ` [PATCH 11/12] ARM: ux500: Use the GPIO regulator framework for SDI0's 'en' and 'vsel' Lee Jones
2012-12-10 10:18   ` Ulf Hansson
2012-12-10 10:20     ` Ulf Hansson
2012-12-10 10:30     ` Lee Jones
2012-12-10 12:06       ` Ulf Hansson
2012-12-10 11:08   ` [PATCH 11/12 v2] " Lee Jones
2012-12-10 12:20     ` Ulf Hansson
2012-12-10  8:56 ` [PATCH 12/12] ARM: ux500: Remove traces of the ios_handler from platform code Lee Jones
2012-12-11  9:19   ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1355129761-8088-2-git-send-email-lee.jones@linaro.org \
    --to=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).