diff options
author | Charles Keepax <ckeepax@opensource.wolfsonmicro.com> | 2013-06-13 04:43:29 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-06-17 18:49:52 -0400 |
commit | dc7d48635dd3c3fd5360238f7d2c697ff13abe7b (patch) | |
tree | 128dcc3bb150a534902473a89b86222e9dcf8dd3 /drivers/mfd/arizona-core.c | |
parent | f3799e93720b8b722944d86f7a2a0599f5a9d716 (diff) |
mfd: arizona: Integrate wm8997 into Arizona mfd
The wm8997 is a compact, high-performance audio hub CODEC with SLIMbus
interfacing, for smartphones, tablets and other portable audio devices
based on the Arizona platform.
This patch integrates the wm8997 into the Arizona mfd.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/arizona-core.c')
-rw-r--r-- | drivers/mfd/arizona-core.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c index 74b4481754fd..89a115301a0c 100644 --- a/drivers/mfd/arizona-core.c +++ b/drivers/mfd/arizona-core.c | |||
@@ -554,6 +554,7 @@ static int arizona_of_get_core_pdata(struct arizona *arizona) | |||
554 | const struct of_device_id arizona_of_match[] = { | 554 | const struct of_device_id arizona_of_match[] = { |
555 | { .compatible = "wlf,wm5102", .data = (void *)WM5102 }, | 555 | { .compatible = "wlf,wm5102", .data = (void *)WM5102 }, |
556 | { .compatible = "wlf,wm5110", .data = (void *)WM5110 }, | 556 | { .compatible = "wlf,wm5110", .data = (void *)WM5110 }, |
557 | { .compatible = "wlf,wm8997", .data = (void *)WM8997 }, | ||
557 | {}, | 558 | {}, |
558 | }; | 559 | }; |
559 | EXPORT_SYMBOL_GPL(arizona_of_match); | 560 | EXPORT_SYMBOL_GPL(arizona_of_match); |
@@ -586,6 +587,15 @@ static struct mfd_cell wm5110_devs[] = { | |||
586 | { .name = "wm5110-codec" }, | 587 | { .name = "wm5110-codec" }, |
587 | }; | 588 | }; |
588 | 589 | ||
590 | static struct mfd_cell wm8997_devs[] = { | ||
591 | { .name = "arizona-micsupp" }, | ||
592 | { .name = "arizona-extcon" }, | ||
593 | { .name = "arizona-gpio" }, | ||
594 | { .name = "arizona-haptics" }, | ||
595 | { .name = "arizona-pwm" }, | ||
596 | { .name = "wm8997-codec" }, | ||
597 | }; | ||
598 | |||
589 | int arizona_dev_init(struct arizona *arizona) | 599 | int arizona_dev_init(struct arizona *arizona) |
590 | { | 600 | { |
591 | struct device *dev = arizona->dev; | 601 | struct device *dev = arizona->dev; |
@@ -608,6 +618,7 @@ int arizona_dev_init(struct arizona *arizona) | |||
608 | switch (arizona->type) { | 618 | switch (arizona->type) { |
609 | case WM5102: | 619 | case WM5102: |
610 | case WM5110: | 620 | case WM5110: |
621 | case WM8997: | ||
611 | for (i = 0; i < ARRAY_SIZE(wm5102_core_supplies); i++) | 622 | for (i = 0; i < ARRAY_SIZE(wm5102_core_supplies); i++) |
612 | arizona->core_supplies[i].supply | 623 | arizona->core_supplies[i].supply |
613 | = wm5102_core_supplies[i]; | 624 | = wm5102_core_supplies[i]; |
@@ -683,6 +694,7 @@ int arizona_dev_init(struct arizona *arizona) | |||
683 | switch (reg) { | 694 | switch (reg) { |
684 | case 0x5102: | 695 | case 0x5102: |
685 | case 0x5110: | 696 | case 0x5110: |
697 | case 0x8997: | ||
686 | break; | 698 | break; |
687 | default: | 699 | default: |
688 | dev_err(arizona->dev, "Unknown device ID: %x\n", reg); | 700 | dev_err(arizona->dev, "Unknown device ID: %x\n", reg); |
@@ -768,6 +780,17 @@ int arizona_dev_init(struct arizona *arizona) | |||
768 | apply_patch = wm5110_patch; | 780 | apply_patch = wm5110_patch; |
769 | break; | 781 | break; |
770 | #endif | 782 | #endif |
783 | #ifdef CONFIG_MFD_WM8997 | ||
784 | case 0x8997: | ||
785 | type_name = "WM8997"; | ||
786 | if (arizona->type != WM8997) { | ||
787 | dev_err(arizona->dev, "WM8997 registered as %d\n", | ||
788 | arizona->type); | ||
789 | arizona->type = WM8997; | ||
790 | } | ||
791 | apply_patch = wm8997_patch; | ||
792 | break; | ||
793 | #endif | ||
771 | default: | 794 | default: |
772 | dev_err(arizona->dev, "Unknown device ID %x\n", reg); | 795 | dev_err(arizona->dev, "Unknown device ID %x\n", reg); |
773 | goto err_reset; | 796 | goto err_reset; |
@@ -934,6 +957,10 @@ int arizona_dev_init(struct arizona *arizona) | |||
934 | ret = mfd_add_devices(arizona->dev, -1, wm5110_devs, | 957 | ret = mfd_add_devices(arizona->dev, -1, wm5110_devs, |
935 | ARRAY_SIZE(wm5110_devs), NULL, 0, NULL); | 958 | ARRAY_SIZE(wm5110_devs), NULL, 0, NULL); |
936 | break; | 959 | break; |
960 | case WM8997: | ||
961 | ret = mfd_add_devices(arizona->dev, -1, wm8997_devs, | ||
962 | ARRAY_SIZE(wm8997_devs), NULL, 0, NULL); | ||
963 | break; | ||
937 | } | 964 | } |
938 | 965 | ||
939 | if (ret != 0) { | 966 | if (ret != 0) { |