aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-05-25 10:31:46 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-05-25 10:31:46 -0400
commit71cbb77289da87e7c9625eb0788d4347eb3e732c (patch)
treeda62aa46dc7032aad113db65b93bb19a9580d55b
parentd217f9055631fb910f4f2e09ccf6446d93ff6533 (diff)
parente5657054ff508c9e547a8ceb931de07838ee3ba0 (diff)
Merge tag 'mfd-arizona-v3.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc into asoc-arizona
mfd: arizona: Updates for v3.10 A bunch of enhancements and fixes for the arizona devices, adding a few new features (the main one being device tree) and improving robustness.
-rw-r--r--Documentation/devicetree/bindings/mfd/arizona.txt62
-rw-r--r--drivers/mfd/arizona-core.c234
-rw-r--r--drivers/mfd/arizona-i2c.c10
-rw-r--r--drivers/mfd/arizona-spi.c10
-rw-r--r--drivers/mfd/arizona.h12
-rw-r--r--drivers/mfd/wm5110-tables.c8
-rw-r--r--include/linux/mfd/arizona/core.h2
-rw-r--r--include/linux/mfd/arizona/pdata.h2
-rw-r--r--include/linux/mfd/arizona/registers.h3
9 files changed, 305 insertions, 38 deletions
diff --git a/Documentation/devicetree/bindings/mfd/arizona.txt b/Documentation/devicetree/bindings/mfd/arizona.txt
new file mode 100644
index 000000000000..0e295c9d8937
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/arizona.txt
@@ -0,0 +1,62 @@
1Wolfson Arizona class audio SoCs
2
3These devices are audio SoCs with extensive digital capabilites and a range
4of analogue I/O.
5
6Required properties:
7
8 - compatible : one of the following chip-specific strings:
9 "wlf,wm5102"
10 "wlf,wm5110"
11 - reg : I2C slave address when connected using I2C, chip select number when
12 using SPI.
13
14 - interrupts : The interrupt line the /IRQ signal for the device is
15 connected to.
16 - interrupt-controller : Arizona class devices contain interrupt controllers
17 and may provide interrupt services to other devices.
18 - interrupt-parent : The parent interrupt controller.
19 - #interrupt-cells: the number of cells to describe an IRQ, this should be 2.
20 The first cell is the IRQ number.
21 The second cell is the flags, encoded as the trigger masks from
22 Documentation/devicetree/bindings/interrupts.txt
23
24 - gpio-controller : Indicates this device is a GPIO controller.
25 - #gpio-cells : Must be 2. The first cell is the pin number and the
26 second cell is used to specify optional parameters (currently unused).
27
28 - AVDD1-supply, DBVDD1-supply, DBVDD2-supply, DBVDD3-supply, CPVDD-supply,
29 SPKVDDL-supply, SPKVDDR-supply : power supplies for the device, as covered
30 in Documentation/devicetree/bindings/regulator/regulator.txt
31
32Optional properties:
33
34 - wlf,reset : GPIO specifier for the GPIO controlling /RESET
35 - wlf,ldoena : GPIO specifier for the GPIO controlling LDOENA
36
37 - wlf,gpio-defaults : A list of GPIO configuration register values. If
38 absent, no configuration of these registers is performed. If any
39 entry has a value that is out of range for a 16 bit register then
40 the chip default will be used. If present exactly five values must
41 be specified.
42
43Example:
44
45codec: wm5102@1a {
46 compatible = "wlf,wm5102";
47 reg = <0x1a>;
48 interrupts = <347>;
49 #interrupt-cells = <2>;
50 interrupt-parent = <&gic>;
51
52 gpio-controller;
53 #gpio-cells = <2>;
54
55 wlf,gpio-defaults = <
56 0x00000000, /* AIF1TXLRCLK */
57 0xffffffff,
58 0xffffffff,
59 0xffffffff,
60 0xffffffff,
61 >;
62};
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index 6ab03043fd60..74b4481754fd 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -16,9 +16,13 @@
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/mfd/core.h> 17#include <linux/mfd/core.h>
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/of.h>
20#include <linux/of_device.h>
21#include <linux/of_gpio.h>
19#include <linux/pm_runtime.h> 22#include <linux/pm_runtime.h>
20#include <linux/regmap.h> 23#include <linux/regmap.h>
21#include <linux/regulator/consumer.h> 24#include <linux/regulator/consumer.h>
25#include <linux/regulator/machine.h>
22#include <linux/slab.h> 26#include <linux/slab.h>
23 27
24#include <linux/mfd/arizona/core.h> 28#include <linux/mfd/arizona/core.h>
@@ -344,6 +348,17 @@ static int arizona_runtime_resume(struct device *dev)
344 348
345 switch (arizona->type) { 349 switch (arizona->type) {
346 case WM5102: 350 case WM5102:
351 if (arizona->external_dcvdd) {
352 ret = regmap_update_bits(arizona->regmap,
353 ARIZONA_ISOLATION_CONTROL,
354 ARIZONA_ISOLATE_DCVDD1, 0);
355 if (ret != 0) {
356 dev_err(arizona->dev,
357 "Failed to connect DCVDD: %d\n", ret);
358 goto err;
359 }
360 }
361
347 ret = wm5102_patch(arizona); 362 ret = wm5102_patch(arizona);
348 if (ret != 0) { 363 if (ret != 0) {
349 dev_err(arizona->dev, "Failed to apply patch: %d\n", 364 dev_err(arizona->dev, "Failed to apply patch: %d\n",
@@ -365,6 +380,28 @@ static int arizona_runtime_resume(struct device *dev)
365 goto err; 380 goto err;
366 } 381 }
367 382
383 if (arizona->external_dcvdd) {
384 ret = regmap_update_bits(arizona->regmap,
385 ARIZONA_ISOLATION_CONTROL,
386 ARIZONA_ISOLATE_DCVDD1, 0);
387 if (ret != 0) {
388 dev_err(arizona->dev,
389 "Failed to connect DCVDD: %d\n", ret);
390 goto err;
391 }
392 }
393 break;
394 }
395
396 switch (arizona->type) {
397 case WM5102:
398 ret = wm5102_patch(arizona);
399 if (ret != 0) {
400 dev_err(arizona->dev, "Failed to apply patch: %d\n",
401 ret);
402 goto err;
403 }
404 default:
368 break; 405 break;
369 } 406 }
370 407
@@ -385,9 +422,22 @@ err:
385static int arizona_runtime_suspend(struct device *dev) 422static int arizona_runtime_suspend(struct device *dev)
386{ 423{
387 struct arizona *arizona = dev_get_drvdata(dev); 424 struct arizona *arizona = dev_get_drvdata(dev);
425 int ret;
388 426
389 dev_dbg(arizona->dev, "Entering AoD mode\n"); 427 dev_dbg(arizona->dev, "Entering AoD mode\n");
390 428
429 if (arizona->external_dcvdd) {
430 ret = regmap_update_bits(arizona->regmap,
431 ARIZONA_ISOLATION_CONTROL,
432 ARIZONA_ISOLATE_DCVDD1,
433 ARIZONA_ISOLATE_DCVDD1);
434 if (ret != 0) {
435 dev_err(arizona->dev, "Failed to isolate DCVDD: %d\n",
436 ret);
437 return ret;
438 }
439 }
440
391 regulator_disable(arizona->dcvdd); 441 regulator_disable(arizona->dcvdd);
392 regcache_cache_only(arizona->regmap, true); 442 regcache_cache_only(arizona->regmap, true);
393 regcache_mark_dirty(arizona->regmap); 443 regcache_mark_dirty(arizona->regmap);
@@ -397,6 +447,26 @@ static int arizona_runtime_suspend(struct device *dev)
397#endif 447#endif
398 448
399#ifdef CONFIG_PM_SLEEP 449#ifdef CONFIG_PM_SLEEP
450static int arizona_suspend(struct device *dev)
451{
452 struct arizona *arizona = dev_get_drvdata(dev);
453
454 dev_dbg(arizona->dev, "Suspend, disabling IRQ\n");
455 disable_irq(arizona->irq);
456
457 return 0;
458}
459
460static int arizona_suspend_late(struct device *dev)
461{
462 struct arizona *arizona = dev_get_drvdata(dev);
463
464 dev_dbg(arizona->dev, "Late suspend, reenabling IRQ\n");
465 enable_irq(arizona->irq);
466
467 return 0;
468}
469
400static int arizona_resume_noirq(struct device *dev) 470static int arizona_resume_noirq(struct device *dev)
401{ 471{
402 struct arizona *arizona = dev_get_drvdata(dev); 472 struct arizona *arizona = dev_get_drvdata(dev);
@@ -422,13 +492,78 @@ const struct dev_pm_ops arizona_pm_ops = {
422 SET_RUNTIME_PM_OPS(arizona_runtime_suspend, 492 SET_RUNTIME_PM_OPS(arizona_runtime_suspend,
423 arizona_runtime_resume, 493 arizona_runtime_resume,
424 NULL) 494 NULL)
425 SET_SYSTEM_SLEEP_PM_OPS(NULL, arizona_resume) 495 SET_SYSTEM_SLEEP_PM_OPS(arizona_suspend, arizona_resume)
426#ifdef CONFIG_PM_SLEEP 496#ifdef CONFIG_PM_SLEEP
497 .suspend_late = arizona_suspend_late,
427 .resume_noirq = arizona_resume_noirq, 498 .resume_noirq = arizona_resume_noirq,
428#endif 499#endif
429}; 500};
430EXPORT_SYMBOL_GPL(arizona_pm_ops); 501EXPORT_SYMBOL_GPL(arizona_pm_ops);
431 502
503#ifdef CONFIG_OF
504int arizona_of_get_type(struct device *dev)
505{
506 const struct of_device_id *id = of_match_device(arizona_of_match, dev);
507
508 if (id)
509 return (int)id->data;
510 else
511 return 0;
512}
513EXPORT_SYMBOL_GPL(arizona_of_get_type);
514
515static int arizona_of_get_core_pdata(struct arizona *arizona)
516{
517 int ret, i;
518
519 arizona->pdata.reset = of_get_named_gpio(arizona->dev->of_node,
520 "wlf,reset", 0);
521 if (arizona->pdata.reset < 0)
522 arizona->pdata.reset = 0;
523
524 arizona->pdata.ldoena = of_get_named_gpio(arizona->dev->of_node,
525 "wlf,ldoena", 0);
526 if (arizona->pdata.ldoena < 0)
527 arizona->pdata.ldoena = 0;
528
529 ret = of_property_read_u32_array(arizona->dev->of_node,
530 "wlf,gpio-defaults",
531 arizona->pdata.gpio_defaults,
532 ARRAY_SIZE(arizona->pdata.gpio_defaults));
533 if (ret >= 0) {
534 /*
535 * All values are literal except out of range values
536 * which are chip default, translate into platform
537 * data which uses 0 as chip default and out of range
538 * as zero.
539 */
540 for (i = 0; i < ARRAY_SIZE(arizona->pdata.gpio_defaults); i++) {
541 if (arizona->pdata.gpio_defaults[i] > 0xffff)
542 arizona->pdata.gpio_defaults[i] = 0;
543 if (arizona->pdata.gpio_defaults[i] == 0)
544 arizona->pdata.gpio_defaults[i] = 0x10000;
545 }
546 } else {
547 dev_err(arizona->dev, "Failed to parse GPIO defaults: %d\n",
548 ret);
549 }
550
551 return 0;
552}
553
554const struct of_device_id arizona_of_match[] = {
555 { .compatible = "wlf,wm5102", .data = (void *)WM5102 },
556 { .compatible = "wlf,wm5110", .data = (void *)WM5110 },
557 {},
558};
559EXPORT_SYMBOL_GPL(arizona_of_match);
560#else
561static inline int arizona_of_get_core_pdata(struct arizona *arizona)
562{
563 return 0;
564}
565#endif
566
432static struct mfd_cell early_devs[] = { 567static struct mfd_cell early_devs[] = {
433 { .name = "arizona-ldo1" }, 568 { .name = "arizona-ldo1" },
434}; 569};
@@ -462,6 +597,8 @@ int arizona_dev_init(struct arizona *arizona)
462 dev_set_drvdata(arizona->dev, arizona); 597 dev_set_drvdata(arizona->dev, arizona);
463 mutex_init(&arizona->clk_lock); 598 mutex_init(&arizona->clk_lock);
464 599
600 arizona_of_get_core_pdata(arizona);
601
465 if (dev_get_platdata(arizona->dev)) 602 if (dev_get_platdata(arizona->dev))
466 memcpy(&arizona->pdata, dev_get_platdata(arizona->dev), 603 memcpy(&arizona->pdata, dev_get_platdata(arizona->dev),
467 sizeof(arizona->pdata)); 604 sizeof(arizona->pdata));
@@ -536,51 +673,22 @@ int arizona_dev_init(struct arizona *arizona)
536 673
537 regcache_cache_only(arizona->regmap, false); 674 regcache_cache_only(arizona->regmap, false);
538 675
676 /* Verify that this is a chip we know about */
539 ret = regmap_read(arizona->regmap, ARIZONA_SOFTWARE_RESET, &reg); 677 ret = regmap_read(arizona->regmap, ARIZONA_SOFTWARE_RESET, &reg);
540 if (ret != 0) { 678 if (ret != 0) {
541 dev_err(dev, "Failed to read ID register: %d\n", ret); 679 dev_err(dev, "Failed to read ID register: %d\n", ret);
542 goto err_reset; 680 goto err_reset;
543 } 681 }
544 682
545 ret = regmap_read(arizona->regmap, ARIZONA_DEVICE_REVISION,
546 &arizona->rev);
547 if (ret != 0) {
548 dev_err(dev, "Failed to read revision register: %d\n", ret);
549 goto err_reset;
550 }
551 arizona->rev &= ARIZONA_DEVICE_REVISION_MASK;
552
553 switch (reg) { 683 switch (reg) {
554#ifdef CONFIG_MFD_WM5102
555 case 0x5102: 684 case 0x5102:
556 type_name = "WM5102";
557 if (arizona->type != WM5102) {
558 dev_err(arizona->dev, "WM5102 registered as %d\n",
559 arizona->type);
560 arizona->type = WM5102;
561 }
562 apply_patch = wm5102_patch;
563 arizona->rev &= 0x7;
564 break;
565#endif
566#ifdef CONFIG_MFD_WM5110
567 case 0x5110: 685 case 0x5110:
568 type_name = "WM5110";
569 if (arizona->type != WM5110) {
570 dev_err(arizona->dev, "WM5110 registered as %d\n",
571 arizona->type);
572 arizona->type = WM5110;
573 }
574 apply_patch = wm5110_patch;
575 break; 686 break;
576#endif
577 default: 687 default:
578 dev_err(arizona->dev, "Unknown device ID %x\n", reg); 688 dev_err(arizona->dev, "Unknown device ID: %x\n", reg);
579 goto err_reset; 689 goto err_reset;
580 } 690 }
581 691
582 dev_info(dev, "%s revision %c\n", type_name, arizona->rev + 'A');
583
584 /* If we have a /RESET GPIO we'll already be reset */ 692 /* If we have a /RESET GPIO we'll already be reset */
585 if (!arizona->pdata.reset) { 693 if (!arizona->pdata.reset) {
586 regcache_mark_dirty(arizona->regmap); 694 regcache_mark_dirty(arizona->regmap);
@@ -600,6 +708,7 @@ int arizona_dev_init(struct arizona *arizona)
600 } 708 }
601 } 709 }
602 710
711 /* Ensure device startup is complete */
603 switch (arizona->type) { 712 switch (arizona->type) {
604 case WM5102: 713 case WM5102:
605 ret = regmap_read(arizona->regmap, 0x19, &val); 714 ret = regmap_read(arizona->regmap, 0x19, &val);
@@ -620,6 +729,52 @@ int arizona_dev_init(struct arizona *arizona)
620 break; 729 break;
621 } 730 }
622 731
732 /* Read the device ID information & do device specific stuff */
733 ret = regmap_read(arizona->regmap, ARIZONA_SOFTWARE_RESET, &reg);
734 if (ret != 0) {
735 dev_err(dev, "Failed to read ID register: %d\n", ret);
736 goto err_reset;
737 }
738
739 ret = regmap_read(arizona->regmap, ARIZONA_DEVICE_REVISION,
740 &arizona->rev);
741 if (ret != 0) {
742 dev_err(dev, "Failed to read revision register: %d\n", ret);
743 goto err_reset;
744 }
745 arizona->rev &= ARIZONA_DEVICE_REVISION_MASK;
746
747 switch (reg) {
748#ifdef CONFIG_MFD_WM5102
749 case 0x5102:
750 type_name = "WM5102";
751 if (arizona->type != WM5102) {
752 dev_err(arizona->dev, "WM5102 registered as %d\n",
753 arizona->type);
754 arizona->type = WM5102;
755 }
756 apply_patch = wm5102_patch;
757 arizona->rev &= 0x7;
758 break;
759#endif
760#ifdef CONFIG_MFD_WM5110
761 case 0x5110:
762 type_name = "WM5110";
763 if (arizona->type != WM5110) {
764 dev_err(arizona->dev, "WM5110 registered as %d\n",
765 arizona->type);
766 arizona->type = WM5110;
767 }
768 apply_patch = wm5110_patch;
769 break;
770#endif
771 default:
772 dev_err(arizona->dev, "Unknown device ID %x\n", reg);
773 goto err_reset;
774 }
775
776 dev_info(dev, "%s revision %c\n", type_name, arizona->rev + 'A');
777
623 if (apply_patch) { 778 if (apply_patch) {
624 ret = apply_patch(arizona); 779 ret = apply_patch(arizona);
625 if (ret != 0) { 780 if (ret != 0) {
@@ -651,6 +806,14 @@ int arizona_dev_init(struct arizona *arizona)
651 arizona->pdata.gpio_defaults[i]); 806 arizona->pdata.gpio_defaults[i]);
652 } 807 }
653 808
809 /*
810 * LDO1 can only be used to supply DCVDD so if it has no
811 * consumers then DCVDD is supplied externally.
812 */
813 if (arizona->pdata.ldo1 &&
814 arizona->pdata.ldo1->num_consumer_supplies == 0)
815 arizona->external_dcvdd = true;
816
654 pm_runtime_set_autosuspend_delay(arizona->dev, 100); 817 pm_runtime_set_autosuspend_delay(arizona->dev, 100);
655 pm_runtime_use_autosuspend(arizona->dev); 818 pm_runtime_use_autosuspend(arizona->dev);
656 pm_runtime_enable(arizona->dev); 819 pm_runtime_enable(arizona->dev);
@@ -697,7 +860,7 @@ int arizona_dev_init(struct arizona *arizona)
697 if (arizona->pdata.micbias[i].discharge) 860 if (arizona->pdata.micbias[i].discharge)
698 val |= ARIZONA_MICB1_DISCH; 861 val |= ARIZONA_MICB1_DISCH;
699 862
700 if (arizona->pdata.micbias[i].fast_start) 863 if (arizona->pdata.micbias[i].soft_start)
701 val |= ARIZONA_MICB1_RATE; 864 val |= ARIZONA_MICB1_RATE;
702 865
703 if (arizona->pdata.micbias[i].bypass) 866 if (arizona->pdata.micbias[i].bypass)
@@ -809,6 +972,11 @@ int arizona_dev_exit(struct arizona *arizona)
809 arizona_free_irq(arizona, ARIZONA_IRQ_CLKGEN_ERR, arizona); 972 arizona_free_irq(arizona, ARIZONA_IRQ_CLKGEN_ERR, arizona);
810 pm_runtime_disable(arizona->dev); 973 pm_runtime_disable(arizona->dev);
811 arizona_irq_exit(arizona); 974 arizona_irq_exit(arizona);
975 if (arizona->pdata.reset)
976 gpio_set_value_cansleep(arizona->pdata.reset, 0);
977 regulator_disable(arizona->dcvdd);
978 regulator_bulk_disable(ARRAY_SIZE(arizona->core_supplies),
979 arizona->core_supplies);
812 return 0; 980 return 0;
813} 981}
814EXPORT_SYMBOL_GPL(arizona_dev_exit); 982EXPORT_SYMBOL_GPL(arizona_dev_exit);
diff --git a/drivers/mfd/arizona-i2c.c b/drivers/mfd/arizona-i2c.c
index 44a1bb969841..deb267ebf84e 100644
--- a/drivers/mfd/arizona-i2c.c
+++ b/drivers/mfd/arizona-i2c.c
@@ -27,9 +27,14 @@ static int arizona_i2c_probe(struct i2c_client *i2c,
27{ 27{
28 struct arizona *arizona; 28 struct arizona *arizona;
29 const struct regmap_config *regmap_config; 29 const struct regmap_config *regmap_config;
30 int ret; 30 int ret, type;
31 31
32 switch (id->driver_data) { 32 if (i2c->dev.of_node)
33 type = arizona_of_get_type(&i2c->dev);
34 else
35 type = id->driver_data;
36
37 switch (type) {
33#ifdef CONFIG_MFD_WM5102 38#ifdef CONFIG_MFD_WM5102
34 case WM5102: 39 case WM5102:
35 regmap_config = &wm5102_i2c_regmap; 40 regmap_config = &wm5102_i2c_regmap;
@@ -84,6 +89,7 @@ static struct i2c_driver arizona_i2c_driver = {
84 .name = "arizona", 89 .name = "arizona",
85 .owner = THIS_MODULE, 90 .owner = THIS_MODULE,
86 .pm = &arizona_pm_ops, 91 .pm = &arizona_pm_ops,
92 .of_match_table = of_match_ptr(arizona_of_match),
87 }, 93 },
88 .probe = arizona_i2c_probe, 94 .probe = arizona_i2c_probe,
89 .remove = arizona_i2c_remove, 95 .remove = arizona_i2c_remove,
diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c
index b57e642d2b4a..47be7b35b5c5 100644
--- a/drivers/mfd/arizona-spi.c
+++ b/drivers/mfd/arizona-spi.c
@@ -27,9 +27,14 @@ static int arizona_spi_probe(struct spi_device *spi)
27 const struct spi_device_id *id = spi_get_device_id(spi); 27 const struct spi_device_id *id = spi_get_device_id(spi);
28 struct arizona *arizona; 28 struct arizona *arizona;
29 const struct regmap_config *regmap_config; 29 const struct regmap_config *regmap_config;
30 int ret; 30 int ret, type;
31 31
32 switch (id->driver_data) { 32 if (spi->dev.of_node)
33 type = arizona_of_get_type(&spi->dev);
34 else
35 type = id->driver_data;
36
37 switch (type) {
33#ifdef CONFIG_MFD_WM5102 38#ifdef CONFIG_MFD_WM5102
34 case WM5102: 39 case WM5102:
35 regmap_config = &wm5102_spi_regmap; 40 regmap_config = &wm5102_spi_regmap;
@@ -84,6 +89,7 @@ static struct spi_driver arizona_spi_driver = {
84 .name = "arizona", 89 .name = "arizona",
85 .owner = THIS_MODULE, 90 .owner = THIS_MODULE,
86 .pm = &arizona_pm_ops, 91 .pm = &arizona_pm_ops,
92 .of_match_table = of_match_ptr(arizona_of_match),
87 }, 93 },
88 .probe = arizona_spi_probe, 94 .probe = arizona_spi_probe,
89 .remove = arizona_spi_remove, 95 .remove = arizona_spi_remove,
diff --git a/drivers/mfd/arizona.h b/drivers/mfd/arizona.h
index 9798ae5da67b..db55d9854a55 100644
--- a/drivers/mfd/arizona.h
+++ b/drivers/mfd/arizona.h
@@ -13,6 +13,7 @@
13#ifndef _WM5102_H 13#ifndef _WM5102_H
14#define _WM5102_H 14#define _WM5102_H
15 15
16#include <linux/of.h>
16#include <linux/regmap.h> 17#include <linux/regmap.h>
17#include <linux/pm.h> 18#include <linux/pm.h>
18 19
@@ -26,6 +27,8 @@ extern const struct regmap_config wm5110_spi_regmap;
26 27
27extern const struct dev_pm_ops arizona_pm_ops; 28extern const struct dev_pm_ops arizona_pm_ops;
28 29
30extern const struct of_device_id arizona_of_match[];
31
29extern const struct regmap_irq_chip wm5102_aod; 32extern const struct regmap_irq_chip wm5102_aod;
30extern const struct regmap_irq_chip wm5102_irq; 33extern const struct regmap_irq_chip wm5102_irq;
31 34
@@ -37,4 +40,13 @@ int arizona_dev_exit(struct arizona *arizona);
37int arizona_irq_init(struct arizona *arizona); 40int arizona_irq_init(struct arizona *arizona);
38int arizona_irq_exit(struct arizona *arizona); 41int arizona_irq_exit(struct arizona *arizona);
39 42
43#ifdef CONFIG_OF
44int arizona_of_get_type(struct device *dev);
45#else
46static inline int arizona_of_get_type(struct device *dev)
47{
48 return 0;
49}
50#endif
51
40#endif 52#endif
diff --git a/drivers/mfd/wm5110-tables.c b/drivers/mfd/wm5110-tables.c
index c41599815299..2a7972349159 100644
--- a/drivers/mfd/wm5110-tables.c
+++ b/drivers/mfd/wm5110-tables.c
@@ -2273,18 +2273,22 @@ static bool wm5110_readable_register(struct device *dev, unsigned int reg)
2273 case ARIZONA_DSP1_CLOCKING_1: 2273 case ARIZONA_DSP1_CLOCKING_1:
2274 case ARIZONA_DSP1_STATUS_1: 2274 case ARIZONA_DSP1_STATUS_1:
2275 case ARIZONA_DSP1_STATUS_2: 2275 case ARIZONA_DSP1_STATUS_2:
2276 case ARIZONA_DSP1_STATUS_3:
2276 case ARIZONA_DSP2_CONTROL_1: 2277 case ARIZONA_DSP2_CONTROL_1:
2277 case ARIZONA_DSP2_CLOCKING_1: 2278 case ARIZONA_DSP2_CLOCKING_1:
2278 case ARIZONA_DSP2_STATUS_1: 2279 case ARIZONA_DSP2_STATUS_1:
2279 case ARIZONA_DSP2_STATUS_2: 2280 case ARIZONA_DSP2_STATUS_2:
2281 case ARIZONA_DSP2_STATUS_3:
2280 case ARIZONA_DSP3_CONTROL_1: 2282 case ARIZONA_DSP3_CONTROL_1:
2281 case ARIZONA_DSP3_CLOCKING_1: 2283 case ARIZONA_DSP3_CLOCKING_1:
2282 case ARIZONA_DSP3_STATUS_1: 2284 case ARIZONA_DSP3_STATUS_1:
2283 case ARIZONA_DSP3_STATUS_2: 2285 case ARIZONA_DSP3_STATUS_2:
2286 case ARIZONA_DSP3_STATUS_3:
2284 case ARIZONA_DSP4_CONTROL_1: 2287 case ARIZONA_DSP4_CONTROL_1:
2285 case ARIZONA_DSP4_CLOCKING_1: 2288 case ARIZONA_DSP4_CLOCKING_1:
2286 case ARIZONA_DSP4_STATUS_1: 2289 case ARIZONA_DSP4_STATUS_1:
2287 case ARIZONA_DSP4_STATUS_2: 2290 case ARIZONA_DSP4_STATUS_2:
2291 case ARIZONA_DSP4_STATUS_3:
2288 return true; 2292 return true;
2289 default: 2293 default:
2290 return false; 2294 return false;
@@ -2334,12 +2338,16 @@ static bool wm5110_volatile_register(struct device *dev, unsigned int reg)
2334 case ARIZONA_DSP1_CLOCKING_1: 2338 case ARIZONA_DSP1_CLOCKING_1:
2335 case ARIZONA_DSP1_STATUS_1: 2339 case ARIZONA_DSP1_STATUS_1:
2336 case ARIZONA_DSP1_STATUS_2: 2340 case ARIZONA_DSP1_STATUS_2:
2341 case ARIZONA_DSP1_STATUS_3:
2337 case ARIZONA_DSP2_STATUS_1: 2342 case ARIZONA_DSP2_STATUS_1:
2338 case ARIZONA_DSP2_STATUS_2: 2343 case ARIZONA_DSP2_STATUS_2:
2344 case ARIZONA_DSP2_STATUS_3:
2339 case ARIZONA_DSP3_STATUS_1: 2345 case ARIZONA_DSP3_STATUS_1:
2340 case ARIZONA_DSP3_STATUS_2: 2346 case ARIZONA_DSP3_STATUS_2:
2347 case ARIZONA_DSP3_STATUS_3:
2341 case ARIZONA_DSP4_STATUS_1: 2348 case ARIZONA_DSP4_STATUS_1:
2342 case ARIZONA_DSP4_STATUS_2: 2349 case ARIZONA_DSP4_STATUS_2:
2350 case ARIZONA_DSP4_STATUS_3:
2343 return true; 2351 return true;
2344 default: 2352 default:
2345 return false; 2353 return false;
diff --git a/include/linux/mfd/arizona/core.h b/include/linux/mfd/arizona/core.h
index cc281368dc55..f797bb9b8b56 100644
--- a/include/linux/mfd/arizona/core.h
+++ b/include/linux/mfd/arizona/core.h
@@ -95,6 +95,8 @@ struct arizona {
95 95
96 struct arizona_pdata pdata; 96 struct arizona_pdata pdata;
97 97
98 unsigned int external_dcvdd:1;
99
98 int irq; 100 int irq;
99 struct irq_domain *virq; 101 struct irq_domain *virq;
100 struct regmap_irq_chip_data *aod_irq_chip; 102 struct regmap_irq_chip_data *aod_irq_chip;
diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h
index 80dead1f7100..12a5c135c746 100644
--- a/include/linux/mfd/arizona/pdata.h
+++ b/include/linux/mfd/arizona/pdata.h
@@ -77,7 +77,7 @@ struct arizona_micbias {
77 int mV; /** Regulated voltage */ 77 int mV; /** Regulated voltage */
78 unsigned int ext_cap:1; /** External capacitor fitted */ 78 unsigned int ext_cap:1; /** External capacitor fitted */
79 unsigned int discharge:1; /** Actively discharge */ 79 unsigned int discharge:1; /** Actively discharge */
80 unsigned int fast_start:1; /** Enable aggressive startup ramp rate */ 80 unsigned int soft_start:1; /** Disable aggressive startup ramp rate */
81 unsigned int bypass:1; /** Use bypass mode */ 81 unsigned int bypass:1; /** Use bypass mode */
82}; 82};
83 83
diff --git a/include/linux/mfd/arizona/registers.h b/include/linux/mfd/arizona/registers.h
index 715b6ba3d52a..4730b5c576e2 100644
--- a/include/linux/mfd/arizona/registers.h
+++ b/include/linux/mfd/arizona/registers.h
@@ -1002,6 +1002,7 @@
1002#define ARIZONA_DSP2_CLOCKING_1 0x1201 1002#define ARIZONA_DSP2_CLOCKING_1 0x1201
1003#define ARIZONA_DSP2_STATUS_1 0x1204 1003#define ARIZONA_DSP2_STATUS_1 0x1204
1004#define ARIZONA_DSP2_STATUS_2 0x1205 1004#define ARIZONA_DSP2_STATUS_2 0x1205
1005#define ARIZONA_DSP2_STATUS_3 0x1206
1005#define ARIZONA_DSP2_SCRATCH_0 0x1240 1006#define ARIZONA_DSP2_SCRATCH_0 0x1240
1006#define ARIZONA_DSP2_SCRATCH_1 0x1241 1007#define ARIZONA_DSP2_SCRATCH_1 0x1241
1007#define ARIZONA_DSP2_SCRATCH_2 0x1242 1008#define ARIZONA_DSP2_SCRATCH_2 0x1242
@@ -1010,6 +1011,7 @@
1010#define ARIZONA_DSP3_CLOCKING_1 0x1301 1011#define ARIZONA_DSP3_CLOCKING_1 0x1301
1011#define ARIZONA_DSP3_STATUS_1 0x1304 1012#define ARIZONA_DSP3_STATUS_1 0x1304
1012#define ARIZONA_DSP3_STATUS_2 0x1305 1013#define ARIZONA_DSP3_STATUS_2 0x1305
1014#define ARIZONA_DSP3_STATUS_3 0x1306
1013#define ARIZONA_DSP3_SCRATCH_0 0x1340 1015#define ARIZONA_DSP3_SCRATCH_0 0x1340
1014#define ARIZONA_DSP3_SCRATCH_1 0x1341 1016#define ARIZONA_DSP3_SCRATCH_1 0x1341
1015#define ARIZONA_DSP3_SCRATCH_2 0x1342 1017#define ARIZONA_DSP3_SCRATCH_2 0x1342
@@ -1018,6 +1020,7 @@
1018#define ARIZONA_DSP4_CLOCKING_1 0x1401 1020#define ARIZONA_DSP4_CLOCKING_1 0x1401
1019#define ARIZONA_DSP4_STATUS_1 0x1404 1021#define ARIZONA_DSP4_STATUS_1 0x1404
1020#define ARIZONA_DSP4_STATUS_2 0x1405 1022#define ARIZONA_DSP4_STATUS_2 0x1405
1023#define ARIZONA_DSP4_STATUS_3 0x1406
1021#define ARIZONA_DSP4_SCRATCH_0 0x1440 1024#define ARIZONA_DSP4_SCRATCH_0 0x1440
1022#define ARIZONA_DSP4_SCRATCH_1 0x1441 1025#define ARIZONA_DSP4_SCRATCH_1 0x1441
1023#define ARIZONA_DSP4_SCRATCH_2 0x1442 1026#define ARIZONA_DSP4_SCRATCH_2 0x1442