aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/arizona-core.c2
-rw-r--r--drivers/mfd/wm8994-core.c35
2 files changed, 21 insertions, 16 deletions
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index 1a6f943f7337..c784f4602a74 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -272,6 +272,7 @@ static struct mfd_cell early_devs[] = {
272static struct mfd_cell wm5102_devs[] = { 272static struct mfd_cell wm5102_devs[] = {
273 { .name = "arizona-extcon" }, 273 { .name = "arizona-extcon" },
274 { .name = "arizona-gpio" }, 274 { .name = "arizona-gpio" },
275 { .name = "arizona-haptics" },
275 { .name = "arizona-micsupp" }, 276 { .name = "arizona-micsupp" },
276 { .name = "arizona-pwm" }, 277 { .name = "arizona-pwm" },
277 { .name = "wm5102-codec" }, 278 { .name = "wm5102-codec" },
@@ -280,6 +281,7 @@ static struct mfd_cell wm5102_devs[] = {
280static struct mfd_cell wm5110_devs[] = { 281static struct mfd_cell wm5110_devs[] = {
281 { .name = "arizona-extcon" }, 282 { .name = "arizona-extcon" },
282 { .name = "arizona-gpio" }, 283 { .name = "arizona-gpio" },
284 { .name = "arizona-haptics" },
283 { .name = "arizona-micsupp" }, 285 { .name = "arizona-micsupp" },
284 { .name = "arizona-pwm" }, 286 { .name = "arizona-pwm" },
285 { .name = "wm5110-codec" }, 287 { .name = "wm5110-codec" },
diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c
index c7f62ac544ad..bcb226ff9d2b 100644
--- a/drivers/mfd/wm8994-core.c
+++ b/drivers/mfd/wm8994-core.c
@@ -401,13 +401,19 @@ static const struct reg_default wm1811_reva_patch[] = {
401 */ 401 */
402static int wm8994_device_init(struct wm8994 *wm8994, int irq) 402static int wm8994_device_init(struct wm8994 *wm8994, int irq)
403{ 403{
404 struct wm8994_pdata *pdata = wm8994->dev->platform_data; 404 struct wm8994_pdata *pdata;
405 struct regmap_config *regmap_config; 405 struct regmap_config *regmap_config;
406 const struct reg_default *regmap_patch = NULL; 406 const struct reg_default *regmap_patch = NULL;
407 const char *devname; 407 const char *devname;
408 int ret, i, patch_regs; 408 int ret, i, patch_regs;
409 int pulls = 0; 409 int pulls = 0;
410 410
411 if (dev_get_platdata(wm8994->dev)) {
412 pdata = dev_get_platdata(wm8994->dev);
413 wm8994->pdata = *pdata;
414 }
415 pdata = &wm8994->pdata;
416
411 dev_set_drvdata(wm8994->dev, wm8994); 417 dev_set_drvdata(wm8994->dev, wm8994);
412 418
413 /* Add the on-chip regulators first for bootstrapping */ 419 /* Add the on-chip regulators first for bootstrapping */
@@ -604,24 +610,21 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
604 } 610 }
605 } 611 }
606 612
607 if (pdata) { 613 wm8994->irq_base = pdata->irq_base;
608 wm8994->irq_base = pdata->irq_base; 614 wm8994->gpio_base = pdata->gpio_base;
609 wm8994->gpio_base = pdata->gpio_base; 615
610 616 /* GPIO configuration is only applied if it's non-zero */
611 /* GPIO configuration is only applied if it's non-zero */ 617 for (i = 0; i < ARRAY_SIZE(pdata->gpio_defaults); i++) {
612 for (i = 0; i < ARRAY_SIZE(pdata->gpio_defaults); i++) { 618 if (pdata->gpio_defaults[i]) {
613 if (pdata->gpio_defaults[i]) { 619 wm8994_set_bits(wm8994, WM8994_GPIO_1 + i,
614 wm8994_set_bits(wm8994, WM8994_GPIO_1 + i, 620 0xffff, pdata->gpio_defaults[i]);
615 0xffff,
616 pdata->gpio_defaults[i]);
617 }
618 } 621 }
622 }
619 623
620 wm8994->ldo_ena_always_driven = pdata->ldo_ena_always_driven; 624 wm8994->ldo_ena_always_driven = pdata->ldo_ena_always_driven;
621 625
622 if (pdata->spkmode_pu) 626 if (pdata->spkmode_pu)
623 pulls |= WM8994_SPKMODE_PU; 627 pulls |= WM8994_SPKMODE_PU;
624 }
625 628
626 /* Disable unneeded pulls */ 629 /* Disable unneeded pulls */
627 wm8994_set_bits(wm8994, WM8994_PULL_CONTROL_2, 630 wm8994_set_bits(wm8994, WM8994_PULL_CONTROL_2,