Skip to contentSkip to conversation

The last large installment of DT for Snowball

PATCH In review Lee Jones 6 participants 50 messages May 18, 2012 – Jun 12, 2012

Subsystems (9)
lore
Share & tools
lore

Lee Jones

author
#0 lore raw

cover The last large installment of DT for Snowball

Everything to follow will be small, mostly unrelated changes and enablement of the odd left-over driver.

 arch/arm/boot/dts/db8500.dtsi          |  143 +++++++++++++++++++++++++++++++-
 arch/arm/boot/dts/snowball.dts         |   14 ++++
 arch/arm/configs/u8500_defconfig       |    1 +
 arch/arm/mach-ux500/board-mop500-uib.c |    4 +-
 arch/arm/mach-ux500/board-mop500.c     |   12 ++-
 arch/arm/mach-ux500/board-mop500.h     |    1 +
 drivers/input/misc/ab8500-ponkey.c     |    6 ++
 drivers/mfd/ab8500-sysctrl.c           |    6 ++
 drivers/mfd/db8500-prcmu.c             |    1 +
 drivers/misc/ab8500-pwm.c              |    6 ++
 drivers/regulator/db8500-prcmu.c       |  137 +++++++++++++++++++++++-------
 11 files changed, 297 insertions(+), 34 deletions(-)
author
#1 lore raw

PATCH 1/16 Input: Add Device Tree support to the ab8500-ponkey driver

This patch will allow the ab8500-ponkey driver to be probed during boot when Device Tree is enabled.

Cc linux-input at vger.kernel.org
---
 drivers/input/misc/ab8500-ponkey.c |    6 ++++++
 1 file changed, 6 insertions(+)
drivers/input/misc/ab8500-ponkey.c +6 -0
index 350fd0c..394aa1f 100644
@@ -131,10 +131,16 @@ static int __devexit ab8500_ponkey_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id ab8500_ponkey_match[] = {
+	{ .compatible = "stericsson,ab8500-ponkey", },
+	{}
+};
+
 static struct platform_driver ab8500_ponkey_driver = {
 	.driver		= {
 		.name	= "ab8500-poweron-key",
 		.owner	= THIS_MODULE,
+		.of_match_table = ab8500_ponkey_match,
 	},
 	.probe		= ab8500_ponkey_probe,
 	.remove		= __devexit_p(ab8500_ponkey_remove),
Signature · 1 line
1.7.9.5
maintainer Applied
#3 lore raw

PATCH 1/16 Input: Add Device Tree support to the ab8500-ponkey driver

Quoted 10 lines · Linus Walleij
Quoted 5 lines · Lee Jones

This patch will allow the ab8500-ponkey driver to be probed during boot when Device Tree is enabled.

Cc linux-input at vger.kernel.org

Applied, thanks.

Signature · 1 line
Dmitry
author
#4 lore raw

PATCH 2/16 ARM: ux500: Enable LED heartbeat functionality on Snowball

In reply to Lee Jones

This patch configures the user LED on Snowball to double flash every second or so, whilst it's still alive. This can give key indications as to what the board is doing in the case of no console output.

---
 arch/arm/mach-ux500/board-mop500.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-ux500/board-mop500.c +1 -1
index de94b2d..8845286 100644
@@ -57,7 +57,7 @@
 static struct gpio_led snowball_led_array[] = {
 	{
 		.name = "user_led",
-		.default_trigger = "none",
+		.default_trigger = "heartbeat",
 		.gpio = 142,
 	},
 };
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH 2/16 ARM: ux500: Enable LED heartbeat functionality on Snowball

Quoted 6 lines · Lee Jones

This patch configures the user LED on Snowball to double flash every second or so, whilst it's still alive. This can give key indications as to what the board is doing in the case of no console output.

This doesn't look like it has anything to do with the DT stuff, shall I queue it in the ux500 tree?

Yours,
Linus Walleij

author
#6 lore raw

PATCH 2/16 ARM: ux500: Enable LED heartbeat functionality on Snowball

Quoted 7 lines · Linus Walleij
Quoted 5 lines · Lee Jones

This patch configures the user LED on Snowball to double flash every second or so, whilst it's still alive. This can give key indications as to what the board is doing in the case of no console output.

Quoted 6 lines
Quoted 1 line

This doesn't look like it has anything to do with the DT stuff, shall I queue it in the ux500 tree?

Yes please.

Signature · 5 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
M: +44 77 88 633 515
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
author
#7 lore raw

PATCH 3/16 ARM: ux500: Enable LED heartbeat functionality on Snowbal via DT

In reply to Lee Jones

This patch configures the user LED on Snowball to double flash every second or so, whilst it's still alive. This can give key indications as to what the board is doing in the case of no console output.

---
 arch/arm/boot/dts/snowball.dts |    1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/snowball.dts +1 -0
index 6b00350..15ee419 100644
@@ -68,6 +68,7 @@
 			label = "user_led";
 			gpios = <&gpio4 14 0x4>;
 			default-state = "on";
+			linux,default-trigger = "heartbeat";
 		};
 	};
 
Signature · 1 line
1.7.9.5
#8 lore raw

PATCH 3/16 ARM: ux500: Enable LED heartbeat functionality on Snowbal via DT

Quoted 6 lines · Lee Jones

This patch configures the user LED on Snowball to double flash every second or so, whilst it's still alive. This can give key indications as to what the board is doing in the case of no console output.

Thanks,
Linus Walleij

author
#9 lore raw

PATCH 4/16 ARM: ux500: Only initialise STE's UIBs on boards which support them

In reply to Lee Jones

ST-Ericsson uses User Interface Boards to extend functionality of some of their development boards. However, these aren't compatible with all the supported boards found in Mainline (Snowball for instance). This patch ensures that the UIBs are only probed on boards which can actually support them. This in turn saves lots of unnecessary error messages normally found in Snowball's boot log.

---
 arch/arm/mach-ux500/board-mop500-uib.c |    4 +---
 arch/arm/mach-ux500/board-mop500.c     |    8 ++++++++
 arch/arm/mach-ux500/board-mop500.h     |    1 +
 3 files changed, 10 insertions(+), 3 deletions(-)
arch/arm/mach-ux500/board-mop500-uib.c +1 -3
index b29a788..1f47d96 100644
@@ -96,7 +96,7 @@ static void __init __mop500_uib_init(struct uib *uib, const char *why)
 /*
  * Detect the UIB attached based on the presence or absence of i2c devices.
  */
