All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/8] Functionality add and bug-fixes related to MMCI regulators
@ 2012-12-13 13:22 ` Lee Jones
  0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2012-12-13 13:22 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel; +Cc: arnd, linus.walleij, ulf.hansson

The main purpose of this patch-set is to move the MMCI's secondary
(platform specific) regulator implementation out of platform code
and into use the regulator frame-work. A few bugs were encountered
along the way, so we've fixed those too and bundled them in for
completeness.

 arch/arm/boot/dts/dbx5x0.dtsi                 |    5 ++-
 arch/arm/boot/dts/href.dtsi                   |    1 +
 arch/arm/boot/dts/hrefprev60.dts              |    2 +-
 arch/arm/mach-ux500/board-mop500-regulators.c |   14 +++++++
 arch/arm/mach-ux500/board-mop500-regulators.h |    1 +
 arch/arm/mach-ux500/board-mop500-sdi.c        |   52 -------------------------
 arch/arm/mach-ux500/board-mop500.c            |   44 +++++++++++++++++++++
 drivers/mmc/host/mmci.c                       |   22 +++++++++++
 drivers/mmc/host/mmci.h                       |    1 +
 9 files changed, 88 insertions(+), 54 deletions(-)


^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 1/8] Functionality add and bug-fixes related to MMCI regulators
@ 2012-12-13 13:22 ` Lee Jones
  0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2012-12-13 13:22 UTC (permalink / raw)
  To: linux-arm-kernel

The main purpose of this patch-set is to move the MMCI's secondary
(platform specific) regulator implementation out of platform code
and into use the regulator frame-work. A few bugs were encountered
along the way, so we've fixed those too and bundled them in for
completeness.

 arch/arm/boot/dts/dbx5x0.dtsi                 |    5 ++-
 arch/arm/boot/dts/href.dtsi                   |    1 +
 arch/arm/boot/dts/hrefprev60.dts              |    2 +-
 arch/arm/mach-ux500/board-mop500-regulators.c |   14 +++++++
 arch/arm/mach-ux500/board-mop500-regulators.h |    1 +
 arch/arm/mach-ux500/board-mop500-sdi.c        |   52 -------------------------
 arch/arm/mach-ux500/board-mop500.c            |   44 +++++++++++++++++++++
 drivers/mmc/host/mmci.c                       |   22 +++++++++++
 drivers/mmc/host/mmci.h                       |    1 +
 9 files changed, 88 insertions(+), 54 deletions(-)

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 1/8] mmc: mmci: Move ios_handler functionality into the driver
  2012-12-13 13:22 ` Lee Jones
@ 2012-12-13 13:22   ` Lee Jones
  -1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2012-12-13 13:22 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: arnd, linus.walleij, ulf.hansson, Lee Jones, Chris Ball, Russell King

There are currently two instances of the ios_handler being used.
Both of which mearly toy with some regulator settings. Now there
is a GPIO regulator API, we can use that instead, and lessen the
per platform burden. By doing this, we also become more Device
Tree compatible.

Cc: Chris Ball <cjb@laptop.org>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Ulf Hansson <ulf.hansson@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mmc/host/mmci.c |   22 ++++++++++++++++++++++
 drivers/mmc/host/mmci.h |    1 +
 2 files changed, 23 insertions(+)

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index edc3e9b..d45c931 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -1091,6 +1091,16 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 	case MMC_POWER_OFF:
 		if (host->vcc)
 			ret = mmc_regulator_set_ocr(mmc, host->vcc, 0);
+
+		if (host->vqmmc) {
+			if (regulator_is_enabled(host->vqmmc)) {
+				ret = regulator_disable(host->vqmmc);
+				if (ret < 0)
+					dev_warn(mmc_dev(mmc),
+						 "unable to disable vmmc-ios\n");
+			}
+		}
+
 		break;
 	case MMC_POWER_UP:
 		if (host->vcc) {
@@ -1115,6 +1125,14 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 
 		break;
 	case MMC_POWER_ON:
+		if (host->vqmmc)
+			if (!regulator_is_enabled(host->vqmmc)) {
+				ret = regulator_enable(host->vqmmc);
+				if (ret < 0)
+					dev_warn(mmc_dev(mmc),
+						 "unable to enable vmmc-ios\n");
+			}
+
 		pwr |= MCI_PWR_ON;
 		break;
 	}
@@ -1379,6 +1397,10 @@ static int __devinit mmci_probe(struct amba_device *dev,
 				 "(using regulator instead)\n");
 		}
 	}
+
+	host->vqmmc = regulator_get(&dev->dev, "vqmmc");
+	if (IS_ERR(host->vqmmc))
+		host->vqmmc = NULL;
 #endif
 	/* Fall back to platform data if no regulator is found */
 	if (host->vcc == NULL)
diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h
index d437ccf..b87d9e2 100644
--- a/drivers/mmc/host/mmci.h
+++ b/drivers/mmc/host/mmci.h
@@ -194,6 +194,7 @@ struct mmci_host {
 	struct sg_mapping_iter	sg_miter;
 	unsigned int		size;
 	struct regulator	*vcc;
+	struct regulator	*vqmmc;
 
 #ifdef CONFIG_DMA_ENGINE
 	/* DMA stuff */
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 1/8] mmc: mmci: Move ios_handler functionality into the driver
@ 2012-12-13 13:22   ` Lee Jones
  0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2012-12-13 13:22 UTC (permalink / raw)
  To: linux-arm-kernel

There are currently two instances of the ios_handler being used.
Both of which mearly toy with some regulator settings. Now there
is a GPIO regulator API, we can use that instead, and lessen the
per platform burden. By doing this, we also become more Device
Tree compatible.

Cc: Chris Ball <cjb@laptop.org>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Ulf Hansson <ulf.hansson@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mmc/host/mmci.c |   22 ++++++++++++++++++++++
 drivers/mmc/host/mmci.h |    1 +
 2 files changed, 23 insertions(+)

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index edc3e9b..d45c931 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -1091,6 +1091,16 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 	case MMC_POWER_OFF:
 		if (host->vcc)
 			ret = mmc_regulator_set_ocr(mmc, host->vcc, 0);
+
+		if (host->vqmmc) {
+			if (regulator_is_enabled(host->vqmmc)) {
+				ret = regulator_disable(host->vqmmc);
+				if (ret < 0)
+					dev_warn(mmc_dev(mmc),
+						 "unable to disable vmmc-ios\n");
+			}
+		}
+
 		break;
 	case MMC_POWER_UP:
 		if (host->vcc) {
@@ -1115,6 +1125,14 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 
 		break;
 	case MMC_POWER_ON:
+		if (host->vqmmc)
+			if (!regulator_is_enabled(host->vqmmc)) {
+				ret = regulator_enable(host->vqmmc);
+				if (ret < 0)
+					dev_warn(mmc_dev(mmc),
+						 "unable to enable vmmc-ios\n");
+			}
+
 		pwr |= MCI_PWR_ON;
 		break;
 	}
@@ -1379,6 +1397,10 @@ static int __devinit mmci_probe(struct amba_device *dev,
 				 "(using regulator instead)\n");
 		}
 	}
+
+	host->vqmmc = regulator_get(&dev->dev, "vqmmc");
+	if (IS_ERR(host->vqmmc))
+		host->vqmmc = NULL;
 #endif
 	/* Fall back to platform data if no regulator is found */
 	if (host->vcc == NULL)
diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h
index d437ccf..b87d9e2 100644
--- a/drivers/mmc/host/mmci.h
+++ b/drivers/mmc/host/mmci.h
@@ -194,6 +194,7 @@ struct mmci_host {
 	struct sg_mapping_iter	sg_miter;
 	unsigned int		size;
 	struct regulator	*vcc;
+	struct regulator	*vqmmc;
 
 #ifdef CONFIG_DMA_ENGINE
 	/* DMA stuff */
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 2/8] ARM: ux500: Set correct MMCI regulator voltages in the ux5x0 Device Tree
  2012-12-13 13:22 ` Lee Jones
@ 2012-12-13 13:22   ` Lee Jones
  -1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2012-12-13 13:22 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: arnd, linus.walleij, ulf.hansson, Lee Jones

Correct the voltage specified by the mmci regulator node in Device
Tree. Despite the MMC subsystem insisting on v3.3, we actually only
offer v2.9, and not v2.6 which must have actually been a typo.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/dbx5x0.dtsi |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.dtsi
index 9f55363..6b1aa6d 100644
--- a/arch/arm/boot/dts/dbx5x0.dtsi
+++ b/arch/arm/boot/dts/dbx5x0.dtsi
@@ -634,7 +634,7 @@
 			compatible = "regulator-gpio";
 
 			regulator-min-microvolt = <1800000>;
-			regulator-max-microvolt = <2600000>;
+			regulator-max-microvolt = <2900000>;
 			regulator-name = "mmci-reg";
 			regulator-type = "voltage";
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 2/8] ARM: ux500: Set correct MMCI regulator voltages in the ux5x0 Device Tree
@ 2012-12-13 13:22   ` Lee Jones
  0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2012-12-13 13:22 UTC (permalink / raw)
  To: linux-arm-kernel

Correct the voltage specified by the mmci regulator node in Device
Tree. Despite the MMC subsystem insisting on v3.3, we actually only
offer v2.9, and not v2.6 which must have actually been a typo.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/dbx5x0.dtsi |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.dtsi
index 9f55363..6b1aa6d 100644
--- a/arch/arm/boot/dts/dbx5x0.dtsi
+++ b/arch/arm/boot/dts/dbx5x0.dtsi
@@ -634,7 +634,7 @@
 			compatible = "regulator-gpio";
 
 			regulator-min-microvolt = <1800000>;
-			regulator-max-microvolt = <2600000>;
+			regulator-max-microvolt = <2900000>;
 			regulator-name = "mmci-reg";
 			regulator-type = "voltage";
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 3/8] ARM: ux500: Specify the ux5x0 MMCI regulator's on/off GPIO as high-enable
  2012-12-13 13:22 ` Lee Jones
@ 2012-12-13 13:22   ` Lee Jones
  -1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2012-12-13 13:22 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: arnd, linus.walleij, ulf.hansson, Lee Jones

If not specified, the GPIO control bit is inverted by default i.e.
low-enable and high-disable. This is not the case with the MMCI
regulator, hence it will turn on during a disable and off when
regulator_enable() is invoked.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/dbx5x0.dtsi |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.dtsi
index 6b1aa6d..88f90217 100644
--- a/arch/arm/boot/dts/dbx5x0.dtsi
+++ b/arch/arm/boot/dts/dbx5x0.dtsi
@@ -638,6 +638,8 @@
 			regulator-name = "mmci-reg";
 			regulator-type = "voltage";
 
+			enable-active-high;
+
 			states = <1800000 0x1
 				  2900000 0x0>;
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 3/8] ARM: ux500: Specify the ux5x0 MMCI regulator's on/off GPIO as high-enable
@ 2012-12-13 13:22   ` Lee Jones
  0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2012-12-13 13:22 UTC (permalink / raw)
  To: linux-arm-kernel

If not specified, the GPIO control bit is inverted by default i.e.
low-enable and high-disable. This is not the case with the MMCI
regulator, hence it will turn on during a disable and off when
regulator_enable() is invoked.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/dbx5x0.dtsi |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.dtsi
index 6b1aa6d..88f90217 100644
--- a/arch/arm/boot/dts/dbx5x0.dtsi
+++ b/arch/arm/boot/dts/dbx5x0.dtsi
@@ -638,6 +638,8 @@
 			regulator-name = "mmci-reg";
 			regulator-type = "voltage";
 
+			enable-active-high;
+
 			states = <1800000 0x1
 				  2900000 0x0>;
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 4/8] ARM: ux500: Specify which IOS regulator to use for MMCI
  2012-12-13 13:22 ` Lee Jones
@ 2012-12-13 13:22   ` Lee Jones
  -1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2012-12-13 13:22 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: arnd, linus.walleij, ulf.hansson, Lee Jones

In an effort to move platform specific GPIO controlled regulators
out from platform code we've created a new mechanism to specify
them from within the MMCI driver using the supply name 'vmmc-ios'.
For that to happen when booting device tree, we need to supply it
in the MMCI (SDI) node.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/href.dtsi |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/href.dtsi b/arch/arm/boot/dts/href.dtsi
index 592fb9d..f2c0f66 100644
--- a/arch/arm/boot/dts/href.dtsi
+++ b/arch/arm/boot/dts/href.dtsi
@@ -87,6 +87,7 @@
 			mmc-cap-sd-highspeed;
 			mmc-cap-mmc-highspeed;
 			vmmc-supply = <&ab8500_ldo_aux3_reg>;
+			vqmmc-supply = <&vmmci>;
 
 			cd-gpios  = <&tc3589x_gpio 3 0x4>;
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 4/8] ARM: ux500: Specify which IOS regulator to use for MMCI
@ 2012-12-13 13:22   ` Lee Jones
  0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2012-12-13 13:22 UTC (permalink / raw)
  To: linux-arm-kernel

In an effort to move platform specific GPIO controlled regulators
out from platform code we've created a new mechanism to specify
them from within the MMCI driver using the supply name 'vmmc-ios'.
For that to happen when booting device tree, we need to supply it
in the MMCI (SDI) node.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/href.dtsi |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/href.dtsi b/arch/arm/boot/dts/href.dtsi
index 592fb9d..f2c0f66 100644
--- a/arch/arm/boot/dts/href.dtsi
+++ b/arch/arm/boot/dts/href.dtsi
@@ -87,6 +87,7 @@
 			mmc-cap-sd-highspeed;
 			mmc-cap-mmc-highspeed;
 			vmmc-supply = <&ab8500_ldo_aux3_reg>;
+			vqmmc-supply = <&vmmci>;
 
 			cd-gpios  = <&tc3589x_gpio 3 0x4>;
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 5/8] ARM: ux500: Use the correct name when supplying a GPIO enable pin
  2012-12-13 13:22 ` Lee Jones
@ 2012-12-13 13:22   ` Lee Jones
  -1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2012-12-13 13:22 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: arnd, linus.walleij, ulf.hansson, Lee Jones

Correct a typo in the Device Tree source file, where instead of
specifying property 'enable-gpio', which the driver is expecting
we specified 'gpio-enable' instead.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/hrefprev60.dts |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/hrefprev60.dts b/arch/arm/boot/dts/hrefprev60.dts
index eec29c4..9194fb6 100644
--- a/arch/arm/boot/dts/hrefprev60.dts
+++ b/arch/arm/boot/dts/hrefprev60.dts
@@ -40,7 +40,7 @@
 
 		vmmci: regulator-gpio {
 			gpios = <&tc3589x_gpio 18 0x4>;
-			gpio-enable = <&tc3589x_gpio 17 0x4>;
+			enable-gpio = <&tc3589x_gpio 17 0x4>;
 
 			status = "okay";
 		};
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 5/8] ARM: ux500: Use the correct name when supplying a GPIO enable pin
@ 2012-12-13 13:22   ` Lee Jones
  0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2012-12-13 13:22 UTC (permalink / raw)
  To: linux-arm-kernel

Correct a typo in the Device Tree source file, where instead of
specifying property 'enable-gpio', which the driver is expecting
we specified 'gpio-enable' instead.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/hrefprev60.dts |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/hrefprev60.dts b/arch/arm/boot/dts/hrefprev60.dts
index eec29c4..9194fb6 100644
--- a/arch/arm/boot/dts/hrefprev60.dts
+++ b/arch/arm/boot/dts/hrefprev60.dts
@@ -40,7 +40,7 @@
 
 		vmmci: regulator-gpio {
 			gpios = <&tc3589x_gpio 18 0x4>;
-			gpio-enable = <&tc3589x_gpio 17 0x4>;
+			enable-gpio = <&tc3589x_gpio 17 0x4>;
 
 			status = "okay";
 		};
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 6/8] ARM: ux500: Setup correct settling time for the MMCI regulator
  2012-12-13 13:22 ` Lee Jones
