All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7 v2] Next round of DT enablement for ux500/Snowball
@ 2012-04-13 14:05 Lee Jones
  2012-04-13 14:05 ` [PATCH 1/7] ARM: ux500: Rename the DT compatible entry for i2c devices on Snowball Lee Jones
                   ` (7 more replies)
  0 siblings, 8 replies; 82+ messages in thread
From: Lee Jones @ 2012-04-13 14:05 UTC (permalink / raw)
  To: linux-arm-kernel

In this patch-set we change a couple of DT compatible entries
to something less cumbersome. Then we have a second stab at 
enabling DT for mmci. Only this time keeping it simple and 
continuing to use current DMA initialisation code. We'll 
change that once the generic bindings for DMA have been 
mainlined. Finally we enable Snowball's GPIO controller.

.../devicetree/bindings/gpio/gpio-nmk.txt          |   29 ++++++++++
 Documentation/devicetree/bindings/mmc/mmci.txt     |   19 +++++++
 arch/arm/boot/dts/db8500.dtsi                      |   46 +++++++++++-----
 arch/arm/boot/dts/snowball.dts                     |   39 +++++++++----
 arch/arm/mach-ux500/board-mop500-sdi.c             |    4 +-
 arch/arm/mach-ux500/board-mop500.c                 |   15 +++++-
 arch/arm/mach-ux500/board-mop500.h                 |    4 ++
 drivers/gpio/gpio-nomadik.c                        |   41 +++++++++++++-
 drivers/mmc/host/mmci.c                            |   58 ++++++++++++++++++--
 9 files changed, 219 insertions(+), 36 deletions(-)

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

* [PATCH 1/7] ARM: ux500: Rename the DT compatible entry for i2c devices on Snowball
  2012-04-13 14:05 [PATCH 0/7 v2] Next round of DT enablement for ux500/Snowball Lee Jones
@ 2012-04-13 14:05 ` Lee Jones
  2012-04-16  8:34   ` Linus Walleij
  2012-04-13 14:05 ` [PATCH 2/7] ARM: ux500: Shorten Snowball's DT compatible gpio entry Lee Jones
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 82+ messages in thread
From: Lee Jones @ 2012-04-13 14:05 UTC (permalink / raw)
  To: linux-arm-kernel

It is believed that the i2c compatible match entry is too long
and cumbersome in its current form. This patch takes steps to
decrease its length by using ST-Mircroelectrics' abbreviation ST.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/db8500.dtsi |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/arm/boot/dts/db8500.dtsi b/arch/arm/boot/dts/db8500.dtsi
index d73dce6..f482845 100644
--- a/arch/arm/boot/dts/db8500.dtsi
+++ b/arch/arm/boot/dts/db8500.dtsi
@@ -56,7 +56,7 @@
 
 		gpio0: gpio at 8012e000 {
 			compatible = "stericsson,db8500-gpio",
-				"stmicroelectronics,nomadik-gpio";
+				"st,nomadik-gpio";
 			reg =  <0x8012e000 0x80>;
 			interrupts = <0 119 0x4>;
 			supports-sleepmode;
@@ -65,7 +65,7 @@
 
 		gpio1: gpio at 8012e080 {
 			compatible = "stericsson,db8500-gpio",
-				"stmicroelectronics,nomadik-gpio";
+				"st,nomadik-gpio";
 			reg =  <0x8012e080 0x80>;
 			interrupts = <0 120 0x4>;
 			supports-sleepmode;
@@ -74,7 +74,7 @@
 
 		gpio2: gpio at 8000e000 {
 			compatible = "stericsson,db8500-gpio",
-				"stmicroelectronics,nomadik-gpio";
+				"st,nomadik-gpio";
 			reg =  <0x8000e000 0x80>;
 			interrupts = <0 121 0x4>;
 			supports-sleepmode;
@@ -83,7 +83,7 @@
 
 		gpio3: gpio at 8000e080 {
 			compatible = "stericsson,db8500-gpio",
-				"stmicroelectronics,nomadik-gpio";
+				"st,nomadik-gpio";
 			reg =  <0x8000e080 0x80>;
 			interrupts = <0 122 0x4>;
 			supports-sleepmode;
@@ -92,7 +92,7 @@
 
 		gpio4: gpio at 8000e100 {
 			compatible = "stericsson,db8500-gpio",
-				"stmicroelectronics,nomadik-gpio";
+				"st,nomadik-gpio";
 			reg =  <0x8000e100 0x80>;
 			interrupts = <0 123 0x4>;
 			supports-sleepmode;
@@ -101,7 +101,7 @@
 
 		gpio5: gpio at 8000e180 {
 			compatible = "stericsson,db8500-gpio",
-				"stmicroelectronics,nomadik-gpio";
+				"st,nomadik-gpio";
 			reg =  <0x8000e180 0x80>;
 			interrupts = <0 124 0x4>;
 			supports-sleepmode;
@@ -110,7 +110,7 @@
 
 		gpio6: gpio at 8011e000 {
 			compatible = "stericsson,db8500-gpio",
-				"stmicroelectronics,nomadik-gpio";
+				"st,nomadik-gpio";
 			reg =  <0x8011e000 0x80>;
 			interrupts = <0 125 0x4>;
 			supports-sleepmode;
@@ -119,7 +119,7 @@
 
 		gpio7: gpio at 8011e080 {
 			compatible = "stericsson,db8500-gpio",
-				"stmicroelectronics,nomadik-gpio";
+				"st,nomadik-gpio";
 			reg =  <0x8011e080 0x80>;
 			interrupts = <0 126 0x4>;
 			supports-sleepmode;
@@ -128,7 +128,7 @@
 
 		gpio8: gpio at a03fe000 {
 			compatible = "stericsson,db8500-gpio",
-				"stmicroelectronics,nomadik-gpio";
+				"st,nomadik-gpio";
 			reg =  <0xa03fe000 0x80>;
 			interrupts = <0 127 0x4>;
 			supports-sleepmode;
-- 
1.7.9.1

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

* [PATCH 2/7] ARM: ux500: Shorten Snowball's DT compatible gpio entry
  2012-04-13 14:05 [PATCH 0/7 v2] Next round of DT enablement for ux500/Snowball Lee Jones
  2012-04-13 14:05 ` [PATCH 1/7] ARM: ux500: Rename the DT compatible entry for i2c devices on Snowball Lee Jones
@ 2012-04-13 14:05 ` Lee Jones
  2012-04-16  8:36   ` Linus Walleij
  2012-04-13 14:05 ` [PATCH 3/7] drivers/gpio: gpio-nomadik: Apply Device Tree bindings Lee Jones
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 82+ messages in thread
From: Lee Jones @ 2012-04-13 14:05 UTC (permalink / raw)
  To: linux-arm-kernel

It is believed that the gpio compatible match entry is too long
and cumbersome in its current form. This patch takes steps to
decrease its length by using ST-Mircroelectrics' abbreviation ST.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/db8500.dtsi |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boot/dts/db8500.dtsi b/arch/arm/boot/dts/db8500.dtsi
index f482845..421e15f 100644
--- a/arch/arm/boot/dts/db8500.dtsi
+++ b/arch/arm/boot/dts/db8500.dtsi
@@ -164,7 +164,7 @@
 		};
 
 		i2c at 80004000 {
-			compatible = "stericsson,db8500-i2c", "stmicroelectronics,nomadik-i2c";
+			compatible = "stericsson,db8500-i2c", "st,nomadik-i2c";
 			reg = <0x80004000 0x1000>;
 			interrupts = <0 21 0x4>;
 			#address-cells = <1>;
@@ -172,7 +172,7 @@
 		};
 
 		i2c at 80122000 {
-			compatible = "stericsson,db8500-i2c", "stmicroelectronics,nomadik-i2c";
+			compatible = "stericsson,db8500-i2c", "st,nomadik-i2c";
 			reg = <0x80122000 0x1000>;
 			interrupts = <0 22 0x4>;
 			#address-cells = <1>;
@@ -180,7 +180,7 @@
 		};
 
 		i2c at 80128000 {
-			compatible = "stericsson,db8500-i2c", "stmicroelectronics,nomadik-i2c";
+			compatible = "stericsson,db8500-i2c", "st,nomadik-i2c";
 			reg = <0x80128000 0x1000>;
 			interrupts = <0 55 0x4>;
 			#address-cells = <1>;
@@ -188,7 +188,7 @@
 		};
 
 		i2c at 80110000 {
-			compatible = "stericsson,db8500-i2c", "stmicroelectronics,nomadik-i2c";
+			compatible = "stericsson,db8500-i2c", "st,nomadik-i2c";
 			reg = <0x80110000 0x1000>;
 			interrupts = <0 12 0x4>;
 			#address-cells = <1>;
@@ -196,7 +196,7 @@
 		};
 
 		i2c at 8012a000 {
-			compatible = "stericsson,db8500-i2c", "stmicroelectronics,nomadik-i2c";
+			compatible = "stericsson,db8500-i2c", "st,nomadik-i2c";
 			reg = <0x8012a000 0x1000>;
 			interrupts = <0 51 0x4>;
 			#address-cells = <1>;
-- 
1.7.9.1

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

* [PATCH 3/7] drivers/gpio: gpio-nomadik: Apply Device Tree bindings
  2012-04-13 14:05 [PATCH 0/7 v2] Next round of DT enablement for ux500/Snowball Lee Jones
  2012-04-13 14:05 ` [PATCH 1/7] ARM: ux500: Rename the DT compatible entry for i2c devices on Snowball Lee Jones
  2012-04-13 14:05 ` [PATCH 2/7] ARM: ux500: Shorten Snowball's DT compatible gpio entry Lee Jones
@ 2012-04-13 14:05 ` Lee Jones
  2012-04-16  8:40   ` Linus Walleij
  2012-05-17 21:33   ` Grant Likely
  2012-04-13 14:05 ` [PATCH 4/7] drivers/gpio: gpio-nomadik: Provide documentation for " Lee Jones
                   ` (4 subsequent siblings)
  7 siblings, 2 replies; 82+ messages in thread
From: Lee Jones @ 2012-04-13 14:05 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/db8500.dtsi      |   18 +++++++++++++++
 arch/arm/boot/dts/snowball.dts     |   10 ++++----
 arch/arm/mach-ux500/board-mop500.c |   12 ++++++++++
 drivers/gpio/gpio-nomadik.c        |   41 +++++++++++++++++++++++++++++++++--
 4 files changed, 73 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boot/dts/db8500.dtsi b/arch/arm/boot/dts/db8500.dtsi
index 421e15f..57d3d35 100644
--- a/arch/arm/boot/dts/db8500.dtsi
+++ b/arch/arm/boot/dts/db8500.dtsi
@@ -61,6 +61,8 @@
 			interrupts = <0 119 0x4>;
 			supports-sleepmode;
 			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-bank = <0>;
 		};
 
 		gpio1: gpio at 8012e080 {
@@ -70,6 +72,8 @@
 			interrupts = <0 120 0x4>;
 			supports-sleepmode;
 			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-bank = <1>;
 		};
 
 		gpio2: gpio at 8000e000 {
@@ -79,6 +83,8 @@
 			interrupts = <0 121 0x4>;
 			supports-sleepmode;
 			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-bank = <2>;
 		};
 
 		gpio3: gpio at 8000e080 {
@@ -88,6 +94,8 @@
 			interrupts = <0 122 0x4>;
 			supports-sleepmode;
 			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-bank = <3>;
 		};
 
 		gpio4: gpio at 8000e100 {
@@ -97,6 +105,8 @@
 			interrupts = <0 123 0x4>;
 			supports-sleepmode;
 			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-bank = <4>;
 		};
 
 		gpio5: gpio at 8000e180 {
@@ -106,6 +116,8 @@
 			interrupts = <0 124 0x4>;
 			supports-sleepmode;
 			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-bank = <5>;
 		};
 
 		gpio6: gpio at 8011e000 {
@@ -115,6 +127,8 @@
 			interrupts = <0 125 0x4>;
 			supports-sleepmode;
 			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-bank = <6>;
 		};
 
 		gpio7: gpio at 8011e080 {
@@ -124,6 +138,8 @@
 			interrupts = <0 126 0x4>;
 			supports-sleepmode;
 			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-bank = <7>;
 		};
 
 		gpio8: gpio at a03fe000 {
@@ -133,6 +149,8 @@
 			interrupts = <0 127 0x4>;
 			supports-sleepmode;
 			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-bank = <8>;
 		};
 
 		usb at a03e0000 {
diff --git a/arch/arm/boot/dts/snowball.dts b/arch/arm/boot/dts/snowball.dts
index 359c6d6..738959d 100644
--- a/arch/arm/boot/dts/snowball.dts
+++ b/arch/arm/boot/dts/snowball.dts
@@ -30,35 +30,35 @@
 			wakeup = <1>;
 			linux,code = <2>;
 			label = "userpb";
-			gpios = <&gpio1 0>;
+			gpios = <&gpio1 0 0>;
 		};
 		button at 2 {
 			debounce_interval = <50>;
 			wakeup = <1>;
 			linux,code = <3>;
 			label = "userpb";
-			gpios = <&gpio4 23>;
+			gpios = <&gpio4 23 0>;
 		};
 		button at 3 {
 			debounce_interval = <50>;
 			wakeup = <1>;
 			linux,code = <4>;
 			label = "userpb";
-			gpios = <&gpio4 23>;
+			gpios = <&gpio4 24 0>;
 		};
 		button at 4 {
 			debounce_interval = <50>;
 			wakeup = <1>;
 			linux,code = <5>;
 			label = "userpb";
-			gpios = <&gpio5 1>;
+			gpios = <&gpio5 1 0>;
 		};
 		button at 5 {
 			debounce_interval = <50>;
 			wakeup = <1>;
 			linux,code = <6>;
 			label = "userpb";
-			gpios = <&gpio5 2>;
+			gpios = <&gpio5 2 0>;
 		};
 	};
 
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 77d03c1..5064140 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -746,10 +746,22 @@ MACHINE_END
 #ifdef CONFIG_MACH_UX500_DT
 
 struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
+	/* Requires DMA and call-back bindings. */
 	OF_DEV_AUXDATA("arm,pl011", 0x80120000, "uart0", &uart0_plat),
 	OF_DEV_AUXDATA("arm,pl011", 0x80121000, "uart1", &uart1_plat),
 	OF_DEV_AUXDATA("arm,pl011", 0x80007000, "uart2", &uart2_plat),
+	/* Requires DMA bindings. */
 	OF_DEV_AUXDATA("arm,pl022", 0x80002000, "ssp0",  &ssp0_plat),
+	/* Requires clock name bindings. */
+	OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e000, "gpio.0", NULL),
+	OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e080, "gpio.1", NULL),
+	OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e000, "gpio.2", NULL),
+	OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e080, "gpio.3", NULL),
+	OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e100, "gpio.4", NULL),
+	OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e180, "gpio.5", NULL),
+	OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e000, "gpio.6", NULL),
+	OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e080, "gpio.7", NULL),
+	OF_DEV_AUXDATA("st,nomadik-gpio", 0xa03fe000, "gpio.8", NULL),
 	{},
 };
 
diff --git a/drivers/gpio/gpio-nomadik.c b/drivers/gpio/gpio-nomadik.c
index 839624f..65c7e8e 100644
--- a/drivers/gpio/gpio-nomadik.c
+++ b/drivers/gpio/gpio-nomadik.c
@@ -1071,6 +1071,7 @@ void nmk_gpio_read_pull(int gpio_bank, u32 *pull_up)
 static int __devinit nmk_gpio_probe(struct platform_device *dev)
 {
 	struct nmk_gpio_platform_data *pdata = dev->dev.platform_data;
+	struct device_node *np = dev->dev.of_node;
 	struct nmk_gpio_chip *nmk_chip;
 	struct gpio_chip *chip;
 	struct resource *res;
@@ -1079,8 +1080,28 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
 	int irq;
 	int ret;
 
-	if (!pdata)
+	if (!pdata && !np) {
+		dev_err(&dev->dev, "No platform data or device tree found\n");
 		return -ENODEV;
+	}
+
+	if (np) {
+		pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
+		if (!pdata)
+			return -ENOMEM;
+
+		if (of_get_property(np, "supports-sleepmode", NULL))
+			pdata->supports_sleepmode = true;
+
+		if (of_property_read_u32(np, "gpio-bank", &dev->id)) {
+			dev_err(&dev->dev, "gpio-bank property not found\n");
+			ret = -EINVAL;
+			goto out_dt;
+		}
+
+		pdata->first_gpio = dev->id * NMK_GPIO_PER_CHIP;
+		pdata->num_gpio   = NMK_GPIO_PER_CHIP;
+	}
 
 	res = platform_get_resource(dev, IORESOURCE_MEM, 0);
 	if (!res) {
@@ -1117,6 +1138,7 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
 		ret = -ENOMEM;
 		goto out_clk;
 	}
+
 	/*
 	 * The virt address in nmk_chip->addr is in the nomadik register space,
 	 * so we can simply convert the resource address, without remapping
@@ -1139,6 +1161,8 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
 	chip->dev = &dev->dev;
 	chip->owner = THIS_MODULE;
 
+	chip->of_node = np;
+
 	ret = gpiochip_add(&nmk_chip->chip);
 	if (ret)
 		goto out_free;
@@ -1146,12 +1170,13 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
 	BUG_ON(nmk_chip->bank >= ARRAY_SIZE(nmk_gpio_chips));
 
 	nmk_gpio_chips[nmk_chip->bank] = nmk_chip;
+
 	platform_set_drvdata(dev, nmk_chip);
 
 	nmk_gpio_init_irq(nmk_chip);
 
-	dev_info(&dev->dev, "at address %p\n",
-		 nmk_chip->addr);
+	dev_info(&dev->dev, "at address %p\n", nmk_chip->addr);
+
 	return 0;
 
 out_free:
@@ -1164,13 +1189,23 @@ out_release:
 out:
 	dev_err(&dev->dev, "Failure %i for GPIO %i-%i\n", ret,
 		  pdata->first_gpio, pdata->first_gpio+31);
+out_dt:
+	if (np)
+		kfree(pdata);
+
 	return ret;
 }
 
+static const struct of_device_id nmk_gpio_match[] = {
+	{ .compatible = "st,nomadik-gpio", },
+	{}
+};
+
 static struct platform_driver nmk_gpio_driver = {
 	.driver = {
 		.owner = THIS_MODULE,
 		.name = "gpio",
+		.of_match_table = nmk_gpio_match,
 	},
 	.probe = nmk_gpio_probe,
 };
-- 
1.7.9.1

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

* [PATCH 4/7] drivers/gpio: gpio-nomadik: Provide documentation for Device Tree bindings
  2012-04-13 14:05 [PATCH 0/7 v2] Next round of DT enablement for ux500/Snowball Lee Jones
                   ` (2 preceding siblings ...)
  2012-04-13 14:05 ` [PATCH 3/7] drivers/gpio: gpio-nomadik: Apply Device Tree bindings Lee Jones
@ 2012-04-13 14:05 ` Lee Jones
  2012-04-13 14:59   ` Lee Jones
  2012-04-13 14:05 ` [PATCH 5/7] ARM: ux500: Rename gpio_keys in the Device Tree file Lee Jones
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 82+ messages in thread
From: Lee Jones @ 2012-04-13 14:05 UTC (permalink / raw)
  To: linux-arm-kernel

Add required documentation for specific gpio-nomadik DT bindings.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 .../devicetree/bindings/gpio/gpio-nmk.txt          |   29 ++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/gpio/gpio-nmk.txt

diff --git a/Documentation/devicetree/bindings/gpio/gpio-nmk.txt b/Documentation/devicetree/bindings/gpio/gpio-nmk.txt
new file mode 100644
index 0000000..7427b63
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-nmk.txt
@@ -0,0 +1,29 @@
+Nomadik GPIO controller
+
+Required properties:
+- compatible           : Should be "st,nomadik-gpio".
+- reg                  : Physical base address and length of the controller's registers.
+- interrupts           : The interrupt outputs from the controller.
+- #gpio-cells          : Should be two:
+                           The first cell is the pin number.
+                           The second cell is used to specify optional parameters:
+                             - bits[3:0] trigger type and level flags:
+                                 1 = low-to-high edge triggered.
+                                 2 = high-to-low edge triggered.
+                                 4 = active high level-sensitive.
+                                 8 = active low level-sensitive.
+- gpio-controller      : Marks the device node as a GPIO controller.
+- supports-sleepmode   : Specifies whether controller can sleep or not
+- gpio-bank            : Specifies which bank a controller owns.
+
+Example:
+
+                gpio1: gpio at 8012e080 {
+                        compatible = "st,nomadik-gpio";
+                        reg =  <0x8012e080 0x80>;
+                        interrupts = <0 120 0x4>;
+                        #gpio-cells = <2>;
+                        gpio-controller;
+                        supports-sleepmode;
+                        gpio-bank = <1>;
+                };
-- 
1.7.9.1

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

* [PATCH 5/7] ARM: ux500: Rename gpio_keys in the Device Tree file
  2012-04-13 14:05 [PATCH 0/7 v2] Next round of DT enablement for ux500/Snowball Lee Jones
                   ` (3 preceding siblings ...)
  2012-04-13 14:05 ` [PATCH 4/7] drivers/gpio: gpio-nomadik: Provide documentation for " Lee Jones
@ 2012-04-13 14:05 ` Lee Jones
  2012-04-13 14:05 ` [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants Lee Jones
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 82+ messages in thread
From: Lee Jones @ 2012-04-13 14:05 UTC (permalink / raw)
  To: linux-arm-kernel

Ensure each button is individually identifiable by using
their correct unique given device names.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/snowball.dts |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/snowball.dts b/arch/arm/boot/dts/snowball.dts
index 738959d..0cec47b 100644
--- a/arch/arm/boot/dts/snowball.dts
+++ b/arch/arm/boot/dts/snowball.dts
@@ -36,28 +36,28 @@
 			debounce_interval = <50>;
 			wakeup = <1>;
 			linux,code = <3>;
-			label = "userpb";
+			label = "extkb1";
 			gpios = <&gpio4 23 0>;
 		};
 		button at 3 {
 			debounce_interval = <50>;
 			wakeup = <1>;
 			linux,code = <4>;
-			label = "userpb";
+			label = "extkb2";
 			gpios = <&gpio4 24 0>;
 		};
 		button at 4 {
 			debounce_interval = <50>;
 			wakeup = <1>;
 			linux,code = <5>;
-			label = "userpb";
+			label = "extkb3";
 			gpios = <&gpio5 1 0>;
 		};
 		button at 5 {
 			debounce_interval = <50>;
 			wakeup = <1>;
 			linux,code = <6>;
-			label = "userpb";
+			label = "extkb4";
 			gpios = <&gpio5 2 0>;
 		};
 	};
-- 
1.7.9.1

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

* [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants
  2012-04-13 14:05 [PATCH 0/7 v2] Next round of DT enablement for ux500/Snowball Lee Jones
                   ` (4 preceding siblings ...)
  2012-04-13 14:05 ` [PATCH 5/7] ARM: ux500: Rename gpio_keys in the Device Tree file Lee Jones
@ 2012-04-13 14:05 ` Lee Jones
  2012-04-13 14:42   ` Pawel Moll
  2012-04-16  8:48   ` Linus Walleij
  2012-04-13 14:05 ` [PATCH 7/7] MMC: mmci: Add required documentation for Device Tree bindings Lee Jones
  2012-04-13 14:21 ` [PATCH 0/7 v2] Next round of DT enablement for ux500/Snowball Arnd Bergmann
  7 siblings, 2 replies; 82+ messages in thread
From: Lee Jones @ 2012-04-13 14:05 UTC (permalink / raw)
  To: linux-arm-kernel

Provide a means to collect attributes specific to ST-Ericsson's
ux500 variant series. This patch registers itself as the AMBA
driver to be called during the probe process. Once all
attributes and ux500 specifics are are collected the normal
mmci core probe is called.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/snowball.dts         |   21 ++++++++++--
 arch/arm/mach-ux500/board-mop500-sdi.c |    4 +-
 arch/arm/mach-ux500/board-mop500.c     |    3 +-
 arch/arm/mach-ux500/board-mop500.h     |    4 ++
 drivers/mmc/host/mmci.c                |   58 +++++++++++++++++++++++++++++--
 5 files changed, 80 insertions(+), 10 deletions(-)

diff --git a/arch/arm/boot/dts/snowball.dts b/arch/arm/boot/dts/snowball.dts
index 0cec47b..fb2a037 100644
--- a/arch/arm/boot/dts/snowball.dts
+++ b/arch/arm/boot/dts/snowball.dts
@@ -87,13 +87,28 @@
 			};
 		};
 
+		// External Micro SD slot
 		sdi at 80126000 {
-			status = "enabled";
-			cd-gpios = <&gpio6 26>;
+			arm,primecell-periphid = <0x10480180>;
+			max-frequency = <50000000>;
+			bus-width = <8>;
+			mmc-cap-mmc-highspeed;
+
+			#gpio-cells = <1>;
+			cd-gpios  = <&gpio6 26>; // 218
+			cd-inverted;
+
+			status = "okay";
 		};
 
+		// On-board eMMC
 		sdi at 80114000 {
-			status = "enabled";
+			arm,primecell-periphid = <0x10480180>;
+		        max-frequency = <50000000>;
+			bus-width = <8>;
+			mmc-cap-mmc-highspeed;
+
+			status = "okay";
 		};
 
 		uart at 80120000 {
diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c
index 920251c..18ff781 100644
--- a/arch/arm/mach-ux500/board-mop500-sdi.c
+++ b/arch/arm/mach-ux500/board-mop500-sdi.c
@@ -80,7 +80,7 @@ static struct stedma40_chan_cfg mop500_sdi0_dma_cfg_tx = {
 };
 #endif
 
-static struct mmci_platform_data mop500_sdi0_data = {
+struct mmci_platform_data mop500_sdi0_data = {
 	.ios_handler	= mop500_sdi0_ios_handler,
 	.ocr_mask	= MMC_VDD_29_30,
 	.f_max		= 50000000,
@@ -227,7 +227,7 @@ static struct stedma40_chan_cfg mop500_sdi4_dma_cfg_tx = {
 };
 #endif
 
-static struct mmci_platform_data mop500_sdi4_data = {
+struct mmci_platform_data mop500_sdi4_data = {
 	.ocr_mask	= MMC_VDD_29_30,
 	.f_max		= 50000000,
 	.capabilities	= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA |
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 5064140..d68a73c 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -752,6 +752,8 @@ struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
 	OF_DEV_AUXDATA("arm,pl011", 0x80007000, "uart2", &uart2_plat),
 	/* Requires DMA bindings. */
 	OF_DEV_AUXDATA("arm,pl022", 0x80002000, "ssp0",  &ssp0_plat),
+	OF_DEV_AUXDATA("arm,pl18x", 0x80126000, "sdi0",  &mop500_sdi0_data),
+	OF_DEV_AUXDATA("arm,pl18x", 0x80114000, "sdi4",  &mop500_sdi4_data),
 	/* Requires clock name bindings. */
 	OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e000, "gpio.0", NULL),
 	OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e080, "gpio.1", NULL),