-static int __init mop500_uib_init(void)
+int __init mop500_uib_init(void)
 {
 	struct uib *uib = mop500_uib;
 	struct i2c_adapter *i2c0;
@@ -131,5 +131,3 @@ static int __init mop500_uib_init(void)
 
 	return 0;
 }
-
-module_init(mop500_uib_init);
arch/arm/mach-ux500/board-mop500.c +8 -0
index 8845286..faa46b1 100644
@@ -635,6 +635,8 @@ static void __init mop500_init_machine(void)
 
 	/* This board has full regulator constraints */
 	regulator_has_full_constraints();
+
+	mop500_uib_init();
 }
 
 static void __init snowball_init_machine(void)
@@ -699,6 +701,8 @@ static void __init hrefv60_init_machine(void)
 
 	/* This board has full regulator constraints */
 	regulator_has_full_constraints();
+
+	mop500_uib_init();
 }
 
 MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
@@ -809,6 +813,8 @@ static void __init u8500_init_machine(void)
 		i2c_register_board_info(2, mop500_i2c2_devices,
 					ARRAY_SIZE(mop500_i2c2_devices));
 
+		mop500_uib_init();
+
 	} else if (of_machine_is_compatible("calaosystems,snowball-a9500")) {
 		//snowball_pins_init();
 
@@ -842,6 +848,8 @@ static void __init u8500_init_machine(void)
 		i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
 		i2c_register_board_info(2, mop500_i2c2_devices,
 					ARRAY_SIZE(mop500_i2c2_devices));
+
+		mop500_uib_init();
 	}
 
 	/* This board has full regulator constraints */
arch/arm/mach-ux500/board-mop500.h +1 -0
index 44ab4bd..b5bfc1a 100644
@@ -92,6 +92,7 @@ void __init mop500_pinmaps_init(void);
 void __init snowball_pinmaps_init(void);
 void __init hrefv60_pinmaps_init(void);
 
+int __init mop500_uib_init(void);
 void mop500_uib_i2c_add(int busnum, struct i2c_board_info *info,
 		unsigned n);
 
Signature · 1 line
1.7.9.5
#10 lore raw

PATCH 4/16 ARM: ux500: Only initialise STE's UIBs on boards which support them

Quoted 8 lines · Lee Jones

ST-Ericsson uses User Interface Boards to extend functionality of some of their development boards. However, these aren't compatible with all the supported boards found in Mainline (Snowball for instance). This patch ensures that the UIBs are only probed on boards which can actually support them. This in turn saves lots of unnecessary error messages normally found in Snowball's boot log.

Shall I take this through the ux500 tree?

Thanks,
Linus Walleij

author
#11 lore raw

PATCH 4/16 ARM: ux500: Only initialise STE's UIBs on boards which support them

Quoted 9 lines · Linus Walleij
Quoted 7 lines · Lee Jones

ST-Ericsson uses User Interface Boards to extend functionality of some of their development boards. However, these aren't compatible with all the supported boards found in Mainline (Snowball for instance). This patch ensures that the UIBs are only probed on boards which can actually support them. This in turn saves lots of unnecessary error messages normally found in Snowball's boot log.

Quoted 5 lines
Quoted 1 line

Shall I take this through the ux500 tree?

Yes please.

Signature · 5 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
M: +44 77 88 633 515
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
author
#12 lore raw

PATCH 5/16 regulator: db8500-prcmu: Separate regulator registration from probe

In reply to Lee Jones

This will provide us with a convenient way to register regulators when booting with Device Tree both enabled & disabled and will save us a great deal of code duplication in time.

Cc linux-kernel at vger.kernel.org
---
 drivers/regulator/db8500-prcmu.c |   71 +++++++++++++++++++++++---------------
 1 file changed, 44 insertions(+), 27 deletions(-)
drivers/regulator/db8500-prcmu.c +44 -27
index 87b2e83..d6b4d4c 100644
@@ -410,40 +410,58 @@ dbx500_regulator_info[DB8500_NUM_REGULATORS] = {
 	},
 };
 
+static __devinit int db8500_regulator_register(struct platform_device *pdev,
+					struct regulator_init_data *init_data,
+					int id,
+					struct device_node *np)
+{
+	struct dbx500_regulator_info *info;
+	struct regulator_config config = { };
+	int err;
+
+	/* assign per-regulator data */
+	info = &dbx500_regulator_info[id];
+	info->dev = &pdev->dev;
+
+	config.dev = &pdev->dev;
+	config.init_data = init_data;
+	config.driver_data = info;
+	config.of_node = np;
+
+	/* register with the regulator framework */
+	info->rdev = regulator_register(&info->desc, &config);
+	if (IS_ERR(info->rdev)) {
+		err = PTR_ERR(info->rdev);
+		dev_err(&pdev->dev, "failed to register %s: err %i\n",
+			info->desc.name, err);
+
+		/* if failing, unregister all earlier regulators */
+		while (--id >= 0) {
+			info = &dbx500_regulator_info[id];
+			regulator_unregister(info->rdev);
+		}
+		return err;
+	}
+
+	dev_dbg(rdev_get_dev(info->rdev),
+		"regulator-%s-probed\n", info->desc.name);
+
+	return 0;
+}
+
 static int __devinit db8500_regulator_probe(struct platform_device *pdev)
 {
 	struct regulator_init_data *db8500_init_data =
 					dev_get_platdata(&pdev->dev);
-	struct regulator_config config = { };
 	int i, err;
 
 	/* register all regulators */
 	for (i = 0; i < ARRAY_SIZE(dbx500_regulator_info); i++) {
-		struct dbx500_regulator_info *info;
-		struct regulator_init_data *init_data = &db8500_init_data[i];
-
-		/* assign per-regulator data */
-		info = &dbx500_regulator_info[i];
-		info->dev = &pdev->dev;
-
-		config.dev = &pdev->dev;
-		config.init_data = init_data;
-		config.driver_data = info;
-
-		/* register with the regulator framework */
-		info->rdev = regulator_register(&info->desc, &config);
-		if (IS_ERR(info->rdev)) {
-			err = PTR_ERR(info->rdev);
-			dev_err(&pdev->dev, "failed to register %s: err %i\n",
-				info->desc.name, err);
-
-			/* if failing, unregister all earlier regulators */
-			while (--i >= 0) {
-				info = &dbx500_regulator_info[i];
-				regulator_unregister(info->rdev);
-			}
+		err = db8500_regulator_register(pdev,
+						&db8500_init_data[i],
+						i, NULL);
+		if (err)
 			return err;
-		}
 
 		dev_dbg(rdev_get_dev(info->rdev),
 			"regulator-%s-probed\n", info->desc.name);
@@ -451,8 +469,7 @@ static int __devinit db8500_regulator_probe(struct platform_device *pdev)
 	err = ux500_regulator_debug_init(pdev,
 					 dbx500_regulator_info,
 					 ARRAY_SIZE(dbx500_regulator_info));
-
-	return err;
+	return 0;
 }
 
 static int __exit db8500_regulator_remove(struct platform_device *pdev)
Signature · 1 line
1.7.9.5
#13 lore raw

Re: [PATCH 05/16] regulator: db8500-prcmu: Separate regulator registration from probe

Quoted 3 lines · Lee Jones

This will provide us with a convenient way to register regulators when booting with Device Tree both enabled & disabled and will save us a great deal of code duplication in time.

Applied, thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120518/8cc8d638/attachment.sig>

Acked-by on v1 5/16
#14 lore raw

Re: [PATCH 05/16] regulator: db8500-prcmu: Separate regulator registration from probe

In reply to Lee Jones
Quoted 6 lines · Lee Jones

This will provide us with a convenient way to register regulators when booting with Device Tree both enabled & disabled and will save us a great deal of code duplication in time.

Cc linux-kernel at vger.kernel.org

Thanks,
Linus Walleij

author
#15 lore raw

PATCH 6/16 ARM: ux500: Apply db8500-prcmu regulator information to db8500 Device Tree

In reply to Lee Jones

Here we inform Device Tree of which regulators are provided by the db8500- prcmu. This way we can reference some of their consumers directly from the Device Tree e.g. SMSC911x Ethernet chip and the Nomadik I2C controller.

---
 arch/arm/boot/dts/db8500.dtsi |  107 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 107 insertions(+)
arch/arm/boot/dts/db8500.dtsi +107 -0
index 076831c..5e78899 100644
@@ -197,6 +197,113 @@
 				reg = <0x80157450 0xC>;
 			};
 