@ 2012-12-13 13:22   ` Lee Jones
  -1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2012-12-13 13:22 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: arnd, linus.walleij, ulf.hansson, Lee Jones

The GPIO controlled MMCI regulator used on the ux5x0 boards takes
100us to settle. There's already a binding to provide such
information. Let's make use of it.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/dbx5x0.dtsi |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.dtsi
index 88f90217..208fe8b 100644
--- a/arch/arm/boot/dts/dbx5x0.dtsi
+++ b/arch/arm/boot/dts/dbx5x0.dtsi
@@ -638,6 +638,7 @@
 			regulator-name = "mmci-reg";
 			regulator-type = "voltage";
 
+			startup-delay-us = <100>;
 			enable-active-high;
 
 			states = <1800000 0x1
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 6/8] ARM: ux500: Setup correct settling time for the MMCI regulator
@ 2012-12-13 13:22   ` Lee Jones
  0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2012-12-13 13:22 UTC (permalink / raw)
  To: linux-arm-kernel

The GPIO controlled MMCI regulator used on the ux5x0 boards takes
100us to settle. There's already a binding to provide such
information. Let's make use of it.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/dbx5x0.dtsi |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.dtsi
index 88f90217..208fe8b 100644
--- a/arch/arm/boot/dts/dbx5x0.dtsi
+++ b/arch/arm/boot/dts/dbx5x0.dtsi
@@ -638,6 +638,7 @@
 			regulator-name = "mmci-reg";
 			regulator-type = "voltage";
 
+			startup-delay-us = <100>;
 			enable-active-high;
 
 			states = <1800000 0x1
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 7/8] ARM: ux500: Use the GPIO regulator framework for SDI0's 'en' and 'vsel'
  2012-12-13 13:22 ` Lee Jones
@ 2012-12-13 13:22   ` Lee Jones
  -1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2012-12-13 13:22 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: arnd, linus.walleij, ulf.hansson, Lee Jones

To prevent lots of unnecessary call-backs into platform code, we're
now using the GPIO regulator framework to control the 'enable' (en)
and 'voltage select' (vsel) GPIO pins which in turn control the
MMCI's secondary regulator settings. This already works with Device
Tree, but when booting with ATAGs we need to register it as a
platform device.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/mach-ux500/board-mop500-regulators.c |   14 ++++++++
 arch/arm/mach-ux500/board-mop500-regulators.h |    1 +
 arch/arm/mach-ux500/board-mop500.c            |   44 +++++++++++++++++++++++++
 3 files changed, 59 insertions(+)

diff --git a/arch/arm/mach-ux500/board-mop500-regulators.c b/arch/arm/mach-ux500/board-mop500-regulators.c
index 2a17bc5..cb75405 100644
--- a/arch/arm/mach-ux500/board-mop500-regulators.c
+++ b/arch/arm/mach-ux500/board-mop500-regulators.c
@@ -28,6 +28,20 @@ struct regulator_init_data gpio_en_3v3_regulator = {
        .consumer_supplies = gpio_en_3v3_consumers,
 };
 
+static struct regulator_consumer_supply sdi0_reg_consumers[] = {
+        REGULATOR_SUPPLY("vqmmc", "sdi0"),
+};
+
+struct regulator_init_data sdi0_reg_init_data = {
+        .constraints = {
+                .min_uV         = 1800000,
+                .max_uV         = 2900000,
+                .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE|REGULATOR_CHANGE_STATUS,
+        },
+        .num_consumer_supplies  = ARRAY_SIZE(sdi0_reg_consumers),
+        .consumer_supplies      = sdi0_reg_consumers,
+};
+
 /*
  * TPS61052 regulator
  */
diff --git a/arch/arm/mach-ux500/board-mop500-regulators.h b/arch/arm/mach-ux500/board-mop500-regulators.h
index 78a0642..0c79d90 100644
--- a/arch/arm/mach-ux500/board-mop500-regulators.h
+++ b/arch/arm/mach-ux500/board-mop500-regulators.h
@@ -19,5 +19,6 @@ ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS];
 extern struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS];
 extern struct regulator_init_data tps61052_regulator;
 extern struct regulator_init_data gpio_en_3v3_regulator;
+extern struct regulator_init_data sdi0_reg_init_data;
 
 #endif
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index daa4237..e934176 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -24,6 +24,8 @@
 #include <linux/mfd/abx500/ab8500.h>
 #include <linux/regulator/ab8500.h>
 #include <linux/regulator/fixed.h>
+#include <linux/regulator/driver.h>
+#include <linux/regulator/gpio-regulator.h>
 #include <linux/mfd/tc3589x.h>
 #include <linux/mfd/tps6105x.h>
 #include <linux/mfd/abx500/ab8500-gpio.h>
@@ -91,6 +93,37 @@ static struct platform_device snowball_gpio_en_3v3_regulator_dev = {
        },
 };
 
