linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/15] Device Tree related re-works and clean-ups
@ 2012-06-20 12:56 Lee Jones
  2012-06-20 12:56 ` [PATCH 01/15] mfd: Add IRQ domain support for the AB8500 Lee Jones
                   ` (14 more replies)
  0 siblings, 15 replies; 40+ messages in thread
From: Lee Jones @ 2012-06-20 12:56 UTC (permalink / raw)
  To: linux-arm-kernel

The next in a long line of Device Tree enablement of ST-Ericsson
related devices. In this patch-set we see the AB8500 obtain a its
own IRQ domain, some major code deletions surrounding regulator
register initialisation and a fairly major change in the way we
register MFD devices when Device Tree is enabled.

After this patch-set is applied on top of the previous one (some
patches are still to be Acked and dragged into the correct trees)
the boot log on Snowball is clean and /proc/interrupts appears to
have the right idea.

 .../devicetree/bindings/gpio/gpio-nmk.txt          |    2 +-
 arch/arm/boot/dts/db8500.dtsi                      |   18 +-
 arch/arm/kernel/perf_event_v7.c                    |   12 +-
 arch/arm/mach-ux500/board-mop500-regulators.c      |  176 --------------
 arch/arm/mach-ux500/board-mop500-regulators.h      |    2 -
 arch/arm/mach-ux500/board-mop500.c                 |   22 --
 arch/arm/mach-ux500/cpu-db8500.c                   |    3 +-
 drivers/i2c/busses/i2c-nomadik.c                   |   90 +++++++-
 drivers/input/misc/ab8500-ponkey.c                 |    6 -
 drivers/mfd/Kconfig                                |    1 +
 drivers/mfd/ab8500-core.c                          |  218 +++++++++---------
 drivers/mfd/ab8500-debugfs.c                       |   12 +-
 drivers/mfd/ab8500-gpadc.c                         |    6 -
 drivers/mfd/ab8500-sysctrl.c                       |    6 -
 drivers/mfd/db8500-prcmu.c                         |   29 ++-
 drivers/mfd/mfd-core.c                             |   31 ++-
 drivers/misc/ab8500-pwm.c                          |    6 -
 drivers/pinctrl/pinctrl-nomadik.c                  |    4 +-
 drivers/regulator/ab8500.c                         |  240 --------------------
 drivers/regulator/db8500-prcmu.c                   |    6 -
 drivers/rtc/rtc-ab8500.c                           |    7 -
 drivers/usb/otg/ab8500-usb.c                       |    6 -
 include/linux/mfd/abx500/ab8500.h                  |    8 +-
 include/linux/mfd/core.h                           |    1 +
 include/linux/regulator/ab8500.h                   |   12 -
 25 files changed, 282 insertions(+), 642 deletions(-)

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

* [PATCH 01/15] mfd: Add IRQ domain support for the AB8500
  2012-06-20 12:56 [PATCH 00/15] Device Tree related re-works and clean-ups Lee Jones
@ 2012-06-20 12:56 ` Lee Jones
  2012-06-29 14:51   ` Samuel Ortiz
  2012-06-20 12:56 ` [PATCH 02/15] mfd: Generically describe interactions with the DB8500 PRCMU Lee Jones
                   ` (13 subsequent siblings)
  14 siblings, 1 reply; 40+ messages in thread
From: Lee Jones @ 2012-06-20 12:56 UTC (permalink / raw)
  To: linux-arm-kernel

