All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 02/19] mfd: Use mfd cell platform_data for ab3550 cells platform bits
       [not found] <1304901131-7104-1-git-send-email-sameo@linux.intel.com>
@ 2011-05-09  0:31 ` Samuel Ortiz
  2011-05-09  7:01   ` Linus Walleij
  2011-05-09  0:31 ` [PATCH 03/19] mfd: Use mfd cell platform_data for ab3100 " Samuel Ortiz
                   ` (19 subsequent siblings)
  20 siblings, 1 reply; 37+ messages in thread
From: Samuel Ortiz @ 2011-05-09  0:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: Samuel Ortiz, Linus Walleij

With the addition of a platform device mfd_cell pointer, MFD drivers
can go back to passing platform data back to their sub drivers.
This allows for an mfd_cell->mfd_data removal and thus keep the sub drivers
MFD agnostic. This is mostly needed for non MFD aware sub drivers.

Cc: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/mfd/ab3550-core.c  |    6 ++++--
 include/linux/mfd/abx500.h |    1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/ab3550-core.c b/drivers/mfd/ab3550-core.c
index ff86acf..3d7dce6 100644
--- a/drivers/mfd/ab3550-core.c
+++ b/drivers/mfd/ab3550-core.c
@@ -1320,8 +1320,10 @@ static int __init ab3550_probe(struct i2c_client *client,
 		goto exit_no_ops;
 
 	/* Set up and register the platform devices. */
-	for (i = 0; i < AB3550_NUM_DEVICES; i++)
-		ab3550_devs[i].mfd_data = ab3550_plf_data->dev_data[i];
+	for (i = 0; i < AB3550_NUM_DEVICES; i++) {
+		ab3550_devs[i].platform_data = ab3550_plf_data->dev_data[i];
+		ab3550_devs[i].pdata_size = ab3550_plf_data->dev_data_sz[i];
+	}
 
 	err = mfd_add_devices(&client->dev, 0, ab3550_devs,
 		ARRAY_SIZE(ab3550_devs), NULL,
diff --git a/include/linux/mfd/abx500.h b/include/linux/mfd/abx500.h
index 7d9b6ae..67bd6f7 100644
--- a/include/linux/mfd/abx500.h
+++ b/include/linux/mfd/abx500.h
@@ -186,6 +186,7 @@ struct abx500_init_settings {
 struct ab3550_platform_data {
 	struct {unsigned int base; unsigned int count; } irq;
 	void *dev_data[AB3550_NUM_DEVICES];
+	size_t dev_data_sz[AB3550_NUM_DEVICES];
 	struct abx500_init_settings *init_settings;
 	unsigned int init_settings_sz;
 };
-- 
1.7.2.3


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

* [PATCH 03/19] mfd: Use mfd cell platform_data for ab3100 cells platform bits
       [not found] <1304901131-7104-1-git-send-email-sameo@linux.intel.com>
  2011-05-09  0:31 ` [PATCH 02/19] mfd: Use mfd cell platform_data for ab3550 cells platform bits Samuel Ortiz
@ 2011-05-09  0:31 ` Samuel Ortiz
  2011-05-09  7:02   ` Linus Walleij
  2011-05-09  0:31 ` [PATCH 04/19] mmc: Use device platform_data to retrieve tmio_mmc " Samuel Ortiz
                   ` (18 subsequent siblings)
  20 siblings, 1 reply; 37+ messages in thread
From: Samuel Ortiz @ 2011-05-09  0:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: Samuel Ortiz, Linus Walleij

With the addition of a platform device mfd_cell pointer, MFD drivers
can go back to passing platform data back to their sub drivers.
This allows for an mfd_cell->mfd_data removal and thus keep the sub drivers
MFD agnostic. This is mostly needed for non MFD aware sub drivers.

Cc: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/mfd/ab3100-core.c  |    6 ++++--
 drivers/regulator/ab3100.c |    3 +--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/ab3100-core.c b/drivers/mfd/ab3100-core.c
index a751927..a20e1c4 100644
--- a/drivers/mfd/ab3100-core.c
+++ b/drivers/mfd/ab3100-core.c
@@ -949,8 +949,10 @@ static int __devinit ab3100_probe(struct i2c_client *client,
 		goto exit_no_ops;
 
 	/* Set up and register the platform devices. */
-	for (i = 0; i < ARRAY_SIZE(ab3100_devs); i++)
-		ab3100_devs[i].mfd_data = ab3100_plf_data;
+	for (i = 0; i < ARRAY_SIZE(ab3100_devs); i++) {
+		ab3100_devs[i].platform_data = ab3100_plf_data;
+		ab3100_devs[i].pdata_size = sizeof(struct ab3100_platform_data);
+	}
 
 	err = mfd_add_devices(&client->dev, 0, ab3100_devs,
 		ARRAY_SIZE(ab3100_devs), NULL, 0);
diff --git a/drivers/regulator/ab3100.c b/drivers/regulator/ab3100.c
index b1d7794..585e494 100644
--- a/drivers/regulator/ab3100.c
+++ b/drivers/regulator/ab3100.c
@@ -17,7 +17,6 @@
 #include <linux/platform_device.h>
 #include <linux/regulator/driver.h>
 #include <linux/mfd/abx500.h>
-#include <linux/mfd/core.h>
 
 /* LDO registers and some handy masking definitions for AB3100 */
 #define AB3100_LDO_A		0x40
@@ -582,7 +581,7 @@ ab3100_regulator_desc[AB3100_NUM_REGULATORS] = {
 
 static int __devinit ab3100_regulators_probe(struct platform_device *pdev)
 {
-	struct ab3100_platform_data *plfdata = mfd_get_data(pdev);
+	struct ab3100_platform_data *plfdata = pdev->dev.platform_data;
 	int err = 0;
 	u8 data;
 	int i;
-- 
1.7.2.3


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

* [PATCH 04/19] mmc: Use device platform_data to retrieve tmio_mmc platform bits
       [not found] <1304901131-7104-1-git-send-email-sameo@linux.intel.com>
  2011-05-09  0:31 ` [PATCH 02/19] mfd: Use mfd cell platform_data for ab3550 cells platform bits Samuel Ortiz
  2011-05-09  0:31 ` [PATCH 03/19] mfd: Use mfd cell platform_data for ab3100 " Samuel Ortiz
@ 2011-05-09  0:31 ` Samuel Ortiz
  2011-05-09  0:31 ` [PATCH 05/19] w1: Use device platform_data to retrieve ds1wm " Samuel Ortiz
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Samuel Ortiz @ 2011-05-09  0:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Samuel Ortiz, Ian Molton, Guennadi Liakhovetski, Philipp Zabel

With the addition of the platform device mfd_cell pointer, we can now
cleanly pass the sub device drivers platform data pointers through the
regular device platform_data one, and get rid of mfd_get_data()

Cc: Ian Molton <spyro@f2s.com>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/mfd/asic3.c         |    3 ++-
 drivers/mfd/t7l66xb.c       |    3 ++-
 drivers/mfd/tc6387xb.c      |    3 ++-
 drivers/mfd/tc6393xb.c      |    3 ++-
 drivers/mmc/host/tmio_mmc.c |    2 +-
 5 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index d4a851c..1df4f2c 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -777,7 +777,8 @@ static struct mfd_cell asic3_cell_mmc = {
 	.name          = "tmio-mmc",
 	.enable        = asic3_mmc_enable,
 	.disable       = asic3_mmc_disable,
-	.mfd_data      = &asic3_mmc_data,
+	.platform_data = &asic3_mmc_data,
+	.pdata_size    = sizeof(asic3_mmc_data),
 	.num_resources = ARRAY_SIZE(asic3_mmc_resources),
 	.resources     = asic3_mmc_resources,
 };
diff --git a/drivers/mfd/t7l66xb.c b/drivers/mfd/t7l66xb.c
index 42830e6..5ef0b8f 100644
--- a/drivers/mfd/t7l66xb.c
+++ b/drivers/mfd/t7l66xb.c
@@ -170,7 +170,8 @@ static struct mfd_cell t7l66xb_cells[] = {
 		.name = "tmio-mmc",
 		.enable = t7l66xb_mmc_enable,
 		.disable = t7l66xb_mmc_disable,
-		.mfd_data = &t7166xb_mmc_data,
+		.platform_data = &t7166xb_mmc_data,
+		.pdata_size    = sizeof(t7166xb_mmc_data),
 		.num_resources = ARRAY_SIZE(t7l66xb_mmc_resources),
 		.resources = t7l66xb_mmc_resources,
 	},
diff --git a/drivers/mfd/tc6387xb.c b/drivers/mfd/tc6387xb.c
index b006f7c..ad715bf 100644
--- a/drivers/mfd/tc6387xb.c
+++ b/drivers/mfd/tc6387xb.c
@@ -131,7 +131,8 @@ static struct mfd_cell tc6387xb_cells[] = {
 		.name = "tmio-mmc",
 		.enable = tc6387xb_mmc_enable,
 		.disable = tc6387xb_mmc_disable,
-		.mfd_data = &tc6387xb_mmc_data,
+		.platform_data = &tc6387xb_mmc_data,
+		.pdata_size    = sizeof(tc6387xb_mmc_data),
 		.num_resources = ARRAY_SIZE(tc6387xb_mmc_resources),
 		.resources = tc6387xb_mmc_resources,
 	},
diff --git a/drivers/mfd/tc6393xb.c b/drivers/mfd/tc6393xb.c
index fc53ce2..8e9b1b7 100644
--- a/drivers/mfd/tc6393xb.c
+++ b/drivers/mfd/tc6393xb.c
@@ -393,7 +393,8 @@ static struct mfd_cell __devinitdata tc6393xb_cells[] = {
 		.name = "tmio-mmc",
 		.enable = tc6393xb_mmc_enable,
 		.resume = tc6393xb_mmc_resume,
-		.mfd_data = &tc6393xb_mmc_data,
+		.platform_data = &tc6393xb_mmc_data,
+		.pdata_size    = sizeof(tc6393xb_mmc_data),
 		.num_resources = ARRAY_SIZE(tc6393xb_mmc_resources),
 		.resources = tc6393xb_mmc_resources,
 	},
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index 79c5684..7ae05f9 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -72,7 +72,7 @@ static int __devinit tmio_mmc_probe(struct platform_device *pdev)
 	if (pdev->num_resources != 2)
 		goto out;
 
-	pdata = mfd_get_data(pdev);
+	pdata = pdev->dev.platform_data;
 	if (!pdata || !pdata->hclk)
 		goto out;
 
-- 
1.7.2.3


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

* [PATCH 05/19] w1: Use device platform_data to retrieve ds1wm platform bits
       [not found] <1304901131-7104-1-git-send-email-sameo@linux.intel.com>
                   ` (2 preceding siblings ...)
  2011-05-09  0:31 ` [PATCH 04/19] mmc: Use device platform_data to retrieve tmio_mmc " Samuel Ortiz
@ 2011-05-09  0:31 ` Samuel Ortiz
  2011-05-09  0:31 ` [PATCH 06/19] mfd: Pass htc-pasic3 led platform data through the cell platform_data Samuel Ortiz
                   ` (16 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Samuel Ortiz @ 2011-05-09  0:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: Samuel Ortiz, Matt Reimer, Philipp Zabel

With the addition of the platform device mfd_cell pointer, we can now
cleanly pass the sub device drivers platform data pointers through the
regular device platform_data one, and get rid of mfd_get_data().

Cc: Matt Reimer <mreimer@vpop.net>
Cc: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/mfd/asic3.c        |    3 ++-
 drivers/mfd/htc-pasic3.c   |    3 ++-
 drivers/w1/masters/ds1wm.c |   12 ++++++++++--
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index 1df4f2c..0536e11 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -676,7 +676,8 @@ static struct mfd_cell asic3_cell_ds1wm = {
 	.name          = "ds1wm",
 	.enable        = ds1wm_enable,
 	.disable       = ds1wm_disable,
-	.mfd_data      = &ds1wm_pdata,
+	.platform_data = &ds1wm_pdata,
+	.pdata_size    = sizeof(ds1wm_pdata),
 	.num_resources = ARRAY_SIZE(ds1wm_resources),
 	.resources     = ds1wm_resources,
 };
diff --git a/drivers/mfd/htc-pasic3.c b/drivers/mfd/htc-pasic3.c
index fb9770b..95a4ff4 100644
--- a/drivers/mfd/htc-pasic3.c
+++ b/drivers/mfd/htc-pasic3.c
@@ -117,7 +117,8 @@ static struct mfd_cell ds1wm_cell __initdata = {
 	.name          = "ds1wm",
 	.enable        = ds1wm_enable,
 	.disable       = ds1wm_disable,
-	.mfd_data      = &ds1wm_pdata,
+	.platform_data = &ds1wm_pdata,
+	.pdata_size    = sizeof(ds1wm_pdata),
 	.num_resources = 2,
 	.resources     = ds1wm_resources,
 };
diff --git a/drivers/w1/masters/ds1wm.c b/drivers/w1/masters/ds1wm.c
index 2f4fa02..0855d6c 100644
--- a/drivers/w1/masters/ds1wm.c
+++ b/drivers/w1/masters/ds1wm.c
@@ -216,7 +216,7 @@ static int ds1wm_find_divisor(int gclk)
 static void ds1wm_up(struct ds1wm_data *ds1wm_data)
 {
 	int divisor;
-	struct ds1wm_driver_data *plat = mfd_get_data(ds1wm_data->pdev);
+	struct ds1wm_driver_data *plat = ds1wm_data->pdev->dev.platform_data;
 
 	if (ds1wm_data->cell->enable)
 		ds1wm_data->cell->enable(ds1wm_data->pdev);
@@ -351,13 +351,21 @@ static int ds1wm_probe(struct platform_device *pdev)
 		ret = -ENOMEM;
 		goto err0;
 	}
-	plat = mfd_get_data(pdev);
 
 	/* calculate bus shift from mem resource */
 	ds1wm_data->bus_shift = resource_size(res) >> 3;
 
 	ds1wm_data->pdev = pdev;
 	ds1wm_data->cell = mfd_get_cell(pdev);
+	if (!ds1wm_data->cell) {
+		ret = -ENODEV;
+		goto err1;
+	}
+	plat = pdev->dev.platform_data;
+	if (!plat) {
+		ret = -ENODEV;
+		goto err1;
+	}
 
 	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 	if (!res) {
-- 
1.7.2.3


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

* [PATCH 06/19] mfd: Pass htc-pasic3 led platform data through the cell platform_data
       [not found] <1304901131-7104-1-git-send-email-sameo@linux.intel.com>
                   ` (3 preceding siblings ...)
  2011-05-09  0:31 ` [PATCH 05/19] w1: Use device platform_data to retrieve ds1wm " Samuel Ortiz
@ 2011-05-09  0:31 ` Samuel Ortiz
  2011-05-09 10:20   ` Paul Parsons
  2011-05-09  0:31 ` [PATCH 07/19] mfd: Use mfd cell platform_data for wl1273 cells platform bits Samuel Ortiz
                   ` (15 subsequent siblings)
  20 siblings, 1 reply; 37+ messages in thread
From: Samuel Ortiz @ 2011-05-09  0:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: Samuel Ortiz, Philipp Zabel

Cc: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/mfd/htc-pasic3.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/htc-pasic3.c b/drivers/mfd/htc-pasic3.c
index 95a4ff4..2808bd1 100644
--- a/drivers/mfd/htc-pasic3.c
+++ b/drivers/mfd/htc-pasic3.c
@@ -173,6 +173,8 @@ static int __init pasic3_probe(struct platform_device *pdev)
 	}
 
 	if (pdata && pdata->led_pdata) {
+		led_cell.platform_data = pdata->led_pdata;
+		led_cell.pdata_size = sizeof(struct pasic3_leds_machinfo);
 		ret = mfd_add_devices(&pdev->dev, pdev->id, &led_cell, 1, r, 0);
 		if (ret < 0)
 			dev_warn(dev, "failed to register LED device\n");
-- 
1.7.2.3


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

* [PATCH 07/19] mfd: Use mfd cell platform_data for wl1273 cells platform bits
       [not found] <1304901131-7104-1-git-send-email-sameo@linux.intel.com>
                   ` (4 preceding siblings ...)
  2011-05-09  0:31 ` [PATCH 06/19] mfd: Pass htc-pasic3 led platform data through the cell platform_data Samuel Ortiz
@ 2011-05-09  0:31 ` Samuel Ortiz
  2011-06-09  8:43   ` Matti J. Aaltonen
  2011-05-09  0:32 ` [PATCH 08/19] fb: Use platform_data to retrieve tmiofb " Samuel Ortiz
                   ` (14 subsequent siblings)
  20 siblings, 1 reply; 37+ messages in thread
From: Samuel Ortiz @ 2011-05-09  0:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: Samuel Ortiz, Matti Aaltonen

With the addition of a platform device mfd_cell pointer, MFD drivers
can go back to passing platform data back to their sub drivers.
This allows for an mfd_cell->mfd_data removal and thus keep the
sub drivers MFD agnostic. This is mostly needed for non MFD aware
sub drivers.

Cc: Matti Aaltonen <matti.j.aaltonen@nokia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/media/radio/radio-wl1273.c |    2 +-
 drivers/mfd/wl1273-core.c          |    6 ++++--
 sound/soc/codecs/wl1273.c          |    3 +--
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/media/radio/radio-wl1273.c b/drivers/media/radio/radio-wl1273.c
index e2550dc..46cacf8 100644
--- a/drivers/media/radio/radio-wl1273.c
+++ b/drivers/media/radio/radio-wl1273.c
@@ -1990,7 +1990,7 @@ static int wl1273_fm_radio_remove(struct platform_device *pdev)
 
 static int __devinit wl1273_fm_radio_probe(struct platform_device *pdev)
 {
-	struct wl1273_core **core = mfd_get_data(pdev);
+	struct wl1273_core **core = pdev->dev.platform_data;
 	struct wl1273_device *radio;
 	struct v4l2_ctrl *ctrl;
 	int r = 0;
diff --git a/drivers/mfd/wl1273-core.c b/drivers/mfd/wl1273-core.c
index 04914f2..63d250d 100644
--- a/drivers/mfd/wl1273-core.c
+++ b/drivers/mfd/wl1273-core.c
@@ -217,7 +217,8 @@ static int __devinit wl1273_core_probe(struct i2c_client *client,
 
 	cell = &core->cells[children];
 	cell->name = "wl1273_fm_radio";
-	cell->mfd_data = &core;
+	cell->platform_data = &core;
+	cell->pdata_size = sizeof(core);
 	children++;
 
 	core->read = wl1273_fm_read_reg;
@@ -231,7 +232,8 @@ static int __devinit wl1273_core_probe(struct i2c_client *client,
 
 		dev_dbg(&client->dev, "%s: Have codec.\n", __func__);
 		cell->name = "wl1273-codec";
-		cell->mfd_data = &core;
+		cell->platform_data = &core;
+		cell->pdata_size = sizeof(core);
 		children++;
 	}
 
diff --git a/sound/soc/codecs/wl1273.c b/sound/soc/codecs/wl1273.c
index c8a874d..5836201 100644
--- a/sound/soc/codecs/wl1273.c
+++ b/sound/soc/codecs/wl1273.c
@@ -441,8 +441,7 @@ EXPORT_SYMBOL_GPL(wl1273_get_format);
 
 static int wl1273_probe(struct snd_soc_codec *codec)
 {
-	struct wl1273_core **core =
-			mfd_get_data(to_platform_device(codec->dev));
+	struct wl1273_core **core = codec->dev->platform_data;
 	struct wl1273_priv *wl1273;
 	int r;
 
-- 
1.7.2.3


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

* [PATCH 08/19] fb: Use platform_data to retrieve tmiofb platform bits
       [not found] <1304901131-7104-1-git-send-email-sameo@linux.intel.com>
                   ` (5 preceding siblings ...)
  2011-05-09  0:31 ` [PATCH 07/19] mfd: Use mfd cell platform_data for wl1273 cells platform bits Samuel Ortiz
@ 2011-05-09  0:32 ` Samuel Ortiz
  2011-05-09  0:32 ` [PATCH 09/19] mtd: Use platform_data to retrieve tmio_nand " Samuel Ortiz
                   ` (13 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Samuel Ortiz @ 2011-05-09  0:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Samuel Ortiz, Ian Molton, Dmitry Baryshkov, Paul Mundt

With the addition of the platform device mfd_cell pointer, we can now
cleanly pass the sub device drivers platform data pointers through the
regular device platform_data one, and get rid of mfd_get_data().

Cc: Ian Molton <spyro@f2s.com>
Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/mfd/tc6393xb.c |    3 ++-
 drivers/video/tmiofb.c |   12 +++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/mfd/tc6393xb.c b/drivers/mfd/tc6393xb.c
index 8e9b1b7..b3d5852 100644
--- a/drivers/mfd/tc6393xb.c
+++ b/drivers/mfd/tc6393xb.c
@@ -694,7 +694,8 @@ static int __devinit tc6393xb_probe(struct platform_device *dev)
 	}
 
 	tc6393xb_cells[TC6393XB_CELL_NAND].mfd_data = tcpd->nand_data;
-	tc6393xb_cells[TC6393XB_CELL_FB].mfd_data = tcpd->fb_data;
+	tc6393xb_cells[TC6393XB_CELL_FB].platform_data = tcpd->fb_data;
+	tc6393xb_cells[TC6393XB_CELL_FB].pdata_size = sizeof(*tcpd->fb_data);
 
 	ret = mfd_add_devices(&dev->dev, dev->id,
 			tc6393xb_cells, ARRAY_SIZE(tc6393xb_cells),
diff --git a/drivers/video/tmiofb.c b/drivers/video/tmiofb.c
index 0c341d7..cd1c4dc 100644
--- a/drivers/video/tmiofb.c
+++ b/drivers/video/tmiofb.c
@@ -250,7 +250,7 @@ static irqreturn_t tmiofb_irq(int irq, void *__info)
  */
 static int tmiofb_hw_stop(struct platform_device *dev)
 {
-	struct tmio_fb_data *data = mfd_get_data(dev);
+	struct tmio_fb_data *data = dev->dev.platform_data;
 	struct fb_info *info = platform_get_drvdata(dev);
 	struct tmiofb_par *par = info->par;
 
@@ -311,7 +311,7 @@ static int tmiofb_hw_init(struct platform_device *dev)
  */
 static void tmiofb_hw_mode(struct platform_device *dev)
 {
-	struct tmio_fb_data *data = mfd_get_data(dev);
+	struct tmio_fb_data *data = dev->dev.platform_data;
 	struct fb_info *info = platform_get_drvdata(dev);
 	struct fb_videomode *mode = info->mode;
 	struct tmiofb_par *par = info->par;
@@ -557,8 +557,7 @@ static int tmiofb_ioctl(struct fb_info *fbi,
 static struct fb_videomode *
 tmiofb_find_mode(struct fb_info *info, struct fb_var_screeninfo *var)
 {
-	struct tmio_fb_data *data =
-			mfd_get_data(to_platform_device(info->device));
+	struct tmio_fb_data *data = info->device->platform_data;
 	struct fb_videomode *best = NULL;
 	int i;
 
@@ -578,8 +577,7 @@ static int tmiofb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
 {
 
 	struct fb_videomode *mode;
-	struct tmio_fb_data *data =
-			mfd_get_data(to_platform_device(info->device));
+	struct tmio_fb_data *data = info->device->platform_data;
 
 	mode = tmiofb_find_mode(info, var);
 	if (!mode || var->bits_per_pixel > 16)
@@ -680,7 +678,7 @@ static struct fb_ops tmiofb_ops = {
 static int __devinit tmiofb_probe(struct platform_device *dev)
 {
 	const struct mfd_cell *cell = mfd_get_cell(dev);
-	struct tmio_fb_data *data = mfd_get_data(dev);
+	struct tmio_fb_data *data = dev->dev.platform_data;
 	struct resource *ccr = platform_get_resource(dev, IORESOURCE_MEM, 1);
 	struct resource *lcr = platform_get_resource(dev, IORESOURCE_MEM, 0);
 	struct resource *vram = platform_get_resource(dev, IORESOURCE_MEM, 2);
-- 
1.7.2.3


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

* [PATCH 09/19] mtd: Use platform_data to retrieve tmio_nand platform bits
       [not found] <1304901131-7104-1-git-send-email-sameo@linux.intel.com>
                   ` (6 preceding siblings ...)
  2011-05-09  0:32 ` [PATCH 08/19] fb: Use platform_data to retrieve tmiofb " Samuel Ortiz
@ 2011-05-09  0:32 ` Samuel Ortiz
  2011-05-09  0:32 ` [PATCH 10/19] mfd: Use mfd cell platform_data for timberdale cells " Samuel Ortiz
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Samuel Ortiz @ 2011-05-09  0:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Samuel Ortiz, Ian Molton, Dmitry Baryshkov, Artem Bityutskiy

With the addition of the platform device mfd_cell pointer, we can now
cleanly pass the sub device drivers platform data pointers through the
regular device platform_data one, and get rid of mfd_get_data().

Cc: Ian Molton <spyro@f2s.com>
Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>
Cc: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/mfd/t7l66xb.c        |    3 ++-
 drivers/mfd/tc6393xb.c       |    4 +++-
 drivers/mtd/nand/tmio_nand.c |    2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/t7l66xb.c b/drivers/mfd/t7l66xb.c
index 5ef0b8f..91ad21e 100644
--- a/drivers/mfd/t7l66xb.c
+++ b/drivers/mfd/t7l66xb.c
@@ -383,7 +383,8 @@ static int t7l66xb_probe(struct platform_device *dev)
 
 	t7l66xb_attach_irq(dev);
 
-	t7l66xb_cells[T7L66XB_CELL_NAND].mfd_data = pdata->nand_data;
+	t7l66xb_cells[T7L66XB_CELL_NAND].platform_data = pdata->nand_data;
+	t7l66xb_cells[T7L66XB_CELL_NAND].pdata_size = sizeof(*pdata->nand_data);
 
 	ret = mfd_add_devices(&dev->dev, dev->id,
 			      t7l66xb_cells, ARRAY_SIZE(t7l66xb_cells),
diff --git a/drivers/mfd/tc6393xb.c b/drivers/mfd/tc6393xb.c
index b3d5852..9612264 100644
--- a/drivers/mfd/tc6393xb.c
+++ b/drivers/mfd/tc6393xb.c
@@ -693,7 +693,9 @@ static int __devinit tc6393xb_probe(struct platform_device *dev)
 			goto err_setup;
 	}
 
-	tc6393xb_cells[TC6393XB_CELL_NAND].mfd_data = tcpd->nand_data;
+	tc6393xb_cells[TC6393XB_CELL_NAND].platform_data = tcpd->nand_data;
+	tc6393xb_cells[TC6393XB_CELL_NAND].pdata_size =
+						sizeof(*tcpd->nand_data);
 	tc6393xb_cells[TC6393XB_CELL_FB].platform_data = tcpd->fb_data;
 	tc6393xb_cells[TC6393XB_CELL_FB].pdata_size = sizeof(*tcpd->fb_data);
 
diff --git a/drivers/mtd/nand/tmio_nand.c b/drivers/mtd/nand/tmio_nand.c
index 14c5787..c004e47 100644
--- a/drivers/mtd/nand/tmio_nand.c
+++ b/drivers/mtd/nand/tmio_nand.c
@@ -372,7 +372,7 @@ static void tmio_hw_stop(struct platform_device *dev, struct tmio_nand *tmio)
 
 static int tmio_probe(struct platform_device *dev)
 {
-	struct tmio_nand_data *data = mfd_get_data(dev);
+	struct tmio_nand_data *data = dev->dev.platform_data;
 	struct resource *fcr = platform_get_resource(dev,
 			IORESOURCE_MEM, 0);
 	struct resource *ccr = platform_get_resource(dev,
-- 
1.7.2.3


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

* [PATCH 10/19] mfd: Use mfd cell platform_data for timberdale cells platform bits
       [not found] <1304901131-7104-1-git-send-email-sameo@linux.intel.com>
                   ` (7 preceding siblings ...)
  2011-05-09  0:32 ` [PATCH 09/19] mtd: Use platform_data to retrieve tmio_nand " Samuel Ortiz
@ 2011-05-09  0:32 ` Samuel Ortiz
  2011-05-09  0:32 ` [PATCH 11/19] mfd: Use mfd cell platform_data for rdc321x " Samuel Ortiz
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Samuel Ortiz @ 2011-05-09  0:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Samuel Ortiz, Richard Röjfors

With the addition of a device platform mfd_cell pointer, MFD drivers
can go back to passing platform data back to their sub drivers.
This allows for an mfd_cell->mfd_data removal and thus keep the
sub drivers MFD agnostic. This is mostly needed for non MFD aware
sub drivers.

Cc: Richard Röjfors <richard.rojfors@pelagicore.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/dma/timb_dma.c           |    3 +-
 drivers/gpio/timbgpio.c          |    6 +-
 drivers/i2c/busses/i2c-ocores.c  |    3 +-
 drivers/i2c/busses/i2c-xiic.c    |    3 +-
 drivers/media/radio/radio-timb.c |    3 +-
 drivers/media/video/timblogiw.c  |    3 +-
 drivers/mfd/timberdale.c         |   81 +++++++++++++++++++++++++-------------
 drivers/net/ks8842.c             |    3 +-
 drivers/spi/xilinx_spi.c         |    3 +-
 9 files changed, 64 insertions(+), 44 deletions(-)

diff --git a/drivers/dma/timb_dma.c b/drivers/dma/timb_dma.c
index d2c75fe..f69f90a 100644
--- a/drivers/dma/timb_dma.c
+++ b/drivers/dma/timb_dma.c
@@ -27,7 +27,6 @@
 #include <linux/io.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
-#include <linux/mfd/core.h>
 #include <linux/slab.h>
 
 #include <linux/timb_dma.h>
@@ -685,7 +684,7 @@ static irqreturn_t td_irq(int irq, void *devid)
 
 static int __devinit td_probe(struct platform_device *pdev)
 {
-	struct timb_dma_platform_data *pdata = mfd_get_data(pdev);
+	struct timb_dma_platform_data *pdata = pdev->dev.platform_data;
 	struct timb_dma *td;
 	struct resource *iomem;
 	int irq;
diff --git a/drivers/gpio/timbgpio.c b/drivers/gpio/timbgpio.c
index edbe1ea..0265872 100644
--- a/drivers/gpio/timbgpio.c
+++ b/drivers/gpio/timbgpio.c
@@ -23,7 +23,6 @@
 #include <linux/module.h>
 #include <linux/gpio.h>
 #include <linux/platform_device.h>
-#include <linux/mfd/core.h>
 #include <linux/irq.h>
 #include <linux/io.h>
 #include <linux/timb_gpio.h>
@@ -229,7 +228,7 @@ static int __devinit timbgpio_probe(struct platform_device *pdev)
 	struct gpio_chip *gc;
 	struct timbgpio *tgpio;
 	struct resource *iomem;
-	struct timbgpio_platform_data *pdata = mfd_get_data(pdev);
+	struct timbgpio_platform_data *pdata = pdev->dev.platform_data;
 	int irq = platform_get_irq(pdev, 0);
 
 	if (!pdata || pdata->nr_pins > 32) {
@@ -320,13 +319,14 @@ err_mem:
 static int __devexit timbgpio_remove(struct platform_device *pdev)
 {
 	int err;
+	struct timbgpio_platform_data *pdata = pdev->dev.platform_data;
 	struct timbgpio *tgpio = platform_get_drvdata(pdev);
 	struct resource *iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	int irq = platform_get_irq(pdev, 0);
 
 	if (irq >= 0 && tgpio->irq_base > 0) {
 		int i;
-		for (i = 0; i < tgpio->gpio.ngpio; i++) {
+		for (i = 0; i < pdata->nr_pins; i++) {
 			irq_set_chip(tgpio->irq_base + i, NULL);
 			irq_set_chip_data(tgpio->irq_base + i, NULL);
 		}
diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c
index fee1a26..1b46a9d 100644
--- a/drivers/i2c/busses/i2c-ocores.c
+++ b/drivers/i2c/busses/i2c-ocores.c
@@ -49,7 +49,6 @@
 #include <linux/init.h>
 #include <linux/errno.h>
 #include <linux/platform_device.h>
-#include <linux/mfd/core.h>
 #include <linux/i2c.h>
 #include <linux/interrupt.h>
 #include <linux/wait.h>
@@ -306,7 +305,7 @@ static int __devinit ocores_i2c_probe(struct platform_device *pdev)
 		return -EIO;
 	}
 
-	pdata = mfd_get_data(pdev);
+	pdata = pdev->dev.platform_data;
 	if (pdata) {
 		i2c->regstep = pdata->regstep;
 		i2c->clock_khz = pdata->clock_khz;
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index e9d5ff4..4bb68f3 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -34,7 +34,6 @@
 #include <linux/errno.h>
 #include <linux/delay.h>
 #include <linux/platform_device.h>
-#include <linux/mfd/core.h>
 #include <linux/i2c.h>
 #include <linux/interrupt.h>
 #include <linux/wait.h>
@@ -705,7 +704,7 @@ static int __devinit xiic_i2c_probe(struct platform_device *pdev)
 	if (irq < 0)
 		goto resource_missing;
 
-	pdata = mfd_get_data(pdev);
+	pdata = (struct xiic_i2c_platform_data *) pdev->dev.platform_data;
 	if (!pdata)
 		return -EINVAL;
 
diff --git a/drivers/media/radio/radio-timb.c b/drivers/media/radio/radio-timb.c
index 1e3a8dd..a185610 100644
--- a/drivers/media/radio/radio-timb.c
+++ b/drivers/media/radio/radio-timb.c
@@ -21,7 +21,6 @@
 #include <media/v4l2-ioctl.h>
 #include <media/v4l2-device.h>
 #include <linux/platform_device.h>
-#include <linux/mfd/core.h>
 #include <linux/interrupt.h>
 #include <linux/slab.h>
 #include <linux/i2c.h>
@@ -149,7 +148,7 @@ static const struct v4l2_file_operations timbradio_fops = {
 
 static int __devinit timbradio_probe(struct platform_device *pdev)
 {
-	struct timb_radio_platform_data *pdata = mfd_get_data(pdev);
+	struct timb_radio_platform_data *pdata = pdev->dev.platform_data;
 	struct timbradio *tr;
 	int err;
 
diff --git a/drivers/media/video/timblogiw.c b/drivers/media/video/timblogiw.c
index 84d4c7c..fc611eb 100644
--- a/drivers/media/video/timblogiw.c
+++ b/drivers/media/video/timblogiw.c
@@ -24,7 +24,6 @@
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 #include <linux/dmaengine.h>
-#include <linux/mfd/core.h>
 #include <linux/scatterlist.h>
 #include <linux/interrupt.h>
 #include <linux/list.h>
@@ -791,7 +790,7 @@ static int __devinit timblogiw_probe(struct platform_device *pdev)
 {
 	int err;
 	struct timblogiw *lw = NULL;
-	struct timb_video_platform_data *pdata = mfd_get_data(pdev);
+	struct timb_video_platform_data *pdata = pdev->dev.platform_data;
 
 	if (!pdata) {
 		dev_err(&pdev->dev, "No platform data\n");
diff --git a/drivers/mfd/timberdale.c b/drivers/mfd/timberdale.c
index 94c6c8a..69272e4 100644
--- a/drivers/mfd/timberdale.c
+++ b/drivers/mfd/timberdale.c
@@ -384,7 +384,8 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg0[] = {
 		.name = "timb-dma",
 		.num_resources = ARRAY_SIZE(timberdale_dma_resources),
 		.resources = timberdale_dma_resources,
-		.mfd_data = &timb_dma_platform_data,
+		.platform_data = &timb_dma_platform_data,
+		.pdata_size = sizeof(timb_dma_platform_data),
 	},
 	{
 		.name = "timb-uart",
@@ -395,37 +396,43 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg0[] = {
 		.name = "xiic-i2c",
 		.num_resources = ARRAY_SIZE(timberdale_xiic_resources),
 		.resources = timberdale_xiic_resources,
-		.mfd_data = &timberdale_xiic_platform_data,
+		.platform_data = &timberdale_xiic_platform_data,
+		.pdata_size = sizeof(timberdale_xiic_platform_data),
 	},
 	{
 		.name = "timb-gpio",
 		.num_resources = ARRAY_SIZE(timberdale_gpio_resources),
 		.resources = timberdale_gpio_resources,
-		.mfd_data = &timberdale_gpio_platform_data,
+		.platform_data = &timberdale_gpio_platform_data,
+		.pdata_size = sizeof(timberdale_gpio_platform_data),
 	},
 	{
 		.name = "timb-video",
 		.num_resources = ARRAY_SIZE(timberdale_video_resources),
 		.resources = timberdale_video_resources,
-		.mfd_data = &timberdale_video_platform_data,
+		.platform_data = &timberdale_video_platform_data,
+		.pdata_size = sizeof(timberdale_video_platform_data),
 	},
 	{
 		.name = "timb-radio",
 		.num_resources = ARRAY_SIZE(timberdale_radio_resources),
 		.resources = timberdale_radio_resources,
-		.mfd_data = &timberdale_radio_platform_data,
+		.platform_data = &timberdale_radio_platform_data,
+		.pdata_size = sizeof(timberdale_radio_platform_data),
 	},
 	{
 		.name = "xilinx_spi",
 		.num_resources = ARRAY_SIZE(timberdale_spi_resources),
 		.resources = timberdale_spi_resources,
-		.mfd_data = &timberdale_xspi_platform_data,
+		.platform_data = &timberdale_xspi_platform_data,
+		.pdata_size = sizeof(timberdale_xspi_platform_data),
 	},
 	{
 		.name = "ks8842",
 		.num_resources = ARRAY_SIZE(timberdale_eth_resources),
 		.resources = timberdale_eth_resources,
-		.mfd_data = &timberdale_ks8842_platform_data,
+		.platform_data = &timberdale_ks8842_platform_data,
+		.pdata_size = sizeof(timberdale_ks8842_platform_data),
 	},
 };
 
@@ -434,7 +441,8 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg1[] = {
 		.name = "timb-dma",
 		.num_resources = ARRAY_SIZE(timberdale_dma_resources),
 		.resources = timberdale_dma_resources,
-		.mfd_data = &timb_dma_platform_data,
+		.platform_data = &timb_dma_platform_data,
+		.pdata_size = sizeof(timb_dma_platform_data),
 	},
 	{
 		.name = "timb-uart",
@@ -450,13 +458,15 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg1[] = {
 		.name = "xiic-i2c",
 		.num_resources = ARRAY_SIZE(timberdale_xiic_resources),
 		.resources = timberdale_xiic_resources,
-		.mfd_data = &timberdale_xiic_platform_data,
+		.platform_data = &timberdale_xiic_platform_data,
+		.pdata_size = sizeof(timberdale_xiic_platform_data),
 	},
 	{
 		.name = "timb-gpio",
 		.num_resources = ARRAY_SIZE(timberdale_gpio_resources),
 		.resources = timberdale_gpio_resources,
-		.mfd_data = &timberdale_gpio_platform_data,
+		.platform_data = &timberdale_gpio_platform_data,
+		.pdata_size = sizeof(timberdale_gpio_platform_data),
 	},
 	{
 		.name = "timb-mlogicore",
@@ -467,25 +477,29 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg1[] = {
 		.name = "timb-video",
 		.num_resources = ARRAY_SIZE(timberdale_video_resources),
 		.resources = timberdale_video_resources,
-		.mfd_data = &timberdale_video_platform_data,
+		.platform_data = &timberdale_video_platform_data,
+		.pdata_size = sizeof(timberdale_video_platform_data),
 	},
 	{
 		.name = "timb-radio",
 		.num_resources = ARRAY_SIZE(timberdale_radio_resources),
 		.resources = timberdale_radio_resources,
-		.mfd_data = &timberdale_radio_platform_data,
+		.platform_data = &timberdale_radio_platform_data,
+		.pdata_size = sizeof(timberdale_radio_platform_data),
 	},
 	{
 		.name = "xilinx_spi",
 		.num_resources = ARRAY_SIZE(timberdale_spi_resources),
 		.resources = timberdale_spi_resources,
-		.mfd_data = &timberdale_xspi_platform_data,
+		.platform_data = &timberdale_xspi_platform_data,
+		.pdata_size = sizeof(timberdale_xspi_platform_data),
 	},
 	{
 		.name = "ks8842",
 		.num_resources = ARRAY_SIZE(timberdale_eth_resources),
 		.resources = timberdale_eth_resources,
-		.mfd_data = &timberdale_ks8842_platform_data,
+		.platform_data = &timberdale_ks8842_platform_data,
+		.pdata_size = sizeof(timberdale_ks8842_platform_data),
 	},
 };
 
@@ -494,7 +508,8 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg2[] = {
 		.name = "timb-dma",
 		.num_resources = ARRAY_SIZE(timberdale_dma_resources),
 		.resources = timberdale_dma_resources,
-		.mfd_data = &timb_dma_platform_data,
+		.platform_data = &timb_dma_platform_data,
+		.pdata_size = sizeof(timb_dma_platform_data),
 	},
 	{
 		.name = "timb-uart",
@@ -505,31 +520,36 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg2[] = {
 		.name = "xiic-i2c",
 		.num_resources = ARRAY_SIZE(timberdale_xiic_resources),
 		.resources = timberdale_xiic_resources,
-		.mfd_data = &timberdale_xiic_platform_data,
+		.platform_data = &timberdale_xiic_platform_data,
+		.pdata_size = sizeof(timberdale_xiic_platform_data),
 	},
 	{
 		.name = "timb-gpio",
 		.num_resources = ARRAY_SIZE(timberdale_gpio_resources),
 		.resources = timberdale_gpio_resources,
-		.mfd_data = &timberdale_gpio_platform_data,
+		.platform_data = &timberdale_gpio_platform_data,
+		.pdata_size = sizeof(timberdale_gpio_platform_data),
 	},
 	{
 		.name = "timb-video",
 		.num_resources = ARRAY_SIZE(timberdale_video_resources),
 		.resources = timberdale_video_resources,
-		.mfd_data = &timberdale_video_platform_data,
+		.platform_data = &timberdale_video_platform_data,
+		.pdata_size = sizeof(timberdale_video_platform_data),
 	},
 	{
 		.name = "timb-radio",
 		.num_resources = ARRAY_SIZE(timberdale_radio_resources),
 		.resources = timberdale_radio_resources,
-		.mfd_data = &timberdale_radio_platform_data,
+		.platform_data = &timberdale_radio_platform_data,
+		.pdata_size = sizeof(timberdale_radio_platform_data),
 	},
 	{
 		.name = "xilinx_spi",
 		.num_resources = ARRAY_SIZE(timberdale_spi_resources),
 		.resources = timberdale_spi_resources,
-		.mfd_data = &timberdale_xspi_platform_data,
+		.platform_data = &timberdale_xspi_platform_data,
+		.pdata_size = sizeof(timberdale_xspi_platform_data),
 	},
 };
 
@@ -538,7 +558,8 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg3[] = {
 		.name = "timb-dma",
 		.num_resources = ARRAY_SIZE(timberdale_dma_resources),
 		.resources = timberdale_dma_resources,
-		.mfd_data = &timb_dma_platform_data,
+		.platform_data = &timb_dma_platform_data,
+		.pdata_size = sizeof(timb_dma_platform_data),
 	},
 	{
 		.name = "timb-uart",
@@ -549,37 +570,43 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg3[] = {
 		.name = "ocores-i2c",
 		.num_resources = ARRAY_SIZE(timberdale_ocores_resources),
 		.resources = timberdale_ocores_resources,
-		.mfd_data = &timberdale_ocores_platform_data,
+		.platform_data = &timberdale_ocores_platform_data,
+		.pdata_size = sizeof(timberdale_ocores_platform_data),
 	},
 	{
 		.name = "timb-gpio",
 		.num_resources = ARRAY_SIZE(timberdale_gpio_resources),
 		.resources = timberdale_gpio_resources,
-		.mfd_data = &timberdale_gpio_platform_data,
+		.platform_data = &timberdale_gpio_platform_data,
+		.pdata_size = sizeof(timberdale_gpio_platform_data),
 	},
 	{
 		.name = "timb-video",
 		.num_resources = ARRAY_SIZE(timberdale_video_resources),
 		.resources = timberdale_video_resources,
-		.mfd_data = &timberdale_video_platform_data,
+		.platform_data = &timberdale_video_platform_data,
+		.pdata_size = sizeof(timberdale_video_platform_data),
 	},
 	{
 		.name = "timb-radio",
 		.num_resources = ARRAY_SIZE(timberdale_radio_resources),
 		.resources = timberdale_radio_resources,
-		.mfd_data = &timberdale_radio_platform_data,
+		.platform_data = &timberdale_radio_platform_data,
+		.pdata_size = sizeof(timberdale_radio_platform_data),
 	},
 	{
 		.name = "xilinx_spi",
 		.num_resources = ARRAY_SIZE(timberdale_spi_resources),
 		.resources = timberdale_spi_resources,
-		.mfd_data = &timberdale_xspi_platform_data,
+		.platform_data = &timberdale_xspi_platform_data,
+		.pdata_size = sizeof(timberdale_xspi_platform_data),
 	},
 	{
 		.name = "ks8842",
 		.num_resources = ARRAY_SIZE(timberdale_eth_resources),
 		.resources = timberdale_eth_resources,
-		.mfd_data = &timberdale_ks8842_platform_data,
+		.platform_data = &timberdale_ks8842_platform_data,
+		.pdata_size = sizeof(timberdale_ks8842_platform_data),
 	},
 };
 
diff --git a/drivers/net/ks8842.c b/drivers/net/ks8842.c
index f0d8346..4d40626 100644
--- a/drivers/net/ks8842.c
+++ b/drivers/net/ks8842.c
@@ -26,7 +26,6 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
-#include <linux/mfd/core.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/ethtool.h>
@@ -1146,7 +1145,7 @@ static int __devinit ks8842_probe(struct platform_device *pdev)
 	struct resource *iomem;
 	struct net_device *netdev;
 	struct ks8842_adapter *adapter;
-	struct ks8842_platform_data *pdata = mfd_get_data(pdev);
+	struct ks8842_platform_data *pdata = pdev->dev.platform_data;
 	u16 id;
 	unsigned i;
 
diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c
index c69c6f2..4d2c75d 100644
--- a/drivers/spi/xilinx_spi.c
+++ b/drivers/spi/xilinx_spi.c
@@ -18,7 +18,6 @@
 #include <linux/interrupt.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
-#include <linux/mfd/core.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/spi_bitbang.h>
 #include <linux/spi/xilinx_spi.h>
@@ -471,7 +470,7 @@ static int __devinit xilinx_spi_probe(struct platform_device *dev)
 	struct spi_master *master;
 	u8 i;
 
-	pdata = mfd_get_data(dev);
+	pdata = dev->dev.platform_data;
 	if (pdata) {
 		num_cs = pdata->num_chipselect;
 		little_endian = pdata->little_endian;
-- 
1.7.2.3


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

* [PATCH 11/19] mfd: Use mfd cell platform_data for rdc321x cells platform bits
       [not found] <1304901131-7104-1-git-send-email-sameo@linux.intel.com>
                   ` (8 preceding siblings ...)
  2011-05-09  0:32 ` [PATCH 10/19] mfd: Use mfd cell platform_data for timberdale cells " Samuel Ortiz
@ 2011-05-09  0:32 ` Samuel Ortiz
  2011-05-09  0:32 ` [PATCH 12/19] mfd: Use mfd cell platform_data for wm8400 " Samuel Ortiz
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Samuel Ortiz @ 2011-05-09  0:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Samuel Ortiz, Grant Likely, Wim Van Sebroeck, Florian Fainelli

With the addition of a platform device mfd_cell pointer, MFD drivers
can go back to passing platform data back to their sub drivers.
This allows for an mfd_cell->mfd_data removal and thus keep the
sub drivers MFD agnostic. This is mostly needed for non MFD aware
sub drivers.

Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Wim Van Sebroeck <wim@iguana.be>
Cc: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/gpio/rdc321x-gpio.c       |    3 +--
 drivers/mfd/rdc321x-southbridge.c |    6 ++++--
 drivers/watchdog/rdc321x_wdt.c    |    3 +--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpio/rdc321x-gpio.c b/drivers/gpio/rdc321x-gpio.c
index a9bda88..2762698 100644
--- a/drivers/gpio/rdc321x-gpio.c
+++ b/drivers/gpio/rdc321x-gpio.c
@@ -27,7 +27,6 @@
 #include <linux/pci.h>
 #include <linux/gpio.h>
 #include <linux/mfd/rdc321x.h>
-#include <linux/mfd/core.h>
 #include <linux/slab.h>
 
 struct rdc321x_gpio {
@@ -136,7 +135,7 @@ static int __devinit rdc321x_gpio_probe(struct platform_device *pdev)
 	struct rdc321x_gpio *rdc321x_gpio_dev;
 	struct rdc321x_gpio_pdata *pdata;
 
-	pdata = mfd_get_data(pdev);
+	pdata = pdev->dev.platform_data;
 	if (!pdata) {
 		dev_err(&pdev->dev, "no platform data supplied\n");
 		return -ENODEV;
diff --git a/drivers/mfd/rdc321x-southbridge.c b/drivers/mfd/rdc321x-southbridge.c
index 10dbe63..809bd4a 100644
--- a/drivers/mfd/rdc321x-southbridge.c
+++ b/drivers/mfd/rdc321x-southbridge.c
@@ -61,12 +61,14 @@ static struct mfd_cell rdc321x_sb_cells[] = {
 		.name		= "rdc321x-wdt",
 		.resources	= rdc321x_wdt_resource,
 		.num_resources	= ARRAY_SIZE(rdc321x_wdt_resource),
-		.mfd_data	= &rdc321x_wdt_pdata,
+		.platform_data	= &rdc321x_wdt_pdata,
+		.pdata_size	= sizeof(rdc321x_wdt_pdata),
 	}, {
 		.name		= "rdc321x-gpio",
 		.resources	= rdc321x_gpio_resources,
 		.num_resources	= ARRAY_SIZE(rdc321x_gpio_resources),
-		.mfd_data	= &rdc321x_gpio_pdata,
+		.platform_data	= &rdc321x_gpio_pdata,
+		.pdata_size	= sizeof(rdc321x_gpio_pdata),
 	},
 };
 
diff --git a/drivers/watchdog/rdc321x_wdt.c b/drivers/watchdog/rdc321x_wdt.c
index d8e7250..428f8a1 100644
--- a/drivers/watchdog/rdc321x_wdt.c
+++ b/drivers/watchdog/rdc321x_wdt.c
@@ -37,7 +37,6 @@
 #include <linux/io.h>
 #include <linux/uaccess.h>
 #include <linux/mfd/rdc321x.h>
-#include <linux/mfd/core.h>
 
 #define RDC_WDT_MASK	0x80000000 /* Mask */
 #define RDC_WDT_EN	0x00800000 /* Enable bit */
@@ -232,7 +231,7 @@ static int __devinit rdc321x_wdt_probe(struct platform_device *pdev)
 	struct resource *r;
 	struct rdc321x_wdt_pdata *pdata;
 
-	pdata = mfd_get_data(pdev);
+	pdata = pdev->dev.platform_data;
 	if (!pdata) {
 		dev_err(&pdev->dev, "no platform data supplied\n");
 		return -ENODEV;
-- 
1.7.2.3


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

* [PATCH 12/19] mfd: Use mfd cell platform_data for wm8400 cells platform bits
       [not found] <1304901131-7104-1-git-send-email-sameo@linux.intel.com>
                   ` (9 preceding siblings ...)
  2011-05-09  0:32 ` [PATCH 11/19] mfd: Use mfd cell platform_data for rdc321x " Samuel Ortiz
@ 2011-05-09  0:32 ` Samuel Ortiz
  2011-05-09  7:13   ` Mark Brown
  2011-05-09  0:32 ` [PATCH 13/19] mfd: Use mfd cell platform_data for mc13xxx " Samuel Ortiz
                   ` (9 subsequent siblings)
  20 siblings, 1 reply; 37+ messages in thread
From: Samuel Ortiz @ 2011-05-09  0:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Samuel Ortiz, Mark Brown

With the addition of a platform device mfd_cell pointer, MFD drivers
can go back to passing platform data back to their sub drivers.
This allows for an mfd_cell->mfd_data removal and thus keep the
sub drivers MFD agnostic. This is mostly needed for non MFD aware
sub drivers.

Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/mfd/wm8400-core.c |    3 ++-
 sound/soc/codecs/wm8400.c |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/wm8400-core.c b/drivers/mfd/wm8400-core.c
index 3a6e78c..597f82e 100644
--- a/drivers/mfd/wm8400-core.c
+++ b/drivers/mfd/wm8400-core.c
@@ -245,7 +245,8 @@ static int wm8400_register_codec(struct wm8400 *wm8400)
 {
 	struct mfd_cell cell = {
 		.name = "wm8400-codec",
-		.mfd_data = wm8400,
+		.platform_data = wm8400,
+		.pdata_size = sizeof(*wm8400),
 	};
 
 	return mfd_add_devices(wm8400->dev, -1, &cell, 1, NULL, 0);
diff --git a/sound/soc/codecs/wm8400.c b/sound/soc/codecs/wm8400.c
index 736b785..a4bd593 100644
--- a/sound/soc/codecs/wm8400.c
+++ b/sound/soc/codecs/wm8400.c
@@ -1378,7 +1378,7 @@ static void wm8400_probe_deferred(struct work_struct *work)
 
 static int wm8400_codec_probe(struct snd_soc_codec *codec)
 {
-	struct wm8400 *wm8400 = mfd_get_data(to_platform_device(codec->dev));
+	struct wm8400 *wm8400 = codec->dev->platform_data;
 	struct wm8400_priv *priv;
 	int ret;
 	u16 reg;
-- 
1.7.2.3


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

* [PATCH 13/19] mfd: Use mfd cell platform_data for mc13xxx cells platform bits
       [not found] <1304901131-7104-1-git-send-email-sameo@linux.intel.com>
                   ` (10 preceding siblings ...)
  2011-05-09  0:32 ` [PATCH 12/19] mfd: Use mfd cell platform_data for wm8400 " Samuel Ortiz
@ 2011-05-09  0:32 ` Samuel Ortiz
  2011-05-09  0:32 ` [PATCH 14/19] mfd: Use mfd cell platform_data for janz " Samuel Ortiz
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Samuel Ortiz @ 2011-05-09  0:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Samuel Ortiz, Uwe Kleine-König, Mark Brown, Liam Girdwood

With the addition of a platform device mfd_cell pointer, MFD drivers
can go back to passing platform data back to their sub drivers.
This allows for an mfd_cell->mfd_data removal and thus keep the
sub drivers MFD agnostic. This is mostly needed for non MFD aware
sub drivers.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/leds/leds-mc13783.c           |    7 +++----
 drivers/mfd/mc13xxx-core.c            |   12 +++++++-----
 drivers/regulator/mc13783-regulator.c |    7 ++++---
 drivers/regulator/mc13892-regulator.c |    7 ++++---
 4 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/drivers/leds/leds-mc13783.c b/drivers/leds/leds-mc13783.c
index 06a5bb4..f05bb08 100644
--- a/drivers/leds/leds-mc13783.c
+++ b/drivers/leds/leds-mc13783.c
@@ -22,7 +22,6 @@
 #include <linux/leds.h>
 #include <linux/workqueue.h>
 #include <linux/mfd/mc13783.h>
-#include <linux/mfd/core.h>
 #include <linux/slab.h>
 
 struct mc13783_led {
@@ -184,7 +183,7 @@ static int __devinit mc13783_led_setup(struct mc13783_led *led, int max_current)
 
 static int __devinit mc13783_leds_prepare(struct platform_device *pdev)
 {
-	struct mc13783_leds_platform_data *pdata = mfd_get_data(pdev);
+	struct mc13783_leds_platform_data *pdata = dev_get_platdata(&pdev->dev);
 	struct mc13783 *dev = dev_get_drvdata(pdev->dev.parent);
 	int ret = 0;
 	int reg = 0;
@@ -265,7 +264,7 @@ out:
 
 static int __devinit mc13783_led_probe(struct platform_device *pdev)
 {
-	struct mc13783_leds_platform_data *pdata = mfd_get_data(pdev);
+	struct mc13783_leds_platform_data *pdata = dev_get_platdata(&pdev->dev);
 	struct mc13783_led_platform_data *led_cur;
 	struct mc13783_led *led, *led_dat;
 	int ret, i;
@@ -352,7 +351,7 @@ err_free:
 
 static int __devexit mc13783_led_remove(struct platform_device *pdev)
 {
-	struct mc13783_leds_platform_data *pdata = mfd_get_data(pdev);
+	struct mc13783_leds_platform_data *pdata = dev_get_platdata(&pdev->dev);
 	struct mc13783_led *led = platform_get_drvdata(pdev);
 	struct mc13783 *dev = dev_get_drvdata(pdev->dev.parent);
 	int i;
diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c
index 668634e..7e4d44b 100644
--- a/drivers/mfd/mc13xxx-core.c
+++ b/drivers/mfd/mc13xxx-core.c
@@ -683,13 +683,14 @@ out:
 EXPORT_SYMBOL_GPL(mc13783_adc_do_conversion);
 
 static int mc13xxx_add_subdevice_pdata(struct mc13xxx *mc13xxx,
-		const char *format, void *pdata)
+		const char *format, void *pdata, size_t pdata_size)
 {
 	char buf[30];
 	const char *name = mc13xxx_get_chipname(mc13xxx);
 
 	struct mfd_cell cell = {
-		.mfd_data = pdata,
+		.platform_data = pdata,
+		.pdata_size = pdata_size,
 	};
 
 	/* there is no asnprintf in the kernel :-( */
@@ -705,7 +706,7 @@ static int mc13xxx_add_subdevice_pdata(struct mc13xxx *mc13xxx,
 
 static int mc13xxx_add_subdevice(struct mc13xxx *mc13xxx, const char *format)
 {
-	return mc13xxx_add_subdevice_pdata(mc13xxx, format, NULL);
+	return mc13xxx_add_subdevice_pdata(mc13xxx, format, NULL, 0);
 }
 
 static int mc13xxx_probe(struct spi_device *spi)
@@ -764,7 +765,7 @@ err_revision:
 
 	if (pdata->flags & MC13XXX_USE_REGULATOR) {
 		mc13xxx_add_subdevice_pdata(mc13xxx, "%s-regulator",
-				&pdata->regulators);
+				&pdata->regulators, sizeof(pdata->regulators));
 	}
 
 	if (pdata->flags & MC13XXX_USE_RTC)
@@ -774,7 +775,8 @@ err_revision:
 		mc13xxx_add_subdevice(mc13xxx, "%s-ts");
 
 	if (pdata->flags & MC13XXX_USE_LED)
-		mc13xxx_add_subdevice_pdata(mc13xxx, "%s-led", pdata->leds);
+		mc13xxx_add_subdevice_pdata(mc13xxx, "%s-led",
+				pdata->leds, sizeof(*pdata->leds));
 
 	return 0;
 }
diff --git a/drivers/regulator/mc13783-regulator.c b/drivers/regulator/mc13783-regulator.c
index 23249cb..3e5d0c3 100644
--- a/drivers/regulator/mc13783-regulator.c
+++ b/drivers/regulator/mc13783-regulator.c
@@ -15,7 +15,6 @@
 #include <linux/regulator/driver.h>
 #include <linux/platform_device.h>
 #include <linux/kernel.h>
-#include <linux/mfd/core.h>
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/err.h>
@@ -337,7 +336,8 @@ static int __devinit mc13783_regulator_probe(struct platform_device *pdev)
 {
 	struct mc13xxx_regulator_priv *priv;
 	struct mc13xxx *mc13783 = dev_get_drvdata(pdev->dev.parent);
-	struct mc13783_regulator_platform_data *pdata = mfd_get_data(pdev);
+	struct mc13783_regulator_platform_data *pdata =
+		dev_get_platdata(&pdev->dev);
 	struct mc13783_regulator_init_data *init_data;
 	int i, ret;
 
@@ -381,7 +381,8 @@ err:
 static int __devexit mc13783_regulator_remove(struct platform_device *pdev)
 {
 	struct mc13xxx_regulator_priv *priv = platform_get_drvdata(pdev);
-	struct mc13783_regulator_platform_data *pdata = mfd_get_data(pdev);
+	struct mc13783_regulator_platform_data *pdata =
+		dev_get_platdata(&pdev->dev);
 	int i;
 
 	platform_set_drvdata(pdev, NULL);
diff --git a/drivers/regulator/mc13892-regulator.c b/drivers/regulator/mc13892-regulator.c
index 6f15168..1b8f739 100644
--- a/drivers/regulator/mc13892-regulator.c
+++ b/drivers/regulator/mc13892-regulator.c
@@ -15,7 +15,6 @@
 #include <linux/regulator/driver.h>
 #include <linux/platform_device.h>
 #include <linux/kernel.h>
-#include <linux/mfd/core.h>
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/err.h>
@@ -521,7 +520,8 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev)
 {
 	struct mc13xxx_regulator_priv *priv;
 	struct mc13xxx *mc13892 = dev_get_drvdata(pdev->dev.parent);
-	struct mc13xxx_regulator_platform_data *pdata = mfd_get_data(pdev);
+	struct mc13xxx_regulator_platform_data *pdata =
+		dev_get_platdata(&pdev->dev);
 	struct mc13xxx_regulator_init_data *init_data;
 	int i, ret;
 	u32 val;
@@ -595,7 +595,8 @@ err_free:
 static int __devexit mc13892_regulator_remove(struct platform_device *pdev)
 {
 	struct mc13xxx_regulator_priv *priv = platform_get_drvdata(pdev);
-	struct mc13xxx_regulator_platform_data *pdata = mfd_get_data(pdev);
+	struct mc13xxx_regulator_platform_data *pdata =
+		dev_get_platdata(&pdev->dev);
 	int i;
 
 	platform_set_drvdata(pdev, NULL);
-- 
1.7.2.3


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

* [PATCH 14/19] mfd: Use mfd cell platform_data for janz cells platform bits
       [not found] <1304901131-7104-1-git-send-email-sameo@linux.intel.com>
                   ` (11 preceding siblings ...)
  2011-05-09  0:32 ` [PATCH 13/19] mfd: Use mfd cell platform_data for mc13xxx " Samuel Ortiz
@ 2011-05-09  0:32 ` Samuel Ortiz
  2011-05-09  0:32 ` [PATCH 15/19] mfd: Use mfd cell platform_data for twl4030 codec " Samuel Ortiz
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Samuel Ortiz @ 2011-05-09  0:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Samuel Ortiz, Ira W. Snyder, Wolfgang Grandegger, Grant Likely

With the addition of a platform device mfd_cell pointer, MFD drivers
can go back to passing platform data back to their sub drivers.
This allows for an mfd_cell->mfd_data removal and thus keep the
sub drivers MFD agnostic. This is mostly needed for non MFD aware
sub drivers.

Cc: Ira W. Snyder <iws@ovro.caltech.edu>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/gpio/janz-ttl.c      |    3 +--
 drivers/mfd/janz-cmodio.c    |    3 ++-
 drivers/net/can/janz-ican3.c |    3 +--
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/gpio/janz-ttl.c b/drivers/gpio/janz-ttl.c
index 2514fb0..813ac07 100644
--- a/drivers/gpio/janz-ttl.c
+++ b/drivers/gpio/janz-ttl.c
@@ -15,7 +15,6 @@
 #include <linux/interrupt.h>
 #include <linux/delay.h>
 #include <linux/platform_device.h>
-#include <linux/mfd/core.h>
 #include <linux/io.h>
 #include <linux/gpio.h>
 #include <linux/slab.h>
@@ -150,7 +149,7 @@ static int __devinit ttl_probe(struct platform_device *pdev)
 	struct resource *res;
 	int ret;
 
-	pdata = mfd_get_data(pdev);
+	pdata = pdev->dev.platform_data;
 	if (!pdata) {
 		dev_err(dev, "no platform data\n");
 		ret = -ENXIO;
diff --git a/drivers/mfd/janz-cmodio.c b/drivers/mfd/janz-cmodio.c
index fc41911..5c2a06a 100644
--- a/drivers/mfd/janz-cmodio.c
+++ b/drivers/mfd/janz-cmodio.c
@@ -86,7 +86,8 @@ static int __devinit cmodio_setup_subdevice(struct cmodio_device *priv,
 
 	/* Add platform data */
 	pdata->modno = modno;
-	cell->mfd_data = pdata;
+	cell->platform_data = pdata;
+	cell->pdata_size = sizeof(*pdata);
 
 	/* MODULbus registers -- PCI BAR3 is big-endian MODULbus access */
 	res->flags = IORESOURCE_MEM;
diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
index 587fba4..f1942ca 100644
--- a/drivers/net/can/janz-ican3.c
+++ b/drivers/net/can/janz-ican3.c
@@ -15,7 +15,6 @@
 #include <linux/interrupt.h>
 #include <linux/delay.h>
 #include <linux/platform_device.h>
-#include <linux/mfd/core.h>
 
 #include <linux/netdevice.h>
 #include <linux/can.h>
@@ -1644,7 +1643,7 @@ static int __devinit ican3_probe(struct platform_device *pdev)
 	struct device *dev;
 	int ret;
 
-	pdata = mfd_get_data(pdev);
+	pdata = pdev->dev.platform_data;
 	if (!pdata)
 		return -ENXIO;
 
-- 
1.7.2.3


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

* [PATCH 15/19] mfd: Use mfd cell platform_data for twl4030 codec cells platform bits
       [not found] <1304901131-7104-1-git-send-email-sameo@linux.intel.com>
                   ` (12 preceding siblings ...)
  2011-05-09  0:32 ` [PATCH 14/19] mfd: Use mfd cell platform_data for janz " Samuel Ortiz
@ 2011-05-09  0:32 ` Samuel Ortiz
  2011-05-09  0:32 ` [PATCH 16/19] mfd: Use mfd cell platform_data for tps6105x " Samuel Ortiz
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Samuel Ortiz @ 2011-05-09  0:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Samuel Ortiz, Peter Ujfalusi, Mark Brown, Liam Girdwood, Dmitry Torokhov

With the addition of a platform device mfd_cell pointer, MFD drivers
can go back to passing platform data back to their sub drivers.
This allows for an mfd_cell->mfd_data removal and thus keep the
sub drivers MFD agnostic. This is mostly needed for non MFD aware
sub drivers.

Cc: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/input/misc/twl4030-vibra.c |    3 +--
 drivers/mfd/twl4030-codec.c        |    6 ++++--
 sound/soc/codecs/twl4030.c         |    6 ++----
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/input/misc/twl4030-vibra.c b/drivers/input/misc/twl4030-vibra.c
index 6a11694..014dd4a 100644
--- a/drivers/input/misc/twl4030-vibra.c
+++ b/drivers/input/misc/twl4030-vibra.c
@@ -29,7 +29,6 @@
 #include <linux/workqueue.h>
 #include <linux/i2c/twl.h>
 #include <linux/mfd/twl4030-codec.h>
-#include <linux/mfd/core.h>
 #include <linux/input.h>
 #include <linux/slab.h>
 
@@ -197,7 +196,7 @@ static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops,
 
 static int __devinit twl4030_vibra_probe(struct platform_device *pdev)
 {
-	struct twl4030_codec_vibra_data *pdata = mfd_get_data(pdev);
+	struct twl4030_codec_vibra_data *pdata = pdev->dev.platform_data;
 	struct vibra_info *info;
 	int ret;
 
diff --git a/drivers/mfd/twl4030-codec.c b/drivers/mfd/twl4030-codec.c
index c02fded..315b5ea 100644
--- a/drivers/mfd/twl4030-codec.c
+++ b/drivers/mfd/twl4030-codec.c
@@ -208,13 +208,15 @@ static int __devinit twl4030_codec_probe(struct platform_device *pdev)
 	if (pdata->audio) {
 		cell = &codec->cells[childs];
 		cell->name = "twl4030-codec";
-		cell->mfd_data = pdata->audio;
+		cell->platform_data = pdata->audio;
+		cell->pdata_size = sizeof(*pdata->audio);
 		childs++;
 	}
 	if (pdata->vibra) {
 		cell = &codec->cells[childs];
 		cell->name = "twl4030-vibra";
-		cell->mfd_data = pdata->vibra;
+		cell->platform_data = pdata->vibra;
+		cell->pdata_size = sizeof(*pdata->vibra);
 		childs++;
 	}
 
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index 575238d..bec788b 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -26,7 +26,6 @@
 #include <linux/pm.h>
 #include <linux/i2c.h>
 #include <linux/platform_device.h>
-#include <linux/mfd/core.h>
 #include <linux/i2c/twl.h>
 #include <linux/slab.h>
 #include <sound/core.h>
@@ -733,8 +732,7 @@ static int aif_event(struct snd_soc_dapm_widget *w,
 
 static void headset_ramp(struct snd_soc_codec *codec, int ramp)
 {
-	struct twl4030_codec_audio_data *pdata =
-			mfd_get_data(to_platform_device(codec->dev));
+	struct twl4030_codec_audio_data *pdata = codec->dev->platform_data;
 	unsigned char hs_gain, hs_pop;
 	struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
 	/* Base values for ramp delay calculation: 2^19 - 2^26 */
@@ -2299,7 +2297,7 @@ static struct snd_soc_codec_driver soc_codec_dev_twl4030 = {
 
 static int __devinit twl4030_codec_probe(struct platform_device *pdev)
 {
-	struct twl4030_codec_audio_data *pdata = mfd_get_data(pdev);
+	struct twl4030_codec_audio_data *pdata = pdev->dev.platform_data;
 
 	if (!pdata) {
 		dev_err(&pdev->dev, "platform_data is missing\n");
-- 
1.7.2.3


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

* [PATCH 16/19] mfd: Use mfd cell platform_data for tps6105x cells platform bits
       [not found] <1304901131-7104-1-git-send-email-sameo@linux.intel.com>
                   ` (13 preceding siblings ...)
  2011-05-09  0:32 ` [PATCH 15/19] mfd: Use mfd cell platform_data for twl4030 codec " Samuel Ortiz
@ 2011-05-09  0:32 ` Samuel Ortiz
  2011-05-09  7:05   ` Linus Walleij
  2011-05-09  0:32 ` [PATCH 17/19] mfd: Use mfd cell platform_data for 88pm860x " Samuel Ortiz
                   ` (5 subsequent siblings)
  20 siblings, 1 reply; 37+ messages in thread
From: Samuel Ortiz @ 2011-05-09  0:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Samuel Ortiz, Mark Brown, Liam Girdwood, Linus Walleij

With the addition of a platform device mfd_cell pointer, MFD drivers
can go back to passing platform data back to their sub drivers.
This allows for an mfd_cell->mfd_data removal and thus keep the
sub drivers MFD agnostic. This is mostly needed for non MFD aware
sub drivers.

Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/mfd/tps6105x.c                 |    3 ++-
 drivers/regulator/tps6105x-regulator.c |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/tps6105x.c b/drivers/mfd/tps6105x.c
index 46d8205..a293b97 100644
--- a/drivers/mfd/tps6105x.c
+++ b/drivers/mfd/tps6105x.c
@@ -183,7 +183,8 @@ static int __devinit tps6105x_probe(struct i2c_client *client,
 	/* Set up and register the platform devices. */
 	for (i = 0; i < ARRAY_SIZE(tps6105x_cells); i++) {
 		/* One state holder for all drivers, this is simple */
-		tps6105x_cells[i].mfd_data = tps6105x;
+		tps6105x_cells[i].platform_data = tps6105x;
+		tps6105x_cells[i].pdata_size = sizeof(*tps6105x);
 	}
 
 	ret = mfd_add_devices(&client->dev, 0, tps6105x_cells,
diff --git a/drivers/regulator/tps6105x-regulator.c b/drivers/regulator/tps6105x-regulator.c
index 1661499..4453a2a 100644
--- a/drivers/regulator/tps6105x-regulator.c
+++ b/drivers/regulator/tps6105x-regulator.c
@@ -137,7 +137,7 @@ static struct regulator_desc tps6105x_regulator_desc = {
  */
 static int __devinit tps6105x_regulator_probe(struct platform_device *pdev)
 {
-	struct tps6105x *tps6105x = mfd_get_data(pdev);
+	struct tps6105x *tps6105x = pdev->dev.platform_data;
 	struct tps6105x_platform_data *pdata = tps6105x->pdata;
 	int ret;
 
@@ -164,7 +164,7 @@ static int __devinit tps6105x_regulator_probe(struct platform_device *pdev)
 
 static int __devexit tps6105x_regulator_remove(struct platform_device *pdev)
 {
-	struct tps6105x *tps6105x = platform_get_drvdata(pdev);
+	struct tps6105x *tps6105x = pdev->dev.platform_data;
 	regulator_unregister(tps6105x->regulator);
 	return 0;
 }
-- 
1.7.2.3


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

* [PATCH 17/19] mfd: Use mfd cell platform_data for 88pm860x cells platform bits
       [not found] <1304901131-7104-1-git-send-email-sameo@linux.intel.com>
                   ` (14 preceding siblings ...)
  2011-05-09  0:32 ` [PATCH 16/19] mfd: Use mfd cell platform_data for tps6105x " Samuel Ortiz
@ 2011-05-09  0:32 ` Samuel Ortiz
  2011-05-09  8:21   ` Haojian Zhuang
  2011-05-09  0:32 ` [PATCH 18/19] mfd: Use mfd cell platform_data for davinci " Samuel Ortiz
                   ` (4 subsequent siblings)
  20 siblings, 1 reply; 37+ messages in thread
From: Samuel Ortiz @ 2011-05-09  0:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Samuel Ortiz, Haojian Zhuang, Mark Brown, Liam Girdwood, Richard Purdie

With the addition of a platform device mfd_cell pointer, MFD drivers
can go back to passing platform back to their sub drivers.
This allows for an mfd_cell->mfd_data removal and thus keep the
sub drivers MFD agnostic. This is mostly needed for non MFD aware
sub drivers.

Cc: Haojian Zhuang <haojian.zhuang@marvell.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/leds/leds-88pm860x.c          |    7 +------
 drivers/mfd/88pm860x-core.c           |   18 ++++++++++++------
 drivers/regulator/88pm8607.c          |    7 +------
 drivers/video/backlight/88pm860x_bl.c |    7 +------
 4 files changed, 15 insertions(+), 24 deletions(-)

diff --git a/drivers/leds/leds-88pm860x.c b/drivers/leds/leds-88pm860x.c
index 416def8..0d4c166 100644
--- a/drivers/leds/leds-88pm860x.c
+++ b/drivers/leds/leds-88pm860x.c
@@ -17,7 +17,6 @@
 #include <linux/leds.h>
 #include <linux/slab.h>
 #include <linux/workqueue.h>
-#include <linux/mfd/core.h>
 #include <linux/mfd/88pm860x.h>
 
 #define LED_PWM_SHIFT		(3)
@@ -171,7 +170,6 @@ static int pm860x_led_probe(struct platform_device *pdev)
 	struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent);
 	struct pm860x_led_pdata *pdata;
 	struct pm860x_led *data;
-	struct mfd_cell *cell;
 	struct resource *res;
 	int ret;
 
@@ -181,10 +179,7 @@ static int pm860x_led_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	cell = pdev->dev.platform_data;
-	if (cell == NULL)
-		return -ENODEV;
-	pdata = cell->mfd_data;
+	pdata = pdev->dev.platform_data;
 	if (pdata == NULL) {
 		dev_err(&pdev->dev, "No platform data!\n");
 		return -EINVAL;
diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
index 011cb6c..801aff7 100644
--- a/drivers/mfd/88pm860x-core.c
+++ b/drivers/mfd/88pm860x-core.c
@@ -516,7 +516,8 @@ static void __devinit device_bk_init(struct pm860x_chip *chip,
 	for (i = 0; i < pdata->num_backlights; i++) {
 		memcpy(&bk_pdata[i], &pdata->backlight[i],
 			sizeof(struct pm860x_backlight_pdata));
-		bk_devs[i].mfd_data = &bk_pdata[i];
+		bk_devs[i].platform_data = &bk_pdata[i];
+		bk_devs[i].pdata_size = sizeof(bk_pdata[i]);
 
 		for (j = 0; j < ARRAY_SIZE(bk_devs); j++) {
 			id = bk_resources[j].start;
@@ -553,7 +554,8 @@ static void __devinit device_led_init(struct pm860x_chip *chip,
 	for (i = 0; i < pdata->num_leds; i++) {
 		memcpy(&led_pdata[i], &pdata->led[i],
 			sizeof(struct pm860x_led_pdata));
-		led_devs[i].mfd_data = &led_pdata[i];
+		led_devs[i].platform_data = &led_pdata[i];
+		led_devs[i].pdata_size = sizeof(led_pdata[i]);
 
 		for (j = 0; j < ARRAY_SIZE(led_devs); j++) {
 			id = led_resources[j].start;
@@ -617,7 +619,8 @@ static void __devinit device_regulator_init(struct pm860x_chip *chip,
 		}
 		memcpy(&regulator_pdata[i], &pdata->regulator[i],
 			sizeof(struct regulator_init_data));
-		regulator_devs[i].mfd_data = &regulator_pdata[i];
+		regulator_devs[i].platform_data = &regulator_pdata[i];
+		regulator_devs[i].pdata_size = sizeof(regulator_pdata[i]);
 		regulator_devs[i].num_resources = 1;
 		regulator_devs[i].resources = &regulator_resources[j];
 
@@ -642,7 +645,8 @@ static void __devinit device_touch_init(struct pm860x_chip *chip,
 		return;
 
 	memcpy(&touch_pdata, pdata->touch, sizeof(struct pm860x_touch_pdata));
-	touch_devs[0].mfd_data = &touch_pdata;
+	touch_devs[0].platform_data = &touch_pdata;
+	touch_devs[0].pdata_size = sizeof(touch_pdata);
 	touch_devs[0].num_resources = ARRAY_SIZE(touch_resources);
 	touch_devs[0].resources = &touch_resources[0];
 	ret = mfd_add_devices(chip->dev, 0, &touch_devs[0],
@@ -662,7 +666,8 @@ static void __devinit device_power_init(struct pm860x_chip *chip,
 		return;
 
 	memcpy(&power_pdata, pdata->power, sizeof(struct pm860x_power_pdata));
-	power_devs[0].mfd_data = &power_pdata;
+	power_devs[0].platform_data = &power_pdata;
+	power_devs[0].pdata_size = sizeof(power_pdata);
 	power_devs[0].num_resources = ARRAY_SIZE(battery_resources);
 	power_devs[0].resources = &battery_resources[0],
 	ret = mfd_add_devices(chip->dev, 0, &power_devs[0], 1,
@@ -670,7 +675,8 @@ static void __devinit device_power_init(struct pm860x_chip *chip,
 	if (ret < 0)
 		dev_err(chip->dev, "Failed to add battery subdev\n");
 
-	power_devs[1].mfd_data = &power_pdata;
+	power_devs[1].platform_data = &power_pdata;
+	power_devs[0].pdata_size = sizeof(power_pdata);
 	power_devs[1].num_resources = ARRAY_SIZE(charger_resources);
 	power_devs[1].resources = &charger_resources[0],
 	ret = mfd_add_devices(chip->dev, 0, &power_devs[1], 1,
diff --git a/drivers/regulator/88pm8607.c b/drivers/regulator/88pm8607.c
index 8592512..784ea77 100644
--- a/drivers/regulator/88pm8607.c
+++ b/drivers/regulator/88pm8607.c
@@ -15,7 +15,6 @@
 #include <linux/platform_device.h>
 #include <linux/regulator/driver.h>
 #include <linux/regulator/machine.h>
-#include <linux/mfd/core.h>
 #include <linux/mfd/88pm860x.h>
 
 struct pm8607_regulator_info {
@@ -400,13 +399,9 @@ static int __devinit pm8607_regulator_probe(struct platform_device *pdev)
 	struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent);
 	struct pm8607_regulator_info *info = NULL;
 	struct regulator_init_data *pdata;
-	struct mfd_cell *cell;
 	int i;
 
-	cell = pdev->dev.platform_data;
-	if (cell == NULL)
-		return -ENODEV;
-	pdata = cell->mfd_data;
+	pdata = pdev->dev.platform_data;
 	if (pdata == NULL)
 		return -EINVAL;
 
diff --git a/drivers/video/backlight/88pm860x_bl.c b/drivers/video/backlight/88pm860x_bl.c
index c8b520e..c04b94d 100644
--- a/drivers/video/backlight/88pm860x_bl.c
+++ b/drivers/video/backlight/88pm860x_bl.c
@@ -16,7 +16,6 @@
 #include <linux/fb.h>
 #include <linux/i2c.h>
 #include <linux/backlight.h>
-#include <linux/mfd/core.h>
 #include <linux/mfd/88pm860x.h>
 
 #define MAX_BRIGHTNESS		(0xFF)
@@ -168,7 +167,6 @@ static int pm860x_backlight_probe(struct platform_device *pdev)
 	struct pm860x_backlight_pdata *pdata = NULL;
 	struct pm860x_backlight_data *data;
 	struct backlight_device *bl;
-	struct mfd_cell *cell;
 	struct resource *res;
 	struct backlight_properties props;
 	unsigned char value;
@@ -181,10 +179,7 @@ static int pm860x_backlight_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	cell = pdev->dev.platform_data;
-	if (cell == NULL)
-		return -ENODEV;
-	pdata = cell->mfd_data;
+	pdata = pdev->dev.platform_data;
 	if (pdata == NULL) {
 		dev_err(&pdev->dev, "platform data isn't assigned to "
 			"backlight\n");
-- 
1.7.2.3


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

* [PATCH 18/19] mfd: Use mfd cell platform_data for davinci cells platform bits
       [not found] <1304901131-7104-1-git-send-email-sameo@linux.intel.com>
                   ` (15 preceding siblings ...)
  2011-05-09  0:32 ` [PATCH 17/19] mfd: Use mfd cell platform_data for 88pm860x " Samuel Ortiz
@ 2011-05-09  0:32 ` Samuel Ortiz
       [not found] ` <1304901131-7104-20-git-send-email-sameo@linux.intel.com>
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Samuel Ortiz @ 2011-05-09  0:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Samuel Ortiz, Miguel Aguilar, Mark Brown, Liam Girdwood

With the addition of a platform device mfd_cell pointer, MFD drivers
can go back to passing platform back to their sub drivers.
This allows for an mfd_cell->mfd_data removal and thus keep the
sub drivers MFD agnostic. This is mostly needed for non MFD aware
sub drivers.

Cc: Miguel Aguilar <miguel.aguilar@ridgerun.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/mfd/davinci_voicecodec.c |    6 ++++--
 sound/soc/codecs/cq93vc.c        |    3 +--
 sound/soc/davinci/davinci-vcif.c |    2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/mfd/davinci_voicecodec.c b/drivers/mfd/davinci_voicecodec.c
index 414783b..4e2af2c 100644
--- a/drivers/mfd/davinci_voicecodec.c
+++ b/drivers/mfd/davinci_voicecodec.c
@@ -119,12 +119,14 @@ static int __init davinci_vc_probe(struct platform_device *pdev)
 	/* Voice codec interface client */
 	cell = &davinci_vc->cells[DAVINCI_VC_VCIF_CELL];
 	cell->name = "davinci-vcif";
-	cell->mfd_data = davinci_vc;
+	cell->platform_data = davinci_vc;
+	cell->pdata_size = sizeof(*davinci_vc);
 
 	/* Voice codec CQ93VC client */
 	cell = &davinci_vc->cells[DAVINCI_VC_CQ93VC_CELL];
 	cell->name = "cq93vc-codec";
-	cell->mfd_data = davinci_vc;
+	cell->platform_data = davinci_vc;
+	cell->pdata_size = sizeof(*davinci_vc);
 
 	ret = mfd_add_devices(&pdev->dev, pdev->id, davinci_vc->cells,
 			      DAVINCI_VC_CELLS, NULL, 0);
diff --git a/sound/soc/codecs/cq93vc.c b/sound/soc/codecs/cq93vc.c
index b8066ef..46dbfd0 100644
--- a/sound/soc/codecs/cq93vc.c
+++ b/sound/soc/codecs/cq93vc.c
@@ -153,8 +153,7 @@ static int cq93vc_resume(struct snd_soc_codec *codec)
 
 static int cq93vc_probe(struct snd_soc_codec *codec)
 {
-	struct davinci_vc *davinci_vc =
-			mfd_get_data(to_platform_device(codec->dev));
+	struct davinci_vc *davinci_vc = codec->dev->platform_data;
 
 	davinci_vc->cq93vc.codec = codec;
 	codec->control_data = davinci_vc;
diff --git a/sound/soc/davinci/davinci-vcif.c b/sound/soc/davinci/davinci-vcif.c
index 13e05a3..9259f1f 100644
--- a/sound/soc/davinci/davinci-vcif.c
+++ b/sound/soc/davinci/davinci-vcif.c
@@ -205,7 +205,7 @@ static struct snd_soc_dai_driver davinci_vcif_dai = {
 
 static int davinci_vcif_probe(struct platform_device *pdev)
 {
-	struct davinci_vc *davinci_vc = mfd_get_data(pdev);
+	struct davinci_vc *davinci_vc = pdev->dev.platform_data;
 	struct davinci_vcif_dev *davinci_vcif_dev;
 	int ret;
 
-- 
1.7.2.3


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

* Re: [PATCH 02/19] mfd: Use mfd cell platform_data for ab3550 cells platform bits
  2011-05-09  0:31 ` [PATCH 02/19] mfd: Use mfd cell platform_data for ab3550 cells platform bits Samuel Ortiz
@ 2011-05-09  7:01   ` Linus Walleij
  0 siblings, 0 replies; 37+ messages in thread
From: Linus Walleij @ 2011-05-09  7:01 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-kernel

2011/5/9 Samuel Ortiz <sameo@linux.intel.com>:

> With the addition of a platform device mfd_cell pointer, MFD drivers
> can go back to passing platform data back to their sub drivers.
> This allows for an mfd_cell->mfd_data removal and thus keep the sub drivers
> MFD agnostic. This is mostly needed for non MFD aware sub drivers.
>
> Cc: Linus Walleij <linus.walleij@stericsson.com>
> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

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

I was always just puzzled by that stuff anyway...

Thanks,
Linus Walleij

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

* Re: [PATCH 03/19] mfd: Use mfd cell platform_data for ab3100 cells platform bits
  2011-05-09  0:31 ` [PATCH 03/19] mfd: Use mfd cell platform_data for ab3100 " Samuel Ortiz
@ 2011-05-09  7:02   ` Linus Walleij
  0 siblings, 0 replies; 37+ messages in thread
From: Linus Walleij @ 2011-05-09  7:02 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-kernel

2011/5/9 Samuel Ortiz <sameo@linux.intel.com>:

> With the addition of a platform device mfd_cell pointer, MFD drivers
> can go back to passing platform data back to their sub drivers.
> This allows for an mfd_cell->mfd_data removal and thus keep the sub drivers
> MFD agnostic. This is mostly needed for non MFD aware sub drivers.
>
> Cc: Linus Walleij <linus.walleij@stericsson.com>
> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

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

Thanks,
Linus Walleij

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

* Re: [PATCH 16/19] mfd: Use mfd cell platform_data for tps6105x cells platform bits
  2011-05-09  0:32 ` [PATCH 16/19] mfd: Use mfd cell platform_data for tps6105x " Samuel Ortiz
@ 2011-05-09  7:05   ` Linus Walleij
  2011-05-11  8:23     ` Samuel Ortiz
  2011-05-11  9:05     ` [PATCH v1 " Samuel Ortiz
  0 siblings, 2 replies; 37+ messages in thread
From: Linus Walleij @ 2011-05-09  7:05 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-kernel, Mark Brown, Liam Girdwood

2011/5/9 Samuel Ortiz <sameo@linux.intel.com>:

> With the addition of a platform device mfd_cell pointer, MFD drivers
> can go back to passing platform data back to their sub drivers.
> This allows for an mfd_cell->mfd_data removal and thus keep the
> sub drivers MFD agnostic. This is mostly needed for non MFD aware
> sub drivers.
>
> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
> Cc: Liam Girdwood <lrg@slimlogic.co.uk>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

I have some question marks on this one...

> --- a/drivers/mfd/tps6105x.c
> +++ b/drivers/mfd/tps6105x.c
> @@ -183,7 +183,8 @@ static int __devinit tps6105x_probe(struct i2c_client *client,
>        /* Set up and register the platform devices. */
>        for (i = 0; i < ARRAY_SIZE(tps6105x_cells); i++) {
>                /* One state holder for all drivers, this is simple */
> -               tps6105x_cells[i].mfd_data = tps6105x;
> +               tps6105x_cells[i].platform_data = tps6105x;
> +               tps6105x_cells[i].pdata_size = sizeof(*tps6105x);

ACK

> --- a/drivers/regulator/tps6105x-regulator.c
> +++ b/drivers/regulator/tps6105x-regulator.c
> @@ -137,7 +137,7 @@ static struct regulator_desc tps6105x_regulator_desc = {
>  */
>  static int __devinit tps6105x_regulator_probe(struct platform_device *pdev)
>  {
> -       struct tps6105x *tps6105x = mfd_get_data(pdev);
> +       struct tps6105x *tps6105x = pdev->dev.platform_data;

Can you use platform_get_drvdata(pdev); instead?

>        struct tps6105x_platform_data *pdata = tps6105x->pdata;
>        int ret;
>
> @@ -164,7 +164,7 @@ static int __devinit tps6105x_regulator_probe(struct platform_device *pdev)
>
>  static int __devexit tps6105x_regulator_remove(struct platform_device *pdev)
>  {
> -       struct tps6105x *tps6105x = platform_get_drvdata(pdev);
> +       struct tps6105x *tps6105x = pdev->dev.platform_data;

And this is a NO-OP, actually a bug in the present code, just leave it
as it is and the other changes removing the mfd->mfd_data fixes the bug...

Yours,
Linus Walleij

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

* Re: [PATCH 12/19] mfd: Use mfd cell platform_data for wm8400 cells platform bits
  2011-05-09  0:32 ` [PATCH 12/19] mfd: Use mfd cell platform_data for wm8400 " Samuel Ortiz
@ 2011-05-09  7:13   ` Mark Brown
  2011-05-10  8:45     ` Samuel Ortiz
  0 siblings, 1 reply; 37+ messages in thread
From: Mark Brown @ 2011-05-09  7:13 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-kernel

On Mon, May 09, 2011 at 02:32:04AM +0200, Samuel Ortiz wrote:

>  static int wm8400_codec_probe(struct snd_soc_codec *codec)
>  {
> -	struct wm8400 *wm8400 = mfd_get_data(to_platform_device(codec->dev));
> +	struct wm8400 *wm8400 = codec->dev->platform_data;

It'd be better to use platform_get_drvdata() here rather than accessing
the pointer directly.

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

* RE: [PATCH 17/19] mfd: Use mfd cell platform_data for 88pm860x cells platform bits
  2011-05-09  0:32 ` [PATCH 17/19] mfd: Use mfd cell platform_data for 88pm860x " Samuel Ortiz
@ 2011-05-09  8:21   ` Haojian Zhuang
  0 siblings, 0 replies; 37+ messages in thread
From: Haojian Zhuang @ 2011-05-09  8:21 UTC (permalink / raw)
  To: Samuel Ortiz, linux-kernel; +Cc: Mark Brown, Liam Girdwood, Richard Purdie

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb2312", Size: 1280 bytes --]



>-----Original Message-----
>From: Samuel Ortiz [mailto:sameo@linux.intel.com]
>Sent: 2011Äê5ÔÂ9ÈÕ 8:32 AM
>To: linux-kernel
>Cc: Samuel Ortiz; Haojian Zhuang; Mark Brown; Liam Girdwood; Richard
>Purdie
>Subject: [PATCH 17/19] mfd: Use mfd cell platform_data for 88pm860x
>cells platform bits
>
>With the addition of a platform device mfd_cell pointer, MFD drivers
>can go back to passing platform back to their sub drivers.
>This allows for an mfd_cell->mfd_data removal and thus keep the
>sub drivers MFD agnostic. This is mostly needed for non MFD aware
>sub drivers.
>
>Cc: Haojian Zhuang <haojian.zhuang@marvell.com>
>Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
>Cc: Liam Girdwood <lrg@slimlogic.co.uk>
>Cc: Richard Purdie <rpurdie@rpsys.net>
>Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
>---
> drivers/leds/leds-88pm860x.c          |    7 +------
> drivers/mfd/88pm860x-core.c           |   18 ++++++++++++------
> drivers/regulator/88pm8607.c          |    7 +------
> drivers/video/backlight/88pm860x_bl.c |    7 +------
> 4 files changed, 15 insertions(+), 24 deletions(-)
>
Tested. It's OK.
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* RE: [PATCH 01/19] mfd: Add platform data pointer back
       [not found] ` <1304901131-7104-2-git-send-email-sameo@linux.intel.com>
@ 2011-05-09  8:22   ` Haojian Zhuang
  2011-05-09 11:21   ` Samuel Ortiz
  1 sibling, 0 replies; 37+ messages in thread
From: Haojian Zhuang @ 2011-05-09  8:22 UTC (permalink / raw)
  To: Samuel Ortiz, linux-kernel
  Cc: Andres Salomon, Artem Bityutskiy, Dmitry Baryshkov,
	Dmitry Torokhov, Florian Fainelli, Grant Likely,
	Guennadi Liakhovetski, Ian Molton, Ira W. Snyder, Liam Girdwood,
	Linus Walleij, Mark Brown, Matti Aaltonen, Matt Reimer,
	Miguel Aguilar, Paul Mundt, Peter Ujfalusi, Philipp Zabel,
	Richard Purdie, Richard Röjfors, Uwe Kleine-König,
	Wim Van Sebroeck, Wolfgang Grandegger

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2207 bytes --]



>-----Original Message-----
>From: Samuel Ortiz [mailto:sameo@linux.intel.com]
>Sent: 2011年5月9日 8:32 AM
>To: linux-kernel
>Cc: Samuel Ortiz; Andres Salomon; Artem Bityutskiy; Dmitry Baryshkov;
>Dmitry Torokhov; Florian Fainelli; Grant Likely; Guennadi Liakhovetski;
>Haojian Zhuang; Ian Molton; Ira W. Snyder; Liam Girdwood; Linus Walleij;
>Mark Brown; Matti Aaltonen; Matt Reimer; Miguel Aguilar; Paul Mundt;
>Peter Ujfalusi; Philipp Zabel; Richard Purdie; Richard Röjfors; Uwe
>Kleine-König; Wim Van Sebroeck; Wolfgang Grandegger
>Subject: [PATCH 01/19] mfd: Add platform data pointer back
>
>Now that we have a way to pass MFD cells down to the sub drivers,
>we can gradually get rid of mfd_data by putting the platform pointer
>back in place.
>
>Cc: Andres Salomon <dilinger@queued.net>
>Cc: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
>Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>
>Cc: Dmitry Torokhov <dtor@mail.ru>
>Cc: Florian Fainelli <florian@openwrt.org>
>Cc: Grant Likely <grant.likely@secretlab.ca>
>Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>Cc: Haojian Zhuang <haojian.zhuang@marvell.com>
>Cc: Ian Molton <spyro@f2s.com>
>Cc: Ira W. Snyder <iws@ovro.caltech.edu>
>Cc: Liam Girdwood <lrg@slimlogic.co.uk>
>Cc: Linus Walleij <linus.walleij@linaro.org>
>Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
>Cc: Matti Aaltonen <matti.j.aaltonen@nokia.com>
>Cc: Matt Reimer <mreimer@vpop.net>
>Cc: Miguel Aguilar <miguel.aguilar@ridgerun.com>
>Cc: Paul Mundt <lethal@linux-sh.org>
>Cc: Peter Ujfalusi <peter.ujfalusi@nokia.com>
>Cc: Philipp Zabel <philipp.zabel@gmail.com>
>Cc: Richard Purdie <rpurdie@rpsys.net>
>Cc: Richard Röjfors <richard.rojfors@pelagicore.com>
>Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>Cc: Wim Van Sebroeck <wim@iguana.be>
>Cc: Wolfgang Grandegger <wg@grandegger.com>
>Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
>---
> drivers/mfd/mfd-core.c   |    7 +++++++
> include/linux/mfd/core.h |    4 ++++
> 2 files changed, 11 insertions(+), 0 deletions(-)
>
Tested. It's OK.
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* RE: [PATCH 19/19] mfd: Remove mfd_data
       [not found] ` <1304901131-7104-20-git-send-email-sameo@linux.intel.com>
@ 2011-05-09  8:22   ` Haojian Zhuang
  0 siblings, 0 replies; 37+ messages in thread
From: Haojian Zhuang @ 2011-05-09  8:22 UTC (permalink / raw)
  To: Samuel Ortiz, linux-kernel
  Cc: Andres Salomon, Artem Bityutskiy, Dmitry Baryshkov,
	Dmitry Torokhov, Florian Fainelli, Grant Likely,
	Guennadi Liakhovetski, Ian Molton, Ira W. Snyder, Liam Girdwood,
	Linus Walleij, Mark Brown, Matti Aaltonen, Matt Reimer,
	Miguel Aguilar, Paul Mundt, Peter Ujfalusi, Philipp Zabel,
	Richard Purdie, Richard Röjfors, Uwe Kleine-König,
	Wim Van Sebroeck, Wolfgang Grandegger

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2138 bytes --]



>-----Original Message-----
>From: Samuel Ortiz [mailto:sameo@linux.intel.com]
>Sent: 2011年5月9日 8:32 AM
>To: linux-kernel
>Cc: Samuel Ortiz; Andres Salomon; Artem Bityutskiy; Dmitry Baryshkov;
>Dmitry Torokhov; Florian Fainelli; Grant Likely; Guennadi Liakhovetski;
>Haojian Zhuang; Ian Molton; Ira W. Snyder; Liam Girdwood; Linus Walleij;
>Mark Brown; Matti Aaltonen; Matt Reimer; Miguel Aguilar; Paul Mundt;
>Peter Ujfalusi; Philipp Zabel; Richard Purdie; Richard Röjfors; Uwe
>Kleine-König; Wim Van Sebroeck; Wolfgang Grandegger
>Subject: [PATCH 19/19] mfd: Remove mfd_data
>
>Cell pointers are passed through device->mfd_cell and platform data
>is passed through the MFD cell platform_data pointer.
>
>Cc: Andres Salomon <dilinger@queued.net>
>Cc: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
>Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>
>Cc: Dmitry Torokhov <dtor@mail.ru>
>Cc: Florian Fainelli <florian@openwrt.org>
>Cc: Grant Likely <grant.likely@secretlab.ca>
>Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>Cc: Haojian Zhuang <haojian.zhuang@marvell.com>
>Cc: Ian Molton <spyro@f2s.com>
>Cc: Ira W. Snyder <iws@ovro.caltech.edu>
>Cc: Liam Girdwood <lrg@slimlogic.co.uk>
>Cc: Linus Walleij <linus.walleij@linaro.org>
>Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
>Cc: Matti Aaltonen <matti.j.aaltonen@nokia.com>
>Cc: Matt Reimer <mreimer@vpop.net>
>Cc: Miguel Aguilar <miguel.aguilar@ridgerun.com>
>Cc: Paul Mundt <lethal@linux-sh.org>
>Cc: Peter Ujfalusi <peter.ujfalusi@nokia.com>
>Cc: Philipp Zabel <philipp.zabel@gmail.com>
>Cc: Richard Purdie <rpurdie@rpsys.net>
>Cc: Richard Röjfors <richard.rojfors@pelagicore.com>
>Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>Cc: Wim Van Sebroeck <wim@iguana.be>
>Cc: Wolfgang Grandegger <wg@grandegger.com>
>Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
>---
> include/linux/mfd/core.h |   21 ---------------------
> 1 files changed, 0 insertions(+), 21 deletions(-)
>
Tested. It's OK.
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: [PATCH 06/19] mfd: Pass htc-pasic3 led platform data through the cell platform_data
  2011-05-09  0:31 ` [PATCH 06/19] mfd: Pass htc-pasic3 led platform data through the cell platform_data Samuel Ortiz
@ 2011-05-09 10:20   ` Paul Parsons
  2011-05-09 11:25     ` Samuel Ortiz
  0 siblings, 1 reply; 37+ messages in thread
From: Paul Parsons @ 2011-05-09 10:20 UTC (permalink / raw)
  To: linux-kernel, Samuel Ortiz; +Cc: Samuel Ortiz, Philipp Zabel

Hi Samuel,

I presume an earlier post called "mfd: Remove mfd_data" provided the patch for struct mfd_cell. If so would you please forward it to the list since I have no visibility of the change. Perhaps linux-kernel bounced the original post?

Regards,
Paul

--- On Mon, 9/5/11, Samuel Ortiz <sameo@linux.intel.com> wrote:

> diff --git a/drivers/mfd/htc-pasic3.c
> b/drivers/mfd/htc-pasic3.c
> index 95a4ff4..2808bd1 100644
> --- a/drivers/mfd/htc-pasic3.c
> +++ b/drivers/mfd/htc-pasic3.c
> @@ -173,6 +173,8 @@ static int __init pasic3_probe(struct
> platform_device *pdev)
>      }
>  
>      if (pdata &&
> pdata->led_pdata) {
> +       
> led_cell.platform_data = pdata->led_pdata;
> +        led_cell.pdata_size
> = sizeof(struct pasic3_leds_machinfo);
>          ret =
> mfd_add_devices(&pdev->dev, pdev->id,
> &led_cell, 1, r, 0);
>          if (ret < 0)
>             
> dev_warn(dev, "failed to register LED device\n");

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

* [PATCH 00/19] mfd: mfd_data removal
       [not found] <1304901131-7104-1-git-send-email-sameo@linux.intel.com>
                   ` (17 preceding siblings ...)
       [not found] ` <1304901131-7104-20-git-send-email-sameo@linux.intel.com>
@ 2011-05-09 11:20 ` Samuel Ortiz
       [not found] ` <1304901131-7104-2-git-send-email-sameo@linux.intel.com>
  2011-05-10  7:52 ` [PATCH 00/19] mfd: mfd_data removal Richard Röjfors
  20 siblings, 0 replies; 37+ messages in thread
From: Samuel Ortiz @ 2011-05-09 11:20 UTC (permalink / raw)
  To: linux-kernel


This patchset is using the newly added platform_device mfd_cell pointer to get
rid of the mfd_data cell pointer.
Drivers willing to access their parent MFD cell will do so through the
mfd_get_cell accessor. Other drivers (and in particular the non MFD ones) will
get their platform data bits from the cell's platform_data pointer. This
allows for non MFD sub drivers to not depend on the MFD core APIs if they
don't need to.

Cc: Andres Salomon <dilinger@queued.net>
Cc: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Florian Fainelli <florian@openwrt.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Haojian Zhuang <haojian.zhuang@marvell.com>
Cc: Ian Molton <spyro@f2s.com>
Cc: Ira W. Snyder <iws@ovro.caltech.edu>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Matti Aaltonen <matti.j.aaltonen@nokia.com>
Cc: Matt Reimer <mreimer@vpop.net>
Cc: Miguel Aguilar <miguel.aguilar@ridgerun.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Cc: Philipp Zabel <philipp.zabel@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Richard Röjfors <richard.rojfors@pelagicore.com>
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Wim Van Sebroeck <wim@iguana.be>
Cc: Wolfgang Grandegger <wg@grandegger.com>

---
Samuel Ortiz (19):
  mfd: Add platform data pointer back
  mfd: Use mfd cell platform_data for ab3550 cells platform bits
  mfd: Use mfd cell platform_data for ab3100 cells platform bits
  mmc: Use device platform_data to retrieve tmio_mmc platform bits
  w1: Use device platform_data to retrieve ds1wm platform bits
  mfd: Pass htc-pasic3 led platform data through the cell platform_data
  mfd: Use mfd cell platform_data for wl1273 cells platform bits
  fb: Use platform_data to retrieve tmiofb platform bits
  mtd: Use platform_data to retrieve tmio_nand platform bits
  mfd: Use mfd cell platform_data for timberdale cells platform bits
  mfd: Use mfd cell platform_data for rdc321x cells platform bits
  mfd: Use mfd cell platform_data for wm8400 cells platform bits
  mfd: Use mfd cell platform_data for mc13xxx cells platform bits
  mfd: Use mfd cell platform_data for janz cells platform bits
  mfd: Use mfd cell platform_data for twl4030 codec cells platform bits
  mfd: Use mfd cell platform_data for tps6105x cells platform bits
  mfd: Use mfd cell platform_data for 88pm860x cells platform bits
  mfd: Use mfd cell platform_data for davinci cells platform bits
  mfd: Remove mfd_data

 drivers/dma/timb_dma.c                 |    3 +-
 drivers/gpio/janz-ttl.c                |    3 +-
 drivers/gpio/rdc321x-gpio.c            |    3 +-
 drivers/gpio/timbgpio.c                |    6 +-
 drivers/i2c/busses/i2c-ocores.c        |    3 +-
 drivers/i2c/busses/i2c-xiic.c          |    3 +-
 drivers/input/misc/twl4030-vibra.c     |    3 +-
 drivers/leds/leds-88pm860x.c           |    7 +--
 drivers/leds/leds-mc13783.c            |    7 +--
 drivers/media/radio/radio-timb.c       |    3 +-
 drivers/media/radio/radio-wl1273.c     |    2 +-
 drivers/media/video/timblogiw.c        |    3 +-
 drivers/mfd/88pm860x-core.c            |   18 +++++--
 drivers/mfd/ab3100-core.c              |    6 ++-
 drivers/mfd/ab3550-core.c              |    6 ++-
 drivers/mfd/asic3.c                    |    6 ++-
 drivers/mfd/davinci_voicecodec.c       |    6 ++-
 drivers/mfd/htc-pasic3.c               |    5 ++-
 drivers/mfd/janz-cmodio.c              |    3 +-
 drivers/mfd/mc13xxx-core.c             |   12 +++--
 drivers/mfd/mfd-core.c                 |    7 +++
 drivers/mfd/rdc321x-southbridge.c      |    6 ++-
 drivers/mfd/t7l66xb.c                  |    6 ++-
 drivers/mfd/tc6387xb.c                 |    3 +-
 drivers/mfd/tc6393xb.c                 |   10 +++-
 drivers/mfd/timberdale.c               |   81 +++++++++++++++++++++-----------
 drivers/mfd/tps6105x.c                 |    3 +-
 drivers/mfd/twl4030-codec.c            |    6 ++-
 drivers/mfd/wl1273-core.c              |    6 ++-
 drivers/mfd/wm8400-core.c              |    3 +-
 drivers/mmc/host/tmio_mmc.c            |    2 +-
 drivers/mtd/nand/tmio_nand.c           |    2 +-
 drivers/net/can/janz-ican3.c           |    3 +-
 drivers/net/ks8842.c                   |    3 +-
 drivers/regulator/88pm8607.c           |    7 +--
 drivers/regulator/ab3100.c             |    3 +-
 drivers/regulator/mc13783-regulator.c  |    7 ++-
 drivers/regulator/mc13892-regulator.c  |    7 ++-
 drivers/regulator/tps6105x-regulator.c |    4 +-
 drivers/spi/xilinx_spi.c               |    3 +-
 drivers/video/backlight/88pm860x_bl.c  |    7 +--
 drivers/video/tmiofb.c                 |   12 ++---
 drivers/w1/masters/ds1wm.c             |   12 ++++-
 drivers/watchdog/rdc321x_wdt.c         |    3 +-
 include/linux/mfd/abx500.h             |    1 +
 include/linux/mfd/core.h               |   23 +--------
 sound/soc/codecs/cq93vc.c              |    3 +-
 sound/soc/codecs/twl4030.c             |    6 +--
 sound/soc/codecs/wl1273.c              |    3 +-
 sound/soc/codecs/wm8400.c              |    2 +-
 sound/soc/davinci/davinci-vcif.c       |    2 +-
 51 files changed, 191 insertions(+), 163 deletions(-)

-- 
1.7.2.3

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

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

* [PATCH 01/19] mfd: Add platform data pointer back
       [not found] ` <1304901131-7104-2-git-send-email-sameo@linux.intel.com>
  2011-05-09  8:22   ` [PATCH 01/19] mfd: Add platform data pointer back Haojian Zhuang
@ 2011-05-09 11:21   ` Samuel Ortiz
  1 sibling, 0 replies; 37+ messages in thread
From: Samuel Ortiz @ 2011-05-09 11:21 UTC (permalink / raw)
  To: linux-kernel


Now that we have a way to pass MFD cells down to the sub drivers,
we can gradually get rid of mfd_data by putting the platform pointer
back in place.

Cc: Andres Salomon <dilinger@queued.net>
Cc: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Florian Fainelli <florian@openwrt.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Haojian Zhuang <haojian.zhuang@marvell.com>
Cc: Ian Molton <spyro@f2s.com>
Cc: Ira W. Snyder <iws@ovro.caltech.edu>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Matti Aaltonen <matti.j.aaltonen@nokia.com>
Cc: Matt Reimer <mreimer@vpop.net>
Cc: Miguel Aguilar <miguel.aguilar@ridgerun.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Cc: Philipp Zabel <philipp.zabel@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Richard Röjfors <richard.rojfors@pelagicore.com>
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Wim Van Sebroeck <wim@iguana.be>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/mfd/mfd-core.c   |    7 +++++++
 include/linux/mfd/core.h |    4 ++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index f4c8c84..0902523 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -88,6 +88,13 @@ static int mfd_add_device(struct device *parent, int id,
 
 	pdev->dev.parent = parent;
 
+	if (cell->pdata_size) {
+		ret = platform_device_add_data(pdev,
+					cell->platform_data, cell->pdata_size);
+		if (ret)
+			goto fail_res;
+	}
+
 	ret = mfd_platform_add_cell(pdev, cell);
 	if (ret)
 		goto fail_res;
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h
index aef23309..68c13e5 100644
--- a/include/linux/mfd/core.h
+++ b/include/linux/mfd/core.h
@@ -36,6 +36,10 @@ struct mfd_cell {
 	/* mfd_data can be used to pass data to client drivers */
 	void			*mfd_data;
 
+	/* platform data passed to the sub devices drivers */
+	void			*platform_data;
+	size_t			pdata_size;
+
 	/*
 	 * These resources can be specified relative to the parent device.
 	 * For accessing hardware you should use resources from the platform dev
-- 
1.7.2.3

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

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

* Re: [PATCH 06/19] mfd: Pass htc-pasic3 led platform data through the cell platform_data
  2011-05-09 10:20   ` Paul Parsons
@ 2011-05-09 11:25     ` Samuel Ortiz
  0 siblings, 0 replies; 37+ messages in thread
From: Samuel Ortiz @ 2011-05-09 11:25 UTC (permalink / raw)
  To: Paul Parsons; +Cc: linux-kernel, Philipp Zabel

Hi Paul,

On Mon, May 09, 2011 at 11:20:16AM +0100, Paul Parsons wrote:
> Hi Samuel,
> 
> I presume an earlier post called "mfd: Remove mfd_data" provided the patch for struct mfd_cell. If so would you please forward it to the list since I have no visibility of the change. Perhaps linux-kernel bounced the original post?
> 
I just realized that it did, yes. Maybe the Cc list was too long.
Anyway, I reposted it to lkml only:
http://lkml.org/lkml/2011/5/9/132

And http://lkml.org/lkml/2011/5/9/131 for the cover letter.

Cheers,
Samuel.


> Regards,
> Paul
> 
> --- On Mon, 9/5/11, Samuel Ortiz <sameo@linux.intel.com> wrote:
> 
> > diff --git a/drivers/mfd/htc-pasic3.c
> > b/drivers/mfd/htc-pasic3.c
> > index 95a4ff4..2808bd1 100644
> > --- a/drivers/mfd/htc-pasic3.c
> > +++ b/drivers/mfd/htc-pasic3.c
> > @@ -173,6 +173,8 @@ static int __init pasic3_probe(struct
> > platform_device *pdev)
> >      }
> >  
> >      if (pdata &&
> > pdata->led_pdata) {
> > +       
> > led_cell.platform_data = pdata->led_pdata;
> > +        led_cell.pdata_size
> > = sizeof(struct pasic3_leds_machinfo);
> >          ret =
> > mfd_add_devices(&pdev->dev, pdev->id,
> > &led_cell, 1, r, 0);
> >          if (ret < 0)
> >             
> > dev_warn(dev, "failed to register LED device\n");

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

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

* Re: [PATCH 00/19] mfd: mfd_data removal
       [not found] <1304901131-7104-1-git-send-email-sameo@linux.intel.com>
                   ` (19 preceding siblings ...)
       [not found] ` <1304901131-7104-2-git-send-email-sameo@linux.intel.com>
@ 2011-05-10  7:52 ` Richard Röjfors
  20 siblings, 0 replies; 37+ messages in thread
From: Richard Röjfors @ 2011-05-10  7:52 UTC (permalink / raw)
  To: Samuel Ortiz
  Cc: linux-kernel, Andres Salomon, Artem Bityutskiy, Dmitry Baryshkov,
	Dmitry Torokhov, Florian Fainelli, Grant Likely,
	Guennadi Liakhovetski, Haojian Zhuang, Ian Molton, Ira W. Snyder,
	Liam Girdwood, Linus Walleij, Mark Brown, Matti Aaltonen,
	Matt Reimer, Miguel Aguilar, Paul Mundt, Peter Ujfalusi,
	Philipp Zabel, Richard Purdie, Uwe Kleine-König,
	Wim Van Sebroeck, Wolfgang Grandegger

On Mon, 2011-05-09 at 02:31 +0200, Samuel Ortiz wrote:
> This patchset is using the newly added platform_device mfd_cell pointer to get
> rid of the mfd_data cell pointer.
> Drivers willing to access their parent MFD cell will do so through the
> mfd_get_cell accessor. Other drivers (and in particular the non MFD ones) will
> get their platform data bits from the cell's platform_data pointer. This
> allows for non MFD sub drivers to not depend on the MFD core APIs if they
> don't need to.
> 
> Cc: Andres Salomon <dilinger@queued.net>
> Cc: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
> Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>
> Cc: Dmitry Torokhov <dtor@mail.ru>
> Cc: Florian Fainelli <florian@openwrt.org>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> Cc: Haojian Zhuang <haojian.zhuang@marvell.com>
> Cc: Ian Molton <spyro@f2s.com>
> Cc: Ira W. Snyder <iws@ovro.caltech.edu>
> Cc: Liam Girdwood <lrg@slimlogic.co.uk>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
> Cc: Matti Aaltonen <matti.j.aaltonen@nokia.com>
> Cc: Matt Reimer <mreimer@vpop.net>
> Cc: Miguel Aguilar <miguel.aguilar@ridgerun.com>
> Cc: Paul Mundt <lethal@linux-sh.org>
> Cc: Peter Ujfalusi <peter.ujfalusi@nokia.com>
> Cc: Philipp Zabel <philipp.zabel@gmail.com>
> Cc: Richard Purdie <rpurdie@rpsys.net>
> Cc: Richard Röjfors <richard.rojfors@pelagicore.com>
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Cc: Wim Van Sebroeck <wim@iguana.be>
> Cc: Wolfgang Grandegger <wg@grandegger.com>
> 
> ---
> Samuel Ortiz (19):
>   mfd: Add platform data pointer back
>   mfd: Use mfd cell platform_data for ab3550 cells platform bits
>   mfd: Use mfd cell platform_data for ab3100 cells platform bits
>   mmc: Use device platform_data to retrieve tmio_mmc platform bits
>   w1: Use device platform_data to retrieve ds1wm platform bits
>   mfd: Pass htc-pasic3 led platform data through the cell platform_data
>   mfd: Use mfd cell platform_data for wl1273 cells platform bits
>   fb: Use platform_data to retrieve tmiofb platform bits
>   mtd: Use platform_data to retrieve tmio_nand platform bits
>   mfd: Use mfd cell platform_data for timberdale cells platform bits
>   mfd: Use mfd cell platform_data for rdc321x cells platform bits
>   mfd: Use mfd cell platform_data for wm8400 cells platform bits
>   mfd: Use mfd cell platform_data for mc13xxx cells platform bits
>   mfd: Use mfd cell platform_data for janz cells platform bits
>   mfd: Use mfd cell platform_data for twl4030 codec cells platform bits
>   mfd: Use mfd cell platform_data for tps6105x cells platform bits
>   mfd: Use mfd cell platform_data for 88pm860x cells platform bits
>   mfd: Use mfd cell platform_data for davinci cells platform bits
>   mfd: Remove mfd_data
> 
>  drivers/dma/timb_dma.c                 |    3 +-
>  drivers/gpio/janz-ttl.c                |    3 +-
>  drivers/gpio/rdc321x-gpio.c            |    3 +-
>  drivers/gpio/timbgpio.c                |    6 +-
>  drivers/i2c/busses/i2c-ocores.c        |    3 +-
>  drivers/i2c/busses/i2c-xiic.c          |    3 +-
>  drivers/input/misc/twl4030-vibra.c     |    3 +-
>  drivers/leds/leds-88pm860x.c           |    7 +--
>  drivers/leds/leds-mc13783.c            |    7 +--
>  drivers/media/radio/radio-timb.c       |    3 +-
>  drivers/media/radio/radio-wl1273.c     |    2 +-
>  drivers/media/video/timblogiw.c        |    3 +-
>  drivers/mfd/88pm860x-core.c            |   18 +++++--
>  drivers/mfd/ab3100-core.c              |    6 ++-
>  drivers/mfd/ab3550-core.c              |    6 ++-
>  drivers/mfd/asic3.c                    |    6 ++-
>  drivers/mfd/davinci_voicecodec.c       |    6 ++-
>  drivers/mfd/htc-pasic3.c               |    5 ++-
>  drivers/mfd/janz-cmodio.c              |    3 +-
>  drivers/mfd/mc13xxx-core.c             |   12 +++--
>  drivers/mfd/mfd-core.c                 |    7 +++
>  drivers/mfd/rdc321x-southbridge.c      |    6 ++-
>  drivers/mfd/t7l66xb.c                  |    6 ++-
>  drivers/mfd/tc6387xb.c                 |    3 +-
>  drivers/mfd/tc6393xb.c                 |   10 +++-
>  drivers/mfd/timberdale.c               |   81 +++++++++++++++++++++-----------
>  drivers/mfd/tps6105x.c                 |    3 +-
>  drivers/mfd/twl4030-codec.c            |    6 ++-
>  drivers/mfd/wl1273-core.c              |    6 ++-
>  drivers/mfd/wm8400-core.c              |    3 +-
>  drivers/mmc/host/tmio_mmc.c            |    2 +-
>  drivers/mtd/nand/tmio_nand.c           |    2 +-
>  drivers/net/can/janz-ican3.c           |    3 +-
>  drivers/net/ks8842.c                   |    3 +-
>  drivers/regulator/88pm8607.c           |    7 +--
>  drivers/regulator/ab3100.c             |    3 +-
>  drivers/regulator/mc13783-regulator.c  |    7 ++-
>  drivers/regulator/mc13892-regulator.c  |    7 ++-
>  drivers/regulator/tps6105x-regulator.c |    4 +-
>  drivers/spi/xilinx_spi.c               |    3 +-
>  drivers/video/backlight/88pm860x_bl.c  |    7 +--
>  drivers/video/tmiofb.c                 |   12 ++---
>  drivers/w1/masters/ds1wm.c             |   12 ++++-
>  drivers/watchdog/rdc321x_wdt.c         |    3 +-
>  include/linux/mfd/abx500.h             |    1 +
>  include/linux/mfd/core.h               |   23 +--------
>  sound/soc/codecs/cq93vc.c              |    3 +-
>  sound/soc/codecs/twl4030.c             |    6 +--
>  sound/soc/codecs/wl1273.c              |    3 +-
>  sound/soc/codecs/wm8400.c              |    2 +-
>  sound/soc/davinci/davinci-vcif.c       |    2 +-
>  51 files changed, 191 insertions(+), 163 deletions(-)
> 

The timberdale part looks good.

Acked-by: Richard Röjfors <richard.rojfors@pelagicore.com>

--Richard


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

* Re: [PATCH 12/19] mfd: Use mfd cell platform_data for wm8400 cells platform bits
  2011-05-09  7:13   ` Mark Brown
@ 2011-05-10  8:45     ` Samuel Ortiz
  2011-05-10  9:10       ` Mark Brown
  0 siblings, 1 reply; 37+ messages in thread
From: Samuel Ortiz @ 2011-05-10  8:45 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel

Hi Mark,

On Mon, May 09, 2011 at 09:13:42AM +0200, Mark Brown wrote:
> On Mon, May 09, 2011 at 02:32:04AM +0200, Samuel Ortiz wrote:
> 
> >  static int wm8400_codec_probe(struct snd_soc_codec *codec)
> >  {
> > -	struct wm8400 *wm8400 = mfd_get_data(to_platform_device(codec->dev));
> > +	struct wm8400 *wm8400 = codec->dev->platform_data;
> 
> It'd be better to use platform_get_drvdata() here rather than accessing
> the pointer directly.
Is the core codec code setting the driver_data pointer appropriately ?

Cheers,
Samuel.

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

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

* Re: [PATCH 12/19] mfd: Use mfd cell platform_data for wm8400 cells platform bits
  2011-05-10  8:45     ` Samuel Ortiz
@ 2011-05-10  9:10       ` Mark Brown
  2011-05-11  9:03         ` [PATCH v1 " Samuel Ortiz
  0 siblings, 1 reply; 37+ messages in thread
From: Mark Brown @ 2011-05-10  9:10 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-kernel

On Tue, May 10, 2011 at 10:45:01AM +0200, Samuel Ortiz wrote:

> > > -	struct wm8400 *wm8400 = mfd_get_data(to_platform_device(codec->dev));
> > > +	struct wm8400 *wm8400 = codec->dev->platform_data;

> > It'd be better to use platform_get_drvdata() here rather than accessing
> > the pointer directly.

> Is the core codec code setting the driver_data pointer appropriately ?

Sorry, I meant _get_platdata().

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

* Re: [PATCH 16/19] mfd: Use mfd cell platform_data for tps6105x cells platform bits
  2011-05-09  7:05   ` Linus Walleij
@ 2011-05-11  8:23     ` Samuel Ortiz
  2011-05-11 19:41       ` Linus Walleij
  2011-05-11  9:05     ` [PATCH v1 " Samuel Ortiz
  1 sibling, 1 reply; 37+ messages in thread
From: Samuel Ortiz @ 2011-05-11  8:23 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-kernel, Mark Brown, Liam Girdwood

Hi Linus,

On Mon, May 09, 2011 at 09:05:19AM +0200, Linus Walleij wrote:
> 2011/5/9 Samuel Ortiz <sameo@linux.intel.com>:
> 
> > With the addition of a platform device mfd_cell pointer, MFD drivers
> > can go back to passing platform data back to their sub drivers.
> > This allows for an mfd_cell->mfd_data removal and thus keep the
> > sub drivers MFD agnostic. This is mostly needed for non MFD aware
> > sub drivers.
> >
> > Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
> > Cc: Liam Girdwood <lrg@slimlogic.co.uk>
> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
> 
> I have some question marks on this one...
> 
> > --- a/drivers/mfd/tps6105x.c
> > +++ b/drivers/mfd/tps6105x.c
> > @@ -183,7 +183,8 @@ static int __devinit tps6105x_probe(struct i2c_client *client,
> >        /* Set up and register the platform devices. */
> >        for (i = 0; i < ARRAY_SIZE(tps6105x_cells); i++) {
> >                /* One state holder for all drivers, this is simple */
> > -               tps6105x_cells[i].mfd_data = tps6105x;
> > +               tps6105x_cells[i].platform_data = tps6105x;
> > +               tps6105x_cells[i].pdata_size = sizeof(*tps6105x);
> 
> ACK
> 
> > --- a/drivers/regulator/tps6105x-regulator.c
> > +++ b/drivers/regulator/tps6105x-regulator.c
> > @@ -137,7 +137,7 @@ static struct regulator_desc tps6105x_regulator_desc = {
> >  */
> >  static int __devinit tps6105x_regulator_probe(struct platform_device *pdev)
> >  {
> > -       struct tps6105x *tps6105x = mfd_get_data(pdev);
> > +       struct tps6105x *tps6105x = pdev->dev.platform_data;
> 
> Can you use platform_get_drvdata(pdev); instead?
I suppose you mean dev_get_platdata() ?


> >        struct tps6105x_platform_data *pdata = tps6105x->pdata;
> >        int ret;
> >
> > @@ -164,7 +164,7 @@ static int __devinit tps6105x_regulator_probe(struct platform_device *pdev)
> >
> >  static int __devexit tps6105x_regulator_remove(struct platform_device *pdev)
> >  {
> > -       struct tps6105x *tps6105x = platform_get_drvdata(pdev);
> > +       struct tps6105x *tps6105x = pdev->dev.platform_data;
> 
> And this is a NO-OP, actually a bug in the present code, just leave it
> as it is and the other changes removing the mfd->mfd_data fixes the bug...
I agree it's a bug in the current code. But I need to fetch the platform_data
pointer, so here again I would have to call dev_get_platdata().

Cheers,
Samuel.


> Yours,
> Linus Walleij

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

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

* [PATCH v1 12/19] mfd: Use mfd cell platform_data for wm8400 cells platform bits
  2011-05-10  9:10       ` Mark Brown
@ 2011-05-11  9:03         ` Samuel Ortiz
  2011-05-11  9:20           ` Mark Brown
  0 siblings, 1 reply; 37+ messages in thread
From: Samuel Ortiz @ 2011-05-11  9:03 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel

With the addition of a platform device mfd_cell pointer, MFD drivers
can go back to passing platform data back to their sub drivers.
This allows for an mfd_cell->mfd_data removal and thus keep the
sub drivers MFD agnostic. This is mostly needed for non MFD aware
sub drivers.

Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---

v0 -> v1: Use dev_get_platdata instead of directly accessing the platform_data
pointer.

---
 drivers/mfd/wm8400-core.c |    3 ++-
 sound/soc/codecs/wm8400.c |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/wm8400-core.c b/drivers/mfd/wm8400-core.c
index 3a6e78c..597f82e 100644
--- a/drivers/mfd/wm8400-core.c
+++ b/drivers/mfd/wm8400-core.c
@@ -245,7 +245,8 @@ static int wm8400_register_codec(struct wm8400 *wm8400)
 {
 	struct mfd_cell cell = {
 		.name = "wm8400-codec",
-		.mfd_data = wm8400,
+		.platform_data = wm8400,
+		.pdata_size = sizeof(*wm8400),
 	};
 
 	return mfd_add_devices(wm8400->dev, -1, &cell, 1, NULL, 0);
diff --git a/sound/soc/codecs/wm8400.c b/sound/soc/codecs/wm8400.c
index 736b785..fbee556 100644
--- a/sound/soc/codecs/wm8400.c
+++ b/sound/soc/codecs/wm8400.c
@@ -1378,7 +1378,7 @@ static void wm8400_probe_deferred(struct work_struct *work)
 
 static int wm8400_codec_probe(struct snd_soc_codec *codec)
 {
-	struct wm8400 *wm8400 = mfd_get_data(to_platform_device(codec->dev));
+	struct wm8400 *wm8400 = dev_get_platdata(codec->dev);
 	struct wm8400_priv *priv;
 	int ret;
 	u16 reg;
-- 
1.7.2.3

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

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

* [PATCH v1 16/19] mfd: Use mfd cell platform_data for tps6105x cells platform bits
  2011-05-09  7:05   ` Linus Walleij
  2011-05-11  8:23     ` Samuel Ortiz
@ 2011-05-11  9:05     ` Samuel Ortiz
  1 sibling, 0 replies; 37+ messages in thread
From: Samuel Ortiz @ 2011-05-11  9:05 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-kernel, Mark Brown, Liam Girdwood

With the addition of a platform device mfd_cell pointer, MFD drivers
can go back to passing platform data back to their sub drivers.
This allows for an mfd_cell->mfd_data removal and thus keep the
sub drivers MFD agnostic. This is mostly needed for non MFD aware
sub drivers.

Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---

v0 -> v1: Use dev_get_platdata instead of accessing the platform_data pointer
directly.

---
 drivers/mfd/tps6105x.c                 |    3 ++-
 drivers/regulator/tps6105x-regulator.c |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/tps6105x.c b/drivers/mfd/tps6105x.c
index 46d8205..a293b97 100644
--- a/drivers/mfd/tps6105x.c
+++ b/drivers/mfd/tps6105x.c
@@ -183,7 +183,8 @@ static int __devinit tps6105x_probe(struct i2c_client *client,
 	/* Set up and register the platform devices. */
 	for (i = 0; i < ARRAY_SIZE(tps6105x_cells); i++) {
 		/* One state holder for all drivers, this is simple */
-		tps6105x_cells[i].mfd_data = tps6105x;
+		tps6105x_cells[i].platform_data = tps6105x;
+		tps6105x_cells[i].pdata_size = sizeof(*tps6105x);
 	}
 
 	ret = mfd_add_devices(&client->dev, 0, tps6105x_cells,
diff --git a/drivers/regulator/tps6105x-regulator.c b/drivers/regulator/tps6105x-regulator.c
index 1661499..a4d7f45 100644
--- a/drivers/regulator/tps6105x-regulator.c
+++ b/drivers/regulator/tps6105x-regulator.c
@@ -137,7 +137,7 @@ static struct regulator_desc tps6105x_regulator_desc = {
  */
 static int __devinit tps6105x_regulator_probe(struct platform_device *pdev)
 {
-	struct tps6105x *tps6105x = mfd_get_data(pdev);
+	struct tps6105x *tps6105x = dev_get_platdata(&pdev->dev);
 	struct tps6105x_platform_data *pdata = tps6105x->pdata;
 	int ret;
 
@@ -164,7 +164,7 @@ static int __devinit tps6105x_regulator_probe(struct platform_device *pdev)
 
 static int __devexit tps6105x_regulator_remove(struct platform_device *pdev)
 {
-	struct tps6105x *tps6105x = platform_get_drvdata(pdev);
+	struct tps6105x *tps6105x = dev_get_platdata(&pdev->dev);
 	regulator_unregister(tps6105x->regulator);
 	return 0;
 }
-- 
1.7.2.3

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

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

* Re: [PATCH v1 12/19] mfd: Use mfd cell platform_data for wm8400 cells platform bits
  2011-05-11  9:03         ` [PATCH v1 " Samuel Ortiz
@ 2011-05-11  9:20           ` Mark Brown
  0 siblings, 0 replies; 37+ messages in thread
From: Mark Brown @ 2011-05-11  9:20 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-kernel

On Wed, May 11, 2011 at 11:03:19AM +0200, Samuel Ortiz wrote:

> With the addition of a platform device mfd_cell pointer, MFD drivers
> can go back to passing platform data back to their sub drivers.
> This allows for an mfd_cell->mfd_data removal and thus keep the
> sub drivers MFD agnostic. This is mostly needed for non MFD aware
> sub drivers.

> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

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

* Re: [PATCH 16/19] mfd: Use mfd cell platform_data for tps6105x cells platform bits
  2011-05-11  8:23     ` Samuel Ortiz
@ 2011-05-11 19:41       ` Linus Walleij
  0 siblings, 0 replies; 37+ messages in thread
From: Linus Walleij @ 2011-05-11 19:41 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-kernel, Mark Brown, Liam Girdwood

2011/5/11 Samuel Ortiz <sameo@linux.intel.com>:
>> > -       struct tps6105x *tps6105x = mfd_get_data(pdev);
>> > +       struct tps6105x *tps6105x = pdev->dev.platform_data;
>>
>> Can you use platform_get_drvdata(pdev); instead?
>
> I suppose you mean dev_get_platdata() ?

Yes, sorry.

>> >  static int __devexit tps6105x_regulator_remove(struct platform_device *pdev)
>> >  {
>> > -       struct tps6105x *tps6105x = platform_get_drvdata(pdev);
>> > +       struct tps6105x *tps6105x = pdev->dev.platform_data;
>>
>> And this is a NO-OP, actually a bug in the present code, just leave it
>> as it is and the other changes removing the mfd->mfd_data fixes the bug...
>
> I agree it's a bug in the current code. But I need to fetch the platform_data
> pointer, so here again I would have to call dev_get_platdata().

Yes again, you're right.

I was mainly after using the pretty accessor functions rather than direct
dereferencing, no big deal.

Thanks,
Linus Walleij

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

* Re: [PATCH 07/19] mfd: Use mfd cell platform_data for wl1273 cells platform bits
  2011-05-09  0:31 ` [PATCH 07/19] mfd: Use mfd cell platform_data for wl1273 cells platform bits Samuel Ortiz
@ 2011-06-09  8:43   ` Matti J. Aaltonen
  0 siblings, 0 replies; 37+ messages in thread
From: Matti J. Aaltonen @ 2011-06-09  8:43 UTC (permalink / raw)
  To: ext Samuel Ortiz; +Cc: linux-kernel

On Mon, 2011-05-09 at 02:31 +0200, ext Samuel Ortiz wrote:
> With the addition of a platform device mfd_cell pointer, MFD drivers
> can go back to passing platform data back to their sub drivers.
> This allows for an mfd_cell->mfd_data removal and thus keep the
> sub drivers MFD agnostic. This is mostly needed for non MFD aware
> sub drivers.
> 
> Cc: Matti Aaltonen <matti.j.aaltonen@nokia.com>
> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
> ---
>  drivers/media/radio/radio-wl1273.c |    2 +-
>  drivers/mfd/wl1273-core.c          |    6 ++++--
>  sound/soc/codecs/wl1273.c          |    3 +--
>  3 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/media/radio/radio-wl1273.c b/drivers/media/radio/radio-wl1273.c
> index e2550dc..46cacf8 100644
> --- a/drivers/media/radio/radio-wl1273.c
> +++ b/drivers/media/radio/radio-wl1273.c
> @@ -1990,7 +1990,7 @@ static int wl1273_fm_radio_remove(struct platform_device *pdev)
>  
>  static int __devinit wl1273_fm_radio_probe(struct platform_device *pdev)
>  {
> -	struct wl1273_core **core = mfd_get_data(pdev);
> +	struct wl1273_core **core = pdev->dev.platform_data;
>  	struct wl1273_device *radio;
>  	struct v4l2_ctrl *ctrl;
>  	int r = 0;
> diff --git a/drivers/mfd/wl1273-core.c b/drivers/mfd/wl1273-core.c
> index 04914f2..63d250d 100644
> --- a/drivers/mfd/wl1273-core.c
> +++ b/drivers/mfd/wl1273-core.c
> @@ -217,7 +217,8 @@ static int __devinit wl1273_core_probe(struct i2c_client *client,
>  
>  	cell = &core->cells[children];
>  	cell->name = "wl1273_fm_radio";
> -	cell->mfd_data = &core;
> +	cell->platform_data = &core;
> +	cell->pdata_size = sizeof(core);
>  	children++;
>  
>  	core->read = wl1273_fm_read_reg;
> @@ -231,7 +232,8 @@ static int __devinit wl1273_core_probe(struct i2c_client *client,
>  
>  		dev_dbg(&client->dev, "%s: Have codec.\n", __func__);
>  		cell->name = "wl1273-codec";
> -		cell->mfd_data = &core;
> +		cell->platform_data = &core;
> +		cell->pdata_size = sizeof(core);
>  		children++;
>  	}
>  
> diff --git a/sound/soc/codecs/wl1273.c b/sound/soc/codecs/wl1273.c
> index c8a874d..5836201 100644
> --- a/sound/soc/codecs/wl1273.c
> +++ b/sound/soc/codecs/wl1273.c
> @@ -441,8 +441,7 @@ EXPORT_SYMBOL_GPL(wl1273_get_format);
>  
>  static int wl1273_probe(struct snd_soc_codec *codec)
>  {
> -	struct wl1273_core **core =
> -			mfd_get_data(to_platform_device(codec->dev));
> +	struct wl1273_core **core = codec->dev->platform_data;
>  	struct wl1273_priv *wl1273;
>  	int r;
>  

Looks good.

B.R.
Matti A.






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

end of thread, other threads:[~2011-06-09  8:43 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1304901131-7104-1-git-send-email-sameo@linux.intel.com>
2011-05-09  0:31 ` [PATCH 02/19] mfd: Use mfd cell platform_data for ab3550 cells platform bits Samuel Ortiz
2011-05-09  7:01   ` Linus Walleij
2011-05-09  0:31 ` [PATCH 03/19] mfd: Use mfd cell platform_data for ab3100 " Samuel Ortiz
2011-05-09  7:02   ` Linus Walleij
2011-05-09  0:31 ` [PATCH 04/19] mmc: Use device platform_data to retrieve tmio_mmc " Samuel Ortiz
2011-05-09  0:31 ` [PATCH 05/19] w1: Use device platform_data to retrieve ds1wm " Samuel Ortiz
2011-05-09  0:31 ` [PATCH 06/19] mfd: Pass htc-pasic3 led platform data through the cell platform_data Samuel Ortiz
2011-05-09 10:20   ` Paul Parsons
2011-05-09 11:25     ` Samuel Ortiz
2011-05-09  0:31 ` [PATCH 07/19] mfd: Use mfd cell platform_data for wl1273 cells platform bits Samuel Ortiz
2011-06-09  8:43   ` Matti J. Aaltonen
2011-05-09  0:32 ` [PATCH 08/19] fb: Use platform_data to retrieve tmiofb " Samuel Ortiz
2011-05-09  0:32 ` [PATCH 09/19] mtd: Use platform_data to retrieve tmio_nand " Samuel Ortiz
2011-05-09  0:32 ` [PATCH 10/19] mfd: Use mfd cell platform_data for timberdale cells " Samuel Ortiz
2011-05-09  0:32 ` [PATCH 11/19] mfd: Use mfd cell platform_data for rdc321x " Samuel Ortiz
2011-05-09  0:32 ` [PATCH 12/19] mfd: Use mfd cell platform_data for wm8400 " Samuel Ortiz
2011-05-09  7:13   ` Mark Brown
2011-05-10  8:45     ` Samuel Ortiz
2011-05-10  9:10       ` Mark Brown
2011-05-11  9:03         ` [PATCH v1 " Samuel Ortiz
2011-05-11  9:20           ` Mark Brown
2011-05-09  0:32 ` [PATCH 13/19] mfd: Use mfd cell platform_data for mc13xxx " Samuel Ortiz
2011-05-09  0:32 ` [PATCH 14/19] mfd: Use mfd cell platform_data for janz " Samuel Ortiz
2011-05-09  0:32 ` [PATCH 15/19] mfd: Use mfd cell platform_data for twl4030 codec " Samuel Ortiz
2011-05-09  0:32 ` [PATCH 16/19] mfd: Use mfd cell platform_data for tps6105x " Samuel Ortiz
2011-05-09  7:05   ` Linus Walleij
2011-05-11  8:23     ` Samuel Ortiz
2011-05-11 19:41       ` Linus Walleij
2011-05-11  9:05     ` [PATCH v1 " Samuel Ortiz
2011-05-09  0:32 ` [PATCH 17/19] mfd: Use mfd cell platform_data for 88pm860x " Samuel Ortiz
2011-05-09  8:21   ` Haojian Zhuang
2011-05-09  0:32 ` [PATCH 18/19] mfd: Use mfd cell platform_data for davinci " Samuel Ortiz
     [not found] ` <1304901131-7104-20-git-send-email-sameo@linux.intel.com>
2011-05-09  8:22   ` [PATCH 19/19] mfd: Remove mfd_data Haojian Zhuang
2011-05-09 11:20 ` [PATCH 00/19] mfd: mfd_data removal Samuel Ortiz
     [not found] ` <1304901131-7104-2-git-send-email-sameo@linux.intel.com>
2011-05-09  8:22   ` [PATCH 01/19] mfd: Add platform data pointer back Haojian Zhuang
2011-05-09 11:21   ` Samuel Ortiz
2011-05-10  7:52 ` [PATCH 00/19] mfd: mfd_data removal Richard Röjfors

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