+/* Dynamically populated. */
+static struct gpio sdi0_reg_gpios[] = {
+        { 0, GPIOF_OUT_INIT_LOW, "mmci_vsel" },
+};
+
+static struct gpio_regulator_state sdi0_reg_states[] = {
+        { .value = 2900000, .gpios = (0 << 0) },
+        { .value = 1800000, .gpios = (1 << 0) },
+};
+
+static struct gpio_regulator_config sdi0_reg_info = {
+	.supply_name           = "ext-mmc-level-shifter",
+	.gpios                 = sdi0_reg_gpios,
+	.nr_gpios              = ARRAY_SIZE(sdi0_reg_gpios),
+	.states                = sdi0_reg_states,
+	.nr_states             = ARRAY_SIZE(sdi0_reg_states),
+	.type                  = REGULATOR_VOLTAGE,
+	.enable_high           = 1,
+	.enabled_at_boot       = 0,
+	.init_data             = &sdi0_reg_init_data,
+	.startup_delay         = 100,
+};
+
+static struct platform_device sdi0_regulator = {
+        .name = "gpio-regulator",
+        .id   = -1,
+        .dev  = {
+                .platform_data = &sdi0_reg_info,
+        },
+};
+
 static struct ab8500_gpio_platform_data ab8500_gpio_pdata = {
 	.gpio_base		= MOP500_AB8500_PIN_GPIO(1),
 	.irq_base		= MOP500_AB8500_VIR_GPIO_IRQ_BASE,
@@ -440,6 +473,7 @@ static struct hash_platform_data u8500_hash1_platform_data = {
 /* add any platform devices here - TODO */
 static struct platform_device *mop500_platform_devs[] __initdata = {
 	&mop500_gpio_keys_device,
+	&sdi0_regulator,
 };
 
 #ifdef CONFIG_STE_DMA40
@@ -581,6 +615,7 @@ static struct platform_device *snowball_platform_devs[] __initdata = {
 	&snowball_key_dev,
 	&snowball_sbnet_dev,
 	&snowball_gpio_en_3v3_regulator_dev,
+	&sdi0_regulator,
 };
 
 static void __init mop500_init_machine(void)
@@ -591,6 +626,9 @@ static void __init mop500_init_machine(void)
 
 	mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
 
+	sdi0_reg_info.enable_gpio = GPIO_SDMMC_EN;
+	sdi0_reg_info.gpios[0].gpio = GPIO_SDMMC_1V8_3V_SEL;
+
 	mop500_pinmaps_init();
 	parent = u8500_init_devices(&ab8500_platdata);
 
@@ -623,6 +661,9 @@ static void __init snowball_init_machine(void)
 	struct device *parent = NULL;
 	int i;
 
+	sdi0_reg_info.enable_gpio = SNOWBALL_SDMMC_EN_GPIO;
+	sdi0_reg_info.gpios[0].gpio = SNOWBALL_SDMMC_1V8_3V_GPIO;
+
 	snowball_pinmaps_init();
 	parent = u8500_init_devices(&ab8500_platdata);
 
@@ -655,6 +696,9 @@ static void __init hrefv60_init_machine(void)
 	 */
 	mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
 
+	sdi0_reg_info.enable_gpio = HREFV60_SDMMC_EN_GPIO;
+	sdi0_reg_info.gpios[0].gpio = HREFV60_SDMMC_1V8_3V_GPIO;
+
 	hrefv60_pinmaps_init();
 	parent = u8500_init_devices(&ab8500_platdata);
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 7/8] ARM: ux500: Use the GPIO regulator framework for SDI0's 'en' and 'vsel'
@ 2012-12-13 13:22   ` Lee Jones
  0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2012-12-13 13:22 UTC (permalink / raw)
  To: linux-arm-kernel

To prevent lots of unnecessary call-backs into platform code, we're
now using the GPIO regulator framework to control the 'enable' (en)
and 'voltage select' (vsel) GPIO pins which in turn control the
MMCI's secondary regulator settings. This already works with Device
Tree, but when booting with ATAGs we need to register it as a
platform device.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/mach-ux500/board-mop500-regulators.c |   14 ++++++++
 arch/arm/mach-ux500/board-mop500-regulators.h |    1 +
 arch/arm/mach-ux500/board-mop500.c            |   44 +++++++++++++++++++++++++
 3 files changed, 59 insertions(+)

diff --git a/arch/arm/mach-ux500/board-mop500-regulators.c b/arch/arm/mach-ux500/board-mop500-regulators.c
index 2a17bc5..cb75405 100644
--- a/arch/arm/mach-ux500/board-mop500-regulators.c
+++ b/arch/arm/mach-ux500/board-mop500-regulators.c
@@ -28,6 +28,20 @@ struct regulator_init_data gpio_en_3v3_regulator = {
        .consumer_supplies = gpio_en_3v3_consumers,
 };
 
+static struct regulator_consumer_supply sdi0_reg_consumers[] = {
+        REGULATOR_SUPPLY("vqmmc", "sdi0"),
+};
+
+struct regulator_init_data sdi0_reg_init_data = {
+        .constraints = {
+                .min_uV         = 1800000,
+                .max_uV         = 2900000,
+                .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE|REGULATOR_CHANGE_STATUS,
+        },
+        .num_consumer_supplies  = ARRAY_SIZE(sdi0_reg_consumers),
+        .consumer_supplies      = sdi0_reg_consumers,
+};
+
 /*
  * TPS61052 regulator
  */
diff --git a/arch/arm/mach-ux500/board-mop500-regulators.h b/arch/arm/mach-ux500/board-mop500-regulators.h
index 78a0642..0c79d90 100644
--- a/arch/arm/mach-ux500/board-mop500-regulators.h
+++ b/arch/arm/mach-ux500/board-mop500-regulators.h
@@ -19,5 +19,6 @@ ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS];
 extern struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS];
 extern struct regulator_init_data tps61052_regulator;
 extern struct regulator_init_data gpio_en_3v3_regulator;
+extern struct regulator_init_data sdi0_reg_init_data;
 
 #endif
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index daa4237..e934176 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -24,6 +24,8 @@
 #include <linux/mfd/abx500/ab8500.h>
 #include <linux/regulator/ab8500.h>
 #include <linux/regulator/fixed.h>
+#include <linux/regulator/driver.h>
+#include <linux/regulator/gpio-regulator.h>
 #include <linux/mfd/tc3589x.h>
 #include <linux/mfd/tps6105x.h>
 #include <linux/mfd/abx500/ab8500-gpio.h>
@@ -91,6 +93,37 @@ static struct platform_device snowball_gpio_en_3v3_regulator_dev = {
        },
 };
 
+/* Dynamically populated. */
+static struct gpio sdi0_reg_gpios[] = {
+        { 0, GPIOF_OUT_INIT_LOW, "mmci_vsel" },
+};
+
+static struct gpio_regulator_state sdi0_reg_states[] = {
+        { .value = 2900000, .gpios = (0 << 0) },
+        { .value = 1800000, .gpios = (1 << 0) },
+};
+
+static struct gpio_regulator_config sdi0_reg_info = {
+	.supply_name           = "ext-mmc-level-shifter",
+	.gpios                 = sdi0_reg_gpios,
+	.nr_gpios              = ARRAY_SIZE(sdi0_reg_gpios),
+	.states                = sdi0_reg_states,
+	.nr_states             = ARRAY_SIZE(sdi0_reg_states),
+	.type                  = REGULATOR_VOLTAGE,
+	.enable_high           = 1,
+	.enabled_at_boot       = 0,
+	.init_data             = &sdi0_reg_init_data,
+	.startup_delay         = 100,
+};
+
+static struct platform_device sdi0_regulator = {
+        .name = "gpio-regulator",
+        .id   = -1,
+        .dev  = {
+                .platform_data = &sdi0_reg_info,
+        },
+};
+
 static struct ab8500_gpio_platform_data ab8500_gpio_pdata = {
 	.gpio_base		= MOP500_AB8500_PIN_GPIO(1),
 	.irq_base		= MOP500_AB8500_VIR_GPIO_IRQ_BASE,
@@ -440,6 +473,7 @@ static struct hash_platform_data u8500_hash1_platform_data = {
 /* add any platform devices here - TODO */
 static struct platform_device *mop500_platform_devs[] __initdata = {
 	&mop500_gpio_keys_device,
+	&sdi0_regulator,
 };
 
 #ifdef CONFIG_STE_DMA40
@@ -581,6 +615,7 @@ static struct platform_device *snowball_platform_devs[] __initdata = {
 	&snowball_key_dev,
 	&snowball_sbnet_dev,
 	&snowball_gpio_en_3v3_regulator_dev,
+	&sdi0_regulator,
 };
 
 static void __init mop500_init_machine(void)
@@ -591,6 +626,9 @@ static void __init mop500_init_machine(void)
 
 	mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
 
+	sdi0_reg_info.enable_gpio = GPIO_SDMMC_EN;
+	sdi0_reg_info.gpios[0].gpio = GPIO_SDMMC_1V8_3V_SEL;
+
 	mop500_pinmaps_init();
 	parent = u8500_init_devices(&ab8500_platdata);
 
@@ -623,6 +661,9 @@ static void __init snowball_init_machine(void)
 	struct device *parent = NULL;
 	int i;
 
+	sdi0_reg_info.enable_gpio = SNOWBALL_SDMMC_EN_GPIO;
+	sdi0_reg_info.gpios[0].gpio = SNOWBALL_SDMMC_1V8_3V_GPIO;
+
 	snowball_pinmaps_init();
 	parent = u8500_init_devices(&ab8500_platdata);
 
@@ -655,6 +696,9 @@ static void __init hrefv60_init_machine(void)
 	 */
 	mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
 
+	sdi0_reg_info.enable_gpio = HREFV60_SDMMC_EN_GPIO;
+	sdi0_reg_info.gpios[0].gpio = HREFV60_SDMMC_1V8_3V_GPIO;
+
 	hrefv60_pinmaps_init();
 	parent = u8500_init_devices(&ab8500_platdata);
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 8/8] ARM: ux500: Remove traces of the ios_handler from platform code
  2012-12-13 13:22 ` Lee Jones
@ 2012-12-13 13:22   ` Lee Jones
  -1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2012-12-13 13:22 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: arnd, linus.walleij, ulf.hansson, Lee Jones

Now MMCI on/off functionality is using the regulator framework
from the MMCI driver, there is no need to keep the ios_handler
laying around, duplicating functionality. So we're removing it.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/mach-ux500/board-mop500-sdi.c |   52 --------------------------------
 1 file changed, 52 deletions(-)

diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c
index 9c8e4a9..5a798d6 100644
--- a/arch/arm/mach-ux500/board-mop500-sdi.c
+++ b/arch/arm/mach-ux500/board-mop500-sdi.c
@@ -31,35 +31,6 @@
  * SDI 0 (MicroSD slot)
  */
 
-/* GPIO pins used by the sdi0 level shifter */
-static int sdi0_en = -1;
-static int sdi0_vsel = -1;
-
-static int mop500_sdi0_ios_handler(struct device *dev, struct mmc_ios *ios)
-{
-	switch (ios->power_mode) {
-	case MMC_POWER_UP:
-	case MMC_POWER_ON:
-		/*
-		 * Level shifter voltage should depend on vdd to when deciding
-		 * on either 1.8V or 2.9V. Once the decision has been made the
-		 * level shifter must be disabled and re-enabled with a changed
-		 * select signal in order to switch the voltage. Since there is
-		 * no framework support yet for indicating 1.8V in vdd, use the
-		 * default 2.9V.
-		 */
-		gpio_direction_output(sdi0_vsel, 0);
-		gpio_direction_output(sdi0_en, 1);
-		break;
-	case MMC_POWER_OFF:
-		gpio_direction_output(sdi0_vsel, 0);
-		gpio_direction_output(sdi0_en, 0);
-		break;
-	}
-
-	return 0;
-}
-
 #ifdef CONFIG_STE_DMA40
 struct stedma40_chan_cfg mop500_sdi0_dma_cfg_rx = {
 	.mode = STEDMA40_MODE_LOGICAL,
@@ -81,7 +52,6 @@ static struct stedma40_chan_cfg mop500_sdi0_dma_cfg_tx = {
 #endif
 
 struct mmci_platform_data mop500_sdi0_data = {
-	.ios_handler	= mop500_sdi0_ios_handler,
 	.ocr_mask	= MMC_VDD_29_30,
 	.f_max		= 50000000,
 	.capabilities	= MMC_CAP_4_BIT_DATA |
@@ -101,22 +71,6 @@ struct mmci_platform_data mop500_sdi0_data = {
 
 static void sdi0_configure(struct device *parent)
 {
-	int ret;
-
-	ret = gpio_request(sdi0_en, "level shifter enable");
-	if (!ret)
-		ret = gpio_request(sdi0_vsel,
-				   "level shifter 1v8-3v select");
-
-	if (ret) {
-		pr_warning("unable to config sdi0 gpios for level shifter.\n");
-		return;
-	}
-
-	/* Select the default 2.9V and enable level shifter */
-	gpio_direction_output(sdi0_vsel, 0);
-	gpio_direction_output(sdi0_en, 1);
-
 	/* Add the device, force v2 to subrevision 1 */
 	db8500_add_sdi0(parent, &mop500_sdi0_data, U8500_SDI_V2_PERIPHID);
 }
@@ -124,8 +78,6 @@ static void sdi0_configure(struct device *parent)
 void mop500_sdi_tc35892_init(struct device *parent)
 {
 	mop500_sdi0_data.gpio_cd = GPIO_SDMMC_CD;
-	sdi0_en = GPIO_SDMMC_EN;
-	sdi0_vsel = GPIO_SDMMC_1V8_3V_SEL;
 	sdi0_configure(parent);
 }
 
@@ -264,8 +216,6 @@ void __init snowball_sdi_init(struct device *parent)
 	/* External Micro SD slot */
 	mop500_sdi0_data.gpio_cd = SNOWBALL_SDMMC_CD_GPIO;
 	mop500_sdi0_data.cd_invert = true;
-	sdi0_en = SNOWBALL_SDMMC_EN_GPIO;
-	sdi0_vsel = SNOWBALL_SDMMC_1V8_3V_GPIO;
 	sdi0_configure(parent);
 }
 
@@ -277,8 +227,6 @@ void __init hrefv60_sdi_init(struct device *parent)
 	db8500_add_sdi4(parent, &mop500_sdi4_data, U8500_SDI_V2_PERIPHID);
 	/* External Micro SD slot */
 	mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO;
-	sdi0_en = HREFV60_SDMMC_EN_GPIO;
-	sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO;
 	sdi0_configure(parent);
 	/* WLAN SDIO channel */
 	db8500_add_sdi1(parent, &mop500_sdi1_data, U8500_SDI_V2_PERIPHID);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 8/8] ARM: ux500: Remove traces of the ios_handler from platform code
@ 2012-12-13 13:22   ` Lee Jones
  0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2012-12-13 13:22 UTC (permalink / raw)
  To: linux-arm-kernel

Now MMCI on/off functionality is using the regulator framework
from the MMCI driver, there is no need to keep the ios_handler
laying around, duplicating functionality. So we're removing it.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/mach-ux500/board-mop500-sdi.c |   52 --------------------------------
 1 file changed, 52 deletions(-)

diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c
index 9c8e4a9..5a798d6 100644
--- a/arch/arm/mach-ux500/board-mop500-sdi.c
+++ b/arch/arm/mach-ux500/board-mop500-sdi.c
@@ -31,35 +31,6 @@
  * SDI 0 (MicroSD slot)
  */
 
-/* GPIO pins used by the sdi0 level shifter */
-static int sdi0_en = -1;
-static int sdi0_vsel = -1;
-
-static int mop500_sdi0_ios_handler(struct device *dev, struct mmc_ios *ios)
-{
-	switch (ios->power_mode) {
-	case MMC_POWER_UP:
-	case MMC_POWER_ON:
-		/*
-		 * Level shifter voltage should depend on vdd to when deciding
-		 * on either 1.8V or 2.9V. Once the decision has been made the
-		 * level shifter must be disabled and re-enabled with a changed
-		 * select signal in order to switch the voltage. Since there is
-		 * no framework support yet for indicating 1.8V in vdd, use the
-		 * default 2.9V.
-		 */
-		gpio_direction_output(sdi0_vsel, 0);
-		gpio_direction_output(sdi0_en, 1);
-		break;
-	case MMC_POWER_OFF:
-		gpio_direction_output(sdi0_vsel, 0);
-		gpio_direction_output(sdi0_en, 0);
-		break;
-	}
-
-	return 0;
-}
-
 #ifdef CONFIG_STE_DMA40
 struct stedma40_chan_cfg mop500_sdi0_dma_cfg_rx = {
 	.mode = STEDMA40_MODE_LOGICAL,
@@ -81,7 +52,6 @@ static struct stedma40_chan_cfg mop500_sdi0_dma_cfg_tx = {
 #endif
 
 struct mmci_platform_data mop500_sdi0_data = {
-	.ios_handler	= mop500_sdi0_ios_handler,
 	.ocr_mask	= MMC_VDD_29_30,
 	.f_max		= 50000000,
 	.capabilities	= MMC_CAP_4_BIT_DATA |
@@ -101,22 +71,6 @@ struct mmci_platform_data mop500_sdi0_data = {
 
 static void sdi0_configure(struct device *parent)
 {
-	int ret;
-
-	ret = gpio_request(sdi0_en, "level shifter enable");
-	if (!ret)
-		ret = gpio_request(sdi0_vsel,
-				   "level shifter 1v8-3v select");
-
-	if (ret) {
-		pr_warning("unable to config sdi0 gpios for level shifter.\n");
-		return;
-	}
-
-	/* Select the default 2.9V and enable level shifter */
-	gpio_direction_output(sdi0_vsel, 0);
-	gpio_direction_output(sdi0_en, 1);
-
 	/* Add the device, force v2 to subrevision 1 */
 	db8500_add_sdi0(parent, &mop500_sdi0_data, U8500_SDI_V2_PERIPHID);
 }
@@ -124,8 +78,6 @@ static void sdi0_configure(struct device *parent)
 void mop500_sdi_tc35892_init(struct device *parent)
 {
 	mop500_sdi0_data.gpio_cd = GPIO_SDMMC_CD;
-	sdi0_en = GPIO_SDMMC_EN;
-	sdi0_vsel = GPIO_SDMMC_1V8_3V_SEL;
 	sdi0_configure(parent);
 }
 
@@ -264,8 +216,6 @@ void __init snowball_sdi_init(struct device *parent)
 	/* External Micro SD slot */
 	mop500_sdi0_data.gpio_cd = SNOWBALL_SDMMC_CD_GPIO;
 	mop500_sdi0_data.cd_invert = true;
-	sdi0_en = SNOWBALL_SDMMC_EN_GPIO;
-	sdi0_vsel = SNOWBALL_SDMMC_1V8_3V_GPIO;
 	sdi0_configure(parent);
 }
 
@@ -277,8 +227,6 @@ void __init hrefv60_sdi_init(struct device *parent)
 	db8500_add_sdi4(parent, &mop500_sdi4_data, U8500_SDI_V2_PERIPHID);
 	/* External Micro SD slot */
 	mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO;
-	sdi0_en = HREFV60_SDMMC_EN_GPIO;
-	sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO;
 	sdi0_configure(parent);
 	/* WLAN SDIO channel */
 	db8500_add_sdi1(parent, &mop500_sdi1_data, U8500_SDI_V2_PERIPHID);
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [PATCH 7/8] ARM: ux500: Use the GPIO regulator framework for SDI0's 'en' and 'vsel'
  2012-12-13 13:22   ` Lee Jones
@ 2012-12-13 15:09     ` Ulf Hansson
  -1 siblings, 0 replies; 38+ messages in thread
From: Ulf Hansson @ 2012-12-13 15:09 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-arm-kernel, linux-kernel, arnd, linus.walleij

On 13 December 2012 14:22, Lee Jones <lee.jones@linaro.org> wrote:
> To prevent lots of unnecessary call-backs into platform code, we're
> now using the GPIO regulator framework to control the 'enable' (en)
> and 'voltage select' (vsel) GPIO pins which in turn control the
> MMCI's secondary regulator settings. This already works with Device
> Tree, but when booting with ATAGs we need to register it as a
> platform device.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  arch/arm/mach-ux500/board-mop500-regulators.c |   14 ++++++++
>  arch/arm/mach-ux500/board-mop500-regulators.h |    1 +
>  arch/arm/mach-ux500/board-mop500.c            |   44 +++++++++++++++++++++++++
>  3 files changed, 59 insertions(+)
>
> diff --git a/arch/arm/mach-ux500/board-mop500-regulators.c b/arch/arm/mach-ux500/board-mop500-regulators.c
> index 2a17bc5..cb75405 100644
> --- a/arch/arm/mach-ux500/board-mop500-regulators.c
> +++ b/arch/arm/mach-ux500/board-mop500-regulators.c
> @@ -28,6 +28,20 @@ struct regulator_init_data gpio_en_3v3_regulator = {
>         .consumer_supplies = gpio_en_3v3_consumers,
>  };
>
> +static struct regulator_consumer_supply sdi0_reg_consumers[] = {
> +        REGULATOR_SUPPLY("vqmmc", "sdi0"),
> +};
> +
> +struct regulator_init_data sdi0_reg_init_data = {
> +        .constraints = {
> +                .min_uV         = 1800000,
> +                .max_uV         = 2900000,
> +                .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE|REGULATOR_CHANGE_STATUS,
> +        },
> +        .num_consumer_supplies  = ARRAY_SIZE(sdi0_reg_consumers),
> +        .consumer_supplies      = sdi0_reg_consumers,
> +};
> +
>  /*
>   * TPS61052 regulator
>   */
> diff --git a/arch/arm/mach-ux500/board-mop500-regulators.h b/arch/arm/mach-ux500/board-mop500-regulators.h
> index 78a0642..0c79d90 100644
> --- a/arch/arm/mach-ux500/board-mop500-regulators.h
> +++ b/arch/arm/mach-ux500/board-mop500-regulators.h
> @@ -19,5 +19,6 @@ ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS];
>  extern struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS];
>  extern struct regulator_init_data tps61052_regulator;
>  extern struct regulator_init_data gpio_en_3v3_regulator;
> +extern struct regulator_init_data sdi0_reg_init_data;
>
>  #endif
> diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
> index daa4237..e934176 100644
> --- a/arch/arm/mach-ux500/board-mop500.c
> +++ b/arch/arm/mach-ux500/board-mop500.c
> @@ -24,6 +24,8 @@
>  #include <linux/mfd/abx500/ab8500.h>
>  #include <linux/regulator/ab8500.h>
>  #include <linux/regulator/fixed.h>
> +#include <linux/regulator/driver.h>
> +#include <linux/regulator/gpio-regulator.h>
>  #include <linux/mfd/tc3589x.h>
>  #include <linux/mfd/tps6105x.h>
>  #include <linux/mfd/abx500/ab8500-gpio.h>
> @@ -91,6 +93,37 @@ static struct platform_device snowball_gpio_en_3v3_regulator_dev = {
>         },
>  };
>
> +/* Dynamically populated. */
> +static struct gpio sdi0_reg_gpios[] = {
> +        { 0, GPIOF_OUT_INIT_LOW, "mmci_vsel" },
> +};
> +
> +static struct gpio_regulator_state sdi0_reg_states[] = {
> +        { .value = 2900000, .gpios = (0 << 0) },
> +        { .value = 1800000, .gpios = (1 << 0) },
> +};
> +
> +static struct gpio_regulator_config sdi0_reg_info = {
> +       .supply_name           = "ext-mmc-level-shifter",
> +       .gpios                 = sdi0_reg_gpios,
> +       .nr_gpios              = ARRAY_SIZE(sdi0_reg_gpios),
> +       .states                = sdi0_reg_states,
> +       .nr_states             = ARRAY_SIZE(sdi0_reg_states),
> +       .type                  = REGULATOR_VOLTAGE,
> +       .enable_high           = 1,
> +       .enabled_at_boot       = 0,
> +       .init_data             = &sdi0_reg_init_data,
> +       .startup_delay         = 100,
> +};
> +
> +static struct platform_device sdi0_regulator = {
> +        .name = "gpio-regulator",
> +        .id   = -1,
> +        .dev  = {
> +                .platform_data = &sdi0_reg_info,
> +        },
> +};
> +
>  static struct ab8500_gpio_platform_data ab8500_gpio_pdata = {
>         .gpio_base              = MOP500_AB8500_PIN_GPIO(1),
>         .irq_base               = MOP500_AB8500_VIR_GPIO_IRQ_BASE,
> @@ -440,6 +473,7 @@ static struct hash_platform_data u8500_hash1_platform_data = {
>  /* add any platform devices here - TODO */
>  static struct platform_device *mop500_platform_devs[] __initdata = {
>         &mop500_gpio_keys_device,
> +       &sdi0_regulator,
>  };
>
>  #ifdef CONFIG_STE_DMA40
> @@ -581,6 +615,7 @@ static struct platform_device *snowball_platform_devs[] __initdata = {
>         &snowball_key_dev,
>         &snowball_sbnet_dev,
>         &snowball_gpio_en_3v3_regulator_dev,
> +       &sdi0_regulator,
>  };
>
>  static void __init mop500_init_machine(void)
> @@ -591,6 +626,9 @@ static void __init mop500_init_machine(void)
>
>         mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
>
> +       sdi0_reg_info.enable_gpio = GPIO_SDMMC_EN;
> +       sdi0_reg_info.gpios[0].gpio = GPIO_SDMMC_1V8_3V_SEL;
> +
>         mop500_pinmaps_init();
>         parent = u8500_init_devices(&ab8500_platdata);
>
> @@ -623,6 +661,9 @@ static void __init snowball_init_machine(void)
>         struct device *parent = NULL;
>         int i;
>
> +       sdi0_reg_info.enable_gpio = SNOWBALL_SDMMC_EN_GPIO;
> +       sdi0_reg_info.gpios[0].gpio = SNOWBALL_SDMMC_1V8_3V_GPIO;
> +
>         snowball_pinmaps_init();
>         parent = u8500_init_devices(&ab8500_platdata);
>
> @@ -655,6 +696,9 @@ static void __init hrefv60_init_machine(void)
>          */
>         mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
>
> +       sdi0_reg_info.enable_gpio = HREFV60_SDMMC_EN_GPIO;
> +       sdi0_reg_info.gpios[0].gpio = HREFV60_SDMMC_1V8_3V_GPIO;
> +
>         hrefv60_pinmaps_init();
>         parent = u8500_init_devices(&ab8500_platdata);
>
> --
> 1.7.9.5
>


Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 7/8] ARM: ux500: Use the GPIO regulator framework for SDI0's 'en' and 'vsel'
@ 2012-12-13 15:09     ` Ulf Hansson
  0 siblings, 0 replies; 38+ messages in thread
From: Ulf Hansson @ 2012-12-13 15:09 UTC (permalink / raw)
  To: linux-arm-kernel

On 13 December 2012 14:22, Lee Jones <lee.jones@linaro.org> wrote:
> To prevent lots of unnecessary call-backs into platform code, we're
> now using the GPIO regulator framework to control the 'enable' (en)
> and 'voltage select' (vsel) GPIO pins which in turn control the
> MMCI's secondary regulator settings. This already works with Device
> Tree, but when booting with ATAGs we need to register it as a
> platform device.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  arch/arm/mach-ux500/board-mop500-regulators.c |   14 ++++++++
>  arch/arm/mach-ux500/board-mop500-regulators.h |    1 +
>  arch/arm/mach-ux500/board-mop500.c            |   44 +++++++++++++++++++++++++
>  3 files changed, 59 insertions(+)
>
> diff --git a/arch/arm/mach-ux500/board-mop500-regulators.c b/arch/arm/mach-ux500/board-mop500-regulators.c
> index 2a17bc5..cb75405 100644
> --- a/arch/arm/mach-ux500/board-mop500-regulators.c
> +++ b/arch/arm/mach-ux500/board-mop500-regulators.c
> @@ -28,6 +28,20 @@ struct regulator_init_data gpio_en_3v3_regulator = {
>         .consumer_supplies = gpio_en_3v3_consumers,
>  };
>
> +static struct regulator_consumer_supply sdi0_reg_consumers[] = {
> +        REGULATOR_SUPPLY("vqmmc", "sdi0"),
> +};
> +
> +struct regulator_init_data sdi0_reg_init_data = {
> +        .constraints = {
> +                .min_uV         = 1800000,
> +                .max_uV         = 2900000,
> +                .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE|REGULATOR_CHANGE_STATUS,
> +        },
> +        .num_consumer_supplies  = ARRAY_SIZE(sdi0_reg_consumers),
> +        .consumer_supplies      = sdi0_reg_consumers,
> +};
> +
>  /*
>   * TPS61052 regulator
>   */
> diff --git a/arch/arm/mach-ux500/board-mop500-regulators.h b/arch/arm/mach-ux500/board-mop500-regulators.h
> index 78a0642..0c79d90 100644
> --- a/arch/arm/mach-ux500/board-mop500-regulators.h
> +++ b/arch/arm/mach-ux500/board-mop500-regulators.h
> @@ -19,5 +19,6 @@ ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS];
>  extern struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS];
>  extern struct regulator_init_data tps61052_regulator;
>  extern struct regulator_init_data gpio_en_3v3_regulator;
> +extern struct regulator_init_data sdi0_reg_init_data;
>
>  #endif
> diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
> index daa4237..e934176 100644
> --- a/arch/arm/mach-ux500/board-mop500.c
> +++ b/arch/arm/mach-ux500/board-mop500.c
> @@ -24,6 +24,8 @@
>  #include <linux/mfd/abx500/ab8500.h>
>  #include <linux/regulator/ab8500.h>
>  #include <linux/regulator/fixed.h>
> +#include <linux/regulator/driver.h>
> +#include <linux/regulator/gpio-regulator.h>
>  #include <linux/mfd/tc3589x.h>
>  #include <linux/mfd/tps6105x.h>
>  #include <linux/mfd/abx500/ab8500-gpio.h>
> @@ -91,6 +93,37 @@ static struct platform_device snowball_gpio_en_3v3_regulator_dev = {
>         },
>  };
>
> +/* Dynamically populated. */
> +static struct gpio sdi0_reg_gpios[] = {
> +        { 0, GPIOF_OUT_INIT_LOW, "mmci_vsel" },
> +};
> +
> +static struct gpio_regulator_state sdi0_reg_states[] = {
> +        { .value = 2900000, .gpios = (0 << 0) },
> +        { .value = 1800000, .gpios = (1 << 0) },
> +};
> +
> +static struct gpio_regulator_config sdi0_reg_info = {
> +       .supply_name           = "ext-mmc-level-shifter",
> +       .gpios                 = sdi0_reg_gpios,
> +       .nr_gpios              = ARRAY_SIZE(sdi0_reg_gpios),
> +       .states                = sdi0_reg_states,
> +       .nr_states             = ARRAY_SIZE(sdi0_reg_states),
> +       .type                  = REGULATOR_VOLTAGE,
> +       .enable_high           = 1,
> +       .enabled_at_boot       = 0,
> +       .init_data             = &sdi0_reg_init_data,
> +       .startup_delay         = 100,
> +};
> +
> +static struct platform_device sdi0_regulator = {
> +        .name = "gpio-regulator",
> +        .id   = -1,
> +        .dev  = {
> +                .platform_data = &sdi0_reg_info,
> +        },
> +};
> +
>  static struct ab8500_gpio_platform_data ab8500_gpio_pdata = {
>         .gpio_base              = MOP500_AB8500_PIN_GPIO(1),
>         .irq_base               = MOP500_AB8500_VIR_GPIO_IRQ_BASE,
> @@ -440,6 +473,7 @@ static struct hash_platform_data u8500_hash1_platform_data = {
>  /* add any platform devices here - TODO */
>  static struct platform_device *mop500_platform_devs[] __initdata = {
>         &mop500_gpio_keys_device,
> +       &sdi0_regulator,
>  };
>
>  #ifdef CONFIG_STE_DMA40
> @@ -581,6 +615,7 @@ static struct platform_device *snowball_platform_devs[] __initdata = {
>         &snowball_key_dev,
>         &snowball_sbnet_dev,
>         &snowball_gpio_en_3v3_regulator_dev,
> +       &sdi0_regulator,
>  };
>
>  static void __init mop500_init_machine(void)
> @@ -591,6 +626,9 @@ static void __init mop500_init_machine(void)
>
>         mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
>
> +       sdi0_reg_info.enable_gpio = GPIO_SDMMC_EN;
> +       sdi0_reg_info.gpios[0].gpio = GPIO_SDMMC_1V8_3V_SEL;
> +
>         mop500_pinmaps_init();
>         parent = u8500_init_devices(&ab8500_platdata);
>
> @@ -623,6 +661,9 @@ static void __init snowball_init_machine(void)
>         struct device *parent = NULL;
>         int i;
>
> +       sdi0_reg_info.enable_gpio = SNOWBALL_SDMMC_EN_GPIO;
> +       sdi0_reg_info.gpios[0].gpio = SNOWBALL_SDMMC_1V8_3V_GPIO;
> +
>         snowball_pinmaps_init();
>         parent = u8500_init_devices(&ab8500_platdata);
>
> @@ -655,6 +696,9 @@ static void __init hrefv60_init_machine(void)
>          */
>         mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
>
> +       sdi0_reg_info.enable_gpio = HREFV60_SDMMC_EN_GPIO;
> +       sdi0_reg_info.gpios[0].gpio = HREFV60_SDMMC_1V8_3V_GPIO;
> +
>         hrefv60_pinmaps_init();
>         parent = u8500_init_devices(&ab8500_platdata);
>
> --
> 1.7.9.5
>


Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 8/8] ARM: ux500: Remove traces of the ios_handler from platform code
  2012-12-13 13:22   ` Lee Jones
@ 2012-12-14  8:25     ` Ulf Hansson
  -1 siblings, 0 replies; 38+ messages in thread
From: Ulf Hansson @ 2012-12-14  8:25 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-arm-kernel, linux-kernel, arnd, linus.walleij

On 13 December 2012 14:22, Lee Jones <lee.jones@linaro.org> wrote:
> Now MMCI on/off functionality is using the regulator framework
> from the MMCI driver, there is no need to keep the ios_handler
> laying around, duplicating functionality. So we're removing it.
>
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  arch/arm/mach-ux500/board-mop500-sdi.c |   52 --------------------------------
>  1 file changed, 52 deletions(-)
>
> diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c
> index 9c8e4a9..5a798d6 100644
> --- a/arch/arm/mach-ux500/board-mop500-sdi.c
> +++ b/arch/arm/mach-ux500/board-mop500-sdi.c
> @@ -31,35 +31,6 @@
>   * SDI 0 (MicroSD slot)
>   */
>
> -/* GPIO pins used by the sdi0 level shifter */
> -static int sdi0_en = -1;
> -static int sdi0_vsel = -1;
> -
> -static int mop500_sdi0_ios_handler(struct device *dev, struct mmc_ios *ios)
> -{
> -       switch (ios->power_mode) {
> -       case MMC_POWER_UP:
> -       case MMC_POWER_ON:
> -               /*
> -                * Level shifter voltage should depend on vdd to when deciding
> -                * on either 1.8V or 2.9V. Once the decision has been made the
> -                * level shifter must be disabled and re-enabled with a changed
> -                * select signal in order to switch the voltage. Since there is
> -                * no framework support yet for indicating 1.8V in vdd, use the
> -                * default 2.9V.
> -                */
> -               gpio_direction_output(sdi0_vsel, 0);
> -               gpio_direction_output(sdi0_en, 1);
> -               break;
> -       case MMC_POWER_OFF:
> -               gpio_direction_output(sdi0_vsel, 0);
> -               gpio_direction_output(sdi0_en, 0);
> -               break;
> -       }
> -
> -       return 0;
> -}
> -
>  #ifdef CONFIG_STE_DMA40
>  struct stedma40_chan_cfg mop500_sdi0_dma_cfg_rx = {
>         .mode = STEDMA40_MODE_LOGICAL,
> @@ -81,7 +52,6 @@ static struct stedma40_chan_cfg mop500_sdi0_dma_cfg_tx = {
>  #endif
>
>  struct mmci_platform_data mop500_sdi0_data = {
> -       .ios_handler    = mop500_sdi0_ios_handler,
>         .ocr_mask       = MMC_VDD_29_30,
>         .f_max          = 50000000,
>         .capabilities   = MMC_CAP_4_BIT_DATA |
> @@ -101,22 +71,6 @@ struct mmci_platform_data mop500_sdi0_data = {
>
>  static void sdi0_configure(struct device *parent)
>  {
> -       int ret;
> -
> -       ret = gpio_request(sdi0_en, "level shifter enable");
> -       if (!ret)
> -               ret = gpio_request(sdi0_vsel,
> -                                  "level shifter 1v8-3v select");
> -
> -       if (ret) {
> -               pr_warning("unable to config sdi0 gpios for level shifter.\n");
> -               return;
> -       }
> -
> -       /* Select the default 2.9V and enable level shifter */
> -       gpio_direction_output(sdi0_vsel, 0);
> -       gpio_direction_output(sdi0_en, 1);
> -
>         /* Add the device, force v2 to subrevision 1 */
>         db8500_add_sdi0(parent, &mop500_sdi0_data, U8500_SDI_V2_PERIPHID);
>  }
> @@ -124,8 +78,6 @@ static void sdi0_configure(struct device *parent)
>  void mop500_sdi_tc35892_init(struct device *parent)
>  {
>         mop500_sdi0_data.gpio_cd = GPIO_SDMMC_CD;
> -       sdi0_en = GPIO_SDMMC_EN;
> -       sdi0_vsel = GPIO_SDMMC_1V8_3V_SEL;
>         sdi0_configure(parent);
>  }
>
> @@ -264,8 +216,6 @@ void __init snowball_sdi_init(struct device *parent)
>         /* External Micro SD slot */
>         mop500_sdi0_data.gpio_cd = SNOWBALL_SDMMC_CD_GPIO;
>         mop500_sdi0_data.cd_invert = true;
> -       sdi0_en = SNOWBALL_SDMMC_EN_GPIO;
> -       sdi0_vsel = SNOWBALL_SDMMC_1V8_3V_GPIO;
>         sdi0_configure(parent);
>  }
>
> @@ -277,8 +227,6 @@ void __init hrefv60_sdi_init(struct device *parent)
>         db8500_add_sdi4(parent, &mop500_sdi4_data, U8500_SDI_V2_PERIPHID);
>         /* External Micro SD slot */
>         mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO;
> -       sdi0_en = HREFV60_SDMMC_EN_GPIO;
> -       sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO;
>         sdi0_configure(parent);
>         /* WLAN SDIO channel */
>         db8500_add_sdi1(parent, &mop500_sdi1_data, U8500_SDI_V2_PERIPHID);
> --
> 1.7.9.5
>

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 8/8] ARM: ux500: Remove traces of the ios_handler from platform code
@ 2012-12-14  8:25     ` Ulf Hansson
  0 siblings, 0 replies; 38+ messages in thread
From: Ulf Hansson @ 2012-12-14  8:25 UTC (permalink / raw)
  To: linux-arm-kernel

On 13 December 2012 14:22, Lee Jones <lee.jones@linaro.org> wrote:
> Now MMCI on/off functionality is using the regulator framework
> from the MMCI driver, there is no need to keep the ios_handler
> laying around, duplicating functionality. So we're removing it.
>
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  arch/arm/mach-ux500/board-mop500-sdi.c |   52 --------------------------------
>  1 file changed, 52 deletions(-)
>
> diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c
> index 9c8e4a9..5a798d6 100644
> --- a/arch/arm/mach-ux500/board-mop500-sdi.c
> +++ b/arch/arm/mach-ux500/board-mop500-sdi.c
> @@ -31,35 +31,6 @@
>   * SDI 0 (MicroSD slot)
>   */
>
> -/* GPIO pins used by the sdi0 level shifter */
> -static int sdi0_en = -1;
> -static int sdi0_vsel = -1;
> -
> -static int mop500_sdi0_ios_handler(struct device *dev, struct mmc_ios *ios)
> -{
> -       switch (ios->power_mode) {
> -       case MMC_POWER_UP:
> -       case MMC_POWER_ON:
> -               /*
> -                * Level shifter voltage should depend on vdd to when deciding
> -                * on either 1.8V or 2.9V. Once the decision has been made the
> -                * level shifter must be disabled and re-enabled with a changed
> -                * select signal in order to switch the voltage. Since there is
> -                * no framework support yet for indicating 1.8V in vdd, use the
> -                * default 2.9V.
> -                */
> -               gpio_direction_output(sdi0_vsel, 0);
> -               gpio_direction_output(sdi0_en, 1);
> -               break;
> -       case MMC_POWER_OFF:
> -               gpio_direction_output(sdi0_vsel, 0);
> -               gpio_direction_output(sdi0_en, 0);
> -               break;
> -       }
> -
> -       return 0;
> -}
> -
>  #ifdef CONFIG_STE_DMA40
>  struct stedma40_chan_cfg mop500_sdi0_dma_cfg_rx = {
>         .mode = STEDMA40_MODE_LOGICAL,
> @@ -81,7 +52,6 @@ static struct stedma40_chan_cfg mop500_sdi0_dma_cfg_tx = {
>  #endif
>
>  struct mmci_platform_data mop500_sdi0_data = {
> -       .ios_handler    = mop500_sdi0_ios_handler,
>         .ocr_mask       = MMC_VDD_29_30,
>         .f_max          = 50000000,
>         .capabilities   = MMC_CAP_4_BIT_DATA |
> @@ -101,22 +71,6 @@ struct mmci_platform_data mop500_sdi0_data = {
>
>  static void sdi0_configure(struct device *parent)
>  {
> -       int ret;
> -
> -       ret = gpio_request(sdi0_en, "level shifter enable");
> -       if (!ret)
> -               ret = gpio_request(sdi0_vsel,
> -                                  "level shifter 1v8-3v select");
> -
> -       if (ret) {
> -               pr_warning("unable to config sdi0 gpios for level shifter.\n");
> -               return;
> -       }
> -
> -       /* Select the default 2.9V and enable level shifter */
> -       gpio_direction_output(sdi0_vsel, 0);
> -       gpio_direction_output(sdi0_en, 1);
> -
>         /* Add the device, force v2 to subrevision 1 */
>         db8500_add_sdi0(parent, &mop500_sdi0_data, U8500_SDI_V2_PERIPHID);
>  }
> @@ -124,8 +78,6 @@ static void sdi0_configure(struct device *parent)
>  void mop500_sdi_tc35892_init(struct device *parent)
>  {
>         mop500_sdi0_data.gpio_cd = GPIO_SDMMC_CD;
> -       sdi0_en = GPIO_SDMMC_EN;
> -       sdi0_vsel = GPIO_SDMMC_1V8_3V_SEL;
>         sdi0_configure(parent);
>  }
>
> @@ -264,8 +216,6 @@ void __init snowball_sdi_init(struct device *parent)
>         /* External Micro SD slot */
>         mop500_sdi0_data.gpio_cd = SNOWBALL_SDMMC_CD_GPIO;
>         mop500_sdi0_data.cd_invert = true;
> -       sdi0_en = SNOWBALL_SDMMC_EN_GPIO;
> -       sdi0_vsel = SNOWBALL_SDMMC_1V8_3V_GPIO;
>         sdi0_configure(parent);
>  }
>
> @@ -277,8 +227,6 @@ void __init hrefv60_sdi_init(struct device *parent)
>         db8500_add_sdi4(parent, &mop500_sdi4_data, U8500_SDI_V2_PERIPHID);
>         /* External Micro SD slot */
>         mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO;
> -       sdi0_en = HREFV60_SDMMC_EN_GPIO;
> -       sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO;
>         sdi0_configure(parent);
>         /* WLAN SDIO channel */
>         db8500_add_sdi1(parent, &mop500_sdi1_data, U8500_SDI_V2_PERIPHID);
> --
> 1.7.9.5
>

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 8/8] ARM: ux500: Remove traces of the ios_handler from platform code
  2012-12-14  8:25     ` Ulf Hansson
@ 2013-01-21 13:11       ` Lee Jones
  -1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2013-01-21 13:11 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: linux-arm-kernel, linux-kernel, arnd, linus.walleij

On Fri, 14 Dec 2012, Ulf Hansson wrote:

> On 13 December 2012 14:22, Lee Jones <lee.jones@linaro.org> wrote:
> > Now MMCI on/off functionality is using the regulator framework
> > from the MMCI driver, there is no need to keep the ios_handler
> > laying around, duplicating functionality. So we're removing it.
> >
> > Acked-by: Linus Walleij <linus.walleij@linaro.org>
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>

What's the latest on these Ulf? Have they been taken in yet?

> > ---
> >  arch/arm/mach-ux500/board-mop500-sdi.c |   52 --------------------------------
> >  1 file changed, 52 deletions(-)
> >
> > diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c
> > index 9c8e4a9..5a798d6 100644
> > --- a/arch/arm/mach-ux500/board-mop500-sdi.c
> > +++ b/arch/arm/mach-ux500/board-mop500-sdi.c
> > @@ -31,35 +31,6 @@
> >   * SDI 0 (MicroSD slot)
> >   */
> >
> > -/* GPIO pins used by the sdi0 level shifter */
> > -static int sdi0_en = -1;
> > -static int sdi0_vsel = -1;
> > -
> > -static int mop500_sdi0_ios_handler(struct device *dev, struct mmc_ios *ios)
> > -{
> > -       switch (ios->power_mode) {
> > -       case MMC_POWER_UP:
> > -       case MMC_POWER_ON:
> > -               /*
> > -                * Level shifter voltage should depend on vdd to when deciding
> > -                * on either 1.8V or 2.9V. Once the decision has been made the
> > -                * level shifter must be disabled and re-enabled with a changed
> > -                * select signal in order to switch the voltage. Since there is
> > -                * no framework support yet for indicating 1.8V in vdd, use the
> > -                * default 2.9V.
> > -                */
> > -               gpio_direction_output(sdi0_vsel, 0);
> > -               gpio_direction_output(sdi0_en, 1);
> > -               break;
> > -       case MMC_POWER_OFF:
> > -               gpio_direction_output(sdi0_vsel, 0);
> > -               gpio_direction_output(sdi0_en, 0);
> > -               break;
> > -       }
> > -
> > -       return 0;
> > -}
> > -
> >  #ifdef CONFIG_STE_DMA40
> >  struct stedma40_chan_cfg mop500_sdi0_dma_cfg_rx = {
> >         .mode = STEDMA40_MODE_LOGICAL,
> > @@ -81,7 +52,6 @@ static struct stedma40_chan_cfg mop500_sdi0_dma_cfg_tx = {
> >  #endif
> >
> >  struct mmci_platform_data mop500_sdi0_data = {
> > -       .ios_handler    = mop500_sdi0_ios_handler,
> >         .ocr_mask       = MMC_VDD_29_30,
> >         .f_max          = 50000000,
> >         .capabilities   = MMC_CAP_4_BIT_DATA |
> > @@ -101,22 +71,6 @@ struct mmci_platform_data mop500_sdi0_data = {
> >
> >  static void sdi0_configure(struct device *parent)
> >  {
> > -       int ret;
> > -
> > -       ret = gpio_request(sdi0_en, "level shifter enable");
> > -       if (!ret)
> > -               ret = gpio_request(sdi0_vsel,
> > -                                  "level shifter 1v8-3v select");
> > -
> > -       if (ret) {
> > -               pr_warning("unable to config sdi0 gpios for level shifter.\n");
> > -               return;
> > -       }
> > -
> > -       /* Select the default 2.9V and enable level shifter */
> > -       gpio_direction_output(sdi0_vsel, 0);
> > -       gpio_direction_output(sdi0_en, 1);
> > -
> >         /* Add the device, force v2 to subrevision 1 */
> >         db8500_add_sdi0(parent, &mop500_sdi0_data, U8500_SDI_V2_PERIPHID);
> >  }
> > @@ -124,8 +78,6 @@ static void sdi0_configure(struct device *parent)
> >  void mop500_sdi_tc35892_init(struct device *parent)
> >  {
> >         mop500_sdi0_data.gpio_cd = GPIO_SDMMC_CD;
> > -       sdi0_en = GPIO_SDMMC_EN;
> > -       sdi0_vsel = GPIO_SDMMC_1V8_3V_SEL;
> >         sdi0_configure(parent);
> >  }
> >
> > @@ -264,8 +216,6 @@ void __init snowball_sdi_init(struct device *parent)
> >         /* External Micro SD slot */
> >         mop500_sdi0_data.gpio_cd = SNOWBALL_SDMMC_CD_GPIO;
> >         mop500_sdi0_data.cd_invert = true;
> > -       sdi0_en = SNOWBALL_SDMMC_EN_GPIO;
> > -       sdi0_vsel = SNOWBALL_SDMMC_1V8_3V_GPIO;
> >         sdi0_configure(parent);
> >  }
> >
> > @@ -277,8 +227,6 @@ void __init hrefv60_sdi_init(struct device *parent)
> >         db8500_add_sdi4(parent, &mop500_sdi4_data, U8500_SDI_V2_PERIPHID);
> >         /* External Micro SD slot */
> >         mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO;
> > -       sdi0_en = HREFV60_SDMMC_EN_GPIO;
> > -       sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO;
> >         sdi0_configure(parent);
> >         /* WLAN SDIO channel */
> >         db8500_add_sdi1(parent, &mop500_sdi1_data, U8500_SDI_V2_PERIPHID);
> >
> 
> Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 8/8] ARM: ux500: Remove traces of the ios_handler from platform code
@ 2013-01-21 13:11       ` Lee Jones
  0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2013-01-21 13:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 14 Dec 2012, Ulf Hansson wrote:

> On 13 December 2012 14:22, Lee Jones <lee.jones@linaro.org> wrote:
> > Now MMCI on/off functionality is using the regulator framework
> > from the MMCI driver, there is no need to keep the ios_handler
> > laying around, duplicating functionality. So we're removing it.
> >
> > Acked-by: Linus Walleij <linus.walleij@linaro.org>
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>

What's the latest on these Ulf? Have they been taken in yet?

> > ---
> >  arch/arm/mach-ux500/board-mop500-sdi.c |   52 --------------------------------
> >  1 file changed, 52 deletions(-)
> >
> > diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c
> > index 9c8e4a9..5a798d6 100644
> > --- a/arch/arm/mach-ux500/board-mop500-sdi.c
> > +++ b/arch/arm/mach-ux500/board-mop500-sdi.c
> > @@ -31,35 +31,6 @@
> >   * SDI 0 (MicroSD slot)
> >   */
> >
> > -/* GPIO pins used by the sdi0 level shifter */
> > -static int sdi0_en = -1;
> > -static int sdi0_vsel = -1;
> > -
> > -static int mop500_sdi0_ios_handler(struct device *dev, struct mmc_ios *ios)
> > -{
> > -       switch (ios->power_mode) {
> > -       case MMC_POWER_UP:
> > -       case MMC_POWER_ON:
> > -               /*
> > -                * Level shifter voltage should depend on vdd to when deciding
> > -                * on either 1.8V or 2.9V. Once the decision has been made the
> > -                * level shifter must be disabled and re-enabled with a changed
> > -                * select signal in order to switch the voltage. Since there is
> > -                * no framework support yet for indicating 1.8V in vdd, use the
> > -                * default 2.9V.
> > -                */
> > -               gpio_direction_output(sdi0_vsel, 0);
> > -               gpio_direction_output(sdi0_en, 1);
> > -               break;
> > -       case MMC_POWER_OFF:
> > -               gpio_direction_output(sdi0_vsel, 0);
> > -               gpio_direction_output(sdi0_en, 0);
> > -               break;
> > -       }
> > -
> > -       return 0;
> > -}
> > -
> >  #ifdef CONFIG_STE_DMA40
> >  struct stedma40_chan_cfg mop500_sdi0_dma_cfg_rx = {
> >         .mode = STEDMA40_MODE_LOGICAL,
> > @@ -81,7 +52,6 @@ static struct stedma40_chan_cfg mop500_sdi0_dma_cfg_tx = {
> >  #endif
> >
> >  struct mmci_platform_data mop500_sdi0_data = {
> > -       .ios_handler    = mop500_sdi0_ios_handler,
> >         .ocr_mask       = MMC_VDD_29_30,
> >         .f_max          = 50000000,
> >         .capabilities   = MMC_CAP_4_BIT_DATA |
> > @@ -101,22 +71,6 @@ struct mmci_platform_data mop500_sdi0_data = {
> >
> >  static void sdi0_configure(struct device *parent)
> >  {
> > -       int ret;
> > -
> > -       ret = gpio_request(sdi0_en, "level shifter enable");
> > -       if (!ret)
> > -               ret = gpio_request(sdi0_vsel,
> > -                                  "level shifter 1v8-3v select");
> > -
> > -       if (ret) {
> > -               pr_warning("unable to config sdi0 gpios for level shifter.\n");
> > -               return;
> > -       }
> > -
> > -       /* Select the default 2.9V and enable level shifter */
> > -       gpio_direction_output(sdi0_vsel, 0);
> > -       gpio_direction_output(sdi0_en, 1);
> > -
> >         /* Add the device, force v2 to subrevision 1 */
> >         db8500_add_sdi0(parent, &mop500_sdi0_data, U8500_SDI_V2_PERIPHID);
> >  }
> > @@ -124,8 +78,6 @@ static void sdi0_configure(struct device *parent)
> >  void mop500_sdi_tc35892_init(struct device *parent)
> >  {
> >         mop500_sdi0_data.gpio_cd = GPIO_SDMMC_CD;
> > -       sdi0_en = GPIO_SDMMC_EN;
> > -       sdi0_vsel = GPIO_SDMMC_1V8_3V_SEL;
> >         sdi0_configure(parent);
> >  }
> >
> > @@ -264,8 +216,6 @@ void __init snowball_sdi_init(struct device *parent)
> >         /* External Micro SD slot */
> >         mop500_sdi0_data.gpio_cd = SNOWBALL_SDMMC_CD_GPIO;
> >         mop500_sdi0_data.cd_invert = true;
> > -       sdi0_en = SNOWBALL_SDMMC_EN_GPIO;
> > -       sdi0_vsel = SNOWBALL_SDMMC_1V8_3V_GPIO;
> >         sdi0_configure(parent);
> >  }
> >
> > @@ -277,8 +227,6 @@ void __init hrefv60_sdi_init(struct device *parent)
> >         db8500_add_sdi4(parent, &mop500_sdi4_data, U8500_SDI_V2_PERIPHID);
> >         /* External Micro SD slot */
> >         mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO;
> > -       sdi0_en = HREFV60_SDMMC_EN_GPIO;
> > -       sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO;
> >         sdi0_configure(parent);
> >         /* WLAN SDIO channel */
> >         db8500_add_sdi1(parent, &mop500_sdi1_data, U8500_SDI_V2_PERIPHID);
> >
> 
> Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 7/8] ARM: ux500: Use the GPIO regulator framework for SDI0's 'en' and 'vsel'
  2012-12-13 15:09     ` Ulf Hansson
@ 2013-01-21 13:11       ` Lee Jones
  -1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2013-01-21 13:11 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: linux-arm-kernel, linux-kernel, arnd, linus.walleij

On Thu, 13 Dec 2012, Ulf Hansson wrote:

> On 13 December 2012 14:22, Lee Jones <lee.jones@linaro.org> wrote:
> > To prevent lots of unnecessary call-backs into platform code, we're
> > now using the GPIO regulator framework to control the 'enable' (en)
> > and 'voltage select' (vsel) GPIO pins which in turn control the
> > MMCI's secondary regulator settings. This already works with Device
> > Tree, but when booting with ATAGs we need to register it as a
> > platform device.
> >
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>

What's the latest on these Ulf? Have they been taken in yet? 

> >  arch/arm/mach-ux500/board-mop500-regulators.c |   14 ++++++++
> >  arch/arm/mach-ux500/board-mop500-regulators.h |    1 +
> >  arch/arm/mach-ux500/board-mop500.c            |   44 +++++++++++++++++++++++++
> >  3 files changed, 59 insertions(+)
> >
> > diff --git a/arch/arm/mach-ux500/board-mop500-regulators.c b/arch/arm/mach-ux500/board-mop500-regulators.c
> > index 2a17bc5..cb75405 100644
> > --- a/arch/arm/mach-ux500/board-mop500-regulators.c
> > +++ b/arch/arm/mach-ux500/board-mop500-regulators.c
> > @@ -28,6 +28,20 @@ struct regulator_init_data gpio_en_3v3_regulator = {
> >         .consumer_supplies = gpio_en_3v3_consumers,
> >  };
> >
> > +static struct regulator_consumer_supply sdi0_reg_consumers[] = {
> > +        REGULATOR_SUPPLY("vqmmc", "sdi0"),
> > +};
> > +
> > +struct regulator_init_data sdi0_reg_init_data = {
> > +        .constraints = {
> > +                .min_uV         = 1800000,
> > +                .max_uV         = 2900000,
> > +                .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE|REGULATOR_CHANGE_STATUS,
> > +        },
> > +        .num_consumer_supplies  = ARRAY_SIZE(sdi0_reg_consumers),
> > +        .consumer_supplies      = sdi0_reg_consumers,
> > +};
> > +
> >  /*
> >   * TPS61052 regulator
> >   */
> > diff --git a/arch/arm/mach-ux500/board-mop500-regulators.h b/arch/arm/mach-ux500/board-mop500-regulators.h
> > index 78a0642..0c79d90 100644
> > --- a/arch/arm/mach-ux500/board-mop500-regulators.h
> > +++ b/arch/arm/mach-ux500/board-mop500-regulators.h
> > @@ -19,5 +19,6 @@ ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS];
> >  extern struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS];
> >  extern struct regulator_init_data tps61052_regulator;
> >  extern struct regulator_init_data gpio_en_3v3_regulator;
> > +extern struct regulator_init_data sdi0_reg_init_data;
> >
> >  #endif
> > diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
> > index daa4237..e934176 100644
> > --- a/arch/arm/mach-ux500/board-mop500.c
> > +++ b/arch/arm/mach-ux500/board-mop500.c
> > @@ -24,6 +24,8 @@
> >  #include <linux/mfd/abx500/ab8500.h>
> >  #include <linux/regulator/ab8500.h>
> >  #include <linux/regulator/fixed.h>
> > +#include <linux/regulator/driver.h>
> > +#include <linux/regulator/gpio-regulator.h>
> >  #include <linux/mfd/tc3589x.h>
> >  #include <linux/mfd/tps6105x.h>
> >  #include <linux/mfd/abx500/ab8500-gpio.h>
> > @@ -91,6 +93,37 @@ static struct platform_device snowball_gpio_en_3v3_regulator_dev = {
> >         },
> >  };
> >
> > +/* Dynamically populated. */
> > +static struct gpio sdi0_reg_gpios[] = {
> > +        { 0, GPIOF_OUT_INIT_LOW, "mmci_vsel" },
> > +};
> > +
> > +static struct gpio_regulator_state sdi0_reg_states[] = {
> > +        { .value = 2900000, .gpios = (0 << 0) },
> > +        { .value = 1800000, .gpios = (1 << 0) },
> > +};
> > +
> > +static struct gpio_regulator_config sdi0_reg_info = {
> > +       .supply_name           = "ext-mmc-level-shifter",
> > +       .gpios                 = sdi0_reg_gpios,
> > +       .nr_gpios              = ARRAY_SIZE(sdi0_reg_gpios),
> > +       .states                = sdi0_reg_states,
> > +       .nr_states             = ARRAY_SIZE(sdi0_reg_states),
> > +       .type                  = REGULATOR_VOLTAGE,
> > +       .enable_high           = 1,
> > +       .enabled_at_boot       = 0,
> > +       .init_data             = &sdi0_reg_init_data,
> > +       .startup_delay         = 100,
> > +};
> > +
> > +static struct platform_device sdi0_regulator = {
> > +        .name = "gpio-regulator",
> > +        .id   = -1,
> > +        .dev  = {
> > +                .platform_data = &sdi0_reg_info,
> > +        },
> > +};
> > +
> >  static struct ab8500_gpio_platform_data ab8500_gpio_pdata = {
> >         .gpio_base              = MOP500_AB8500_PIN_GPIO(1),
> >         .irq_base               = MOP500_AB8500_VIR_GPIO_IRQ_BASE,
> > @@ -440,6 +473,7 @@ static struct hash_platform_data u8500_hash1_platform_data = {
> >  /* add any platform devices here - TODO */
> >  static struct platform_device *mop500_platform_devs[] __initdata = {
> >         &mop500_gpio_keys_device,
> > +       &sdi0_regulator,
> >  };
> >
> >  #ifdef CONFIG_STE_DMA40
> > @@ -581,6 +615,7 @@ static struct platform_device *snowball_platform_devs[] __initdata = {
> >         &snowball_key_dev,
> >         &snowball_sbnet_dev,
> >         &snowball_gpio_en_3v3_regulator_dev,
> > +       &sdi0_regulator,
> >  };
> >
> >  static void __init mop500_init_machine(void)
> > @@ -591,6 +626,9 @@ static void __init mop500_init_machine(void)
> >
> >         mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
> >
> > +       sdi0_reg_info.enable_gpio = GPIO_SDMMC_EN;
> > +       sdi0_reg_info.gpios[0].gpio = GPIO_SDMMC_1V8_3V_SEL;
> > +
> >         mop500_pinmaps_init();
> >         parent = u8500_init_devices(&ab8500_platdata);
> >
> > @@ -623,6 +661,9 @@ static void __init snowball_init_machine(void)
> >         struct device *parent = NULL;
> >         int i;
> >
> > +       sdi0_reg_info.enable_gpio = SNOWBALL_SDMMC_EN_GPIO;
> > +       sdi0_reg_info.gpios[0].gpio = SNOWBALL_SDMMC_1V8_3V_GPIO;
> > +
> >         snowball_pinmaps_init();
> >         parent = u8500_init_devices(&ab8500_platdata);
> >
> > @@ -655,6 +696,9 @@ static void __init hrefv60_init_machine(void)
> >          */
> >         mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
> >
> > +       sdi0_reg_info.enable_gpio = HREFV60_SDMMC_EN_GPIO;
> > +       sdi0_reg_info.gpios[0].gpio = HREFV60_SDMMC_1V8_3V_GPIO;
> > +
> >         hrefv60_pinmaps_init();
> >         parent = u8500_init_devices(&ab8500_platdata);
> >
> >
> 
> 
> Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 7/8] ARM: ux500: Use the GPIO regulator framework for SDI0's 'en' and 'vsel'
@ 2013-01-21 13:11       ` Lee Jones
  0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2013-01-21 13:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 13 Dec 2012, Ulf Hansson wrote:

> On 13 December 2012 14:22, Lee Jones <lee.jones@linaro.org> wrote:
> > To prevent lots of unnecessary call-backs into platform code, we're
> > now using the GPIO regulator framework to control the 'enable' (en)
> > and 'voltage select' (vsel) GPIO pins which in turn control the
> > MMCI's secondary regulator settings. This already works with Device
> > Tree, but when booting with ATAGs we need to register it as a
> > platform device.
> >
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>

What's the latest on these Ulf? Have they been taken in yet? 

> >  arch/arm/mach-ux500/board-mop500-regulators.c |   14 ++++++++
> >  arch/arm/mach-ux500/board-mop500-regulators.h |    1 +
> >  arch/arm/mach-ux500/board-mop500.c            |   44 +++++++++++++++++++++++++
> >  3 files changed, 59 insertions(+)
> >
> > diff --git a/arch/arm/mach-ux500/board-mop500-regulators.c b/arch/arm/mach-ux500/board-mop500-regulators.c
> > index 2a17bc5..cb75405 100644
> > --- a/arch/arm/mach-ux500/board-mop500-regulators.c
> > +++ b/arch/arm/mach-ux500/board-mop500-regulators.c
> > @@ -28,6 +28,20 @@ struct regulator_init_data gpio_en_3v3_regulator = {
> >         .consumer_supplies = gpio_en_3v3_consumers,
> >  };
> >
> > +static struct regulator_consumer_supply sdi0_reg_consumers[] = {
> > +        REGULATOR_SUPPLY("vqmmc", "sdi0"),
> > +};
> > +
> > +struct regulator_init_data sdi0_reg_init_data = {
> > +        .constraints = {
> > +                .min_uV         = 1800000,
> > +                .max_uV         = 2900000,
> > +                .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE|REGULATOR_CHANGE_STATUS,
> > +        },
> > +        .num_consumer_supplies  = ARRAY_SIZE(sdi0_reg_consumers),
> > +        .consumer_supplies      = sdi0_reg_consumers,
> > +};
> > +
> >  /*
> >   * TPS61052 regulator
> >   */
> > diff --git a/arch/arm/mach-ux500/board-mop500-regulators.h b/arch/arm/mach-ux500/board-mop500-regulators.h
> > index 78a0642..0c79d90 100644
> > --- a/arch/arm/mach-ux500/board-mop500-regulators.h
> > +++ b/arch/arm/mach-ux500/board-mop500-regulators.h
> > @@ -19,5 +19,6 @@ ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS];
> >  extern struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS];
> >  extern struct regulator_init_data tps61052_regulator;
> >  extern struct regulator_init_data gpio_en_3v3_regulator;
> > +extern struct regulator_init_data sdi0_reg_init_data;
> >
> >  #endif
> > diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
> > index daa4237..e934176 100644
> > --- a/arch/arm/mach-ux500/board-mop500.c
> > +++ b/arch/arm/mach-ux500/board-mop500.c
> > @@ -24,6 +24,8 @@
> >  #include <linux/mfd/abx500/ab8500.h>
> >  #include <linux/regulator/ab8500.h>
> >  #include <linux/regulator/fixed.h>
> > +#include <linux/regulator/driver.h>
> > +#include <linux/regulator/gpio-regulator.h>
> >  #include <linux/mfd/tc3589x.h>
> >  #include <linux/mfd/tps6105x.h>
> >  #include <linux/mfd/abx500/ab8500-gpio.h>
> > @@ -91,6 +93,37 @@ static struct platform_device snowball_gpio_en_3v3_regulator_dev = {
> >         },
> >  };
> >
> > +/* Dynamically populated. */
> > +static struct gpio sdi0_reg_gpios[] = {
> > +        { 0, GPIOF_OUT_INIT_LOW, "mmci_vsel" },
> > +};
> > +
> > +static struct gpio_regulator_state sdi0_reg_states[] = {
> > +        { .value = 2900000, .gpios = (0 << 0) },
> > +        { .value = 1800000, .gpios = (1 << 0) },
> > +};
> > +
> > +static struct gpio_regulator_config sdi0_reg_info = {
> > +       .supply_name           = "ext-mmc-level-shifter",
> > +       .gpios                 = sdi0_reg_gpios,
> > +       .nr_gpios              = ARRAY_SIZE(sdi0_reg_gpios),
> > +       .states                = sdi0_reg_states,
> > +       .nr_states             = ARRAY_SIZE(sdi0_reg_states),
> > +       .type                  = REGULATOR_VOLTAGE,
> > +       .enable_high           = 1,
> > +       .enabled_at_boot       = 0,
> > +       .init_data             = &sdi0_reg_init_data,
> > +       .startup_delay         = 100,
> > +};
> > +
> > +static struct platform_device sdi0_regulator = {
> > +        .name = "gpio-regulator",
> > +        .id   = -1,
> > +        .dev  = {
> > +                .platform_data = &sdi0_reg_info,
> > +        },
> > +};
> > +
> >  static struct ab8500_gpio_platform_data ab8500_gpio_pdata = {
> >         .gpio_base              = MOP500_AB8500_PIN_GPIO(1),
> >         .irq_base               = MOP500_AB8500_VIR_GPIO_IRQ_BASE,
> > @@ -440,6 +473,7 @@ static struct hash_platform_data u8500_hash1_platform_data = {
> >  /* add any platform devices here - TODO */
> >  static struct platform_device *mop500_platform_devs[] __initdata = {
> >         &mop500_gpio_keys_device,
> > +       &sdi0_regulator,
> >  };
> >
> >  #ifdef CONFIG_STE_DMA40
> > @@ -581,6 +615,7 @@ static struct platform_device *snowball_platform_devs[] __initdata = {
> >         &snowball_key_dev,
> >         &snowball_sbnet_dev,
> >         &snowball_gpio_en_3v3_regulator_dev,
> > +       &sdi0_regulator,
> >  };
> >
> >  static void __init mop500_init_machine(void)
> > @@ -591,6 +626,9 @@ static void __init mop500_init_machine(void)
> >
> >         mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
> >
> > +       sdi0_reg_info.enable_gpio = GPIO_SDMMC_EN;
> > +       sdi0_reg_info.gpios[0].gpio = GPIO_SDMMC_1V8_3V_SEL;
> > +
> >         mop500_pinmaps_init();
> >         parent = u8500_init_devices(&ab8500_platdata);
> >
> > @@ -623,6 +661,9 @@ static void __init snowball_init_machine(void)
> >         struct device *parent = NULL;
> >         int i;
> >
> > +       sdi0_reg_info.enable_gpio = SNOWBALL_SDMMC_EN_GPIO;
> > +       sdi0_reg_info.gpios[0].gpio = SNOWBALL_SDMMC_1V8_3V_GPIO;
> > +
> >         snowball_pinmaps_init();
> >         parent = u8500_init_devices(&ab8500_platdata);
> >
> > @@ -655,6 +696,9 @@ static void __init hrefv60_init_machine(void)
> >          */
> >         mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
> >
> > +       sdi0_reg_info.enable_gpio = HREFV60_SDMMC_EN_GPIO;
> > +       sdi0_reg_info.gpios[0].gpio = HREFV60_SDMMC_1V8_3V_GPIO;
> > +
> >         hrefv60_pinmaps_init();
> >         parent = u8500_init_devices(&ab8500_platdata);
> >
> >
> 
> 
> Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 1/8] mmc: mmci: Move ios_handler functionality into the driver
  2012-12-13 13:22   ` Lee Jones
@ 2013-01-21 14:06     ` Lee Jones
  -1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2013-01-21 14:06 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: arnd, linus.walleij, ulf.hansson, Chris Ball, Russell King

On Thu, 13 Dec 2012, Lee Jones wrote:

> There are currently two instances of the ios_handler being used.
> Both of which mearly toy with some regulator settings. Now there
> is a GPIO regulator API, we can use that instead, and lessen the
> per platform burden. By doing this, we also become more Device
> Tree compatible.
> 
> Cc: Chris Ball <cjb@laptop.org>
> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> Acked-by: Ulf Hansson <ulf.hansson@stericsson.com>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Any more news on this one?

>  drivers/mmc/host/mmci.c |   22 ++++++++++++++++++++++
>  drivers/mmc/host/mmci.h |    1 +
>  2 files changed, 23 insertions(+)
> 
> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
> index edc3e9b..d45c931 100644
> --- a/drivers/mmc/host/mmci.c
> +++ b/drivers/mmc/host/mmci.c
> @@ -1091,6 +1091,16 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>  	case MMC_POWER_OFF:
>  		if (host->vcc)
>  			ret = mmc_regulator_set_ocr(mmc, host->vcc, 0);
> +
> +		if (host->vqmmc) {
> +			if (regulator_is_enabled(host->vqmmc)) {
> +				ret = regulator_disable(host->vqmmc);
> +				if (ret < 0)
> +					dev_warn(mmc_dev(mmc),
> +						 "unable to disable vmmc-ios\n");
> +			}
> +		}
> +
>  		break;
>  	case MMC_POWER_UP:
>  		if (host->vcc) {
> @@ -1115,6 +1125,14 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>  
>  		break;
>  	case MMC_POWER_ON:
> +		if (host->vqmmc)
> +			if (!regulator_is_enabled(host->vqmmc)) {
> +				ret = regulator_enable(host->vqmmc);
> +				if (ret < 0)
> +					dev_warn(mmc_dev(mmc),
> +						 "unable to enable vmmc-ios\n");
> +			}
> +
>  		pwr |= MCI_PWR_ON;
>  		break;
>  	}
> @@ -1379,6 +1397,10 @@ static int __devinit mmci_probe(struct amba_device *dev,
>  				 "(using regulator instead)\n");
>  		}
>  	}
> +
> +	host->vqmmc = regulator_get(&dev->dev, "vqmmc");
> +	if (IS_ERR(host->vqmmc))
> +		host->vqmmc = NULL;
>  #endif
>  	/* Fall back to platform data if no regulator is found */
>  	if (host->vcc == NULL)
> diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h
> index d437ccf..b87d9e2 100644
> --- a/drivers/mmc/host/mmci.h
> +++ b/drivers/mmc/host/mmci.h
> @@ -194,6 +194,7 @@ struct mmci_host {
>  	struct sg_mapping_iter	sg_miter;
>  	unsigned int		size;
>  	struct regulator	*vcc;
> +	struct regulator	*vqmmc;
>  
>  #ifdef CONFIG_DMA_ENGINE
>  	/* DMA stuff */

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 1/8] mmc: mmci: Move ios_handler functionality into the driver
@ 2013-01-21 14:06     ` Lee Jones
  0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2013-01-21 14:06 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 13 Dec 2012, Lee Jones wrote:

> There are currently two instances of the ios_handler being used.
> Both of which mearly toy with some regulator settings. Now there
> is a GPIO regulator API, we can use that instead, and lessen the
> per platform burden. By doing this, we also become more Device
> Tree compatible.
> 
> Cc: Chris Ball <cjb@laptop.org>
> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> Acked-by: Ulf Hansson <ulf.hansson@stericsson.com>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Any more news on this one?

>  drivers/mmc/host/mmci.c |   22 ++++++++++++++++++++++
>  drivers/mmc/host/mmci.h |    1 +
>  2 files changed, 23 insertions(+)
> 
> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
> index edc3e9b..d45c931 100644
> --- a/drivers/mmc/host/mmci.c
> +++ b/drivers/mmc/host/mmci.c
> @@ -1091,6 +1091,16 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>  	case MMC_POWER_OFF:
>  		if (host->vcc)
>  			ret = mmc_regulator_set_ocr(mmc, host->vcc, 0);
> +
> +		if (host->vqmmc) {
> +			if (regulator_is_enabled(host->vqmmc)) {
> +				ret = regulator_disable(host->vqmmc);
> +				if (ret < 0)
> +					dev_warn(mmc_dev(mmc),
> +						 "unable to disable vmmc-ios\n");
> +			}
> +		}
> +
>  		break;
>  	case MMC_POWER_UP:
>  		if (host->vcc) {
> @@ -1115,6 +1125,14 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>  
>  		break;
>  	case MMC_POWER_ON:
> +		if (host->vqmmc)
> +			if (!regulator_is_enabled(host->vqmmc)) {
> +				ret = regulator_enable(host->vqmmc);
> +				if (ret < 0)
> +					dev_warn(mmc_dev(mmc),
> +						 "unable to enable vmmc-ios\n");
> +			}
> +
>  		pwr |= MCI_PWR_ON;
>  		break;
>  	}
> @@ -1379,6 +1397,10 @@ static int __devinit mmci_probe(struct amba_device *dev,
>  				 "(using regulator instead)\n");
>  		}
>  	}
> +
> +	host->vqmmc = regulator_get(&dev->dev, "vqmmc");
> +	if (IS_ERR(host->vqmmc))
> +		host->vqmmc = NULL;
>  #endif
>  	/* Fall back to platform data if no regulator is found */
>  	if (host->vcc == NULL)
> diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h
> index d437ccf..b87d9e2 100644
> --- a/drivers/mmc/host/mmci.h
> +++ b/drivers/mmc/host/mmci.h
> @@ -194,6 +194,7 @@ struct mmci_host {
>  	struct sg_mapping_iter	sg_miter;
>  	unsigned int		size;
>  	struct regulator	*vcc;
> +	struct regulator	*vqmmc;
>  
>  #ifdef CONFIG_DMA_ENGINE
>  	/* DMA stuff */

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 1/8] mmc: mmci: Move ios_handler functionality into the driver
  2013-01-21 14:06     ` Lee Jones
@ 2013-01-21 20:25       ` Ulf Hansson
  -1 siblings, 0 replies; 38+ messages in thread
From: Ulf Hansson @ 2013-01-21 20:25 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-arm-kernel, linux-kernel, arnd, linus.walleij, Chris Ball,
	Russell King

On 21 January 2013 15:06, Lee Jones <lee.jones@linaro.org> wrote:
> On Thu, 13 Dec 2012, Lee Jones wrote:
>
>> There are currently two instances of the ios_handler being used.
>> Both of which mearly toy with some regulator settings. Now there
>> is a GPIO regulator API, we can use that instead, and lessen the
>> per platform burden. By doing this, we also become more Device
>> Tree compatible.
>>
>> Cc: Chris Ball <cjb@laptop.org>
>> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
>> Acked-by: Ulf Hansson <ulf.hansson@stericsson.com>
>> Signed-off-by: Lee Jones <lee.jones@linaro.org>
>
> Any more news on this one?

Not exactly this version of the patch, but another one has has been
merged through Russell's patch tracker. Available for 3.9.

>
>>  drivers/mmc/host/mmci.c |   22 ++++++++++++++++++++++
>>  drivers/mmc/host/mmci.h |    1 +
>>  2 files changed, 23 insertions(+)
>>
>> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
>> index edc3e9b..d45c931 100644
>> --- a/drivers/mmc/host/mmci.c
>> +++ b/drivers/mmc/host/mmci.c
>> @@ -1091,6 +1091,16 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>>       case MMC_POWER_OFF:
>>               if (host->vcc)
>>                       ret = mmc_regulator_set_ocr(mmc, host->vcc, 0);
>> +
>> +             if (host->vqmmc) {
>> +                     if (regulator_is_enabled(host->vqmmc)) {
>> +                             ret = regulator_disable(host->vqmmc);
>> +                             if (ret < 0)
>> +                                     dev_warn(mmc_dev(mmc),
>> +                                              "unable to disable vmmc-ios\n");
>> +                     }
>> +             }
>> +
>>               break;
>>       case MMC_POWER_UP:
>>               if (host->vcc) {
>> @@ -1115,6 +1125,14 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>>
>>               break;
>>       case MMC_POWER_ON:
>> +             if (host->vqmmc)
>> +                     if (!regulator_is_enabled(host->vqmmc)) {
>> +                             ret = regulator_enable(host->vqmmc);
>> +                             if (ret < 0)
>> +                                     dev_warn(mmc_dev(mmc),
>> +                                              "unable to enable vmmc-ios\n");
>> +                     }
>> +
>>               pwr |= MCI_PWR_ON;
>>               break;
>>       }
>> @@ -1379,6 +1397,10 @@ static int __devinit mmci_probe(struct amba_device *dev,
>>                                "(using regulator instead)\n");
>>               }
>>       }
>> +
>> +     host->vqmmc = regulator_get(&dev->dev, "vqmmc");
>> +     if (IS_ERR(host->vqmmc))
>> +             host->vqmmc = NULL;
>>  #endif
>>       /* Fall back to platform data if no regulator is found */
>>       if (host->vcc == NULL)
>> diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h
>> index d437ccf..b87d9e2 100644
>> --- a/drivers/mmc/host/mmci.h
>> +++ b/drivers/mmc/host/mmci.h
>> @@ -194,6 +194,7 @@ struct mmci_host {
>>       struct sg_mapping_iter  sg_miter;
>>       unsigned int            size;
>>       struct regulator        *vcc;
>> +     struct regulator        *vqmmc;
>>
>>  #ifdef CONFIG_DMA_ENGINE
>>       /* DMA stuff */
>
> --
> Lee Jones
> Linaro ST-Ericsson Landing Team Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 1/8] mmc: mmci: Move ios_handler functionality into the driver
@ 2013-01-21 20:25       ` Ulf Hansson
  0 siblings, 0 replies; 38+ messages in thread
From: Ulf Hansson @ 2013-01-21 20:25 UTC (permalink / raw)
  To: linux-arm-kernel

On 21 January 2013 15:06, Lee Jones <lee.jones@linaro.org> wrote:
> On Thu, 13 Dec 2012, Lee Jones wrote:
>
>> There are currently two instances of the ios_handler being used.
>> Both of which mearly toy with some regulator settings. Now there
>> is a GPIO regulator API, we can use that instead, and lessen the
>> per platform burden. By doing this, we also become more Device
>> Tree compatible.
>>
>> Cc: Chris Ball <cjb@laptop.org>
>> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
>> Acked-by: Ulf Hansson <ulf.hansson@stericsson.com>
>> Signed-off-by: Lee Jones <lee.jones@linaro.org>
>
> Any more news on this one?

Not exactly this version of the patch, but another one has has been
merged through Russell's patch tracker. Available for 3.9.

>
>>  drivers/mmc/host/mmci.c |   22 ++++++++++++++++++++++
>>  drivers/mmc/host/mmci.h |    1 +
>>  2 files changed, 23 insertions(+)
>>
>> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
>> index edc3e9b..d45c931 100644
>> --- a/drivers/mmc/host/mmci.c
>> +++ b/drivers/mmc/host/mmci.c
>> @@ -1091,6 +1091,16 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>>       case MMC_POWER_OFF:
>>               if (host->vcc)
>>                       ret = mmc_regulator_set_ocr(mmc, host->vcc, 0);
>> +
>> +             if (host->vqmmc) {
>> +                     if (regulator_is_enabled(host->vqmmc)) {
>> +                             ret = regulator_disable(host->vqmmc);
>> +                             if (ret < 0)
>> +                                     dev_warn(mmc_dev(mmc),
>> +                                              "unable to disable vmmc-ios\n");
>> +                     }
>> +             }
>> +
>>               break;
>>       case MMC_POWER_UP:
>>               if (host->vcc) {
>> @@ -1115,6 +1125,14 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>>
>>               break;
>>       case MMC_POWER_ON:
>> +             if (host->vqmmc)
>> +                     if (!regulator_is_enabled(host->vqmmc)) {
>> +                             ret = regulator_enable(host->vqmmc);
>> +                             if (ret < 0)
>> +                                     dev_warn(mmc_dev(mmc),
>> +                                              "unable to enable vmmc-ios\n");
>> +                     }
>> +
>>               pwr |= MCI_PWR_ON;
>>               break;
>>       }
>> @@ -1379,6 +1397,10 @@ static int __devinit mmci_probe(struct amba_device *dev,
>>                                "(using regulator instead)\n");
>>               }
>>       }
>> +
>> +     host->vqmmc = regulator_get(&dev->dev, "vqmmc");
>> +     if (IS_ERR(host->vqmmc))
>> +             host->vqmmc = NULL;
>>  #endif
>>       /* Fall back to platform data if no regulator is found */
>>       if (host->vcc == NULL)
>> diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h
>> index d437ccf..b87d9e2 100644
>> --- a/drivers/mmc/host/mmci.h
>> +++ b/drivers/mmc/host/mmci.h
>> @@ -194,6 +194,7 @@ struct mmci_host {
>>       struct sg_mapping_iter  sg_miter;
>>       unsigned int            size;
>>       struct regulator        *vcc;
>> +     struct regulator        *vqmmc;
>>
>>  #ifdef CONFIG_DMA_ENGINE
>>       /* DMA stuff */
>
> --
> Lee Jones
> Linaro ST-Ericsson Landing Team Lead
> Linaro.org ? Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 1/8] mmc: mmci: Move ios_handler functionality into the driver
  2013-01-21 20:25       ` Ulf Hansson
@ 2013-01-22  8:46         ` Lee Jones
  -1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2013-01-22  8:46 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: linux-arm-kernel, linux-kernel, arnd, linus.walleij, Chris Ball,
	Russell King