@@ -801,7 +803,6 @@ static void __init u8500_init_machine(void)
 		platform_add_devices(snowball_platform_devs,
 				ARRAY_SIZE(snowball_platform_devs));
 
-		snowball_sdi_init(parent);
 	} else if (of_machine_is_compatible("st-ericsson,hrefv60+")) {
 		/*
 		 * The HREFv60 board removed a GPIO expander and routed
diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h
index fdcfa87..384baf7 100644
--- a/arch/arm/mach-ux500/board-mop500.h
+++ b/arch/arm/mach-ux500/board-mop500.h
@@ -7,6 +7,8 @@
 #ifndef __BOARD_MOP500_H
 #define __BOARD_MOP500_H
 
+#include <linux/amba/mmci.h>
+
 /* Snowball specific GPIO assignments, this board has no GPIO expander */
 #define SNOWBALL_ACCEL_INT1_GPIO	163
 #define SNOWBALL_ACCEL_INT2_GPIO	164
@@ -74,6 +76,8 @@
 #define SNOWBALL_EN_3V3_ETH_GPIO	MOP500_AB8500_PIN_GPIO(26)	/* GPIO26 */
 
 struct i2c_board_info;
+extern struct mmci_platform_data mop500_sdi0_data;
+extern struct mmci_platform_data mop500_sdi4_data;
 
 extern void mop500_sdi_init(struct device *parent);
 extern void snowball_sdi_init(struct device *parent);
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 032b847..5a7da17 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -15,6 +15,7 @@
 #include <linux/device.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/highmem.h>
@@ -1196,21 +1197,70 @@ static const struct mmc_host_ops mmci_ops = {
 	.get_cd		= mmci_get_cd,
 };
 
+#ifdef CONFIG_OF
+static void mmci_dt_populate_generic_pdata(struct device_node *np,
+					struct mmci_platform_data *pdata)
+{
+	int bus_width = 0;
+
+	of_property_read_u32(np, "wp-gpios", &pdata->gpio_wp);
+	if (!pdata->gpio_wp)
+		pdata->gpio_wp = -1;
+
+	of_property_read_u32(np, "cd-gpios", &pdata->gpio_cd);
+	if (!pdata->gpio_cd)
+		pdata->gpio_cd = -1;
+
+	if (of_get_property(np, "cd-inverted", NULL))
+		pdata->cd_invert = true;
+	else
+		pdata->cd_invert = false;
+
+	of_property_read_u32(np, "max-frequency", &pdata->f_max);
+	if (!pdata->f_max)
+		pr_warn("%s has no 'max-frequency' property\n", np->full_name);
+
+	if (of_get_property(np, "mmc-cap-mmc-highspeed", NULL))
+		pdata->capabilities |= MMC_CAP_MMC_HIGHSPEED;
+	if (of_get_property(np, "mmc-cap-sd-highspeed", NULL))
+		pdata->capabilities |= MMC_CAP_SD_HIGHSPEED;
+
+	of_property_read_u32(np, "bus-width", &bus_width);
+	switch (bus_width) {
+	case 0 :
+		/* No bus-width supplied. */
+		break;
+	case 4 :
+		pdata->capabilities |= MMC_CAP_4_BIT_DATA;
+		break;
+	case 8 :
+		pdata->capabilities |= MMC_CAP_8_BIT_DATA;
+		break;
+	default :
+		pr_warn("%s: Unsupported bus width\n", np->full_name);
+	}
+}
+#endif
+
 static int __devinit mmci_probe(struct amba_device *dev,
 	const struct amba_id *id)
 {
 	struct mmci_platform_data *plat = dev->dev.platform_data;
+	struct device_node *np = dev->dev.of_node;
 	struct variant_data *variant = id->data;
 	struct mmci_host *host;
 	struct mmc_host *mmc;
 	int ret;
 
-	/* must have platform data */
-	if (!plat) {
-		ret = -EINVAL;
-		goto out;
+	/* Must have platform data or Device Tree. */
+	if (!plat && !np) {
+		dev_err(&dev->dev, "No plat data or DT found\n");
+		return -EINVAL;
 	}
 
+	if (np)
+		mmci_dt_populate_generic_pdata(np, plat);
+
 	ret = amba_request_regions(dev, DRIVER_NAME);
 	if (ret)
 		goto out;
-- 
1.7.9.1

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

* [PATCH 7/7] MMC: mmci: Add required documentation for Device Tree bindings
  2012-04-13 14:05 [PATCH 0/7 v2] Next round of DT enablement for ux500/Snowball Lee Jones
                   ` (5 preceding siblings ...)
  2012-04-13 14:05 ` [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants Lee Jones
@ 2012-04-13 14:05 ` Lee Jones
  2012-04-18 14:31   ` Pawel Moll
                     ` (2 more replies)
  2012-04-13 14:21 ` [PATCH 0/7 v2] Next round of DT enablement for ux500/Snowball Arnd Bergmann
  7 siblings, 3 replies; 82+ messages in thread
From: Lee Jones @ 2012-04-13 14:05 UTC (permalink / raw)
  To: linux-arm-kernel

This provides full documentation detailing each compulsory,
optional and device (variant) specific properties available
for use within the MMCI Device Tree.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 Documentation/devicetree/bindings/mmc/mmci.txt |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mmc/mmci.txt

diff --git a/Documentation/devicetree/bindings/mmc/mmci.txt b/Documentation/devicetree/bindings/mmc/mmci.txt
new file mode 100644
index 0000000..14a81d5
--- /dev/null
+++ b/Documentation/devicetree/bindings/mmc/mmci.txt
@@ -0,0 +1,19 @@
+* ARM PrimeCell MultiMedia Card Interface (MMCI) PL180/1
+
+The ARM PrimeCell MMCI PL180 and PL181 provides and interface for
+reading and writing to MultiMedia and SD cards alike.
+
+Required properties:
+- compatible             : contains "arm,pl18x", "arm,primecell".
+- reg                    : contains pl18x registers and length.
+- interrupts             : contains the device IRQ(s).
+- arm,primecell-periphid : contains the PrimeCell Peripheral ID.
+
+Optional properties:
+- wp-gpios               : contains any write protect (ro) gpios
+- cd-gpios               : contains any card detection gpios
+- cd-inverted            : indicates whether the cd gpio is inverted
+- max-frequency          : contains the maximum operating frequency
+- bus-width              : number of data lines, can be <1>, <4>, or <8>
+- mmc-cap-mmc-highspeed  : indicates whether MMC is high speed capable
+- mmc-cap-sd-highspeed   : indicates whether SD is high speed capable
-- 
1.7.9.1

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

* [PATCH 0/7 v2] Next round of DT enablement for ux500/Snowball
  2012-04-13 14:05 [PATCH 0/7 v2] Next round of DT enablement for ux500/Snowball Lee Jones
                   ` (6 preceding siblings ...)
  2012-04-13 14:05 ` [PATCH 7/7] MMC: mmci: Add required documentation for Device Tree bindings Lee Jones
@ 2012-04-13 14:21 ` Arnd Bergmann
  7 siblings, 0 replies; 82+ messages in thread
From: Arnd Bergmann @ 2012-04-13 14:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 13 April 2012, Lee Jones wrote:
> 
> In this patch-set we change a couple of DT compatible entries
> to something less cumbersome. Then we have a second stab at 
> enabling DT for mmci. Only this time keeping it simple and 
> continuing to use current DMA initialisation code. We'll 
> change that once the generic bindings for DMA have been 
> mainlined. Finally we enable Snowball's GPIO controller.

Looks good.

Acked-by: Arnd Bergmann <arnd@arndb.de>

for the entire series.

	Arnd

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

* [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants
  2012-04-13 14:05 ` [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants Lee Jones
@ 2012-04-13 14:42   ` Pawel Moll
  2012-04-13 14:51     ` Arnd Bergmann
  2012-04-16  8:48   ` Linus Walleij
  1 sibling, 1 reply; 82+ messages in thread
From: Pawel Moll @ 2012-04-13 14:42 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 2012-04-13 at 15:05 +0100, Lee Jones wrote:
> +	of_property_read_u32(np, "wp-gpios", &pdata->gpio_wp);
> +	if (!pdata->gpio_wp)
> +		pdata->gpio_wp = -1;
> +
> +	of_property_read_u32(np, "cd-gpios", &pdata->gpio_cd);
> +	if (!pdata->gpio_cd)
> +		pdata->gpio_cd = -1;

I think you should use of_gpio_named_count(np, "XX-gpios") here rather
then of_property_read() - there's more to GPIOs than just a number...

Cheers!

Pawe?

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

* [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants
  2012-04-13 14:42   ` Pawel Moll
@ 2012-04-13 14:51     ` Arnd Bergmann
  2012-04-13 14:54       ` Lee Jones
  0 siblings, 1 reply; 82+ messages in thread
From: Arnd Bergmann @ 2012-04-13 14:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 13 April 2012, Pawel Moll wrote:
> On Fri, 2012-04-13 at 15:05 +0100, Lee Jones wrote:
> > +     of_property_read_u32(np, "wp-gpios", &pdata->gpio_wp);
> > +     if (!pdata->gpio_wp)
> > +             pdata->gpio_wp = -1;
> > +
> > +     of_property_read_u32(np, "cd-gpios", &pdata->gpio_cd);
> > +     if (!pdata->gpio_cd)
> > +             pdata->gpio_cd = -1;
> 
> I think you should use of_gpio_named_count(np, "XX-gpios") here rather
> then of_property_read() - there's more to GPIOs than just a number...

Hmm, that part was done right in the git tree, I guess something
went wrong when sending out the series.

	Arnd

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

* [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants
  2012-04-13 14:51     ` Arnd Bergmann
@ 2012-04-13 14:54       ` Lee Jones
  2012-04-13 15:05         ` Pawel Moll
  0 siblings, 1 reply; 82+ messages in thread
From: Lee Jones @ 2012-04-13 14:54 UTC (permalink / raw)
  To: linux-arm-kernel

On 13/04/12 15:51, Arnd Bergmann wrote:
> On Friday 13 April 2012, Pawel Moll wrote:
>> On Fri, 2012-04-13 at 15:05 +0100, Lee Jones wrote:
>>> +     of_property_read_u32(np, "wp-gpios",&pdata->gpio_wp);
>>> +     if (!pdata->gpio_wp)
>>> +             pdata->gpio_wp = -1;
>>> +
>>> +     of_property_read_u32(np, "cd-gpios",&pdata->gpio_cd);
>>> +     if (!pdata->gpio_cd)
>>> +             pdata->gpio_cd = -1;
>>
>> I think you should use of_gpio_named_count(np, "XX-gpios") here rather
>> then of_property_read() - there's more to GPIOs than just a number...
>
> Hmm, that part was done right in the git tree, I guess something
> went wrong when sending out the series.

Different patch series.

The GPIO bindings aren't in yet. Once this one is accepted, I'll fire 
off the second patch-set.

-- 
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

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

* [PATCH 4/7] drivers/gpio: gpio-nomadik: Provide documentation for Device Tree bindings
  2012-04-13 14:05 ` [PATCH 4/7] drivers/gpio: gpio-nomadik: Provide documentation for " Lee Jones
@ 2012-04-13 14:59   ` Lee Jones
  2012-04-16  8:43     ` Linus Walleij
  0 siblings, 1 reply; 82+ messages in thread
From: Lee Jones @ 2012-04-13 14:59 UTC (permalink / raw)
  To: linux-arm-kernel

Grant's comments also taken heed of here:

From: Lee Jones <lee.jones@linaro.org>
Date: Wed, 4 Apr 2012 17:06:41 +0100
Subject: [PATCH 4/7] drivers/gpio: gpio-nomadik: Provide documentation for
 Device Tree bindings

Add required documentation for specific gpio-nomadik DT bindings.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 .../devicetree/bindings/gpio/gpio-nmk.txt          |   29 ++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/gpio/gpio-nmk.txt

diff --git a/Documentation/devicetree/bindings/gpio/gpio-nmk.txt b/Documentation/devicetree/bindings/gpio/gpio-nmk.txt
new file mode 100644
index 0000000..3856789
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-nmk.txt
@@ -0,0 +1,29 @@
+Nomadik GPIO controller
+
+Required properties:
+- compatible            : Should be "st,nomadik-gpio".
+- reg                   : Physical base address and length of the controller's registers.
+- interrupts            : The interrupt outputs from the controller.
+- #gpio-cells           : Should be two:
+                            The first cell is the pin number.
+                            The second cell is used to specify optional parameters:
+                              - bits[3:0] trigger type and level flags:
+                                  1 = low-to-high edge triggered.
+                                  2 = high-to-low edge triggered.
+                                  4 = active high level-sensitive.
+                                  8 = active low level-sensitive.
+- gpio-controller       : Marks the device node as a GPIO controller.
+- gpio-bank             : Specifies which bank a controller owns.
+- st,supports-sleepmode : Specifies whether controller can sleep or not
+
+Example:
+
+                gpio1: gpio at 8012e080 {
+                        compatible = "st,nomadik-gpio";
+                        reg =  <0x8012e080 0x80>;
+                        interrupts = <0 120 0x4>;
+                        #gpio-cells = <2>;
+                        gpio-controller;
+                        supports-sleepmode;
+                        gpio-bank = <1>;
+                };
-- 
1.7.9.1

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

* [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants
  2012-04-13 14:54       ` Lee Jones
@ 2012-04-13 15:05         ` Pawel Moll
  2012-04-13 15:16           ` Lee Jones
  0 siblings, 1 reply; 82+ messages in thread
From: Pawel Moll @ 2012-04-13 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 2012-04-13 at 15:54 +0100, Lee Jones wrote:
> On 13/04/12 15:51, Arnd Bergmann wrote:
> > On Friday 13 April 2012, Pawel Moll wrote:
> >> On Fri, 2012-04-13 at 15:05 +0100, Lee Jones wrote:
> >>> +     of_property_read_u32(np, "wp-gpios",&pdata->gpio_wp);
> >>> +     if (!pdata->gpio_wp)
> >>> +             pdata->gpio_wp = -1;
> >>> +
> >>> +     of_property_read_u32(np, "cd-gpios",&pdata->gpio_cd);
> >>> +     if (!pdata->gpio_cd)
> >>> +             pdata->gpio_cd = -1;
> >>
> >> I think you should use of_gpio_named_count(np, "XX-gpios") here rather
> >> then of_property_read() - there's more to GPIOs than just a number...

Of course I meant of_get_named_gpio(np, "XX-gpios", 0) not
_named_count ;-)

> > Hmm, that part was done right in the git tree, I guess something
> > went wrong when sending out the series.
> 
> Different patch series.
> 
> The GPIO bindings aren't in yet. Once this one is accepted, I'll fire 
> off the second patch-set.

Em, I'm not sure I'm following... Why not use the proper API
immediately?

Generally, except for that, looks good to me.

Pawe?

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

* [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants
  2012-04-13 15:05         ` Pawel Moll
@ 2012-04-13 15:16           ` Lee Jones
  2012-04-13 15:27             ` Pawel Moll
  0 siblings, 1 reply; 82+ messages in thread
From: Lee Jones @ 2012-04-13 15:16 UTC (permalink / raw)
  To: linux-arm-kernel

On 13/04/12 16:05, Pawel Moll wrote:
> On Fri, 2012-04-13 at 15:54 +0100, Lee Jones wrote:
>> On 13/04/12 15:51, Arnd Bergmann wrote:
>>> On Friday 13 April 2012, Pawel Moll wrote:
>>>> On Fri, 2012-04-13 at 15:05 +0100, Lee Jones wrote:
>>>>> +     of_property_read_u32(np, "wp-gpios",&pdata->gpio_wp);
>>>>> +     if (!pdata->gpio_wp)
>>>>> +             pdata->gpio_wp = -1;
>>>>> +
>>>>> +     of_property_read_u32(np, "cd-gpios",&pdata->gpio_cd);
>>>>> +     if (!pdata->gpio_cd)
>>>>> +             pdata->gpio_cd = -1;
>>>>
>>>> I think you should use of_gpio_named_count(np, "XX-gpios") here rather
>>>> then of_property_read() - there's more to GPIOs than just a number...
>
> Of course I meant of_get_named_gpio(np, "XX-gpios", 0) not
> _named_count ;-)
>
>>> Hmm, that part was done right in the git tree, I guess something
>>> went wrong when sending out the series.
>>
>> Different patch series.
>>
>> The GPIO bindings aren't in yet. Once this one is accepted, I'll fire
>> off the second patch-set.
>
> Em, I'm not sure I'm following... Why not use the proper API
> immediately?
>
> Generally, except for that, looks good to me.

Because in it's current state, gpio-nomadik doesn't know how to decode 
any provided flags and phandles don't work yet, hence the IRQ request 
really is just a number in this case. In a latter patch-set I provide 
the GPIO driver with said bindings and swap the simple integer format 
for one which is more in keeping with the DT format e.g. <32> becomes 
<&gpio1 1 0x4> for instance.

This patch does function perfectly well the way it is and provides no 
breakage. I'm aiming for both patch-sets to be sucked into the v3.5 
merge window in any case, so all functionality will be provided at -rc1. 
Only the bleeding edge, hardcore, kernel developers who use the 
gpio-nomadik driver (so, just me and Linus Walleij then :D ) will ever 
use this code as-is.

-- 
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

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

* [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants
  2012-04-13 15:16           ` Lee Jones
@ 2012-04-13 15:27             ` Pawel Moll
  0 siblings, 0 replies; 82+ messages in thread
From: Pawel Moll @ 2012-04-13 15:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 2012-04-13 at 16:16 +0100, Lee Jones wrote:
> Because in it's current state, gpio-nomadik doesn't know how to decode 
> any provided flags and phandles don't work yet, hence the IRQ request 
> really is just a number in this case. In a latter patch-set I provide 
> the GPIO driver with said bindings and swap the simple integer format 
> for one which is more in keeping with the DT format e.g. <32> becomes 
> <&gpio1 1 0x4> for instance.
> 
> This patch does function perfectly well the way it is and provides no 
> breakage. I'm aiming for both patch-sets to be sucked into the v3.5 
> merge window in any case, so all functionality will be provided at -rc1. 
> Only the bleeding edge, hardcore, kernel developers who use the 
> gpio-nomadik driver (so, just me and Linus Walleij then :D ) will ever 
> use this code as-is.

I see, fine by me.

Cheers!

Pawe?

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

* [PATCH 1/7] ARM: ux500: Rename the DT compatible entry for i2c devices on Snowball
  2012-04-13 14:05 ` [PATCH 1/7] ARM: ux500: Rename the DT compatible entry for i2c devices on Snowball Lee Jones
@ 2012-04-16  8:34   ` Linus Walleij
  0 siblings, 0 replies; 82+ messages in thread
From: Linus Walleij @ 2012-04-16  8:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Apr 13, 2012 at 4:05 PM, Lee Jones <lee.jones@linaro.org> wrote:

> It is believed that the i2c compatible match entry is too long
> and cumbersome in its current form. This patch takes steps to
> decrease its length by using ST-Mircroelectrics' abbreviation ST.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Applied to ux500-core with speling cortecctions and Arnd's ACK.

Thanks,
Linus Walleij

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

* [PATCH 2/7] ARM: ux500: Shorten Snowball's DT compatible gpio entry
  2012-04-13 14:05 ` [PATCH 2/7] ARM: ux500: Shorten Snowball's DT compatible gpio entry Lee Jones
@ 2012-04-16  8:36   ` Linus Walleij
  2012-04-16  9:00     ` Lee Jones
  0 siblings, 1 reply; 82+ messages in thread
From: Linus Walleij @ 2012-04-16  8:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Apr 13, 2012 at 4:05 PM, Lee Jones <lee.jones@linaro.org> wrote:

> It is believed that the gpio compatible match entry is too long
> and cumbersome in its current form. This patch takes steps to
> decrease its length by using ST-Mircroelectrics' abbreviation ST.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Applied with the proper spelling and Arnds ACK.

Thanks,
Linus Walleij

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

* [PATCH 3/7] drivers/gpio: gpio-nomadik: Apply Device Tree bindings
  2012-04-13 14:05 ` [PATCH 3/7] drivers/gpio: gpio-nomadik: Apply Device Tree bindings Lee Jones
@ 2012-04-16  8:40   ` Linus Walleij
  2012-05-17 21:33   ` Grant Likely
  1 sibling, 0 replies; 82+ messages in thread
From: Linus Walleij @ 2012-04-16  8:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Apr 13, 2012 at 4:05 PM, Lee Jones <lee.jones@linaro.org> wrote:

> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
> ?arch/arm/boot/dts/db8500.dtsi ? ? ?| ? 18 +++++++++++++++
> ?arch/arm/boot/dts/snowball.dts ? ? | ? 10 ++++----
> ?arch/arm/mach-ux500/board-mop500.c | ? 12 ++++++++++
> ?drivers/gpio/gpio-nomadik.c ? ? ? ?| ? 41 +++++++++++++++++++++++++++++++++--
> ?4 files changed, 73 insertions(+), 8 deletions(-)

Thanks, I added a commit blurb and applied this to ux500-core.
(So let's keep this out of the GPIO tree.)

I am planning to do some pinctrl changes for ux500 this development
cycle as well, let us take all of this through the ux500 tree up through
ARM SoC to avoid conflicts and confusion.

Yours,
Linus Walleij

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

* [PATCH 4/7] drivers/gpio: gpio-nomadik: Provide documentation for Device Tree bindings
  2012-04-13 14:59   ` Lee Jones
@ 2012-04-16  8:43     ` Linus Walleij
  0 siblings, 0 replies; 82+ messages in thread
From: Linus Walleij @ 2012-04-16  8:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Apr 13, 2012 at 4:59 PM, Lee Jones <lee.jones@linaro.org> wrote:

> Grant's comments also taken heed of here:
>
> From: Lee Jones <lee.jones@linaro.org>
> Date: Wed, 4 Apr 2012 17:06:41 +0100
> Subject: [PATCH 4/7] drivers/gpio: gpio-nomadik: Provide documentation for
> ?Device Tree bindings
>
> Add required documentation for specific gpio-nomadik DT bindings.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

OK applied this version to the ux500 tree targeting ARM SoC.
As with the other patch, let's keep it out of the GPIO tree.

Yours,
Linus Walleij

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

* [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants
  2012-04-13 14:05 ` [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants Lee Jones
  2012-04-13 14:42   ` Pawel Moll
@ 2012-04-16  8:48   ` Linus Walleij
  2012-04-16  9:06     ` Lee Jones
                       ` (2 more replies)
  1 sibling, 3 replies; 82+ messages in thread
From: Linus Walleij @ 2012-04-16  8:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Apr 13, 2012 at 4:05 PM, Lee Jones <lee.jones@linaro.org> wrote:

> Provide a means to collect attributes specific to ST-Ericsson's
> ux500 variant series. This patch registers itself as the AMBA
> driver to be called during the probe process. Once all
> attributes and ux500 specifics are are collected the normal
> mmci core probe is called.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
> ?arch/arm/boot/dts/snowball.dts ? ? ? ? | ? 21 ++++++++++--
> ?arch/arm/mach-ux500/board-mop500-sdi.c | ? ?4 +-
> ?arch/arm/mach-ux500/board-mop500.c ? ? | ? ?3 +-
> ?arch/arm/mach-ux500/board-mop500.h ? ? | ? ?4 ++
> ?drivers/mmc/host/mmci.c ? ? ? ? ? ? ? ?| ? 58 +++++++++++++++++++++++++++++--
> ?5 files changed, 80 insertions(+), 10 deletions(-)

Can you split this in a clean patch to mmci.c and another patch for all
the ux500 stuff? You can add my Acked-by for both.

Obviously I cannot apply the mmci.c patch without Russell's ACK,
(or you have to take it through his patch tracker). Russell has
positively affirmed that he's looking after the MMCI driver.

If you get Russell's ACK I'll behappy to merge it through ux500
and ARM SoC.

Yours,
Linus Walleij

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

* [PATCH 2/7] ARM: ux500: Shorten Snowball's DT compatible gpio entry
  2012-04-16  8:36   ` Linus Walleij
@ 2012-04-16  9:00     ` Lee Jones
  0 siblings, 0 replies; 82+ messages in thread
From: Lee Jones @ 2012-04-16  9:00 UTC (permalink / raw)
  To: linux-arm-kernel

On 16/04/12 09:36, Linus Walleij wrote:
> On Fri, Apr 13, 2012 at 4:05 PM, Lee Jones<lee.jones@linaro.org>  wrote:
>
>> It is believed that the gpio compatible match entry is too long
>> and cumbersome in its current form. This patch takes steps to
>> decrease its length by using ST-Mircroelectrics' abbreviation ST.
>>
>> Signed-off-by: Lee Jones<lee.jones@linaro.org>
>
> Applied with the proper spelling and Arnds ACK.

Good catch. :)

-- 
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

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

* [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants
  2012-04-16  8:48   ` Linus Walleij
@ 2012-04-16  9:06     ` Lee Jones
  2012-04-16  9:18       ` Linus Walleij
  2012-04-16  9:25     ` [PATCH 6.1/7] ARM: ux500: Enable Device Tree support mmci for Snowball Lee Jones
  2012-04-16  9:26     ` [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500 Lee Jones
  2 siblings, 1 reply; 82+ messages in thread
From: Lee Jones @ 2012-04-16  9:06 UTC (permalink / raw)
  To: linux-arm-kernel

On 16/04/12 09:48, Linus Walleij wrote:
> On Fri, Apr 13, 2012 at 4:05 PM, Lee Jones<lee.jones@linaro.org>  wrote:
>
>> Provide a means to collect attributes specific to ST-Ericsson's
>> ux500 variant series. This patch registers itself as the AMBA
>> driver to be called during the probe process. Once all
>> attributes and ux500 specifics are are collected the normal
>> mmci core probe is called.
>>
>> Signed-off-by: Lee Jones<lee.jones@linaro.org>
>> ---
>>   arch/arm/boot/dts/snowball.dts         |   21 ++++++++++--
>>   arch/arm/mach-ux500/board-mop500-sdi.c |    4 +-
>>   arch/arm/mach-ux500/board-mop500.c     |    3 +-
>>   arch/arm/mach-ux500/board-mop500.h     |    4 ++
>>   drivers/mmc/host/mmci.c                |   58 +++++++++++++++++++++++++++++--
>>   5 files changed, 80 insertions(+), 10 deletions(-)
>
> Can you split this in a clean patch to mmci.c and another patch for all
> the ux500 stuff? You can add my Acked-by for both.

I can do that. You'll have it by this afternoon.

Thanks.

> Obviously I cannot apply the mmci.c patch without Russell's ACK,
> (or you have to take it through his patch tracker). Russell has
> positively affirmed that he's looking after the MMCI driver.
>
> If you get Russell's ACK I'll behappy to merge it through ux500
> and ARM SoC.
>
> Yours,
> Linus Walleij


-- 
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

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

* [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants
  2012-04-16  9:06     ` Lee Jones
@ 2012-04-16  9:18       ` Linus Walleij
  0 siblings, 0 replies; 82+ messages in thread
From: Linus Walleij @ 2012-04-16  9:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Apr 16, 2012 at 11:06 AM, Lee Jones <lee.jones@linaro.org> wrote:
> On 16/04/12 09:48, Linus Walleij wrote:

>> Can you split this in a clean patch to mmci.c and another patch for all
>> the ux500 stuff? You can add my Acked-by for both.
>
> I can do that. You'll have it by this afternoon.

Then it looks like only runtime dependencies exist between the MMCI
and ux500 patch and they can be merged to different trees right?

I'll be happy to do that if I know that Russell picks the mmci.c portions.

Yours,
Linus Walleij

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

* [PATCH 6.1/7] ARM: ux500: Enable Device Tree support mmci for Snowball
  2012-04-16  8:48   ` Linus Walleij
  2012-04-16  9:06     ` Lee Jones
@ 2012-04-16  9:25     ` Lee Jones
  2012-04-16  9:26     ` [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500 Lee Jones
  2 siblings, 0 replies; 82+ messages in thread
From: Lee Jones @ 2012-04-16  9:25 UTC (permalink / raw)
  To: linux-arm-kernel

From: Lee Jones <lee.jones@linaro.org>
Date: Mon, 16 Apr 2012 10:11:03 +0100
Subject: [PATCH 6.1/7] ARM: ux500: Enable Device Tree support mmci for Snowball

Allow proper initialisation for MMC via the mmci driver
for the Snowball low-cost development board using DT. At
the moment we continue to use DMA setup from platform code.
Once the DMA generic DT bindings have been completed we
can then port the remainder over to DT.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/snowball.dts         |   21 ++++++++++++++++++---
 arch/arm/mach-ux500/board-mop500-sdi.c |    4 ++--
 arch/arm/mach-ux500/board-mop500.c     |    3 ++-
 arch/arm/mach-ux500/board-mop500.h     |    4 ++++
 4 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/snowball.dts b/arch/arm/boot/dts/snowball.dts
index 0cec47b..fb2a037 100644
--- a/arch/arm/boot/dts/snowball.dts
+++ b/arch/arm/boot/dts/snowball.dts
@@ -87,13 +87,28 @@
 			};
 		};
 
+		// External Micro SD slot
 		sdi at 80126000 {
-			status = "enabled";
-			cd-gpios = <&gpio6 26>;
+			arm,primecell-periphid = <0x10480180>;
+			max-frequency = <50000000>;
+			bus-width = <8>;
+			mmc-cap-mmc-highspeed;
+
+			#gpio-cells = <1>;
+			cd-gpios  = <&gpio6 26>; // 218
+			cd-inverted;
+
+			status = "okay";
 		};
 
+		// On-board eMMC
 		sdi at 80114000 {
-			status = "enabled";
+			arm,primecell-periphid = <0x10480180>;
+		        max-frequency = <50000000>;
+			bus-width = <8>;
+			mmc-cap-mmc-highspeed;
+
+			status = "okay";
 		};
 
 		uart at 80120000 {
diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c
index 920251c..18ff781 100644
--- a/arch/arm/mach-ux500/board-mop500-sdi.c
+++ b/arch/arm/mach-ux500/board-mop500-sdi.c
@@ -80,7 +80,7 @@ static struct stedma40_chan_cfg mop500_sdi0_dma_cfg_tx = {
 };
 #endif
 
-static struct mmci_platform_data mop500_sdi0_data = {
+struct mmci_platform_data mop500_sdi0_data = {
 	.ios_handler	= mop500_sdi0_ios_handler,
 	.ocr_mask	= MMC_VDD_29_30,
 	.f_max		= 50000000,
@@ -227,7 +227,7 @@ static struct stedma40_chan_cfg mop500_sdi4_dma_cfg_tx = {
 };
 #endif
 
-static struct mmci_platform_data mop500_sdi4_data = {
+struct mmci_platform_data mop500_sdi4_data = {
 	.ocr_mask	= MMC_VDD_29_30,
 	.f_max		= 50000000,
 	.capabilities	= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA |
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 5064140..d68a73c 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -752,6 +752,8 @@ struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
 	OF_DEV_AUXDATA("arm,pl011", 0x80007000, "uart2", &uart2_plat),
 	/* Requires DMA bindings. */
 	OF_DEV_AUXDATA("arm,pl022", 0x80002000, "ssp0",  &ssp0_plat),
+	OF_DEV_AUXDATA("arm,pl18x", 0x80126000, "sdi0",  &mop500_sdi0_data),
+	OF_DEV_AUXDATA("arm,pl18x", 0x80114000, "sdi4",  &mop500_sdi4_data),
 	/* Requires clock name bindings. */
 	OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e000, "gpio.0", NULL),
 	OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e080, "gpio.1", NULL),
@@ -801,7 +803,6 @@ static void __init u8500_init_machine(void)
 		platform_add_devices(snowball_platform_devs,
 				ARRAY_SIZE(snowball_platform_devs));
 
-		snowball_sdi_init(parent);
 	} else if (of_machine_is_compatible("st-ericsson,hrefv60+")) {
 		/*
 		 * The HREFv60 board removed a GPIO expander and routed
diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h
index fdcfa87..384baf7 100644
--- a/arch/arm/mach-ux500/board-mop500.h
+++ b/arch/arm/mach-ux500/board-mop500.h
@@ -7,6 +7,8 @@
 #ifndef __BOARD_MOP500_H
 #define __BOARD_MOP500_H
 
+#include <linux/amba/mmci.h>
+
 /* Snowball specific GPIO assignments, this board has no GPIO expander */
 #define SNOWBALL_ACCEL_INT1_GPIO	163
 #define SNOWBALL_ACCEL_INT2_GPIO	164
@@ -74,6 +76,8 @@
 #define SNOWBALL_EN_3V3_ETH_GPIO	MOP500_AB8500_PIN_GPIO(26)	/* GPIO26 */
 
 struct i2c_board_info;
+extern struct mmci_platform_data mop500_sdi0_data;
+extern struct mmci_platform_data mop500_sdi4_data;
 
 extern void mop500_sdi_init(struct device *parent);
 extern void snowball_sdi_init(struct device *parent);
-- 
1.7.9.1

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-04-16  8:48   ` Linus Walleij
  2012-04-16  9:06     ` Lee Jones
  2012-04-16  9:25     ` [PATCH 6.1/7] ARM: ux500: Enable Device Tree support mmci for Snowball Lee Jones
@ 2012-04-16  9:26     ` Lee Jones
  2012-04-25 18:57       ` Russell King - ARM Linux
  2012-06-04 10:14       ` Russell King - ARM Linux
  2 siblings, 2 replies; 82+ messages in thread
From: Lee Jones @ 2012-04-16  9:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Lee Jones <lee.jones@linaro.org>
Date: Mon, 16 Apr 2012 10:18:43 +0100
Subject: [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500 variants

Provide a means to collect attributes specific to ST-Ericsson's
ux500 variant series. This patch registers itself as the AMBA
driver to be called during the probe process. Once all
attributes and ux500 specifics are are collected the normal
mmci core probe is called.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mmc/host/mmci.c |   58 +++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 54 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 032b847..5a7da17 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -15,6 +15,7 @@
 #include <linux/device.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/highmem.h>
@@ -1196,21 +1197,70 @@ static const struct mmc_host_ops mmci_ops = {
 	.get_cd		= mmci_get_cd,
 };
 
+#ifdef CONFIG_OF
+static void mmci_dt_populate_generic_pdata(struct device_node *np,
+					struct mmci_platform_data *pdata)
+{
+	int bus_width = 0;
+
+	of_property_read_u32(np, "wp-gpios", &pdata->gpio_wp);
+	if (!pdata->gpio_wp)
+		pdata->gpio_wp = -1;
+
+	of_property_read_u32(np, "cd-gpios", &pdata->gpio_cd);
+	if (!pdata->gpio_cd)
+		pdata->gpio_cd = -1;
+
+	if (of_get_property(np, "cd-inverted", NULL))
+		pdata->cd_invert = true;
+	else
+		pdata->cd_invert = false;
+
+	of_property_read_u32(np, "max-frequency", &pdata->f_max);
+	if (!pdata->f_max)
+		pr_warn("%s has no 'max-frequency' property\n", np->full_name);
+
+	if (of_get_property(np, "mmc-cap-mmc-highspeed", NULL))
+		pdata->capabilities |= MMC_CAP_MMC_HIGHSPEED;
+	if (of_get_property(np, "mmc-cap-sd-highspeed", NULL))
+		pdata->capabilities |= MMC_CAP_SD_HIGHSPEED;
+
+	of_property_read_u32(np, "bus-width", &bus_width);
+	switch (bus_width) {
+	case 0 :
+		/* No bus-width supplied. */
+		break;
+	case 4 :
+		pdata->capabilities |= MMC_CAP_4_BIT_DATA;
+		break;
+	case 8 :
+		pdata->capabilities |= MMC_CAP_8_BIT_DATA;
+		break;
+	default :
+		pr_warn("%s: Unsupported bus width\n", np->full_name);
+	}
+}
+#endif
+
 static int __devinit mmci_probe(struct amba_device *dev,
 	const struct amba_id *id)
 {
 	struct mmci_platform_data *plat = dev->dev.platform_data;
+	struct device_node *np = dev->dev.of_node;
 	struct variant_data *variant = id->data;
 	struct mmci_host *host;
 	struct mmc_host *mmc;
 	int ret;
 
-	/* must have platform data */
-	if (!plat) {
-		ret = -EINVAL;
-		goto out;
+	/* Must have platform data or Device Tree. */
+	if (!plat && !np) {
+		dev_err(&dev->dev, "No plat data or DT found\n");
+		return -EINVAL;
 	}
 
+	if (np)
+		mmci_dt_populate_generic_pdata(np, plat);
+
 	ret = amba_request_regions(dev, DRIVER_NAME);
 	if (ret)
 		goto out;
-- 
1.7.9.1

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

* [PATCH 7/7] MMC: mmci: Add required documentation for Device Tree bindings
  2012-04-13 14:05 ` [PATCH 7/7] MMC: mmci: Add required documentation for Device Tree bindings Lee Jones
@ 2012-04-18 14:31   ` Pawel Moll
  2012-04-18 15:01     ` Pawel Moll
  2012-04-18 15:12     ` Lee Jones
  2012-04-18 15:20   ` [PATCH 7/7 v2] " Lee Jones
  2012-05-17 21:23   ` [PATCH 7/7] " Grant Likely
  2 siblings, 2 replies; 82+ messages in thread
From: Pawel Moll @ 2012-04-18 14:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 2012-04-13 at 15:05 +0100, Lee Jones wrote:
> +Required properties:
> +- arm,primecell-periphid : contains the PrimeCell Peripheral ID.

I'd say that this is _very_ optional (as in: don't use this, unless you
know what are you doing ;-)

Also, how are you planning to represent the ".ocr_mask" part of the
platform data? (I'm asking about this particular one, because it's the
only I need on vexpress ;-)

Cheers!

Pawe?

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

* [PATCH 7/7] MMC: mmci: Add required documentation for Device Tree bindings
  2012-04-18 14:31   ` Pawel Moll
@ 2012-04-18 15:01     ` Pawel Moll
  2012-04-18 15:12     ` Lee Jones
  1 sibling, 0 replies; 82+ messages in thread
From: Pawel Moll @ 2012-04-18 15:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 2012-04-18 at 15:31 +0100, Pawel Moll wrote:
> On Fri, 2012-04-13 at 15:05 +0100, Lee Jones wrote:
> > +Required properties:
> > +- arm,primecell-periphid : contains the PrimeCell Peripheral ID.
> 
> I'd say that this is _very_ optional (as in: don't use this, unless you
> know what are you doing ;-)
> 
> Also, how are you planning to represent the ".ocr_mask" part of the
> platform data? (I'm asking about this particular one, because it's the
> only I need on vexpress ;-)

I forgot to mention: those are minors, generally it looks good to me

Acked-by: Pawel Moll <pawel.moll@arm.com>

Cheers!

Pawe?

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

* [PATCH 7/7] MMC: mmci: Add required documentation for Device Tree bindings
  2012-04-18 14:31   ` Pawel Moll
  2012-04-18 15:01     ` Pawel Moll
@ 2012-04-18 15:12     ` Lee Jones
  2012-04-18 15:20       ` Chris Ball
  1 sibling, 1 reply; 82+ messages in thread
From: Lee Jones @ 2012-04-18 15:12 UTC (permalink / raw)
  To: linux-arm-kernel

On 18/04/12 15:31, Pawel Moll wrote:
> On Fri, 2012-04-13 at 15:05 +0100, Lee Jones wrote:
>> +Required properties:
>> +- arm,primecell-periphid : contains the PrimeCell Peripheral ID.
>
> I'd say that this is _very_ optional (as in: don't use this, unless you
> know what are you doing ;-)

Okay.

Who is pulling this patch by the way? Chris is it you?

I'll draft another one with the arm,primecell-periphid moved to optional 
properties and reply to the original [PATCH 7/7] mail with Arnd's Acked-by.

> Also, how are you planning to represent the ".ocr_mask" part of the
> platform data? (I'm asking about this particular one, because it's the
> only I need on vexpress ;-)

Short answer; I'm not.

Long answer; I'm not ... until the DMA mess is sorted out. Once it is, 
I'll use the correct bindings to associate DMA settings with the device. 
Until this time the ocr_mask (operation conditions register mask - see 
Russell, I'm learning ;)) will continue to be set using platform code. 
If you require it before that point, I have no qualms with you adding it 
yourself. :D

-- 
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

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

* [PATCH 7/7] MMC: mmci: Add required documentation for Device Tree bindings
  2012-04-18 15:12     ` Lee Jones
@ 2012-04-18 15:20       ` Chris Ball
  2012-04-18 15:25         ` Lee Jones
  0 siblings, 1 reply; 82+ messages in thread
From: Chris Ball @ 2012-04-18 15:20 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Wed, Apr 18 2012, Lee Jones wrote:
> On 18/04/12 15:31, Pawel Moll wrote:
>> On Fri, 2012-04-13 at 15:05 +0100, Lee Jones wrote:
>>> +Required properties:
>>> +- arm,primecell-periphid : contains the PrimeCell Peripheral ID.
>>
>> I'd say that this is _very_ optional (as in: don't use this, unless you
>> know what are you doing ;-)
>
> Okay.
>
> Who is pulling this patch by the way? Chris is it you?

Russell King is maintaining MMCI (although I don't think MAINTAINERS has
caught up with that yet) -- it would be ideal for me if you could get an
ACK from him so that I can merge it to mmc-next and send it to Linus.

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* [PATCH 7/7 v2] MMC: mmci: Add required documentation for Device Tree bindings
  2012-04-13 14:05 ` [PATCH 7/7] MMC: mmci: Add required documentation for Device Tree bindings Lee Jones
  2012-04-18 14:31   ` Pawel Moll
@ 2012-04-18 15:20   ` Lee Jones
  2012-05-17 21:23   ` [PATCH 7/7] " Grant Likely
  2 siblings, 0 replies; 82+ messages in thread
From: Lee Jones @ 2012-04-18 15:20 UTC (permalink / raw)
  To: linux-arm-kernel

From: Lee Jones <lee.jones@linaro.org>
Date: Wed, 14 Mar 2012 13:58:34 +0000
Subject: [PATCH] MMC: mmci: Add required documentation for Device Tree bindings

This provides full documentation detailing each compulsory,
optional and device (variant) specific properties available
for use within the MMCI Device Tree.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 Documentation/devicetree/bindings/mmc/mmci.txt |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mmc/mmci.txt

diff --git a/Documentation/devicetree/bindings/mmc/mmci.txt b/Documentation/devicetree/bindings/mmc/mmci.txt
new file mode 100644
index 0000000..5b68c93
--- /dev/null
+++ b/Documentation/devicetree/bindings/mmc/mmci.txt
@@ -0,0 +1,19 @@
+* ARM PrimeCell MultiMedia Card Interface (MMCI) PL180/1
+
+The ARM PrimeCell MMCI PL180 and PL181 provides and interface for
+reading and writing to MultiMedia and SD cards alike.
+
+Required properties:
+- compatible             : contains "arm,pl18x", "arm,primecell".
+- reg                    : contains pl18x registers and length.
+- interrupts             : contains the device IRQ(s).
+
+Optional properties:
+- wp-gpios               : contains any write protect (ro) gpios
+- cd-gpios               : contains any card detection gpios
+- cd-inverted            : indicates whether the cd gpio is inverted
+- max-frequency          : contains the maximum operating frequency
+- bus-width              : number of data lines, can be <1>, <4>, or <8>
+- mmc-cap-mmc-highspeed  : indicates whether MMC is high speed capable
+- mmc-cap-sd-highspeed   : indicates whether SD is high speed capable
+- arm,primecell-periphid : contains the PrimeCell Peripheral ID.
-- 
1.7.9.1

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

* [PATCH 7/7] MMC: mmci: Add required documentation for Device Tree bindings
  2012-04-18 15:20       ` Chris Ball
@ 2012-04-18 15:25         ` Lee Jones
  0 siblings, 0 replies; 82+ messages in thread
From: Lee Jones @ 2012-04-18 15:25 UTC (permalink / raw)
  To: linux-arm-kernel

On 18/04/12 16:20, Chris Ball wrote:
> Hi,
>
> On Wed, Apr 18 2012, Lee Jones wrote:
>> On 18/04/12 15:31, Pawel Moll wrote:
>>> On Fri, 2012-04-13 at 15:05 +0100, Lee Jones wrote:
>>>> +Required properties:
>>>> +- arm,primecell-periphid : contains the PrimeCell Peripheral ID.
>>>
>>> I'd say that this is _very_ optional (as in: don't use this, unless you
>>> know what are you doing ;-)
>>
>> Okay.
>>
>> Who is pulling this patch by the way? Chris is it you?
>
> Russell King is maintaining MMCI (although I don't think MAINTAINERS has
> caught up with that yet) -- it would be ideal for me if you could get an
> ACK from him so that I can merge it to mmc-next and send it to Linus.

Ideal, thanks Chris.

Russell is CC'ed, so hopefully he'll come across it soon.

Kind regards,
Lee

-- 
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

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-04-16  9:26     ` [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500 Lee Jones
@ 2012-04-25 18:57       ` Russell King - ARM Linux
  2012-04-30  8:25         ` Lee Jones
  2012-05-03 15:03         ` Lee Jones
  2012-06-04 10:14       ` Russell King - ARM Linux
  1 sibling, 2 replies; 82+ messages in thread
From: Russell King - ARM Linux @ 2012-04-25 18:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Apr 16, 2012 at 10:26:08AM +0100, Lee Jones wrote:
> +	/* Must have platform data or Device Tree. */
> +	if (!plat && !np) {
> +		dev_err(&dev->dev, "No plat data or DT found\n");
> +		return -EINVAL;
>  	}
>  
> +	if (np)
> +		mmci_dt_populate_generic_pdata(np, plat);

Please tell me what happens if plat is NULL, but we're running on a DT
enabled platform.  Something tells me that you might just want to fix
that case _before_ I apply your patch.

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-04-25 18:57       ` Russell King - ARM Linux
@ 2012-04-30  8:25         ` Lee Jones
  2012-05-03 15:03         ` Lee Jones
  1 sibling, 0 replies; 82+ messages in thread
From: Lee Jones @ 2012-04-30  8:25 UTC (permalink / raw)
  To: linux-arm-kernel

On 25/04/12 19:57, Russell King - ARM Linux wrote:
> On Mon, Apr 16, 2012 at 10:26:08AM +0100, Lee Jones wrote:
>> +	/* Must have platform data or Device Tree. */
>> +	if (!plat&&  !np) {
>> +		dev_err(&dev->dev, "No plat data or DT found\n");
>> +		return -EINVAL;
>>   	}
>>
>> +	if (np)
>> +		mmci_dt_populate_generic_pdata(np, plat);
>
> Please tell me what happens if plat is NULL, but we're running on a DT
> enabled platform.  Something tells me that you might just want to fix
> that case _before_ I apply your patch.


Sorry for the response delay, I've been incredibly busy with other DT 
enablement.

You're right, I need to allocate memory for platform_data in 
mmci_dt_populate_generic_pdata. This must have worked by chance when I 
tested it. I will draft up another patch and send it to you as soon as I 
can free up some time.

Kind regards,
Lee

-- 
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

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-04-25 18:57       ` Russell King - ARM Linux
  2012-04-30  8:25         ` Lee Jones
@ 2012-05-03 15:03         ` Lee Jones
  2012-05-03 15:12           ` Russell King - ARM Linux
  1 sibling, 1 reply; 82+ messages in thread
From: Lee Jones @ 2012-05-03 15:03 UTC (permalink / raw)
  To: linux-arm-kernel

Here you are Russell. Sorry for the delay.

From: Lee Jones <lee.jones@linaro.org>
Date: Mon, 16 Apr 2012 10:18:43 +0100
Subject: [PATCH 01/19] MMC: mmci: Enable Device Tree support for ux500
 variants

Provide a means to collect attributes specific to ST-Ericsson's
ux500 variant series. This patch registers itself as the AMBA
driver to be called during the probe process. Once all
attributes and ux500 specifics are are collected the normal
mmci core probe is called.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mmc/host/mmci.c |   68 ++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 64 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 032b847..23764ec 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -15,6 +15,7 @@
 #include <linux/device.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/highmem.h>
@@ -1196,21 +1197,77 @@ static const struct mmc_host_ops mmci_ops = {
 	.get_cd		= mmci_get_cd,
 };
 
+#ifdef CONFIG_OF
+static void mmci_dt_populate_generic_pdata(struct device_node *np,
+					struct mmci_platform_data *pdata)
+{
+	int bus_width = 0;
+
+	of_property_read_u32(np, "wp-gpios", &pdata->gpio_wp);
+	if (!pdata->gpio_wp)
+		pdata->gpio_wp = -1;
+
+	of_property_read_u32(np, "cd-gpios", &pdata->gpio_cd);
+	if (!pdata->gpio_cd)
+		pdata->gpio_cd = -1;
+
+	if (of_get_property(np, "cd-inverted", NULL))
+		pdata->cd_invert = true;
+	else
+		pdata->cd_invert = false;
+
+	of_property_read_u32(np, "max-frequency", &pdata->f_max);
+	if (!pdata->f_max)
+		pr_warn("%s has no 'max-frequency' property\n", np->full_name);
+
+	if (of_get_property(np, "mmc-cap-mmc-highspeed", NULL))
+		pdata->capabilities |= MMC_CAP_MMC_HIGHSPEED;
+	if (of_get_property(np, "mmc-cap-sd-highspeed", NULL))
+		pdata->capabilities |= MMC_CAP_SD_HIGHSPEED;
+
+	of_property_read_u32(np, "bus-width", &bus_width);
+	switch (bus_width) {
+	case 0 :
+		/* No bus-width supplied. */
+		break;
+	case 4 :
+		pdata->capabilities |= MMC_CAP_4_BIT_DATA;
+		break;
+	case 8 :
+		pdata->capabilities |= MMC_CAP_8_BIT_DATA;
+		break;
+	default :
+		pr_warn("%s: Unsupported bus width\n", np->full_name);
+	}
+}
+#endif
+
 static int __devinit mmci_probe(struct amba_device *dev,
 	const struct amba_id *id)
 {
 	struct mmci_platform_data *plat = dev->dev.platform_data;
+	struct device_node *np = dev->dev.of_node;
 	struct variant_data *variant = id->data;
 	struct mmci_host *host;
 	struct mmc_host *mmc;
-	int ret;
+	int ret, freeplat = 0;
+
+	/* Must have platform data or Device Tree. */
+	if (!plat && !np) {
+		dev_err(&dev->dev, "No plat data or DT found\n");
+		return -EINVAL;
+	}
 
-	/* must have platform data */
 	if (!plat) {
-		ret = -EINVAL;
-		goto out;
+		plat = kzalloc(sizeof(*plat), GFP_KERNEL);
+		if (!plat)
+			return -ENOMEM;
+		freeplat = 1;
 	}
 
+	if (np)
+		mmci_dt_populate_generic_pdata(np, plat);
+
 	ret = amba_request_regions(dev, DRIVER_NAME);
 	if (ret)
 		goto out;
@@ -1448,6 +1505,9 @@ static int __devinit mmci_probe(struct amba_device *dev,
  rel_regions:
 	amba_release_regions(dev);
  out:
+	if (freeplat)
+		kfree(plat);
+
 	return ret;
 }
 
-- 
1.7.9.5

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-05-03 15:03         ` Lee Jones
@ 2012-05-03 15:12           ` Russell King - ARM Linux
  2012-05-03 15:18             ` Lee Jones
  2012-05-03 15:30             ` Lee Jones
  0 siblings, 2 replies; 82+ messages in thread
From: Russell King - ARM Linux @ 2012-05-03 15:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, May 03, 2012 at 04:03:34PM +0100, Lee Jones wrote:
> +#ifdef CONFIG_OF
> +static void mmci_dt_populate_generic_pdata(struct device_node *np,
> +					struct mmci_platform_data *pdata)
> +{
> +	int bus_width = 0;
> +
> +	of_property_read_u32(np, "wp-gpios", &pdata->gpio_wp);
> +	if (!pdata->gpio_wp)
> +		pdata->gpio_wp = -1;
> +
> +	of_property_read_u32(np, "cd-gpios", &pdata->gpio_cd);
> +	if (!pdata->gpio_cd)
> +		pdata->gpio_cd = -1;
> +
> +	if (of_get_property(np, "cd-inverted", NULL))
> +		pdata->cd_invert = true;
> +	else
> +		pdata->cd_invert = false;
> +
> +	of_property_read_u32(np, "max-frequency", &pdata->f_max);
> +	if (!pdata->f_max)
> +		pr_warn("%s has no 'max-frequency' property\n", np->full_name);
> +
> +	if (of_get_property(np, "mmc-cap-mmc-highspeed", NULL))
> +		pdata->capabilities |= MMC_CAP_MMC_HIGHSPEED;
> +	if (of_get_property(np, "mmc-cap-sd-highspeed", NULL))
> +		pdata->capabilities |= MMC_CAP_SD_HIGHSPEED;
> +
> +	of_property_read_u32(np, "bus-width", &bus_width);
> +	switch (bus_width) {
> +	case 0 :
> +		/* No bus-width supplied. */
> +		break;
> +	case 4 :
> +		pdata->capabilities |= MMC_CAP_4_BIT_DATA;
> +		break;
> +	case 8 :
> +		pdata->capabilities |= MMC_CAP_8_BIT_DATA;
> +		break;
> +	default :
> +		pr_warn("%s: Unsupported bus width\n", np->full_name);
> +	}
> +}
> +#endif
> +
>  static int __devinit mmci_probe(struct amba_device *dev,
>  	const struct amba_id *id)
>  {
>  	struct mmci_platform_data *plat = dev->dev.platform_data;
> +	struct device_node *np = dev->dev.of_node;
>  	struct variant_data *variant = id->data;
>  	struct mmci_host *host;
>  	struct mmc_host *mmc;
> -	int ret;
> +	int ret, freeplat = 0;
> +
> +	/* Must have platform data or Device Tree. */
> +	if (!plat && !np) {
> +		dev_err(&dev->dev, "No plat data or DT found\n");
> +		return -EINVAL;
> +	}
>  
> -	/* must have platform data */
>  	if (!plat) {
> -		ret = -EINVAL;
> -		goto out;
> +		plat = kzalloc(sizeof(*plat), GFP_KERNEL);

I think this will leak memory - consider what happens if the driver gets
bound and unbound from the same device a number of times.

How about using devm_kzalloc() instead, so that when probe fails or the
driver is unbound, the memory is automatically freed?  No need for that
freeplat variable either...

> +		if (!plat)
> +			return -ENOMEM;
> +		freeplat = 1;
>  	}
>  
> +	if (np)
> +		mmci_dt_populate_generic_pdata(np, plat);
> +
>  	ret = amba_request_regions(dev, DRIVER_NAME);
>  	if (ret)
>  		goto out;
> @@ -1448,6 +1505,9 @@ static int __devinit mmci_probe(struct amba_device *dev,
>   rel_regions:
>  	amba_release_regions(dev);
>   out:
> +	if (freeplat)
> +		kfree(plat);
> +
>  	return ret;
>  }
>  
> -- 
> 1.7.9.5

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-05-03 15:12           ` Russell King - ARM Linux
@ 2012-05-03 15:18             ` Lee Jones
  2012-05-03 15:30             ` Lee Jones
  1 sibling, 0 replies; 82+ messages in thread
From: Lee Jones @ 2012-05-03 15:18 UTC (permalink / raw)
  To: linux-arm-kernel

On 03/05/12 16:12, Russell King - ARM Linux wrote:
> On Thu, May 03, 2012 at 04:03:34PM +0100, Lee Jones wrote:
>> +#ifdef CONFIG_OF
>> +static void mmci_dt_populate_generic_pdata(struct device_node *np,
>> +					struct mmci_platform_data *pdata)
>> +{
>> +	int bus_width = 0;
>> +
>> +	of_property_read_u32(np, "wp-gpios",&pdata->gpio_wp);
>> +	if (!pdata->gpio_wp)
>> +		pdata->gpio_wp = -1;
>> +
>> +	of_property_read_u32(np, "cd-gpios",&pdata->gpio_cd);
>> +	if (!pdata->gpio_cd)
>> +		pdata->gpio_cd = -1;
>> +
>> +	if (of_get_property(np, "cd-inverted", NULL))
>> +		pdata->cd_invert = true;
>> +	else
>> +		pdata->cd_invert = false;
>> +
>> +	of_property_read_u32(np, "max-frequency",&pdata->f_max);
>> +	if (!pdata->f_max)
>> +		pr_warn("%s has no 'max-frequency' property\n", np->full_name);
>> +
>> +	if (of_get_property(np, "mmc-cap-mmc-highspeed", NULL))
>> +		pdata->capabilities |= MMC_CAP_MMC_HIGHSPEED;
>> +	if (of_get_property(np, "mmc-cap-sd-highspeed", NULL))
>> +		pdata->capabilities |= MMC_CAP_SD_HIGHSPEED;
>> +
>> +	of_property_read_u32(np, "bus-width",&bus_width);
>> +	switch (bus_width) {
>> +	case 0 :
>> +		/* No bus-width supplied. */
>> +		break;
>> +	case 4 :
>> +		pdata->capabilities |= MMC_CAP_4_BIT_DATA;
>> +		break;
>> +	case 8 :
>> +		pdata->capabilities |= MMC_CAP_8_BIT_DATA;
>> +		break;
>> +	default :
>> +		pr_warn("%s: Unsupported bus width\n", np->full_name);
>> +	}
>> +}
>> +#endif
>> +
>>   static int __devinit mmci_probe(struct amba_device *dev,
>>   	const struct amba_id *id)
>>   {
>>   	struct mmci_platform_data *plat = dev->dev.platform_data;
>> +	struct device_node *np = dev->dev.of_node;
>>   	struct variant_data *variant = id->data;
>>   	struct mmci_host *host;
>>   	struct mmc_host *mmc;
>> -	int ret;
>> +	int ret, freeplat = 0;
>> +
>> +	/* Must have platform data or Device Tree. */
>> +	if (!plat&&  !np) {
>> +		dev_err(&dev->dev, "No plat data or DT found\n");
>> +		return -EINVAL;
>> +	}
>>
>> -	/* must have platform data */
>>   	if (!plat) {
>> -		ret = -EINVAL;
>> -		goto out;
>> +		plat = kzalloc(sizeof(*plat), GFP_KERNEL);
>
> I think this will leak memory - consider what happens if the driver gets
> bound and unbound from the same device a number of times.
>
> How about using devm_kzalloc() instead, so that when probe fails or the
> driver is unbound, the memory is automatically freed?  No need for that
> freeplat variable either...

Makes sense. Give me a few moments.

>> +		if (!plat)
>> +			return -ENOMEM;
>> +		freeplat = 1;
>>   	}
>>
>> +	if (np)
>> +		mmci_dt_populate_generic_pdata(np, plat);
>> +
>>   	ret = amba_request_regions(dev, DRIVER_NAME);
>>   	if (ret)
>>   		goto out;
>> @@ -1448,6 +1505,9 @@ static int __devinit mmci_probe(struct amba_device *dev,
>>    rel_regions:
>>   	amba_release_regions(dev);
>>    out:
>> +	if (freeplat)
>> +		kfree(plat);
>> +
>>   	return ret;
>>   }
>>
>> --
>> 1.7.9.5


-- 
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

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-05-03 15:12           ` Russell King - ARM Linux
  2012-05-03 15:18             ` Lee Jones
@ 2012-05-03 15:30             ` Lee Jones
  2012-05-03 16:30               ` Russell King - ARM Linux
  1 sibling, 1 reply; 82+ messages in thread
From: Lee Jones @ 2012-05-03 15:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Lee Jones <lee.jones@linaro.org>
Date: Mon, 16 Apr 2012 10:18:43 +0100
Subject: [PATCH 01/19] MMC: mmci: Enable Device Tree support for ux500
 variants

Provide a means to collect attributes specific to ST-Ericsson's
ux500 variant series. This patch registers itself as the AMBA
driver to be called during the probe process. Once all
attributes and ux500 specifics are are collected the normal
mmci core probe is called.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mmc/host/mmci.c |   62 ++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 59 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 032b847..c2bd5ea 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -15,6 +15,7 @@
 #include <linux/device.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/highmem.h>
@@ -1196,21 +1197,76 @@ static const struct mmc_host_ops mmci_ops = {
 	.get_cd		= mmci_get_cd,
 };
 
+#ifdef CONFIG_OF
+static void mmci_dt_populate_generic_pdata(struct device_node *np,
+					struct mmci_platform_data *pdata)
+{
+	int bus_width = 0;
+
+	of_property_read_u32(np, "wp-gpios", &pdata->gpio_wp);
+	if (!pdata->gpio_wp)
+		pdata->gpio_wp = -1;
+
+	of_property_read_u32(np, "cd-gpios", &pdata->gpio_cd);
+	if (!pdata->gpio_cd)
+		pdata->gpio_cd = -1;
+
+	if (of_get_property(np, "cd-inverted", NULL))
+		pdata->cd_invert = true;
+	else
+		pdata->cd_invert = false;
+
+	of_property_read_u32(np, "max-frequency", &pdata->f_max);
+	if (!pdata->f_max)
+		pr_warn("%s has no 'max-frequency' property\n", np->full_name);
+
+	if (of_get_property(np, "mmc-cap-mmc-highspeed", NULL))
+		pdata->capabilities |= MMC_CAP_MMC_HIGHSPEED;
+	if (of_get_property(np, "mmc-cap-sd-highspeed", NULL))
+		pdata->capabilities |= MMC_CAP_SD_HIGHSPEED;
+
+	of_property_read_u32(np, "bus-width", &bus_width);
+	switch (bus_width) {
+	case 0 :
+		/* No bus-width supplied. */
+		break;
+	case 4 :
+		pdata->capabilities |= MMC_CAP_4_BIT_DATA;
+		break;
+	case 8 :
+		pdata->capabilities |= MMC_CAP_8_BIT_DATA;
+		break;
+	default :
+		pr_warn("%s: Unsupported bus width\n", np->full_name);
+	}
+}
+#endif
+
 static int __devinit mmci_probe(struct amba_device *dev,
 	const struct amba_id *id)
 {
 	struct mmci_platform_data *plat = dev->dev.platform_data;
+	struct device_node *np = dev->dev.of_node;
 	struct variant_data *variant = id->data;
 	struct mmci_host *host;
 	struct mmc_host *mmc;
 	int ret;
 
-	/* must have platform data */
+	/* Must have platform data or Device Tree. */
+	if (!plat && !np) {
+		dev_err(&dev->dev, "No plat data or DT found\n");
+		return -EINVAL;
+	}
+
 	if (!plat) {
-		ret = -EINVAL;
-		goto out;
+		plat = devm_kzalloc(&dev->dev, sizeof(*plat), GFP_KERNEL);
+		if (!plat)
+			return -ENOMEM;
 	}
 
+	if (np)
+		mmci_dt_populate_generic_pdata(np, plat);
+
 	ret = amba_request_regions(dev, DRIVER_NAME);
 	if (ret)
 		goto out;
-- 
1.7.9.5

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-05-03 15:30             ` Lee Jones
@ 2012-05-03 16:30               ` Russell King - ARM Linux
  2012-05-03 16:38                 ` Lee Jones
  0 siblings, 1 reply; 82+ messages in thread
From: Russell King - ARM Linux @ 2012-05-03 16:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, May 03, 2012 at 04:30:48PM +0100, Lee Jones wrote:
> From: Lee Jones <lee.jones@linaro.org>
> Date: Mon, 16 Apr 2012 10:18:43 +0100
> Subject: [PATCH 01/19] MMC: mmci: Enable Device Tree support for ux500
>  variants
> 
> Provide a means to collect attributes specific to ST-Ericsson's
> ux500 variant series. This patch registers itself as the AMBA
> driver to be called during the probe process. Once all
> attributes and ux500 specifics are are collected the normal
> mmci core probe is called.
> 
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

This looks fine now, thanks.

> ---
>  drivers/mmc/host/mmci.c |   62 ++++++++++++++++++++++++++++++++++++++++++++---
>  1 file changed, 59 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
> index 032b847..c2bd5ea 100644
> --- a/drivers/mmc/host/mmci.c
> +++ b/drivers/mmc/host/mmci.c
> @@ -15,6 +15,7 @@
>  #include <linux/device.h>
>  #include <linux/interrupt.h>
>  #include <linux/kernel.h>
> +#include <linux/slab.h>
>  #include <linux/delay.h>
>  #include <linux/err.h>
>  #include <linux/highmem.h>
> @@ -1196,21 +1197,76 @@ static const struct mmc_host_ops mmci_ops = {
>  	.get_cd		= mmci_get_cd,
>  };
>  
> +#ifdef CONFIG_OF
> +static void mmci_dt_populate_generic_pdata(struct device_node *np,
> +					struct mmci_platform_data *pdata)
> +{
> +	int bus_width = 0;
> +
> +	of_property_read_u32(np, "wp-gpios", &pdata->gpio_wp);
> +	if (!pdata->gpio_wp)
> +		pdata->gpio_wp = -1;
> +
> +	of_property_read_u32(np, "cd-gpios", &pdata->gpio_cd);
> +	if (!pdata->gpio_cd)
> +		pdata->gpio_cd = -1;
> +
> +	if (of_get_property(np, "cd-inverted", NULL))
> +		pdata->cd_invert = true;
> +	else
> +		pdata->cd_invert = false;
> +
> +	of_property_read_u32(np, "max-frequency", &pdata->f_max);
> +	if (!pdata->f_max)
> +		pr_warn("%s has no 'max-frequency' property\n", np->full_name);
> +
> +	if (of_get_property(np, "mmc-cap-mmc-highspeed", NULL))
> +		pdata->capabilities |= MMC_CAP_MMC_HIGHSPEED;
> +	if (of_get_property(np, "mmc-cap-sd-highspeed", NULL))
> +		pdata->capabilities |= MMC_CAP_SD_HIGHSPEED;
> +
> +	of_property_read_u32(np, "bus-width", &bus_width);
> +	switch (bus_width) {
> +	case 0 :
> +		/* No bus-width supplied. */
> +		break;
> +	case 4 :
> +		pdata->capabilities |= MMC_CAP_4_BIT_DATA;
> +		break;
> +	case 8 :
> +		pdata->capabilities |= MMC_CAP_8_BIT_DATA;
> +		break;
> +	default :
> +		pr_warn("%s: Unsupported bus width\n", np->full_name);
> +	}
> +}
> +#endif
> +
>  static int __devinit mmci_probe(struct amba_device *dev,
>  	const struct amba_id *id)
>  {
>  	struct mmci_platform_data *plat = dev->dev.platform_data;
> +	struct device_node *np = dev->dev.of_node;
>  	struct variant_data *variant = id->data;
>  	struct mmci_host *host;
>  	struct mmc_host *mmc;
>  	int ret;
>  
> -	/* must have platform data */
> +	/* Must have platform data or Device Tree. */
> +	if (!plat && !np) {
> +		dev_err(&dev->dev, "No plat data or DT found\n");
> +		return -EINVAL;
> +	}
> +
>  	if (!plat) {
> -		ret = -EINVAL;
> -		goto out;
> +		plat = devm_kzalloc(&dev->dev, sizeof(*plat), GFP_KERNEL);
> +		if (!plat)
> +			return -ENOMEM;
>  	}
>  
> +	if (np)
> +		mmci_dt_populate_generic_pdata(np, plat);
> +
>  	ret = amba_request_regions(dev, DRIVER_NAME);
>  	if (ret)
>  		goto out;
> -- 
> 1.7.9.5

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-05-03 16:30               ` Russell King - ARM Linux
@ 2012-05-03 16:38                 ` Lee Jones
  2012-05-03 16:45                   ` Russell King - ARM Linux
  0 siblings, 1 reply; 82+ messages in thread
From: Lee Jones @ 2012-05-03 16:38 UTC (permalink / raw)
  To: linux-arm-kernel

On 03/05/12 17:30, Russell King - ARM Linux wrote:
> On Thu, May 03, 2012 at 04:30:48PM +0100, Lee Jones wrote:
>> From: Lee Jones<lee.jones@linaro.org>
>> Date: Mon, 16 Apr 2012 10:18:43 +0100
>> Subject: [PATCH 01/19] MMC: mmci: Enable Device Tree support for ux500
>>   variants
>>
>> Provide a means to collect attributes specific to ST-Ericsson's
>> ux500 variant series. This patch registers itself as the AMBA
>> driver to be called during the probe process. Once all
>> attributes and ux500 specifics are are collected the normal
>> mmci core probe is called.
>>
>> Acked-by: Linus Walleij<linus.walleij@linaro.org>
>> Acked-by: Arnd Bergmann<arnd@arndb.de>
>> Signed-off-by: Lee Jones<lee.jones@linaro.org>
>
> This looks fine now, thanks.

Thanks for taking the time to do this Russell.

Would you be kind enough to cast your eye over the documentation patch 
as well please? I believe Chris is waiting on an Ack from you before he 
will pull it.

[PATCH 7/7] MMC: mmci: Add required documentation for Device Tree bindings

Chris, will you also take this one through your tree?

>> ---
>>   drivers/mmc/host/mmci.c |   62 ++++++++++++++++++++++++++++++++++++++++++++---
>>   1 file changed, 59 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
>> index 032b847..c2bd5ea 100644
>> --- a/drivers/mmc/host/mmci.c
>> +++ b/drivers/mmc/host/mmci.c
>> @@ -15,6 +15,7 @@
>>   #include<linux/device.h>
>>   #include<linux/interrupt.h>
>>   #include<linux/kernel.h>
>> +#include<linux/slab.h>
>>   #include<linux/delay.h>
>>   #include<linux/err.h>
>>   #include<linux/highmem.h>
>> @@ -1196,21 +1197,76 @@ static const struct mmc_host_ops mmci_ops = {
>>   	.get_cd		= mmci_get_cd,
>>   };
>>
>> +#ifdef CONFIG_OF
>> +static void mmci_dt_populate_generic_pdata(struct device_node *np,
>> +					struct mmci_platform_data *pdata)
>> +{
>> +	int bus_width = 0;
>> +
>> +	of_property_read_u32(np, "wp-gpios",&pdata->gpio_wp);
>> +	if (!pdata->gpio_wp)
>> +		pdata->gpio_wp = -1;
>> +
>> +	of_property_read_u32(np, "cd-gpios",&pdata->gpio_cd);
>> +	if (!pdata->gpio_cd)
>> +		pdata->gpio_cd = -1;
>> +
>> +	if (of_get_property(np, "cd-inverted", NULL))
>> +		pdata->cd_invert = true;
>> +	else
>> +		pdata->cd_invert = false;
>> +
>> +	of_property_read_u32(np, "max-frequency",&pdata->f_max);
>> +	if (!pdata->f_max)
>> +		pr_warn("%s has no 'max-frequency' property\n", np->full_name);
>> +
>> +	if (of_get_property(np, "mmc-cap-mmc-highspeed", NULL))
>> +		pdata->capabilities |= MMC_CAP_MMC_HIGHSPEED;
>> +	if (of_get_property(np, "mmc-cap-sd-highspeed", NULL))
>> +		pdata->capabilities |= MMC_CAP_SD_HIGHSPEED;
>> +
>> +	of_property_read_u32(np, "bus-width",&bus_width);
>> +	switch (bus_width) {
>> +	case 0 :
>> +		/* No bus-width supplied. */
>> +		break;
>> +	case 4 :
>> +		pdata->capabilities |= MMC_CAP_4_BIT_DATA;
>> +		break;
>> +	case 8 :
>> +		pdata->capabilities |= MMC_CAP_8_BIT_DATA;
>> +		break;
>> +	default :
>> +		pr_warn("%s: Unsupported bus width\n", np->full_name);
>> +	}
>> +}
>> +#endif
>> +
>>   static int __devinit mmci_probe(struct amba_device *dev,
>>   	const struct amba_id *id)
>>   {
>>   	struct mmci_platform_data *plat = dev->dev.platform_data;
>> +	struct device_node *np = dev->dev.of_node;
>>   	struct variant_data *variant = id->data;
>>   	struct mmci_host *host;
>>   	struct mmc_host *mmc;
>>   	int ret;
>>
>> -	/* must have platform data */
>> +	/* Must have platform data or Device Tree. */
>> +	if (!plat&&  !np) {
>> +		dev_err(&dev->dev, "No plat data or DT found\n");
>> +		return -EINVAL;
>> +	}
>> +
>>   	if (!plat) {
>> -		ret = -EINVAL;
>> -		goto out;
>> +		plat = devm_kzalloc(&dev->dev, sizeof(*plat), GFP_KERNEL);
>> +		if (!plat)
>> +			return -ENOMEM;
>>   	}
>>
>> +	if (np)
>> +		mmci_dt_populate_generic_pdata(np, plat);
>> +
>>   	ret = amba_request_regions(dev, DRIVER_NAME);
>>   	if (ret)
>>   		goto out;
>> --
>> 1.7.9.5


-- 
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

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-05-03 16:38                 ` Lee Jones
@ 2012-05-03 16:45                   ` Russell King - ARM Linux
  2012-05-03 16:59                     ` Lee Jones
  2012-05-03 17:09                     ` Chris Ball
  0 siblings, 2 replies; 82+ messages in thread
From: Russell King - ARM Linux @ 2012-05-03 16:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, May 03, 2012 at 05:38:59PM +0100, Lee Jones wrote:
> Would you be kind enough to cast your eye over the documentation patch  
> as well please? I believe Chris is waiting on an Ack from you before he  
> will pull it.
>
> [PATCH 7/7] MMC: mmci: Add required documentation for Device Tree bindings

I'm not sure I'm the right person for doing that because I've hardly
touched DT stuff.

Provided the properties are sanely named, and the common properties between
drivers is already sensibly separated, then I don't see there's much to
comment on.

One thing that might help is if the format of these descriptions were
changed so that there was one file per subsystem documenting the common
options, rather than (eg) every MMC driver documentating the same base
options time and time again.

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-05-03 16:45                   ` Russell King - ARM Linux
@ 2012-05-03 16:59                     ` Lee Jones
  2012-05-03 17:13                       ` Mark Brown
  2012-05-03 17:09                     ` Chris Ball
  1 sibling, 1 reply; 82+ messages in thread
From: Lee Jones @ 2012-05-03 16:59 UTC (permalink / raw)
  To: linux-arm-kernel

On 03/05/12 17:45, Russell King - ARM Linux wrote:
> On Thu, May 03, 2012 at 05:38:59PM +0100, Lee Jones wrote:
>> Would you be kind enough to cast your eye over the documentation patch
>> as well please? I believe Chris is waiting on an Ack from you before he
>> will pull it.
>>
>> [PATCH 7/7] MMC: mmci: Add required documentation for Device Tree bindings
>
> I'm not sure I'm the right person for doing that because I've hardly
> touched DT stuff.
>
> Provided the properties are sanely named, and the common properties between
> drivers is already sensibly separated, then I don't see there's much to
> comment on.

That sounds fair.

> One thing that might help is if the format of these descriptions were
> changed so that there was one file per subsystem documenting the common
> options, rather than (eg) every MMC driver documentating the same base
> options time and time again.

I'm afraid that's not really for me to decide, however Grant is on CC. 
Perhaps that's a point he'd like to drive. If he's stopped reading this 
thread and fails to reply, I will endeavor to poke him about it while 
we're in Hong Kong.

-- 
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

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-05-03 16:45                   ` Russell King - ARM Linux
  2012-05-03 16:59                     ` Lee Jones
@ 2012-05-03 17:09                     ` Chris Ball
  2012-05-04 13:18                       ` Lee Jones
  1 sibling, 1 reply; 82+ messages in thread
From: Chris Ball @ 2012-05-03 17:09 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Thu, May 03 2012, Russell King - ARM Linux wrote:
> On Thu, May 03, 2012 at 05:38:59PM +0100, Lee Jones wrote:
>> Would you be kind enough to cast your eye over the documentation patch  
>> as well please? I believe Chris is waiting on an Ack from you before he  
>> will pull it.
>>
>> [PATCH 7/7] MMC: mmci: Add required documentation for Device Tree bindings
>
> I'm not sure I'm the right person for doing that because I've hardly
> touched DT stuff.
>
> Provided the properties are sanely named, and the common properties between
> drivers is already sensibly separated, then I don't see there's much to
> comment on.
>
> One thing that might help is if the format of these descriptions were
> changed so that there was one file per subsystem documenting the common
> options, rather than (eg) every MMC driver documentating the same base
> options time and time again.

Arnd has a patch to add a single file description of MMC bindings, but
it's been a while since the last revision -- Arnd, is there anything we
can do to help get your bindings patch merged soon?

Lee, Arnd's Acked-by is fine for this patch, I can take it via MMC if
the MMC patches are self-contained.  I'm having trouble finding the
latest patchset in one place, though; could you send me a pointer to
it, or repost it to me and the MMC list with your ACKs included?

Thanks very much,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-05-03 16:59                     ` Lee Jones
@ 2012-05-03 17:13                       ` Mark Brown
  2012-05-03 21:21                         ` Lee Jones
  0 siblings, 1 reply; 82+ messages in thread
From: Mark Brown @ 2012-05-03 17:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, May 03, 2012 at 05:59:54PM +0100, Lee Jones wrote:
> On 03/05/12 17:45, Russell King - ARM Linux wrote:

> >One thing that might help is if the format of these descriptions were
> >changed so that there was one file per subsystem documenting the common
> >options, rather than (eg) every MMC driver documentating the same base
> >options time and time again.

> I'm afraid that's not really for me to decide, however Grant is on
> CC. Perhaps that's a point he'd like to drive. If he's stopped
> reading this thread and fails to reply, I will endeavor to poke him
> about it while we're in Hong Kong.

It's what we're already doing for other things where there's a lot of
commonality like regulators, I don't think there's any conroversy, it's
just reminding people to not cut'n'paste.

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-05-03 17:13                       ` Mark Brown
@ 2012-05-03 21:21                         ` Lee Jones
  0 siblings, 0 replies; 82+ messages in thread
From: Lee Jones @ 2012-05-03 21:21 UTC (permalink / raw)
  To: linux-arm-kernel

On 03/05/12 18:13, Mark Brown wrote:
> On Thu, May 03, 2012 at 05:59:54PM +0100, Lee Jones wrote:
>> On 03/05/12 17:45, Russell King - ARM Linux wrote:
>
>>> One thing that might help is if the format of these descriptions were
>>> changed so that there was one file per subsystem documenting the common
>>> options, rather than (eg) every MMC driver documentating the same base
>>> options time and time again.
>
>> I'm afraid that's not really for me to decide, however Grant is on
>> CC. Perhaps that's a point he'd like to drive. If he's stopped
>> reading this thread and fails to reply, I will endeavor to poke him
>> about it while we're in Hong Kong.
>
> It's what we're already doing for other things where there's a lot of
> commonality like regulators, I don't think there's any conroversy, it's
> just reminding people to not cut'n'paste.

Okay. I'm happy to do a little documentation clean-up once the 
enablement is complete. There is one more patch-set from me and another 
from another engineer due, then we can work on tying up some of the 
loose ends, such as documentation consolidation etc.

-- 
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

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-05-03 17:09                     ` Chris Ball
@ 2012-05-04 13:18                       ` Lee Jones
  2012-05-04 13:26                         ` Chris Ball
  0 siblings, 1 reply; 82+ messages in thread
From: Lee Jones @ 2012-05-04 13:18 UTC (permalink / raw)
  To: linux-arm-kernel

On 03/05/12 18:09, Chris Ball wrote:
> Hi,
>
> On Thu, May 03 2012, Russell King - ARM Linux wrote:
>> On Thu, May 03, 2012 at 05:38:59PM +0100, Lee Jones wrote:
>>> Would you be kind enough to cast your eye over the documentation patch
>>> as well please? I believe Chris is waiting on an Ack from you before he
>>> will pull it.
>>>
>>> [PATCH 7/7] MMC: mmci: Add required documentation for Device Tree bindings
>>
>> I'm not sure I'm the right person for doing that because I've hardly
>> touched DT stuff.
>>
>> Provided the properties are sanely named, and the common properties between
>> drivers is already sensibly separated, then I don't see there's much to
>> comment on.
>>
>> One thing that might help is if the format of these descriptions were
>> changed so that there was one file per subsystem documenting the common
>> options, rather than (eg) every MMC driver documentating the same base
>> options time and time again.
>
> Arnd has a patch to add a single file description of MMC bindings, but
> it's been a while since the last revision -- Arnd, is there anything we
> can do to help get your bindings patch merged soon?
>
> Lee, Arnd's Acked-by is fine for this patch, I can take it via MMC if
> the MMC patches are self-contained.  I'm having trouble finding the
> latest patchset in one place, though; could you send me a pointer to
> it, or repost it to me and the MMC list with your ACKs included?
>
> Thanks very much,

I can either do that, or push it through Arnd's tree if you like (and 
it's okay with him), as I will be supplying him with another pull 
request after my next patch-set has been scrutinised. Would that suit 
you better?

Kind regards,
Lee

-- 
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

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-05-04 13:18                       ` Lee Jones
@ 2012-05-04 13:26                         ` Chris Ball
  2012-05-04 13:39                           ` Lee Jones
       [not found]                           ` <4FA3DEEF.2010206@linaro.org>
  0 siblings, 2 replies; 82+ messages in thread
From: Chris Ball @ 2012-05-04 13:26 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Fri, May 04 2012, Lee Jones wrote:
> I can either do that, or push it through Arnd's tree if you like (and
> it's okay with him), as I will be supplying him with another pull
> request after my next patch-set has been scrutinised. Would that suit
> you better?

If the MMC patches are self-contained and it doesn't break anything to
merge them separately, my preference is to merge them via the MMC tree
(to avoid creating conflicts against other MMC patches in there).

If there are dependencies, going via Arnd instead is fine.

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-05-04 13:26                         ` Chris Ball
@ 2012-05-04 13:39                           ` Lee Jones
  2012-05-07 22:00                               ` Paul Gortmaker
       [not found]                           ` <4FA3DEEF.2010206@linaro.org>
  1 sibling, 1 reply; 82+ messages in thread
From: Lee Jones @ 2012-05-04 13:39 UTC (permalink / raw)
  To: linux-arm-kernel

On 04/05/12 14:26, Chris Ball wrote:
> Hi,
>
> On Fri, May 04 2012, Lee Jones wrote:
>> I can either do that, or push it through Arnd's tree if you like (and
>> it's okay with him), as I will be supplying him with another pull
>> request after my next patch-set has been scrutinised. Would that suit
>> you better?
>
> If the MMC patches are self-contained and it doesn't break anything to
> merge them separately, my preference is to merge them via the MMC tree
> (to avoid creating conflicts against other MMC patches in there).
>
> If there are dependencies, going via Arnd instead is fine.

Okay, I'll knock up a small patch-set and send it to you.

I think it's 3 patches.

-- 
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

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

* Re: [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
       [not found]                           ` <4FA3DEEF.2010206@linaro.org>
@ 2012-05-04 14:08                             ` Chris Ball
  0 siblings, 0 replies; 82+ messages in thread
From: Chris Ball @ 2012-05-04 14:08 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-mmc

Hi Lee,

On Fri, May 04 2012, Lee Jones wrote:
> The following changes since commit 69964ea4c7b68c9399f7977aa5b9aa6539a6a98a:
>
>   Linux 3.4-rc5 (2012-04-29 15:19:10 -0700)
>
> are available in the git repository at:
>
>   git://git.linaro.org/people/ljones/linux-3.0-ux500.git mmc-for-chrisb
>
> for you to fetch changes up to b6e0fdd89668db08a40f8cbe687b23f1eaf15b5a:
>
>   drivers/mmc: MMCI: Use correct GPIO binding for IRQ requests
> (2012-05-04 14:47:28 +0100)
>
> ----------------------------------------------------------------
> Lee Jones (3):
>       MMC: mmci: Enable Device Tree support for ux500 variants
>       MMC: mmci: Add required documentation for Device Tree bindings
>       drivers/mmc: MMCI: Use correct GPIO binding for IRQ requests
>
>  Documentation/devicetree/bindings/mmc/mmci.txt |   19 ++++++++
>  drivers/mmc/host/mmci.c                        |   59
> ++++++++++++++++++++++--
>  2 files changed, 74 insertions(+), 4 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/mmc/mmci.txt

Thanks very much, pushed to mmc-next for 3.5.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* Re: [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-05-04 13:39                           ` Lee Jones
@ 2012-05-07 22:00                               ` Paul Gortmaker
  0 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2012-05-07 22:00 UTC (permalink / raw)
  To: Lee Jones
  Cc: Chris Ball, Russell King - ARM Linux, linus.walleij, arnd,
	Linus Walleij, grant.likely, linux-arm-kernel, linux-next

On Fri, May 4, 2012 at 9:39 AM, Lee Jones <lee.jones@linaro.org> wrote:
> On 04/05/12 14:26, Chris Ball wrote:
>>
>> Hi,
>>
>> On Fri, May 04 2012, Lee Jones wrote:
>>>
>>> I can either do that, or push it through Arnd's tree if you like (and
>>> it's okay with him), as I will be supplying him with another pull
>>> request after my next patch-set has been scrutinised. Would that suit
>>> you better?
>>
>>
>> If the MMC patches are self-contained and it doesn't break anything to

Hi All,

The version of these patches that just appeared in linux-next is causing
build fails on about 5 different configs (versatile_defconfig etc).

It isn't hard to see (with hindsight) that the new function is declared in
an #ifdef CONFIG_OF block, but it's callers are not similarly guarded.
So you get things like this:

http://kisskb.ellerman.id.au/kisskb/buildresult/6272348/

If you can get a fixed up version into the linux-next queue ASAP, that
would be great.

Thanks,
Paul.
--


>> merge them separately, my preference is to merge them via the MMC tree
>> (to avoid creating conflicts against other MMC patches in there).
>>
>> If there are dependencies, going via Arnd instead is fine.
>
>
> Okay, I'll knock up a small patch-set and send it to you.
>
> I think it's 3 patches.
>
>
> --
> 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
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
@ 2012-05-07 22:00                               ` Paul Gortmaker
  0 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2012-05-07 22:00 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, May 4, 2012 at 9:39 AM, Lee Jones <lee.jones@linaro.org> wrote:
> On 04/05/12 14:26, Chris Ball wrote:
>>
>> Hi,
>>
>> On Fri, May 04 2012, Lee Jones wrote:
>>>
>>> I can either do that, or push it through Arnd's tree if you like (and
>>> it's okay with him), as I will be supplying him with another pull
>>> request after my next patch-set has been scrutinised. Would that suit
>>> you better?
>>
>>
>> If the MMC patches are self-contained and it doesn't break anything to

Hi All,

The version of these patches that just appeared in linux-next is causing
build fails on about 5 different configs (versatile_defconfig etc).

It isn't hard to see (with hindsight) that the new function is declared in
an #ifdef CONFIG_OF block, but it's callers are not similarly guarded.
So you get things like this:

http://kisskb.ellerman.id.au/kisskb/buildresult/6272348/

If you can get a fixed up version into the linux-next queue ASAP, that
would be great.

Thanks,
Paul.
--


>> merge them separately, my preference is to merge them via the MMC tree
>> (to avoid creating conflicts against other MMC patches in there).
>>
>> If there are dependencies, going via Arnd instead is fine.
>
>
> Okay, I'll knock up a small patch-set and send it to you.
>
> I think it's 3 patches.
>
>
> --
> 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
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-05-07 22:00                               ` Paul Gortmaker
@ 2012-05-08 11:19                                 ` Lee Jones
  -1 siblings, 0 replies; 82+ messages in thread
From: Lee Jones @ 2012-05-08 11:19 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: Chris Ball, Russell King - ARM Linux, linus.walleij, arnd,
	Linus Walleij, grant.likely, linux-arm-kernel, linux-next

On 07/05/12 23:00, Paul Gortmaker wrote:
> On Fri, May 4, 2012 at 9:39 AM, Lee Jones<lee.jones@linaro.org>  wrote:
>> On 04/05/12 14:26, Chris Ball wrote:
>>>
>>> Hi,
>>>
>>> On Fri, May 04 2012, Lee Jones wrote:
>>>>
>>>> I can either do that, or push it through Arnd's tree if you like (and
>>>> it's okay with him), as I will be supplying him with another pull
>>>> request after my next patch-set has been scrutinised. Would that suit
>>>> you better?
>>>
>>>
>>> If the MMC patches are self-contained and it doesn't break anything to
>
> Hi All,
>
> The version of these patches that just appeared in linux-next is causing
> build fails on about 5 different configs (versatile_defconfig etc).
>
> It isn't hard to see (with hindsight) that the new function is declared in
> an #ifdef CONFIG_OF block, but it's callers are not similarly guarded.
> So you get things like this:
>
> http://kisskb.ellerman.id.au/kisskb/buildresult/6272348/
>
> If you can get a fixed up version into the linux-next queue ASAP, that
> would be great.

I've fixed the issue. How would you like the fix?

As a fix patch, or a replacement for the broken one?

Kind regards,
Lee

>>> merge them separately, my preference is to merge them via the MMC tree
>>> (to avoid creating conflicts against other MMC patches in there).
>>>
>>> If there are dependencies, going via Arnd instead is fine.
>>
>>
>> Okay, I'll knock up a small patch-set and send it to you.
>>
>> I think it's 3 patches.

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
@ 2012-05-08 11:19                                 ` Lee Jones
  0 siblings, 0 replies; 82+ messages in thread
From: Lee Jones @ 2012-05-08 11:19 UTC (permalink / raw)
  To: linux-arm-kernel

On 07/05/12 23:00, Paul Gortmaker wrote:
> On Fri, May 4, 2012 at 9:39 AM, Lee Jones<lee.jones@linaro.org>  wrote:
>> On 04/05/12 14:26, Chris Ball wrote:
>>>
>>> Hi,
>>>
>>> On Fri, May 04 2012, Lee Jones wrote:
>>>>
>>>> I can either do that, or push it through Arnd's tree if you like (and
>>>> it's okay with him), as I will be supplying him with another pull
>>>> request after my next patch-set has been scrutinised. Would that suit
>>>> you better?
>>>
>>>
>>> If the MMC patches are self-contained and it doesn't break anything to
>
> Hi All,
>
> The version of these patches that just appeared in linux-next is causing
> build fails on about 5 different configs (versatile_defconfig etc).
>
> It isn't hard to see (with hindsight) that the new function is declared in
> an #ifdef CONFIG_OF block, but it's callers are not similarly guarded.
> So you get things like this:
>
> http://kisskb.ellerman.id.au/kisskb/buildresult/6272348/
>
> If you can get a fixed up version into the linux-next queue ASAP, that
> would be great.

I've fixed the issue. How would you like the fix?

As a fix patch, or a replacement for the broken one?

Kind regards,
Lee

>>> merge them separately, my preference is to merge them via the MMC tree
>>> (to avoid creating conflicts against other MMC patches in there).
>>>
>>> If there are dependencies, going via Arnd instead is fine.
>>
>>
>> Okay, I'll knock up a small patch-set and send it to you.
>>
>> I think it's 3 patches.

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

* Re: [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-05-08 11:19                                 ` Lee Jones
@ 2012-05-08 12:18                                   ` Chris Ball
  -1 siblings, 0 replies; 82+ messages in thread
From: Chris Ball @ 2012-05-08 12:18 UTC (permalink / raw)
  To: Lee Jones
  Cc: Paul Gortmaker, Russell King - ARM Linux, linus.walleij, arnd,
	Linus Walleij, grant.likely, linux-arm-kernel, linux-next

Hi Lee,

On Tue, May 08 2012, Lee Jones wrote:
> I've fixed the issue. How would you like the fix?
>
> As a fix patch, or a replacement for the broken one?

Let's go with a fix patch.  (I may squash it into the original later,
before sending it to Linus.)

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
@ 2012-05-08 12:18                                   ` Chris Ball
  0 siblings, 0 replies; 82+ messages in thread
From: Chris Ball @ 2012-05-08 12:18 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Lee,

On Tue, May 08 2012, Lee Jones wrote:
> I've fixed the issue. How would you like the fix?
>
> As a fix patch, or a replacement for the broken one?

Let's go with a fix patch.  (I may squash it into the original later,
before sending it to Linus.)

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* Re: [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-05-08 12:18                                   ` Chris Ball
@ 2012-05-08 12:59                                     ` Lee Jones
  -1 siblings, 0 replies; 82+ messages in thread
From: Lee Jones @ 2012-05-08 12:59 UTC (permalink / raw)
  To: Chris Ball
  Cc: Paul Gortmaker, Russell King - ARM Linux, linus.walleij, arnd,
	Linus Walleij, grant.likely, linux-arm-kernel, linux-next

Here you go Chris.

From: Lee Jones <lee.jones@linaro.org>
Date: Tue, 8 May 2012 13:40:02 +0100
Subject: [PATCH] MMC: mmci: Fix compiler error when CONFIG_OF is not set

error: implicit declaration of function 'mmci_dt_populate_generic_pdata'

This is due to the '#if CONFIG_OF' guards placed around
mmci_dt_populate_generic_pdata(), but not around the call to it. We
repair this by inserting a stub which elegantly returns when CONFIG_OF
is not set.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mmc/host/mmci.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 2303a16..efc822d 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -1241,6 +1241,12 @@ static void mmci_dt_populate_generic_pdata(struct device_node *np,
 		pr_warn("%s: Unsupported bus width\n", np->full_name);
 	}
 }
+#else
+static void mmci_dt_populate_generic_pdata(struct device_node *np,
+					struct mmci_platform_data *pdata)
+{
+	return;
+}
 #endif
 
 static int __devinit mmci_probe(struct amba_device *dev,
-- 
1.7.9.5

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
@ 2012-05-08 12:59                                     ` Lee Jones
  0 siblings, 0 replies; 82+ messages in thread
From: Lee Jones @ 2012-05-08 12:59 UTC (permalink / raw)
  To: linux-arm-kernel

Here you go Chris.

From: Lee Jones <lee.jones@linaro.org>
Date: Tue, 8 May 2012 13:40:02 +0100
Subject: [PATCH] MMC: mmci: Fix compiler error when CONFIG_OF is not set

error: implicit declaration of function 'mmci_dt_populate_generic_pdata'

This is due to the '#if CONFIG_OF' guards placed around
mmci_dt_populate_generic_pdata(), but not around the call to it. We
repair this by inserting a stub which elegantly returns when CONFIG_OF
is not set.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mmc/host/mmci.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 2303a16..efc822d 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -1241,6 +1241,12 @@ static void mmci_dt_populate_generic_pdata(struct device_node *np,
 		pr_warn("%s: Unsupported bus width\n", np->full_name);
 	}
 }
+#else
+static void mmci_dt_populate_generic_pdata(struct device_node *np,
+					struct mmci_platform_data *pdata)
+{
+	return;
+}
 #endif
 
 static int __devinit mmci_probe(struct amba_device *dev,
-- 
1.7.9.5

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

* Re: [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-05-08 12:59                                     ` Lee Jones
@ 2012-05-08 14:38                                       ` Chris Ball
  -1 siblings, 0 replies; 82+ messages in thread
From: Chris Ball @ 2012-05-08 14:38 UTC (permalink / raw)
  To: Lee Jones
  Cc: Paul Gortmaker, Russell King - ARM Linux, linus.walleij, arnd,
	Linus Walleij, grant.likely, linux-arm-kernel, linux-next

Hi,

On Tue, May 08 2012, Lee Jones wrote:
> Here you go Chris.
>
> From: Lee Jones <lee.jones@linaro.org>
> Date: Tue, 8 May 2012 13:40:02 +0100
> Subject: [PATCH] MMC: mmci: Fix compiler error when CONFIG_OF is not set
>
> error: implicit declaration of function 'mmci_dt_populate_generic_pdata'
>
> This is due to the '#if CONFIG_OF' guards placed around
> mmci_dt_populate_generic_pdata(), but not around the call to it. We
> repair this by inserting a stub which elegantly returns when CONFIG_OF
> is not set.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/mmc/host/mmci.c |    6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
> index 2303a16..efc822d 100644
> --- a/drivers/mmc/host/mmci.c
> +++ b/drivers/mmc/host/mmci.c
> @@ -1241,6 +1241,12 @@ static void mmci_dt_populate_generic_pdata(struct device_node *np,
>  		pr_warn("%s: Unsupported bus width\n", np->full_name);
>  	}
>  }
> +#else
> +static void mmci_dt_populate_generic_pdata(struct device_node *np,
> +					struct mmci_platform_data *pdata)
> +{
> +	return;
> +}
>  #endif
>  
>  static int __devinit mmci_probe(struct amba_device *dev,

Thanks, this is in mmc-next now.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
@ 2012-05-08 14:38                                       ` Chris Ball
  0 siblings, 0 replies; 82+ messages in thread
From: Chris Ball @ 2012-05-08 14:38 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Tue, May 08 2012, Lee Jones wrote:
> Here you go Chris.
>
> From: Lee Jones <lee.jones@linaro.org>
> Date: Tue, 8 May 2012 13:40:02 +0100
> Subject: [PATCH] MMC: mmci: Fix compiler error when CONFIG_OF is not set
>
> error: implicit declaration of function 'mmci_dt_populate_generic_pdata'
>
> This is due to the '#if CONFIG_OF' guards placed around
> mmci_dt_populate_generic_pdata(), but not around the call to it. We
> repair this by inserting a stub which elegantly returns when CONFIG_OF
> is not set.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/mmc/host/mmci.c |    6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
> index 2303a16..efc822d 100644
> --- a/drivers/mmc/host/mmci.c
> +++ b/drivers/mmc/host/mmci.c
> @@ -1241,6 +1241,12 @@ static void mmci_dt_populate_generic_pdata(struct device_node *np,
>  		pr_warn("%s: Unsupported bus width\n", np->full_name);
>  	}
>  }
> +#else
> +static void mmci_dt_populate_generic_pdata(struct device_node *np,
> +					struct mmci_platform_data *pdata)
> +{
> +	return;
> +}
>  #endif
>  
>  static int __devinit mmci_probe(struct amba_device *dev,

Thanks, this is in mmc-next now.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* Re: [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-05-08 12:59                                     ` Lee Jones
@ 2012-05-08 23:58                                       ` Paul Gortmaker
  -1 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2012-05-08 23:58 UTC (permalink / raw)
  To: Lee Jones
  Cc: Chris Ball, Russell King - ARM Linux, linus.walleij, arnd,
	Linus Walleij, grant.likely, linux-arm-kernel, linux-next

On Tue, May 8, 2012 at 8:59 AM, Lee Jones <lee.jones@linaro.org> wrote:
> Here you go Chris.
>
> From: Lee Jones <lee.jones@linaro.org>
> Date: Tue, 8 May 2012 13:40:02 +0100
> Subject: [PATCH] MMC: mmci: Fix compiler error when CONFIG_OF is not set
>
> error: implicit declaration of function 'mmci_dt_populate_generic_pdata'
>
> This is due to the '#if CONFIG_OF' guards placed around
> mmci_dt_populate_generic_pdata(), but not around the call to it. We
> repair this by inserting a stub which elegantly returns when CONFIG_OF
> is not set.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Please if possible, do not neglect to add the Reported-by: line when
appropriate.  I've been at this long enough that it really won't change
my life any if it is there or not there, but for someone new to linux, it
might make the difference between an "I'm glad I reported that" vs.
a "Screw them, I'm not reporting anything else in the future."

Thanks,
Paul.
--

> ---
>  drivers/mmc/host/mmci.c |    6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
> index 2303a16..efc822d 100644
> --- a/drivers/mmc/host/mmci.c
> +++ b/drivers/mmc/host/mmci.c
> @@ -1241,6 +1241,12 @@ static void mmci_dt_populate_generic_pdata(struct device_node *np,
>                pr_warn("%s: Unsupported bus width\n", np->full_name);
>        }
>  }
> +#else
> +static void mmci_dt_populate_generic_pdata(struct device_node *np,
> +                                       struct mmci_platform_data *pdata)
> +{
> +       return;
> +}
>  #endif
>
>  static int __devinit mmci_probe(struct amba_device *dev,
> --
> 1.7.9.5
> --
> To unsubscribe from this list: send the line "unsubscribe linux-next" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
@ 2012-05-08 23:58                                       ` Paul Gortmaker
  0 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2012-05-08 23:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, May 8, 2012 at 8:59 AM, Lee Jones <lee.jones@linaro.org> wrote:
> Here you go Chris.
>
> From: Lee Jones <lee.jones@linaro.org>
> Date: Tue, 8 May 2012 13:40:02 +0100
> Subject: [PATCH] MMC: mmci: Fix compiler error when CONFIG_OF is not set
>
> error: implicit declaration of function 'mmci_dt_populate_generic_pdata'
>
> This is due to the '#if CONFIG_OF' guards placed around
> mmci_dt_populate_generic_pdata(), but not around the call to it. We
> repair this by inserting a stub which elegantly returns when CONFIG_OF
> is not set.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Please if possible, do not neglect to add the Reported-by: line when
appropriate.  I've been at this long enough that it really won't change
my life any if it is there or not there, but for someone new to linux, it
might make the difference between an "I'm glad I reported that" vs.
a "Screw them, I'm not reporting anything else in the future."

Thanks,
Paul.
--

> ---
> ?drivers/mmc/host/mmci.c | ? ?6 ++++++
> ?1 file changed, 6 insertions(+)
>
> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
> index 2303a16..efc822d 100644
> --- a/drivers/mmc/host/mmci.c
> +++ b/drivers/mmc/host/mmci.c
> @@ -1241,6 +1241,12 @@ static void mmci_dt_populate_generic_pdata(struct device_node *np,
> ? ? ? ? ? ? ? ?pr_warn("%s: Unsupported bus width\n", np->full_name);
> ? ? ? ?}
> ?}
> +#else
> +static void mmci_dt_populate_generic_pdata(struct device_node *np,
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? struct mmci_platform_data *pdata)
> +{
> + ? ? ? return;
> +}
> ?#endif
>
> ?static int __devinit mmci_probe(struct amba_device *dev,
> --
> 1.7.9.5
> --
> To unsubscribe from this list: send the line "unsubscribe linux-next" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-05-08 23:58                                       ` Paul Gortmaker
@ 2012-05-09  0:29                                         ` Chris Ball
  -1 siblings, 0 replies; 82+ messages in thread
From: Chris Ball @ 2012-05-09  0:29 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: Lee Jones, Russell King - ARM Linux, linus.walleij, arnd,
	Linus Walleij, grant.likely, linux-arm-kernel, linux-next

Hi Paul,

On Tue, May 08 2012, Paul Gortmaker wrote:
> On Tue, May 8, 2012 at 8:59 AM, Lee Jones <lee.jones@linaro.org> wrote:
>> Here you go Chris.
>>
>> From: Lee Jones <lee.jones@linaro.org>
>> Date: Tue, 8 May 2012 13:40:02 +0100
>> Subject: [PATCH] MMC: mmci: Fix compiler error when CONFIG_OF is not set
>>
>> error: implicit declaration of function 'mmci_dt_populate_generic_pdata'
>>
>> This is due to the '#if CONFIG_OF' guards placed around
>> mmci_dt_populate_generic_pdata(), but not around the call to it. We
>> repair this by inserting a stub which elegantly returns when CONFIG_OF
>> is not set.
>>
>> Signed-off-by: Lee Jones <lee.jones@linaro.org>
>
> Please if possible, do not neglect to add the Reported-by: line when
> appropriate.  I've been at this long enough that it really won't change
> my life any if it is there or not there, but for someone new to linux, it
> might make the difference between an "I'm glad I reported that" vs.
> a "Screw them, I'm not reporting anything else in the future."

Agreed -- I added a Reported-by line when I applied the patch:

http://git.kernel.org/?p=linux/kernel/git/cjb/mmc.git;a=commit;h=c0a120a4bc68f5dc5f5238e76013cc18bac0ffed

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
@ 2012-05-09  0:29                                         ` Chris Ball
  0 siblings, 0 replies; 82+ messages in thread
From: Chris Ball @ 2012-05-09  0:29 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Paul,

On Tue, May 08 2012, Paul Gortmaker wrote:
> On Tue, May 8, 2012 at 8:59 AM, Lee Jones <lee.jones@linaro.org> wrote:
>> Here you go Chris.
>>
>> From: Lee Jones <lee.jones@linaro.org>
>> Date: Tue, 8 May 2012 13:40:02 +0100
>> Subject: [PATCH] MMC: mmci: Fix compiler error when CONFIG_OF is not set
>>
>> error: implicit declaration of function 'mmci_dt_populate_generic_pdata'
>>
>> This is due to the '#if CONFIG_OF' guards placed around
>> mmci_dt_populate_generic_pdata(), but not around the call to it. We
>> repair this by inserting a stub which elegantly returns when CONFIG_OF
>> is not set.
>>
>> Signed-off-by: Lee Jones <lee.jones@linaro.org>
>
> Please if possible, do not neglect to add the Reported-by: line when
> appropriate.  I've been at this long enough that it really won't change
> my life any if it is there or not there, but for someone new to linux, it
> might make the difference between an "I'm glad I reported that" vs.
> a "Screw them, I'm not reporting anything else in the future."

Agreed -- I added a Reported-by line when I applied the patch:

http://git.kernel.org/?p=linux/kernel/git/cjb/mmc.git;a=commit;h=c0a120a4bc68f5dc5f5238e76013cc18bac0ffed

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* Re: [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-05-09  0:29                                         ` Chris Ball
@ 2012-05-09  0:52                                           ` Paul Gortmaker
  -1 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2012-05-09  0:52 UTC (permalink / raw)
  To: Chris Ball
  Cc: Lee Jones, Russell King - ARM Linux, linus.walleij, arnd,
	Linus Walleij, grant.likely, linux-arm-kernel, linux-next

[Re: [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500] On 08/05/2012 (Tue 20:29) Chris Ball wrote:

> Hi Paul,
> 
> On Tue, May 08 2012, Paul Gortmaker wrote:
> > On Tue, May 8, 2012 at 8:59 AM, Lee Jones <lee.jones@linaro.org> wrote:
> >> Here you go Chris.
> >>
> >> From: Lee Jones <lee.jones@linaro.org>
> >> Date: Tue, 8 May 2012 13:40:02 +0100
> >> Subject: [PATCH] MMC: mmci: Fix compiler error when CONFIG_OF is not set
> >>
> >> error: implicit declaration of function 'mmci_dt_populate_generic_pdata'
> >>
> >> This is due to the '#if CONFIG_OF' guards placed around
> >> mmci_dt_populate_generic_pdata(), but not around the call to it. We
> >> repair this by inserting a stub which elegantly returns when CONFIG_OF
> >> is not set.
> >>
> >> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> >
> > Please if possible, do not neglect to add the Reported-by: line when
> > appropriate.  I've been at this long enough that it really won't change
> > my life any if it is there or not there, but for someone new to linux, it
> > might make the difference between an "I'm glad I reported that" vs.
> > a "Screw them, I'm not reporting anything else in the future."
> 
> Agreed -- I added a Reported-by line when I applied the patch:
> 
> http://git.kernel.org/?p=linux/kernel/git/cjb/mmc.git;a=commit;h=c0a120a4bc68f5dc5f5238e76013cc18bac0ffed

Cool, thanks Chris -- you may not hear it, but I'm sure you've
implicitly helped keep people involved in the triage process.

Paul.
--

> 
> Thanks,
> 
> - Chris.
> -- 
> Chris Ball   <cjb@laptop.org>   <http://printf.net/>
> One Laptop Per Child

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
@ 2012-05-09  0:52                                           ` Paul Gortmaker
  0 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2012-05-09  0:52 UTC (permalink / raw)
  To: linux-arm-kernel

[Re: [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500] On 08/05/2012 (Tue 20:29) Chris Ball wrote:

> Hi Paul,
> 
> On Tue, May 08 2012, Paul Gortmaker wrote:
> > On Tue, May 8, 2012 at 8:59 AM, Lee Jones <lee.jones@linaro.org> wrote:
> >> Here you go Chris.
> >>
> >> From: Lee Jones <lee.jones@linaro.org>
> >> Date: Tue, 8 May 2012 13:40:02 +0100
> >> Subject: [PATCH] MMC: mmci: Fix compiler error when CONFIG_OF is not set
> >>
> >> error: implicit declaration of function 'mmci_dt_populate_generic_pdata'
> >>
> >> This is due to the '#if CONFIG_OF' guards placed around
> >> mmci_dt_populate_generic_pdata(), but not around the call to it. We
> >> repair this by inserting a stub which elegantly returns when CONFIG_OF
> >> is not set.
> >>
> >> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> >
> > Please if possible, do not neglect to add the Reported-by: line when
> > appropriate.  I've been at this long enough that it really won't change
> > my life any if it is there or not there, but for someone new to linux, it
> > might make the difference between an "I'm glad I reported that" vs.
> > a "Screw them, I'm not reporting anything else in the future."
> 
> Agreed -- I added a Reported-by line when I applied the patch:
> 
> http://git.kernel.org/?p=linux/kernel/git/cjb/mmc.git;a=commit;h=c0a120a4bc68f5dc5f5238e76013cc18bac0ffed

Cool, thanks Chris -- you may not hear it, but I'm sure you've
implicitly helped keep people involved in the triage process.

Paul.
--

> 
> Thanks,
> 
> - Chris.
> -- 
> Chris Ball   <cjb@laptop.org>   <http://printf.net/>
> One Laptop Per Child

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

* [PATCH 7/7] MMC: mmci: Add required documentation for Device Tree bindings
  2012-04-13 14:05 ` [PATCH 7/7] MMC: mmci: Add required documentation for Device Tree bindings Lee Jones
  2012-04-18 14:31   ` Pawel Moll
  2012-04-18 15:20   ` [PATCH 7/7 v2] " Lee Jones
@ 2012-05-17 21:23   ` Grant Likely
  2 siblings, 0 replies; 82+ messages in thread
From: Grant Likely @ 2012-05-17 21:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 13 Apr 2012 15:05:09 +0100, Lee Jones <lee.jones@linaro.org> wrote:
> This provides full documentation detailing each compulsory,
> optional and device (variant) specific properties available
> for use within the MMCI Device Tree.
> 
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Acked-by: Grant Likely <grant.likely@secretlab.ca>

Should be merged with the mmc driver code changes.

g.

> ---
>  Documentation/devicetree/bindings/mmc/mmci.txt |   19 +++++++++++++++++++
>  1 files changed, 19 insertions(+), 0 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/mmc/mmci.txt
> 
> diff --git a/Documentation/devicetree/bindings/mmc/mmci.txt b/Documentation/devicetree/bindings/mmc/mmci.txt
> new file mode 100644
> index 0000000..14a81d5
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mmc/mmci.txt
> @@ -0,0 +1,19 @@
> +* ARM PrimeCell MultiMedia Card Interface (MMCI) PL180/1
> +
> +The ARM PrimeCell MMCI PL180 and PL181 provides and interface for
> +reading and writing to MultiMedia and SD cards alike.
> +
> +Required properties:
> +- compatible             : contains "arm,pl18x", "arm,primecell".
> +- reg                    : contains pl18x registers and length.
> +- interrupts             : contains the device IRQ(s).
> +- arm,primecell-periphid : contains the PrimeCell Peripheral ID.
> +
> +Optional properties:
> +- wp-gpios               : contains any write protect (ro) gpios
> +- cd-gpios               : contains any card detection gpios
> +- cd-inverted            : indicates whether the cd gpio is inverted
> +- max-frequency          : contains the maximum operating frequency
> +- bus-width              : number of data lines, can be <1>, <4>, or <8>
> +- mmc-cap-mmc-highspeed  : indicates whether MMC is high speed capable
> +- mmc-cap-sd-highspeed   : indicates whether SD is high speed capable
> -- 
> 1.7.9.1
> 

-- 
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies, Ltd.

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

* [PATCH 3/7] drivers/gpio: gpio-nomadik: Apply Device Tree bindings
  2012-04-13 14:05 ` [PATCH 3/7] drivers/gpio: gpio-nomadik: Apply Device Tree bindings Lee Jones
  2012-04-16  8:40   ` Linus Walleij
@ 2012-05-17 21:33   ` Grant Likely
  2012-05-18  7:37     ` Lee Jones
  1 sibling, 1 reply; 82+ messages in thread
From: Grant Likely @ 2012-05-17 21:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 13 Apr 2012 15:05:05 +0100, Lee Jones <lee.jones@linaro.org> wrote:
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Looks pretty good to me.  A few comments below, but otherwise you can
add my:

Acked-by: Grant Likely <grant.likely@secretlab.ca>

Does this need to be merged via the arm-soc tree?

g.

> ---
>  arch/arm/boot/dts/db8500.dtsi      |   18 +++++++++++++++
>  arch/arm/boot/dts/snowball.dts     |   10 ++++----
>  arch/arm/mach-ux500/board-mop500.c |   12 ++++++++++
>  drivers/gpio/gpio-nomadik.c        |   41 +++++++++++++++++++++++++++++++++--
>  4 files changed, 73 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/db8500.dtsi b/arch/arm/boot/dts/db8500.dtsi
> index 421e15f..57d3d35 100644
> --- a/arch/arm/boot/dts/db8500.dtsi
> +++ b/arch/arm/boot/dts/db8500.dtsi
> @@ -61,6 +61,8 @@
>  			interrupts = <0 119 0x4>;
>  			supports-sleepmode;
>  			gpio-controller;
> +			#gpio-cells = <2>;
> +			gpio-bank = <0>;
>  		};
>  
>  		gpio1: gpio at 8012e080 {
> @@ -70,6 +72,8 @@
>  			interrupts = <0 120 0x4>;
>  			supports-sleepmode;
>  			gpio-controller;
> +			#gpio-cells = <2>;
> +			gpio-bank = <1>;
>  		};
>  
>  		gpio2: gpio at 8000e000 {
> @@ -79,6 +83,8 @@
>  			interrupts = <0 121 0x4>;
>  			supports-sleepmode;
>  			gpio-controller;
> +			#gpio-cells = <2>;
> +			gpio-bank = <2>;
>  		};
>  
>  		gpio3: gpio at 8000e080 {
> @@ -88,6 +94,8 @@
>  			interrupts = <0 122 0x4>;
>  			supports-sleepmode;
>  			gpio-controller;
> +			#gpio-cells = <2>;
> +			gpio-bank = <3>;
>  		};
>  
>  		gpio4: gpio at 8000e100 {
> @@ -97,6 +105,8 @@
>  			interrupts = <0 123 0x4>;
>  			supports-sleepmode;
>  			gpio-controller;
> +			#gpio-cells = <2>;
> +			gpio-bank = <4>;
>  		};
>  
>  		gpio5: gpio at 8000e180 {
> @@ -106,6 +116,8 @@
>  			interrupts = <0 124 0x4>;
>  			supports-sleepmode;
>  			gpio-controller;
> +			#gpio-cells = <2>;
> +			gpio-bank = <5>;
>  		};
>  
>  		gpio6: gpio at 8011e000 {
> @@ -115,6 +127,8 @@
>  			interrupts = <0 125 0x4>;
>  			supports-sleepmode;
>  			gpio-controller;
> +			#gpio-cells = <2>;
> +			gpio-bank = <6>;
>  		};
>  
>  		gpio7: gpio at 8011e080 {
> @@ -124,6 +138,8 @@
>  			interrupts = <0 126 0x4>;
>  			supports-sleepmode;
>  			gpio-controller;
> +			#gpio-cells = <2>;
> +			gpio-bank = <7>;
>  		};
>  
>  		gpio8: gpio at a03fe000 {
> @@ -133,6 +149,8 @@
>  			interrupts = <0 127 0x4>;
>  			supports-sleepmode;
>  			gpio-controller;
> +			#gpio-cells = <2>;
> +			gpio-bank = <8>;
>  		};
>  
>  		usb at a03e0000 {
> diff --git a/arch/arm/boot/dts/snowball.dts b/arch/arm/boot/dts/snowball.dts
> index 359c6d6..738959d 100644
> --- a/arch/arm/boot/dts/snowball.dts
> +++ b/arch/arm/boot/dts/snowball.dts
> @@ -30,35 +30,35 @@
>  			wakeup = <1>;
>  			linux,code = <2>;
>  			label = "userpb";
> -			gpios = <&gpio1 0>;
> +			gpios = <&gpio1 0 0>;
>  		};
>  		button at 2 {
>  			debounce_interval = <50>;
>  			wakeup = <1>;
>  			linux,code = <3>;
>  			label = "userpb";
> -			gpios = <&gpio4 23>;
> +			gpios = <&gpio4 23 0>;
>  		};
>  		button at 3 {
>  			debounce_interval = <50>;
>  			wakeup = <1>;
>  			linux,code = <4>;
>  			label = "userpb";
> -			gpios = <&gpio4 23>;
> +			gpios = <&gpio4 24 0>;
>  		};
>  		button at 4 {
>  			debounce_interval = <50>;
>  			wakeup = <1>;
>  			linux,code = <5>;
>  			label = "userpb";
> -			gpios = <&gpio5 1>;
> +			gpios = <&gpio5 1 0>;
>  		};
>  		button at 5 {
>  			debounce_interval = <50>;
>  			wakeup = <1>;
>  			linux,code = <6>;
>  			label = "userpb";
> -			gpios = <&gpio5 2>;
> +			gpios = <&gpio5 2 0>;
>  		};
>  	};
>  
> diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
> index 77d03c1..5064140 100644
> --- a/arch/arm/mach-ux500/board-mop500.c
> +++ b/arch/arm/mach-ux500/board-mop500.c
> @@ -746,10 +746,22 @@ MACHINE_END
>  #ifdef CONFIG_MACH_UX500_DT
>  
>  struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
> +	/* Requires DMA and call-back bindings. */
>  	OF_DEV_AUXDATA("arm,pl011", 0x80120000, "uart0", &uart0_plat),
>  	OF_DEV_AUXDATA("arm,pl011", 0x80121000, "uart1", &uart1_plat),
>  	OF_DEV_AUXDATA("arm,pl011", 0x80007000, "uart2", &uart2_plat),
> +	/* Requires DMA bindings. */
>  	OF_DEV_AUXDATA("arm,pl022", 0x80002000, "ssp0",  &ssp0_plat),
> +	/* Requires clock name bindings. */
> +	OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e000, "gpio.0", NULL),
> +	OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e080, "gpio.1", NULL),
> +	OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e000, "gpio.2", NULL),
> +	OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e080, "gpio.3", NULL),
> +	OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e100, "gpio.4", NULL),
> +	OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e180, "gpio.5", NULL),
> +	OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e000, "gpio.6", NULL),
> +	OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e080, "gpio.7", NULL),
> +	OF_DEV_AUXDATA("st,nomadik-gpio", 0xa03fe000, "gpio.8", NULL),
>  	{},
>  };
>  
> diff --git a/drivers/gpio/gpio-nomadik.c b/drivers/gpio/gpio-nomadik.c
> index 839624f..65c7e8e 100644
> --- a/drivers/gpio/gpio-nomadik.c
> +++ b/drivers/gpio/gpio-nomadik.c
> @@ -1071,6 +1071,7 @@ void nmk_gpio_read_pull(int gpio_bank, u32 *pull_up)
>  static int __devinit nmk_gpio_probe(struct platform_device *dev)
>  {
>  	struct nmk_gpio_platform_data *pdata = dev->dev.platform_data;
> +	struct device_node *np = dev->dev.of_node;
>  	struct nmk_gpio_chip *nmk_chip;
>  	struct gpio_chip *chip;
>  	struct resource *res;
> @@ -1079,8 +1080,28 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
>  	int irq;
>  	int ret;
>  
> -	if (!pdata)
> +	if (!pdata && !np) {
> +		dev_err(&dev->dev, "No platform data or device tree found\n");
>  		return -ENODEV;
> +	}
> +
> +	if (np) {
> +		pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);

devm_kzalloc()

> +		if (!pdata)
> +			return -ENOMEM;
> +
> +		if (of_get_property(np, "supports-sleepmode", NULL))
> +			pdata->supports_sleepmode = true;

I believe these properties were going to be updated to add an
"stericsson," prefix.

> +
> +		if (of_property_read_u32(np, "gpio-bank", &dev->id)) {
> +			dev_err(&dev->dev, "gpio-bank property not found\n");
> +			ret = -EINVAL;
> +			goto out_dt;
> +		}
> +
> +		pdata->first_gpio = dev->id * NMK_GPIO_PER_CHIP;
> +		pdata->num_gpio   = NMK_GPIO_PER_CHIP;
> +	}
>  
>  	res = platform_get_resource(dev, IORESOURCE_MEM, 0);
>  	if (!res) {
> @@ -1117,6 +1138,7 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
>  		ret = -ENOMEM;
>  		goto out_clk;
>  	}
> +

Nit: unrelated whitespace change.

>  	/*
>  	 * The virt address in nmk_chip->addr is in the nomadik register space,
>  	 * so we can simply convert the resource address, without remapping
> @@ -1139,6 +1161,8 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
>  	chip->dev = &dev->dev;
>  	chip->owner = THIS_MODULE;
>  
> +	chip->of_node = np;
> +
>  	ret = gpiochip_add(&nmk_chip->chip);
>  	if (ret)
>  		goto out_free;
> @@ -1146,12 +1170,13 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
>  	BUG_ON(nmk_chip->bank >= ARRAY_SIZE(nmk_gpio_chips));
>  
>  	nmk_gpio_chips[nmk_chip->bank] = nmk_chip;
> +
>  	platform_set_drvdata(dev, nmk_chip);
>  
>  	nmk_gpio_init_irq(nmk_chip);
>  
> -	dev_info(&dev->dev, "at address %p\n",
> -		 nmk_chip->addr);
> +	dev_info(&dev->dev, "at address %p\n", nmk_chip->addr);
> +

Nit: unrelated change

>  	return 0;
>  
>  out_free:
> @@ -1164,13 +1189,23 @@ out_release:
>  out:
>  	dev_err(&dev->dev, "Failure %i for GPIO %i-%i\n", ret,
>  		  pdata->first_gpio, pdata->first_gpio+31);
> +out_dt:
> +	if (np)
> +		kfree(pdata);
> +
>  	return ret;
>  }
>  
> +static const struct of_device_id nmk_gpio_match[] = {
> +	{ .compatible = "st,nomadik-gpio", },
> +	{}
> +};
> +
>  static struct platform_driver nmk_gpio_driver = {
>  	.driver = {
>  		.owner = THIS_MODULE,
>  		.name = "gpio",
> +		.of_match_table = nmk_gpio_match,
>  	},
>  	.probe = nmk_gpio_probe,
>  };
> -- 
> 1.7.9.1
> 

-- 
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies, Ltd.

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

* [PATCH 3/7] drivers/gpio: gpio-nomadik: Apply Device Tree bindings
  2012-05-17 21:33   ` Grant Likely
@ 2012-05-18  7:37     ` Lee Jones
  0 siblings, 0 replies; 82+ messages in thread
From: Lee Jones @ 2012-05-18  7:37 UTC (permalink / raw)
  To: linux-arm-kernel

On 17/05/12 22:33, Grant Likely wrote:
> On Fri, 13 Apr 2012 15:05:05 +0100, Lee Jones<lee.jones@linaro.org>  wrote:
>> Signed-off-by: Lee Jones<lee.jones@linaro.org>
>
> Looks pretty good to me.  A few comments below, but otherwise you can
> add my:
>
> Acked-by: Grant Likely<grant.likely@secretlab.ca>
>
> Does this need to be merged via the arm-soc tree?

It's already been merged.

>> +	if (np) {
>> +		pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
>
> devm_kzalloc()

Yep, I can do that. I'll submit a follow-up patch.

>> +		if (!pdata)
>> +			return -ENOMEM;
>> +
>> +		if (of_get_property(np, "supports-sleepmode", NULL))
>> +			pdata->supports_sleepmode = true;
>
> I believe these properties were going to be updated to add an
> "stericsson," prefix.

Yes, I made that change. Odd that it didn't make it.

I'll make the change.

>> +
>> +		if (of_property_read_u32(np, "gpio-bank",&dev->id)) {
>> +			dev_err(&dev->dev, "gpio-bank property not found\n");
>> +			ret = -EINVAL;
>> +			goto out_dt;
>> +		}
>> +
>> +		pdata->first_gpio = dev->id * NMK_GPIO_PER_CHIP;
>> +		pdata->num_gpio   = NMK_GPIO_PER_CHIP;
>> +	}
>>
>>   	res = platform_get_resource(dev, IORESOURCE_MEM, 0);
>>   	if (!res) {
>> @@ -1117,6 +1138,7 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
>>   		ret = -ENOMEM;
>>   		goto out_clk;
>>   	}
>> +
>
> Nit: unrelated whitespace change.

Okay, but it looks better now though, so I'll leave it if that's okay?

>>   	/*
>>   	 * The virt address in nmk_chip->addr is in the nomadik register space,
>>   	 * so we can simply convert the resource address, without remapping
>> @@ -1139,6 +1161,8 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
>>   	chip->dev =&dev->dev;
>>   	chip->owner = THIS_MODULE;
>>
>> +	chip->of_node = np;
>> +
>>   	ret = gpiochip_add(&nmk_chip->chip);
>>   	if (ret)
>>   		goto out_free;
>> @@ -1146,12 +1170,13 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
>>   	BUG_ON(nmk_chip->bank>= ARRAY_SIZE(nmk_gpio_chips));
>>
>>   	nmk_gpio_chips[nmk_chip->bank] = nmk_chip;
>> +
>>   	platform_set_drvdata(dev, nmk_chip);
>>
>>   	nmk_gpio_init_irq(nmk_chip);
>>
>> -	dev_info(&dev->dev, "at address %p\n",
>> -		 nmk_chip->addr);
>> +	dev_info(&dev->dev, "at address %p\n", nmk_chip->addr);
>> +
>
> Nit: unrelated change

As above.

>>   	return 0;
>>
>>   out_free:
>> @@ -1164,13 +1189,23 @@ out_release:
>>   out:
>>   	dev_err(&dev->dev, "Failure %i for GPIO %i-%i\n", ret,
>>   		  pdata->first_gpio, pdata->first_gpio+31);
>> +out_dt:
>> +	if (np)
>> +		kfree(pdata);
>> +
>>   	return ret;
>>   }
>>
>> +static const struct of_device_id nmk_gpio_match[] = {
>> +	{ .compatible = "st,nomadik-gpio", },
>> +	{}
>> +};
>> +
>>   static struct platform_driver nmk_gpio_driver = {
>>   	.driver = {
>>   		.owner = THIS_MODULE,
>>   		.name = "gpio",
>> +		.of_match_table = nmk_gpio_match,
>>   	},
>>   	.probe = nmk_gpio_probe,
>>   };
>> --
>> 1.7.9.1
>>
>


-- 
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

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-04-16  9:26     ` [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500 Lee Jones
  2012-04-25 18:57       ` Russell King - ARM Linux
@ 2012-06-04 10:14       ` Russell King - ARM Linux
  2012-06-05 10:47         ` Lee Jones
  1 sibling, 1 reply; 82+ messages in thread
From: Russell King - ARM Linux @ 2012-06-04 10:14 UTC (permalink / raw)
  To: linux-arm-kernel

So why is this buggy patch now merged in the mainline kernel?

On Mon, Apr 16, 2012 at 10:26:08AM +0100, Lee Jones wrote:
> From: Lee Jones <lee.jones@linaro.org>
> Date: Mon, 16 Apr 2012 10:18:43 +0100
> Subject: [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500 variants
> 
> Provide a means to collect attributes specific to ST-Ericsson's
> ux500 variant series. This patch registers itself as the AMBA
> driver to be called during the probe process. Once all
> attributes and ux500 specifics are are collected the normal
> mmci core probe is called.
> 
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/mmc/host/mmci.c |   58 +++++++++++++++++++++++++++++++++++++++++++---
>  1 files changed, 54 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
> index 032b847..5a7da17 100644
> --- a/drivers/mmc/host/mmci.c
> +++ b/drivers/mmc/host/mmci.c
> @@ -15,6 +15,7 @@
>  #include <linux/device.h>
>  #include <linux/interrupt.h>
>  #include <linux/kernel.h>
> +#include <linux/slab.h>
>  #include <linux/delay.h>
>  #include <linux/err.h>
>  #include <linux/highmem.h>
> @@ -1196,21 +1197,70 @@ static const struct mmc_host_ops mmci_ops = {
>  	.get_cd		= mmci_get_cd,
>  };
>  
> +#ifdef CONFIG_OF
> +static void mmci_dt_populate_generic_pdata(struct device_node *np,
> +					struct mmci_platform_data *pdata)
> +{
> +	int bus_width = 0;
> +
> +	of_property_read_u32(np, "wp-gpios", &pdata->gpio_wp);
> +	if (!pdata->gpio_wp)
> +		pdata->gpio_wp = -1;
> +
> +	of_property_read_u32(np, "cd-gpios", &pdata->gpio_cd);
> +	if (!pdata->gpio_cd)
> +		pdata->gpio_cd = -1;
> +
> +	if (of_get_property(np, "cd-inverted", NULL))
> +		pdata->cd_invert = true;
> +	else
> +		pdata->cd_invert = false;
> +
> +	of_property_read_u32(np, "max-frequency", &pdata->f_max);
> +	if (!pdata->f_max)
> +		pr_warn("%s has no 'max-frequency' property\n", np->full_name);
> +
> +	if (of_get_property(np, "mmc-cap-mmc-highspeed", NULL))
> +		pdata->capabilities |= MMC_CAP_MMC_HIGHSPEED;
> +	if (of_get_property(np, "mmc-cap-sd-highspeed", NULL))
> +		pdata->capabilities |= MMC_CAP_SD_HIGHSPEED;
> +
> +	of_property_read_u32(np, "bus-width", &bus_width);
> +	switch (bus_width) {
> +	case 0 :
> +		/* No bus-width supplied. */
> +		break;
> +	case 4 :
> +		pdata->capabilities |= MMC_CAP_4_BIT_DATA;
> +		break;
> +	case 8 :
> +		pdata->capabilities |= MMC_CAP_8_BIT_DATA;
> +		break;
> +	default :
> +		pr_warn("%s: Unsupported bus width\n", np->full_name);
> +	}
> +}
> +#endif
> +
>  static int __devinit mmci_probe(struct amba_device *dev,
>  	const struct amba_id *id)
>  {
>  	struct mmci_platform_data *plat = dev->dev.platform_data;
> +	struct device_node *np = dev->dev.of_node;
>  	struct variant_data *variant = id->data;
>  	struct mmci_host *host;
>  	struct mmc_host *mmc;
>  	int ret;
>  
> -	/* must have platform data */
> -	if (!plat) {
> -		ret = -EINVAL;
> -		goto out;
> +	/* Must have platform data or Device Tree. */
> +	if (!plat && !np) {
> +		dev_err(&dev->dev, "No plat data or DT found\n");
> +		return -EINVAL;
>  	}
>  
> +	if (np)
> +		mmci_dt_populate_generic_pdata(np, plat);
> +
>  	ret = amba_request_regions(dev, DRIVER_NAME);
>  	if (ret)
>  		goto out;
> -- 
> 1.7.9.1
> 

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-06-04 10:14       ` Russell King - ARM Linux
@ 2012-06-05 10:47         ` Lee Jones
  2012-06-05 10:52           ` Russell King - ARM Linux
  0 siblings, 1 reply; 82+ messages in thread
From: Lee Jones @ 2012-06-05 10:47 UTC (permalink / raw)
  To: linux-arm-kernel

On 04/06/12 11:14, Russell King - ARM Linux wrote:
> So why is this buggy patch now merged in the mainline kernel?

I guess Chris took it because you said it was fine?

On 03/05/12 17:30, Russell King - ARM Linux wrote:
> On Thu, May 03, 2012 at 04:30:48PM +0100, Lee Jones wrote:
>> From: Lee Jones<lee.jones@linaro.org>
>> Date: Mon, 16 Apr 2012 10:18:43 +0100
>> Subject: [PATCH 01/19] MMC: mmci: Enable Device Tree support for ux500
>>   variants
>>
>> Provide a means to collect attributes specific to ST-Ericsson's
>> ux500 variant series. This patch registers itself as the AMBA
>> driver to be called during the probe process. Once all
>> attributes and ux500 specifics are are collected the normal
>> mmci core probe is called.
>>
>> Acked-by: Linus Walleij<linus.walleij@linaro.org>
>> Acked-by: Arnd Bergmann<arnd@arndb.de>
>> Signed-off-by: Lee Jones<lee.jones@linaro.org>
> 
> This looks fine now, thanks.

-- 
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

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-06-05 10:47         ` Lee Jones
@ 2012-06-05 10:52           ` Russell King - ARM Linux
  2012-06-05 12:59             ` Linus Walleij
  0 siblings, 1 reply; 82+ messages in thread
From: Russell King - ARM Linux @ 2012-06-05 10:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jun 05, 2012 at 11:47:51AM +0100, Lee Jones wrote:
> On 04/06/12 11:14, Russell King - ARM Linux wrote:
> > So why is this buggy patch now merged in the mainline kernel?
> 
> I guess Chris took it because you said it was fine?

Err, no.  If you re-read the thread, you'll see that I said your
subsequent patch posted on Thu, 03 May 2012 16:30:48 +0100 with
the devm_kzalloc() was fine.

The one which was merged is the one without the devm_kzalloc() which
is _not_ fine, because it's an oops waiting to happen - the one I
replied yesterday to without the devm_kzalloc().

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-06-05 10:52           ` Russell King - ARM Linux
@ 2012-06-05 12:59             ` Linus Walleij
  2012-06-06  8:09               ` Lee Jones
  2012-06-11 10:03               ` Lee Jones
  0 siblings, 2 replies; 82+ messages in thread
From: Linus Walleij @ 2012-06-05 12:59 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jun 5, 2012 at 12:52 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Tue, Jun 05, 2012 at 11:47:51AM +0100, Lee Jones wrote:
>> On 04/06/12 11:14, Russell King - ARM Linux wrote:
>> > So why is this buggy patch now merged in the mainline kernel?
>>
>> I guess Chris took it because you said it was fine?
>
> Err, no. ?If you re-read the thread, you'll see that I said your
> subsequent patch posted on Thu, 03 May 2012 16:30:48 +0100 with
> the devm_kzalloc() was fine.

Lee can you provide an incremental fixup that makes the current
code textually equivalent to what Russell ACKed (devm_kzalloc()),
and funnel to Chris for the -rc:s ASAP?

Yours,
Linus Walleij

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-06-05 12:59             ` Linus Walleij
@ 2012-06-06  8:09               ` Lee Jones
  2012-06-11 10:03               ` Lee Jones
  1 sibling, 0 replies; 82+ messages in thread
From: Lee Jones @ 2012-06-06  8:09 UTC (permalink / raw)
  To: linux-arm-kernel

>
> > >> > So why is this buggy patch now merged in the mainline kernel?
> > >>
> > >> I guess Chris took it because you said it was fine?
> > >
> > > Err, no.  If you re-read the thread, you'll see that I said your
> > > subsequent patch posted on Thu, 03 May 2012 16:30:48 +0100 with
> > > the devm_kzalloc() was fine.
>

Ah, so the wrong patch was merged?


> > Lee can you provide an incremental fixup that makes the current
>
> > code textually equivalent to what Russell ACKed (devm_kzalloc()),
> > and funnel to Chris for the -rc:s ASAP?
>

It turns out that there is no free internet in my hotel, so it will have to
wait until I'm back from my holiday (Monday).

Kind regards,
Lee

-- 
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



-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120606/e6cebc03/attachment-0001.html>

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-06-05 12:59             ` Linus Walleij
  2012-06-06  8:09               ` Lee Jones
@ 2012-06-11 10:03               ` Lee Jones
  2012-06-11 10:34                 ` Linus Walleij
  1 sibling, 1 reply; 82+ messages in thread
From: Lee Jones @ 2012-06-11 10:03 UTC (permalink / raw)
  To: linux-arm-kernel

> Lee can you provide an incremental fixup that makes the current
> code textually equivalent to what Russell ACKed (devm_kzalloc()),
> and funnel to Chris for the -rc:s ASAP?

Your wish is my command:

From: Lee Jones <lee.jones@linaro.org>
Date: Mon, 11 Jun 2012 10:41:00 +0100
Subject: [PATCH] mmc: mmci: Allocate platform memory during Device Tree boot

When booting with Device Tree enabled, platform specific information
is gathered by parsing the DT binary. Platform data is subsequently
populated with the result. The memory required for this is not
automatically allocated during Device Tree boot, so we'll do it here
instead.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mmc/host/mmci.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index f0fcce4..0045ee0 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -1276,6 +1276,12 @@ static int __devinit mmci_probe(struct amba_device *dev,
 		return -EINVAL;
 	}
 
+	if (!plat) {
+		plat = devm_kzalloc(&dev->dev, sizeof(*plat), GFP_KERNEL);
+		if (!plat)
+			return -ENOMEM;
+	}
+
 	if (np)
 		mmci_dt_populate_generic_pdata(np, plat);
 
-- 
1.7.9.5

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

* [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500
  2012-06-11 10:03               ` Lee Jones
@ 2012-06-11 10:34                 ` Linus Walleij
  0 siblings, 0 replies; 82+ messages in thread
From: Linus Walleij @ 2012-06-11 10:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jun 11, 2012 at 12:03 PM, Lee Jones <lee.jones@linaro.org> wrote:

> From: Lee Jones <lee.jones@linaro.org>
> Date: Mon, 11 Jun 2012 10:41:00 +0100
> Subject: [PATCH] mmc: mmci: Allocate platform memory during Device Tree boot
>
> When booting with Device Tree enabled, platform specific information
> is gathered by parsing the DT binary. Platform data is subsequently
> populated with the result. The memory required for this is not
> automatically allocated during Device Tree boot, so we'll do it here
> instead.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Pls put this in Russell's patch tracker.

Yours,
Linus Walleij

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

* [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants
  2012-04-09 14:27         ` Arnd Bergmann
@ 2012-04-09 14:41           ` Chris Ball
  0 siblings, 0 replies; 82+ messages in thread
From: Chris Ball @ 2012-04-09 14:41 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Mon, Apr 09 2012, Arnd Bergmann wrote:
> Agreed.
>
> Should we use max-frequency or clock-frequency for sdhci though? It looks
> like this is both the maximum frequency that it can use and the base frequency
> that the actual clock rate is derived from (can be a fraction).

This is ultimately setting the "f_max" ("maximum operating frequency")
field in the MMC core, so I'm happy naming the property "max-frequency".

It's true that this doesn't explain the derivation to clock rate --
but we weren't doing that before the DT binding either, and I think that
having a discrepancy between the DT property and the core's naming would
lead to confusion/mistakes.

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants
  2012-04-06  4:14       ` Grant Likely
@ 2012-04-09 14:27         ` Arnd Bergmann
  2012-04-09 14:41           ` Chris Ball
  0 siblings, 1 reply; 82+ messages in thread
From: Arnd Bergmann @ 2012-04-09 14:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 06 April 2012, Grant Likely wrote:
> Yes, "clock-frequency" already has established usage as an exact clock
> specification.  If it is a maximum as you say then something like
> "max-frequency" makes more sense.
> 
> Someone was working on a common MMC DT binding.  Really all of the MMC
> drivers should use the same binding for the common bits.

Agreed.

Should we use max-frequency or clock-frequency for sdhci though? It looks
like this is both the maximum frequency that it can use and the base frequency
that the actual clock rate is derived from (can be a fraction).

	Arnd

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

* [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants
  2012-04-05 13:45     ` Lee Jones
@ 2012-04-06  4:14       ` Grant Likely
  2012-04-09 14:27         ` Arnd Bergmann
  0 siblings, 1 reply; 82+ messages in thread
From: Grant Likely @ 2012-04-06  4:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 05 Apr 2012 14:45:02 +0100, Lee Jones <lee.jones@linaro.org> wrote:
> On 05/04/12 13:36, Russell King - ARM Linux wrote:
> > On Thu, Apr 05, 2012 at 10:55:47AM +0100, Lee Jones wrote:
> >> +	of_property_read_u32(np, "clock-frequency",&pdata->f_max);
> >> +	if (!pdata->f_max)
> >> +		pr_warn("%s has no 'clock-frequency' property\n", np->full_name);
> >
> > To be anal about this (which is what we should be about DT bindings)
> > this is not a 'clock frequency' but a maximum clock frequency for the
> > bus.  Or to put it another way, a clock frequency limit.
> >
> > A 'clock-frequency' property suggests (at least to me) that it's
> > specifying the rate of the MCLK signal, which is not what it's doing.
> 
> Sounds sensible.
> 
> I initially had it as 'f-max', but was told to change it to 
> 'clock-frequency'. I'm happy to take other suggestions however.

Yes, "clock-frequency" already has established usage as an exact clock
specification.  If it is a maximum as you say then something like
"max-frequency" makes more sense.

Someone was working on a common MMC DT binding.  Really all of the MMC
drivers should use the same binding for the common bits.

g.

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

* [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants
  2012-04-05 12:36   ` Russell King - ARM Linux
@ 2012-04-05 13:45     ` Lee Jones
  2012-04-06  4:14       ` Grant Likely
  0 siblings, 1 reply; 82+ messages in thread
From: Lee Jones @ 2012-04-05 13:45 UTC (permalink / raw)
  To: linux-arm-kernel

On 05/04/12 13:36, Russell King - ARM Linux wrote:
> On Thu, Apr 05, 2012 at 10:55:47AM +0100, Lee Jones wrote:
>> +	of_property_read_u32(np, "clock-frequency",&pdata->f_max);
>> +	if (!pdata->f_max)
>> +		pr_warn("%s has no 'clock-frequency' property\n", np->full_name);
>
> To be anal about this (which is what we should be about DT bindings)
> this is not a 'clock frequency' but a maximum clock frequency for the
> bus.  Or to put it another way, a clock frequency limit.
>
> A 'clock-frequency' property suggests (at least to me) that it's
> specifying the rate of the MCLK signal, which is not what it's doing.

Sounds sensible.

I initially had it as 'f-max', but was told to change it to 
'clock-frequency'. I'm happy to take other suggestions however.

Kind regards,
Lee

-- 
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

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

* [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants
  2012-04-05  9:55 ` [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants Lee Jones
@ 2012-04-05 12:36   ` Russell King - ARM Linux
  2012-04-05 13:45     ` Lee Jones
  0 siblings, 1 reply; 82+ messages in thread
From: Russell King - ARM Linux @ 2012-04-05 12:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Apr 05, 2012 at 10:55:47AM +0100, Lee Jones wrote:
> +	of_property_read_u32(np, "clock-frequency", &pdata->f_max);
> +	if (!pdata->f_max)
> +		pr_warn("%s has no 'clock-frequency' property\n", np->full_name);

To be anal about this (which is what we should be about DT bindings)
this is not a 'clock frequency' but a maximum clock frequency for the
bus.  Or to put it another way, a clock frequency limit.

A 'clock-frequency' property suggests (at least to me) that it's
specifying the rate of the MCLK signal, which is not what it's doing.

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

* [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants
  2012-04-05 10:25 [PATCH 1/7] ARM: ux500: New DT:ed snowball_platform_devs for one-by-one device enablement Lee Jones
@ 2012-04-05 10:25 ` Lee Jones
  0 siblings, 0 replies; 82+ messages in thread
From: Lee Jones @ 2012-04-05 10:25 UTC (permalink / raw)
  To: linux-arm-kernel

Provide a means to collect attributes specific to ST-Ericsson's
ux500 variant series. This patch registers itself as the AMBA
driver to be called during the probe process. Once all
attributes and ux500 specifics are are collected the normal
mmci core probe is called.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/snowball.dts         |   21 ++++++++++--
 arch/arm/mach-ux500/board-mop500-sdi.c |    4 +-
 arch/arm/mach-ux500/board-mop500.c     |    3 +-
 arch/arm/mach-ux500/board-mop500.h     |    4 ++
 drivers/mmc/host/mmci.c                |   58 +++++++++++++++++++++++++++++--
 5 files changed, 80 insertions(+), 10 deletions(-)

diff --git a/arch/arm/boot/dts/snowball.dts b/arch/arm/boot/dts/snowball.dts
index 0cec47b..8e2a609 100644
--- a/arch/arm/boot/dts/snowball.dts
+++ b/arch/arm/boot/dts/snowball.dts
@@ -87,13 +87,28 @@
 			};
 		};
 
+		// External Micro SD slot
 		sdi at 80126000 {
-			status = "enabled";
-			cd-gpios = <&gpio6 26>;
+			arm,primecell-periphid = <0x10480180>;
+			clock-frequency = <50000000>;
+			bus-width = <8>;
+			mmc-cap-mmc-highspeed;
+
+			#gpio-cells = <1>;
+			cd-gpios  = <&gpio6 26>; // 218
+			cd-inverted;
+
+			status = "okay";
 		};
 
+		// On-board eMMC
 		sdi at 80114000 {
-			status = "enabled";
+			arm,primecell-periphid = <0x10480180>;
+		        clock-frequency = <50000000>;
+			bus-width = <8>;
+			mmc-cap-mmc-highspeed;
+
+			status = "okay";
 		};
 
 		uart at 80120000 {
diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c
index 920251c..18ff781 100644
--- a/arch/arm/mach-ux500/board-mop500-sdi.c
+++ b/arch/arm/mach-ux500/board-mop500-sdi.c
@@ -80,7 +80,7 @@ static struct stedma40_chan_cfg mop500_sdi0_dma_cfg_tx = {
 };
 #endif
 
-static struct mmci_platform_data mop500_sdi0_data = {
+struct mmci_platform_data mop500_sdi0_data = {
 	.ios_handler	= mop500_sdi0_ios_handler,
 	.ocr_mask	= MMC_VDD_29_30,
 	.f_max		= 50000000,
@@ -227,7 +227,7 @@ static struct stedma40_chan_cfg mop500_sdi4_dma_cfg_tx = {
 };
 #endif
 
-static struct mmci_platform_data mop500_sdi4_data = {
+struct mmci_platform_data mop500_sdi4_data = {
 	.ocr_mask	= MMC_VDD_29_30,
 	.f_max		= 50000000,
 	.capabilities	= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA |
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index a47d6bd..d2c3a5c 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -759,6 +759,8 @@ struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
 	OF_DEV_AUXDATA("arm,pl011", 0x80007000, "uart2", &uart2_plat),
 	/* Requires DMA bindings. */
 	OF_DEV_AUXDATA("arm,pl022", 0x80002000, "ssp0",  &ssp0_plat),
+	OF_DEV_AUXDATA("arm,pl18x", 0x80126000, "sdi0",  &mop500_sdi0_data),
+	OF_DEV_AUXDATA("arm,pl18x", 0x80114000, "sdi4",  &mop500_sdi4_data),
 	/* Requires clock name bindings. */
 	OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8012e000, "gpio.0", NULL),
 	OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8012e080, "gpio.1", NULL),
@@ -815,7 +817,6 @@ static void __init u8500_init_machine(void)
 		platform_add_devices(snowball_of_platform_devs,
 				ARRAY_SIZE(snowball_of_platform_devs));
 
-		snowball_sdi_init(parent);
 	} else if (of_machine_is_compatible("st-ericsson,hrefv60+")) {
 		/*
 		 * The HREFv60 board removed a GPIO expander and routed
diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h
index fdcfa87..384baf7 100644
--- a/arch/arm/mach-ux500/board-mop500.h
+++ b/arch/arm/mach-ux500/board-mop500.h
@@ -7,6 +7,8 @@
 #ifndef __BOARD_MOP500_H
 #define __BOARD_MOP500_H
 
+#include <linux/amba/mmci.h>
+
 /* Snowball specific GPIO assignments, this board has no GPIO expander */
 #define SNOWBALL_ACCEL_INT1_GPIO	163
 #define SNOWBALL_ACCEL_INT2_GPIO	164
@@ -74,6 +76,8 @@
 #define SNOWBALL_EN_3V3_ETH_GPIO	MOP500_AB8500_PIN_GPIO(26)	/* GPIO26 */
 
 struct i2c_board_info;
+extern struct mmci_platform_data mop500_sdi0_data;
+extern struct mmci_platform_data mop500_sdi4_data;
 
 extern void mop500_sdi_init(struct device *parent);
 extern void snowball_sdi_init(struct device *parent);
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 032b847..8538d55 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -15,6 +15,7 @@
 #include <linux/device.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/highmem.h>
@@ -1196,21 +1197,70 @@ static const struct mmc_host_ops mmci_ops = {
 	.get_cd		= mmci_get_cd,
 };
 
+#ifdef CONFIG_OF
+static void mmci_dt_populate_generic_pdata(struct device_node *np,
+					struct mmci_platform_data *pdata)
+{
+	int bus_width = 0;
+
+	of_property_read_u32(np, "wp-gpios", &pdata->gpio_wp);
+	if (!pdata->gpio_wp)
+		pdata->gpio_wp = -1;
+
+	of_property_read_u32(np, "cd-gpios", &pdata->gpio_cd);
+	if (!pdata->gpio_cd)
+		pdata->gpio_cd = -1;
+
+	if (of_get_property(np, "cd-inverted", NULL))
+		pdata->cd_invert = true;
+	else
+		pdata->cd_invert = false;
+
+	of_property_read_u32(np, "clock-frequency", &pdata->f_max);
+	if (!pdata->f_max)
+		pr_warn("%s has no 'clock-frequency' property\n", np->full_name);
+
+	if (of_get_property(np, "mmc-cap-mmc-highspeed", NULL))
+		pdata->capabilities |= MMC_CAP_MMC_HIGHSPEED;
+	if (of_get_property(np, "mmc-cap-sd-highspeed", NULL))
+		pdata->capabilities |= MMC_CAP_SD_HIGHSPEED;
+
+	of_property_read_u32(np, "bus-width", &bus_width);
+	switch (bus_width) {
+	case 0 :
+		/* No bus-width supplied. */
+		break;
+	case 4 :
+		pdata->capabilities |= MMC_CAP_4_BIT_DATA;
+		break;
+	case 8 :
+		pdata->capabilities |= MMC_CAP_8_BIT_DATA;
+		break;
+	default :
+		pr_warn("%s: Unsupported bus width\n", np->full_name);
+	}
+}
+#endif
+
 static int __devinit mmci_probe(struct amba_device *dev,
 	const struct amba_id *id)
 {
 	struct mmci_platform_data *plat = dev->dev.platform_data;
+	struct device_node *np = dev->dev.of_node;
 	struct variant_data *variant = id->data;
 	struct mmci_host *host;
 	struct mmc_host *mmc;
 	int ret;
 
-	/* must have platform data */
-	if (!plat) {
-		ret = -EINVAL;
-		goto out;
+	/* Must have platform data or Device Tree. */
+	if (!plat && !np) {
+		dev_err(&dev->dev, "No plat data or DT found\n");
+		return -EINVAL;
 	}
 
+	if (np)
+		mmci_dt_populate_generic_pdata(np, plat);
+
 	ret = amba_request_regions(dev, DRIVER_NAME);
 	if (ret)
 		goto out;
-- 
1.7.9.1

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

* [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants
  2012-04-05  9:55 [0/7] Next round of DT enablement for ux500/Snowball Lee Jones
@ 2012-04-05  9:55 ` Lee Jones
  2012-04-05 12:36   ` Russell King - ARM Linux
  0 siblings, 1 reply; 82+ messages in thread
From: Lee Jones @ 2012-04-05  9:55 UTC (permalink / raw)
  To: linux-arm-kernel

Provide a means to collect attributes specific to ST-Ericsson's
ux500 variant series. This patch registers itself as the AMBA
driver to be called during the probe process. Once all
attributes and ux500 specifics are are collected the normal
mmci core probe is called.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/boot/dts/snowball.dts         |   21 ++++++++++--
 arch/arm/mach-ux500/board-mop500-sdi.c |    4 +-
 arch/arm/mach-ux500/board-mop500.c     |    3 +-
 arch/arm/mach-ux500/board-mop500.h     |    4 ++
 drivers/mmc/host/mmci.c                |   58 +++++++++++++++++++++++++++++--
 5 files changed, 80 insertions(+), 10 deletions(-)

diff --git a/arch/arm/boot/dts/snowball.dts b/arch/arm/boot/dts/snowball.dts
index 0cec47b..8e2a609 100644
--- a/arch/arm/boot/dts/snowball.dts
+++ b/arch/arm/boot/dts/snowball.dts
@@ -87,13 +87,28 @@
 			};
 		};
 
+		// External Micro SD slot
 		sdi at 80126000 {
-			status = "enabled";
-			cd-gpios = <&gpio6 26>;
+			arm,primecell-periphid = <0x10480180>;
+			clock-frequency = <50000000>;
+			bus-width = <8>;
+			mmc-cap-mmc-highspeed;
+
+			#gpio-cells = <1>;
+			cd-gpios  = <&gpio6 26>; // 218
+			cd-inverted;
+
+			status = "okay";
 		};
 
+		// On-board eMMC
 		sdi at 80114000 {
-			status = "enabled";
+			arm,primecell-periphid = <0x10480180>;
+		        clock-frequency = <50000000>;
+			bus-width = <8>;
+			mmc-cap-mmc-highspeed;
+
+			status = "okay";
 		};
 
 		uart at 80120000 {
diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c
index 920251c..18ff781 100644
--- a/arch/arm/mach-ux500/board-mop500-sdi.c
+++ b/arch/arm/mach-ux500/board-mop500-sdi.c
@@ -80,7 +80,7 @@ static struct stedma40_chan_cfg mop500_sdi0_dma_cfg_tx = {
 };
 #endif
 
-static struct mmci_platform_data mop500_sdi0_data = {
+struct mmci_platform_data mop500_sdi0_data = {
 	.ios_handler	= mop500_sdi0_ios_handler,
 	.ocr_mask	= MMC_VDD_29_30,
 	.f_max		= 50000000,
@@ -227,7 +227,7 @@ static struct stedma40_chan_cfg mop500_sdi4_dma_cfg_tx = {
 };
 #endif
 
-static struct mmci_platform_data mop500_sdi4_data = {
+struct mmci_platform_data mop500_sdi4_data = {
 	.ocr_mask	= MMC_VDD_29_30,
 	.f_max		= 50000000,
 	.capabilities	= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA |
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index a47d6bd..d2c3a5c 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -759,6 +759,8 @@ struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
 	OF_DEV_AUXDATA("arm,pl011", 0x80007000, "uart2", &uart2_plat),
 	/* Requires DMA bindings. */
 	OF_DEV_AUXDATA("arm,pl022", 0x80002000, "ssp0",  &ssp0_plat),
+	OF_DEV_AUXDATA("arm,pl18x", 0x80126000, "sdi0",  &mop500_sdi0_data),
+	OF_DEV_AUXDATA("arm,pl18x", 0x80114000, "sdi4",  &mop500_sdi4_data),
 	/* Requires clock name bindings. */
 	OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8012e000, "gpio.0", NULL),
 	OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8012e080, "gpio.1", NULL),
@@ -815,7 +817,6 @@ static void __init u8500_init_machine(void)
 		platform_add_devices(snowball_of_platform_devs,
 				ARRAY_SIZE(snowball_of_platform_devs));
 
-		snowball_sdi_init(parent);
 	} else if (of_machine_is_compatible("st-ericsson,hrefv60+")) {
 		/*
 		 * The HREFv60 board removed a GPIO expander and routed
diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h
index fdcfa87..384baf7 100644
--- a/arch/arm/mach-ux500/board-mop500.h
+++ b/arch/arm/mach-ux500/board-mop500.h
@@ -7,6 +7,8 @@
 #ifndef __BOARD_MOP500_H
 #define __BOARD_MOP500_H
 
+#include <linux/amba/mmci.h>
+
 /* Snowball specific GPIO assignments, this board has no GPIO expander */
 #define SNOWBALL_ACCEL_INT1_GPIO	163
 #define SNOWBALL_ACCEL_INT2_GPIO	164
@@ -74,6 +76,8 @@
 #define SNOWBALL_EN_3V3_ETH_GPIO	MOP500_AB8500_PIN_GPIO(26)	/* GPIO26 */
 
 struct i2c_board_info;
+extern struct mmci_platform_data mop500_sdi0_data;
+extern struct mmci_platform_data mop500_sdi4_data;
 
 extern void mop500_sdi_init(struct device *parent);
 extern void snowball_sdi_init(struct device *parent);
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 032b847..8538d55 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -15,6 +15,7 @@
 #include <linux/device.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/highmem.h>
@@ -1196,21 +1197,70 @@ static const struct mmc_host_ops mmci_ops = {
 	.get_cd		= mmci_get_cd,
 };
 
+#ifdef CONFIG_OF
+static void mmci_dt_populate_generic_pdata(struct device_node *np,
+					struct mmci_platform_data *pdata)
+{
+	int bus_width = 0;
+
+	of_property_read_u32(np, "wp-gpios", &pdata->gpio_wp);
+	if (!pdata->gpio_wp)
+		pdata->gpio_wp = -1;
+
+	of_property_read_u32(np, "cd-gpios", &pdata->gpio_cd);
+	if (!pdata->gpio_cd)
+		pdata->gpio_cd = -1;
+
+	if (of_get_property(np, "cd-inverted", NULL))
+		pdata->cd_invert = true;
+	else
+		pdata->cd_invert = false;
+
+	of_property_read_u32(np, "clock-frequency", &pdata->f_max);
+	if (!pdata->f_max)
+		pr_warn("%s has no 'clock-frequency' property\n", np->full_name);
+
+	if (of_get_property(np, "mmc-cap-mmc-highspeed", NULL))
+		pdata->capabilities |= MMC_CAP_MMC_HIGHSPEED;
+	if (of_get_property(np, "mmc-cap-sd-highspeed", NULL))
+		pdata->capabilities |= MMC_CAP_SD_HIGHSPEED;
+
+	of_property_read_u32(np, "bus-width", &bus_width);
+	switch (bus_width) {
+	case 0 :
+		/* No bus-width supplied. */
+		break;
+	case 4 :
+		pdata->capabilities |= MMC_CAP_4_BIT_DATA;
+		break;
+	case 8 :
+		pdata->capabilities |= MMC_CAP_8_BIT_DATA;
+		break;
+	default :
+		pr_warn("%s: Unsupported bus width\n", np->full_name);
+	}
+}
+#endif
+
 static int __devinit mmci_probe(struct amba_device *dev,
 	const struct amba_id *id)
 {
 	struct mmci_platform_data *plat = dev->dev.platform_data;
+	struct device_node *np = dev->dev.of_node;
 	struct variant_data *variant = id->data;
 	struct mmci_host *host;
 	struct mmc_host *mmc;
 	int ret;
 
-	/* must have platform data */
-	if (!plat) {
-		ret = -EINVAL;
-		goto out;
+	/* Must have platform data or Device Tree. */
+	if (!plat && !np) {
+		dev_err(&dev->dev, "No plat data or DT found\n");
+		return -EINVAL;
 	}
 
+	if (np)
+		mmci_dt_populate_generic_pdata(np, plat);
+
 	ret = amba_request_regions(dev, DRIVER_NAME);
 	if (ret)
 		goto out;
-- 
1.7.9.1

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

end of thread, other threads:[~2012-06-11 10:34 UTC | newest]

Thread overview: 82+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-13 14:05 [PATCH 0/7 v2] Next round of DT enablement for ux500/Snowball Lee Jones
2012-04-13 14:05 ` [PATCH 1/7] ARM: ux500: Rename the DT compatible entry for i2c devices on Snowball Lee Jones
2012-04-16  8:34   ` Linus Walleij
2012-04-13 14:05 ` [PATCH 2/7] ARM: ux500: Shorten Snowball's DT compatible gpio entry Lee Jones
2012-04-16  8:36   ` Linus Walleij
2012-04-16  9:00     ` Lee Jones
2012-04-13 14:05 ` [PATCH 3/7] drivers/gpio: gpio-nomadik: Apply Device Tree bindings Lee Jones
2012-04-16  8:40   ` Linus Walleij
2012-05-17 21:33   ` Grant Likely
2012-05-18  7:37     ` Lee Jones
2012-04-13 14:05 ` [PATCH 4/7] drivers/gpio: gpio-nomadik: Provide documentation for " Lee Jones
2012-04-13 14:59   ` Lee Jones
2012-04-16  8:43     ` Linus Walleij
2012-04-13 14:05 ` [PATCH 5/7] ARM: ux500: Rename gpio_keys in the Device Tree file Lee Jones
2012-04-13 14:05 ` [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants Lee Jones
2012-04-13 14:42   ` Pawel Moll
2012-04-13 14:51     ` Arnd Bergmann
2012-04-13 14:54       ` Lee Jones
2012-04-13 15:05         ` Pawel Moll
2012-04-13 15:16           ` Lee Jones
2012-04-13 15:27             ` Pawel Moll
2012-04-16  8:48   ` Linus Walleij
2012-04-16  9:06     ` Lee Jones
2012-04-16  9:18       ` Linus Walleij
2012-04-16  9:25     ` [PATCH 6.1/7] ARM: ux500: Enable Device Tree support mmci for Snowball Lee Jones
2012-04-16  9:26     ` [PATCH 6.2/7] MMC: mmci: Enable Device Tree support for ux500 Lee Jones
2012-04-25 18:57       ` Russell King - ARM Linux
2012-04-30  8:25         ` Lee Jones
2012-05-03 15:03         ` Lee Jones
2012-05-03 15:12           ` Russell King - ARM Linux
2012-05-03 15:18             ` Lee Jones
2012-05-03 15:30             ` Lee Jones
2012-05-03 16:30               ` Russell King - ARM Linux
2012-05-03 16:38                 ` Lee Jones
2012-05-03 16:45                   ` Russell King - ARM Linux
2012-05-03 16:59                     ` Lee Jones
2012-05-03 17:13                       ` Mark Brown
2012-05-03 21:21                         ` Lee Jones
2012-05-03 17:09                     ` Chris Ball
2012-05-04 13:18                       ` Lee Jones
2012-05-04 13:26                         ` Chris Ball
2012-05-04 13:39                           ` Lee Jones
2012-05-07 22:00                             ` Paul Gortmaker
2012-05-07 22:00                               ` Paul Gortmaker
2012-05-08 11:19                               ` Lee Jones
2012-05-08 11:19                                 ` Lee Jones
2012-05-08 12:18                                 ` Chris Ball
2012-05-08 12:18                                   ` Chris Ball
2012-05-08 12:59                                   ` Lee Jones
2012-05-08 12:59                                     ` Lee Jones
2012-05-08 14:38                                     ` Chris Ball
2012-05-08 14:38                                       ` Chris Ball
2012-05-08 23:58                                     ` Paul Gortmaker
2012-05-08 23:58                                       ` Paul Gortmaker
2012-05-09  0:29                                       ` Chris Ball
2012-05-09  0:29                                         ` Chris Ball
2012-05-09  0:52                                         ` Paul Gortmaker
2012-05-09  0:52                                           ` Paul Gortmaker
     [not found]                           ` <4FA3DEEF.2010206@linaro.org>
2012-05-04 14:08                             ` Chris Ball
2012-06-04 10:14       ` Russell King - ARM Linux
2012-06-05 10:47         ` Lee Jones
2012-06-05 10:52           ` Russell King - ARM Linux
2012-06-05 12:59             ` Linus Walleij
2012-06-06  8:09               ` Lee Jones
2012-06-11 10:03               ` Lee Jones
2012-06-11 10:34                 ` Linus Walleij
2012-04-13 14:05 ` [PATCH 7/7] MMC: mmci: Add required documentation for Device Tree bindings Lee Jones
2012-04-18 14:31   ` Pawel Moll
2012-04-18 15:01     ` Pawel Moll
2012-04-18 15:12     ` Lee Jones
2012-04-18 15:20       ` Chris Ball
2012-04-18 15:25         ` Lee Jones
2012-04-18 15:20   ` [PATCH 7/7 v2] " Lee Jones
2012-05-17 21:23   ` [PATCH 7/7] " Grant Likely
2012-04-13 14:21 ` [PATCH 0/7 v2] Next round of DT enablement for ux500/Snowball Arnd Bergmann
  -- strict thread matches above, loose matches on Subject: below --
2012-04-05 10:25 [PATCH 1/7] ARM: ux500: New DT:ed snowball_platform_devs for one-by-one device enablement Lee Jones
2012-04-05 10:25 ` [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants Lee Jones
2012-04-05  9:55 [0/7] Next round of DT enablement for ux500/Snowball Lee Jones
2012-04-05  9:55 ` [PATCH 6/7] MMC: mmci: Enable Device Tree support for ux500 variants Lee Jones
2012-04-05 12:36   ` Russell King - ARM Linux
2012-04-05 13:45     ` Lee Jones
2012-04-06  4:14       ` Grant Likely
2012-04-09 14:27         ` Arnd Bergmann
2012-04-09 14:41           ` Chris Ball

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.