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,