On Mon, 21 Jan 2013, Ulf Hansson wrote:

> On 21 January 2013 15:06, Lee Jones <lee.jones@linaro.org> wrote:
> > On Thu, 13 Dec 2012, Lee Jones wrote:
> >
> >> There are currently two instances of the ios_handler being used.
> >> Both of which mearly toy with some regulator settings. Now there
> >> is a GPIO regulator API, we can use that instead, and lessen the
> >> per platform burden. By doing this, we also become more Device
> >> Tree compatible.
> >>
> >> Cc: Chris Ball <cjb@laptop.org>
> >> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> >> Acked-by: Ulf Hansson <ulf.hansson@stericsson.com>
> >> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> >
> > Any more news on this one?
> 
> Not exactly this version of the patch, but another one has has been
> merged through Russell's patch tracker. Available for 3.9.

Nice. Thanks for the update.

> >>  drivers/mmc/host/mmci.c |   22 ++++++++++++++++++++++
> >>  drivers/mmc/host/mmci.h |    1 +
> >>  2 files changed, 23 insertions(+)
> >>
> >> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
> >> index edc3e9b..d45c931 100644
> >> --- a/drivers/mmc/host/mmci.c
> >> +++ b/drivers/mmc/host/mmci.c
> >> @@ -1091,6 +1091,16 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
> >>       case MMC_POWER_OFF:
> >>               if (host->vcc)
> >>                       ret = mmc_regulator_set_ocr(mmc, host->vcc, 0);
> >> +
> >> +             if (host->vqmmc) {
> >> +                     if (regulator_is_enabled(host->vqmmc)) {
> >> +                             ret = regulator_disable(host->vqmmc);
> >> +                             if (ret < 0)
> >> +                                     dev_warn(mmc_dev(mmc),
> >> +                                              "unable to disable vmmc-ios\n");
> >> +                     }
> >> +             }
> >> +
> >>               break;
> >>       case MMC_POWER_UP:
> >>               if (host->vcc) {
> >> @@ -1115,6 +1125,14 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
> >>
> >>               break;
> >>       case MMC_POWER_ON:
> >> +             if (host->vqmmc)
> >> +                     if (!regulator_is_enabled(host->vqmmc)) {
> >> +                             ret = regulator_enable(host->vqmmc);
> >> +                             if (ret < 0)
> >> +                                     dev_warn(mmc_dev(mmc),
> >> +                                              "unable to enable vmmc-ios\n");
> >> +                     }
> >> +
> >>               pwr |= MCI_PWR_ON;
> >>               break;
> >>       }
> >> @@ -1379,6 +1397,10 @@ static int __devinit mmci_probe(struct amba_device *dev,
> >>                                "(using regulator instead)\n");
> >>               }
> >>       }
> >> +
> >> +     host->vqmmc = regulator_get(&dev->dev, "vqmmc");
> >> +     if (IS_ERR(host->vqmmc))
> >> +             host->vqmmc = NULL;
> >>  #endif
> >>       /* Fall back to platform data if no regulator is found */
> >>       if (host->vcc == NULL)
> >> diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h
> >> index d437ccf..b87d9e2 100644
> >> --- a/drivers/mmc/host/mmci.h
> >> +++ b/drivers/mmc/host/mmci.h
> >> @@ -194,6 +194,7 @@ struct mmci_host {
> >>       struct sg_mapping_iter  sg_miter;
> >>       unsigned int            size;
> >>       struct regulator        *vcc;
> >> +     struct regulator        *vqmmc;
> >>
> >>  #ifdef CONFIG_DMA_ENGINE
> >>       /* DMA stuff */
> >

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 1/8] mmc: mmci: Move ios_handler functionality into the driver
@ 2013-01-22  8:46         ` Lee Jones
  0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2013-01-22  8:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 21 Jan 2013, Ulf Hansson wrote:

> On 21 January 2013 15:06, Lee Jones <lee.jones@linaro.org> wrote:
> > On Thu, 13 Dec 2012, Lee Jones wrote:
> >
> >> There are currently two instances of the ios_handler being used.
> >> Both of which mearly toy with some regulator settings. Now there
> >> is a GPIO regulator API, we can use that instead, and lessen the
> >> per platform burden. By doing this, we also become more Device
> >> Tree compatible.
> >>
> >> Cc: Chris Ball <cjb@laptop.org>
> >> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> >> Acked-by: Ulf Hansson <ulf.hansson@stericsson.com>
> >> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> >
> > Any more news on this one?
> 
> Not exactly this version of the patch, but another one has has been
> merged through Russell's patch tracker. Available for 3.9.

Nice. Thanks for the update.

> >>  drivers/mmc/host/mmci.c |   22 ++++++++++++++++++++++
> >>  drivers/mmc/host/mmci.h |    1 +
> >>  2 files changed, 23 insertions(+)
> >>
> >> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
> >> index edc3e9b..d45c931 100644
> >> --- a/drivers/mmc/host/mmci.c
> >> +++ b/drivers/mmc/host/mmci.c
> >> @@ -1091,6 +1091,16 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
> >>       case MMC_POWER_OFF:
> >>               if (host->vcc)
> >>                       ret = mmc_regulator_set_ocr(mmc, host->vcc, 0);
> >> +
> >> +             if (host->vqmmc) {
> >> +                     if (regulator_is_enabled(host->vqmmc)) {
> >> +                             ret = regulator_disable(host->vqmmc);
> >> +                             if (ret < 0)
> >> +                                     dev_warn(mmc_dev(mmc),
> >> +                                              "unable to disable vmmc-ios\n");
> >> +                     }
> >> +             }
> >> +
> >>               break;
> >>       case MMC_POWER_UP:
> >>               if (host->vcc) {
> >> @@ -1115,6 +1125,14 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
> >>
> >>               break;
> >>       case MMC_POWER_ON:
> >> +             if (host->vqmmc)
> >> +                     if (!regulator_is_enabled(host->vqmmc)) {
> >> +                             ret = regulator_enable(host->vqmmc);
> >> +                             if (ret < 0)
> >> +                                     dev_warn(mmc_dev(mmc),
> >> +                                              "unable to enable vmmc-ios\n");
> >> +                     }
> >> +
> >>               pwr |= MCI_PWR_ON;
> >>               break;
> >>       }
> >> @@ -1379,6 +1397,10 @@ static int __devinit mmci_probe(struct amba_device *dev,
> >>                                "(using regulator instead)\n");
> >>               }
> >>       }
> >> +
> >> +     host->vqmmc = regulator_get(&dev->dev, "vqmmc");
> >> +     if (IS_ERR(host->vqmmc))
> >> +             host->vqmmc = NULL;
> >>  #endif
> >>       /* Fall back to platform data if no regulator is found */
> >>       if (host->vcc == NULL)
> >> diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h
> >> index d437ccf..b87d9e2 100644
> >> --- a/drivers/mmc/host/mmci.h
> >> +++ b/drivers/mmc/host/mmci.h
> >> @@ -194,6 +194,7 @@ struct mmci_host {
> >>       struct sg_mapping_iter  sg_miter;
> >>       unsigned int            size;
> >>       struct regulator        *vcc;
> >> +     struct regulator        *vqmmc;
> >>
> >>  #ifdef CONFIG_DMA_ENGINE
> >>       /* DMA stuff */
> >

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 8/8] ARM: ux500: Remove traces of the ios_handler from platform code
  2012-12-13 13:22   ` Lee Jones
