diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2011-04-06 10:26:56 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-05-26 13:45:12 -0400 |
commit | 07259a7092e47b9fbb5c8bfdad45fa4c7dbbc051 (patch) | |
tree | 73d3c059141e3b418ac40b3f63a165fc1b326013 /drivers/mfd/88pm860x-core.c | |
parent | a7c98ce25cfa600bd614134a82d22bcb7bcb9d65 (diff) |
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: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Richard Purdie <rpurdie@rpsys.net>
Acked-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/88pm860x-core.c')
-rw-r--r-- | drivers/mfd/88pm860x-core.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c index 011cb6ce861b..801aff7c8bab 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, | |||
516 | for (i = 0; i < pdata->num_backlights; i++) { | 516 | for (i = 0; i < pdata->num_backlights; i++) { |
517 | memcpy(&bk_pdata[i], &pdata->backlight[i], | 517 | memcpy(&bk_pdata[i], &pdata->backlight[i], |
518 | sizeof(struct pm860x_backlight_pdata)); | 518 | sizeof(struct pm860x_backlight_pdata)); |
519 | bk_devs[i].mfd_data = &bk_pdata[i]; | 519 | bk_devs[i].platform_data = &bk_pdata[i]; |
520 | bk_devs[i].pdata_size = sizeof(bk_pdata[i]); | ||
520 | 521 | ||
521 | for (j = 0; j < ARRAY_SIZE(bk_devs); j++) { | 522 | for (j = 0; j < ARRAY_SIZE(bk_devs); j++) { |
522 | id = bk_resources[j].start; | 523 | id = bk_resources[j].start; |
@@ -553,7 +554,8 @@ static void __devinit device_led_init(struct pm860x_chip *chip, | |||
553 | for (i = 0; i < pdata->num_leds; i++) { | 554 | for (i = 0; i < pdata->num_leds; i++) { |
554 | memcpy(&led_pdata[i], &pdata->led[i], | 555 | memcpy(&led_pdata[i], &pdata->led[i], |
555 | sizeof(struct pm860x_led_pdata)); | 556 | sizeof(struct pm860x_led_pdata)); |
556 | led_devs[i].mfd_data = &led_pdata[i]; | 557 | led_devs[i].platform_data = &led_pdata[i]; |
558 | led_devs[i].pdata_size = sizeof(led_pdata[i]); | ||
557 | 559 | ||
558 | for (j = 0; j < ARRAY_SIZE(led_devs); j++) { | 560 | for (j = 0; j < ARRAY_SIZE(led_devs); j++) { |
559 | id = led_resources[j].start; | 561 | id = led_resources[j].start; |
@@ -617,7 +619,8 @@ static void __devinit device_regulator_init(struct pm860x_chip *chip, | |||
617 | } | 619 | } |
618 | memcpy(®ulator_pdata[i], &pdata->regulator[i], | 620 | memcpy(®ulator_pdata[i], &pdata->regulator[i], |
619 | sizeof(struct regulator_init_data)); | 621 | sizeof(struct regulator_init_data)); |
620 | regulator_devs[i].mfd_data = ®ulator_pdata[i]; | 622 | regulator_devs[i].platform_data = ®ulator_pdata[i]; |
623 | regulator_devs[i].pdata_size = sizeof(regulator_pdata[i]); | ||
621 | regulator_devs[i].num_resources = 1; | 624 | regulator_devs[i].num_resources = 1; |
622 | regulator_devs[i].resources = ®ulator_resources[j]; | 625 | regulator_devs[i].resources = ®ulator_resources[j]; |
623 | 626 | ||
@@ -642,7 +645,8 @@ static void __devinit device_touch_init(struct pm860x_chip *chip, | |||
642 | return; | 645 | return; |
643 | 646 | ||
644 | memcpy(&touch_pdata, pdata->touch, sizeof(struct pm860x_touch_pdata)); | 647 | memcpy(&touch_pdata, pdata->touch, sizeof(struct pm860x_touch_pdata)); |
645 | touch_devs[0].mfd_data = &touch_pdata; | 648 | touch_devs[0].platform_data = &touch_pdata; |
649 | touch_devs[0].pdata_size = sizeof(touch_pdata); | ||
646 | touch_devs[0].num_resources = ARRAY_SIZE(touch_resources); | 650 | touch_devs[0].num_resources = ARRAY_SIZE(touch_resources); |
647 | touch_devs[0].resources = &touch_resources[0]; | 651 | touch_devs[0].resources = &touch_resources[0]; |
648 | ret = mfd_add_devices(chip->dev, 0, &touch_devs[0], | 652 | ret = mfd_add_devices(chip->dev, 0, &touch_devs[0], |
@@ -662,7 +666,8 @@ static void __devinit device_power_init(struct pm860x_chip *chip, | |||
662 | return; | 666 | return; |
663 | 667 | ||
664 | memcpy(&power_pdata, pdata->power, sizeof(struct pm860x_power_pdata)); | 668 | memcpy(&power_pdata, pdata->power, sizeof(struct pm860x_power_pdata)); |
665 | power_devs[0].mfd_data = &power_pdata; | 669 | power_devs[0].platform_data = &power_pdata; |
670 | power_devs[0].pdata_size = sizeof(power_pdata); | ||
666 | power_devs[0].num_resources = ARRAY_SIZE(battery_resources); | 671 | power_devs[0].num_resources = ARRAY_SIZE(battery_resources); |
667 | power_devs[0].resources = &battery_resources[0], | 672 | power_devs[0].resources = &battery_resources[0], |
668 | ret = mfd_add_devices(chip->dev, 0, &power_devs[0], 1, | 673 | 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, | |||
670 | if (ret < 0) | 675 | if (ret < 0) |
671 | dev_err(chip->dev, "Failed to add battery subdev\n"); | 676 | dev_err(chip->dev, "Failed to add battery subdev\n"); |
672 | 677 | ||
673 | power_devs[1].mfd_data = &power_pdata; | 678 | power_devs[1].platform_data = &power_pdata; |
679 | power_devs[0].pdata_size = sizeof(power_pdata); | ||
674 | power_devs[1].num_resources = ARRAY_SIZE(charger_resources); | 680 | power_devs[1].num_resources = ARRAY_SIZE(charger_resources); |
675 | power_devs[1].resources = &charger_resources[0], | 681 | power_devs[1].resources = &charger_resources[0], |
676 | ret = mfd_add_devices(chip->dev, 0, &power_devs[1], 1, | 682 | ret = mfd_add_devices(chip->dev, 0, &power_devs[1], 1, |