diff options
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/Kconfig | 1 | ||||
-rw-r--r-- | drivers/mfd/ab8500-gpadc.c | 17 | ||||
-rw-r--r-- | drivers/mfd/omap-usb-host.c | 6 | ||||
-rw-r--r-- | drivers/mfd/palmas.c | 36 | ||||
-rw-r--r-- | drivers/mfd/tps65912-core.c | 1 | ||||
-rw-r--r-- | drivers/mfd/twl4030-audio.c | 2 | ||||
-rw-r--r-- | drivers/mfd/twl4030-madc.c | 2 |
7 files changed, 53 insertions, 12 deletions
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 671f5b171c73..c346941a2515 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig | |||
@@ -858,6 +858,7 @@ config EZX_PCAP | |||
858 | config AB8500_CORE | 858 | config AB8500_CORE |
859 | bool "ST-Ericsson AB8500 Mixed Signal Power Management chip" | 859 | bool "ST-Ericsson AB8500 Mixed Signal Power Management chip" |
860 | depends on GENERIC_HARDIRQS && ABX500_CORE && MFD_DB8500_PRCMU | 860 | depends on GENERIC_HARDIRQS && ABX500_CORE && MFD_DB8500_PRCMU |
861 | select POWER_SUPPLY | ||
861 | select MFD_CORE | 862 | select MFD_CORE |
862 | select IRQ_DOMAIN | 863 | select IRQ_DOMAIN |
863 | help | 864 | help |
diff --git a/drivers/mfd/ab8500-gpadc.c b/drivers/mfd/ab8500-gpadc.c index b1f3561b023f..5f341a50ee5a 100644 --- a/drivers/mfd/ab8500-gpadc.c +++ b/drivers/mfd/ab8500-gpadc.c | |||
@@ -594,9 +594,12 @@ static int ab8500_gpadc_runtime_suspend(struct device *dev) | |||
594 | static int ab8500_gpadc_runtime_resume(struct device *dev) | 594 | static int ab8500_gpadc_runtime_resume(struct device *dev) |
595 | { | 595 | { |
596 | struct ab8500_gpadc *gpadc = dev_get_drvdata(dev); | 596 | struct ab8500_gpadc *gpadc = dev_get_drvdata(dev); |
597 | int ret; | ||
597 | 598 | ||
598 | regulator_enable(gpadc->regu); | 599 | ret = regulator_enable(gpadc->regu); |
599 | return 0; | 600 | if (ret) |
601 | dev_err(dev, "Failed to enable vtvout LDO: %d\n", ret); | ||
602 | return ret; | ||
600 | } | 603 | } |
601 | 604 | ||
602 | static int ab8500_gpadc_runtime_idle(struct device *dev) | 605 | static int ab8500_gpadc_runtime_idle(struct device *dev) |
@@ -643,7 +646,7 @@ static int ab8500_gpadc_probe(struct platform_device *pdev) | |||
643 | } | 646 | } |
644 | 647 | ||
645 | /* VTVout LDO used to power up ab8500-GPADC */ | 648 | /* VTVout LDO used to power up ab8500-GPADC */ |
646 | gpadc->regu = regulator_get(&pdev->dev, "vddadc"); | 649 | gpadc->regu = devm_regulator_get(&pdev->dev, "vddadc"); |
647 | if (IS_ERR(gpadc->regu)) { | 650 | if (IS_ERR(gpadc->regu)) { |
648 | ret = PTR_ERR(gpadc->regu); | 651 | ret = PTR_ERR(gpadc->regu); |
649 | dev_err(gpadc->dev, "failed to get vtvout LDO\n"); | 652 | dev_err(gpadc->dev, "failed to get vtvout LDO\n"); |
@@ -652,7 +655,11 @@ static int ab8500_gpadc_probe(struct platform_device *pdev) | |||
652 | 655 | ||
653 | platform_set_drvdata(pdev, gpadc); | 656 | platform_set_drvdata(pdev, gpadc); |
654 | 657 | ||
655 | regulator_enable(gpadc->regu); | 658 | ret = regulator_enable(gpadc->regu); |
659 | if (ret) { | ||
660 | dev_err(gpadc->dev, "Failed to enable vtvout LDO: %d\n", ret); | ||
661 | goto fail_enable; | ||
662 | } | ||
656 | 663 | ||
657 | pm_runtime_set_autosuspend_delay(gpadc->dev, GPADC_AUDOSUSPEND_DELAY); | 664 | pm_runtime_set_autosuspend_delay(gpadc->dev, GPADC_AUDOSUSPEND_DELAY); |
658 | pm_runtime_use_autosuspend(gpadc->dev); | 665 | pm_runtime_use_autosuspend(gpadc->dev); |
@@ -663,6 +670,8 @@ static int ab8500_gpadc_probe(struct platform_device *pdev) | |||
663 | list_add_tail(&gpadc->node, &ab8500_gpadc_list); | 670 | list_add_tail(&gpadc->node, &ab8500_gpadc_list); |
664 | dev_dbg(gpadc->dev, "probe success\n"); | 671 | dev_dbg(gpadc->dev, "probe success\n"); |
665 | return 0; | 672 | return 0; |
673 | |||
674 | fail_enable: | ||
666 | fail_irq: | 675 | fail_irq: |
667 | free_irq(gpadc->irq, gpadc); | 676 | free_irq(gpadc->irq, gpadc); |
668 | fail: | 677 | fail: |
diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c index 6b5edf64de2b..4febc5c7fdee 100644 --- a/drivers/mfd/omap-usb-host.c +++ b/drivers/mfd/omap-usb-host.c | |||
@@ -460,15 +460,15 @@ static void omap_usbhs_init(struct device *dev) | |||
460 | 460 | ||
461 | switch (omap->usbhs_rev) { | 461 | switch (omap->usbhs_rev) { |
462 | case OMAP_USBHS_REV1: | 462 | case OMAP_USBHS_REV1: |
463 | omap_usbhs_rev1_hostconfig(omap, reg); | 463 | reg = omap_usbhs_rev1_hostconfig(omap, reg); |
464 | break; | 464 | break; |
465 | 465 | ||
466 | case OMAP_USBHS_REV2: | 466 | case OMAP_USBHS_REV2: |
467 | omap_usbhs_rev2_hostconfig(omap, reg); | 467 | reg = omap_usbhs_rev2_hostconfig(omap, reg); |
468 | break; | 468 | break; |
469 | 469 | ||
470 | default: /* newer revisions */ | 470 | default: /* newer revisions */ |
471 | omap_usbhs_rev2_hostconfig(omap, reg); | 471 | reg = omap_usbhs_rev2_hostconfig(omap, reg); |
472 | break; | 472 | break; |
473 | } | 473 | } |
474 | 474 | ||
diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c index bbdbc50a3cca..73bf76df1044 100644 --- a/drivers/mfd/palmas.c +++ b/drivers/mfd/palmas.c | |||
@@ -257,9 +257,24 @@ static struct regmap_irq_chip palmas_irq_chip = { | |||
257 | PALMAS_INT1_MASK), | 257 | PALMAS_INT1_MASK), |
258 | }; | 258 | }; |
259 | 259 | ||
260 | static void palmas_dt_to_pdata(struct device_node *node, | 260 | static int palmas_set_pdata_irq_flag(struct i2c_client *i2c, |
261 | struct palmas_platform_data *pdata) | 261 | struct palmas_platform_data *pdata) |
262 | { | 262 | { |
263 | struct irq_data *irq_data = irq_get_irq_data(i2c->irq); | ||
264 | if (!irq_data) { | ||
265 | dev_err(&i2c->dev, "Invalid IRQ: %d\n", i2c->irq); | ||
266 | return -EINVAL; | ||
267 | } | ||
268 | |||
269 | pdata->irq_flags = irqd_get_trigger_type(irq_data); | ||
270 | dev_info(&i2c->dev, "Irq flag is 0x%08x\n", pdata->irq_flags); | ||
271 | return 0; | ||
272 | } | ||
273 | |||
274 | static void palmas_dt_to_pdata(struct i2c_client *i2c, | ||
275 | struct palmas_platform_data *pdata) | ||
276 | { | ||
277 | struct device_node *node = i2c->dev.of_node; | ||
263 | int ret; | 278 | int ret; |
264 | u32 prop; | 279 | u32 prop; |
265 | 280 | ||
@@ -283,6 +298,8 @@ static void palmas_dt_to_pdata(struct device_node *node, | |||
283 | pdata->power_ctrl = PALMAS_POWER_CTRL_NSLEEP_MASK | | 298 | pdata->power_ctrl = PALMAS_POWER_CTRL_NSLEEP_MASK | |
284 | PALMAS_POWER_CTRL_ENABLE1_MASK | | 299 | PALMAS_POWER_CTRL_ENABLE1_MASK | |
285 | PALMAS_POWER_CTRL_ENABLE2_MASK; | 300 | PALMAS_POWER_CTRL_ENABLE2_MASK; |
301 | if (i2c->irq) | ||
302 | palmas_set_pdata_irq_flag(i2c, pdata); | ||
286 | } | 303 | } |
287 | 304 | ||
288 | static int palmas_i2c_probe(struct i2c_client *i2c, | 305 | static int palmas_i2c_probe(struct i2c_client *i2c, |
@@ -304,7 +321,7 @@ static int palmas_i2c_probe(struct i2c_client *i2c, | |||
304 | if (!pdata) | 321 | if (!pdata) |
305 | return -ENOMEM; | 322 | return -ENOMEM; |
306 | 323 | ||
307 | palmas_dt_to_pdata(node, pdata); | 324 | palmas_dt_to_pdata(i2c, pdata); |
308 | } | 325 | } |
309 | 326 | ||
310 | if (!pdata) | 327 | if (!pdata) |
@@ -344,6 +361,19 @@ static int palmas_i2c_probe(struct i2c_client *i2c, | |||
344 | } | 361 | } |
345 | } | 362 | } |
346 | 363 | ||
364 | /* Change interrupt line output polarity */ | ||
365 | if (pdata->irq_flags & IRQ_TYPE_LEVEL_HIGH) | ||
366 | reg = PALMAS_POLARITY_CTRL_INT_POLARITY; | ||
367 | else | ||
368 | reg = 0; | ||
369 | ret = palmas_update_bits(palmas, PALMAS_PU_PD_OD_BASE, | ||
370 | PALMAS_POLARITY_CTRL, PALMAS_POLARITY_CTRL_INT_POLARITY, | ||
371 | reg); | ||
372 | if (ret < 0) { | ||
373 | dev_err(palmas->dev, "POLARITY_CTRL updat failed: %d\n", ret); | ||
374 | goto err; | ||
375 | } | ||
376 | |||
347 | /* Change IRQ into clear on read mode for efficiency */ | 377 | /* Change IRQ into clear on read mode for efficiency */ |
348 | slave = PALMAS_BASE_TO_SLAVE(PALMAS_INTERRUPT_BASE); | 378 | slave = PALMAS_BASE_TO_SLAVE(PALMAS_INTERRUPT_BASE); |
349 | addr = PALMAS_BASE_TO_REG(PALMAS_INTERRUPT_BASE, PALMAS_INT_CTRL); | 379 | addr = PALMAS_BASE_TO_REG(PALMAS_INTERRUPT_BASE, PALMAS_INT_CTRL); |
@@ -352,7 +382,7 @@ static int palmas_i2c_probe(struct i2c_client *i2c, | |||
352 | regmap_write(palmas->regmap[slave], addr, reg); | 382 | regmap_write(palmas->regmap[slave], addr, reg); |
353 | 383 | ||
354 | ret = regmap_add_irq_chip(palmas->regmap[slave], palmas->irq, | 384 | ret = regmap_add_irq_chip(palmas->regmap[slave], palmas->irq, |
355 | IRQF_ONESHOT | IRQF_TRIGGER_LOW, 0, &palmas_irq_chip, | 385 | IRQF_ONESHOT | pdata->irq_flags, 0, &palmas_irq_chip, |
356 | &palmas->irq_data); | 386 | &palmas->irq_data); |
357 | if (ret < 0) | 387 | if (ret < 0) |
358 | goto err; | 388 | goto err; |
diff --git a/drivers/mfd/tps65912-core.c b/drivers/mfd/tps65912-core.c index 4658b5bdcd84..aeb8e40ab424 100644 --- a/drivers/mfd/tps65912-core.c +++ b/drivers/mfd/tps65912-core.c | |||
@@ -169,6 +169,7 @@ err: | |||
169 | void tps65912_device_exit(struct tps65912 *tps65912) | 169 | void tps65912_device_exit(struct tps65912 *tps65912) |
170 | { | 170 | { |
171 | mfd_remove_devices(tps65912->dev); | 171 | mfd_remove_devices(tps65912->dev); |
172 | tps65912_irq_exit(tps65912); | ||
172 | kfree(tps65912); | 173 | kfree(tps65912); |
173 | } | 174 | } |
174 | 175 | ||
diff --git a/drivers/mfd/twl4030-audio.c b/drivers/mfd/twl4030-audio.c index e16edca92670..d2ab222138c2 100644 --- a/drivers/mfd/twl4030-audio.c +++ b/drivers/mfd/twl4030-audio.c | |||
@@ -118,7 +118,7 @@ EXPORT_SYMBOL_GPL(twl4030_audio_enable_resource); | |||
118 | * Disable the resource. | 118 | * Disable the resource. |
119 | * The function returns with error or the content of the register | 119 | * The function returns with error or the content of the register |
120 | */ | 120 | */ |
121 | int twl4030_audio_disable_resource(unsigned id) | 121 | int twl4030_audio_disable_resource(enum twl4030_audio_res id) |
122 | { | 122 | { |
123 | struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev); | 123 | struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev); |
124 | int val; | 124 | int val; |
diff --git a/drivers/mfd/twl4030-madc.c b/drivers/mfd/twl4030-madc.c index 88ff9dc83305..942b666a2a07 100644 --- a/drivers/mfd/twl4030-madc.c +++ b/drivers/mfd/twl4030-madc.c | |||
@@ -800,7 +800,7 @@ static int twl4030_madc_remove(struct platform_device *pdev) | |||
800 | 800 | ||
801 | static struct platform_driver twl4030_madc_driver = { | 801 | static struct platform_driver twl4030_madc_driver = { |
802 | .probe = twl4030_madc_probe, | 802 | .probe = twl4030_madc_probe, |
803 | .remove = __exit_p(twl4030_madc_remove), | 803 | .remove = twl4030_madc_remove, |
804 | .driver = { | 804 | .driver = { |
805 | .name = "twl4030_madc", | 805 | .name = "twl4030_madc", |
806 | .owner = THIS_MODULE, | 806 | .owner = THIS_MODULE, |