]> Git Repo - linux.git/commitdiff
Merge with upstream to accommodate with MFD changes
authorAnton Vorontsov <[email protected]>
Tue, 25 Sep 2012 02:10:08 +0000 (19:10 -0700)
committerAnton Vorontsov <[email protected]>
Tue, 25 Sep 2012 02:12:01 +0000 (19:12 -0700)
commit 0848c94fb4 ("mfd: core: Push irqdomain mapping out into devices")
that appeared in v3.6-rc6 adds another argument to the mfd_add_devices()
call, and that makes commit a830d28b48bf ("power_supply: Enable
battery-charger for 88pm860x", which is battery tree) no longer compatible
with the latest kernels.

This commit is used to merge upstream back into battery tree and
accommodate 88pm860x driver for the latest changes in MFD core.

Signed-off-by: Stephen Rothwell <[email protected]>
Reported-by: Fengguang Wu <[email protected]>
Reported-by: Samuel Ortiz <[email protected]>
Signed-off-by: Anton Vorontsov <[email protected]>
1  2 
drivers/mfd/88pm860x-core.c

index 76b5b7daf65df853e3908072455cd440fe2943ba,b73f033b2c602fadce09dd97d0c7623581962e12..2abd607eb05b53396490ea4420af17328b596dd9
@@@ -18,7 -18,6 +18,7 @@@
  #include <linux/mfd/core.h>
  #include <linux/mfd/88pm860x.h>
  #include <linux/regulator/machine.h>
 +#include <linux/power/charger-manager.h>
  
  #define INT_STATUS_NUM                        3
  
@@@ -85,8 -84,7 +85,8 @@@ static struct resource battery_resource
  static struct resource charger_resources[] __devinitdata = {
        {PM8607_IRQ_CHG,  PM8607_IRQ_CHG,  "charger detect",  IORESOURCE_IRQ,},
        {PM8607_IRQ_CHG_DONE,  PM8607_IRQ_CHG_DONE,  "charging done",       IORESOURCE_IRQ,},
 -      {PM8607_IRQ_CHG_FAULT, PM8607_IRQ_CHG_FAULT, "charging timeout",    IORESOURCE_IRQ,},
 +      {PM8607_IRQ_CHG_FAIL,  PM8607_IRQ_CHG_FAIL,  "charging timeout",    IORESOURCE_IRQ,},
 +      {PM8607_IRQ_CHG_FAULT, PM8607_IRQ_CHG_FAULT, "charging fault",      IORESOURCE_IRQ,},
        {PM8607_IRQ_GPADC1,    PM8607_IRQ_GPADC1,    "battery temperature", IORESOURCE_IRQ,},
        {PM8607_IRQ_VBAT, PM8607_IRQ_VBAT, "battery voltage", IORESOURCE_IRQ,},
        {PM8607_IRQ_VCHG, PM8607_IRQ_VCHG, "vchg voltage",    IORESOURCE_IRQ,},
@@@ -157,15 -155,10 +157,15 @@@ static struct regulator_init_data preg_
        .consumer_supplies      = &preg_supply[0],
  };
  
 +static struct charger_regulator chg_desc_regulator_data[] = {
 +      { .regulator_name = "preg", },
 +};
 +
  static struct mfd_cell power_devs[] = {
        {"88pm860x-battery", -1,},
        {"88pm860x-charger", -1,},
        {"88pm860x-preg",    -1,},
 +      {"charger-manager", -1,},
  };
  
  static struct mfd_cell rtc_devs[] = {
@@@ -644,7 -637,7 +644,7 @@@ static void __devinit device_bk_init(st
                        bk_devs[i].resources = &bk_resources[j];
                        ret = mfd_add_devices(chip->dev, 0,
                                              &bk_devs[i], 1,
-                                             &bk_resources[j], 0);
+                                             &bk_resources[j], 0, NULL);
                        if (ret < 0) {
                                dev_err(chip->dev, "Failed to add "
                                        "backlight subdev\n");
@@@ -679,7 -672,7 +679,7 @@@ static void __devinit device_led_init(s
                        led_devs[i].resources = &led_resources[j],
                        ret = mfd_add_devices(chip->dev, 0,
                                              &led_devs[i], 1,
-                                             &led_resources[j], 0);
+                                             &led_resources[j], 0, NULL);
                        if (ret < 0) {
                                dev_err(chip->dev, "Failed to add "
                                        "led subdev\n");
@@@ -716,7 -709,7 +716,7 @@@ static void __devinit device_regulator_
                regulator_devs[i].resources = &regulator_resources[seq];
  
                ret = mfd_add_devices(chip->dev, 0, &regulator_devs[i], 1,
-                                     &regulator_resources[seq], 0);
+                                     &regulator_resources[seq], 0, NULL);
                if (ret < 0) {
                        dev_err(chip->dev, "Failed to add regulator subdev\n");
                        goto out;
@@@ -740,7 -733,7 +740,7 @@@ static void __devinit device_rtc_init(s
        rtc_devs[0].resources = &rtc_resources[0];
        ret = mfd_add_devices(chip->dev, 0, &rtc_devs[0],
                              ARRAY_SIZE(rtc_devs), &rtc_resources[0],
-                             chip->irq_base);
+                             chip->irq_base, NULL);
        if (ret < 0)
                dev_err(chip->dev, "Failed to add rtc subdev\n");
  }
@@@ -759,7 -752,7 +759,7 @@@ static void __devinit device_touch_init
        touch_devs[0].resources = &touch_resources[0];
        ret = mfd_add_devices(chip->dev, 0, &touch_devs[0],
                              ARRAY_SIZE(touch_devs), &touch_resources[0],
-                             chip->irq_base);
+                             chip->irq_base, NULL);
        if (ret < 0)
                dev_err(chip->dev, "Failed to add touch subdev\n");
  }
@@@ -777,7 -770,7 +777,7 @@@ static void __devinit device_power_init
        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,
-                             &battery_resources[0], chip->irq_base);
+                             &battery_resources[0], chip->irq_base, NULL);
        if (ret < 0)
                dev_err(chip->dev, "Failed to add battery subdev\n");
  
        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,
