@@ -335,7 +335,10 @@ static int tps65219_probe(struct i2c_client *client,
struct tps65219 *tps;
int ret;
unsigned int chipid;
+ bool pwr_button;
bool sys_pwr;
+ struct mfd_cell cells[TPS65219_MAX_CELLS];
+ int nr_cells = 0;
tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL);
if (!tps)
@@ -364,9 +367,16 @@ static int tps65219_probe(struct i2c_client *client,
return ret;
}
- ret = devm_mfd_add_devices(tps->dev, PLATFORM_DEVID_AUTO, tps65219_cells,
- ARRAY_SIZE(tps65219_cells), NULL, 0,
- NULL);
+ memcpy(&cells[nr_cells++], &tps65219_regulator_cell,
+ sizeof(tps65219_regulator_cell));
+ pwr_button = of_property_read_bool(tps->dev->of_node, "ti,power-button");
+ if (pwr_button)
+ memcpy(&cells[nr_cells++], &tps65219_pwrbutton_cell,
+ sizeof(tps65219_pwrbutton_cell));
+
+ ret = devm_mfd_add_devices(tps->dev, PLATFORM_DEVID_AUTO, cells,
+ nr_cells, NULL, 0,
+ regmap_irq_get_domain(tps->irq_data));
if (ret) {
dev_err(tps->dev, "mfd_add_devices failed: %d\n", ret);
return ret;