+			db8500-prcmu-regulators {
+				compatible = "stericsson,db8500-prcmu-regulator";
+
+				// DB8500_REGULATOR_VAPE
+				db8500_vape_reg: db8500_vape {
+					regulator-name = "db8500-vape";
+					regulator-always-on;
+				};
+
+				// DB8500_REGULATOR_VARM
+				db8500_varm_reg: db8500_varm {
+					regulator-name = "db8500-varm";
+				};
+
+				// DB8500_REGULATOR_VMODEM
+				db8500_vmodem_reg: db8500_vmodem {
+					regulator-name = "db8500-vmodem";
+				};
+
+				// DB8500_REGULATOR_VPLL
+				db8500_vpll_reg: db8500_vpll {
+					regulator-name = "db8500-vpll";
+				};
+
+				// DB8500_REGULATOR_VSMPS1
+				db8500_vsmps1_reg: db8500_vsmps1 {
+					regulator-name = "db8500-vsmps1";
+				};
+
+				// DB8500_REGULATOR_VSMPS2
+				db8500_vsmps2_reg: db8500_vsmps2 {
+					regulator-name = "db8500-vsmps2";
+				};
+
+				// DB8500_REGULATOR_VSMPS3
+				db8500_vsmps3_reg: db8500_vsmps3 {
+					regulator-name = "db8500-vsmps3";
+				};
+
+				// DB8500_REGULATOR_VRF1
+				db8500_vrf1_reg: db8500_vrf1 {
+					regulator-name = "db8500-vrf1";
+				};
+
+				// DB8500_REGULATOR_SWITCH_SVAMMDSP
+				db8500_sva_mmdsp_reg: db8500_sva_mmdsp {
+					regulator-name = "db8500-sva-mmdsp";
+				};
+
+				// DB8500_REGULATOR_SWITCH_SVAMMDSPRET
+				db8500_sva_mmdsp_ret_reg: db8500_sva_mmdsp_ret {
+					regulator-name = "db8500-sva-mmdsp-ret";
+				};
+
+				// DB8500_REGULATOR_SWITCH_SVAPIPE
+				db8500_sva_pipe_reg: db8500_sva_pipe {
+					regulator-name = "db8500_sva_pipe";
+				};
+
+				// DB8500_REGULATOR_SWITCH_SIAMMDSP
+				db8500_sia_mmdsp_reg: db8500_sia_mmdsp {
+					regulator-name = "db8500_sia_mmdsp";
+				};
+
+				// DB8500_REGULATOR_SWITCH_SIAMMDSPRET
+				db8500_sia_mmdsp_ret_reg: db8500_sia_mmdsp_ret {
+					regulator-name = "db8500-sia-mmdsp-ret";
+				};
+
+				// DB8500_REGULATOR_SWITCH_SIAPIPE
+				db8500_sia_pipe_reg: db8500_sia_pipe {
+					regulator-name = "db8500-sia-pipe";
+				};
+
+				// DB8500_REGULATOR_SWITCH_SGA
+				db8500_sga_reg: db8500_sga {
+					regulator-name = "db8500-sga";
+					vin-supply = <&db8500_vape_reg>;
+				};
+
+				// DB8500_REGULATOR_SWITCH_B2R2_MCDE
+				db8500_b2r2_mcde_reg: db8500_b2r2_mcde {
+					regulator-name = "db8500-b2r2-mcde";
+					vin-supply = <&db8500_vape_reg>;
+				};
+
+				// DB8500_REGULATOR_SWITCH_ESRAM12
+				db8500_esram12_reg: db8500_esram12 {
+					regulator-name = "db8500-esram12";
+				};
+
+				// DB8500_REGULATOR_SWITCH_ESRAM12RET
+				db8500_esram12_ret_reg: db8500_esram12_ret {
+					regulator-name = "db8500-esram12-ret";
+				};
+
+				// DB8500_REGULATOR_SWITCH_ESRAM34
+				db8500_esram34_reg: db8500_esram34 {
+					regulator-name = "db8500-esram34";
+				};
+
+				// DB8500_REGULATOR_SWITCH_ESRAM34RET
+				db8500_esram34_ret_reg: db8500_esram34_ret {
+					regulator-name = "db8500-esram34-ret";
+				};
+			};
+
 			ab8500 at 5 {
 				compatible = "stericsson,ab8500";
 				reg = <5>; /* mailbox 5 is i2c */
Signature · 1 line
1.7.9.5
#16 lore raw

PATCH 6/16 ARM: ux500: Apply db8500-prcmu regulator information to db8500 Device Tree

Quoted 5 lines · Lee Jones

Here we inform Device Tree of which regulators are provided by the db8500- prcmu. This way we can reference some of their consumers directly from the Device Tree e.g. SMSC911x Ethernet chip and the Nomadik I2C controller.

I am hesitant about the I2C controller. That thing is a voltage domain and it appears these should be handled centrally. using runtime PM and power domains.

Linus Walleij

author
#17 lore raw

PATCH 6/16 ARM: ux500: Apply db8500-prcmu regulator information to db8500 Device Tree

Quoted 11 lines · Linus Walleij
Quoted 5 lines · Lee Jones

Here we inform Device Tree of which regulators are provided by the db8500- prcmu. This way we can reference some of their consumers directly from the Device Tree e.g. SMSC911x Ethernet chip and the Nomadik I2C controller.

I am hesitant about the I2C controller. That thing is a voltage domain and it appears these should be handled centrally. using runtime PM and power domains.

This patch doesn't have anything to do with the I2C controller. I only mentioned it as an example. Would you like me to change the commit log and re-submit?

Signature · 5 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
M: +44 77 88 633 515
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#18 lore raw

PATCH 6/16 ARM: ux500: Apply db8500-prcmu regulator information to db8500 Device Tree

In reply to Lee Jones
Quoted 5 lines · Lee Jones

Here we inform Device Tree of which regulators are provided by the db8500- prcmu. This way we can reference some of their consumers directly from the Device Tree e.g. SMSC911x Ethernet chip and the Nomadik I2C controller.

Remove mentioning the I2C controller and

Yours,
Linus Walleij

author
#19 lore raw

PATCH 7/16 regulator: Enable Device Tree for the db8500-prcmu regulator driver

In reply to Lee Jones

Here we use the previous regulator register code separated from probe to register each of the regulators mentioned in Device Tree.

Cc linux-kernel at vger.kernel.org
---
 drivers/regulator/db8500-prcmu.c |   76 ++++++++++++++++++++++++++++++++++----
 1 file changed, 69 insertions(+), 7 deletions(-)
drivers/regulator/db8500-prcmu.c +69 -7
index d6b4d4c..968f97f 100644
@@ -17,6 +17,8 @@
 #include <linux/regulator/driver.h>
 #include <linux/regulator/machine.h>
 #include <linux/regulator/db8500-prcmu.h>
+#include <linux/regulator/of_regulator.h>
+#include <linux/of.h>
 #include <linux/module.h>
 #include "dbx500-prcmu.h"
 
@@ -449,23 +451,77 @@ static __devinit int db8500_regulator_register(struct platform_device *pdev,
 	return 0;
 }
 
+static struct of_regulator_match db8500_regulator_matches[] = {
+	{ .name	= "db8500-vape",          .driver_data = (void *) DB8500_REGULATOR_VAPE, },
+	{ .name	= "db8500-varm",          .driver_data = (void *) DB8500_REGULATOR_VARM, },
+	{ .name	= "db8500-vmodem",        .driver_data = (void *) DB8500_REGULATOR_VMODEM, },
+	{ .name	= "db8500-vpll",          .driver_data = (void *) DB8500_REGULATOR_VPLL, },
+	{ .name	= "db8500-vsmps1",        .driver_data = (void *) DB8500_REGULATOR_VSMPS1, },
+	{ .name	= "db8500-vsmps2",        .driver_data = (void *) DB8500_REGULATOR_VSMPS2, },
+	{ .name	= "db8500-vsmps3",        .driver_data = (void *) DB8500_REGULATOR_VSMPS3, },
+	{ .name	= "db8500-vrf1",          .driver_data = (void *) DB8500_REGULATOR_VRF1, },
+	{ .name	= "db8500-sva-mmdsp",     .driver_data = (void *) DB8500_REGULATOR_SWITCH_SVAMMDSP, },
+	{ .name	= "db8500-sva-mmdsp-ret", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SVAMMDSPRET, },
+	{ .name	= "db8500-sva-pipe",      .driver_data = (void *) DB8500_REGULATOR_SWITCH_SVAPIPE, },
+	{ .name	= "db8500-sia-mmdsp",     .driver_data = (void *) DB8500_REGULATOR_SWITCH_SIAMMDSP, },
+	{ .name	= "db8500-sia-mmdsp-ret", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SIAMMDSPRET, },
+	{ .name	= "db8500-sia-pipe",      .driver_data = (void *) DB8500_REGULATOR_SWITCH_SIAPIPE, },
+	{ .name	= "db8500-sga",           .driver_data = (void *) DB8500_REGULATOR_SWITCH_SGA, },
+	{ .name	= "db8500-b2r2-mcde",     .driver_data = (void *) DB8500_REGULATOR_SWITCH_B2R2_MCDE, },
+	{ .name	= "db8500-esram12",       .driver_data = (void *) DB8500_REGULATOR_SWITCH_ESRAM12, },
+	{ .name	= "db8500-esram12-ret",   .driver_data = (void *) DB8500_REGULATOR_SWITCH_ESRAM12RET, },
+	{ .name	= "db8500-esram34",       .driver_data = (void *) DB8500_REGULATOR_SWITCH_ESRAM34, },
+	{ .name	= "db8500-esram34-ret",   .driver_data = (void *) DB8500_REGULATOR_SWITCH_ESRAM34RET, },
+};
+
+static __devinit int
+db8500_regulator_of_probe(struct platform_device *pdev,
+			struct device_node *np)
+{
+	int i, err;
+
+	for (i = 0; i < ARRAY_SIZE(dbx500_regulator_info); i++) {
+		err = db8500_regulator_register(
+			pdev, db8500_regulator_matches[i].init_data,
+			i, db8500_regulator_matches[i].of_node);
+		if (err)
+			return err;
+	}
+
+	return 0;
+}
+
 static int __devinit db8500_regulator_probe(struct platform_device *pdev)
 {
 	struct regulator_init_data *db8500_init_data =
 					dev_get_platdata(&pdev->dev);
+	struct device_node *np = pdev->dev.of_node;
 	int i, err;
 
 	/* register all regulators */
-	for (i = 0; i < ARRAY_SIZE(dbx500_regulator_info); i++) {
-		err = db8500_regulator_register(pdev,
-						&db8500_init_data[i],
-						i, NULL);
-		if (err)
+	if (np) {
+		err = of_regulator_match(&pdev->dev, np,
+					db8500_regulator_matches,
+					ARRAY_SIZE(db8500_regulator_matches));
+		if (err < 0) {
+			dev_err(&pdev->dev,
+				"Error parsing regulator init data: %d\n", err);
 			return err;
+		}
 
-		dev_dbg(rdev_get_dev(info->rdev),
-			"regulator-%s-probed\n", info->desc.name);
+		err = db8500_regulator_of_probe(pdev, np);
+		if (err)
+			return err;
+	} else {
+		for (i = 0; i < ARRAY_SIZE(dbx500_regulator_info); i++) {
+			err = db8500_regulator_register(pdev,
+							&db8500_init_data[i],
+							i, NULL);
+			if (err)
+				return err;
+		}
 	}
+
 	err = ux500_regulator_debug_init(pdev,
 					 dbx500_regulator_info,
 					 ARRAY_SIZE(dbx500_regulator_info));
@@ -491,10 +547,16 @@ static int __exit db8500_regulator_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id db8500_prcmu_regulator_match[] = {
+        { .compatible = "stericsson,db8500-prcmu-regulator", },
+        {}
+};
+
 static struct platform_driver db8500_regulator_driver = {
 	.driver = {
 		.name = "db8500-prcmu-regulators",
 		.owner = THIS_MODULE,
+		.of_match_table = db8500_prcmu_regulator_match,
 	},
 	.probe = db8500_regulator_probe,
 	.remove = __exit_p(db8500_regulator_remove),
Signature · 1 line
1.7.9.5
#20 lore raw

Re: [PATCH 07/16] regulator: Enable Device Tree for the db8500-prcmu regulator driver

Quoted 2 lines · Lee Jones

Here we use the previous regulator register code separated from probe to register each of the regulators mentioned in Device Tree.

Applied, thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120518/218fb70d/attachment.sig>

author
#22 lore raw

PATCH 8/16 ARM: ux500: Allow PRCMU regulator to be probed during a DT enabled boot

In reply to Lee Jones

This patch adds the correct compatible string for use during Device Tree population. Without it the DB8500 PRCMU regulators would be processed when DT is enabled.

---
 arch/arm/mach-ux500/board-mop500.c |    1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-ux500/board-mop500.c +1 -0
index faa46b1..33d47e1 100644
@@ -771,6 +771,7 @@ static const struct of_device_id u8500_local_bus_nodes[] = {
 	/* only create devices below soc node */
 	{ .compatible = "stericsson,db8500", },
 	{ .compatible = "stericsson,db8500-prcmu", },
+	{ .compatible = "stericsson,db8500-prcmu-regulator", },
 	{ .compatible = "stericsson,ab8500", },
 	{ .compatible = "stericsson,ab8500-regulator", },
 	{ .compatible = "simple-bus"},
Signature · 1 line
1.7.9.5
author
#24 lore raw

PATCH 9/16 ARM: ux500: Provide regulator support for SMSC911x via Device Tree

In reply to Lee Jones

This patch adds a fixed regulator for use by the SMSC911x Ethernet chip driver into the db8500 Device Tree. It also references other regulators required by the same device.

---
 arch/arm/boot/dts/snowball.dts   |   13 +++++++++++++
 arch/arm/configs/u8500_defconfig |    1 +
 drivers/mfd/db8500-prcmu.c       |    1 +
 3 files changed, 15 insertions(+)
arch/arm/boot/dts/snowball.dts +13 -0
index 15ee419..ae3c367 100644
@@ -20,6 +20,16 @@
 		reg = <0x00000000 0x20000000>;
 	};
 
+	en_3v3_reg: en_3v3 {
+		compatible = "regulator-fixed";
+                regulator-name = "en-3v3-fixed-supply";
+                regulator-min-microvolt = <3300000>;
+                regulator-max-microvolt = <3300000>;
+                gpios = <&gpio0 26  0x4>; // 26
+                startup-delay-us = <5000>;
+                enable-active-high;
+	};
+
 	gpio_keys {
 		compatible = "gpio-keys";
 		#address-cells = <1>;
@@ -81,6 +91,9 @@
 				reg = <0 0x10000>;
 				interrupts = <12 0x1>;
 				interrupt-parent = <&gpio4>;
+				vdd33a-supply = <&en_3v3_reg>;
+				vddvario-supply = <&db8500_vape_reg>;
+
 
 				reg-shift = <1>;
 				reg-io-width = <2>;
arch/arm/configs/u8500_defconfig +1 -0
index c6973c5..440152a 100644
@@ -75,6 +75,7 @@ CONFIG_AB5500_CORE=y
 CONFIG_AB8500_CORE=y
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_AB8500=y
+CONFIG_REGULATOR_FIXED_VOLTAGE=y
 # CONFIG_HID_SUPPORT is not set
 CONFIG_USB_GADGET=y
 CONFIG_AB8500_USB=y
drivers/mfd/db8500-prcmu.c +1 -0
index d534449..40204e1 100644
@@ -2735,6 +2735,7 @@ static struct regulator_consumer_supply db8500_vape_consumers[] = {
 	REGULATOR_SUPPLY("vcore", "uart2"),
 	REGULATOR_SUPPLY("v-ape", "nmk-ske-keypad.0"),
 	REGULATOR_SUPPLY("v-hsi", "ste_hsi.0"),
+	REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
 };
 
 static struct regulator_consumer_supply db8500_vsmps2_consumers[] = {
Signature · 1 line
1.7.9.5
#25 lore raw

PATCH 9/16 ARM: ux500: Provide regulator support for SMSC911x via Device Tree

Quoted 8 lines · Lee Jones

This patch adds a fixed regulator for use by the SMSC911x Ethernet chip driver into the db8500 Device Tree. It also references other regulators required by the same device.

?arch/arm/boot/dts/snowball.dts ? | ? 13 +++++++++++++
?arch/arm/configs/u8500_defconfig | ? ?1 +
?drivers/mfd/db8500-prcmu.c ? ? ? | ? ?1 +

We usually don't mix code and defconfig changes in the same patch.

Why can't the snowball Kconfig select the fixed regulator instead, so you get rid of the defconfig change?

drivers/mfd/db8500-prcmu.c static struct regulator_consumer_supply db8500_vape_consumers[] = { · line 2739

Quoted 10 lines
drivers/mfd/db8500-prcmu.c +1 -0
index d534449..40204e1 100644
@@ -2735,6 +2735,7 @@ static struct regulator_consumer_supply db8500_vape_consumers[] = {
 ? ? ? ?REGULATOR_SUPPLY("vcore", "uart2"),
 ? ? ? ?REGULATOR_SUPPLY("v-ape", "nmk-ske-keypad.0"),
 ? ? ? ?REGULATOR_SUPPLY("v-hsi", "ste_hsi.0"),
+ ? ? ? REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
 ?};

Hm we have discussed previously that these regulator supplies should be passed from the platform rather than open-coded in the driver.

Well, Device Tree solves that problem long term I guess.

Yours,
Lins Walleij

maintainer
#26 lore raw

PATCH 9/16 ARM: ux500: Provide regulator support for SMSC911x via Device Tree

Quoted 6 lines · Linus Walleij
Quoted 4 lines · Lee Jones

This patch adds a fixed regulator for use by the SMSC911x Ethernet chip driver into the db8500 Device Tree. It also references other regulators required by the same device.

Quoted 6 lines
Quoted 4 lines
 arch/arm/boot/dts/snowball.dts   |   13 +++++++++++++
 arch/arm/configs/u8500_defconfig |    1 +
 drivers/mfd/db8500-prcmu.c       |    1 +

We usually don't mix code and defconfig changes in the same patch.

I think it would be good if we did more often ;-)

Quoted 2 lines

Why can't the snowball Kconfig select the fixed regulator instead, so you get rid of the defconfig change?

Is it a build dependency or a run-time dependency? I'd say if the kernel fails to build without enabling the fixed regulator, it needs to be selected in Kconfig, otherwise I'd prefer to have it enabled in the defconfig file.

Arnd

author
#27 lore raw

PATCH 9/16 ARM: ux500: Provide regulator support for SMSC911x via Device Tree

In reply to Linus Walleij
Quoted 11 lines · Linus Walleij
Quoted 8 lines · Lee Jones

This patch adds a fixed regulator for use by the SMSC911x Ethernet chip driver into the db8500 Device Tree. It also references other regulators required by the same device.

  arch/arm/boot/dts/snowball.dts   |   13 +++++++++++++
  arch/arm/configs/u8500_defconfig |    1 +
  drivers/mfd/db8500-prcmu.c       |    1 +
Quoted 4 lines

We usually don't mix code and defconfig changes in the same patch.

Why can't the snowball Kconfig select the fixed regulator instead, so you get rid of the defconfig change?

I can do that.

Quoted 5 lines
Quoted 5 lines
drivers/mfd/db8500-prcmu.c +0 -0
index d534449..40204e1 100644
@@ -2735,6 +2735,7 @@ static struct regulator_consumer_supply db8500_vape_consumers[] = {
Quoted 8 lines

drivers/mfd/db8500-prcmu.c static struct regulator_consumer_supply db8500_vape_consumers[] = { · line 2739

Quoted 5 lines
drivers/mfd/db8500-prcmu.c +1 -0
        REGULATOR_SUPPLY("vcore", "uart2"),
        REGULATOR_SUPPLY("v-ape", "nmk-ske-keypad.0"),
        REGULATOR_SUPPLY("v-hsi", "ste_hsi.0"),
+       REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
  };

Hm we have discussed previously that these regulator supplies should be passed from the platform rather than open-coded in the driver.

So, do you want me to chop this out of this patch and re-submit then?

Quoted 1 line

Well, Device Tree solves that problem long term I guess.

Right.

Signature · 5 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
M: +44 77 88 633 515
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
author
#28 lore raw

PATCH 10/16 ARM: ux500: Add db8500 Device Tree node for ab8500-sysctrl

In reply to Lee Jones

This adds the DT node for the mfd/ab8500-sysctrl driver. It will allow probing of the driver during a Device Tree enabled boot.

---
 arch/arm/boot/dts/db8500.dtsi |    4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boot/dts/db8500.dtsi +4 -0
index 5e78899..3c00e0670 100644
@@ -329,6 +329,10 @@
 					interrupt-names = "ONKEY_DBF", "ONKEY_DBR";
 				};
 
+				ab8500-sysctrl {
+					compatible = "stericsson,ab8500-sysctrl";
+				};
+
 				ab8500-regulators {
 					compatible = "stericsson,ab8500-regulator";
 
Signature · 1 line
1.7.9.5
author
#30 lore raw

PATCH 11/16 mfd: Enable Device Tree support in the ab8500-sysctrl driver

In reply to Lee Jones

This patch ensures probing of the ab8500-sysctrl driver during a DT enabled boot, so long as the associated nodes are present in the Device Tree binary.

---
 drivers/mfd/ab8500-sysctrl.c |    6 ++++++
 1 file changed, 6 insertions(+)
drivers/mfd/ab8500-sysctrl.c +6 -0
index c28d4eb..5a3e51c 100644
@@ -61,10 +61,16 @@ static int __devexit ab8500_sysctrl_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id ab8500_sysctrl_match[] = {
+	{ .compatible = "stericsson,ab8500-sysctrl", },
+	{}
+};
+
 static struct platform_driver ab8500_sysctrl_driver = {
 	.driver = {
 		.name = "ab8500-sysctrl",
 		.owner = THIS_MODULE,
+		.of_match_table = ab8500_sysctrl_match,
 	},
 	.probe = ab8500_sysctrl_probe,
 	.remove = __devexit_p(ab8500_sysctrl_remove),
Signature · 1 line
1.7.9.5
Applied
#31 lore raw

PATCH 11/16 mfd: Enable Device Tree support in the ab8500-sysctrl driver

Hi Lee,

Quoted 3 lines · Lee Jones

This patch ensures probing of the ab8500-sysctrl driver during a DT enabled boot, so long as the associated nodes are present in the Device Tree binary.

Applied, thanks.

Cheers,
Samuel.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/
author
#32 lore raw

PATCH 12/16 ARM: ux500: Add db8500 Device Tree node for misc/ab8500-pwm

In reply to Lee Jones

This adds the DT node for the misc/ab8500-pwm driver. It will allow probing of the driver during a Device Tree enabled boot.

---
 arch/arm/boot/dts/db8500.dtsi |    4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boot/dts/db8500.dtsi +4 -0
index 3c00e0670..37dcc13 100644
@@ -333,6 +333,10 @@
 					compatible = "stericsson,ab8500-sysctrl";
 				};
 
+				ab8500-pwm {
+					compatible = "stericsson,ab8500-pwm";
+				};
+
 				ab8500-regulators {
 					compatible = "stericsson,ab8500-regulator";
 
Signature · 1 line
1.7.9.5
author
#34 lore raw

PATCH 13/16 mfd: Enable Device Tree support in the ab8500-pwm driver

In reply to Lee Jones

This patch ensures probing of the ab8500-pwm driver during a DT enabled boot, so long as the associated nodes are present in the Device Tree binary.

---
 drivers/misc/ab8500-pwm.c |    6 ++++++
 1 file changed, 6 insertions(+)
drivers/misc/ab8500-pwm.c +6 -0
index d7a9aa1..042a8fe 100644
@@ -142,10 +142,16 @@ static int __devexit ab8500_pwm_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id ab8500_pwm_match[] = {
+	{ .compatible = "stericsson,ab8500-pwm", },
+	{}
+};
+
 static struct platform_driver ab8500_pwm_driver = {
 	.driver = {
 		.name = "ab8500-pwm",
 		.owner = THIS_MODULE,
+		.of_match_table = ab8500_pwm_match,
 	},
 	.probe = ab8500_pwm_probe,
 	.remove = __devexit_p(ab8500_pwm_remove),
Signature · 1 line
1.7.9.5
Applied
#35 lore raw

PATCH 13/16 mfd: Enable Device Tree support in the ab8500-pwm driver

Hi Lee,

Quoted 3 lines · Lee Jones

This patch ensures probing of the ab8500-pwm driver during a DT enabled boot, so long as the associated nodes are present in the Device Tree binary.

Applied as well, thanks.

Cheers,
Samuel.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/
author
#36 lore raw

PATCH 14/16 ARM: ux500: Add a ab8500-usb Device Tree node for db8500 based devices

In reply to Lee Jones

Here we specify each of the ab8500 USB driver's seven IRQs, which the driver references by name. We also apply regulator support for the three used by the device.

---
 arch/arm/boot/dts/db8500.dtsi |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
arch/arm/boot/dts/db8500.dtsi +21 -0
index 37dcc13..dcc5099 100644
@@ -322,6 +322,27 @@
 					vddadc-supply = <&ab8500_ldo_tvout_reg>;
 				};
 
+				ab8500-usb {
+					compatible = "stericsson,ab8500-usb";
+					interrupts = < 0 90 0x4
+						       0 96 0x4
+						       0 14 0x4
+						       0 15 0x4
+						       0 79 0x4
+						       0 74 0x4
+						       0 75 0x4>;
+					interrupt-names = "ID_WAKEUP_R",
+							  "ID_WAKEUP_F",
+							  "VBUS_DET_F",
+							  "VBUS_DET_R",
+							  "USB_LINK_STATUS",
+							  "USB_ADP_PROBE_PLUG",
+							  "USB_ADP_PROBE_UNPLUG";
+					vddulpivio18-supply = <&ab8500_ldo_initcore_reg>;
+					v-ape-supply = <&db8500_vape_reg>;
+					musb_1v8-supply = <&db8500_vsmps2_reg>;
+				};
+
 				ab8500-ponkey {
 					compatible = "stericsson,ab8500-ponkey";
 					interrupts = <0 6 0x4
Signature · 1 line
1.7.9.5
author
#38 lore raw

PATCH 15/16 ARM: ux500: Add regulator support for nomadik-i2c into the db8500 Device Tree

In reply to Lee Jones

Now we have full ab8500 and db8500-prcmu regulator support within DT we can easily reference them from within each of the consumer's nodes. Here we reference the ones used by each of the Nomadic I2C controllers.

---
 arch/arm/boot/dts/db8500.dtsi |    5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/db8500.dtsi +5 -0
index dcc5099..f1e0fb4 100644
@@ -434,6 +434,7 @@
 			interrupts = <0 21 0x4>;
 			#address-cells = <1>;
 			#size-cells = <0>;
+			v-i2c-supply = <&db8500_vape_reg>;
 		};
 
 		i2c at 80122000 {
@@ -442,6 +443,7 @@
 			interrupts = <0 22 0x4>;
 			#address-cells = <1>;
 			#size-cells = <0>;
+			v-i2c-supply = <&db8500_vape_reg>;
 		};
 
 		i2c at 80128000 {
@@ -450,6 +452,7 @@
 			interrupts = <0 55 0x4>;
 			#address-cells = <1>;
 			#size-cells = <0>;
+			v-i2c-supply = <&db8500_vape_reg>;
 		};
 
 		i2c at 80110000 {
@@ -458,6 +461,7 @@
 			interrupts = <0 12 0x4>;
 			#address-cells = <1>;
 			#size-cells = <0>;
+			v-i2c-supply = <&db8500_vape_reg>;
 		};
 
 		i2c at 8012a000 {
@@ -466,6 +470,7 @@
 			interrupts = <0 51 0x4>;
 			#address-cells = <1>;
 			#size-cells = <0>;
+			v-i2c-supply = <&db8500_vape_reg>;
 		};
 
 		ssp at 80002000 {
Signature · 1 line
1.7.9.5
#39 lore raw

PATCH 15/16 ARM: ux500: Add regulator support for nomadik-i2c into the db8500 Device Tree

Quoted 5 lines · Lee Jones

Now we have full ab8500 and db8500-prcmu regulator support within DT we can easily reference them from within each of the consumer's nodes. Here we reference the ones used by each of the Nomadic I2C controllers.

I'm hesitant about this. It seems to be going about things the wrong way to have the platform device take a voltage domain regulator.

Yours,
Linus Walleij

author
#40 lore raw

PATCH 15/16 ARM: ux500: Add regulator support for nomadik-i2c into the db8500 Device Tree

Quoted 10 lines · Linus Walleij
Quoted 5 lines · Lee Jones

Now we have full ab8500 and db8500-prcmu regulator support within DT we can easily reference them from within each of the consumer's nodes. Here we reference the ones used by each of the Nomadic I2C controllers.

I'm hesitant about this. It seems to be going about things the wrong way to have the platform device take a voltage domain regulator.

This doesn't change the behavior of the current system, only DT:s it.

It's just that:

Quoted 2 lines
struct regulator_consumer_supply db8500_vape_consumers[] = {
        REGULATOR_SUPPLY("v-i2c", "nmk-i2c.0")

In drivers/mfd/db8500-prcmu.c is replaced by:

Quoted 1 line

v-i2c-supply = <&db8500_vape_reg>;

In the Device Tree.

If we want to start re-working things, can we do it after the DT enablement please?

Signature · 5 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
M: +44 77 88 633 515
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#41 lore raw

PATCH 15/16 ARM: ux500: Add regulator support for nomadik-i2c into the db8500 Device Tree

Quoted 4 lines · Lee Jones

This doesn't change the behavior of the current system, only DT:s it.

It's just that:

Quoted 8 lines
Quoted 2 lines

struct regulator_consumer_supply db8500_vape_consumers[] = { ? ? ? ?REGULATOR_SUPPLY("v-i2c", "nmk-i2c.0")

In drivers/mfd/db8500-prcmu.c is replaced by:

Quoted 1 line

v-i2c-supply = <&db8500_vape_reg>;

In the Device Tree

Yes...

Quoted 2 lines

If we want to start re-working things, can we do it after the DT enablement please?

I'm told not to put DT bindings for things in place if they are incorrect, since they get set in stone... and I'm told we should probably remove this one regulator from the device rather. I'm just uncertain.

Linus Walleij

author
#42 lore raw

PATCH 15/16 ARM: ux500: Add regulator support for nomadik-i2c into the db8500 Device Tree

Quoted 17 lines · Linus Walleij
Quoted 4 lines · Lee Jones

This doesn't change the behavior of the current system, only DT:s it.

It's just that:

Quoted 8 lines
Quoted 2 lines
struct regulator_consumer_supply db8500_vape_consumers[] = {
        REGULATOR_SUPPLY("v-i2c", "nmk-i2c.0")

In drivers/mfd/db8500-prcmu.c is replaced by:

Quoted 1 line

v-i2c-supply =<&db8500_vape_reg>;

In the Device Tree

Yes...

Quoted 7 lines
Quoted 2 lines

If we want to start re-working things, can we do it after the DT enablement please?

I'm told not to put DT bindings for things in place if they are incorrect, since they get set in stone... and I'm told we should probably remove this one regulator from the device rather. I'm just uncertain.

Nothing is set in stone. I'm always happy to do clean-ups and code corrections. :)

Mark,

What's the answer?

Kind regards,
Lee

Signature · 5 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
M: +44 77 88 633 515
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#43 lore raw

PATCH 15/16 ARM: ux500: Add regulator support for nomadik-i2c into the db8500 Device Tree

Quoted 8 lines · Lee Jones

[Me]

Quoted 4 lines

I'm told not to put DT bindings for things in place if they are incorrect, since they get set in stone... and I'm told we should probably remove this one regulator from the device rather. I'm just uncertain.

Nothing is set in stone. I'm always happy to do clean-ups and code corrections. :)

So assume this one device tree gets deployed, and some poor windows phone developer start scratching his head about the strange voltage domain regulator for the I2C device, when in reality there is no such thing, there is only an APE voltage domain regulator common for all these devices.

So with device trees the fit between physical reality and what we model in the kernel needs to be as close as possible or we will cause trouble.

That's the implications it will have unless we get it right, and that's why I'm hesitant.

Yours,
Linus Walleij

author
#44 lore raw

PATCH 15/16 ARM: ux500: Add regulator support for nomadik-i2c into the db8500 Device Tree

Quoted 16 lines · Linus Walleij
Quoted 8 lines · Lee Jones

[Me]

Quoted 4 lines

I'm told not to put DT bindings for things in place if they are incorrect, since they get set in stone... and I'm told we should probably remove this one regulator from the device rather. I'm just uncertain.

Nothing is set in stone. I'm always happy to do clean-ups and code corrections. :)

So assume this one device tree gets deployed, and some poor windows phone developer start scratching his head about the strange voltage domain regulator for the I2C device, when in reality there is no such thing, there is only an APE voltage domain regulator common for all these devices.

Quoted 6 lines

So with device trees the fit between physical reality and what we model in the kernel needs to be as close as possible or we will cause trouble.

That's the implications it will have unless we get it right, and that's why I'm hesitant.

I'm more than happy to 'do the right thing', but I need to know what that is first.

Signature · 5 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
M: +44 77 88 633 515
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#45 lore raw

PATCH 15/16 ARM: ux500: Add regulator support for nomadik-i2c into the db8500 Device Tree

Quoted 10 lines · Lee Jones
Quoted 5 lines · Linus Walleij

So assume this one device tree gets deployed, and some poor windows phone developer start scratching his head about the strange voltage domain regulator for the I2C device, when in reality there is no such thing, there is only an APE voltage domain regulator common for all these devices.

I'm more than happy to 'do the right thing', but I need to know what that is first.

My working assumption is that the right thing to do is delete this regulator from the I2C driver, then refactor the (out-of-tree) runtime PM code to fetch the voltage domain regulators, so the APE voltage domain regulators get taken by the voltage domains instead.

I haven't tried deleting it though, plese try it and see if the domain is still on anyway, then it's the way to proceed.

Yours,
Linus Walleij

author
#46 lore raw

PATCH 16/16 ARM: ux500: Re-enable SMSC911x platform code registration during non-DT boots

In reply to Lee Jones

The patch to disable SMSC911x registration was applied twice in the upstream kernel by mistake. Git interpreted this as 'take the same entry from a similar struct' which was close by. This was the wrong thing to do. This patch rectifies this error and re-enables SMSC911x registration when Device Tree is not enabled.

---
 arch/arm/mach-ux500/board-mop500.c |    1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-ux500/board-mop500.c +1 -0
index 33d47e1..2ddbb87 100644
@@ -596,6 +596,7 @@ static void __init mop500_uart_init(struct device *parent)
 static struct platform_device *snowball_platform_devs[] __initdata = {
 	&snowball_led_dev,
 	&snowball_key_dev,
+	&snowball_sbnet_dev,
 	&ab8500_device,
 };
 
Signature · 1 line
1.7.9.5
#47 lore raw

PATCH 16/16 ARM: ux500: Re-enable SMSC911x platform code registration during non-DT boots

Quoted 8 lines · Lee Jones

The patch to disable SMSC911x registration was applied twice in the upstream kernel by mistake. Git interpreted this as 'take the same entry from a similar struct' which was close by. This was the wrong thing to do. This patch rectifies this error and re-enables SMSC911x registration when Device Tree is not enabled.

This patch needs to go first, and into the -rc series.

Thanks,
Linus Walleij

author
#48 lore raw

PATCH 16/16 ARM: ux500: Re-enable SMSC911x platform code registration during non-DT boots

Quoted 8 lines · Linus Walleij
Quoted 6 lines · Lee Jones

The patch to disable SMSC911x registration was applied twice in the upstream kernel by mistake. Git interpreted this as 'take the same entry from a similar struct' which was close by. This was the wrong thing to do. This patch rectifies this error and re-enables SMSC911x registration when Device Tree is not enabled.

Quoted 6 lines
Quoted 2 lines

This patch needs to go first, and into the -rc series.

Do you want to take it?

If not, how would you like me to take it forward?

Signature · 5 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
M: +44 77 88 633 515
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#49 lore raw

PATCH 16/16 ARM: ux500: Re-enable SMSC911x platform code registration during non-DT boots

Quoted 3 lines · Lee Jones

Do you want to take it?

If not, how would you like me to take it forward?

Please do, I've screwed up DT patches in the past so it's better if they go through a separate pull request.

Yours,
Linus Walleij