-                             &charger_resources[0], chip->irq_base);
+                             &charger_resources[0], chip->irq_base, NULL);
        if (ret < 0)
                dev_err(chip->dev, "Failed to add charger subdev\n");
  
        power_devs[2].num_resources = ARRAY_SIZE(preg_resources);
        power_devs[2].resources = &preg_resources[0],
        ret = mfd_add_devices(chip->dev, 0, &power_devs[2], 1,
-                             &preg_resources[0], chip->irq_base);
+                             &preg_resources[0], chip->irq_base, NULL);
        if (ret < 0)
                dev_err(chip->dev, "Failed to add preg subdev\n");
-                                     NULL, chip->irq_base);
 +
 +      if (pdata->chg_desc) {
 +              pdata->chg_desc->charger_regulators =
 +                      &chg_desc_regulator_data[0];
 +              pdata->chg_desc->num_charger_regulators =
 +                      ARRAY_SIZE(chg_desc_regulator_data),
 +              power_devs[3].platform_data = pdata->chg_desc;
 +              power_devs[3].pdata_size = sizeof(*pdata->chg_desc);
 +              ret = mfd_add_devices(chip->dev, 0, &power_devs[3], 1,
++                                    NULL, chip->irq_base, NULL);
 +              if (ret < 0)
 +                      dev_err(chip->dev, "Failed to add chg-manager subdev\n");
 +      }
  }
  
  static void __devinit device_onkey_init(struct pm860x_chip *chip,
        onkey_devs[0].resources = &onkey_resources[0],
        ret = mfd_add_devices(chip->dev, 0, &onkey_devs[0],
                              ARRAY_SIZE(onkey_devs), &onkey_resources[0],
-                             chip->irq_base);
+                             chip->irq_base, NULL);
        if (ret < 0)
                dev_err(chip->dev, "Failed to add onkey subdev\n");
  }
@@@ -835,7 -815,8 +835,8 @@@ static void __devinit device_codec_init
        codec_devs[0].num_resources = ARRAY_SIZE(codec_resources);
        codec_devs[0].resources = &codec_resources[0],
        ret = mfd_add_devices(chip->dev, 0, &codec_devs[0],
-                             ARRAY_SIZE(codec_devs), &codec_resources[0], 0);
+                             ARRAY_SIZE(codec_devs), &codec_resources[0], 0,
+                             NULL);
        if (ret < 0)
                dev_err(chip->dev, "Failed to add codec subdev\n");
  }
This page took 0.068838 seconds and 4 git commands to generate.