Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ec1b54c authored by Andres Salomon's avatar Andres Salomon Committed by Samuel Ortiz
Browse files

mfd: mfd_cell is now implicitly available to mc13xxx drivers



The cell's platform_data is now accessed with a helper function;
change clients to use that, and remove the now-unused data_size.

Note that mfd-core no longer makes a copy of platform_data, but the
mc13xxx-core driver creates the pdata structures on the stack.  In
order to get around that, the various ARM mach types that set the
pdata have been changed to hold the variable in static (global) memory.
Also note that __initdata references in aforementioned pdata structs
have been dropped.

Signed-off-by: default avatarAndres Salomon <dilinger@queued.net>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 8615e4cb
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -232,10 +232,13 @@ static struct mc13xxx_regulator_init_data mx27_3ds_regulators[] = {
};

/* MC13783 */
static struct mc13xxx_platform_data mc13783_pdata __initdata = {
static struct mc13xxx_platform_data mc13783_pdata = {
	.regulators = {
		.regulators = mx27_3ds_regulators,
		.num_regulators = ARRAY_SIZE(mx27_3ds_regulators),
	.flags  = MC13XXX_USE_REGULATOR,

	},
	.flags  = MC13783_USE_REGULATOR,
};

/* SPI */
+6 −4
Original line number Diff line number Diff line
@@ -263,10 +263,12 @@ static struct mc13xxx_regulator_init_data pcm038_regulators[] = {
};

static struct mc13xxx_platform_data pcm038_pmic = {
	.regulators = {
		.regulators = pcm038_regulators,
		.num_regulators = ARRAY_SIZE(pcm038_regulators),
	.flags = MC13XXX_USE_ADC | MC13XXX_USE_REGULATOR |
		 MC13XXX_USE_TOUCHSCREEN,
	},
	.flags = MC13783_USE_ADC | MC13783_USE_REGULATOR |
		 MC13783_USE_TOUCHSCREEN,
};

static struct spi_board_info pcm038_spi_board_info[] __initdata = {
+6 −4
Original line number Diff line number Diff line
@@ -488,10 +488,12 @@ static struct mc13xxx_regulator_init_data mx31_3ds_regulators[] = {
};

/* MC13783 */
static struct mc13xxx_platform_data mc13783_pdata __initdata = {
static struct mc13xxx_platform_data mc13783_pdata = {
	.regulators = {
		.regulators = mx31_3ds_regulators,
		.num_regulators = ARRAY_SIZE(mx31_3ds_regulators),
	.flags  = MC13XXX_USE_REGULATOR | MC13XXX_USE_TOUCHSCREEN
	},
	.flags  = MC13783_USE_REGULATOR | MC13783_USE_TOUCHSCREEN,
};

/* SPI */
+4 −2
Original line number Diff line number Diff line
@@ -268,8 +268,10 @@ static struct mc13783_leds_platform_data moboard_leds = {
};

static struct mc13xxx_platform_data moboard_pmic = {
	.regulators = {
		.regulators = moboard_regulators,
		.num_regulators = ARRAY_SIZE(moboard_regulators),
	},
	.leds = &moboard_leds,
	.flags = MC13XXX_USE_REGULATOR | MC13XXX_USE_RTC |
		MC13XXX_USE_ADC | MC13XXX_USE_LED,
+4 −3
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#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 {
@@ -183,7 +184,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 = dev_get_platdata(&pdev->dev);
	struct mc13783_leds_platform_data *pdata = mfd_get_data(pdev);
	struct mc13783 *dev = dev_get_drvdata(pdev->dev.parent);
	int ret = 0;
	int reg = 0;
@@ -264,7 +265,7 @@ static int __devinit mc13783_leds_prepare(struct platform_device *pdev)

static int __devinit mc13783_led_probe(struct platform_device *pdev)
{
	struct mc13783_leds_platform_data *pdata = dev_get_platdata(&pdev->dev);
	struct mc13783_leds_platform_data *pdata = mfd_get_data(pdev);
	struct mc13783_led_platform_data *led_cur;
	struct mc13783_led *led, *led_dat;
	int ret, i;
@@ -351,7 +352,7 @@ static int __devinit mc13783_led_probe(struct platform_device *pdev)

static int __devexit mc13783_led_remove(struct platform_device *pdev)
{
	struct mc13783_leds_platform_data *pdata = dev_get_platdata(&pdev->dev);
	struct mc13783_leds_platform_data *pdata = mfd_get_data(pdev);
	struct mc13783_led *led = platform_get_drvdata(pdev);
	struct mc13783 *dev = dev_get_drvdata(pdev->dev.parent);
	int i;
Loading