@ 2013-01-23 10:04     ` Linus Walleij
  -1 siblings, 0 replies; 38+ messages in thread
From: Linus Walleij @ 2013-01-23 10:04 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-arm-kernel, linux-kernel, arnd, linus.walleij, ulf.hansson

On Thu, Dec 13, 2012 at 2:22 PM, Lee Jones <lee.jones@linaro.org> wrote:

> Now MMCI on/off functionality is using the regulator framework
> from the MMCI driver, there is no need to keep the ios_handler
> laying around, duplicating functionality. So we're removing it.
>
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Applied to my ux500-cleanups branch.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 8/8] ARM: ux500: Remove traces of the ios_handler from platform code
@ 2013-01-23 10:04     ` Linus Walleij
  0 siblings, 0 replies; 38+ messages in thread
From: Linus Walleij @ 2013-01-23 10:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Dec 13, 2012 at 2:22 PM, Lee Jones <lee.jones@linaro.org> wrote:

> Now MMCI on/off functionality is using the regulator framework
> from the MMCI driver, there is no need to keep the ios_handler
> laying around, duplicating functionality. So we're removing it.
>
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Applied to my ux500-cleanups branch.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 8/8] ARM: ux500: Remove traces of the ios_handler from platform code
  2013-01-23 10:04     ` Linus Walleij
@ 2013-01-23 10:07       ` Linus Walleij
  -1 siblings, 0 replies; 38+ messages in thread