As the AB8500 is an IRQ controller in its own right, here we provide
the AB8500 driver with IRQ domain support. This is required if we wish
to reference any of its IRQs from a platform's Device Tree.

Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Naga Radheshy <naga.radheshy@stericsson.com>
Cc: Mattias Wallin <mattias.wallin@stericsson.com>
Cc: Daniel Willerud <daniel.willerud@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/Kconfig               |    1 +
 drivers/mfd/ab8500-core.c         |  130 ++++++++++++++++++++-----------------
 include/linux/mfd/abx500/ab8500.h |    5 ++
 3 files changed, 76 insertions(+), 60 deletions(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 170072e..e3637c2 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -696,6 +696,7 @@ config AB8500_CORE
 	bool "ST-Ericsson AB8500 Mixed Signal Power Management chip"
 	depends on GENERIC_HARDIRQS && ABX500_CORE && MFD_DB8500_PRCMU
 	select MFD_CORE
+	select IRQ_DOMAIN
 	help
 	  Select this option to enable access to AB8500 power management
 	  chip. This connects to U8500 either on the SSP/SPI bus (deprecated
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 4dc5024..bf2ba0a 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -11,6 +11,7 @@
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/irq.h>
+#include <linux/irqdomain.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
@@ -361,7 +362,7 @@ static void ab8500_irq_sync_unlock(struct irq_data *data)
 static void ab8500_irq_mask(struct irq_data *data)
 {
 	struct ab8500 *ab8500 = irq_data_get_irq_chip_data(data);
-	int offset = data->irq - ab8500->irq_base;
+	int offset = data->hwirq;
 	int index = offset / 8;
 	int mask = 1 << (offset % 8);
 
@@ -371,7 +372,7 @@ static void ab8500_irq_mask(struct irq_data *data)
 static void ab8500_irq_unmask(struct irq_data *data)
 {
 	struct ab8500 *ab8500 = irq_data_get_irq_chip_data(data);
-	int offset = data->irq - ab8500->irq_base;
+	int offset = data->hwirq;
 	int index = offset / 8;
 	int mask = 1 << (offset % 8);
 
@@ -510,38 +511,51 @@ static irqreturn_t ab8500_irq(int irq, void *dev)
 	return IRQ_HANDLED;
 }
 
-static int ab8500_irq_init(struct ab8500 *ab8500)
+/**
+ * ab8500_irq_get_virq(): Map an interrupt on a chip to a virtual IRQ
+ *
+ * @ab8500: ab8500_irq controller to operate on.
+ * @irq: index of the interrupt requested in the chip IRQs
+ *
+ * Useful for drivers to request their own IRQs.
+ */
+int ab8500_irq_get_virq(struct ab8500 *ab8500, int irq)
 {
-	int base = ab8500->irq_base;
-	int irq;
-	int num_irqs;
+	if (!ab8500)
+		return -EINVAL;
 
-	if (is_ab9540(ab8500))
-		num_irqs = AB9540_NR_IRQS;
-	else if (is_ab8505(ab8500))
-		num_irqs = AB8505_NR_IRQS;
-	else
-		num_irqs = AB8500_NR_IRQS;
+	return irq_create_mapping(ab8500->domain, irq);
+}
+EXPORT_SYMBOL_GPL(ab8500_irq_get_virq);
 
-	for (irq = base; irq < base + num_irqs; irq++) {
-		irq_set_chip_data(irq, ab8500);
-		irq_set_chip_and_handler(irq, &ab8500_irq_chip,
-					 handle_simple_irq);
-		irq_set_nested_thread(irq, 1);
+static int ab8500_irq_map(struct irq_domain *d, unsigned int virq,
+				irq_hw_number_t hwirq)
+{
+	struct ab8500 *ab8500 = d->host_data;
+
+	if (!ab8500)
+		return -EINVAL;
+
+	irq_set_chip_data(virq, ab8500);
+	irq_set_chip_and_handler(virq, &ab8500_irq_chip,
+				handle_simple_irq);
+	irq_set_nested_thread(virq, 1);
 #ifdef CONFIG_ARM
-		set_irq_flags(irq, IRQF_VALID);
+	set_irq_flags(virq, IRQF_VALID);
 #else
-		irq_set_noprobe(irq);
+	irq_set_noprobe(virq);
 #endif
-	}
 
 	return 0;
 }
 
-static void ab8500_irq_remove(struct ab8500 *ab8500)
+static struct irq_domain_ops ab8500_irq_ops = {
+        .map    = ab8500_irq_map,
+        .xlate  = irq_domain_xlate_twocell,
+};
+
+static int ab8500_irq_init(struct ab8500 *ab8500, struct device_node *np)
 {
-	int base = ab8500->irq_base;
-	int irq;
 	int num_irqs;
 
 	if (is_ab9540(ab8500))
@@ -551,13 +565,22 @@ static void ab8500_irq_remove(struct ab8500 *ab8500)
 	else
 		num_irqs = AB8500_NR_IRQS;
 
-	for (irq = base; irq < base + num_irqs; irq++) {
-#ifdef CONFIG_ARM
-		set_irq_flags(irq, 0);
-#endif
-		irq_set_chip_and_handler(irq, NULL, NULL);
-		irq_set_chip_data(irq, NULL);
+	if (ab8500->irq_base) {
+		ab8500->domain = irq_domain_add_legacy(
+			NULL, num_irqs, ab8500->irq_base,
+			0, &ab8500_irq_ops, ab8500);
+	}
+	else {
+		ab8500->domain = irq_domain_add_linear(
+			np, num_irqs, &ab8500_irq_ops, ab8500);
 	}
+
+	if (!ab8500->domain) {
+		dev_err(ab8500->dev, "Failed to create irqdomain\n");
+		return -ENOSYS;
+	}
+
+	return 0;
 }
 
 int ab8500_suspend(struct ab8500 *ab8500)
@@ -1233,14 +1256,6 @@ static int __devinit ab8500_probe(struct platform_device *pdev)
 
 	if (plat)
 		ab8500->irq_base = plat->irq_base;
-	else if (np)
-		ret = of_property_read_u32(np, "stericsson,irq-base", &ab8500->irq_base);
-
-	if (!ab8500->irq_base) {
-		dev_info(&pdev->dev, "couldn't find irq-base\n");
-		ret = -EINVAL;
-		goto out_free_ab8500;
-	}
 
 	ab8500->dev = &pdev->dev;
 
@@ -1323,7 +1338,7 @@ static int __devinit ab8500_probe(struct platform_device *pdev)
 		AB8500_SWITCH_OFF_STATUS, &value);
 	if (ret < 0)
 		return ret;
-	dev_info(ab8500->dev, "switch off status: %#x", value);
+	dev_info(ab8500->dev, "switch off status: %#x\n", value);
 
 	if (plat && plat->init)
 		plat->init(ab8500);
@@ -1352,25 +1367,25 @@ static int __devinit ab8500_probe(struct platform_device *pdev)
 	for (i = 0; i < ab8500->mask_size; i++)
 		ab8500->mask[i] = ab8500->oldmask[i] = 0xff;
 
-	if (ab8500->irq_base) {
-		ret = ab8500_irq_init(ab8500);
-		if (ret)
-			goto out_freeoldmask;
+	ret = ab8500_irq_init(ab8500, np);
+	if (ret)
+		goto out_freeoldmask;
 
-		/*  Activate this feature only in ab9540 */
-		/*  till tests are done on ab8500 1p2 or later*/
-		if (is_ab9540(ab8500))
-			ret = request_threaded_irq(ab8500->irq, NULL,
+	/*  Activate this feature only in ab9540 */
+	/*  till tests are done on ab8500 1p2 or later*/
+	if (is_ab9540(ab8500)) {
+		ret = request_threaded_irq(ab8500->irq, NULL,
 					ab8500_hierarchical_irq,
 					IRQF_ONESHOT | IRQF_NO_SUSPEND,
 					"ab8500", ab8500);
-		else
-			ret = request_threaded_irq(ab8500->irq, NULL,
+	}
+	else {
+		ret = request_threaded_irq(ab8500->irq, NULL,
 					ab8500_irq,
 					IRQF_ONESHOT | IRQF_NO_SUSPEND,
 					"ab8500", ab8500);
 		if (ret)
-			goto out_removeirq;
+			goto out_freeoldmask;
 	}
 
 	if (!np) {
@@ -1417,15 +1432,11 @@ static int __devinit ab8500_probe(struct platform_device *pdev)
 					&ab8500_attr_group);
 	if (ret)
 		dev_err(ab8500->dev, "error creating sysfs entries\n");
-	else
-		return ret;
+
+	return ret;
 
 out_freeirq:
-	if (ab8500->irq_base)
-		free_irq(ab8500->irq, ab8500);
-out_removeirq:
-	if (ab8500->irq_base)
-		ab8500_irq_remove(ab8500);
+	free_irq(ab8500->irq, ab8500);
 out_freeoldmask:
 	kfree(ab8500->oldmask);
 out_freemask:
@@ -1444,11 +1455,10 @@ static int __devexit ab8500_remove(struct platform_device *pdev)
 		sysfs_remove_group(&ab8500->dev->kobj, &ab9540_attr_group);
 	else
 		sysfs_remove_group(&ab8500->dev->kobj, &ab8500_attr_group);
+
 	mfd_remove_devices(ab8500->dev);
-	if (ab8500->irq_base) {
-		free_irq(ab8500->irq, ab8500);
-		ab8500_irq_remove(ab8500);
-	}
+	free_irq(ab8500->irq, ab8500);
+
 	kfree(ab8500->oldmask);
 	kfree(ab8500->mask);
 	kfree(ab8500);
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h
index 91dd3ef..4ae2cd9 100644
--- a/include/linux/mfd/abx500/ab8500.h
+++ b/include/linux/mfd/abx500/ab8500.h
@@ -9,6 +9,7 @@
 
 #include <linux/atomic.h>
 #include <linux/mutex.h>
+#include <linux/irqdomain.h>
 
 struct device;
 
@@ -227,6 +228,7 @@ enum ab8500_version {
  * @irq_lock: genirq bus lock
  * @transfer_ongoing: 0 if no transfer ongoing
  * @irq: irq line
+ * @irq_domain: irq domain
  * @version: chip version id (e.g. ab8500 or ab9540)
  * @chip_id: chip revision id
  * @write: register write
@@ -247,6 +249,7 @@ struct ab8500 {
 	atomic_t	transfer_ongoing;
 	int		irq_base;
 	int		irq;
+	struct irq_domain  *domain;
 	enum ab8500_version version;
 	u8		chip_id;
 
@@ -336,4 +339,6 @@ static inline int is_ab8500_2p0(struct ab8500 *ab)
 	return (is_ab8500(ab) && (ab->chip_id == AB8500_CUT2P0));
 }
 
+int ab8500_irq_get_virq(struct ab8500 *ab8500, int irq);
+
 #endif /* MFD_AB8500_H */
-- 
1.7.9.5

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

* [PATCH 02/15] mfd: Generically describe interactions with the DB8500 PRCMU
  2012-06-20 12:56 [PATCH 00/15] Device Tree related re-works and clean-ups Lee Jones
  2012-06-20 12:56 ` [PATCH 01/15] mfd: Add IRQ domain support for the AB8500 Lee Jones
@ 2012-06-20 12:56 ` Lee Jones
  2012-06-29 14:53   ` Samuel Ortiz
  2012-06-20 12:56 ` [PATCH 03/15] mfd: Make MFD core code Device Tree and IRQ domain aware Lee Jones
                   ` (12 subsequent siblings)
  14 siblings, 1 reply; 40+ messages in thread
From: Lee Jones @ 2012-06-20 12:56 UTC (permalink / raw)
  To: linux-arm-kernel

There is only one method used to communicate with the DB8500 PRCMU, via I2C.
Now this can be assumed, there is no requirement to specify the protocol in
the function name. This patch removes protocol specifics and uses a more
generic naming convention.

Cc: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/ab8500-core.c    |   12 ++++++------
 drivers/mfd/ab8500-debugfs.c |    6 +++---
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index bf2ba0a..8de3b65 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -141,7 +141,7 @@ static const char ab8500_version_str[][7] = {
 	[AB8500_VERSION_AB8540] = "AB8540",
 };
 
-static int ab8500_i2c_write(struct ab8500 *ab8500, u16 addr, u8 data)
+static int ab8500_prcmu_write(struct ab8500 *ab8500, u16 addr, u8 data)
 {
 	int ret;
 
@@ -151,7 +151,7 @@ static int ab8500_i2c_write(struct ab8500 *ab8500, u16 addr, u8 data)
 	return ret;
 }
 
-static int ab8500_i2c_write_masked(struct ab8500 *ab8500, u16 addr, u8 mask,
+static int ab8500_prcmu_write_masked(struct ab8500 *ab8500, u16 addr, u8 mask,
 	u8 data)
 {
 	int ret;
@@ -163,7 +163,7 @@ static int ab8500_i2c_write_masked(struct ab8500 *ab8500, u16 addr, u8 mask,
 	return ret;
 }
 
-static int ab8500_i2c_read(struct ab8500 *ab8500, u16 addr)
+static int ab8500_prcmu_read(struct ab8500 *ab8500, u16 addr)
 {
 	int ret;
 	u8 data;
@@ -1267,9 +1267,9 @@ static int __devinit ab8500_probe(struct platform_device *pdev)
 
 	ab8500->irq = resource->start;
 
-	ab8500->read = ab8500_i2c_read;
-	ab8500->write = ab8500_i2c_write;
-	ab8500->write_masked = ab8500_i2c_write_masked;
+	ab8500->read = ab8500_prcmu_read;
+	ab8500->write = ab8500_prcmu_write;
+	ab8500->write_masked = ab8500_prcmu_write_masked;
 
 	mutex_init(&ab8500->lock);
 	mutex_init(&ab8500->irq_lock);
diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index 50c4c89..361de52 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -31,12 +31,12 @@ struct ab8500_reg_range {
 };
 
 /**
- * struct ab8500_i2c_ranges
+ * struct ab8500_prcmu_ranges
  * @num_ranges: the number of ranges in the list
  * @bankid: bank identifier
  * @range: the list of register ranges
  */
-struct ab8500_i2c_ranges {
+struct ab8500_prcmu_ranges {
 	u8 num_ranges;
 	u8 bankid;
 	const struct ab8500_reg_range *range;
@@ -47,7 +47,7 @@ struct ab8500_i2c_ranges {
 
 #define AB8500_REV_REG 0x80
 
-static struct ab8500_i2c_ranges debug_ranges[AB8500_NUM_BANKS] = {
+static struct ab8500_prcmu_ranges debug_ranges[AB8500_NUM_BANKS] = {
 	[0x0] = {
 		.num_ranges = 0,
 		.range = 0,
-- 
1.7.9.5

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

* [PATCH 03/15] mfd: Make MFD core code Device Tree and IRQ domain aware
  2012-06-20 12:56 [PATCH 00/15] Device Tree related re-works and clean-ups Lee Jones
  2012-06-20 12:56 ` [PATCH 01/15] mfd: Add IRQ domain support for the AB8500 Lee Jones
  2012-06-20 12:56 ` [PATCH 02/15] mfd: Generically describe interactions with the DB8500 PRCMU Lee Jones
@ 2012-06-20 12:56 ` Lee Jones
  2012-06-29 14:55   ` Samuel Ortiz
  2012-06-20 12:56 ` [PATCH 04/15] mfd: ab8500: Register devices using the newly DT:ed MFD API Lee Jones
                   ` (11 subsequent siblings)
  14 siblings, 1 reply; 40+ messages in thread
From: Lee Jones @ 2012-06-20 12:56 UTC (permalink / raw)
  To: linux-arm-kernel

During Device Tree enablement of the ab8500 and db8500-prcmu drivers,
a decision was made to omit registration through the MFD API and use
Device Tree directly. However, because MFD devices have a different
address space and the ab8500 and db8500 both use I2C to communicate,
this causes issues with address translation during execution of
of_platform_populate(). So the solution is to make the MFD core aware
of Device Tree and have it assign the correct node pointers instead.

To make this work the MFD core also needs to be awere of IRQ domains,
as Device Tree insists on IRQ domain compatibility. So, instead of
providing an irq-base via platform code, in the DT case we simply
look up the IRQ domain and map to the correct virtual IRQ.

Cc: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/mfd-core.c   |   31 +++++++++++++++++++++++++++----
 include/linux/mfd/core.h |    1 +
 2 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index ffc3d48..effc4f5 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -18,6 +18,8 @@
 #include <linux/pm_runtime.h>
 #include <linux/slab.h>
 #include <linux/module.h>
+#include <linux/irqdomain.h>
+#include <linux/of.h>
 
 int mfd_cell_enable(struct platform_device *pdev)
 {
@@ -76,6 +78,8 @@ static int mfd_add_device(struct device *parent, int id,
 {
 	struct resource *res;
 	struct platform_device *pdev;
+	struct device_node *np = NULL;
+	struct irq_domain *domain = NULL;
 	int ret = -ENOMEM;
 	int r;
 
@@ -89,6 +93,18 @@ static int mfd_add_device(struct device *parent, int id,
 
 	pdev->dev.parent = parent;
 
+	if (parent->of_node) {
+		if (cell->of_compatible) {
+			for_each_child_of_node(parent->of_node, np) {
+				if (of_device_is_compatible(np, cell->of_compatible)) {
+					pdev->dev.of_node = np;
+					domain = irq_find_host(parent->of_node);
+					break;
+				}
+			}
+		}
+	}
+
 	if (cell->pdata_size) {
 		ret = platform_device_add_data(pdev,
 					cell->platform_data, cell->pdata_size);
@@ -112,10 +128,17 @@ static int mfd_add_device(struct device *parent, int id,
 			res[r].end = mem_base->start +
 				cell->resources[r].end;
 		} else if (cell->resources[r].flags & IORESOURCE_IRQ) {
-			res[r].start = irq_base +
-				cell->resources[r].start;
-			res[r].end   = irq_base +
-				cell->resources[r].end;
+			if (domain) {
+				/* Unable to create mappings for IRQ ranges. */
+				WARN_ON(cell->resources[r].start != cell->resources[r].end);
+				res[r].start = res[r].end = irq_create_mapping(
+					domain, cell->resources[r].start);
+			} else {
+				res[r].start = irq_base +
+					cell->resources[r].start;
+				res[r].end   = irq_base +
+					cell->resources[r].end;
+			}
 		} else {
 			res[r].parent = cell->resources[r].parent;
 			res[r].start = cell->resources[r].start;
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h
index 4e76163..99b7eb1 100644
--- a/include/linux/mfd/core.h
+++ b/include/linux/mfd/core.h
@@ -36,6 +36,7 @@ struct mfd_cell {
 	/* platform data passed to the sub devices drivers */
 	void			*platform_data;
 	size_t			pdata_size;
+	const char		*of_compatible;
 
 	/*
 	 * These resources can be specified relative to the parent device.
-- 
1.7.9.5

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

* [PATCH 04/15] mfd: ab8500: Register devices using the newly DT:ed MFD API
  2012-06-20 12:56 [PATCH 00/15] Device Tree related re-works and clean-ups Lee Jones
                   ` (2 preceding siblings ...)
  2012-06-20 12:56 ` [PATCH 03/15] mfd: Make MFD core code Device Tree and IRQ domain aware Lee Jones
@ 2012-06-20 12:56 ` Lee Jones
  2012-06-29 15:09   ` Samuel Ortiz
  2012-06-20 12:56 ` [PATCH 05/15] mfd: db8500-prcmu: " Lee Jones
                   ` (10 subsequent siblings)
  14 siblings, 1 reply; 40+ messages in thread
From: Lee Jones @ 2012-06-20 12:56 UTC (permalink / raw)
  To: linux-arm-kernel

Now the MFD API is Device Tree aware we can use it for platform
registration again, even when booting with DT enabled. To aid in
Device Node pointer allocation we provide each cell with the
associative compatible string.

Cc: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/mach-ux500/board-mop500.c |    1 -
 drivers/input/misc/ab8500-ponkey.c |    6 ----
 drivers/mfd/ab8500-core.c          |   64 ++++++++++++++++++++++--------------
 drivers/mfd/ab8500-debugfs.c       |    6 ----
 drivers/mfd/ab8500-gpadc.c         |    6 ----
 drivers/mfd/ab8500-sysctrl.c       |    6 ----
 drivers/misc/ab8500-pwm.c          |    6 ----
 drivers/regulator/ab8500.c         |    6 ----
 drivers/rtc/rtc-ab8500.c           |    7 ----
 drivers/usb/otg/ab8500-usb.c       |    6 ----
 10 files changed, 39 insertions(+), 75 deletions(-)

diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 1087176..7e5b161 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -822,7 +822,6 @@ static const struct of_device_id u8500_local_bus_nodes[] = {
 	{ .compatible = "stericsson,db8500-prcmu", },
 	{ .compatible = "stericsson,db8500-prcmu-regulator", },
 	{ .compatible = "stericsson,ab8500", },
-	{ .compatible = "stericsson,ab8500-regulator", },
 	{ .compatible = "simple-bus"},
 	{ },
 };
diff --git a/drivers/input/misc/ab8500-ponkey.c b/drivers/input/misc/ab8500-ponkey.c
index 33e5b1e..5ceb23e 100644
--- a/drivers/input/misc/ab8500-ponkey.c
+++ b/drivers/input/misc/ab8500-ponkey.c
@@ -132,16 +132,10 @@ static int __devexit ab8500_ponkey_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id ab8500_ponkey_match[] = {
-	{ .compatible = "stericsson,ab8500-ponkey", },
-	{}
-};
-
 static struct platform_driver ab8500_ponkey_driver = {
 	.driver		= {
 		.name	= "ab8500-poweron-key",
 		.owner	= THIS_MODULE,
-		.of_match_table = ab8500_ponkey_match,
 	},
 	.probe		= ab8500_ponkey_probe,
 	.remove		= __devexit_p(ab8500_ponkey_remove),
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 8de3b65..79d7672 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -970,54 +970,69 @@ static struct mfd_cell __devinitdata abx500_common_devs[] = {
 #ifdef CONFIG_DEBUG_FS
 	{
 		.name = "ab8500-debug",
+		.of_compatible = "stericsson,ab8500-debug",
 		.num_resources = ARRAY_SIZE(ab8500_debug_resources),
 		.resources = ab8500_debug_resources,
 	},
 #endif
 	{
 		.name = "ab8500-sysctrl",
+		.of_compatible = "stericsson,ab8500-sysctrl",
 	},
 	{
 		.name = "ab8500-regulator",
+		.of_compatible = "stericsson,ab8500-regulator",
 	},
 	{
 		.name = "ab8500-gpadc",
+		.of_compatible = "stericsson,ab8500-gpadc",
 		.num_resources = ARRAY_SIZE(ab8500_gpadc_resources),
 		.resources = ab8500_gpadc_resources,
 	},
 	{
 		.name = "ab8500-rtc",
+		.of_compatible = "stericsson,ab8500-rtc",
 		.num_resources = ARRAY_SIZE(ab8500_rtc_resources),
 		.resources = ab8500_rtc_resources,
 	},
 	{
 		.name = "ab8500-acc-det",
+		.of_compatible = "stericsson,ab8500-acc-det",
 		.num_resources = ARRAY_SIZE(ab8500_av_acc_detect_resources),
 		.resources = ab8500_av_acc_detect_resources,
 	},
 	{
 		.name = "ab8500-poweron-key",
+		.of_compatible = "stericsson,ab8500-poweron-key",
 		.num_resources = ARRAY_SIZE(ab8500_poweronkey_db_resources),
 		.resources = ab8500_poweronkey_db_resources,
 	},
 	{
 		.name = "ab8500-pwm",
+		.of_compatible = "stericsson,ab8500-pwm",
 		.id = 1,
 	},
 	{
 		.name = "ab8500-pwm",
+		.of_compatible = "stericsson,ab8500-pwm",
 		.id = 2,
 	},
 	{
 		.name = "ab8500-pwm",
+		.of_compatible = "stericsson,ab8500-pwm",
 		.id = 3,
 	},
-	{ .name = "ab8500-leds", },
+	{
+		.name = "ab8500-leds",
+		.of_compatible = "stericsson,ab8500-leds",
+	},
 	{
 		.name = "ab8500-denc",
+		.of_compatible = "stericsson,ab8500-denc",
 	},
 	{
 		.name = "ab8500-temp",
+		.of_compatible = "stericsson,ab8500-temp",
 		.num_resources = ARRAY_SIZE(ab8500_temp_resources),
 		.resources = ab8500_temp_resources,
 	},
@@ -1049,11 +1064,13 @@ static struct mfd_cell __devinitdata ab8500_bm_devs[] = {
 static struct mfd_cell __devinitdata ab8500_devs[] = {
 	{
 		.name = "ab8500-gpio",
+		.of_compatible = "stericsson,ab8500-gpio",
 		.num_resources = ARRAY_SIZE(ab8500_gpio_resources),
 		.resources = ab8500_gpio_resources,
 	},
 	{
 		.name = "ab8500-usb",
+		.of_compatible = "stericsson,ab8500-usb",
 		.num_resources = ARRAY_SIZE(ab8500_usb_resources),
 		.resources = ab8500_usb_resources,
 	},
@@ -1388,32 +1405,29 @@ static int __devinit ab8500_probe(struct platform_device *pdev)
 			goto out_freeoldmask;
 	}
 
-	if (!np) {
-		ret = mfd_add_devices(ab8500->dev, 0, abx500_common_devs,
-				ARRAY_SIZE(abx500_common_devs), NULL,
-				ab8500->irq_base);
+	ret = mfd_add_devices(ab8500->dev, 0, abx500_common_devs,
+			ARRAY_SIZE(abx500_common_devs), NULL,
+			ab8500->irq_base);
+	if (ret)
+		goto out_freeirq;
 
-		if (ret)
-			goto out_freeirq;
-
-		if (is_ab9540(ab8500))
-			ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs,
-					ARRAY_SIZE(ab9540_devs), NULL,
-					ab8500->irq_base);
-		else
-			ret = mfd_add_devices(ab8500->dev, 0, ab8500_devs,
-					ARRAY_SIZE(ab8500_devs), NULL,
-					ab8500->irq_base);
-		if (ret)
-			goto out_freeirq;
+	if (is_ab9540(ab8500))
+		ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs,
+				ARRAY_SIZE(ab9540_devs), NULL,
+				ab8500->irq_base);
+	else
+		ret = mfd_add_devices(ab8500->dev, 0, ab8500_devs,
+				ARRAY_SIZE(ab8500_devs), NULL,
+				ab8500->irq_base);
+	if (ret)
+		goto out_freeirq;
 
-		if (is_ab9540(ab8500) || is_ab8505(ab8500))
-			ret = mfd_add_devices(ab8500->dev, 0, ab9540_ab8505_devs,
-					ARRAY_SIZE(ab9540_ab8505_devs), NULL,
-					ab8500->irq_base);
-		if (ret)
-			goto out_freeirq;
-	}
+	if (is_ab9540(ab8500) || is_ab8505(ab8500))
+		ret = mfd_add_devices(ab8500->dev, 0, ab9540_ab8505_devs,
+				ARRAY_SIZE(ab9540_ab8505_devs), NULL,
+				ab8500->irq_base);
+	if (ret)
+		goto out_freeirq;
 
 	if (!no_bm) {
 		/* Add battery management devices */
diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index 361de52..c4cb806 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -608,16 +608,10 @@ static int __devexit ab8500_debug_remove(struct platform_device *plf)
 	return 0;
 }
 
-static const struct of_device_id ab8500_debug_match[] = {
-        { .compatible = "stericsson,ab8500-debug", },
-        {}
-};
-
 static struct platform_driver ab8500_debug_driver = {
 	.driver = {
 		.name = "ab8500-debug",
 		.owner = THIS_MODULE,
-		.of_match_table = ab8500_debug_match,
 	},
 	.probe  = ab8500_debug_probe,
 	.remove = __devexit_p(ab8500_debug_remove)
diff --git a/drivers/mfd/ab8500-gpadc.c b/drivers/mfd/ab8500-gpadc.c
index b6cbc3ba..866f959 100644
--- a/drivers/mfd/ab8500-gpadc.c
+++ b/drivers/mfd/ab8500-gpadc.c
@@ -649,18 +649,12 @@ static int __devexit ab8500_gpadc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id ab8500_gpadc_match[] = {
-	{ .compatible = "stericsson,ab8500-gpadc", },
-	{}
-};
-
 static struct platform_driver ab8500_gpadc_driver = {
 	.probe = ab8500_gpadc_probe,
 	.remove = __devexit_p(ab8500_gpadc_remove),
 	.driver = {
 		.name = "ab8500-gpadc",
 		.owner = THIS_MODULE,
-		.of_match_table = ab8500_gpadc_match,
 	},
 };
 
diff --git a/drivers/mfd/ab8500-sysctrl.c b/drivers/mfd/ab8500-sysctrl.c
index 5a3e51c..c28d4eb 100644
--- a/drivers/mfd/ab8500-sysctrl.c
+++ b/drivers/mfd/ab8500-sysctrl.c
@@ -61,16 +61,10 @@ static int __devexit ab8500_sysctrl_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id ab8500_sysctrl_match[] = {
-	{ .compatible = "stericsson,ab8500-sysctrl", },
-	{}
-};
-
 static struct platform_driver ab8500_sysctrl_driver = {
 	.driver = {
 		.name = "ab8500-sysctrl",
 		.owner = THIS_MODULE,
-		.of_match_table = ab8500_sysctrl_match,
 	},
 	.probe = ab8500_sysctrl_probe,
 	.remove = __devexit_p(ab8500_sysctrl_remove),
diff --git a/drivers/misc/ab8500-pwm.c b/drivers/misc/ab8500-pwm.c
index 042a8fe..d7a9aa1 100644
--- a/drivers/misc/ab8500-pwm.c
+++ b/drivers/misc/ab8500-pwm.c
@@ -142,16 +142,10 @@ static int __devexit ab8500_pwm_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id ab8500_pwm_match[] = {
-	{ .compatible = "stericsson,ab8500-pwm", },
-	{}
-};
-
 static struct platform_driver ab8500_pwm_driver = {
 	.driver = {
 		.name = "ab8500-pwm",
 		.owner = THIS_MODULE,
-		.of_match_table = ab8500_pwm_match,
 	},
 	.probe = ab8500_pwm_probe,
 	.remove = __devexit_p(ab8500_pwm_remove),
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c
index a739f5c..6745bd2 100644
--- a/drivers/regulator/ab8500.c
+++ b/drivers/regulator/ab8500.c
@@ -906,18 +906,12 @@ static __devexit int ab8500_regulator_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id ab8500_regulator_match[] = {
-        { .compatible = "stericsson,ab8500-regulator", },
-        {}
-};
-
 static struct platform_driver ab8500_regulator_driver = {
 	.probe = ab8500_regulator_probe,
 	.remove = __devexit_p(ab8500_regulator_remove),
 	.driver         = {
 		.name   = "ab8500-regulator",
 		.owner  = THIS_MODULE,
-		.of_match_table = ab8500_regulator_match,
 	},
 };
 
diff --git a/drivers/rtc/rtc-ab8500.c b/drivers/rtc/rtc-ab8500.c
index 116c23d..3046af5 100644
--- a/drivers/rtc/rtc-ab8500.c
+++ b/drivers/rtc/rtc-ab8500.c
@@ -17,7 +17,6 @@
 #include <linux/mfd/abx500.h>
 #include <linux/mfd/abx500/ab8500.h>
 #include <linux/delay.h>
-#include <linux/of.h>
 
 #define AB8500_RTC_SOFF_STAT_REG	0x00
 #define AB8500_RTC_CC_CONF_REG		0x01
@@ -454,16 +453,10 @@ static int __devexit ab8500_rtc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id ab8500_rtc_match[] = {
-        { .compatible = "stericsson,ab8500-rtc", },
-        {}
-};
-
 static struct platform_driver ab8500_rtc_driver = {
 	.driver = {
 		.name = "ab8500-rtc",
 		.owner = THIS_MODULE,
-		.of_match_table = ab8500_rtc_match,
 	},
 	.probe	= ab8500_rtc_probe,
 	.remove = __devexit_p(ab8500_rtc_remove),
diff --git a/drivers/usb/otg/ab8500-usb.c b/drivers/usb/otg/ab8500-usb.c
index 9799ac6..a84af67 100644
--- a/drivers/usb/otg/ab8500-usb.c
+++ b/drivers/usb/otg/ab8500-usb.c
@@ -569,18 +569,12 @@ static int __devexit ab8500_usb_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id ab8500_usb_match[] = {
-	{ .compatible = "stericsson,ab8500-usb", },
-	{},
-};
-
 static struct platform_driver ab8500_usb_driver = {
 	.probe		= ab8500_usb_probe,
 	.remove		= __devexit_p(ab8500_usb_remove),
 	.driver		= {
 		.name	= "ab8500-usb",
 		.owner	= THIS_MODULE,
-		.of_match_table = ab8500_usb_match,
 	},
 };
 
-- 
1.7.9.5

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

* [PATCH 05/15] mfd: db8500-prcmu: Register devices using the newly DT:ed MFD API
  2012-06-20 12:56 [PATCH 00/15] Device Tree related re-works and clean-ups Lee Jones
                   ` (3 preceding siblings ...)
  2012-06-20 12:56 ` [PATCH 04/15] mfd: ab8500: Register devices using the newly DT:ed MFD API Lee Jones
@ 2012-06-20 12:56 ` Lee Jones
  2012-06-29 15:11   ` Samuel Ortiz
  2012-06-20 12:56 ` [PATCH 06/15] mfd: Register the ab8500 from db8500-prcmu using the " Lee Jones
                   ` (9 subsequent siblings)
  14 siblings, 1 reply; 40+ messages in thread
From: Lee Jones @ 2012-06-20 12:56 UTC (permalink / raw)
  To: linux-arm-kernel

Now the MFD API is Device Tree aware we can use it for platform
registration again, even when booting with DT enabled. To aid in
Device Node pointer allocation we provide each cell with the
associative compatible string.

Cc: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/db8500-prcmu.c       |   14 +++++++-------
 drivers/regulator/db8500-prcmu.c |    6 ------
 2 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
index 1aa0bb7..e9e576c 100644
--- a/drivers/mfd/db8500-prcmu.c
+++ b/drivers/mfd/db8500-prcmu.c
@@ -2948,11 +2948,13 @@ static struct regulator_init_data db8500_regulators[DB8500_NUM_REGULATORS] = {
 static struct mfd_cell db8500_prcmu_devs[] = {
 	{
 		.name = "db8500-prcmu-regulators",
+		.of_compatible = "stericsson,db8500-prcmu-regulator",
 		.platform_data = &db8500_regulators,
 		.pdata_size = sizeof(db8500_regulators),
 	},
 	{
 		.name = "cpufreq-u8500",
+		.of_compatible = "stericsson,cpufreq-u8500",
 	},
 };
 
@@ -2990,13 +2992,11 @@ static int __devinit db8500_prcmu_probe(struct platform_device *pdev)
 	if (cpu_is_u8500v20_or_later())
 		prcmu_config_esram0_deep_sleep(ESRAM0_DEEP_SLEEP_STATE_RET);
 
-	if (!np) {
-		err = mfd_add_devices(&pdev->dev, 0, db8500_prcmu_devs,
-				ARRAY_SIZE(db8500_prcmu_devs), NULL, 0);
-		if (err) {
-			pr_err("prcmu: Failed to add subdevices\n");
-			return err;
-		}
+	err = mfd_add_devices(&pdev->dev, 0, db8500_prcmu_devs,
+			ARRAY_SIZE(db8500_prcmu_devs), NULL, 0);
+	if (err) {
+		pr_err("prcmu: Failed to add subdevices\n");
+		return err;
 	}
 
 	pr_info("DB8500 PRCMU initialized\n");
diff --git a/drivers/regulator/db8500-prcmu.c b/drivers/regulator/db8500-prcmu.c
index 9dbb491..359f8d1 100644
--- a/drivers/regulator/db8500-prcmu.c
+++ b/drivers/regulator/db8500-prcmu.c
@@ -547,16 +547,10 @@ static int __exit db8500_regulator_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id db8500_prcmu_regulator_match[] = {
-        { .compatible = "stericsson,db8500-prcmu-regulator", },
-        {}
-};
-
 static struct platform_driver db8500_regulator_driver = {
 	.driver = {
 		.name = "db8500-prcmu-regulators",
 		.owner = THIS_MODULE,
-		.of_match_table = db8500_prcmu_regulator_match,
 	},
 	.probe = db8500_regulator_probe,
 	.remove = __exit_p(db8500_regulator_remove),
-- 
1.7.9.5

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

* [PATCH 06/15] mfd: Register the ab8500 from db8500-prcmu using the MFD API
  2012-06-20 12:56 [PATCH 00/15] Device Tree related re-works and clean-ups Lee Jones
                   ` (4 preceding siblings ...)
  2012-06-20 12:56 ` [PATCH 05/15] mfd: db8500-prcmu: " Lee Jones
@ 2012-06-20 12:56 ` Lee Jones
  2012-06-29 15:15   ` Samuel Ortiz
  2012-06-20 12:56 ` [PATCH 07/15] i2c: Add Device Tree support to the Nomadik I2C driver Lee Jones
                   ` (8 subsequent siblings)
  14 siblings, 1 reply; 40+ messages in thread
From: Lee Jones @ 2012-06-20 12:56 UTC (permalink / raw)
  To: linux-arm-kernel

Hierarchically, the AB8500 is a child of the DB8500 PRCMU. So now that
Device Tree is being used and MFD core code is Device Tree aware, we
can simply register DB8500 PRCMU from Device Tree in the normal way
then allow the DB8500 PRCMU driver to register the AB8500 as a simple
MFD device at probe time.

Cc: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/mach-ux500/board-mop500.c |    2 --
 drivers/mfd/ab8500-core.c          |   12 ------------
 drivers/mfd/db8500-prcmu.c         |   15 +++++++++++++++
 3 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 7e5b161..0bae853 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -820,8 +820,6 @@ static const struct of_device_id u8500_local_bus_nodes[] = {
 	/* only create devices below soc node */
 	{ .compatible = "stericsson,db8500", },
 	{ .compatible = "stericsson,db8500-prcmu", },
-	{ .compatible = "stericsson,db8500-prcmu-regulator", },
-	{ .compatible = "stericsson,ab8500", },
 	{ .compatible = "simple-bus"},
 	{ },
 };
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 79d7672..738b9c5 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -1247,14 +1247,6 @@ static struct attribute_group ab9540_attr_group = {
 	.attrs	= ab9540_sysfs_entries,
 };
 
-static const struct of_device_id ab8500_match[] = {
-	{
-		.compatible = "stericsson,ab8500",
-		.data = (void *)AB8500_VERSION_AB8500,
-	},
-	{},
-};
-
 static int __devinit ab8500_probe(struct platform_device *pdev)
 {
 	struct ab8500_platform_data *plat = dev_get_platdata(&pdev->dev);
@@ -1296,9 +1288,6 @@ static int __devinit ab8500_probe(struct platform_device *pdev)
 
 	if (platid)
 		version = platid->driver_data;
-	else if (np)
-		version = (unsigned int)
-			of_match_device(ab8500_match, &pdev->dev)->data;
 
 	if (version != AB8500_VERSION_UNDEFINED)
 		ab8500->version = version;
@@ -1492,7 +1481,6 @@ static struct platform_driver ab8500_core_driver = {
 	.driver = {
 		.name = "ab8500-core",
 		.owner = THIS_MODULE,
-		.of_match_table = ab8500_match,
 	},
 	.probe	= ab8500_probe,
 	.remove	= __devexit_p(ab8500_remove),
diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
index e9e576c..80def6c 100644
--- a/drivers/mfd/db8500-prcmu.c
+++ b/drivers/mfd/db8500-prcmu.c
@@ -2945,6 +2945,14 @@ static struct regulator_init_data db8500_regulators[DB8500_NUM_REGULATORS] = {
 	},
 };
 
+static struct resource ab8500_resources[] = {
+	[0] = {
+		.start	= IRQ_DB8500_AB8500,
+		.end	= IRQ_DB8500_AB8500,
+		.flags	= IORESOURCE_IRQ
+	}
+};
+
 static struct mfd_cell db8500_prcmu_devs[] = {
 	{
 		.name = "db8500-prcmu-regulators",
@@ -2956,6 +2964,13 @@ static struct mfd_cell db8500_prcmu_devs[] = {
 		.name = "cpufreq-u8500",
 		.of_compatible = "stericsson,cpufreq-u8500",
 	},
+	{
+		.name = "ab8500-core",
+		.of_compatible = "stericsson,ab8500",
+		.num_resources = ARRAY_SIZE(ab8500_resources),
+		.resources = ab8500_resources,
+		.id = AB8500_VERSION_AB8500,
+	},
 };
 
 /**
-- 
1.7.9.5

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

* [PATCH 07/15] i2c: Add Device Tree support to the Nomadik I2C driver
  2012-06-20 12:56 [PATCH 00/15] Device Tree related re-works and clean-ups Lee Jones
                   ` (5 preceding siblings ...)
  2012-06-20 12:56 ` [PATCH 06/15] mfd: Register the ab8500 from db8500-prcmu using the " Lee Jones
@ 2012-06-20 12:56 ` Lee Jones
  2012-06-20 19:30   ` Linus Walleij
  2012-06-20 12:56 ` [PATCH 08/15] regulator: Stop initialising AB8500's registers during bring-up Lee Jones
                   ` (7 subsequent siblings)
  14 siblings, 1 reply; 40+ messages in thread
From: Lee Jones @ 2012-06-20 12:56 UTC (permalink / raw)
  To: linux-arm-kernel

Here we apply the bindings required for successful Device Tree
probing of the i2c-nomadik driver. We also apply a fall-back
configuration in case either one is not provided, or a required
element is missing from the one supplied.

Cc: linux-i2c at vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/i2c/busses/i2c-nomadik.c |   90 +++++++++++++++++++++++++++++++++++---
 1 file changed, 84 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c
index a92440d..5611c62 100644
--- a/drivers/i2c/busses/i2c-nomadik.c
+++ b/drivers/i2c/busses/i2c-nomadik.c
@@ -23,6 +23,7 @@
 #include <linux/io.h>
 #include <linux/regulator/consumer.h>
 #include <linux/pm_runtime.h>
+#include <linux/of.h>
 
 #include <plat/i2c.h>
 
@@ -333,10 +334,6 @@ static void setup_i2c_controller(struct nmk_i2c_dev *dev)
 
 	i2c_clk = clk_get_rate(dev->clk);
 
-	/* fallback to std. mode if machine has not provided it */
-	if (dev->cfg.clk_freq == 0)
-		dev->cfg.clk_freq = 100000;
-
 	/*
 	 * The spec says, in case of std. mode the divider is
 	 * 2 whereas it is 3 for fast and fastplus mode of
@@ -899,15 +896,90 @@ static const struct i2c_algorithm nmk_i2c_algo = {
 	.functionality	= nmk_i2c_functionality
 };
 
+static struct nmk_i2c_controller u8500_i2c = {
+	/*
+	 * Slave data setup time; 250ns, 100ns, and 10ns, which
+	 * is 14, 6 and 2 respectively for a 48Mhz i2c clock.
+	 */
+	.slsu           = 0xe,
+	.tft            = 1,      /* Tx FIFO threshold */
+	.rft            = 8,      /* Rx FIFO threshold */
+	.clk_freq       = 100000, /* std. mode operation */
+	.timeout        = 200,    /* Slave response timeout(ms) */
+	.sm             = I2C_FREQ_MODE_FAST,
+};
+
+static int __devinit
+nmk_i2c_of_probe(struct device_node *np, struct nmk_i2c_controller *pdata)
+{
+	of_property_read_u32(np, "clock-frequency", (u32*)&pdata->clk_freq);
+	if (!pdata->clk_freq) {
+		pr_warn("%s: Clock frequency not found\n", np->full_name);
+		return -EINVAL;
+	}
+
+	of_property_read_u32(np, "stericsson,slsu", (u32*)&pdata->slsu);
+	if (!pdata->slsu) {
+		pr_warn("%s: Data line delay not found\n", np->full_name);
+		return -EINVAL;
+	}
+
+	of_property_read_u32(np, "stericsson,tft", (u32*)&pdata->tft);
+	if (!pdata->tft) {
+		pr_warn("%s: Tx FIFO threshold not found\n", np->full_name);
+		return -EINVAL;
+	}
+
+	of_property_read_u32(np, "stericsson,rft", (u32*)&pdata->rft);
+	if (!pdata->rft) {
+		pr_warn("%s: Rx FIFO threshold not found\n", np->full_name);
+		return -EINVAL;
+	}
+
+	of_property_read_u32(np, "stericsson,timeout", (u32*)&pdata->timeout);
+	if (!pdata->timeout) {
+		pr_warn("%s: Timeout not found\n", np->full_name);
+		return -EINVAL;
+	}
+
+	/*
+	 * This driver only supports fast and standard frequency
+	 * modes. If anything else is requested fall-back to standard.
+	 */
+	if (of_get_property(np, "stericsson,i2c_freq_mode_fast", NULL))
+		pdata->sm = I2C_FREQ_MODE_FAST;
+	else
+		pdata->sm = I2C_FREQ_MODE_STANDARD;
+
+	return 0;
+}
+
 static int __devinit nmk_i2c_probe(struct platform_device *pdev)
 {
 	int ret = 0;
 	struct resource *res;
-	struct nmk_i2c_controller *pdata =
-			pdev->dev.platform_data;
+	struct nmk_i2c_controller *pdata = pdev->dev.platform_data;
+	struct device_node *np = pdev->dev.of_node;
 	struct nmk_i2c_dev	*dev;
 	struct i2c_adapter *adap;
 
+	if (np) {
+		if (!pdata) {
+			pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
+			if (!pdata) {
+				ret = -ENOMEM;
+				goto err_no_mem;
+			}
+		}
+		ret = nmk_i2c_of_probe(np, pdata);
+		if (ret)
+			kfree(pdata);
+	}
+
+	if (!pdata)
+		/* No i2c configuration found, using the default. */
+		pdata = &u8500_i2c;
+
 	dev = kzalloc(sizeof(struct nmk_i2c_dev), GFP_KERNEL);
 	if (!dev) {
 		dev_err(&pdev->dev, "cannot allocate memory\n");
@@ -1038,11 +1110,17 @@ static int __devexit nmk_i2c_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id nmk_gpio_match[] = {
+	{ .compatible = "st,nomadik-i2c", },
+	{},
+};
+
 static struct platform_driver nmk_i2c_driver = {
 	.driver = {
 		.owner = THIS_MODULE,
 		.name = DRIVER_NAME,
 		.pm = &nmk_i2c_pm,
+		.of_match_table = nmk_gpio_match,
 	},
 	.probe = nmk_i2c_probe,
 	.remove = __devexit_p(nmk_i2c_remove),
-- 
1.7.9.5

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

* [PATCH 08/15] regulator: Stop initialising AB8500's registers during bring-up
  2012-06-20 12:56 [PATCH 00/15] Device Tree related re-works and clean-ups Lee Jones
                   ` (6 preceding siblings ...)
  2012-06-20 12:56 ` [PATCH 07/15] i2c: Add Device Tree support to the Nomadik I2C driver Lee Jones
@ 2012-06-20 12:56 ` Lee Jones
  2012-06-20 13:08   ` Mark Brown
  2012-06-20 13:26   ` Mark Brown
  2012-06-20 12:56 ` [PATCH 09/15] pinctrl: pinctrl-nomadik: Fix possible memory leak Lee Jones
                   ` (6 subsequent siblings)
  14 siblings, 2 replies; 40+ messages in thread
From: Lee Jones @ 2012-06-20 12:56 UTC (permalink / raw)
  To: linux-arm-kernel

There is no need to initialise the AB8500's regulator registers, as
most of this work is already carried out by framework features.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/regulator/ab8500.c       |  234 --------------------------------------
 include/linux/regulator/ab8500.h |   12 --
 2 files changed, 246 deletions(-)

diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c
index 6745bd2..adb32cb 100644
--- a/drivers/regulator/ab8500.c
+++ b/drivers/regulator/ab8500.c
@@ -531,221 +531,6 @@ static struct ab8500_regulator_info
 
 };
 
-struct ab8500_reg_init {
-	u8 bank;
-	u8 addr;
-	u8 mask;
-};
-
-#define REG_INIT(_id, _bank, _addr, _mask)	\
-	[_id] = {				\
-		.bank = _bank,			\
-		.addr = _addr,			\
-		.mask = _mask,			\
-	}
-
-static struct ab8500_reg_init ab8500_reg_init[] = {
-	/*
-	 * 0x30, VanaRequestCtrl
-	 * 0x0C, VpllRequestCtrl
-	 * 0xc0, VextSupply1RequestCtrl
-	 */
-	REG_INIT(AB8500_REGUREQUESTCTRL2,	0x03, 0x04, 0xfc),
-	/*
-	 * 0x03, VextSupply2RequestCtrl
-	 * 0x0c, VextSupply3RequestCtrl
-	 * 0x30, Vaux1RequestCtrl
-	 * 0xc0, Vaux2RequestCtrl
-	 */
-	REG_INIT(AB8500_REGUREQUESTCTRL3,	0x03, 0x05, 0xff),
-	/*
-	 * 0x03, Vaux3RequestCtrl
-	 * 0x04, SwHPReq
-	 */
-	REG_INIT(AB8500_REGUREQUESTCTRL4,	0x03, 0x06, 0x07),
-	/*
-	 * 0x08, VanaSysClkReq1HPValid
-	 * 0x20, Vaux1SysClkReq1HPValid
-	 * 0x40, Vaux2SysClkReq1HPValid
-	 * 0x80, Vaux3SysClkReq1HPValid
-	 */
-	REG_INIT(AB8500_REGUSYSCLKREQ1HPVALID1,	0x03, 0x07, 0xe8),
-	/*
-	 * 0x10, VextSupply1SysClkReq1HPValid
-	 * 0x20, VextSupply2SysClkReq1HPValid
-	 * 0x40, VextSupply3SysClkReq1HPValid
-	 */
-	REG_INIT(AB8500_REGUSYSCLKREQ1HPVALID2,	0x03, 0x08, 0x70),
-	/*
-	 * 0x08, VanaHwHPReq1Valid
-	 * 0x20, Vaux1HwHPReq1Valid
-	 * 0x40, Vaux2HwHPReq1Valid
-	 * 0x80, Vaux3HwHPReq1Valid
-	 */
-	REG_INIT(AB8500_REGUHWHPREQ1VALID1,	0x03, 0x09, 0xe8),
-	/*
-	 * 0x01, VextSupply1HwHPReq1Valid
-	 * 0x02, VextSupply2HwHPReq1Valid
-	 * 0x04, VextSupply3HwHPReq1Valid
-	 */
-	REG_INIT(AB8500_REGUHWHPREQ1VALID2,	0x03, 0x0a, 0x07),
-	/*
-	 * 0x08, VanaHwHPReq2Valid
-	 * 0x20, Vaux1HwHPReq2Valid
-	 * 0x40, Vaux2HwHPReq2Valid
-	 * 0x80, Vaux3HwHPReq2Valid
-	 */
-	REG_INIT(AB8500_REGUHWHPREQ2VALID1,	0x03, 0x0b, 0xe8),
-	/*
-	 * 0x01, VextSupply1HwHPReq2Valid
-	 * 0x02, VextSupply2HwHPReq2Valid
-	 * 0x04, VextSupply3HwHPReq2Valid
-	 */
-	REG_INIT(AB8500_REGUHWHPREQ2VALID2,	0x03, 0x0c, 0x07),
-	/*
-	 * 0x20, VanaSwHPReqValid
-	 * 0x80, Vaux1SwHPReqValid
-	 */
-	REG_INIT(AB8500_REGUSWHPREQVALID1,	0x03, 0x0d, 0xa0),
-	/*
-	 * 0x01, Vaux2SwHPReqValid
-	 * 0x02, Vaux3SwHPReqValid
-	 * 0x04, VextSupply1SwHPReqValid
-	 * 0x08, VextSupply2SwHPReqValid
-	 * 0x10, VextSupply3SwHPReqValid
-	 */
-	REG_INIT(AB8500_REGUSWHPREQVALID2,	0x03, 0x0e, 0x1f),
-	/*
-	 * 0x02, SysClkReq2Valid1
-	 * ...
-	 * 0x80, SysClkReq8Valid1
-	 */
-	REG_INIT(AB8500_REGUSYSCLKREQVALID1,	0x03, 0x0f, 0xfe),
-	/*
-	 * 0x02, SysClkReq2Valid2
-	 * ...
-	 * 0x80, SysClkReq8Valid2
-	 */
-	REG_INIT(AB8500_REGUSYSCLKREQVALID2,	0x03, 0x10, 0xfe),
-	/*
-	 * 0x02, VTVoutEna
-	 * 0x04, Vintcore12Ena
-	 * 0x38, Vintcore12Sel
-	 * 0x40, Vintcore12LP
-	 * 0x80, VTVoutLP
-	 */
-	REG_INIT(AB8500_REGUMISC1,		0x03, 0x80, 0xfe),
-	/*
-	 * 0x02, VaudioEna
-	 * 0x04, VdmicEna
-	 * 0x08, Vamic1Ena
-	 * 0x10, Vamic2Ena
-	 */
-	REG_INIT(AB8500_VAUDIOSUPPLY,		0x03, 0x83, 0x1e),
-	/*
-	 * 0x01, Vamic1_dzout
-	 * 0x02, Vamic2_dzout
-	 */
-	REG_INIT(AB8500_REGUCTRL1VAMIC,		0x03, 0x84, 0x03),
-	/*
-	 * 0x0c, VanaRegu
-	 * 0x03, VpllRegu
-	 */
-	REG_INIT(AB8500_VPLLVANAREGU,		0x04, 0x06, 0x0f),
-	/*
-	 * 0x01, VrefDDREna
-	 * 0x02, VrefDDRSleepMode
-	 */
-	REG_INIT(AB8500_VREFDDR,		0x04, 0x07, 0x03),
-	/*
-	 * 0x03, VextSupply1Regu
-	 * 0x0c, VextSupply2Regu
-	 * 0x30, VextSupply3Regu
-	 * 0x40, ExtSupply2Bypass
-	 * 0x80, ExtSupply3Bypass
-	 */
-	REG_INIT(AB8500_EXTSUPPLYREGU,		0x04, 0x08, 0xff),
-	/*
-	 * 0x03, Vaux1Regu
-	 * 0x0c, Vaux2Regu
-	 */
-	REG_INIT(AB8500_VAUX12REGU,		0x04, 0x09, 0x0f),
-	/*
-	 * 0x03, Vaux3Regu
-	 */
-	REG_INIT(AB8500_VRF1VAUX3REGU,		0x04, 0x0a, 0x03),
-	/*
-	 * 0x3f, Vsmps1Sel1
-	 */
-	REG_INIT(AB8500_VSMPS1SEL1,		0x04, 0x13, 0x3f),
-	/*
-	 * 0x0f, Vaux1Sel
-	 */
-	REG_INIT(AB8500_VAUX1SEL,		0x04, 0x1f, 0x0f),
-	/*
-	 * 0x0f, Vaux2Sel
-	 */
-	REG_INIT(AB8500_VAUX2SEL,		0x04, 0x20, 0x0f),
-	/*
-	 * 0x07, Vaux3Sel
-	 */
-	REG_INIT(AB8500_VRF1VAUX3SEL,		0x04, 0x21, 0x07),
-	/*
-	 * 0x01, VextSupply12LP
-	 */
-	REG_INIT(AB8500_REGUCTRL2SPARE,		0x04, 0x22, 0x01),
-	/*
-	 * 0x04, Vaux1Disch
-	 * 0x08, Vaux2Disch
-	 * 0x10, Vaux3Disch
-	 * 0x20, Vintcore12Disch
-	 * 0x40, VTVoutDisch
-	 * 0x80, VaudioDisch
-	 */
-	REG_INIT(AB8500_REGUCTRLDISCH,		0x04, 0x43, 0xfc),
-	/*
-	 * 0x02, VanaDisch
-	 * 0x04, VdmicPullDownEna
-	 * 0x10, VdmicDisch
-	 */
-	REG_INIT(AB8500_REGUCTRLDISCH2,		0x04, 0x44, 0x16),
-};
-
-static __devinit int
-ab8500_regulator_init_registers(struct platform_device *pdev, int id, int value)
-{
-	int err;
-
-	if (value & ~ab8500_reg_init[id].mask) {
-		dev_err(&pdev->dev,
-			"Configuration error: value outside mask.\n");
-		return -EINVAL;
-	}
-
-	err = abx500_mask_and_set_register_interruptible(
-		&pdev->dev,
-		ab8500_reg_init[id].bank,
-		ab8500_reg_init[id].addr,
-		ab8500_reg_init[id].mask,
-		value);
-	if (err < 0) {
-		dev_err(&pdev->dev,
-			"Failed to initialize 0x%02x, 0x%02x.\n",
-			ab8500_reg_init[id].bank,
-			ab8500_reg_init[id].addr);
-		return err;
-	}
-
-	dev_vdbg(&pdev->dev,
-		"init: 0x%02x, 0x%02x, 0x%02x, 0x%02x\n",
-		ab8500_reg_init[id].bank,
-		ab8500_reg_init[id].addr,
-		ab8500_reg_init[id].mask,
-		value);
-
-	return 0;
-}
-
 static __devinit int ab8500_regulator_register(struct platform_device *pdev,
 					struct regulator_init_data *init_data,
 					int id,
@@ -860,25 +645,6 @@ static __devinit int ab8500_regulator_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	/* initialize registers */
-	for (i = 0; i < pdata->num_regulator_reg_init; i++) {
-		int id, value;
-
-		id = pdata->regulator_reg_init[i].id;
-		value = pdata->regulator_reg_init[i].value;
-
-		/* check for configuration errors */
-		if (id >= AB8500_NUM_REGULATOR_REGISTERS) {
-			dev_err(&pdev->dev,
-				"Configuration error: id outside range.\n");
-			return -EINVAL;
-		}
-
-		err = ab8500_regulator_init_registers(pdev, id, value);
-		if (err < 0)
-			return err;
-	}
-
 	/* register all regulators */
 	for (i = 0; i < ARRAY_SIZE(ab8500_regulator_info); i++) {
 		err = ab8500_regulator_register(pdev, &pdata->regulator[i], i, NULL);
diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h
index 7bd73bb..0e89945 100644
--- a/include/linux/regulator/ab8500.h
+++ b/include/linux/regulator/ab8500.h
@@ -45,18 +45,6 @@ enum ab9540_regulator_id {
 	AB9540_NUM_REGULATORS,
 };
 
-/* AB8500 and AB9540 register initialization */
-struct ab8500_regulator_reg_init {
-	int id;
-	u8 value;
-};
-
-#define INIT_REGULATOR_REGISTER(_id, _value)	\
-	{					\
-		.id = _id,			\
-		.value = _value,		\
-	}
-
 /* AB8500 registers */
 enum ab8500_regulator_reg {
 	AB8500_REGUREQUESTCTRL2,
-- 
1.7.9.5

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

* [PATCH 09/15] pinctrl: pinctrl-nomadik: Fix possible memory leak
  2012-06-20 12:56 [PATCH 00/15] Device Tree related re-works and clean-ups Lee Jones
                   ` (7 preceding siblings ...)
  2012-06-20 12:56 ` [PATCH 08/15] regulator: Stop initialising AB8500's registers during bring-up Lee Jones
@ 2012-06-20 12:56 ` Lee Jones
  2012-06-20 12:56 ` [PATCH 10/15] pinctrl: pinctrl-nomadik: Append sleepmode property with vendor specific prefixes Lee Jones
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 40+ messages in thread
From: Lee Jones @ 2012-06-20 12:56 UTC (permalink / raw)
  To: linux-arm-kernel

If the Nomadik Pin Control driver is continuously bound and unbound
from the same device a number of times the kzalloc() will leak
memory. Replacing it with devm_kzalloc() will ensure memory is
freed automatically in the event of failure and unbinding.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/pinctrl/pinctrl-nomadik.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c
index b26395d..e297499 100644
--- a/drivers/pinctrl/pinctrl-nomadik.c
+++ b/drivers/pinctrl/pinctrl-nomadik.c
@@ -1194,7 +1194,7 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
 	}
 
 	if (np) {
-		pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
+		pdata = devm_kzalloc(&dev->dev, sizeof(*pdata), GFP_KERNEL);
 		if (!pdata)
 			return -ENOMEM;
 
-- 
1.7.9.5

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

* [PATCH 10/15] pinctrl: pinctrl-nomadik: Append sleepmode property with vendor specific prefixes
  2012-06-20 12:56 [PATCH 00/15] Device Tree related re-works and clean-ups Lee Jones
                   ` (8 preceding siblings ...)
  2012-06-20 12:56 ` [PATCH 09/15] pinctrl: pinctrl-nomadik: Fix possible memory leak Lee Jones
@ 2012-06-20 12:56 ` Lee Jones
  2012-06-20 12:56 ` [PATCH 11/15] ARM: ux500: Remove AB8500 regulator register initialisation information Lee Jones
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 40+ messages in thread
From: Lee Jones @ 2012-06-20 12:56 UTC (permalink / raw)
  To: linux-arm-kernel

Any non-standard property should contain the vendor's identifier which
should be perpended onto the property name followed by a comma. This
aids in name-space collision prevention. This patch ensures the
sleepmode property adheres to the rules.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 .../devicetree/bindings/gpio/gpio-nmk.txt          |    2 +-
 drivers/pinctrl/pinctrl-nomadik.c                  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/gpio/gpio-nmk.txt b/Documentation/devicetree/bindings/gpio/gpio-nmk.txt
index ee87467..8315ac7 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-nmk.txt
+++ b/Documentation/devicetree/bindings/gpio/gpio-nmk.txt
@@ -26,6 +26,6 @@ Example:
                         #gpio-cells = <2>;
                         gpio-controller;
                         interrupt-controller;
-                        supports-sleepmode;
+                        st,supports-sleepmode;
                         gpio-bank = <1>;
                 };
diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c
index e297499..8ca100d 100644
--- a/drivers/pinctrl/pinctrl-nomadik.c
+++ b/drivers/pinctrl/pinctrl-nomadik.c
@@ -1198,7 +1198,7 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
 		if (!pdata)
 			return -ENOMEM;
 
-		if (of_get_property(np, "supports-sleepmode", NULL))
+		if (of_get_property(np, "st,supports-sleepmode", NULL))
 			pdata->supports_sleepmode = true;
 
 		if (of_property_read_u32(np, "gpio-bank", &dev->id)) {
-- 
1.7.9.5

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

* [PATCH 11/15] ARM: ux500: Remove AB8500 regulator register initialisation information
  2012-06-20 12:56 [PATCH 00/15] Device Tree related re-works and clean-ups Lee Jones
                   ` (9 preceding siblings ...)
  2012-06-20 12:56 ` [PATCH 10/15] pinctrl: pinctrl-nomadik: Append sleepmode property with vendor specific prefixes Lee Jones
@ 2012-06-20 12:56 ` Lee Jones
  2012-06-20 12:56 ` [PATCH 12/15] ARM: ux500: Ensure vendor specific properties have the vendor's identifier Lee Jones
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 40+ messages in thread
From: Lee Jones @ 2012-06-20 12:56 UTC (permalink / raw)
  To: linux-arm-kernel

There is no need to initialise the AB8500's regulator registers, as
most of this work is already carried out by framework features, so
we can safely remove all traces from platform code.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/mach-ux500/board-mop500-regulators.c |  176 -------------------------
 arch/arm/mach-ux500/board-mop500-regulators.h |    2 -
 arch/arm/mach-ux500/board-mop500.c            |    2 -
 include/linux/mfd/abx500/ab8500.h             |    3 -
 4 files changed, 183 deletions(-)

diff --git a/arch/arm/mach-ux500/board-mop500-regulators.c b/arch/arm/mach-ux500/board-mop500-regulators.c
index 52426a4..ff43788 100644
--- a/arch/arm/mach-ux500/board-mop500-regulators.c
+++ b/arch/arm/mach-ux500/board-mop500-regulators.c
@@ -106,182 +106,6 @@ static struct regulator_consumer_supply ab8500_vana_consumers[] = {
 	REGULATOR_SUPPLY("vsmps2", "mcde.0"),
 };
 
-/* ab8500 regulator register initialization */
-struct ab8500_regulator_reg_init
-ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS] = {
-	/*
-	 * VanaRequestCtrl          = HP/LP depending on VxRequest
-	 * VextSupply1RequestCtrl   = HP/LP depending on VxRequest
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL2, 0x00),
-	/*
-	 * VextSupply2RequestCtrl   = HP/LP depending on VxRequest
-	 * VextSupply3RequestCtrl   = HP/LP depending on VxRequest
-	 * Vaux1RequestCtrl         = HP/LP depending on VxRequest
-	 * Vaux2RequestCtrl         = HP/LP depending on VxRequest
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL3, 0x00),
-	/*
-	 * Vaux3RequestCtrl         = HP/LP depending on VxRequest
-	 * SwHPReq                  = Control through SWValid disabled
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL4, 0x00),
-	/*
-	 * VanaSysClkReq1HPValid    = disabled
-	 * Vaux1SysClkReq1HPValid   = disabled
-	 * Vaux2SysClkReq1HPValid   = disabled
-	 * Vaux3SysClkReq1HPValid   = disabled
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID1, 0x00),
-	/*
-	 * VextSupply1SysClkReq1HPValid = disabled
-	 * VextSupply2SysClkReq1HPValid = disabled
-	 * VextSupply3SysClkReq1HPValid = SysClkReq1 controlled
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID2, 0x40),
-	/*
-	 * VanaHwHPReq1Valid        = disabled
-	 * Vaux1HwHPreq1Valid       = disabled
-	 * Vaux2HwHPReq1Valid       = disabled
-	 * Vaux3HwHPReqValid        = disabled
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID1, 0x00),
-	/*
-	 * VextSupply1HwHPReq1Valid = disabled
-	 * VextSupply2HwHPReq1Valid = disabled
-	 * VextSupply3HwHPReq1Valid = disabled
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID2, 0x00),
-	/*
-	 * VanaHwHPReq2Valid        = disabled
-	 * Vaux1HwHPReq2Valid       = disabled
-	 * Vaux2HwHPReq2Valid       = disabled
-	 * Vaux3HwHPReq2Valid       = disabled
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID1, 0x00),
-	/*
-	 * VextSupply1HwHPReq2Valid = disabled
-	 * VextSupply2HwHPReq2Valid = disabled
-	 * VextSupply3HwHPReq2Valid = HWReq2 controlled
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID2, 0x04),
-	/*
-	 * VanaSwHPReqValid         = disabled
-	 * Vaux1SwHPReqValid        = disabled
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID1, 0x00),
-	/*
-	 * Vaux2SwHPReqValid        = disabled
-	 * Vaux3SwHPReqValid        = disabled
-	 * VextSupply1SwHPReqValid  = disabled
-	 * VextSupply2SwHPReqValid  = disabled
-	 * VextSupply3SwHPReqValid  = disabled
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID2, 0x00),
-	/*
-	 * SysClkReq2Valid1         = SysClkReq2 controlled
-	 * SysClkReq3Valid1         = disabled
-	 * SysClkReq4Valid1         = SysClkReq4 controlled
-	 * SysClkReq5Valid1         = disabled
-	 * SysClkReq6Valid1         = SysClkReq6 controlled
-	 * SysClkReq7Valid1         = disabled
-	 * SysClkReq8Valid1         = disabled
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID1, 0x2a),
-	/*
-	 * SysClkReq2Valid2         = disabled
-	 * SysClkReq3Valid2         = disabled
-	 * SysClkReq4Valid2         = disabled
-	 * SysClkReq5Valid2         = disabled
-	 * SysClkReq6Valid2         = SysClkReq6 controlled
-	 * SysClkReq7Valid2         = disabled
-	 * SysClkReq8Valid2         = disabled
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID2, 0x20),
-	/*
-	 * VTVoutEna                = disabled
-	 * Vintcore12Ena            = disabled
-	 * Vintcore12Sel            = 1.25 V
-	 * Vintcore12LP             = inactive (HP)
-	 * VTVoutLP                 = inactive (HP)
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_REGUMISC1, 0x10),
-	/*
-	 * VaudioEna                = disabled
-	 * VdmicEna                 = disabled
-	 * Vamic1Ena                = disabled
-	 * Vamic2Ena                = disabled
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_VAUDIOSUPPLY, 0x00),
-	/*
-	 * Vamic1_dzout             = high-Z when Vamic1 is disabled
-	 * Vamic2_dzout             = high-Z when Vamic2 is disabled
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_REGUCTRL1VAMIC, 0x00),
-	/*
-	 * VPll                     = Hw controlled
-	 * VanaRegu                 = force off
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_VPLLVANAREGU, 0x02),
-	/*
-	 * VrefDDREna               = disabled
-	 * VrefDDRSleepMode         = inactive (no pulldown)
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_VREFDDR, 0x00),
-	/*
-	 * VextSupply1Regu          = HW control
-	 * VextSupply2Regu          = HW control
-	 * VextSupply3Regu          = HW control
-	 * ExtSupply2Bypass         = ExtSupply12LPn ball is 0 when Ena is 0
-	 * ExtSupply3Bypass         = ExtSupply3LPn ball is 0 when Ena is 0
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_EXTSUPPLYREGU, 0x2a),
-	/*
-	 * Vaux1Regu                = force HP
-	 * Vaux2Regu                = force off
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_VAUX12REGU, 0x01),
-	/*
-	 * Vaux3regu                = force off
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3REGU, 0x00),
-	/*
-	 * Vsmps1                   = 1.15V
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_VSMPS1SEL1, 0x24),
-	/*
-	 * Vaux1Sel                 = 2.5 V
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_VAUX1SEL, 0x08),
-	/*
-	 * Vaux2Sel                 = 2.9 V
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_VAUX2SEL, 0x0d),
-	/*
-	 * Vaux3Sel                 = 2.91 V
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3SEL, 0x07),
-	/*
-	 * VextSupply12LP           = disabled (no LP)
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_REGUCTRL2SPARE, 0x00),
-	/*
-	 * Vaux1Disch               = short discharge time
-	 * Vaux2Disch               = short discharge time
-	 * Vaux3Disch               = short discharge time
-	 * Vintcore12Disch          = short discharge time
-	 * VTVoutDisch              = short discharge time
-	 * VaudioDisch              = short discharge time
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH, 0x00),
-	/*
-	 * VanaDisch                = short discharge time
-	 * VdmicPullDownEna         = pulldown disabled when Vdmic is disabled
-	 * VdmicDisch               = short discharge time
-	 */
-	INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH2, 0x00),
-};
-
 /* AB8500 regulators */
 struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS] = {
 	/* supplies to the display/camera */
diff --git a/arch/arm/mach-ux500/board-mop500-regulators.h b/arch/arm/mach-ux500/board-mop500-regulators.h
index 9499215..a795cec 100644
--- a/arch/arm/mach-ux500/board-mop500-regulators.h
+++ b/arch/arm/mach-ux500/board-mop500-regulators.h
@@ -14,8 +14,6 @@
 #include <linux/regulator/machine.h>
 #include <linux/regulator/ab8500.h>
 
-extern struct ab8500_regulator_reg_init
-ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS];
 extern struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS];
 extern struct regulator_init_data tps61052_regulator;
 
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 0bae853..3871162 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -190,8 +190,6 @@ static struct platform_device snowball_sbnet_dev = {
 
 static struct ab8500_platform_data ab8500_platdata = {
 	.irq_base	= MOP500_AB8500_IRQ_BASE,
-	.regulator_reg_init = ab8500_regulator_reg_init,
-	.num_regulator_reg_init	= ARRAY_SIZE(ab8500_regulator_reg_init),
 	.regulator	= ab8500_regulators,
 	.num_regulator	= ARRAY_SIZE(ab8500_regulators),
 	.gpio		= &ab8500_gpio_pdata,
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h
index 4ae2cd9..795a3be 100644
--- a/include/linux/mfd/abx500/ab8500.h
+++ b/include/linux/mfd/abx500/ab8500.h
@@ -266,7 +266,6 @@ struct ab8500 {
 	const int *irq_reg_offset;
 };
 
-struct regulator_reg_init;
 struct regulator_init_data;
 struct ab8500_gpio_platform_data;
 
@@ -282,8 +281,6 @@ struct ab8500_gpio_platform_data;
 struct ab8500_platform_data {
 	int irq_base;
 	void (*init) (struct ab8500 *);
-	int num_regulator_reg_init;
-	struct ab8500_regulator_reg_init *regulator_reg_init;
 	int num_regulator;
 	struct regulator_init_data *regulator;
 	struct ab8500_gpio_platform_data *gpio;
-- 
1.7.9.5

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

* [PATCH 12/15] ARM: ux500: Ensure vendor specific properties have the vendor's identifier
  2012-06-20 12:56 [PATCH 00/15] Device Tree related re-works and clean-ups Lee Jones
                   ` (10 preceding siblings ...)
  2012-06-20 12:56 ` [PATCH 11/15] ARM: ux500: Remove AB8500 regulator register initialisation information Lee Jones
@ 2012-06-20 12:56 ` Lee Jones
  2012-06-20 12:56 ` [PATCH 13/15] ARM: ux500: Remove temporary snowball_of_platform_devs enablement structure Lee Jones
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 40+ messages in thread
From: Lee Jones @ 2012-06-20 12:56 UTC (permalink / raw)
  To: linux-arm-kernel

Any non-standard property should contain the vendor's identifier which
should be perpended onto the property name followed by a comma. This
aids in name-space collision prevention.

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

diff --git a/arch/arm/boot/dts/db8500.dtsi b/arch/arm/boot/dts/db8500.dtsi
index d89b88d..7279165 100644
--- a/arch/arm/boot/dts/db8500.dtsi
+++ b/arch/arm/boot/dts/db8500.dtsi
@@ -60,7 +60,7 @@
 			interrupts = <0 119 0x4>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			supports-sleepmode;
+			st,supports-sleepmode;
 			gpio-controller;
 			#gpio-cells = <2>;
 			gpio-bank = <0>;
@@ -73,7 +73,7 @@
 			interrupts = <0 120 0x4>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			supports-sleepmode;
+			st,supports-sleepmode;
 			gpio-controller;
 			#gpio-cells = <2>;
 			gpio-bank = <1>;
@@ -86,7 +86,7 @@
 			interrupts = <0 121 0x4>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			supports-sleepmode;
+			st,supports-sleepmode;
 			gpio-controller;
 			#gpio-cells = <2>;
 			gpio-bank = <2>;
@@ -99,7 +99,7 @@
 			interrupts = <0 122 0x4>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			supports-sleepmode;
+			st,supports-sleepmode;
 			gpio-controller;
 			#gpio-cells = <2>;
 			gpio-bank = <3>;
@@ -112,7 +112,7 @@
 			interrupts = <0 123 0x4>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			supports-sleepmode;
+			st,supports-sleepmode;
 			gpio-controller;
 			#gpio-cells = <2>;
 			gpio-bank = <4>;
@@ -125,7 +125,7 @@
 			interrupts = <0 124 0x4>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			supports-sleepmode;
+			st,supports-sleepmode;
 			gpio-controller;
 			#gpio-cells = <2>;
 			gpio-bank = <5>;
@@ -138,7 +138,7 @@
 			interrupts = <0 125 0x4>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			supports-sleepmode;
+			st,supports-sleepmode;
 			gpio-controller;
 			#gpio-cells = <2>;
 			gpio-bank = <6>;
@@ -151,7 +151,7 @@
 			interrupts = <0 126 0x4>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			supports-sleepmode;
+			st,supports-sleepmode;
 			gpio-controller;
 			#gpio-cells = <2>;
 			gpio-bank = <7>;
@@ -164,7 +164,7 @@
 			interrupts = <0 127 0x4>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			supports-sleepmode;
+			st,supports-sleepmode;
 			gpio-controller;
 			#gpio-cells = <2>;
 			gpio-bank = <8>;
-- 
1.7.9.5

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

* [PATCH 13/15] ARM: ux500: Remove temporary snowball_of_platform_devs enablement structure
  2012-06-20 12:56 [PATCH 00/15] Device Tree related re-works and clean-ups Lee Jones
                   ` (11 preceding siblings ...)
  2012-06-20 12:56 ` [PATCH 12/15] ARM: ux500: Ensure vendor specific properties have the vendor's identifier Lee Jones
@ 2012-06-20 12:56 ` Lee Jones
  2012-06-20 12:56 ` [PATCH 14/15] ARM: ux500: Remove PMU platform registration when booting with DT Lee Jones
  2012-06-20 12:56 ` [PATCH 15/15] ARM: perf: handle muxed CPU IRQ lines Lee Jones
  14 siblings, 0 replies; 40+ messages in thread
From: Lee Jones @ 2012-06-20 12:56 UTC (permalink / raw)
  To: linux-arm-kernel

All Device Tree enablement for Snowball's Platform  devices; LEDs, Keys,
Ethernet and all associated AB8500 Multi-Functional Devices are now
complete, so here we remove any trace of adding those devices when Device
Tree is enabled.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/mach-ux500/board-mop500.c |   17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 3871162..0c5a69b 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -783,10 +783,6 @@ MACHINE_END
 
 #ifdef CONFIG_MACH_UX500_DT
 
-static struct platform_device *snowball_of_platform_devs[] __initdata = {
-	&snowball_key_dev,
-};
-
 struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
 	/* Requires DMA and call-back bindings. */
 	OF_DEV_AUXDATA("arm,pl011", 0x80120000, "uart0", &uart0_plat),
@@ -840,8 +836,6 @@ static void __init u8500_init_machine(void)
 
 	for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++)
 		mop500_platform_devs[i]->dev.parent = parent;
-	for (i = 0; i < ARRAY_SIZE(snowball_platform_devs); i++)
-		snowball_platform_devs[i]->dev.parent = parent;
 
 	/* automatically probe child nodes of db8500 device */
 	of_platform_populate(NULL, u8500_local_bus_nodes, u8500_auxdata_lookup, parent);
@@ -860,17 +854,6 @@ static void __init u8500_init_machine(void)
 
 		mop500_uib_init();
 
-	} else if (of_machine_is_compatible("calaosystems,snowball-a9500")) {
-		/*
-		 * Devices to be DT:ed:
-		 *   snowball_led_dev   = done
-		 *   snowball_key_dev   = todo
-		 *   snowball_sbnet_dev = done
-		 *   ab8500_device      = done
-		 */
-		platform_add_devices(snowball_of_platform_devs,
-				ARRAY_SIZE(snowball_of_platform_devs));
-
 	} else if (of_machine_is_compatible("st-ericsson,hrefv60+")) {
 		/*
 		 * The HREFv60 board removed a GPIO expander and routed
-- 
1.7.9.5

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

* [PATCH 14/15] ARM: ux500: Remove PMU platform registration when booting with DT
  2012-06-20 12:56 [PATCH 00/15] Device Tree related re-works and clean-ups Lee Jones
                   ` (12 preceding siblings ...)
  2012-06-20 12:56 ` [PATCH 13/15] ARM: ux500: Remove temporary snowball_of_platform_devs enablement structure Lee Jones
@ 2012-06-20 12:56 ` Lee Jones
  2012-06-20 12:56 ` [PATCH 15/15] ARM: perf: handle muxed CPU IRQ lines Lee Jones
  14 siblings, 0 replies; 40+ messages in thread
From: Lee Jones @ 2012-06-20 12:56 UTC (permalink / raw)
  To: linux-arm-kernel

PMU registration is successfully completed by Device Tree now, so
there is no longer a requirement to register it from platform code.
This patch removes platform registration during a DT boot.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/mach-ux500/cpu-db8500.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index a12bd9e..c8dd94f 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -139,7 +139,6 @@ static struct platform_device *platform_devs[] __initdata = {
 
 static struct platform_device *of_platform_devs[] __initdata = {
 	&u8500_dma40_device,
-	&db8500_pmu_device,
 };
 
 static resource_size_t __initdata db8500_gpio_base[] = {
@@ -248,7 +247,7 @@ struct device * __init u8500_of_init_devices(void)
 	/*
 	 * Devices to be DT:ed:
 	 *   u8500_dma40_device  = todo
-	 *   db8500_pmu_device   = todo
+	 *   db8500_pmu_device   = done
 	 *   db8500_prcmu_device = done
 	 */
 	platform_add_devices(of_platform_devs, ARRAY_SIZE(of_platform_devs));
-- 
1.7.9.5

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

* [PATCH 15/15] ARM: perf: handle muxed CPU IRQ lines
  2012-06-20 12:56 [PATCH 00/15] Device Tree related re-works and clean-ups Lee Jones
                   ` (13 preceding siblings ...)
  2012-06-20 12:56 ` [PATCH 14/15] ARM: ux500: Remove PMU platform registration when booting with DT Lee Jones
@ 2012-06-20 12:56 ` Lee Jones
  2012-06-20 13:28   ` Will Deacon
  14 siblings, 1 reply; 40+ messages in thread
From: Lee Jones @ 2012-06-20 12:56 UTC (permalink / raw)
  To: linux-arm-kernel

When registering a PMU device, a platform can either use the generic
IRQ handler, or supplement it with one of its own. One of the reasons
a platform might choose to do this is to handle the case of muxed IRQ
lines. If this is the case and the IRQ is handled on the wrong CPU,
this patch sets affinity with the next successive online CPU.

Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/kernel/perf_event_v7.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/arm/kernel/perf_event_v7.c b/arch/arm/kernel/perf_event_v7.c
index d3c5360..04a8867 100644
--- a/arch/arm/kernel/perf_event_v7.c
+++ b/arch/arm/kernel/perf_event_v7.c
@@ -1069,8 +1069,18 @@ static irqreturn_t armv7pmu_handle_irq(int irq_num, void *dev)
 	/*
 	 * Did an overflow occur?
 	 */
-	if (!armv7_pmnc_has_overflowed(pmnc))
+	if (armv7_pmnc_has_overflowed(pmnc)) {
+		unsigned int next_cpu;
+
+		next_cpu = cpumask_next(smp_processor_id(), cpu_online_mask);
+
+		if (next_cpu >= nr_cpumask_bits)
+			next_cpu = cpumask_first(cpu_online_mask);
+
+		irq_set_affinity(irq_num, cpumask_of(next_cpu));
+
 		return IRQ_NONE;
+	}
 
 	/*
 	 * Handle the counter(s) overflow(s)
-- 
1.7.9.5

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

* [PATCH 08/15] regulator: Stop initialising AB8500's registers during bring-up
  2012-06-20 12:56 ` [PATCH 08/15] regulator: Stop initialising AB8500's registers during bring-up Lee Jones
@ 2012-06-20 13:08   ` Mark Brown
  2012-06-20 13:19     ` Lee Jones
  2012-06-20 13:26   ` Mark Brown
  1 sibling, 1 reply; 40+ messages in thread
From: Mark Brown @ 2012-06-20 13:08 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jun 20, 2012 at 01:56:44PM +0100, Lee Jones wrote:
> There is no need to initialise the AB8500's regulator registers, as
> most of this work is already carried out by framework features.

Does this have any dependency on the rest of the series?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120620/8fe6cae5/attachment.sig>

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

* [PATCH 08/15] regulator: Stop initialising AB8500's registers during bring-up
  2012-06-20 13:08   ` Mark Brown
@ 2012-06-20 13:19     ` Lee Jones
  0 siblings, 0 replies; 40+ messages in thread
From: Lee Jones @ 2012-06-20 13:19 UTC (permalink / raw)
  To: linux-arm-kernel

On 20/06/12 14:08, Mark Brown wrote:
> On Wed, Jun 20, 2012 at 01:56:44PM +0100, Lee Jones wrote:
>> There is no need to initialise the AB8500's regulator registers, as
>> most of this work is already carried out by framework features.
>
> Does this have any dependency on the rest of the series?

Unfortunately yes.

It needs the "ARM: ux500:" stuff to go in first.

-- 
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] 40+ messages in thread

* [PATCH 08/15] regulator: Stop initialising AB8500's registers during bring-up
  2012-06-20 12:56 ` [PATCH 08/15] regulator: Stop initialising AB8500's registers during bring-up Lee Jones
  2012-06-20 13:08   ` Mark Brown
@ 2012-06-20 13:26   ` Mark Brown
  1 sibling, 0 replies; 40+ messages in thread
From: Mark Brown @ 2012-06-20 13:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jun 20, 2012 at 01:56:44PM +0100, Lee Jones wrote:
> There is no need to initialise the AB8500's regulator registers, as
> most of this work is already carried out by framework features.

Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120620/8ab4b0f3/attachment.sig>

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

* [PATCH 15/15] ARM: perf: handle muxed CPU IRQ lines
  2012-06-20 12:56 ` [PATCH 15/15] ARM: perf: handle muxed CPU IRQ lines Lee Jones
@ 2012-06-20 13:28   ` Will Deacon
  2012-06-20 13:44     ` Lee Jones
  0 siblings, 1 reply; 40+ messages in thread
From: Will Deacon @ 2012-06-20 13:28 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Lee,

On Wed, Jun 20, 2012 at 01:56:51PM +0100, Lee Jones wrote:
> When registering a PMU device, a platform can either use the generic
> IRQ handler, or supplement it with one of its own. One of the reasons
> a platform might choose to do this is to handle the case of muxed IRQ
> lines. If this is the case and the IRQ is handled on the wrong CPU,
> this patch sets affinity with the next successive online CPU.
> 
> Cc: Will Deacon <will.deacon@arm.com>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  arch/arm/kernel/perf_event_v7.c |   12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/kernel/perf_event_v7.c b/arch/arm/kernel/perf_event_v7.c
> index d3c5360..04a8867 100644
> --- a/arch/arm/kernel/perf_event_v7.c
> +++ b/arch/arm/kernel/perf_event_v7.c
> @@ -1069,8 +1069,18 @@ static irqreturn_t armv7pmu_handle_irq(int irq_num, void *dev)
>  	/*
>  	 * Did an overflow occur?
>  	 */
> -	if (!armv7_pmnc_has_overflowed(pmnc))
> +	if (armv7_pmnc_has_overflowed(pmnc)) {

Did you mean to change this predicate?

> +		unsigned int next_cpu;
> +
> +		next_cpu = cpumask_next(smp_processor_id(), cpu_online_mask);
> +
> +		if (next_cpu >= nr_cpumask_bits)
> +			next_cpu = cpumask_first(cpu_online_mask);
> +
> +		irq_set_affinity(irq_num, cpumask_of(next_cpu));
> +

Shouldn't this be in the platform IRQ handler, rather than the core v7 perf
code?

Will

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

* [PATCH 15/15] ARM: perf: handle muxed CPU IRQ lines
  2012-06-20 13:28   ` Will Deacon
@ 2012-06-20 13:44     ` Lee Jones
  2012-06-20 14:01       ` Will Deacon
  0 siblings, 1 reply; 40+ messages in thread
From: Lee Jones @ 2012-06-20 13:44 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Will,

> On Wed, Jun 20, 2012 at 01:56:51PM +0100, Lee Jones wrote:
>> When registering a PMU device, a platform can either use the generic
>> IRQ handler, or supplement it with one of its own. One of the reasons
>> a platform might choose to do this is to handle the case of muxed IRQ
>> lines. If this is the case and the IRQ is handled on the wrong CPU,
>> this patch sets affinity with the next successive online CPU.
>>
>> Cc: Will Deacon<will.deacon@arm.com>
>> Signed-off-by: Lee Jones<lee.jones@linaro.org>
>> ---
>>   arch/arm/kernel/perf_event_v7.c |   12 +++++++++++-
>>   1 file changed, 11 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/kernel/perf_event_v7.c b/arch/arm/kernel/perf_event_v7.c
>> index d3c5360..04a8867 100644
>> --- a/arch/arm/kernel/perf_event_v7.c
>> +++ b/arch/arm/kernel/perf_event_v7.c
>> @@ -1069,8 +1069,18 @@ static irqreturn_t armv7pmu_handle_irq(int irq_num, void *dev)
>>   	/*
>>   	 * Did an overflow occur?
>>   	 */
>> -	if (!armv7_pmnc_has_overflowed(pmnc))
>> +	if (armv7_pmnc_has_overflowed(pmnc)) {
>
> Did you mean to change this predicate?

No sorry, that's a mistake.

>> +		unsigned int next_cpu;
>> +
>> +		next_cpu = cpumask_next(smp_processor_id(), cpu_online_mask);
>> +
>> +		if (next_cpu>= nr_cpumask_bits)
>> +			next_cpu = cpumask_first(cpu_online_mask);
>> +
>> +		irq_set_affinity(irq_num, cpumask_of(next_cpu));
>> +
>
> Shouldn't this be in the platform IRQ handler, rather than the core v7 perf
> code?

Well that's where it currently resides, but in the process of DT:ing the 
platform, we have no real way to set the call-back. Normally, if it's 
absolutely necessary, we do this with AUXDATA. However in the PMU case 
we fall-down as a device address is required for DT look-up, which the 
PMU does not have.

I spoke with Arnd about sensible solutions and he suggested placing the 
logic inside the generic instead, thus supporting muxed IRQ lines 
without the requirement of providing a platform specific handler in 
every instance this occurs (although, I think the ux500 are the only 
platform to do this currently).

I'd be happy to take any other suggestions, but this seemed fairly neat 
and unobtrusive (not withstanding the predicate cock-up).

-- 
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] 40+ messages in thread

* [PATCH 15/15] ARM: perf: handle muxed CPU IRQ lines
  2012-06-20 13:44     ` Lee Jones
@ 2012-06-20 14:01       ` Will Deacon
  2012-06-20 14:13         ` Lee Jones
  0 siblings, 1 reply; 40+ messages in thread
From: Will Deacon @ 2012-06-20 14:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jun 20, 2012 at 02:44:50PM +0100, Lee Jones wrote:
> >
> > Shouldn't this be in the platform IRQ handler, rather than the core v7 perf
> > code?
> 
> Well that's where it currently resides, but in the process of DT:ing the 
> platform, we have no real way to set the call-back. Normally, if it's 
> absolutely necessary, we do this with AUXDATA. However in the PMU case 
> we fall-down as a device address is required for DT look-up, which the 
> PMU does not have.

Right, so I suspect this is going to be a huge problem for the OMAP guys,
where they have to do a fair amount of jiggery-pokery to kick their PMU into
action. We are also looking to put suspend/resume hooks into the
arm_pmu_platdata which will undoubtedly be highly platform-specific.

> I spoke with Arnd about sensible solutions and he suggested placing the 
> logic inside the generic instead, thus supporting muxed IRQ lines 
> without the requirement of providing a platform specific handler in 
> every instance this occurs (although, I think the ux500 are the only 
> platform to do this currently).

Whilst this code isn't too problematic (but yes, you are the only platform
that needs it) I think if we solve the bigger problem then you can use the
same solution to do your IRQ ping-ponging.

> I'd be happy to take any other suggestions, but this seemed fairly neat 
> and unobtrusive (not withstanding the predicate cock-up).

Can we not fix the AUXDATA stuff to assume address 0 if it's not present for
the matching node? This will work for perf as I don't expect to have
multiple nodes with the same compatible string for PMUs that are not
memory-mapped (for big.LITTLE, the strings will be different).

Will

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

* [PATCH 15/15] ARM: perf: handle muxed CPU IRQ lines
  2012-06-20 14:01       ` Will Deacon
@ 2012-06-20 14:13         ` Lee Jones
  0 siblings, 0 replies; 40+ messages in thread
From: Lee Jones @ 2012-06-20 14:13 UTC (permalink / raw)
  To: linux-arm-kernel

On 20/06/12 15:01, Will Deacon wrote:
> On Wed, Jun 20, 2012 at 02:44:50PM +0100, Lee Jones wrote:
>>>
>>> Shouldn't this be in the platform IRQ handler, rather than the core v7 perf
>>> code?
>>
>> Well that's where it currently resides, but in the process of DT:ing the
>> platform, we have no real way to set the call-back. Normally, if it's
>> absolutely necessary, we do this with AUXDATA. However in the PMU case
>> we fall-down as a device address is required for DT look-up, which the
>> PMU does not have.
>
> Right, so I suspect this is going to be a huge problem for the OMAP guys,
> where they have to do a fair amount of jiggery-pokery to kick their PMU into
> action. We are also looking to put suspend/resume hooks into the
> arm_pmu_platdata which will undoubtedly be highly platform-specific.
>
>> I spoke with Arnd about sensible solutions and he suggested placing the
>> logic inside the generic instead, thus supporting muxed IRQ lines
>> without the requirement of providing a platform specific handler in
>> every instance this occurs (although, I think the ux500 are the only
>> platform to do this currently).
>
> Whilst this code isn't too problematic (but yes, you are the only platform
> that needs it) I think if we solve the bigger problem then you can use the
> same solution to do your IRQ ping-ponging.
>
>> I'd be happy to take any other suggestions, but this seemed fairly neat
>> and unobtrusive (not withstanding the predicate cock-up).
>
> Can we not fix the AUXDATA stuff to assume address 0 if it's not present for
> the matching node? This will work for perf as I don't expect to have
> multiple nodes with the same compatible string for PMUs that are not
> memory-mapped (for big.LITTLE, the strings will be different).

Okay, leave it with me.

I'm off now until Monday, I'll pick it up then.

Thanks Will.

-- 
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] 40+ messages in thread

* [PATCH 07/15] i2c: Add Device Tree support to the Nomadik I2C driver
  2012-06-20 12:56 ` [PATCH 07/15] i2c: Add Device Tree support to the Nomadik I2C driver Lee Jones
@ 2012-06-20 19:30   ` Linus Walleij
  2012-06-21  6:47     ` Srinidhi Kasagar
  0 siblings, 1 reply; 40+ messages in thread
From: Linus Walleij @ 2012-06-20 19:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jun 20, 2012 at 2:56 PM, Lee Jones <lee.jones@linaro.org> wrote:

> Here we apply the bindings required for successful Device Tree
> probing of the i2c-nomadik driver. We also apply a fall-back
> configuration in case either one is not provided, or a required
> element is missing from the one supplied.
>
> Cc: linux-i2c at vger.kernel.org
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Pls Cc Srinidhi on these patches, and I would prefer to get his ACK on this.

Srinidhi, could you propose a patch to MAINTAINERS adding yourself as
explicit maintainer for this driver?

> +static struct nmk_i2c_controller u8500_i2c = {
> + ? ? ? /*
> + ? ? ? ?* Slave data setup time; 250ns, 100ns, and 10ns, which
> + ? ? ? ?* is 14, 6 and 2 respectively for a 48Mhz i2c clock.
> + ? ? ? ?*/
> + ? ? ? .slsu ? ? ? ? ? = 0xe,
> + ? ? ? .tft ? ? ? ? ? ?= 1, ? ? ?/* Tx FIFO threshold */
> + ? ? ? .rft ? ? ? ? ? ?= 8, ? ? ?/* Rx FIFO threshold */
> + ? ? ? .clk_freq ? ? ? = 100000, /* std. mode operation */

As per earlier discussion, change this default value to 400000.

> + ? ? ? .timeout ? ? ? ?= 200, ? ?/* Slave response timeout(ms) */
> + ? ? ? .sm ? ? ? ? ? ? = I2C_FREQ_MODE_FAST,
> +};

Thanks,
Lmims Walleij

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

* [PATCH 07/15] i2c: Add Device Tree support to the Nomadik I2C driver
  2012-06-20 19:30   ` Linus Walleij
@ 2012-06-21  6:47     ` Srinidhi Kasagar
  0 siblings, 0 replies; 40+ messages in thread
From: Srinidhi Kasagar @ 2012-06-21  6:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jun 20, 2012 at 21:30:17 +0200, Linus Walleij wrote:
> On Wed, Jun 20, 2012 at 2:56 PM, Lee Jones <lee.jones@linaro.org> wrote:
> 
> > Here we apply the bindings required for successful Device Tree
> > probing of the i2c-nomadik driver. We also apply a fall-back
> > configuration in case either one is not provided, or a required
> > element is missing from the one supplied.
> >
> > Cc: linux-i2c at vger.kernel.org
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> 
> Pls Cc Srinidhi on these patches, and I would prefer to get his ACK on this.

if trivial comments fixed, then

Acked-by: srinidhi kasagar <srinidhi.kasagar@stericsson.com>

> 
> Srinidhi, could you propose a patch to MAINTAINERS adding yourself as
> explicit maintainer for this driver?

ok.

/srinidhi

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

* [PATCH 01/15] mfd: Add IRQ domain support for the AB8500
  2012-06-20 12:56 ` [PATCH 01/15] mfd: Add IRQ domain support for the AB8500 Lee Jones
@ 2012-06-29 14:51   ` Samuel Ortiz
  0 siblings, 0 replies; 40+ messages in thread
From: Samuel Ortiz @ 2012-06-29 14:51 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Lee,

On Wed, Jun 20, 2012 at 01:56:37PM +0100, Lee Jones wrote:
> As the AB8500 is an IRQ controller in its own right, here we provide
> the AB8500 driver with IRQ domain support. This is required if we wish
> to reference any of its IRQs from a platform's Device Tree.
> 
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> Cc: Naga Radheshy <naga.radheshy@stericsson.com>
> Cc: Mattias Wallin <mattias.wallin@stericsson.com>
> Cc: Daniel Willerud <daniel.willerud@stericsson.com>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/mfd/Kconfig               |    1 +
>  drivers/mfd/ab8500-core.c         |  130 ++++++++++++++++++++-----------------
>  include/linux/mfd/abx500/ab8500.h |    5 ++
>  3 files changed, 76 insertions(+), 60 deletions(-)
Applied, thanks.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

* [PATCH 03/15] mfd: Make MFD core code Device Tree and IRQ domain aware
  2012-06-29 14:55   ` Samuel Ortiz
@ 2012-06-29 14:52     ` Lee Jones
  2012-06-29 18:49       ` Samuel Ortiz
  0 siblings, 1 reply; 40+ messages in thread
From: Lee Jones @ 2012-06-29 14:52 UTC (permalink / raw)
  To: linux-arm-kernel

On 29/06/12 15:55, Samuel Ortiz wrote:
> Hi Lee,
>
> On Wed, Jun 20, 2012 at 01:56:39PM +0100, Lee Jones wrote:
>> During Device Tree enablement of the ab8500 and db8500-prcmu drivers,
>> a decision was made to omit registration through the MFD API and use
>> Device Tree directly. However, because MFD devices have a different
>> address space and the ab8500 and db8500 both use I2C to communicate,
>> this causes issues with address translation during execution of
>> of_platform_populate(). So the solution is to make the MFD core aware
>> of Device Tree and have it assign the correct node pointers instead.
>>
>> To make this work the MFD core also needs to be awere of IRQ domains,
>> as Device Tree insists on IRQ domain compatibility. So, instead of
>> providing an irq-base via platform code, in the DT case we simply
>> look up the IRQ domain and map to the correct virtual IRQ.
>>
>> Cc: Samuel Ortiz <sameo@linux.intel.com>
>> Signed-off-by: Lee Jones <lee.jones@linaro.org>
>> ---
>>   drivers/mfd/mfd-core.c   |   31 +++++++++++++++++++++++++++----
>>   include/linux/mfd/core.h |    1 +
>>   2 files changed, 28 insertions(+), 4 deletions(-)
> Applied, after changing the code style a bit to make it more readable.
> Could you please provide me with a follow up patch for documenting the
> of_compatible MFD cell field, please ?

Yes, of course.

What exactly would you like? Something in Documentation/devicetree you 
mean? Or something else?

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] 40+ messages in thread

* [PATCH 02/15] mfd: Generically describe interactions with the DB8500 PRCMU
  2012-06-20 12:56 ` [PATCH 02/15] mfd: Generically describe interactions with the DB8500 PRCMU Lee Jones
@ 2012-06-29 14:53   ` Samuel Ortiz
  0 siblings, 0 replies; 40+ messages in thread
From: Samuel Ortiz @ 2012-06-29 14:53 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Lee,

On Wed, Jun 20, 2012 at 01:56:38PM +0100, Lee Jones wrote:
> There is only one method used to communicate with the DB8500 PRCMU, via I2C.
> Now this can be assumed, there is no requirement to specify the protocol in
> the function name. This patch removes protocol specifics and uses a more
> generic naming convention.
> 
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/mfd/ab8500-core.c    |   12 ++++++------
>  drivers/mfd/ab8500-debugfs.c |    6 +++---
>  2 files changed, 9 insertions(+), 9 deletions(-)
Applied, thanks.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

* [PATCH 03/15] mfd: Make MFD core code Device Tree and IRQ domain aware
  2012-06-20 12:56 ` [PATCH 03/15] mfd: Make MFD core code Device Tree and IRQ domain aware Lee Jones
@ 2012-06-29 14:55   ` Samuel Ortiz
  2012-06-29 14:52     ` Lee Jones
  0 siblings, 1 reply; 40+ messages in thread
From: Samuel Ortiz @ 2012-06-29 14:55 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Lee,

On Wed, Jun 20, 2012 at 01:56:39PM +0100, Lee Jones wrote:
> During Device Tree enablement of the ab8500 and db8500-prcmu drivers,
> a decision was made to omit registration through the MFD API and use
> Device Tree directly. However, because MFD devices have a different
> address space and the ab8500 and db8500 both use I2C to communicate,
> this causes issues with address translation during execution of
> of_platform_populate(). So the solution is to make the MFD core aware
> of Device Tree and have it assign the correct node pointers instead.
> 
> To make this work the MFD core also needs to be awere of IRQ domains,
> as Device Tree insists on IRQ domain compatibility. So, instead of
> providing an irq-base via platform code, in the DT case we simply
> look up the IRQ domain and map to the correct virtual IRQ.
> 
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/mfd/mfd-core.c   |   31 +++++++++++++++++++++++++++----
>  include/linux/mfd/core.h |    1 +
>  2 files changed, 28 insertions(+), 4 deletions(-)
Applied, after changing the code style a bit to make it more readable.
Could you please provide me with a follow up patch for documenting the
of_compatible MFD cell field, please ?

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

* [PATCH 04/15] mfd: ab8500: Register devices using the newly DT:ed MFD API
  2012-06-20 12:56 ` [PATCH 04/15] mfd: ab8500: Register devices using the newly DT:ed MFD API Lee Jones
@ 2012-06-29 15:09   ` Samuel Ortiz
  2012-06-29 16:04     ` Lee Jones
  0 siblings, 1 reply; 40+ messages in thread
From: Samuel Ortiz @ 2012-06-29 15:09 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Lee,

On Wed, Jun 20, 2012 at 01:56:40PM +0100, Lee Jones wrote:
> Now the MFD API is Device Tree aware we can use it for platform
> registration again, even when booting with DT enabled. To aid in
> Device Node pointer allocation we provide each cell with the
> associative compatible string.
> 
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  arch/arm/mach-ux500/board-mop500.c |    1 -
>  drivers/input/misc/ab8500-ponkey.c |    6 ----
>  drivers/mfd/ab8500-core.c          |   64 ++++++++++++++++++++++--------------
>  drivers/mfd/ab8500-debugfs.c       |    6 ----
>  drivers/mfd/ab8500-gpadc.c         |    6 ----
>  drivers/mfd/ab8500-sysctrl.c       |    6 ----
>  drivers/misc/ab8500-pwm.c          |    6 ----
>  drivers/regulator/ab8500.c         |    6 ----
>  drivers/rtc/rtc-ab8500.c           |    7 ----
>  drivers/usb/otg/ab8500-usb.c       |    6 ----
>  10 files changed, 39 insertions(+), 75 deletions(-)
This one does not apply properly against my for-next branch. Could you please
generate a new one for me ?

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

* [PATCH 05/15] mfd: db8500-prcmu: Register devices using the newly DT:ed MFD API
  2012-06-20 12:56 ` [PATCH 05/15] mfd: db8500-prcmu: " Lee Jones
@ 2012-06-29 15:11   ` Samuel Ortiz
  0 siblings, 0 replies; 40+ messages in thread
From: Samuel Ortiz @ 2012-06-29 15:11 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Lee,

On Wed, Jun 20, 2012 at 01:56:41PM +0100, Lee Jones wrote:
> Now the MFD API is Device Tree aware we can use it for platform
> registration again, even when booting with DT enabled. To aid in
> Device Node pointer allocation we provide each cell with the
> associative compatible string.
> 
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/mfd/db8500-prcmu.c       |   14 +++++++-------
>  drivers/regulator/db8500-prcmu.c |    6 ------
>  2 files changed, 7 insertions(+), 13 deletions(-)
Patch applied, thanks.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

* [PATCH 06/15] mfd: Register the ab8500 from db8500-prcmu using the MFD API
  2012-06-20 12:56 ` [PATCH 06/15] mfd: Register the ab8500 from db8500-prcmu using the " Lee Jones
@ 2012-06-29 15:15   ` Samuel Ortiz
  0 siblings, 0 replies; 40+ messages in thread
From: Samuel Ortiz @ 2012-06-29 15:15 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Lee,

On Wed, Jun 20, 2012 at 01:56:42PM +0100, Lee Jones wrote:
> Hierarchically, the AB8500 is a child of the DB8500 PRCMU. So now that
> Device Tree is being used and MFD core code is Device Tree aware, we
> can simply register DB8500 PRCMU from Device Tree in the normal way
> then allow the DB8500 PRCMU driver to register the AB8500 as a simple
> MFD device at probe time.
> 
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  arch/arm/mach-ux500/board-mop500.c |    2 --
>  drivers/mfd/ab8500-core.c          |   12 ------------
>  drivers/mfd/db8500-prcmu.c         |   15 +++++++++++++++
>  3 files changed, 15 insertions(+), 14 deletions(-)
Patch applied, thanks.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

* [PATCH 04/15] mfd: ab8500: Register devices using the newly DT:ed MFD API
  2012-06-29 15:09   ` Samuel Ortiz
@ 2012-06-29 16:04     ` Lee Jones
  2012-06-29 18:50       ` Samuel Ortiz
  0 siblings, 1 reply; 40+ messages in thread
From: Lee Jones @ 2012-06-29 16:04 UTC (permalink / raw)
  To: linux-arm-kernel

On 29/06/12 16:09, Samuel Ortiz wrote:
> Hi Lee,
>
> On Wed, Jun 20, 2012 at 01:56:40PM +0100, Lee Jones wrote:
>> Now the MFD API is Device Tree aware we can use it for platform
>> registration again, even when booting with DT enabled. To aid in
>> Device Node pointer allocation we provide each cell with the
>> associative compatible string.
>>
>> Cc: Samuel Ortiz <sameo@linux.intel.com>
>> Signed-off-by: Lee Jones <lee.jones@linaro.org>
>> ---
>>   arch/arm/mach-ux500/board-mop500.c |    1 -
>>   drivers/input/misc/ab8500-ponkey.c |    6 ----
>>   drivers/mfd/ab8500-core.c          |   64 ++++++++++++++++++++++--------------
>>   drivers/mfd/ab8500-debugfs.c       |    6 ----
>>   drivers/mfd/ab8500-gpadc.c         |    6 ----
>>   drivers/mfd/ab8500-sysctrl.c       |    6 ----
>>   drivers/misc/ab8500-pwm.c          |    6 ----
>>   drivers/regulator/ab8500.c         |    6 ----
>>   drivers/rtc/rtc-ab8500.c           |    7 ----
>>   drivers/usb/otg/ab8500-usb.c       |    6 ----
>>   10 files changed, 39 insertions(+), 75 deletions(-)
> This one does not apply properly against my for-next branch. Could you please
> generate a new one for me ?

Hmm... we have a problem.

I have the new patch based on -next, but I can't test it, as -next is 
broken for Snowball. Hence why I'm still using rc2. Do you want it anyway?

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] 40+ messages in thread

* [PATCH 03/15] mfd: Make MFD core code Device Tree and IRQ domain aware
  2012-06-29 14:52     ` Lee Jones
@ 2012-06-29 18:49       ` Samuel Ortiz
  2012-07-02  9:57         ` Lee Jones
  0 siblings, 1 reply; 40+ messages in thread
From: Samuel Ortiz @ 2012-06-29 18:49 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Lee,

On Fri, Jun 29, 2012 at 03:52:49PM +0100, Lee Jones wrote:
> On 29/06/12 15:55, Samuel Ortiz wrote:
> >Hi Lee,
> >
> >On Wed, Jun 20, 2012 at 01:56:39PM +0100, Lee Jones wrote:
> >>During Device Tree enablement of the ab8500 and db8500-prcmu drivers,
> >>a decision was made to omit registration through the MFD API and use
> >>Device Tree directly. However, because MFD devices have a different
> >>address space and the ab8500 and db8500 both use I2C to communicate,
> >>this causes issues with address translation during execution of
> >>of_platform_populate(). So the solution is to make the MFD core aware
> >>of Device Tree and have it assign the correct node pointers instead.
> >>
> >>To make this work the MFD core also needs to be awere of IRQ domains,
> >>as Device Tree insists on IRQ domain compatibility. So, instead of
> >>providing an irq-base via platform code, in the DT case we simply
> >>look up the IRQ domain and map to the correct virtual IRQ.
> >>
> >>Cc: Samuel Ortiz <sameo@linux.intel.com>
> >>Signed-off-by: Lee Jones <lee.jones@linaro.org>
> >>---
> >>  drivers/mfd/mfd-core.c   |   31 +++++++++++++++++++++++++++----
> >>  include/linux/mfd/core.h |    1 +
> >>  2 files changed, 28 insertions(+), 4 deletions(-)
> >Applied, after changing the code style a bit to make it more readable.
> >Could you please provide me with a follow up patch for documenting the
> >of_compatible MFD cell field, please ?
> 
> Yes, of course.
> 
> What exactly would you like? Something in Documentation/devicetree
> you mean? Or something else?
At least a code comment in the header file.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

* [PATCH 04/15] mfd: ab8500: Register devices using the newly DT:ed MFD API
  2012-06-29 16:04     ` Lee Jones
@ 2012-06-29 18:50       ` Samuel Ortiz
  2012-07-02 10:03         ` Lee Jones
  0 siblings, 1 reply; 40+ messages in thread
From: Samuel Ortiz @ 2012-06-29 18:50 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Lee,

On Fri, Jun 29, 2012 at 05:04:34PM +0100, Lee Jones wrote:
> On 29/06/12 16:09, Samuel Ortiz wrote:
> >Hi Lee,
> >
> >On Wed, Jun 20, 2012 at 01:56:40PM +0100, Lee Jones wrote:
> >>Now the MFD API is Device Tree aware we can use it for platform
> >>registration again, even when booting with DT enabled. To aid in
> >>Device Node pointer allocation we provide each cell with the
> >>associative compatible string.
> >>
> >>Cc: Samuel Ortiz <sameo@linux.intel.com>
> >>Signed-off-by: Lee Jones <lee.jones@linaro.org>
> >>---
> >>  arch/arm/mach-ux500/board-mop500.c |    1 -
> >>  drivers/input/misc/ab8500-ponkey.c |    6 ----
> >>  drivers/mfd/ab8500-core.c          |   64 ++++++++++++++++++++++--------------
> >>  drivers/mfd/ab8500-debugfs.c       |    6 ----
> >>  drivers/mfd/ab8500-gpadc.c         |    6 ----
> >>  drivers/mfd/ab8500-sysctrl.c       |    6 ----
> >>  drivers/misc/ab8500-pwm.c          |    6 ----
> >>  drivers/regulator/ab8500.c         |    6 ----
> >>  drivers/rtc/rtc-ab8500.c           |    7 ----
> >>  drivers/usb/otg/ab8500-usb.c       |    6 ----
> >>  10 files changed, 39 insertions(+), 75 deletions(-)
> >This one does not apply properly against my for-next branch. Could you please
> >generate a new one for me ?
> 
> Hmm... we have a problem.
> 
> I have the new patch based on -next, but I can't test it, as -next
> is broken for Snowball. Hence why I'm still using rc2. Do you want
> it anyway?
Yes. And once Snowball is working with -next, I'll take a patch fix from you
if necessary.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

* [PATCH 03/15] mfd: Make MFD core code Device Tree and IRQ domain aware
  2012-06-29 18:49       ` Samuel Ortiz
@ 2012-07-02  9:57         ` Lee Jones
  2012-07-02 15:01           ` Samuel Ortiz
  0 siblings, 1 reply; 40+ messages in thread
From: Lee Jones @ 2012-07-02  9:57 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Sam,

Something like this what you were after?

From: Lee Jones <lee.jones@linaro.org>
Date: Mon, 2 Jul 2012 10:50:19 +0100
Subject: [PATCH] MFD: Attaching a node to new 'struct mfd_cell' of_compatible
 variable

Applying a succinct description to the of_compatible variable recently
added to the mfd_cell struct. Also link to the documentation page where
more information can be found about compatible properties.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 include/linux/mfd/core.h |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h
index 99b7eb1..3a8435a 100644
--- a/include/linux/mfd/core.h
+++ b/include/linux/mfd/core.h
@@ -36,6 +36,10 @@ struct mfd_cell {
 	/* platform data passed to the sub devices drivers */
 	void			*platform_data;
 	size_t			pdata_size;
+	/*
+	 * Device Tree compatible string
+	 * See: Documentation/devicetree/usage-model.txt Chapter 2.2 for details
+	 */
 	const char		*of_compatible;
 
 	/*
-- 
1.7.9.5

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

* [PATCH 04/15] mfd: ab8500: Register devices using the newly DT:ed MFD API
  2012-06-29 18:50       ` Samuel Ortiz
@ 2012-07-02 10:03         ` Lee Jones
  2012-07-02 15:14           ` Samuel Ortiz
  0 siblings, 1 reply; 40+ messages in thread
From: Lee Jones @ 2012-07-02 10:03 UTC (permalink / raw)
  To: linux-arm-kernel

>>> This one does not apply properly against my for-next branch. Could you please
>>> generate a new one for me ?
>>
>> Hmm... we have a problem.
>>
>> I have the new patch based on -next, but I can't test it, as -next
>> is broken for Snowball. Hence why I'm still using rc2. Do you want
>> it anyway?
> Yes. And once Snowball is working with -next, I'll take a patch fix from you
> if necessary.

Okay, this one applies on -next:

From: Lee Jones <lee.jones@linaro.org>
Date: Wed, 20 Jun 2012 08:48:33 +0100
Subject: [PATCH 1/1] mfd: ab8500: Register devices using the newly DT:ed MFD
 API

Now the MFD API is Device Tree aware we can use it for platform
registration again, even when booting with DT enabled. To aid in
Device Node pointer allocation we provide each cell with the
associative compatible string.

Cc: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/mach-ux500/board-mop500.c |    1 -
 drivers/mfd/ab8500-core.c          |   64 ++++++++++++++++++++++--------------
 drivers/mfd/ab8500-debugfs.c       |    6 ----
 drivers/mfd/ab8500-gpadc.c         |    6 ----
 drivers/mfd/ab8500-sysctrl.c       |    6 ----
 drivers/misc/ab8500-pwm.c          |    6 ----
 drivers/regulator/ab8500.c         |    6 ----
 drivers/rtc/rtc-ab8500.c           |    7 ----
 drivers/usb/otg/ab8500-usb.c       |    6 ----
 9 files changed, 39 insertions(+), 69 deletions(-)

diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 88e0aa0..10527b3 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -784,7 +784,6 @@ static const struct of_device_id u8500_local_bus_nodes[] = {
 	{ .compatible = "stericsson,db8500-prcmu", },
 	{ .compatible = "stericsson,db8500-prcmu-regulator", },
 	{ .compatible = "stericsson,ab8500", },
-	{ .compatible = "stericsson,ab8500-regulator", },
 	{ .compatible = "simple-bus"},
 	{ },
 };
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 8de3b65..79d7672 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -970,54 +970,69 @@ static struct mfd_cell __devinitdata abx500_common_devs[] = {
 #ifdef CONFIG_DEBUG_FS
 	{
 		.name = "ab8500-debug",
+		.of_compatible = "stericsson,ab8500-debug",
 		.num_resources = ARRAY_SIZE(ab8500_debug_resources),
 		.resources = ab8500_debug_resources,
 	},
 #endif
 	{
 		.name = "ab8500-sysctrl",
+		.of_compatible = "stericsson,ab8500-sysctrl",
 	},
 	{
 		.name = "ab8500-regulator",
+		.of_compatible = "stericsson,ab8500-regulator",
 	},
 	{
 		.name = "ab8500-gpadc",
+		.of_compatible = "stericsson,ab8500-gpadc",
 		.num_resources = ARRAY_SIZE(ab8500_gpadc_resources),
 		.resources = ab8500_gpadc_resources,
 	},
 	{
 		.name = "ab8500-rtc",
+		.of_compatible = "stericsson,ab8500-rtc",
 		.num_resources = ARRAY_SIZE(ab8500_rtc_resources),
 		.resources = ab8500_rtc_resources,
 	},
 	{
 		.name = "ab8500-acc-det",
+		.of_compatible = "stericsson,ab8500-acc-det",
 		.num_resources = ARRAY_SIZE(ab8500_av_acc_detect_resources),
 		.resources = ab8500_av_acc_detect_resources,
 	},
 	{
 		.name = "ab8500-poweron-key",
+		.of_compatible = "stericsson,ab8500-poweron-key",
 		.num_resources = ARRAY_SIZE(ab8500_poweronkey_db_resources),
 		.resources = ab8500_poweronkey_db_resources,
 	},
 	{
 		.name = "ab8500-pwm",
+		.of_compatible = "stericsson,ab8500-pwm",
 		.id = 1,
 	},
 	{
 		.name = "ab8500-pwm",
+		.of_compatible = "stericsson,ab8500-pwm",
 		.id = 2,
 	},
 	{
 		.name = "ab8500-pwm",
+		.of_compatible = "stericsson,ab8500-pwm",
 		.id = 3,
 	},
-	{ .name = "ab8500-leds", },
+	{
+		.name = "ab8500-leds",
+		.of_compatible = "stericsson,ab8500-leds",
+	},
 	{
 		.name = "ab8500-denc",
+		.of_compatible = "stericsson,ab8500-denc",
 	},
 	{
 		.name = "ab8500-temp",
+		.of_compatible = "stericsson,ab8500-temp",
 		.num_resources = ARRAY_SIZE(ab8500_temp_resources),
 		.resources = ab8500_temp_resources,
 	},
@@ -1049,11 +1064,13 @@ static struct mfd_cell __devinitdata ab8500_bm_devs[] = {
 static struct mfd_cell __devinitdata ab8500_devs[] = {
 	{
 		.name = "ab8500-gpio",
+		.of_compatible = "stericsson,ab8500-gpio",
 		.num_resources = ARRAY_SIZE(ab8500_gpio_resources),
 		.resources = ab8500_gpio_resources,
 	},
 	{
 		.name = "ab8500-usb",
+		.of_compatible = "stericsson,ab8500-usb",
 		.num_resources = ARRAY_SIZE(ab8500_usb_resources),
 		.resources = ab8500_usb_resources,
 	},
@@ -1388,32 +1405,29 @@ static int __devinit ab8500_probe(struct platform_device *pdev)
 			goto out_freeoldmask;
 	}
 
-	if (!np) {
-		ret = mfd_add_devices(ab8500->dev, 0, abx500_common_devs,
-				ARRAY_SIZE(abx500_common_devs), NULL,
-				ab8500->irq_base);
+	ret = mfd_add_devices(ab8500->dev, 0, abx500_common_devs,
+			ARRAY_SIZE(abx500_common_devs), NULL,
+			ab8500->irq_base);
+	if (ret)
+		goto out_freeirq;
 
-		if (ret)
-			goto out_freeirq;
-
-		if (is_ab9540(ab8500))
-			ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs,
-					ARRAY_SIZE(ab9540_devs), NULL,
-					ab8500->irq_base);
-		else
-			ret = mfd_add_devices(ab8500->dev, 0, ab8500_devs,
-					ARRAY_SIZE(ab8500_devs), NULL,
-					ab8500->irq_base);
-		if (ret)
-			goto out_freeirq;
+	if (is_ab9540(ab8500))
+		ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs,
+				ARRAY_SIZE(ab9540_devs), NULL,
+				ab8500->irq_base);
+	else
+		ret = mfd_add_devices(ab8500->dev, 0, ab8500_devs,
+				ARRAY_SIZE(ab8500_devs), NULL,
+				ab8500->irq_base);
+	if (ret)
+		goto out_freeirq;
 
-		if (is_ab9540(ab8500) || is_ab8505(ab8500))
-			ret = mfd_add_devices(ab8500->dev, 0, ab9540_ab8505_devs,
-					ARRAY_SIZE(ab9540_ab8505_devs), NULL,
-					ab8500->irq_base);
-		if (ret)
-			goto out_freeirq;
-	}
+	if (is_ab9540(ab8500) || is_ab8505(ab8500))
+		ret = mfd_add_devices(ab8500->dev, 0, ab9540_ab8505_devs,
+				ARRAY_SIZE(ab9540_ab8505_devs), NULL,
+				ab8500->irq_base);
+	if (ret)
+		goto out_freeirq;
 
 	if (!no_bm) {
 		/* Add battery management devices */
diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index 361de52..c4cb806 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -608,16 +608,10 @@ static int __devexit ab8500_debug_remove(struct platform_device *plf)
 	return 0;
 }
 
-static const struct of_device_id ab8500_debug_match[] = {
-        { .compatible = "stericsson,ab8500-debug", },
-        {}
-};
-
 static struct platform_driver ab8500_debug_driver = {
 	.driver = {
 		.name = "ab8500-debug",
 		.owner = THIS_MODULE,
-		.of_match_table = ab8500_debug_match,
 	},
 	.probe  = ab8500_debug_probe,
 	.remove = __devexit_p(ab8500_debug_remove)
diff --git a/drivers/mfd/ab8500-gpadc.c b/drivers/mfd/ab8500-gpadc.c
index b6cbc3ba..866f959 100644
--- a/drivers/mfd/ab8500-gpadc.c
+++ b/drivers/mfd/ab8500-gpadc.c
@@ -649,18 +649,12 @@ static int __devexit ab8500_gpadc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id ab8500_gpadc_match[] = {
-	{ .compatible = "stericsson,ab8500-gpadc", },
-	{}
-};
-
 static struct platform_driver ab8500_gpadc_driver = {
 	.probe = ab8500_gpadc_probe,
 	.remove = __devexit_p(ab8500_gpadc_remove),
 	.driver = {
 		.name = "ab8500-gpadc",
 		.owner = THIS_MODULE,
-		.of_match_table = ab8500_gpadc_match,
 	},
 };
 
diff --git a/drivers/mfd/ab8500-sysctrl.c b/drivers/mfd/ab8500-sysctrl.c
index 5a3e51c..c28d4eb 100644
--- a/drivers/mfd/ab8500-sysctrl.c
+++ b/drivers/mfd/ab8500-sysctrl.c
@@ -61,16 +61,10 @@ static int __devexit ab8500_sysctrl_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id ab8500_sysctrl_match[] = {
-	{ .compatible = "stericsson,ab8500-sysctrl", },
-	{}
-};
-
 static struct platform_driver ab8500_sysctrl_driver = {
 	.driver = {
 		.name = "ab8500-sysctrl",
 		.owner = THIS_MODULE,
-		.of_match_table = ab8500_sysctrl_match,
 	},
 	.probe = ab8500_sysctrl_probe,
 	.remove = __devexit_p(ab8500_sysctrl_remove),
diff --git a/drivers/misc/ab8500-pwm.c b/drivers/misc/ab8500-pwm.c
index 042a8fe..d7a9aa1 100644
--- a/drivers/misc/ab8500-pwm.c
+++ b/drivers/misc/ab8500-pwm.c
@@ -142,16 +142,10 @@ static int __devexit ab8500_pwm_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id ab8500_pwm_match[] = {
-	{ .compatible = "stericsson,ab8500-pwm", },
-	{}
-};
-
 static struct platform_driver ab8500_pwm_driver = {
 	.driver = {
 		.name = "ab8500-pwm",
 		.owner = THIS_MODULE,
-		.of_match_table = ab8500_pwm_match,
 	},
 	.probe = ab8500_pwm_probe,
 	.remove = __devexit_p(ab8500_pwm_remove),
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c
index 13d424f..10f2f4d 100644
--- a/drivers/regulator/ab8500.c
+++ b/drivers/regulator/ab8500.c
@@ -848,18 +848,12 @@ static __devexit int ab8500_regulator_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id ab8500_regulator_match[] = {
-        { .compatible = "stericsson,ab8500-regulator", },
-        {}
-};
-
 static struct platform_driver ab8500_regulator_driver = {
 	.probe = ab8500_regulator_probe,
 	.remove = __devexit_p(ab8500_regulator_remove),
 	.driver         = {
 		.name   = "ab8500-regulator",
 		.owner  = THIS_MODULE,
-		.of_match_table = ab8500_regulator_match,
 	},
 };
 
diff --git a/drivers/rtc/rtc-ab8500.c b/drivers/rtc/rtc-ab8500.c
index 7777717..e951e00 100644
--- a/drivers/rtc/rtc-ab8500.c
+++ b/drivers/rtc/rtc-ab8500.c
@@ -17,7 +17,6 @@
 #include <linux/mfd/abx500.h>
 #include <linux/mfd/abx500/ab8500.h>
 #include <linux/delay.h>
-#include <linux/of.h>
 
 #define AB8500_RTC_SOFF_STAT_REG	0x00
 #define AB8500_RTC_CC_CONF_REG		0x01
@@ -462,16 +461,10 @@ static int __devexit ab8500_rtc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id ab8500_rtc_match[] = {
-        { .compatible = "stericsson,ab8500-rtc", },
-        {}
-};
-
 static struct platform_driver ab8500_rtc_driver = {
 	.driver = {
 		.name = "ab8500-rtc",
 		.owner = THIS_MODULE,
-		.of_match_table = ab8500_rtc_match,
 	},
 	.probe	= ab8500_rtc_probe,
 	.remove = __devexit_p(ab8500_rtc_remove),
diff --git a/drivers/usb/otg/ab8500-usb.c b/drivers/usb/otg/ab8500-usb.c
index 9799ac6..a84af67 100644
--- a/drivers/usb/otg/ab8500-usb.c
+++ b/drivers/usb/otg/ab8500-usb.c
@@ -569,18 +569,12 @@ static int __devexit ab8500_usb_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id ab8500_usb_match[] = {
-	{ .compatible = "stericsson,ab8500-usb", },
-	{},
-};
-
 static struct platform_driver ab8500_usb_driver = {
 	.probe		= ab8500_usb_probe,
 	.remove		= __devexit_p(ab8500_usb_remove),
 	.driver		= {
 		.name	= "ab8500-usb",
 		.owner	= THIS_MODULE,
-		.of_match_table = ab8500_usb_match,
 	},
 };
 
-- 
1.7.9.5

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

* [PATCH 03/15] mfd: Make MFD core code Device Tree and IRQ domain aware
  2012-07-02  9:57         ` Lee Jones
@ 2012-07-02 15:01           ` Samuel Ortiz
  0 siblings, 0 replies; 40+ messages in thread
From: Samuel Ortiz @ 2012-07-02 15:01 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Lee,

On Mon, Jul 02, 2012 at 10:57:21AM +0100, Lee Jones wrote:
> Hi Sam,
> 
> Something like this what you were after?
Yes, patch applied. Thanks.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

* [PATCH 04/15] mfd: ab8500: Register devices using the newly DT:ed MFD API
  2012-07-02 10:03         ` Lee Jones
@ 2012-07-02 15:14           ` Samuel Ortiz
  2012-07-04 15:29             ` Lee Jones
  0 siblings, 1 reply; 40+ messages in thread
From: Samuel Ortiz @ 2012-07-02 15:14 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Lee,

On Mon, Jul 02, 2012 at 11:03:46AM +0100, Lee Jones wrote:
> >>> This one does not apply properly against my for-next branch. Could you please
> >>> generate a new one for me ?
> >>
> >> Hmm... we have a problem.
> >>
> >> I have the new patch based on -next, but I can't test it, as -next
> >> is broken for Snowball. Hence why I'm still using rc2. Do you want
> >> it anyway?
> > Yes. And once Snowball is working with -next, I'll take a patch fix from you
> > if necessary.
> 
> Okay, this one applies on -next:
> 
> From: Lee Jones <lee.jones@linaro.org>
> Date: Wed, 20 Jun 2012 08:48:33 +0100
> Subject: [PATCH 1/1] mfd: ab8500: Register devices using the newly DT:ed MFD
>  API
> 
> Now the MFD API is Device Tree aware we can use it for platform
> registration again, even when booting with DT enabled. To aid in
> Device Node pointer allocation we provide each cell with the
> associative compatible string.
> 
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  arch/arm/mach-ux500/board-mop500.c |    1 -
>  drivers/mfd/ab8500-core.c          |   64 ++++++++++++++++++++++--------------
>  drivers/mfd/ab8500-debugfs.c       |    6 ----
>  drivers/mfd/ab8500-gpadc.c         |    6 ----
>  drivers/mfd/ab8500-sysctrl.c       |    6 ----
>  drivers/misc/ab8500-pwm.c          |    6 ----
>  drivers/regulator/ab8500.c         |    6 ----
>  drivers/rtc/rtc-ab8500.c           |    7 ----
>  drivers/usb/otg/ab8500-usb.c       |    6 ----
>  9 files changed, 39 insertions(+), 69 deletions(-)
Applied, although rtc-ab8500.c and ab8500-usb.c did not need any changes.
Please check commit 47e1f40fcb12f976e7769f75c04c65828ed5da75 on my for-next
branch to see if I missed anything.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

* [PATCH 04/15] mfd: ab8500: Register devices using the newly DT:ed MFD API
  2012-07-02 15:14           ` Samuel Ortiz
@ 2012-07-04 15:29             ` Lee Jones
  0 siblings, 0 replies; 40+ messages in thread
From: Lee Jones @ 2012-07-04 15:29 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Sam,

> On Mon, Jul 02, 2012 at 11:03:46AM +0100, Lee Jones wrote:
>>>>> This one does not apply properly against my for-next branch. Could you please
>>>>> generate a new one for me ?
>>>>
>>>> Hmm... we have a problem.
>>>>
>>>> I have the new patch based on -next, but I can't test it, as -next
>>>> is broken for Snowball. Hence why I'm still using rc2. Do you want
>>>> it anyway?
>>> Yes. And once Snowball is working with -next, I'll take a patch fix from you
>>> if necessary.
>>
>> Okay, this one applies on -next:
>>
>> From: Lee Jones <lee.jones@linaro.org>
>> Date: Wed, 20 Jun 2012 08:48:33 +0100
>> Subject: [PATCH 1/1] mfd: ab8500: Register devices using the newly DT:ed MFD
>>   API
>>
>> Now the MFD API is Device Tree aware we can use it for platform
>> registration again, even when booting with DT enabled. To aid in
>> Device Node pointer allocation we provide each cell with the
>> associative compatible string.
>>
>> Cc: Samuel Ortiz <sameo@linux.intel.com>
>> Signed-off-by: Lee Jones <lee.jones@linaro.org>
>> ---
>>   arch/arm/mach-ux500/board-mop500.c |    1 -
>>   drivers/mfd/ab8500-core.c          |   64 ++++++++++++++++++++++--------------
>>   drivers/mfd/ab8500-debugfs.c       |    6 ----
>>   drivers/mfd/ab8500-gpadc.c         |    6 ----
>>   drivers/mfd/ab8500-sysctrl.c       |    6 ----
>>   drivers/misc/ab8500-pwm.c          |    6 ----
>>   drivers/regulator/ab8500.c         |    6 ----
>>   drivers/rtc/rtc-ab8500.c           |    7 ----
>>   drivers/usb/otg/ab8500-usb.c       |    6 ----
>>   9 files changed, 39 insertions(+), 69 deletions(-)
> Applied, although rtc-ab8500.c and ab8500-usb.c did not need any changes.
> Please check commit 47e1f40fcb12f976e7769f75c04c65828ed5da75 on my for-next
> branch to see if I missed anything.

Looks like the rtc-ab8500 and ponkey-ab8500 just made it into next. Please use the patch below to complement the one above. Thanks.

From: Lee Jones <lee.jones@linaro.org>
Date: Wed, 20 Jun 2012 08:48:33 +0100
Subject: [PATCH 1/1] mfd: ab8500: Clean-up the last two ab8500 related DT
 match tables

A patch was recently submitted to stop all ab8500 devices from
being registered through Device Tree. Instead, only the db8500
will be DT:ed and the rest will continue to be registered via
the MFD API, as they always were.

Two patches have recently been applied which enable Device Tree
probing; one for rtc-ab8500 and the other for ponkey-ab8500.
These two need to be removed to prevent double-probing these
devices with Device Tree is enabled.

Cc: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/input/misc/ab8500-ponkey.c |    8 --------
 drivers/rtc/rtc-ab8500.c           |    6 ------
 2 files changed, 14 deletions(-)

diff --git a/drivers/input/misc/ab8500-ponkey.c b/drivers/input/misc/ab8500-ponkey.c
index 84ec691..5ceb23e 100644
--- a/drivers/input/misc/ab8500-ponkey.c
+++ b/drivers/input/misc/ab8500-ponkey.c
@@ -132,18 +132,10 @@ static int __devexit ab8500_ponkey_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_OF
-static const struct of_device_id ab8500_ponkey_match[] = {
-	{ .compatible = "stericsson,ab8500-ponkey", },
-	{}
-};
-#endif
-
 static struct platform_driver ab8500_ponkey_driver = {
 	.driver		= {
 		.name	= "ab8500-poweron-key",
 		.owner	= THIS_MODULE,
-		.of_match_table = of_match_ptr(ab8500_ponkey_match),
 	},
 	.probe		= ab8500_ponkey_probe,
 	.remove		= __devexit_p(ab8500_ponkey_remove),
diff --git a/drivers/rtc/rtc-ab8500.c b/drivers/rtc/rtc-ab8500.c
index bf3c2f6..2e5970f 100644
--- a/drivers/rtc/rtc-ab8500.c
+++ b/drivers/rtc/rtc-ab8500.c
@@ -462,16 +462,10 @@ static int __devexit ab8500_rtc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id ab8500_rtc_match[] = {
-	{ .compatible = "stericsson,b8500-rtc", },
-	{}
-};
-
 static struct platform_driver ab8500_rtc_driver = {
 	.driver = {
 		.name = "ab8500-rtc",
 		.owner = THIS_MODULE,
-		.of_match_table = ab8500_rtc_match,
 	},
 	.probe	= ab8500_rtc_probe,
 	.remove = __devexit_p(ab8500_rtc_remove),
-- 
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 related	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2012-07-04 15:29 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-20 12:56 [PATCH 00/15] Device Tree related re-works and clean-ups Lee Jones
2012-06-20 12:56 ` [PATCH 01/15] mfd: Add IRQ domain support for the AB8500 Lee Jones
2012-06-29 14:51   ` Samuel Ortiz
2012-06-20 12:56 ` [PATCH 02/15] mfd: Generically describe interactions with the DB8500 PRCMU Lee Jones
2012-06-29 14:53   ` Samuel Ortiz
2012-06-20 12:56 ` [PATCH 03/15] mfd: Make MFD core code Device Tree and IRQ domain aware Lee Jones
2012-06-29 14:55   ` Samuel Ortiz
2012-06-29 14:52     ` Lee Jones
2012-06-29 18:49       ` Samuel Ortiz
2012-07-02  9:57         ` Lee Jones
2012-07-02 15:01           ` Samuel Ortiz
2012-06-20 12:56 ` [PATCH 04/15] mfd: ab8500: Register devices using the newly DT:ed MFD API Lee Jones
2012-06-29 15:09   ` Samuel Ortiz
2012-06-29 16:04     ` Lee Jones
2012-06-29 18:50       ` Samuel Ortiz
2012-07-02 10:03         ` Lee Jones
2012-07-02 15:14           ` Samuel Ortiz
2012-07-04 15:29             ` Lee Jones
2012-06-20 12:56 ` [PATCH 05/15] mfd: db8500-prcmu: " Lee Jones
2012-06-29 15:11   ` Samuel Ortiz
2012-06-20 12:56 ` [PATCH 06/15] mfd: Register the ab8500 from db8500-prcmu using the " Lee Jones
2012-06-29 15:15   ` Samuel Ortiz
2012-06-20 12:56 ` [PATCH 07/15] i2c: Add Device Tree support to the Nomadik I2C driver Lee Jones
2012-06-20 19:30   ` Linus Walleij
2012-06-21  6:47     ` Srinidhi Kasagar
2012-06-20 12:56 ` [PATCH 08/15] regulator: Stop initialising AB8500's registers during bring-up Lee Jones
2012-06-20 13:08   ` Mark Brown
2012-06-20 13:19     ` Lee Jones
2012-06-20 13:26   ` Mark Brown
2012-06-20 12:56 ` [PATCH 09/15] pinctrl: pinctrl-nomadik: Fix possible memory leak Lee Jones
2012-06-20 12:56 ` [PATCH 10/15] pinctrl: pinctrl-nomadik: Append sleepmode property with vendor specific prefixes Lee Jones
2012-06-20 12:56 ` [PATCH 11/15] ARM: ux500: Remove AB8500 regulator register initialisation information Lee Jones
2012-06-20 12:56 ` [PATCH 12/15] ARM: ux500: Ensure vendor specific properties have the vendor's identifier Lee Jones
2012-06-20 12:56 ` [PATCH 13/15] ARM: ux500: Remove temporary snowball_of_platform_devs enablement structure Lee Jones
2012-06-20 12:56 ` [PATCH 14/15] ARM: ux500: Remove PMU platform registration when booting with DT Lee Jones
2012-06-20 12:56 ` [PATCH 15/15] ARM: perf: handle muxed CPU IRQ lines Lee Jones
2012-06-20 13:28   ` Will Deacon
2012-06-20 13:44     ` Lee Jones
2012-06-20 14:01       ` Will Deacon
2012-06-20 14:13         ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).