diff options
author | Charlie Huang <chahuang@nvidia.com> | 2012-09-11 19:03:15 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 12:36:50 -0700 |
commit | ba0ddbccddec24da1754e033cde934c69089c0a4 (patch) | |
tree | ce563970dcce4ca94c912047e454bedc384e02c7 /drivers/mfd/max77665.c | |
parent | 410d5639f180adf07c23d0ab76d9cd3d91c6bb63 (diff) |
mfd: MAX77665: carry over platform data for each cell
Add feature to transfer design specific platform data from board
file(s) to the cell device drivers.
Change-Id: I788082a1606bd07d72835d81e39ef7cd04e67c1c
Signed-off-by: Charlie Huang <chahuang@nvidia.com>
(cherry picked from commit e10e95036f2678aef17afe3b527fa4ec17866679)
Reviewed on http://git-master/r/139118
Reviewed-on: http://git-master/r/141852
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Thomas Cherry <tcherry@nvidia.com>
Rebase-Id: Rf151d196e6722f8d560fa95bfe9aefbda22834aa
Diffstat (limited to 'drivers/mfd/max77665.c')
-rw-r--r-- | drivers/mfd/max77665.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/drivers/mfd/max77665.c b/drivers/mfd/max77665.c index 3c5755c82c1e..d6d0bfd1fb38 100644 --- a/drivers/mfd/max77665.c +++ b/drivers/mfd/max77665.c @@ -57,10 +57,10 @@ static const struct max77665_irq_data max77665_irqs[] = { }; static struct mfd_cell max77665s[] = { - {.name = "max77665-charger",}, - {.name = "max77665-flash",}, - {.name = "max77665-muic",}, - {.name = "max77665-haptic",}, + [MAX77665_CELL_CHARGER] = {.name = "max77665-charger",}, + [MAX77665_CELL_FLASH] = {.name = "max77665-flash",}, + [MAX77665_CELL_MUIC] = {.name = "max77665-muic",}, + [MAX77665_CELL_HAPTIC] = {.name = "max77665-haptic",}, }; static void max77665_irq_lock(struct irq_data *data) @@ -271,7 +271,6 @@ static int max77665_i2c_probe(struct i2c_client *client, max77665->dev = &client->dev; for (i = 0; i < MAX77665_I2C_SLAVE_MAX; ++i) { - slv_client = max77665->client[i]; if (i == 0) slv_client = client; else @@ -282,6 +281,7 @@ static int max77665_i2c_probe(struct i2c_client *client, ret = -ENOMEM; goto err_exit; } + max77665->client[i] = slv_client; i2c_set_clientdata(slv_client, max77665); max77665->regmap[i] = devm_regmap_init_i2c(slv_client, @@ -297,6 +297,26 @@ static int max77665_i2c_probe(struct i2c_client *client, if (client->irq > 0) max77665_irq_init(max77665, client->irq, pdata->irq_base); + max77665s[MAX77665_CELL_CHARGER].platform_data = + pdata->charger_platform_data.pdata; + max77665s[MAX77665_CELL_CHARGER].pdata_size = + pdata->charger_platform_data.size; + + max77665s[MAX77665_CELL_FLASH].platform_data = + pdata->flash_platform_data.pdata; + max77665s[MAX77665_CELL_FLASH].pdata_size = + pdata->flash_platform_data.size; + + max77665s[MAX77665_CELL_MUIC].platform_data = + pdata->muic_platform_data.pdata; + max77665s[MAX77665_CELL_MUIC].pdata_size = + pdata->muic_platform_data.size; + + max77665s[MAX77665_CELL_HAPTIC].platform_data = + pdata->haptic_platform_data.pdata; + max77665s[MAX77665_CELL_HAPTIC].pdata_size = + pdata->haptic_platform_data.size; + ret = mfd_add_devices(max77665->dev, -1, max77665s, ARRAY_SIZE(max77665s), NULL, 0, NULL); if (ret) { |