From: Linus Walleij @ 2013-01-23 10:07 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-arm-kernel, linux-kernel, arnd, linus.walleij, ulf.hansson

On Wed, Jan 23, 2013 at 11:04 AM, Linus Walleij
<linus.walleij@linaro.org> wrote:
> On Thu, Dec 13, 2012 at 2:22 PM, Lee Jones <lee.jones@linaro.org> wrote:
>
>> Now MMCI on/off functionality is using the regulator framework
>> from the MMCI driver, there is no need to keep the ios_handler
>> laying around, duplicating functionality. So we're removing it.
>>
>> Acked-by: Linus Walleij <linus.walleij@linaro.org>
>> Signed-off-by: Lee Jones <lee.jones@linaro.org>
>
> Applied to my ux500-cleanups branch.

Or no, wait, that is dependent or Russell's tree so will not
be bisectable.

Either submit sequel patches to [1/8] through Russell's
patch tracker (based on his tree I guess) or wait for these
to hit mainline and push them after that.

Acked-by anway, on all of the cleanups following [1/8].

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 8/8] ARM: ux500: Remove traces of the ios_handler from platform code
@ 2013-01-23 10:07       ` Linus Walleij
  0 siblings, 0 replies; 38+ messages in thread
From: Linus Walleij @ 2013-01-23 10:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 23, 2013 at 11:04 AM, Linus Walleij
<linus.walleij@linaro.org> wrote:
> On Thu, Dec 13, 2012 at 2:22 PM, Lee Jones <lee.jones@linaro.org> wrote:
>
>> Now MMCI on/off functionality is using the regulator framework
>> from the MMCI driver, there is no need to keep the ios_handler
>> laying around, duplicating functionality. So we're removing it.
>>
>> Acked-by: Linus Walleij <linus.walleij@linaro.org>
>> Signed-off-by: Lee Jones <lee.jones@linaro.org>
>
> Applied to my ux500-cleanups branch.

Or no, wait, that is dependent or Russell's tree so will not
be bisectable.

Either submit sequel patches to [1/8] through Russell's
patch tracker (based on his tree I guess) or wait for these
to hit mainline and push them after that.

Acked-by anway, on all of the cleanups following [1/8].

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 8/8] ARM: ux500: Remove traces of the ios_handler from platform code
  2013-01-23 10:07       ` Linus Walleij
@ 2013-01-23 11:27         ` Lee Jones
  -1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2013-01-23 11:27 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linux-arm-kernel, linux-kernel, arnd, linus.walleij, ulf.hansson

On Wed, 23 Jan 2013, Linus Walleij wrote:

> On Wed, Jan 23, 2013 at 11:04 AM, Linus Walleij
> <linus.walleij@linaro.org> wrote:
> > On Thu, Dec 13, 2012 at 2:22 PM, Lee Jones <lee.jones@linaro.org> wrote:
> >
> >> Now MMCI on/off functionality is using the regulator framework
> >> from the MMCI driver, there is no need to keep the ios_handler
> >> laying around, duplicating functionality. So we're removing it.
> >>
> >> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> >> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> >
> > Applied to my ux500-cleanups branch.
> 
> Or no, wait, that is dependent or Russell's tree so will not
> be bisectable.
> 
> Either submit sequel patches to [1/8] through Russell's
> patch tracker (based on his tree I guess) or wait for these
> to hit mainline and push them after that.
> 
> Acked-by anway, on all of the cleanups following [1/8].

I have this queued already, with the MMCI patch in as a dependency.

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 8/8] ARM: ux500: Remove traces of the ios_handler from platform code
@ 2013-01-23 11:27         ` Lee Jones
  0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2013-01-23 11:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 23 Jan 2013, Linus Walleij wrote:

> On Wed, Jan 23, 2013 at 11:04 AM, Linus Walleij
> <linus.walleij@linaro.org> wrote:
> > On Thu, Dec 13, 2012 at 2:22 PM, Lee Jones <lee.jones@linaro.org> wrote:
> >
> >> Now MMCI on/off functionality is using the regulator framework
> >> from the MMCI driver, there is no need to keep the ios_handler
> >> laying around, duplicating functionality. So we're removing it.
> >>
> >> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> >> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> >
> > Applied to my ux500-cleanups branch.
> 
> Or no, wait, that is dependent or Russell's tree so will not
> be bisectable.
> 
> Either submit sequel patches to [1/8] through Russell's
> patch tracker (based on his tree I guess) or wait for these
> to hit mainline and push them after that.
> 
> Acked-by anway, on all of the cleanups following [1/8].

I have this queued already, with the MMCI patch in as a dependency.

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2013-01-23 11:27 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-13 13:22 [PATCH 1/8] Functionality add and bug-fixes related to MMCI regulators Lee Jones
2012-12-13 13:22 ` Lee Jones
2012-12-13 13:22 ` [PATCH 1/8] mmc: mmci: Move ios_handler functionality into the driver Lee Jones
2012-12-13 13:22   ` Lee Jones
2013-01-21 14:06   ` Lee Jones
2013-01-21 14:06     ` Lee Jones
2013-01-21 20:25     ` Ulf Hansson
2013-01-21 20:25       ` Ulf Hansson
2013-01-22  8:46       ` Lee Jones
2013-01-22  8:46         ` Lee Jones
2012-12-13 13:22 ` [PATCH 2/8] ARM: ux500: Set correct MMCI regulator voltages in the ux5x0 Device Tree Lee Jones
2012-12-13 13:22   ` Lee Jones
2012-12-13 13:22 ` [PATCH 3/8] ARM: ux500: Specify the ux5x0 MMCI regulator's on/off GPIO as high-enable Lee Jones
2012-12-13 13:22   ` Lee Jones
2012-12-13 13:22 ` [PATCH 4/8] ARM: ux500: Specify which IOS regulator to use for MMCI Lee Jones
2012-12-13 13:22   ` Lee Jones
2012-12-13 13:22 ` [PATCH 5/8] ARM: ux500: Use the correct name when supplying a GPIO enable pin Lee Jones
2012-12-13 13:22   ` Lee Jones
2012-12-13 13:22 ` [PATCH 6/8] ARM: ux500: Setup correct settling time for the MMCI regulator Lee Jones
2012-12-13 13:22   ` Lee Jones
2012-12-13 13:22 ` [PATCH 7/8] ARM: ux500: Use the GPIO regulator framework for SDI0's 'en' and 'vsel' Lee Jones
2012-12-13 13:22   ` Lee Jones
2012-12-13 15:09   ` Ulf Hansson
2012-12-13 15:09     ` Ulf Hansson
2013-01-21 13:11     ` Lee Jones
2013-01-21 13:11       ` Lee Jones
2012-12-13 13:22 ` [PATCH 8/8] ARM: ux500: Remove traces of the ios_handler from platform code Lee Jones
2012-12-13 13:22   ` Lee Jones
2012-12-14  8:25   ` Ulf Hansson
2012-12-14  8:25     ` Ulf Hansson
2013-01-21 13:11     ` Lee Jones
2013-01-21 13:11       ` Lee Jones
2013-01-23 10:04   ` Linus Walleij
2013-01-23 10:04     ` Linus Walleij
2013-01-23 10:07     ` Linus Walleij
2013-01-23 10:07       ` Linus Walleij
2013-01-23 11:27       ` Lee Jones
2013-01-23 11:27         ` Lee Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.