diff options
Diffstat (limited to 'drivers/mfd')
48 files changed, 1550 insertions, 374 deletions
diff --git a/drivers/mfd/88pm80x.c b/drivers/mfd/88pm80x.c index 5e72f65ef94c..63445ea6b0bf 100644 --- a/drivers/mfd/88pm80x.c +++ b/drivers/mfd/88pm80x.c | |||
@@ -33,6 +33,8 @@ static struct pm80x_chip_mapping chip_mapping[] = { | |||
33 | {0x3, CHIP_PM800}, | 33 | {0x3, CHIP_PM800}, |
34 | /* 88PM805 chip id number */ | 34 | /* 88PM805 chip id number */ |
35 | {0x0, CHIP_PM805}, | 35 | {0x0, CHIP_PM805}, |
36 | /* 88PM860 chip id number */ | ||
37 | {0x4, CHIP_PM860}, | ||
36 | }; | 38 | }; |
37 | 39 | ||
38 | /* | 40 | /* |
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 99d63675f073..4d92df6ef9fe 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig | |||
@@ -60,6 +60,17 @@ config MFD_AAT2870_CORE | |||
60 | additional drivers must be enabled in order to use the | 60 | additional drivers must be enabled in order to use the |
61 | functionality of the device. | 61 | functionality of the device. |
62 | 62 | ||
63 | config MFD_ATMEL_FLEXCOM | ||
64 | tristate "Atmel Flexcom (Flexible Serial Communication Unit)" | ||
65 | select MFD_CORE | ||
66 | depends on OF | ||
67 | help | ||
68 | Select this to get support for Atmel Flexcom. This is a wrapper | ||
69 | which embeds a SPI controller, a I2C controller and a USART. Only | ||
70 | one function can be used at a time. The choice is done at boot time | ||
71 | by the probe function of this MFD driver according to a device tree | ||
72 | property. | ||
73 | |||
63 | config MFD_ATMEL_HLCDC | 74 | config MFD_ATMEL_HLCDC |
64 | tristate "Atmel HLCDC (High-end LCD Controller)" | 75 | tristate "Atmel HLCDC (High-end LCD Controller)" |
65 | select MFD_CORE | 76 | select MFD_CORE |
@@ -725,9 +736,10 @@ config MFD_RTSX_PCI | |||
725 | select MFD_CORE | 736 | select MFD_CORE |
726 | help | 737 | help |
727 | This supports for Realtek PCI-Express card reader including rts5209, | 738 | This supports for Realtek PCI-Express card reader including rts5209, |
728 | rts5229, rtl8411, etc. Realtek card reader supports access to many | 739 | rts5227, rts522A, rts5229, rts5249, rts524A, rts525A, rtl8411, etc. |
729 | types of memory cards, such as Memory Stick, Memory Stick Pro, | 740 | Realtek card reader supports access to many types of memory cards, |
730 | Secure Digital and MultiMediaCard. | 741 | such as Memory Stick, Memory Stick Pro, Secure Digital and |
742 | MultiMediaCard. | ||
731 | 743 | ||
732 | config MFD_RT5033 | 744 | config MFD_RT5033 |
733 | tristate "Richtek RT5033 Power Management IC" | 745 | tristate "Richtek RT5033 Power Management IC" |
@@ -1059,6 +1071,7 @@ config MFD_PALMAS | |||
1059 | config TPS6105X | 1071 | config TPS6105X |
1060 | tristate "TI TPS61050/61052 Boost Converters" | 1072 | tristate "TI TPS61050/61052 Boost Converters" |
1061 | depends on I2C | 1073 | depends on I2C |
1074 | select REGMAP_I2C | ||
1062 | select REGULATOR | 1075 | select REGULATOR |
1063 | select MFD_CORE | 1076 | select MFD_CORE |
1064 | select REGULATOR_FIXED_VOLTAGE | 1077 | select REGULATOR_FIXED_VOLTAGE |
@@ -1471,7 +1484,7 @@ config MFD_WM8994 | |||
1471 | 1484 | ||
1472 | config MFD_STW481X | 1485 | config MFD_STW481X |
1473 | tristate "Support for ST Microelectronics STw481x" | 1486 | tristate "Support for ST Microelectronics STw481x" |
1474 | depends on I2C && ARCH_NOMADIK | 1487 | depends on I2C && (ARCH_NOMADIK || COMPILE_TEST) |
1475 | select REGMAP_I2C | 1488 | select REGMAP_I2C |
1476 | select MFD_CORE | 1489 | select MFD_CORE |
1477 | help | 1490 | help |
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index a59e3fcc8626..a8b76b81b467 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile | |||
@@ -164,6 +164,7 @@ obj-$(CONFIG_MFD_SPMI_PMIC) += qcom-spmi-pmic.o | |||
164 | obj-$(CONFIG_TPS65911_COMPARATOR) += tps65911-comparator.o | 164 | obj-$(CONFIG_TPS65911_COMPARATOR) += tps65911-comparator.o |
165 | obj-$(CONFIG_MFD_TPS65090) += tps65090.o | 165 | obj-$(CONFIG_MFD_TPS65090) += tps65090.o |
166 | obj-$(CONFIG_MFD_AAT2870_CORE) += aat2870-core.o | 166 | obj-$(CONFIG_MFD_AAT2870_CORE) += aat2870-core.o |
167 | obj-$(CONFIG_MFD_ATMEL_FLEXCOM) += atmel-flexcom.o | ||
167 | obj-$(CONFIG_MFD_ATMEL_HLCDC) += atmel-hlcdc.o | 168 | obj-$(CONFIG_MFD_ATMEL_HLCDC) += atmel-hlcdc.o |
168 | obj-$(CONFIG_MFD_INTEL_LPSS) += intel-lpss.o | 169 | obj-$(CONFIG_MFD_INTEL_LPSS) += intel-lpss.o |
169 | obj-$(CONFIG_MFD_INTEL_LPSS_PCI) += intel-lpss-pci.o | 170 | obj-$(CONFIG_MFD_INTEL_LPSS_PCI) += intel-lpss-pci.o |
@@ -190,5 +191,6 @@ obj-$(CONFIG_MFD_RT5033) += rt5033.o | |||
190 | obj-$(CONFIG_MFD_SKY81452) += sky81452.o | 191 | obj-$(CONFIG_MFD_SKY81452) += sky81452.o |
191 | 192 | ||
192 | intel-soc-pmic-objs := intel_soc_pmic_core.o intel_soc_pmic_crc.o | 193 | intel-soc-pmic-objs := intel_soc_pmic_core.o intel_soc_pmic_crc.o |
194 | intel-soc-pmic-$(CONFIG_INTEL_PMC_IPC) += intel_soc_pmic_bxtwc.o | ||
193 | obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o | 195 | obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o |
194 | obj-$(CONFIG_MFD_MT6397) += mt6397-core.o | 196 | obj-$(CONFIG_MFD_MT6397) += mt6397-core.o |
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c index 44cfdbb295db..d474732cc65c 100644 --- a/drivers/mfd/arizona-core.c +++ b/drivers/mfd/arizona-core.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/regulator/consumer.h> | 24 | #include <linux/regulator/consumer.h> |
25 | #include <linux/regulator/machine.h> | 25 | #include <linux/regulator/machine.h> |
26 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
27 | #include <linux/platform_device.h> | ||
27 | 28 | ||
28 | #include <linux/mfd/arizona/core.h> | 29 | #include <linux/mfd/arizona/core.h> |
29 | #include <linux/mfd/arizona/registers.h> | 30 | #include <linux/mfd/arizona/registers.h> |
@@ -69,8 +70,6 @@ EXPORT_SYMBOL_GPL(arizona_clk32k_enable); | |||
69 | 70 | ||
70 | int arizona_clk32k_disable(struct arizona *arizona) | 71 | int arizona_clk32k_disable(struct arizona *arizona) |
71 | { | 72 | { |
72 | int ret = 0; | ||
73 | |||
74 | mutex_lock(&arizona->clk_lock); | 73 | mutex_lock(&arizona->clk_lock); |
75 | 74 | ||
76 | BUG_ON(arizona->clk32k_ref <= 0); | 75 | BUG_ON(arizona->clk32k_ref <= 0); |
@@ -90,7 +89,7 @@ int arizona_clk32k_disable(struct arizona *arizona) | |||
90 | 89 | ||
91 | mutex_unlock(&arizona->clk_lock); | 90 | mutex_unlock(&arizona->clk_lock); |
92 | 91 | ||
93 | return ret; | 92 | return 0; |
94 | } | 93 | } |
95 | EXPORT_SYMBOL_GPL(arizona_clk32k_disable); | 94 | EXPORT_SYMBOL_GPL(arizona_clk32k_disable); |
96 | 95 | ||
@@ -462,6 +461,50 @@ static int wm5102_clear_write_sequencer(struct arizona *arizona) | |||
462 | } | 461 | } |
463 | 462 | ||
464 | #ifdef CONFIG_PM | 463 | #ifdef CONFIG_PM |
464 | static int arizona_isolate_dcvdd(struct arizona *arizona) | ||
465 | { | ||
466 | int ret; | ||
467 | |||
468 | ret = regmap_update_bits(arizona->regmap, | ||
469 | ARIZONA_ISOLATION_CONTROL, | ||
470 | ARIZONA_ISOLATE_DCVDD1, | ||
471 | ARIZONA_ISOLATE_DCVDD1); | ||
472 | if (ret != 0) | ||
473 | dev_err(arizona->dev, "Failed to isolate DCVDD: %d\n", ret); | ||
474 | |||
475 | return ret; | ||
476 | } | ||
477 | |||
478 | static int arizona_connect_dcvdd(struct arizona *arizona) | ||
479 | { | ||
480 | int ret; | ||
481 | |||
482 | ret = regmap_update_bits(arizona->regmap, | ||
483 | ARIZONA_ISOLATION_CONTROL, | ||
484 | ARIZONA_ISOLATE_DCVDD1, 0); | ||
485 | if (ret != 0) | ||
486 | dev_err(arizona->dev, "Failed to connect DCVDD: %d\n", ret); | ||
487 | |||
488 | return ret; | ||
489 | } | ||
490 | |||
491 | static int arizona_is_jack_det_active(struct arizona *arizona) | ||
492 | { | ||
493 | unsigned int val; | ||
494 | int ret; | ||
495 | |||
496 | ret = regmap_read(arizona->regmap, ARIZONA_JACK_DETECT_ANALOGUE, &val); | ||
497 | if (ret) { | ||
498 | dev_err(arizona->dev, | ||
499 | "Failed to check jack det status: %d\n", ret); | ||
500 | return ret; | ||
501 | } else if (val & ARIZONA_JD1_ENA) { | ||
502 | return 1; | ||
503 | } else { | ||
504 | return 0; | ||
505 | } | ||
506 | } | ||
507 | |||
465 | static int arizona_runtime_resume(struct device *dev) | 508 | static int arizona_runtime_resume(struct device *dev) |
466 | { | 509 | { |
467 | struct arizona *arizona = dev_get_drvdata(dev); | 510 | struct arizona *arizona = dev_get_drvdata(dev); |
@@ -501,14 +544,9 @@ static int arizona_runtime_resume(struct device *dev) | |||
501 | switch (arizona->type) { | 544 | switch (arizona->type) { |
502 | case WM5102: | 545 | case WM5102: |
503 | if (arizona->external_dcvdd) { | 546 | if (arizona->external_dcvdd) { |
504 | ret = regmap_update_bits(arizona->regmap, | 547 | ret = arizona_connect_dcvdd(arizona); |
505 | ARIZONA_ISOLATION_CONTROL, | 548 | if (ret != 0) |
506 | ARIZONA_ISOLATE_DCVDD1, 0); | ||
507 | if (ret != 0) { | ||
508 | dev_err(arizona->dev, | ||
509 | "Failed to connect DCVDD: %d\n", ret); | ||
510 | goto err; | 549 | goto err; |
511 | } | ||
512 | } | 550 | } |
513 | 551 | ||
514 | ret = wm5102_patch(arizona); | 552 | ret = wm5102_patch(arizona); |
@@ -533,14 +571,9 @@ static int arizona_runtime_resume(struct device *dev) | |||
533 | goto err; | 571 | goto err; |
534 | 572 | ||
535 | if (arizona->external_dcvdd) { | 573 | if (arizona->external_dcvdd) { |
536 | ret = regmap_update_bits(arizona->regmap, | 574 | ret = arizona_connect_dcvdd(arizona); |
537 | ARIZONA_ISOLATION_CONTROL, | 575 | if (ret != 0) |
538 | ARIZONA_ISOLATE_DCVDD1, 0); | ||
539 | if (ret) { | ||
540 | dev_err(arizona->dev, | ||
541 | "Failed to connect DCVDD: %d\n", ret); | ||
542 | goto err; | 576 | goto err; |
543 | } | ||
544 | } else { | 577 | } else { |
545 | /* | 578 | /* |
546 | * As this is only called for the internal regulator | 579 | * As this is only called for the internal regulator |
@@ -571,14 +604,9 @@ static int arizona_runtime_resume(struct device *dev) | |||
571 | goto err; | 604 | goto err; |
572 | 605 | ||
573 | if (arizona->external_dcvdd) { | 606 | if (arizona->external_dcvdd) { |
574 | ret = regmap_update_bits(arizona->regmap, | 607 | ret = arizona_connect_dcvdd(arizona); |
575 | ARIZONA_ISOLATION_CONTROL, | 608 | if (ret != 0) |
576 | ARIZONA_ISOLATE_DCVDD1, 0); | ||
577 | if (ret != 0) { | ||
578 | dev_err(arizona->dev, | ||
579 | "Failed to connect DCVDD: %d\n", ret); | ||
580 | goto err; | 609 | goto err; |
581 | } | ||
582 | } | 610 | } |
583 | break; | 611 | break; |
584 | } | 612 | } |
@@ -600,49 +628,50 @@ err: | |||
600 | static int arizona_runtime_suspend(struct device *dev) | 628 | static int arizona_runtime_suspend(struct device *dev) |
601 | { | 629 | { |
602 | struct arizona *arizona = dev_get_drvdata(dev); | 630 | struct arizona *arizona = dev_get_drvdata(dev); |
603 | unsigned int val; | 631 | int jd_active = 0; |
604 | int ret; | 632 | int ret; |
605 | 633 | ||
606 | dev_dbg(arizona->dev, "Entering AoD mode\n"); | 634 | dev_dbg(arizona->dev, "Entering AoD mode\n"); |
607 | 635 | ||
608 | ret = regmap_read(arizona->regmap, ARIZONA_JACK_DETECT_ANALOGUE, &val); | ||
609 | if (ret) { | ||
610 | dev_err(dev, "Failed to check jack det status: %d\n", ret); | ||
611 | return ret; | ||
612 | } | ||
613 | |||
614 | if (arizona->external_dcvdd) { | ||
615 | ret = regmap_update_bits(arizona->regmap, | ||
616 | ARIZONA_ISOLATION_CONTROL, | ||
617 | ARIZONA_ISOLATE_DCVDD1, | ||
618 | ARIZONA_ISOLATE_DCVDD1); | ||
619 | if (ret != 0) { | ||
620 | dev_err(arizona->dev, "Failed to isolate DCVDD: %d\n", | ||
621 | ret); | ||
622 | return ret; | ||
623 | } | ||
624 | } | ||
625 | |||
626 | switch (arizona->type) { | 636 | switch (arizona->type) { |
627 | case WM5110: | 637 | case WM5110: |
628 | case WM8280: | 638 | case WM8280: |
629 | if (arizona->external_dcvdd) | 639 | jd_active = arizona_is_jack_det_active(arizona); |
630 | break; | 640 | if (jd_active < 0) |
641 | return jd_active; | ||
631 | 642 | ||
632 | /* | 643 | if (arizona->external_dcvdd) { |
633 | * As this is only called for the internal regulator | 644 | ret = arizona_isolate_dcvdd(arizona); |
634 | * (where we know voltage ranges available) it is ok | 645 | if (ret != 0) |
635 | * to request an exact range. | 646 | return ret; |
636 | */ | 647 | } else { |
637 | ret = regulator_set_voltage(arizona->dcvdd, 1175000, 1175000); | 648 | /* |
638 | if (ret < 0) { | 649 | * As this is only called for the internal regulator |
639 | dev_err(arizona->dev, | 650 | * (where we know voltage ranges available) it is ok |
640 | "Failed to set suspend voltage: %d\n", ret); | 651 | * to request an exact range. |
641 | return ret; | 652 | */ |
653 | ret = regulator_set_voltage(arizona->dcvdd, | ||
654 | 1175000, 1175000); | ||
655 | if (ret < 0) { | ||
656 | dev_err(arizona->dev, | ||
657 | "Failed to set suspend voltage: %d\n", | ||
658 | ret); | ||
659 | return ret; | ||
660 | } | ||
642 | } | 661 | } |
643 | break; | 662 | break; |
644 | case WM5102: | 663 | case WM5102: |
645 | if (!(val & ARIZONA_JD1_ENA)) { | 664 | jd_active = arizona_is_jack_det_active(arizona); |
665 | if (jd_active < 0) | ||
666 | return jd_active; | ||
667 | |||
668 | if (arizona->external_dcvdd) { | ||
669 | ret = arizona_isolate_dcvdd(arizona); | ||
670 | if (ret != 0) | ||
671 | return ret; | ||
672 | } | ||
673 | |||
674 | if (!jd_active) { | ||
646 | ret = regmap_write(arizona->regmap, | 675 | ret = regmap_write(arizona->regmap, |
647 | ARIZONA_WRITE_SEQUENCER_CTRL_3, 0x0); | 676 | ARIZONA_WRITE_SEQUENCER_CTRL_3, 0x0); |
648 | if (ret) { | 677 | if (ret) { |
@@ -654,6 +683,15 @@ static int arizona_runtime_suspend(struct device *dev) | |||
654 | } | 683 | } |
655 | break; | 684 | break; |
656 | default: | 685 | default: |
686 | jd_active = arizona_is_jack_det_active(arizona); | ||
687 | if (jd_active < 0) | ||
688 | return jd_active; | ||
689 | |||
690 | if (arizona->external_dcvdd) { | ||
691 | ret = arizona_isolate_dcvdd(arizona); | ||
692 | if (ret != 0) | ||
693 | return ret; | ||
694 | } | ||
657 | break; | 695 | break; |
658 | } | 696 | } |
659 | 697 | ||
@@ -662,7 +700,7 @@ static int arizona_runtime_suspend(struct device *dev) | |||
662 | regulator_disable(arizona->dcvdd); | 700 | regulator_disable(arizona->dcvdd); |
663 | 701 | ||
664 | /* Allow us to completely power down if no jack detection */ | 702 | /* Allow us to completely power down if no jack detection */ |
665 | if (!(val & ARIZONA_JD1_ENA)) { | 703 | if (!jd_active) { |
666 | dev_dbg(arizona->dev, "Fully powering off\n"); | 704 | dev_dbg(arizona->dev, "Fully powering off\n"); |
667 | 705 | ||
668 | arizona->has_fully_powered_off = true; | 706 | arizona->has_fully_powered_off = true; |
@@ -928,7 +966,8 @@ int arizona_dev_init(struct arizona *arizona) | |||
928 | const char *type_name; | 966 | const char *type_name; |
929 | unsigned int reg, val, mask; | 967 | unsigned int reg, val, mask; |
930 | int (*apply_patch)(struct arizona *) = NULL; | 968 | int (*apply_patch)(struct arizona *) = NULL; |
931 | int ret, i; | 969 | const struct mfd_cell *subdevs = NULL; |
970 | int n_subdevs, ret, i; | ||
932 | 971 | ||
933 | dev_set_drvdata(arizona->dev, arizona); | 972 | dev_set_drvdata(arizona->dev, arizona); |
934 | mutex_init(&arizona->clk_lock); | 973 | mutex_init(&arizona->clk_lock); |
@@ -1089,74 +1128,95 @@ int arizona_dev_init(struct arizona *arizona) | |||
1089 | arizona->rev &= ARIZONA_DEVICE_REVISION_MASK; | 1128 | arizona->rev &= ARIZONA_DEVICE_REVISION_MASK; |
1090 | 1129 | ||
1091 | switch (reg) { | 1130 | switch (reg) { |
1092 | #ifdef CONFIG_MFD_WM5102 | ||
1093 | case 0x5102: | 1131 | case 0x5102: |
1094 | type_name = "WM5102"; | 1132 | if (IS_ENABLED(CONFIG_MFD_WM5102)) { |
1095 | if (arizona->type != WM5102) { | 1133 | type_name = "WM5102"; |
1096 | dev_err(arizona->dev, "WM5102 registered as %d\n", | 1134 | if (arizona->type != WM5102) { |
1097 | arizona->type); | 1135 | dev_warn(arizona->dev, |
1098 | arizona->type = WM5102; | 1136 | "WM5102 registered as %d\n", |
1137 | arizona->type); | ||
1138 | arizona->type = WM5102; | ||
1139 | } | ||
1140 | |||
1141 | apply_patch = wm5102_patch; | ||
1142 | arizona->rev &= 0x7; | ||
1143 | subdevs = wm5102_devs; | ||
1144 | n_subdevs = ARRAY_SIZE(wm5102_devs); | ||
1099 | } | 1145 | } |
1100 | apply_patch = wm5102_patch; | ||
1101 | arizona->rev &= 0x7; | ||
1102 | break; | 1146 | break; |
1103 | #endif | ||
1104 | #ifdef CONFIG_MFD_WM5110 | ||
1105 | case 0x5110: | 1147 | case 0x5110: |
1106 | switch (arizona->type) { | 1148 | if (IS_ENABLED(CONFIG_MFD_WM5110)) { |
1107 | case WM5110: | 1149 | switch (arizona->type) { |
1108 | type_name = "WM5110"; | 1150 | case WM5110: |
1109 | break; | 1151 | type_name = "WM5110"; |
1110 | case WM8280: | 1152 | break; |
1111 | type_name = "WM8280"; | 1153 | case WM8280: |
1112 | break; | 1154 | type_name = "WM8280"; |
1113 | default: | 1155 | break; |
1114 | type_name = "WM5110"; | 1156 | default: |
1115 | dev_err(arizona->dev, "WM5110 registered as %d\n", | 1157 | type_name = "WM5110"; |
1116 | arizona->type); | 1158 | dev_warn(arizona->dev, |
1117 | arizona->type = WM5110; | 1159 | "WM5110 registered as %d\n", |
1118 | break; | 1160 | arizona->type); |
1161 | arizona->type = WM5110; | ||
1162 | break; | ||
1163 | } | ||
1164 | |||
1165 | apply_patch = wm5110_patch; | ||
1166 | subdevs = wm5110_devs; | ||
1167 | n_subdevs = ARRAY_SIZE(wm5110_devs); | ||
1119 | } | 1168 | } |
1120 | apply_patch = wm5110_patch; | ||
1121 | break; | 1169 | break; |
1122 | #endif | ||
1123 | #ifdef CONFIG_MFD_WM8997 | ||
1124 | case 0x8997: | 1170 | case 0x8997: |
1125 | type_name = "WM8997"; | 1171 | if (IS_ENABLED(CONFIG_MFD_WM8997)) { |
1126 | if (arizona->type != WM8997) { | 1172 | type_name = "WM8997"; |
1127 | dev_err(arizona->dev, "WM8997 registered as %d\n", | 1173 | if (arizona->type != WM8997) { |
1128 | arizona->type); | 1174 | dev_warn(arizona->dev, |
1129 | arizona->type = WM8997; | 1175 | "WM8997 registered as %d\n", |
1176 | arizona->type); | ||
1177 | arizona->type = WM8997; | ||
1178 | } | ||
1179 | |||
1180 | apply_patch = wm8997_patch; | ||
1181 | subdevs = wm8997_devs; | ||
1182 | n_subdevs = ARRAY_SIZE(wm8997_devs); | ||
1130 | } | 1183 | } |
1131 | apply_patch = wm8997_patch; | ||
1132 | break; | 1184 | break; |
1133 | #endif | ||
1134 | #ifdef CONFIG_MFD_WM8998 | ||
1135 | case 0x6349: | 1185 | case 0x6349: |
1136 | switch (arizona->type) { | 1186 | if (IS_ENABLED(CONFIG_MFD_WM8998)) { |
1137 | case WM8998: | 1187 | switch (arizona->type) { |
1138 | type_name = "WM8998"; | 1188 | case WM8998: |
1139 | break; | 1189 | type_name = "WM8998"; |
1140 | 1190 | break; | |
1141 | case WM1814: | 1191 | |
1142 | type_name = "WM1814"; | 1192 | case WM1814: |
1143 | break; | 1193 | type_name = "WM1814"; |
1194 | break; | ||
1195 | |||
1196 | default: | ||
1197 | type_name = "WM8998"; | ||
1198 | dev_warn(arizona->dev, | ||
1199 | "WM8998 registered as %d\n", | ||
1200 | arizona->type); | ||
1201 | arizona->type = WM8998; | ||
1202 | } | ||
1144 | 1203 | ||
1145 | default: | 1204 | apply_patch = wm8998_patch; |
1146 | type_name = "WM8998"; | 1205 | subdevs = wm8998_devs; |
1147 | dev_err(arizona->dev, "WM8998 registered as %d\n", | 1206 | n_subdevs = ARRAY_SIZE(wm8998_devs); |
1148 | arizona->type); | ||
1149 | arizona->type = WM8998; | ||
1150 | } | 1207 | } |
1151 | |||
1152 | apply_patch = wm8998_patch; | ||
1153 | break; | 1208 | break; |
1154 | #endif | ||
1155 | default: | 1209 | default: |
1156 | dev_err(arizona->dev, "Unknown device ID %x\n", reg); | 1210 | dev_err(arizona->dev, "Unknown device ID %x\n", reg); |
1157 | goto err_reset; | 1211 | goto err_reset; |
1158 | } | 1212 | } |
1159 | 1213 | ||
1214 | if (!subdevs) { | ||
1215 | dev_err(arizona->dev, | ||
1216 | "No kernel support for device ID %x\n", reg); | ||
1217 | goto err_reset; | ||
1218 | } | ||
1219 | |||
1160 | dev_info(dev, "%s revision %c\n", type_name, arizona->rev + 'A'); | 1220 | dev_info(dev, "%s revision %c\n", type_name, arizona->rev + 'A'); |
1161 | 1221 | ||
1162 | if (apply_patch) { | 1222 | if (apply_patch) { |
@@ -1342,28 +1402,10 @@ int arizona_dev_init(struct arizona *arizona) | |||
1342 | arizona_request_irq(arizona, ARIZONA_IRQ_UNDERCLOCKED, "Underclocked", | 1402 | arizona_request_irq(arizona, ARIZONA_IRQ_UNDERCLOCKED, "Underclocked", |
1343 | arizona_underclocked, arizona); | 1403 | arizona_underclocked, arizona); |
1344 | 1404 | ||
1345 | switch (arizona->type) { | 1405 | ret = mfd_add_devices(arizona->dev, PLATFORM_DEVID_NONE, |
1346 | case WM5102: | 1406 | subdevs, n_subdevs, NULL, 0, NULL); |
1347 | ret = mfd_add_devices(arizona->dev, -1, wm5102_devs, | ||
1348 | ARRAY_SIZE(wm5102_devs), NULL, 0, NULL); | ||
1349 | break; | ||
1350 | case WM5110: | ||
1351 | case WM8280: | ||
1352 | ret = mfd_add_devices(arizona->dev, -1, wm5110_devs, | ||
1353 | ARRAY_SIZE(wm5110_devs), NULL, 0, NULL); | ||
1354 | break; | ||
1355 | case WM8997: | ||
1356 | ret = mfd_add_devices(arizona->dev, -1, wm8997_devs, | ||
1357 | ARRAY_SIZE(wm8997_devs), NULL, 0, NULL); | ||
1358 | break; | ||
1359 | case WM8998: | ||
1360 | case WM1814: | ||
1361 | ret = mfd_add_devices(arizona->dev, -1, wm8998_devs, | ||
1362 | ARRAY_SIZE(wm8998_devs), NULL, 0, NULL); | ||
1363 | break; | ||
1364 | } | ||
1365 | 1407 | ||
1366 | if (ret != 0) { | 1408 | if (ret) { |
1367 | dev_err(arizona->dev, "Failed to add subdevices: %d\n", ret); | 1409 | dev_err(arizona->dev, "Failed to add subdevices: %d\n", ret); |
1368 | goto err_irq; | 1410 | goto err_irq; |
1369 | } | 1411 | } |
diff --git a/drivers/mfd/arizona-i2c.c b/drivers/mfd/arizona-i2c.c index cea1b409fa27..4e3afd1861fc 100644 --- a/drivers/mfd/arizona-i2c.c +++ b/drivers/mfd/arizona-i2c.c | |||
@@ -27,7 +27,7 @@ static int arizona_i2c_probe(struct i2c_client *i2c, | |||
27 | const struct i2c_device_id *id) | 27 | const struct i2c_device_id *id) |
28 | { | 28 | { |
29 | struct arizona *arizona; | 29 | struct arizona *arizona; |
30 | const struct regmap_config *regmap_config; | 30 | const struct regmap_config *regmap_config = NULL; |
31 | unsigned long type; | 31 | unsigned long type; |
32 | int ret; | 32 | int ret; |
33 | 33 | ||
@@ -37,31 +37,32 @@ static int arizona_i2c_probe(struct i2c_client *i2c, | |||
37 | type = id->driver_data; | 37 | type = id->driver_data; |
38 | 38 | ||
39 | switch (type) { | 39 | switch (type) { |
40 | #ifdef CONFIG_MFD_WM5102 | ||
41 | case WM5102: | 40 | case WM5102: |
42 | regmap_config = &wm5102_i2c_regmap; | 41 | if (IS_ENABLED(CONFIG_MFD_WM5102)) |
42 | regmap_config = &wm5102_i2c_regmap; | ||
43 | break; | 43 | break; |
44 | #endif | ||
45 | #ifdef CONFIG_MFD_WM5110 | ||
46 | case WM5110: | 44 | case WM5110: |
47 | case WM8280: | 45 | case WM8280: |
48 | regmap_config = &wm5110_i2c_regmap; | 46 | if (IS_ENABLED(CONFIG_MFD_WM5110)) |
47 | regmap_config = &wm5110_i2c_regmap; | ||
49 | break; | 48 | break; |
50 | #endif | ||
51 | #ifdef CONFIG_MFD_WM8997 | ||
52 | case WM8997: | 49 | case WM8997: |
53 | regmap_config = &wm8997_i2c_regmap; | 50 | if (IS_ENABLED(CONFIG_MFD_WM8997)) |
51 | regmap_config = &wm8997_i2c_regmap; | ||
54 | break; | 52 | break; |
55 | #endif | ||
56 | #ifdef CONFIG_MFD_WM8998 | ||
57 | case WM8998: | 53 | case WM8998: |
58 | case WM1814: | 54 | case WM1814: |
59 | regmap_config = &wm8998_i2c_regmap; | 55 | if (IS_ENABLED(CONFIG_MFD_WM8998)) |
56 | regmap_config = &wm8998_i2c_regmap; | ||
60 | break; | 57 | break; |
61 | #endif | ||
62 | default: | 58 | default: |
63 | dev_err(&i2c->dev, "Unknown device type %ld\n", | 59 | dev_err(&i2c->dev, "Unknown device type %ld\n", type); |
64 | id->driver_data); | 60 | return -EINVAL; |
61 | } | ||
62 | |||
63 | if (!regmap_config) { | ||
64 | dev_err(&i2c->dev, | ||
65 | "No kernel support for device type %ld\n", type); | ||
65 | return -EINVAL; | 66 | return -EINVAL; |
66 | } | 67 | } |
67 | 68 | ||
@@ -77,7 +78,7 @@ static int arizona_i2c_probe(struct i2c_client *i2c, | |||
77 | return ret; | 78 | return ret; |
78 | } | 79 | } |
79 | 80 | ||
80 | arizona->type = id->driver_data; | 81 | arizona->type = type; |
81 | arizona->dev = &i2c->dev; | 82 | arizona->dev = &i2c->dev; |
82 | arizona->irq = i2c->irq; | 83 | arizona->irq = i2c->irq; |
83 | 84 | ||
diff --git a/drivers/mfd/arizona-irq.c b/drivers/mfd/arizona-irq.c index 2cac4f463f1e..3d425e93ce84 100644 --- a/drivers/mfd/arizona-irq.c +++ b/drivers/mfd/arizona-irq.c | |||
@@ -169,7 +169,7 @@ static struct irq_chip arizona_irq_chip = { | |||
169 | static int arizona_irq_map(struct irq_domain *h, unsigned int virq, | 169 | static int arizona_irq_map(struct irq_domain *h, unsigned int virq, |
170 | irq_hw_number_t hw) | 170 | irq_hw_number_t hw) |
171 | { | 171 | { |
172 | struct regmap_irq_chip_data *data = h->host_data; | 172 | struct arizona *data = h->host_data; |
173 | 173 | ||
174 | irq_set_chip_data(virq, data); | 174 | irq_set_chip_data(virq, data); |
175 | irq_set_chip_and_handler(virq, &arizona_irq_chip, handle_simple_irq); | 175 | irq_set_chip_and_handler(virq, &arizona_irq_chip, handle_simple_irq); |
diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c index 03d62f7b4720..befbc89bfd34 100644 --- a/drivers/mfd/arizona-spi.c +++ b/drivers/mfd/arizona-spi.c | |||
@@ -27,7 +27,7 @@ static int arizona_spi_probe(struct spi_device *spi) | |||
27 | { | 27 | { |
28 | const struct spi_device_id *id = spi_get_device_id(spi); | 28 | const struct spi_device_id *id = spi_get_device_id(spi); |
29 | struct arizona *arizona; | 29 | struct arizona *arizona; |
30 | const struct regmap_config *regmap_config; | 30 | const struct regmap_config *regmap_config = NULL; |
31 | unsigned long type; | 31 | unsigned long type; |
32 | int ret; | 32 | int ret; |
33 | 33 | ||
@@ -37,20 +37,23 @@ static int arizona_spi_probe(struct spi_device *spi) | |||
37 | type = id->driver_data; | 37 | type = id->driver_data; |
38 | 38 | ||
39 | switch (type) { | 39 | switch (type) { |
40 | #ifdef CONFIG_MFD_WM5102 | ||
41 | case WM5102: | 40 | case WM5102: |
42 | regmap_config = &wm5102_spi_regmap; | 41 | if (IS_ENABLED(CONFIG_MFD_WM5102)) |
42 | regmap_config = &wm5102_spi_regmap; | ||
43 | break; | 43 | break; |
44 | #endif | ||
45 | #ifdef CONFIG_MFD_WM5110 | ||
46 | case WM5110: | 44 | case WM5110: |
47 | case WM8280: | 45 | case WM8280: |
48 | regmap_config = &wm5110_spi_regmap; | 46 | if (IS_ENABLED(CONFIG_MFD_WM5110)) |
47 | regmap_config = &wm5110_spi_regmap; | ||
49 | break; | 48 | break; |
50 | #endif | ||
51 | default: | 49 | default: |
52 | dev_err(&spi->dev, "Unknown device type %ld\n", | 50 | dev_err(&spi->dev, "Unknown device type %ld\n", type); |
53 | id->driver_data); | 51 | return -EINVAL; |
52 | } | ||
53 | |||
54 | if (!regmap_config) { | ||
55 | dev_err(&spi->dev, | ||
56 | "No kernel support for device type %ld\n", type); | ||
54 | return -EINVAL; | 57 | return -EINVAL; |
55 | } | 58 | } |
56 | 59 | ||
@@ -66,7 +69,7 @@ static int arizona_spi_probe(struct spi_device *spi) | |||
66 | return ret; | 69 | return ret; |
67 | } | 70 | } |
68 | 71 | ||
69 | arizona->type = id->driver_data; | 72 | arizona->type = type; |
70 | arizona->dev = &spi->dev; | 73 | arizona->dev = &spi->dev; |
71 | arizona->irq = spi->irq; | 74 | arizona->irq = spi->irq; |
72 | 75 | ||
diff --git a/drivers/mfd/atmel-flexcom.c b/drivers/mfd/atmel-flexcom.c new file mode 100644 index 000000000000..e8e67be6b493 --- /dev/null +++ b/drivers/mfd/atmel-flexcom.c | |||
@@ -0,0 +1,104 @@ | |||
1 | /* | ||
2 | * Driver for Atmel Flexcom | ||
3 | * | ||
4 | * Copyright (C) 2015 Atmel Corporation | ||
5 | * | ||
6 | * Author: Cyrille Pitchen <cyrille.pitchen@atmel.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
15 | * more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License along with | ||
18 | * this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | ||
20 | |||
21 | #include <linux/module.h> | ||
22 | #include <linux/types.h> | ||
23 | #include <linux/kernel.h> | ||
24 | #include <linux/platform_device.h> | ||
25 | #include <linux/of.h> | ||
26 | #include <linux/of_platform.h> | ||
27 | #include <linux/err.h> | ||
28 | #include <linux/io.h> | ||
29 | #include <linux/clk.h> | ||
30 | #include <dt-bindings/mfd/atmel-flexcom.h> | ||
31 | |||
32 | /* I/O register offsets */ | ||
33 | #define FLEX_MR 0x0 /* Mode Register */ | ||
34 | #define FLEX_VERSION 0xfc /* Version Register */ | ||
35 | |||
36 | /* Mode Register bit fields */ | ||
37 | #define FLEX_MR_OPMODE_OFFSET (0) /* Operating Mode */ | ||
38 | #define FLEX_MR_OPMODE_MASK (0x3 << FLEX_MR_OPMODE_OFFSET) | ||
39 | #define FLEX_MR_OPMODE(opmode) (((opmode) << FLEX_MR_OPMODE_OFFSET) & \ | ||
40 | FLEX_MR_OPMODE_MASK) | ||
41 | |||
42 | |||
43 | static int atmel_flexcom_probe(struct platform_device *pdev) | ||
44 | { | ||
45 | struct device_node *np = pdev->dev.of_node; | ||
46 | struct clk *clk; | ||
47 | struct resource *res; | ||
48 | void __iomem *base; | ||
49 | u32 opmode; | ||
50 | int err; | ||
51 | |||
52 | err = of_property_read_u32(np, "atmel,flexcom-mode", &opmode); | ||
53 | if (err) | ||
54 | return err; | ||
55 | |||
56 | if (opmode < ATMEL_FLEXCOM_MODE_USART || | ||
57 | opmode > ATMEL_FLEXCOM_MODE_TWI) | ||
58 | return -EINVAL; | ||
59 | |||
60 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
61 | base = devm_ioremap_resource(&pdev->dev, res); | ||
62 | if (IS_ERR(base)) | ||
63 | return PTR_ERR(base); | ||
64 | |||
65 | clk = devm_clk_get(&pdev->dev, NULL); | ||
66 | if (IS_ERR(clk)) | ||
67 | return PTR_ERR(clk); | ||
68 | |||
69 | err = clk_prepare_enable(clk); | ||
70 | if (err) | ||
71 | return err; | ||
72 | |||
73 | /* | ||
74 | * Set the Operating Mode in the Mode Register: only the selected device | ||
75 | * is clocked. Hence, registers of the other serial devices remain | ||
76 | * inaccessible and are read as zero. Also the external I/O lines of the | ||
77 | * Flexcom are muxed to reach the selected device. | ||
78 | */ | ||
79 | writel(FLEX_MR_OPMODE(opmode), base + FLEX_MR); | ||
80 | |||
81 | clk_disable_unprepare(clk); | ||
82 | |||
83 | return of_platform_populate(np, NULL, NULL, &pdev->dev); | ||
84 | } | ||
85 | |||
86 | static const struct of_device_id atmel_flexcom_of_match[] = { | ||
87 | { .compatible = "atmel,sama5d2-flexcom" }, | ||
88 | { /* sentinel */ } | ||
89 | }; | ||
90 | MODULE_DEVICE_TABLE(of, atmel_flexcom_of_match); | ||
91 | |||
92 | static struct platform_driver atmel_flexcom_driver = { | ||
93 | .probe = atmel_flexcom_probe, | ||
94 | .driver = { | ||
95 | .name = "atmel_flexcom", | ||
96 | .of_match_table = atmel_flexcom_of_match, | ||
97 | }, | ||
98 | }; | ||
99 | |||
100 | module_platform_driver(atmel_flexcom_driver); | ||
101 | |||
102 | MODULE_AUTHOR("Cyrille Pitchen <cyrille.pitchen@atmel.com>"); | ||
103 | MODULE_DESCRIPTION("Atmel Flexcom MFD driver"); | ||
104 | MODULE_LICENSE("GPL v2"); | ||
diff --git a/drivers/mfd/atmel-hlcdc.c b/drivers/mfd/atmel-hlcdc.c index 3fff6b5d0426..06c205868573 100644 --- a/drivers/mfd/atmel-hlcdc.c +++ b/drivers/mfd/atmel-hlcdc.c | |||
@@ -148,6 +148,7 @@ static const struct of_device_id atmel_hlcdc_match[] = { | |||
148 | { .compatible = "atmel,sama5d4-hlcdc" }, | 148 | { .compatible = "atmel,sama5d4-hlcdc" }, |
149 | { /* sentinel */ }, | 149 | { /* sentinel */ }, |
150 | }; | 150 | }; |
151 | MODULE_DEVICE_TABLE(of, atmel_hlcdc_match); | ||
151 | 152 | ||
152 | static struct platform_driver atmel_hlcdc_driver = { | 153 | static struct platform_driver atmel_hlcdc_driver = { |
153 | .probe = atmel_hlcdc_probe, | 154 | .probe = atmel_hlcdc_probe, |
diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c index 3f576b76c322..9842199e2e6c 100644 --- a/drivers/mfd/axp20x.c +++ b/drivers/mfd/axp20x.c | |||
@@ -161,6 +161,21 @@ static struct resource axp22x_pek_resources[] = { | |||
161 | }, | 161 | }, |
162 | }; | 162 | }; |
163 | 163 | ||
164 | static struct resource axp288_power_button_resources[] = { | ||
165 | { | ||
166 | .name = "PEK_DBR", | ||
167 | .start = AXP288_IRQ_POKN, | ||
168 | .end = AXP288_IRQ_POKN, | ||
169 | .flags = IORESOURCE_IRQ, | ||
170 | }, | ||
171 | { | ||
172 | .name = "PEK_DBF", | ||
173 | .start = AXP288_IRQ_POKP, | ||
174 | .end = AXP288_IRQ_POKP, | ||
175 | .flags = IORESOURCE_IRQ, | ||
176 | }, | ||
177 | }; | ||
178 | |||
164 | static struct resource axp288_fuel_gauge_resources[] = { | 179 | static struct resource axp288_fuel_gauge_resources[] = { |
165 | { | 180 | { |
166 | .start = AXP288_IRQ_QWBTU, | 181 | .start = AXP288_IRQ_QWBTU, |
@@ -572,6 +587,11 @@ static struct mfd_cell axp288_cells[] = { | |||
572 | .resources = axp288_fuel_gauge_resources, | 587 | .resources = axp288_fuel_gauge_resources, |
573 | }, | 588 | }, |
574 | { | 589 | { |
590 | .name = "axp20x-pek", | ||
591 | .num_resources = ARRAY_SIZE(axp288_power_button_resources), | ||
592 | .resources = axp288_power_button_resources, | ||
593 | }, | ||
594 | { | ||
575 | .name = "axp288_pmic_acpi", | 595 | .name = "axp288_pmic_acpi", |
576 | }, | 596 | }, |
577 | }; | 597 | }; |
diff --git a/drivers/mfd/bcm590xx.c b/drivers/mfd/bcm590xx.c index da2af5b4f855..320aaefee718 100644 --- a/drivers/mfd/bcm590xx.c +++ b/drivers/mfd/bcm590xx.c | |||
@@ -128,4 +128,3 @@ module_i2c_driver(bcm590xx_i2c_driver); | |||
128 | MODULE_AUTHOR("Matt Porter <mporter@linaro.org>"); | 128 | MODULE_AUTHOR("Matt Porter <mporter@linaro.org>"); |
129 | MODULE_DESCRIPTION("BCM590xx multi-function driver"); | 129 | MODULE_DESCRIPTION("BCM590xx multi-function driver"); |
130 | MODULE_LICENSE("GPL v2"); | 130 | MODULE_LICENSE("GPL v2"); |
131 | MODULE_ALIAS("i2c:bcm590xx"); | ||
diff --git a/drivers/mfd/cros_ec_i2c.c b/drivers/mfd/cros_ec_i2c.c index d06e4b46db80..56a466469664 100644 --- a/drivers/mfd/cros_ec_i2c.c +++ b/drivers/mfd/cros_ec_i2c.c | |||
@@ -344,6 +344,12 @@ static int cros_ec_i2c_resume(struct device *dev) | |||
344 | static SIMPLE_DEV_PM_OPS(cros_ec_i2c_pm_ops, cros_ec_i2c_suspend, | 344 | static SIMPLE_DEV_PM_OPS(cros_ec_i2c_pm_ops, cros_ec_i2c_suspend, |
345 | cros_ec_i2c_resume); | 345 | cros_ec_i2c_resume); |
346 | 346 | ||
347 | static const struct of_device_id cros_ec_i2c_of_match[] = { | ||
348 | { .compatible = "google,cros-ec-i2c", }, | ||
349 | { /* sentinel */ }, | ||
350 | }; | ||
351 | MODULE_DEVICE_TABLE(of, cros_ec_i2c_of_match); | ||
352 | |||
347 | static const struct i2c_device_id cros_ec_i2c_id[] = { | 353 | static const struct i2c_device_id cros_ec_i2c_id[] = { |
348 | { "cros-ec-i2c", 0 }, | 354 | { "cros-ec-i2c", 0 }, |
349 | { } | 355 | { } |
@@ -353,6 +359,7 @@ MODULE_DEVICE_TABLE(i2c, cros_ec_i2c_id); | |||
353 | static struct i2c_driver cros_ec_driver = { | 359 | static struct i2c_driver cros_ec_driver = { |
354 | .driver = { | 360 | .driver = { |
355 | .name = "cros-ec-i2c", | 361 | .name = "cros-ec-i2c", |
362 | .of_match_table = of_match_ptr(cros_ec_i2c_of_match), | ||
356 | .pm = &cros_ec_i2c_pm_ops, | 363 | .pm = &cros_ec_i2c_pm_ops, |
357 | }, | 364 | }, |
358 | .probe = cros_ec_i2c_probe, | 365 | .probe = cros_ec_i2c_probe, |
diff --git a/drivers/mfd/da903x.c b/drivers/mfd/da903x.c index ef7fe2ae2fa4..37e4426ef061 100644 --- a/drivers/mfd/da903x.c +++ b/drivers/mfd/da903x.c | |||
@@ -532,11 +532,7 @@ static int da903x_probe(struct i2c_client *client, | |||
532 | return ret; | 532 | return ret; |
533 | } | 533 | } |
534 | 534 | ||
535 | ret = da903x_add_subdevs(chip, pdata); | 535 | return da903x_add_subdevs(chip, pdata); |
536 | if (ret) | ||
537 | return ret; | ||
538 | |||
539 | return 0; | ||
540 | } | 536 | } |
541 | 537 | ||
542 | static int da903x_remove(struct i2c_client *client) | 538 | static int da903x_remove(struct i2c_client *client) |
diff --git a/drivers/mfd/da9052-core.c b/drivers/mfd/da9052-core.c index 46e3840c7a37..c0bf68a3e614 100644 --- a/drivers/mfd/da9052-core.c +++ b/drivers/mfd/da9052-core.c | |||
@@ -51,6 +51,9 @@ static bool da9052_reg_readable(struct device *dev, unsigned int reg) | |||
51 | case DA9052_GPIO_2_3_REG: | 51 | case DA9052_GPIO_2_3_REG: |
52 | case DA9052_GPIO_4_5_REG: | 52 | case DA9052_GPIO_4_5_REG: |
53 | case DA9052_GPIO_6_7_REG: | 53 | case DA9052_GPIO_6_7_REG: |
54 | case DA9052_GPIO_8_9_REG: | ||
55 | case DA9052_GPIO_10_11_REG: | ||
56 | case DA9052_GPIO_12_13_REG: | ||
54 | case DA9052_GPIO_14_15_REG: | 57 | case DA9052_GPIO_14_15_REG: |
55 | case DA9052_ID_0_1_REG: | 58 | case DA9052_ID_0_1_REG: |
56 | case DA9052_ID_2_3_REG: | 59 | case DA9052_ID_2_3_REG: |
@@ -178,6 +181,9 @@ static bool da9052_reg_writeable(struct device *dev, unsigned int reg) | |||
178 | case DA9052_GPIO_2_3_REG: | 181 | case DA9052_GPIO_2_3_REG: |
179 | case DA9052_GPIO_4_5_REG: | 182 | case DA9052_GPIO_4_5_REG: |
180 | case DA9052_GPIO_6_7_REG: | 183 | case DA9052_GPIO_6_7_REG: |
184 | case DA9052_GPIO_8_9_REG: | ||
185 | case DA9052_GPIO_10_11_REG: | ||
186 | case DA9052_GPIO_12_13_REG: | ||
181 | case DA9052_GPIO_14_15_REG: | 187 | case DA9052_GPIO_14_15_REG: |
182 | case DA9052_ID_0_1_REG: | 188 | case DA9052_ID_0_1_REG: |
183 | case DA9052_ID_2_3_REG: | 189 | case DA9052_ID_2_3_REG: |
diff --git a/drivers/mfd/da9052-i2c.c b/drivers/mfd/da9052-i2c.c index 02887001e800..2697ffb08009 100644 --- a/drivers/mfd/da9052-i2c.c +++ b/drivers/mfd/da9052-i2c.c | |||
@@ -174,11 +174,7 @@ static int da9052_i2c_probe(struct i2c_client *client, | |||
174 | return ret; | 174 | return ret; |
175 | } | 175 | } |
176 | 176 | ||
177 | ret = da9052_device_init(da9052, id->driver_data); | 177 | return da9052_device_init(da9052, id->driver_data); |
178 | if (ret != 0) | ||
179 | return ret; | ||
180 | |||
181 | return 0; | ||
182 | } | 178 | } |
183 | 179 | ||
184 | static int da9052_i2c_remove(struct i2c_client *client) | 180 | static int da9052_i2c_remove(struct i2c_client *client) |
diff --git a/drivers/mfd/da9052-spi.c b/drivers/mfd/da9052-spi.c index 71b89dd4e8de..b9ea1b27db64 100644 --- a/drivers/mfd/da9052-spi.c +++ b/drivers/mfd/da9052-spi.c | |||
@@ -56,11 +56,7 @@ static int da9052_spi_probe(struct spi_device *spi) | |||
56 | return ret; | 56 | return ret; |
57 | } | 57 | } |
58 | 58 | ||
59 | ret = da9052_device_init(da9052, id->driver_data); | 59 | return da9052_device_init(da9052, id->driver_data); |
60 | if (ret != 0) | ||
61 | return ret; | ||
62 | |||
63 | return 0; | ||
64 | } | 60 | } |
65 | 61 | ||
66 | static int da9052_spi_remove(struct spi_device *spi) | 62 | static int da9052_spi_remove(struct spi_device *spi) |
diff --git a/drivers/mfd/da9062-core.c b/drivers/mfd/da9062-core.c index f80d9471f2e7..a9ad024ec6b0 100644 --- a/drivers/mfd/da9062-core.c +++ b/drivers/mfd/da9062-core.c | |||
@@ -198,7 +198,7 @@ static int da9062_clear_fault_log(struct da9062 *chip) | |||
198 | return ret; | 198 | return ret; |
199 | } | 199 | } |
200 | 200 | ||
201 | int get_device_type(struct da9062 *chip) | 201 | static int da9062_get_device_type(struct da9062 *chip) |
202 | { | 202 | { |
203 | int device_id, variant_id, variant_mrc; | 203 | int device_id, variant_id, variant_mrc; |
204 | int ret; | 204 | int ret; |
@@ -466,7 +466,7 @@ static int da9062_i2c_probe(struct i2c_client *i2c, | |||
466 | if (ret < 0) | 466 | if (ret < 0) |
467 | dev_warn(chip->dev, "Cannot clear fault log\n"); | 467 | dev_warn(chip->dev, "Cannot clear fault log\n"); |
468 | 468 | ||
469 | ret = get_device_type(chip); | 469 | ret = da9062_get_device_type(chip); |
470 | if (ret) | 470 | if (ret) |
471 | return ret; | 471 | return ret; |
472 | 472 | ||
diff --git a/drivers/mfd/da9150-core.c b/drivers/mfd/da9150-core.c index 94b9bbd1a69b..195fdcfa1a0d 100644 --- a/drivers/mfd/da9150-core.c +++ b/drivers/mfd/da9150-core.c | |||
@@ -23,6 +23,77 @@ | |||
23 | #include <linux/mfd/da9150/core.h> | 23 | #include <linux/mfd/da9150/core.h> |
24 | #include <linux/mfd/da9150/registers.h> | 24 | #include <linux/mfd/da9150/registers.h> |
25 | 25 | ||
26 | /* Raw device access, used for QIF */ | ||
27 | static int da9150_i2c_read_device(struct i2c_client *client, u8 addr, int count, | ||
28 | u8 *buf) | ||
29 | { | ||
30 | struct i2c_msg xfer; | ||
31 | int ret; | ||
32 | |||
33 | /* | ||
34 | * Read is split into two transfers as device expects STOP/START rather | ||
35 | * than repeated start to carry out this kind of access. | ||
36 | */ | ||
37 | |||
38 | /* Write address */ | ||
39 | xfer.addr = client->addr; | ||
40 | xfer.flags = 0; | ||
41 | xfer.len = 1; | ||
42 | xfer.buf = &addr; | ||
43 | |||
44 | ret = i2c_transfer(client->adapter, &xfer, 1); | ||
45 | if (ret != 1) { | ||
46 | if (ret < 0) | ||
47 | return ret; | ||
48 | else | ||
49 | return -EIO; | ||
50 | } | ||
51 | |||
52 | /* Read data */ | ||
53 | xfer.addr = client->addr; | ||
54 | xfer.flags = I2C_M_RD; | ||
55 | xfer.len = count; | ||
56 | xfer.buf = buf; | ||
57 | |||
58 | ret = i2c_transfer(client->adapter, &xfer, 1); | ||
59 | if (ret == 1) | ||
60 | return 0; | ||
61 | else if (ret < 0) | ||
62 | return ret; | ||
63 | else | ||
64 | return -EIO; | ||
65 | } | ||
66 | |||
67 | static int da9150_i2c_write_device(struct i2c_client *client, u8 addr, | ||
68 | int count, const u8 *buf) | ||
69 | { | ||
70 | struct i2c_msg xfer; | ||
71 | u8 *reg_data; | ||
72 | int ret; | ||
73 | |||
74 | reg_data = kzalloc(1 + count, GFP_KERNEL); | ||
75 | if (!reg_data) | ||
76 | return -ENOMEM; | ||
77 | |||
78 | reg_data[0] = addr; | ||
79 | memcpy(®_data[1], buf, count); | ||
80 | |||
81 | /* Write address & data */ | ||
82 | xfer.addr = client->addr; | ||
83 | xfer.flags = 0; | ||
84 | xfer.len = 1 + count; | ||
85 | xfer.buf = reg_data; | ||
86 | |||
87 | ret = i2c_transfer(client->adapter, &xfer, 1); | ||
88 | kfree(reg_data); | ||
89 | if (ret == 1) | ||
90 | return 0; | ||
91 | else if (ret < 0) | ||
92 | return ret; | ||
93 | else | ||
94 | return -EIO; | ||
95 | } | ||
96 | |||
26 | static bool da9150_volatile_reg(struct device *dev, unsigned int reg) | 97 | static bool da9150_volatile_reg(struct device *dev, unsigned int reg) |
27 | { | 98 | { |
28 | switch (reg) { | 99 | switch (reg) { |
@@ -107,6 +178,28 @@ static const struct regmap_config da9150_regmap_config = { | |||
107 | .volatile_reg = da9150_volatile_reg, | 178 | .volatile_reg = da9150_volatile_reg, |
108 | }; | 179 | }; |
109 | 180 | ||
181 | void da9150_read_qif(struct da9150 *da9150, u8 addr, int count, u8 *buf) | ||
182 | { | ||
183 | int ret; | ||
184 | |||
185 | ret = da9150_i2c_read_device(da9150->core_qif, addr, count, buf); | ||
186 | if (ret < 0) | ||
187 | dev_err(da9150->dev, "Failed to read from QIF 0x%x: %d\n", | ||
188 | addr, ret); | ||
189 | } | ||
190 | EXPORT_SYMBOL_GPL(da9150_read_qif); | ||
191 | |||
192 | void da9150_write_qif(struct da9150 *da9150, u8 addr, int count, const u8 *buf) | ||
193 | { | ||
194 | int ret; | ||
195 | |||
196 | ret = da9150_i2c_write_device(da9150->core_qif, addr, count, buf); | ||
197 | if (ret < 0) | ||
198 | dev_err(da9150->dev, "Failed to write to QIF 0x%x: %d\n", | ||
199 | addr, ret); | ||
200 | } | ||
201 | EXPORT_SYMBOL_GPL(da9150_write_qif); | ||
202 | |||
110 | u8 da9150_reg_read(struct da9150 *da9150, u16 reg) | 203 | u8 da9150_reg_read(struct da9150 *da9150, u16 reg) |
111 | { | 204 | { |
112 | int val, ret; | 205 | int val, ret; |
@@ -262,54 +355,45 @@ static const struct regmap_irq_chip da9150_regmap_irq_chip = { | |||
262 | }; | 355 | }; |
263 | 356 | ||
264 | static struct resource da9150_gpadc_resources[] = { | 357 | static struct resource da9150_gpadc_resources[] = { |
265 | { | 358 | DEFINE_RES_IRQ_NAMED(DA9150_IRQ_GPADC, "GPADC"), |
266 | .name = "GPADC", | ||
267 | .start = DA9150_IRQ_GPADC, | ||
268 | .end = DA9150_IRQ_GPADC, | ||
269 | .flags = IORESOURCE_IRQ, | ||
270 | }, | ||
271 | }; | 359 | }; |
272 | 360 | ||
273 | static struct resource da9150_charger_resources[] = { | 361 | static struct resource da9150_charger_resources[] = { |
274 | { | 362 | DEFINE_RES_IRQ_NAMED(DA9150_IRQ_CHG, "CHG_STATUS"), |
275 | .name = "CHG_STATUS", | 363 | DEFINE_RES_IRQ_NAMED(DA9150_IRQ_TJUNC, "CHG_TJUNC"), |
276 | .start = DA9150_IRQ_CHG, | 364 | DEFINE_RES_IRQ_NAMED(DA9150_IRQ_VFAULT, "CHG_VFAULT"), |
277 | .end = DA9150_IRQ_CHG, | 365 | DEFINE_RES_IRQ_NAMED(DA9150_IRQ_VBUS, "CHG_VBUS"), |
278 | .flags = IORESOURCE_IRQ, | 366 | }; |
279 | }, | 367 | |
280 | { | 368 | static struct resource da9150_fg_resources[] = { |
281 | .name = "CHG_TJUNC", | 369 | DEFINE_RES_IRQ_NAMED(DA9150_IRQ_FG, "FG"), |
282 | .start = DA9150_IRQ_TJUNC, | 370 | }; |
283 | .end = DA9150_IRQ_TJUNC, | 371 | |
284 | .flags = IORESOURCE_IRQ, | 372 | enum da9150_dev_idx { |
285 | }, | 373 | DA9150_GPADC_IDX = 0, |
286 | { | 374 | DA9150_CHARGER_IDX, |
287 | .name = "CHG_VFAULT", | 375 | DA9150_FG_IDX, |
288 | .start = DA9150_IRQ_VFAULT, | ||
289 | .end = DA9150_IRQ_VFAULT, | ||
290 | .flags = IORESOURCE_IRQ, | ||
291 | }, | ||
292 | { | ||
293 | .name = "CHG_VBUS", | ||
294 | .start = DA9150_IRQ_VBUS, | ||
295 | .end = DA9150_IRQ_VBUS, | ||
296 | .flags = IORESOURCE_IRQ, | ||
297 | }, | ||
298 | }; | 376 | }; |
299 | 377 | ||
300 | static struct mfd_cell da9150_devs[] = { | 378 | static struct mfd_cell da9150_devs[] = { |
301 | { | 379 | [DA9150_GPADC_IDX] = { |
302 | .name = "da9150-gpadc", | 380 | .name = "da9150-gpadc", |
303 | .of_compatible = "dlg,da9150-gpadc", | 381 | .of_compatible = "dlg,da9150-gpadc", |
304 | .resources = da9150_gpadc_resources, | 382 | .resources = da9150_gpadc_resources, |
305 | .num_resources = ARRAY_SIZE(da9150_gpadc_resources), | 383 | .num_resources = ARRAY_SIZE(da9150_gpadc_resources), |
306 | }, | 384 | }, |
307 | { | 385 | [DA9150_CHARGER_IDX] = { |
308 | .name = "da9150-charger", | 386 | .name = "da9150-charger", |
309 | .of_compatible = "dlg,da9150-charger", | 387 | .of_compatible = "dlg,da9150-charger", |
310 | .resources = da9150_charger_resources, | 388 | .resources = da9150_charger_resources, |
311 | .num_resources = ARRAY_SIZE(da9150_charger_resources), | 389 | .num_resources = ARRAY_SIZE(da9150_charger_resources), |
312 | }, | 390 | }, |
391 | [DA9150_FG_IDX] = { | ||
392 | .name = "da9150-fuel-gauge", | ||
393 | .of_compatible = "dlg,da9150-fuel-gauge", | ||
394 | .resources = da9150_fg_resources, | ||
395 | .num_resources = ARRAY_SIZE(da9150_fg_resources), | ||
396 | }, | ||
313 | }; | 397 | }; |
314 | 398 | ||
315 | static int da9150_probe(struct i2c_client *client, | 399 | static int da9150_probe(struct i2c_client *client, |
@@ -317,6 +401,7 @@ static int da9150_probe(struct i2c_client *client, | |||
317 | { | 401 | { |
318 | struct da9150 *da9150; | 402 | struct da9150 *da9150; |
319 | struct da9150_pdata *pdata = dev_get_platdata(&client->dev); | 403 | struct da9150_pdata *pdata = dev_get_platdata(&client->dev); |
404 | int qif_addr; | ||
320 | int ret; | 405 | int ret; |
321 | 406 | ||
322 | da9150 = devm_kzalloc(&client->dev, sizeof(*da9150), GFP_KERNEL); | 407 | da9150 = devm_kzalloc(&client->dev, sizeof(*da9150), GFP_KERNEL); |
@@ -335,16 +420,41 @@ static int da9150_probe(struct i2c_client *client, | |||
335 | return ret; | 420 | return ret; |
336 | } | 421 | } |
337 | 422 | ||
338 | da9150->irq_base = pdata ? pdata->irq_base : -1; | 423 | /* Setup secondary I2C interface for QIF access */ |
424 | qif_addr = da9150_reg_read(da9150, DA9150_CORE2WIRE_CTRL_A); | ||
425 | qif_addr = (qif_addr & DA9150_CORE_BASE_ADDR_MASK) >> 1; | ||
426 | qif_addr |= DA9150_QIF_I2C_ADDR_LSB; | ||
427 | da9150->core_qif = i2c_new_dummy(client->adapter, qif_addr); | ||
428 | if (!da9150->core_qif) { | ||
429 | dev_err(da9150->dev, "Failed to attach QIF client\n"); | ||
430 | return -ENODEV; | ||
431 | } | ||
432 | |||
433 | i2c_set_clientdata(da9150->core_qif, da9150); | ||
434 | |||
435 | if (pdata) { | ||
436 | da9150->irq_base = pdata->irq_base; | ||
437 | |||
438 | da9150_devs[DA9150_FG_IDX].platform_data = pdata->fg_pdata; | ||
439 | da9150_devs[DA9150_FG_IDX].pdata_size = | ||
440 | sizeof(struct da9150_fg_pdata); | ||
441 | } else { | ||
442 | da9150->irq_base = -1; | ||
443 | } | ||
339 | 444 | ||
340 | ret = regmap_add_irq_chip(da9150->regmap, da9150->irq, | 445 | ret = regmap_add_irq_chip(da9150->regmap, da9150->irq, |
341 | IRQF_TRIGGER_LOW | IRQF_ONESHOT, | 446 | IRQF_TRIGGER_LOW | IRQF_ONESHOT, |
342 | da9150->irq_base, &da9150_regmap_irq_chip, | 447 | da9150->irq_base, &da9150_regmap_irq_chip, |
343 | &da9150->regmap_irq_data); | 448 | &da9150->regmap_irq_data); |
344 | if (ret) | 449 | if (ret) { |
345 | return ret; | 450 | dev_err(da9150->dev, "Failed to add regmap irq chip: %d\n", |
451 | ret); | ||
452 | goto regmap_irq_fail; | ||
453 | } | ||
454 | |||
346 | 455 | ||
347 | da9150->irq_base = regmap_irq_chip_get_base(da9150->regmap_irq_data); | 456 | da9150->irq_base = regmap_irq_chip_get_base(da9150->regmap_irq_data); |
457 | |||
348 | enable_irq_wake(da9150->irq); | 458 | enable_irq_wake(da9150->irq); |
349 | 459 | ||
350 | ret = mfd_add_devices(da9150->dev, -1, da9150_devs, | 460 | ret = mfd_add_devices(da9150->dev, -1, da9150_devs, |
@@ -352,11 +462,17 @@ static int da9150_probe(struct i2c_client *client, | |||
352 | da9150->irq_base, NULL); | 462 | da9150->irq_base, NULL); |
353 | if (ret) { | 463 | if (ret) { |
354 | dev_err(da9150->dev, "Failed to add child devices: %d\n", ret); | 464 | dev_err(da9150->dev, "Failed to add child devices: %d\n", ret); |
355 | regmap_del_irq_chip(da9150->irq, da9150->regmap_irq_data); | 465 | goto mfd_fail; |
356 | return ret; | ||
357 | } | 466 | } |
358 | 467 | ||
359 | return 0; | 468 | return 0; |
469 | |||
470 | mfd_fail: | ||
471 | regmap_del_irq_chip(da9150->irq, da9150->regmap_irq_data); | ||
472 | regmap_irq_fail: | ||
473 | i2c_unregister_device(da9150->core_qif); | ||
474 | |||
475 | return ret; | ||
360 | } | 476 | } |
361 | 477 | ||
362 | static int da9150_remove(struct i2c_client *client) | 478 | static int da9150_remove(struct i2c_client *client) |
@@ -365,6 +481,7 @@ static int da9150_remove(struct i2c_client *client) | |||
365 | 481 | ||
366 | regmap_del_irq_chip(da9150->irq, da9150->regmap_irq_data); | 482 | regmap_del_irq_chip(da9150->irq, da9150->regmap_irq_data); |
367 | mfd_remove_devices(da9150->dev); | 483 | mfd_remove_devices(da9150->dev); |
484 | i2c_unregister_device(da9150->core_qif); | ||
368 | 485 | ||
369 | return 0; | 486 | return 0; |
370 | } | 487 | } |
diff --git a/drivers/mfd/hi6421-pmic-core.c b/drivers/mfd/hi6421-pmic-core.c index 95b2ff8f223a..f9ded45a992d 100644 --- a/drivers/mfd/hi6421-pmic-core.c +++ b/drivers/mfd/hi6421-pmic-core.c | |||
@@ -97,6 +97,7 @@ static const struct of_device_id of_hi6421_pmic_match_tbl[] = { | |||
97 | { .compatible = "hisilicon,hi6421-pmic", }, | 97 | { .compatible = "hisilicon,hi6421-pmic", }, |
98 | { }, | 98 | { }, |
99 | }; | 99 | }; |
100 | MODULE_DEVICE_TABLE(of, of_hi6421_pmic_match_tbl); | ||
100 | 101 | ||
101 | static struct platform_driver hi6421_pmic_driver = { | 102 | static struct platform_driver hi6421_pmic_driver = { |
102 | .driver = { | 103 | .driver = { |
diff --git a/drivers/mfd/htc-i2cpld.c b/drivers/mfd/htc-i2cpld.c index 1bd5b042c8b3..0c6ff727b2ec 100644 --- a/drivers/mfd/htc-i2cpld.c +++ b/drivers/mfd/htc-i2cpld.c | |||
@@ -318,7 +318,6 @@ static int htcpld_setup_chip_irq( | |||
318 | struct htcpld_data *htcpld; | 318 | struct htcpld_data *htcpld; |
319 | struct htcpld_chip *chip; | 319 | struct htcpld_chip *chip; |
320 | unsigned int irq, irq_end; | 320 | unsigned int irq, irq_end; |
321 | int ret = 0; | ||
322 | 321 | ||
323 | /* Get the platform and driver data */ | 322 | /* Get the platform and driver data */ |
324 | htcpld = platform_get_drvdata(pdev); | 323 | htcpld = platform_get_drvdata(pdev); |
@@ -333,7 +332,7 @@ static int htcpld_setup_chip_irq( | |||
333 | irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); | 332 | irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); |
334 | } | 333 | } |
335 | 334 | ||
336 | return ret; | 335 | return 0; |
337 | } | 336 | } |
338 | 337 | ||
339 | static int htcpld_register_chip_i2c( | 338 | static int htcpld_register_chip_i2c( |
diff --git a/drivers/mfd/intel-lpss-acpi.c b/drivers/mfd/intel-lpss-acpi.c index 0d92d73bfa0e..b6fd9041f82f 100644 --- a/drivers/mfd/intel-lpss-acpi.c +++ b/drivers/mfd/intel-lpss-acpi.c | |||
@@ -25,10 +25,26 @@ static const struct intel_lpss_platform_info spt_info = { | |||
25 | .clk_rate = 120000000, | 25 | .clk_rate = 120000000, |
26 | }; | 26 | }; |
27 | 27 | ||
28 | static const struct intel_lpss_platform_info bxt_info = { | ||
29 | .clk_rate = 100000000, | ||
30 | }; | ||
31 | |||
32 | static const struct intel_lpss_platform_info bxt_i2c_info = { | ||
33 | .clk_rate = 133000000, | ||
34 | }; | ||
35 | |||
28 | static const struct acpi_device_id intel_lpss_acpi_ids[] = { | 36 | static const struct acpi_device_id intel_lpss_acpi_ids[] = { |
29 | /* SPT */ | 37 | /* SPT */ |
30 | { "INT3446", (kernel_ulong_t)&spt_info }, | 38 | { "INT3446", (kernel_ulong_t)&spt_info }, |
31 | { "INT3447", (kernel_ulong_t)&spt_info }, | 39 | { "INT3447", (kernel_ulong_t)&spt_info }, |
40 | /* BXT */ | ||
41 | { "80860AAC", (kernel_ulong_t)&bxt_i2c_info }, | ||
42 | { "80860ABC", (kernel_ulong_t)&bxt_info }, | ||
43 | { "80860AC2", (kernel_ulong_t)&bxt_info }, | ||
44 | /* APL */ | ||
45 | { "80865AAC", (kernel_ulong_t)&bxt_i2c_info }, | ||
46 | { "80865ABC", (kernel_ulong_t)&bxt_info }, | ||
47 | { "80865AC2", (kernel_ulong_t)&bxt_info }, | ||
32 | { } | 48 | { } |
33 | }; | 49 | }; |
34 | MODULE_DEVICE_TABLE(acpi, intel_lpss_acpi_ids); | 50 | MODULE_DEVICE_TABLE(acpi, intel_lpss_acpi_ids); |
diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c index 9236dffeb4d6..5bfdfccbb9a1 100644 --- a/drivers/mfd/intel-lpss-pci.c +++ b/drivers/mfd/intel-lpss-pci.c | |||
@@ -70,7 +70,52 @@ static const struct intel_lpss_platform_info spt_uart_info = { | |||
70 | .clk_con_id = "baudclk", | 70 | .clk_con_id = "baudclk", |
71 | }; | 71 | }; |
72 | 72 | ||
73 | static const struct intel_lpss_platform_info bxt_info = { | ||
74 | .clk_rate = 100000000, | ||
75 | }; | ||
76 | |||
77 | static const struct intel_lpss_platform_info bxt_uart_info = { | ||
78 | .clk_rate = 100000000, | ||
79 | .clk_con_id = "baudclk", | ||
80 | }; | ||
81 | |||
82 | static const struct intel_lpss_platform_info bxt_i2c_info = { | ||
83 | .clk_rate = 133000000, | ||
84 | }; | ||
85 | |||
73 | static const struct pci_device_id intel_lpss_pci_ids[] = { | 86 | static const struct pci_device_id intel_lpss_pci_ids[] = { |
87 | /* BXT */ | ||
88 | { PCI_VDEVICE(INTEL, 0x0aac), (kernel_ulong_t)&bxt_i2c_info }, | ||
89 | { PCI_VDEVICE(INTEL, 0x0aae), (kernel_ulong_t)&bxt_i2c_info }, | ||
90 | { PCI_VDEVICE(INTEL, 0x0ab0), (kernel_ulong_t)&bxt_i2c_info }, | ||
91 | { PCI_VDEVICE(INTEL, 0x0ab2), (kernel_ulong_t)&bxt_i2c_info }, | ||
92 | { PCI_VDEVICE(INTEL, 0x0ab4), (kernel_ulong_t)&bxt_i2c_info }, | ||
93 | { PCI_VDEVICE(INTEL, 0x0ab6), (kernel_ulong_t)&bxt_i2c_info }, | ||
94 | { PCI_VDEVICE(INTEL, 0x0ab8), (kernel_ulong_t)&bxt_i2c_info }, | ||
95 | { PCI_VDEVICE(INTEL, 0x0aba), (kernel_ulong_t)&bxt_i2c_info }, | ||
96 | { PCI_VDEVICE(INTEL, 0x0abc), (kernel_ulong_t)&bxt_uart_info }, | ||
97 | { PCI_VDEVICE(INTEL, 0x0abe), (kernel_ulong_t)&bxt_uart_info }, | ||
98 | { PCI_VDEVICE(INTEL, 0x0ac0), (kernel_ulong_t)&bxt_uart_info }, | ||
99 | { PCI_VDEVICE(INTEL, 0x0ac2), (kernel_ulong_t)&bxt_info }, | ||
100 | { PCI_VDEVICE(INTEL, 0x0ac4), (kernel_ulong_t)&bxt_info }, | ||
101 | { PCI_VDEVICE(INTEL, 0x0ac6), (kernel_ulong_t)&bxt_info }, | ||
102 | { PCI_VDEVICE(INTEL, 0x0aee), (kernel_ulong_t)&bxt_uart_info }, | ||
103 | /* APL */ | ||
104 | { PCI_VDEVICE(INTEL, 0x5aac), (kernel_ulong_t)&bxt_i2c_info }, | ||
105 | { PCI_VDEVICE(INTEL, 0x5aae), (kernel_ulong_t)&bxt_i2c_info }, | ||
106 | { PCI_VDEVICE(INTEL, 0x5ab0), (kernel_ulong_t)&bxt_i2c_info }, | ||
107 | { PCI_VDEVICE(INTEL, 0x5ab2), (kernel_ulong_t)&bxt_i2c_info }, | ||
108 | { PCI_VDEVICE(INTEL, 0x5ab4), (kernel_ulong_t)&bxt_i2c_info }, | ||
109 | { PCI_VDEVICE(INTEL, 0x5ab6), (kernel_ulong_t)&bxt_i2c_info }, | ||
110 | { PCI_VDEVICE(INTEL, 0x5ab8), (kernel_ulong_t)&bxt_i2c_info }, | ||
111 | { PCI_VDEVICE(INTEL, 0x5aba), (kernel_ulong_t)&bxt_i2c_info }, | ||
112 | { PCI_VDEVICE(INTEL, 0x5abc), (kernel_ulong_t)&bxt_uart_info }, | ||
113 | { PCI_VDEVICE(INTEL, 0x5abe), (kernel_ulong_t)&bxt_uart_info }, | ||
114 | { PCI_VDEVICE(INTEL, 0x5ac0), (kernel_ulong_t)&bxt_uart_info }, | ||
115 | { PCI_VDEVICE(INTEL, 0x5ac2), (kernel_ulong_t)&bxt_info }, | ||
116 | { PCI_VDEVICE(INTEL, 0x5ac4), (kernel_ulong_t)&bxt_info }, | ||
117 | { PCI_VDEVICE(INTEL, 0x5ac6), (kernel_ulong_t)&bxt_info }, | ||
118 | { PCI_VDEVICE(INTEL, 0x5aee), (kernel_ulong_t)&bxt_uart_info }, | ||
74 | /* SPT-LP */ | 119 | /* SPT-LP */ |
75 | { PCI_VDEVICE(INTEL, 0x9d27), (kernel_ulong_t)&spt_uart_info }, | 120 | { PCI_VDEVICE(INTEL, 0x9d27), (kernel_ulong_t)&spt_uart_info }, |
76 | { PCI_VDEVICE(INTEL, 0x9d28), (kernel_ulong_t)&spt_uart_info }, | 121 | { PCI_VDEVICE(INTEL, 0x9d28), (kernel_ulong_t)&spt_uart_info }, |
diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c index fdf4d5c1add2..001a7d7708ce 100644 --- a/drivers/mfd/intel-lpss.c +++ b/drivers/mfd/intel-lpss.c | |||
@@ -26,6 +26,8 @@ | |||
26 | #include <linux/pm_runtime.h> | 26 | #include <linux/pm_runtime.h> |
27 | #include <linux/seq_file.h> | 27 | #include <linux/seq_file.h> |
28 | 28 | ||
29 | #include <asm-generic/io-64-nonatomic-lo-hi.h> | ||
30 | |||
29 | #include "intel-lpss.h" | 31 | #include "intel-lpss.h" |
30 | 32 | ||
31 | #define LPSS_DEV_OFFSET 0x000 | 33 | #define LPSS_DEV_OFFSET 0x000 |
@@ -52,8 +54,7 @@ | |||
52 | #define LPSS_PRIV_SSP_REG 0x20 | 54 | #define LPSS_PRIV_SSP_REG 0x20 |
53 | #define LPSS_PRIV_SSP_REG_DIS_DMA_FIN BIT(0) | 55 | #define LPSS_PRIV_SSP_REG_DIS_DMA_FIN BIT(0) |
54 | 56 | ||
55 | #define LPSS_PRIV_REMAP_ADDR_LO 0x40 | 57 | #define LPSS_PRIV_REMAP_ADDR 0x40 |
56 | #define LPSS_PRIV_REMAP_ADDR_HI 0x44 | ||
57 | 58 | ||
58 | #define LPSS_PRIV_CAPS 0xfc | 59 | #define LPSS_PRIV_CAPS 0xfc |
59 | #define LPSS_PRIV_CAPS_NO_IDMA BIT(8) | 60 | #define LPSS_PRIV_CAPS_NO_IDMA BIT(8) |
@@ -250,12 +251,7 @@ static void intel_lpss_set_remap_addr(const struct intel_lpss *lpss) | |||
250 | { | 251 | { |
251 | resource_size_t addr = lpss->info->mem->start; | 252 | resource_size_t addr = lpss->info->mem->start; |
252 | 253 | ||
253 | writel(addr, lpss->priv + LPSS_PRIV_REMAP_ADDR_LO); | 254 | lo_hi_writeq(addr, lpss->priv + LPSS_PRIV_REMAP_ADDR); |
254 | #if BITS_PER_LONG > 32 | ||
255 | writel(addr >> 32, lpss->priv + LPSS_PRIV_REMAP_ADDR_HI); | ||
256 | #else | ||
257 | writel(0, lpss->priv + LPSS_PRIV_REMAP_ADDR_HI); | ||
258 | #endif | ||
259 | } | 255 | } |
260 | 256 | ||
261 | static void intel_lpss_deassert_reset(const struct intel_lpss *lpss) | 257 | static void intel_lpss_deassert_reset(const struct intel_lpss *lpss) |
diff --git a/drivers/mfd/intel_quark_i2c_gpio.c b/drivers/mfd/intel_quark_i2c_gpio.c index 1ce16037d043..042137465300 100644 --- a/drivers/mfd/intel_quark_i2c_gpio.c +++ b/drivers/mfd/intel_quark_i2c_gpio.c | |||
@@ -31,6 +31,10 @@ | |||
31 | #define MFD_I2C_BAR 0 | 31 | #define MFD_I2C_BAR 0 |
32 | #define MFD_GPIO_BAR 1 | 32 | #define MFD_GPIO_BAR 1 |
33 | 33 | ||
34 | /* ACPI _ADR value to match the child node */ | ||
35 | #define MFD_ACPI_MATCH_GPIO 0ULL | ||
36 | #define MFD_ACPI_MATCH_I2C 1ULL | ||
37 | |||
34 | /* The base GPIO number under GPIOLIB framework */ | 38 | /* The base GPIO number under GPIOLIB framework */ |
35 | #define INTEL_QUARK_MFD_GPIO_BASE 8 | 39 | #define INTEL_QUARK_MFD_GPIO_BASE 8 |
36 | 40 | ||
@@ -82,27 +86,37 @@ static struct resource intel_quark_i2c_res[] = { | |||
82 | }, | 86 | }, |
83 | }; | 87 | }; |
84 | 88 | ||
89 | static struct mfd_cell_acpi_match intel_quark_acpi_match_i2c = { | ||
90 | .adr = MFD_ACPI_MATCH_I2C, | ||
91 | }; | ||
92 | |||
85 | static struct resource intel_quark_gpio_res[] = { | 93 | static struct resource intel_quark_gpio_res[] = { |
86 | [INTEL_QUARK_IORES_MEM] = { | 94 | [INTEL_QUARK_IORES_MEM] = { |
87 | .flags = IORESOURCE_MEM, | 95 | .flags = IORESOURCE_MEM, |
88 | }, | 96 | }, |
89 | }; | 97 | }; |
90 | 98 | ||
99 | static struct mfd_cell_acpi_match intel_quark_acpi_match_gpio = { | ||
100 | .adr = MFD_ACPI_MATCH_GPIO, | ||
101 | }; | ||
102 | |||
91 | static struct mfd_cell intel_quark_mfd_cells[] = { | 103 | static struct mfd_cell intel_quark_mfd_cells[] = { |
92 | { | 104 | { |
93 | .id = MFD_I2C_BAR, | ||
94 | .name = "i2c_designware", | ||
95 | .num_resources = ARRAY_SIZE(intel_quark_i2c_res), | ||
96 | .resources = intel_quark_i2c_res, | ||
97 | .ignore_resource_conflicts = true, | ||
98 | }, | ||
99 | { | ||
100 | .id = MFD_GPIO_BAR, | 105 | .id = MFD_GPIO_BAR, |
101 | .name = "gpio-dwapb", | 106 | .name = "gpio-dwapb", |
107 | .acpi_match = &intel_quark_acpi_match_gpio, | ||
102 | .num_resources = ARRAY_SIZE(intel_quark_gpio_res), | 108 | .num_resources = ARRAY_SIZE(intel_quark_gpio_res), |
103 | .resources = intel_quark_gpio_res, | 109 | .resources = intel_quark_gpio_res, |
104 | .ignore_resource_conflicts = true, | 110 | .ignore_resource_conflicts = true, |
105 | }, | 111 | }, |
112 | { | ||
113 | .id = MFD_I2C_BAR, | ||
114 | .name = "i2c_designware", | ||
115 | .acpi_match = &intel_quark_acpi_match_i2c, | ||
116 | .num_resources = ARRAY_SIZE(intel_quark_i2c_res), | ||
117 | .resources = intel_quark_i2c_res, | ||
118 | .ignore_resource_conflicts = true, | ||
119 | }, | ||
106 | }; | 120 | }; |
107 | 121 | ||
108 | static const struct pci_device_id intel_quark_mfd_ids[] = { | 122 | static const struct pci_device_id intel_quark_mfd_ids[] = { |
@@ -248,12 +262,11 @@ static int intel_quark_mfd_probe(struct pci_dev *pdev, | |||
248 | 262 | ||
249 | dev_set_drvdata(&pdev->dev, quark_mfd); | 263 | dev_set_drvdata(&pdev->dev, quark_mfd); |
250 | 264 | ||
251 | ret = intel_quark_i2c_setup(pdev, &intel_quark_mfd_cells[MFD_I2C_BAR]); | 265 | ret = intel_quark_i2c_setup(pdev, &intel_quark_mfd_cells[1]); |
252 | if (ret) | 266 | if (ret) |
253 | return ret; | 267 | return ret; |
254 | 268 | ||
255 | ret = intel_quark_gpio_setup(pdev, | 269 | ret = intel_quark_gpio_setup(pdev, &intel_quark_mfd_cells[0]); |
256 | &intel_quark_mfd_cells[MFD_GPIO_BAR]); | ||
257 | if (ret) | 270 | if (ret) |
258 | return ret; | 271 | return ret; |
259 | 272 | ||
diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c new file mode 100644 index 000000000000..b9428767e615 --- /dev/null +++ b/drivers/mfd/intel_soc_pmic_bxtwc.c | |||
@@ -0,0 +1,477 @@ | |||
1 | /* | ||
2 | * MFD core driver for Intel Broxton Whiskey Cove PMIC | ||
3 | * | ||
4 | * Copyright (C) 2015 Intel Corporation. All rights reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms and conditions of the GNU General Public License, | ||
8 | * version 2, as published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
13 | * more details. | ||
14 | */ | ||
15 | |||
16 | #include <linux/module.h> | ||
17 | #include <linux/acpi.h> | ||
18 | #include <linux/err.h> | ||
19 | #include <linux/delay.h> | ||
20 | #include <linux/interrupt.h> | ||
21 | #include <linux/kernel.h> | ||
22 | #include <linux/mfd/core.h> | ||
23 | #include <linux/mfd/intel_bxtwc.h> | ||
24 | #include <asm/intel_pmc_ipc.h> | ||
25 | |||
26 | /* PMIC device registers */ | ||
27 | #define REG_ADDR_MASK 0xFF00 | ||
28 | #define REG_ADDR_SHIFT 8 | ||
29 | #define REG_OFFSET_MASK 0xFF | ||
30 | |||
31 | /* Interrupt Status Registers */ | ||
32 | #define BXTWC_IRQLVL1 0x4E02 | ||
33 | #define BXTWC_PWRBTNIRQ 0x4E03 | ||
34 | |||
35 | #define BXTWC_THRM0IRQ 0x4E04 | ||
36 | #define BXTWC_THRM1IRQ 0x4E05 | ||
37 | #define BXTWC_THRM2IRQ 0x4E06 | ||
38 | #define BXTWC_BCUIRQ 0x4E07 | ||
39 | #define BXTWC_ADCIRQ 0x4E08 | ||
40 | #define BXTWC_CHGR0IRQ 0x4E09 | ||
41 | #define BXTWC_CHGR1IRQ 0x4E0A | ||
42 | #define BXTWC_GPIOIRQ0 0x4E0B | ||
43 | #define BXTWC_GPIOIRQ1 0x4E0C | ||
44 | #define BXTWC_CRITIRQ 0x4E0D | ||
45 | |||
46 | /* Interrupt MASK Registers */ | ||
47 | #define BXTWC_MIRQLVL1 0x4E0E | ||
48 | #define BXTWC_MPWRTNIRQ 0x4E0F | ||
49 | |||
50 | #define BXTWC_MTHRM0IRQ 0x4E12 | ||
51 | #define BXTWC_MTHRM1IRQ 0x4E13 | ||
52 | #define BXTWC_MTHRM2IRQ 0x4E14 | ||
53 | #define BXTWC_MBCUIRQ 0x4E15 | ||
54 | #define BXTWC_MADCIRQ 0x4E16 | ||
55 | #define BXTWC_MCHGR0IRQ 0x4E17 | ||
56 | #define BXTWC_MCHGR1IRQ 0x4E18 | ||
57 | #define BXTWC_MGPIO0IRQ 0x4E19 | ||
58 | #define BXTWC_MGPIO1IRQ 0x4E1A | ||
59 | #define BXTWC_MCRITIRQ 0x4E1B | ||
60 | |||
61 | /* Whiskey Cove PMIC share same ACPI ID between different platforms */ | ||
62 | #define BROXTON_PMIC_WC_HRV 4 | ||
63 | |||
64 | /* Manage in two IRQ chips since mask registers are not consecutive */ | ||
65 | enum bxtwc_irqs { | ||
66 | /* Level 1 */ | ||
67 | BXTWC_PWRBTN_LVL1_IRQ = 0, | ||
68 | BXTWC_TMU_LVL1_IRQ, | ||
69 | BXTWC_THRM_LVL1_IRQ, | ||
70 | BXTWC_BCU_LVL1_IRQ, | ||
71 | BXTWC_ADC_LVL1_IRQ, | ||
72 | BXTWC_CHGR_LVL1_IRQ, | ||
73 | BXTWC_GPIO_LVL1_IRQ, | ||
74 | BXTWC_CRIT_LVL1_IRQ, | ||
75 | |||
76 | /* Level 2 */ | ||
77 | BXTWC_PWRBTN_IRQ, | ||
78 | }; | ||
79 | |||
80 | enum bxtwc_irqs_level2 { | ||
81 | /* Level 2 */ | ||
82 | BXTWC_THRM0_IRQ = 0, | ||
83 | BXTWC_THRM1_IRQ, | ||
84 | BXTWC_THRM2_IRQ, | ||
85 | BXTWC_BCU_IRQ, | ||
86 | BXTWC_ADC_IRQ, | ||
87 | BXTWC_CHGR0_IRQ, | ||
88 | BXTWC_CHGR1_IRQ, | ||
89 | BXTWC_GPIO0_IRQ, | ||
90 | BXTWC_GPIO1_IRQ, | ||
91 | BXTWC_CRIT_IRQ, | ||
92 | }; | ||
93 | |||
94 | static const struct regmap_irq bxtwc_regmap_irqs[] = { | ||
95 | REGMAP_IRQ_REG(BXTWC_PWRBTN_LVL1_IRQ, 0, BIT(0)), | ||
96 | REGMAP_IRQ_REG(BXTWC_TMU_LVL1_IRQ, 0, BIT(1)), | ||
97 | REGMAP_IRQ_REG(BXTWC_THRM_LVL1_IRQ, 0, BIT(2)), | ||
98 | REGMAP_IRQ_REG(BXTWC_BCU_LVL1_IRQ, 0, BIT(3)), | ||
99 | REGMAP_IRQ_REG(BXTWC_ADC_LVL1_IRQ, 0, BIT(4)), | ||
100 | REGMAP_IRQ_REG(BXTWC_CHGR_LVL1_IRQ, 0, BIT(5)), | ||
101 | REGMAP_IRQ_REG(BXTWC_GPIO_LVL1_IRQ, 0, BIT(6)), | ||
102 | REGMAP_IRQ_REG(BXTWC_CRIT_LVL1_IRQ, 0, BIT(7)), | ||
103 | REGMAP_IRQ_REG(BXTWC_PWRBTN_IRQ, 1, 0x03), | ||
104 | }; | ||
105 | |||
106 | static const struct regmap_irq bxtwc_regmap_irqs_level2[] = { | ||
107 | REGMAP_IRQ_REG(BXTWC_THRM0_IRQ, 0, 0xff), | ||
108 | REGMAP_IRQ_REG(BXTWC_THRM1_IRQ, 1, 0xbf), | ||
109 | REGMAP_IRQ_REG(BXTWC_THRM2_IRQ, 2, 0xff), | ||
110 | REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 3, 0x1f), | ||
111 | REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 4, 0xff), | ||
112 | REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 5, 0x1f), | ||
113 | REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 6, 0x1f), | ||
114 | REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 7, 0xff), | ||
115 | REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 8, 0x3f), | ||
116 | REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 9, 0x03), | ||
117 | }; | ||
118 | |||
119 | static struct regmap_irq_chip bxtwc_regmap_irq_chip = { | ||
120 | .name = "bxtwc_irq_chip", | ||
121 | .status_base = BXTWC_IRQLVL1, | ||
122 | .mask_base = BXTWC_MIRQLVL1, | ||
123 | .irqs = bxtwc_regmap_irqs, | ||
124 | .num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs), | ||
125 | .num_regs = 2, | ||
126 | }; | ||
127 | |||
128 | static struct regmap_irq_chip bxtwc_regmap_irq_chip_level2 = { | ||
129 | .name = "bxtwc_irq_chip_level2", | ||
130 | .status_base = BXTWC_THRM0IRQ, | ||
131 | .mask_base = BXTWC_MTHRM0IRQ, | ||
132 | .irqs = bxtwc_regmap_irqs_level2, | ||
133 | .num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_level2), | ||
134 | .num_regs = 10, | ||
135 | }; | ||
136 | |||
137 | static struct resource gpio_resources[] = { | ||
138 | DEFINE_RES_IRQ_NAMED(BXTWC_GPIO0_IRQ, "GPIO0"), | ||
139 | DEFINE_RES_IRQ_NAMED(BXTWC_GPIO1_IRQ, "GPIO1"), | ||
140 | }; | ||
141 | |||
142 | static struct resource adc_resources[] = { | ||
143 | DEFINE_RES_IRQ_NAMED(BXTWC_ADC_IRQ, "ADC"), | ||
144 | }; | ||
145 | |||
146 | static struct resource charger_resources[] = { | ||
147 | DEFINE_RES_IRQ_NAMED(BXTWC_CHGR0_IRQ, "CHARGER"), | ||
148 | DEFINE_RES_IRQ_NAMED(BXTWC_CHGR1_IRQ, "CHARGER1"), | ||
149 | }; | ||
150 | |||
151 | static struct resource thermal_resources[] = { | ||
152 | DEFINE_RES_IRQ(BXTWC_THRM0_IRQ), | ||
153 | DEFINE_RES_IRQ(BXTWC_THRM1_IRQ), | ||
154 | DEFINE_RES_IRQ(BXTWC_THRM2_IRQ), | ||
155 | }; | ||
156 | |||
157 | static struct resource bcu_resources[] = { | ||
158 | DEFINE_RES_IRQ_NAMED(BXTWC_BCU_IRQ, "BCU"), | ||
159 | }; | ||
160 | |||
161 | static struct mfd_cell bxt_wc_dev[] = { | ||
162 | { | ||
163 | .name = "bxt_wcove_gpadc", | ||
164 | .num_resources = ARRAY_SIZE(adc_resources), | ||
165 | .resources = adc_resources, | ||
166 | }, | ||
167 | { | ||
168 | .name = "bxt_wcove_thermal", | ||
169 | .num_resources = ARRAY_SIZE(thermal_resources), | ||
170 | .resources = thermal_resources, | ||
171 | }, | ||
172 | { | ||
173 | .name = "bxt_wcove_ext_charger", | ||
174 | .num_resources = ARRAY_SIZE(charger_resources), | ||
175 | .resources = charger_resources, | ||
176 | }, | ||
177 | { | ||
178 | .name = "bxt_wcove_bcu", | ||
179 | .num_resources = ARRAY_SIZE(bcu_resources), | ||
180 | .resources = bcu_resources, | ||
181 | }, | ||
182 | { | ||
183 | .name = "bxt_wcove_gpio", | ||
184 | .num_resources = ARRAY_SIZE(gpio_resources), | ||
185 | .resources = gpio_resources, | ||
186 | }, | ||
187 | { | ||
188 | .name = "bxt_wcove_region", | ||
189 | }, | ||
190 | }; | ||
191 | |||
192 | static int regmap_ipc_byte_reg_read(void *context, unsigned int reg, | ||
193 | unsigned int *val) | ||
194 | { | ||
195 | int ret; | ||
196 | int i2c_addr; | ||
197 | u8 ipc_in[2]; | ||
198 | u8 ipc_out[4]; | ||
199 | struct intel_soc_pmic *pmic = context; | ||
200 | |||
201 | if (reg & REG_ADDR_MASK) | ||
202 | i2c_addr = (reg & REG_ADDR_MASK) >> REG_ADDR_SHIFT; | ||
203 | else { | ||
204 | i2c_addr = BXTWC_DEVICE1_ADDR; | ||
205 | if (!i2c_addr) { | ||
206 | dev_err(pmic->dev, "I2C address not set\n"); | ||
207 | return -EINVAL; | ||
208 | } | ||
209 | } | ||
210 | reg &= REG_OFFSET_MASK; | ||
211 | |||
212 | ipc_in[0] = reg; | ||
213 | ipc_in[1] = i2c_addr; | ||
214 | ret = intel_pmc_ipc_command(PMC_IPC_PMIC_ACCESS, | ||
215 | PMC_IPC_PMIC_ACCESS_READ, | ||
216 | ipc_in, sizeof(ipc_in), (u32 *)ipc_out, 1); | ||
217 | if (ret) { | ||
218 | dev_err(pmic->dev, "Failed to read from PMIC\n"); | ||
219 | return ret; | ||
220 | } | ||
221 | *val = ipc_out[0]; | ||
222 | |||
223 | return 0; | ||
224 | } | ||
225 | |||
226 | static int regmap_ipc_byte_reg_write(void *context, unsigned int reg, | ||
227 | unsigned int val) | ||
228 | { | ||
229 | int ret; | ||
230 | int i2c_addr; | ||
231 | u8 ipc_in[3]; | ||
232 | struct intel_soc_pmic *pmic = context; | ||
233 | |||
234 | if (reg & REG_ADDR_MASK) | ||
235 | i2c_addr = (reg & REG_ADDR_MASK) >> REG_ADDR_SHIFT; | ||
236 | else { | ||
237 | i2c_addr = BXTWC_DEVICE1_ADDR; | ||
238 | if (!i2c_addr) { | ||
239 | dev_err(pmic->dev, "I2C address not set\n"); | ||
240 | return -EINVAL; | ||
241 | } | ||
242 | } | ||
243 | reg &= REG_OFFSET_MASK; | ||
244 | |||
245 | ipc_in[0] = reg; | ||
246 | ipc_in[1] = i2c_addr; | ||
247 | ipc_in[2] = val; | ||
248 | ret = intel_pmc_ipc_command(PMC_IPC_PMIC_ACCESS, | ||
249 | PMC_IPC_PMIC_ACCESS_WRITE, | ||
250 | ipc_in, sizeof(ipc_in), NULL, 0); | ||
251 | if (ret) { | ||
252 | dev_err(pmic->dev, "Failed to write to PMIC\n"); | ||
253 | return ret; | ||
254 | } | ||
255 | |||
256 | return 0; | ||
257 | } | ||
258 | |||
259 | /* sysfs interfaces to r/w PMIC registers, required by initial script */ | ||
260 | static unsigned long bxtwc_reg_addr; | ||
261 | static ssize_t bxtwc_reg_show(struct device *dev, | ||
262 | struct device_attribute *attr, char *buf) | ||
263 | { | ||
264 | return sprintf(buf, "0x%lx\n", bxtwc_reg_addr); | ||
265 | } | ||
266 | |||
267 | static ssize_t bxtwc_reg_store(struct device *dev, | ||
268 | struct device_attribute *attr, const char *buf, size_t count) | ||
269 | { | ||
270 | if (kstrtoul(buf, 0, &bxtwc_reg_addr)) { | ||
271 | dev_err(dev, "Invalid register address\n"); | ||
272 | return -EINVAL; | ||
273 | } | ||
274 | return (ssize_t)count; | ||
275 | } | ||
276 | |||
277 | static ssize_t bxtwc_val_show(struct device *dev, | ||
278 | struct device_attribute *attr, char *buf) | ||
279 | { | ||
280 | int ret; | ||
281 | unsigned int val; | ||
282 | struct intel_soc_pmic *pmic = dev_get_drvdata(dev); | ||
283 | |||
284 | ret = regmap_read(pmic->regmap, bxtwc_reg_addr, &val); | ||
285 | if (ret < 0) { | ||
286 | dev_err(dev, "Failed to read 0x%lx\n", bxtwc_reg_addr); | ||
287 | return -EIO; | ||
288 | } | ||
289 | |||
290 | return sprintf(buf, "0x%02x\n", val); | ||
291 | } | ||
292 | |||
293 | static ssize_t bxtwc_val_store(struct device *dev, | ||
294 | struct device_attribute *attr, const char *buf, size_t count) | ||
295 | { | ||
296 | int ret; | ||
297 | unsigned int val; | ||
298 | struct intel_soc_pmic *pmic = dev_get_drvdata(dev); | ||
299 | |||
300 | ret = kstrtouint(buf, 0, &val); | ||
301 | if (ret) | ||
302 | return ret; | ||
303 | |||
304 | ret = regmap_write(pmic->regmap, bxtwc_reg_addr, val); | ||
305 | if (ret) { | ||
306 | dev_err(dev, "Failed to write value 0x%02x to address 0x%lx", | ||
307 | val, bxtwc_reg_addr); | ||
308 | return -EIO; | ||
309 | } | ||
310 | return count; | ||
311 | } | ||
312 | |||
313 | static DEVICE_ATTR(addr, S_IWUSR | S_IRUSR, bxtwc_reg_show, bxtwc_reg_store); | ||
314 | static DEVICE_ATTR(val, S_IWUSR | S_IRUSR, bxtwc_val_show, bxtwc_val_store); | ||
315 | static struct attribute *bxtwc_attrs[] = { | ||
316 | &dev_attr_addr.attr, | ||
317 | &dev_attr_val.attr, | ||
318 | NULL | ||
319 | }; | ||
320 | |||
321 | static const struct attribute_group bxtwc_group = { | ||
322 | .attrs = bxtwc_attrs, | ||
323 | }; | ||
324 | |||
325 | static const struct regmap_config bxtwc_regmap_config = { | ||
326 | .reg_bits = 16, | ||
327 | .val_bits = 8, | ||
328 | .reg_write = regmap_ipc_byte_reg_write, | ||
329 | .reg_read = regmap_ipc_byte_reg_read, | ||
330 | }; | ||
331 | |||
332 | static int bxtwc_probe(struct platform_device *pdev) | ||
333 | { | ||
334 | int ret; | ||
335 | acpi_handle handle; | ||
336 | acpi_status status; | ||
337 | unsigned long long hrv; | ||
338 | struct intel_soc_pmic *pmic; | ||
339 | |||
340 | handle = ACPI_HANDLE(&pdev->dev); | ||
341 | status = acpi_evaluate_integer(handle, "_HRV", NULL, &hrv); | ||
342 | if (ACPI_FAILURE(status)) { | ||
343 | dev_err(&pdev->dev, "Failed to get PMIC hardware revision\n"); | ||
344 | return -ENODEV; | ||
345 | } | ||
346 | if (hrv != BROXTON_PMIC_WC_HRV) { | ||
347 | dev_err(&pdev->dev, "Invalid PMIC hardware revision: %llu\n", | ||
348 | hrv); | ||
349 | return -ENODEV; | ||
350 | } | ||
351 | |||
352 | pmic = devm_kzalloc(&pdev->dev, sizeof(*pmic), GFP_KERNEL); | ||
353 | if (!pmic) | ||
354 | return -ENOMEM; | ||
355 | |||
356 | ret = platform_get_irq(pdev, 0); | ||
357 | if (ret < 0) { | ||
358 | dev_err(&pdev->dev, "Invalid IRQ\n"); | ||
359 | return ret; | ||
360 | } | ||
361 | pmic->irq = ret; | ||
362 | |||
363 | dev_set_drvdata(&pdev->dev, pmic); | ||
364 | pmic->dev = &pdev->dev; | ||
365 | |||
366 | pmic->regmap = devm_regmap_init(&pdev->dev, NULL, pmic, | ||
367 | &bxtwc_regmap_config); | ||
368 | if (IS_ERR(pmic->regmap)) { | ||
369 | ret = PTR_ERR(pmic->regmap); | ||
370 | dev_err(&pdev->dev, "Failed to initialise regmap: %d\n", ret); | ||
371 | return ret; | ||
372 | } | ||
373 | |||
374 | ret = regmap_add_irq_chip(pmic->regmap, pmic->irq, | ||
375 | IRQF_ONESHOT | IRQF_SHARED, | ||
376 | 0, &bxtwc_regmap_irq_chip, | ||
377 | &pmic->irq_chip_data); | ||
378 | if (ret) { | ||
379 | dev_err(&pdev->dev, "Failed to add IRQ chip\n"); | ||
380 | return ret; | ||
381 | } | ||
382 | |||
383 | ret = regmap_add_irq_chip(pmic->regmap, pmic->irq, | ||
384 | IRQF_ONESHOT | IRQF_SHARED, | ||
385 | 0, &bxtwc_regmap_irq_chip_level2, | ||
386 | &pmic->irq_chip_data_level2); | ||
387 | if (ret) { | ||
388 | dev_err(&pdev->dev, "Failed to add secondary IRQ chip\n"); | ||
389 | goto err_irq_chip_level2; | ||
390 | } | ||
391 | |||
392 | ret = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, bxt_wc_dev, | ||
393 | ARRAY_SIZE(bxt_wc_dev), NULL, 0, | ||
394 | NULL); | ||
395 | if (ret) { | ||
396 | dev_err(&pdev->dev, "Failed to add devices\n"); | ||
397 | goto err_mfd; | ||
398 | } | ||
399 | |||
400 | ret = sysfs_create_group(&pdev->dev.kobj, &bxtwc_group); | ||
401 | if (ret) { | ||
402 | dev_err(&pdev->dev, "Failed to create sysfs group %d\n", ret); | ||
403 | goto err_sysfs; | ||
404 | } | ||
405 | |||
406 | return 0; | ||
407 | |||
408 | err_sysfs: | ||
409 | mfd_remove_devices(&pdev->dev); | ||
410 | err_mfd: | ||
411 | regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_level2); | ||
412 | err_irq_chip_level2: | ||
413 | regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data); | ||
414 | |||
415 | return ret; | ||
416 | } | ||
417 | |||
418 | static int bxtwc_remove(struct platform_device *pdev) | ||
419 | { | ||
420 | struct intel_soc_pmic *pmic = dev_get_drvdata(&pdev->dev); | ||
421 | |||
422 | sysfs_remove_group(&pdev->dev.kobj, &bxtwc_group); | ||
423 | mfd_remove_devices(&pdev->dev); | ||
424 | regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data); | ||
425 | regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_level2); | ||
426 | |||
427 | return 0; | ||
428 | } | ||
429 | |||
430 | static void bxtwc_shutdown(struct platform_device *pdev) | ||
431 | { | ||
432 | struct intel_soc_pmic *pmic = dev_get_drvdata(&pdev->dev); | ||
433 | |||
434 | disable_irq(pmic->irq); | ||
435 | } | ||
436 | |||
437 | #ifdef CONFIG_PM_SLEEP | ||
438 | static int bxtwc_suspend(struct device *dev) | ||
439 | { | ||
440 | struct intel_soc_pmic *pmic = dev_get_drvdata(dev); | ||
441 | |||
442 | disable_irq(pmic->irq); | ||
443 | |||
444 | return 0; | ||
445 | } | ||
446 | |||
447 | static int bxtwc_resume(struct device *dev) | ||
448 | { | ||
449 | struct intel_soc_pmic *pmic = dev_get_drvdata(dev); | ||
450 | |||
451 | enable_irq(pmic->irq); | ||
452 | return 0; | ||
453 | } | ||
454 | #endif | ||
455 | static SIMPLE_DEV_PM_OPS(bxtwc_pm_ops, bxtwc_suspend, bxtwc_resume); | ||
456 | |||
457 | static const struct acpi_device_id bxtwc_acpi_ids[] = { | ||
458 | { "INT34D3", }, | ||
459 | { } | ||
460 | }; | ||
461 | MODULE_DEVICE_TABLE(acpi, pmic_acpi_ids); | ||
462 | |||
463 | static struct platform_driver bxtwc_driver = { | ||
464 | .probe = bxtwc_probe, | ||
465 | .remove = bxtwc_remove, | ||
466 | .shutdown = bxtwc_shutdown, | ||
467 | .driver = { | ||
468 | .name = "BXTWC PMIC", | ||
469 | .pm = &bxtwc_pm_ops, | ||
470 | .acpi_match_table = ACPI_PTR(bxtwc_acpi_ids), | ||
471 | }, | ||
472 | }; | ||
473 | |||
474 | module_platform_driver(bxtwc_driver); | ||
475 | |||
476 | MODULE_LICENSE("GPL v2"); | ||
477 | MODULE_AUTHOR("Qipeng Zha<qipeng.zha@intel.com>"); | ||
diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c index 463f4eae20c1..05b924542ee2 100644 --- a/drivers/mfd/kempld-core.c +++ b/drivers/mfd/kempld-core.c | |||
@@ -448,7 +448,6 @@ static int kempld_probe(struct platform_device *pdev) | |||
448 | struct device *dev = &pdev->dev; | 448 | struct device *dev = &pdev->dev; |
449 | struct kempld_device_data *pld; | 449 | struct kempld_device_data *pld; |
450 | struct resource *ioport; | 450 | struct resource *ioport; |
451 | int ret; | ||
452 | 451 | ||
453 | pld = devm_kzalloc(dev, sizeof(*pld), GFP_KERNEL); | 452 | pld = devm_kzalloc(dev, sizeof(*pld), GFP_KERNEL); |
454 | if (!pld) | 453 | if (!pld) |
@@ -471,11 +470,7 @@ static int kempld_probe(struct platform_device *pdev) | |||
471 | mutex_init(&pld->lock); | 470 | mutex_init(&pld->lock); |
472 | platform_set_drvdata(pdev, pld); | 471 | platform_set_drvdata(pdev, pld); |
473 | 472 | ||
474 | ret = kempld_detect_device(pld); | 473 | return kempld_detect_device(pld); |
475 | if (ret) | ||
476 | return ret; | ||
477 | |||
478 | return 0; | ||
479 | } | 474 | } |
480 | 475 | ||
481 | static int kempld_remove(struct platform_device *pdev) | 476 | static int kempld_remove(struct platform_device *pdev) |
@@ -756,7 +751,6 @@ MODULE_DEVICE_TABLE(dmi, kempld_dmi_table); | |||
756 | static int __init kempld_init(void) | 751 | static int __init kempld_init(void) |
757 | { | 752 | { |
758 | const struct dmi_system_id *id; | 753 | const struct dmi_system_id *id; |
759 | int ret; | ||
760 | 754 | ||
761 | if (force_device_id[0]) { | 755 | if (force_device_id[0]) { |
762 | for (id = kempld_dmi_table; | 756 | for (id = kempld_dmi_table; |
@@ -771,11 +765,7 @@ static int __init kempld_init(void) | |||
771 | return -ENODEV; | 765 | return -ENODEV; |
772 | } | 766 | } |
773 | 767 | ||
774 | ret = platform_driver_register(&kempld_driver); | 768 | return platform_driver_register(&kempld_driver); |
775 | if (ret) | ||
776 | return ret; | ||
777 | |||
778 | return 0; | ||
779 | } | 769 | } |
780 | 770 | ||
781 | static void __exit kempld_exit(void) | 771 | static void __exit kempld_exit(void) |
diff --git a/drivers/mfd/lm3533-core.c b/drivers/mfd/lm3533-core.c index 643f3750e830..5abcbb2e8849 100644 --- a/drivers/mfd/lm3533-core.c +++ b/drivers/mfd/lm3533-core.c | |||
@@ -472,11 +472,7 @@ static int lm3533_device_setup(struct lm3533 *lm3533, | |||
472 | if (ret) | 472 | if (ret) |
473 | return ret; | 473 | return ret; |
474 | 474 | ||
475 | ret = lm3533_set_boost_ovp(lm3533, pdata->boost_ovp); | 475 | return lm3533_set_boost_ovp(lm3533, pdata->boost_ovp); |
476 | if (ret) | ||
477 | return ret; | ||
478 | |||
479 | return 0; | ||
480 | } | 476 | } |
481 | 477 | ||
482 | static int lm3533_device_init(struct lm3533 *lm3533) | 478 | static int lm3533_device_init(struct lm3533 *lm3533) |
@@ -596,7 +592,6 @@ static int lm3533_i2c_probe(struct i2c_client *i2c, | |||
596 | const struct i2c_device_id *id) | 592 | const struct i2c_device_id *id) |
597 | { | 593 | { |
598 | struct lm3533 *lm3533; | 594 | struct lm3533 *lm3533; |
599 | int ret; | ||
600 | 595 | ||
601 | dev_dbg(&i2c->dev, "%s\n", __func__); | 596 | dev_dbg(&i2c->dev, "%s\n", __func__); |
602 | 597 | ||
@@ -613,11 +608,7 @@ static int lm3533_i2c_probe(struct i2c_client *i2c, | |||
613 | lm3533->dev = &i2c->dev; | 608 | lm3533->dev = &i2c->dev; |
614 | lm3533->irq = i2c->irq; | 609 | lm3533->irq = i2c->irq; |
615 | 610 | ||
616 | ret = lm3533_device_init(lm3533); | 611 | return lm3533_device_init(lm3533); |
617 | if (ret) | ||
618 | return ret; | ||
619 | |||
620 | return 0; | ||
621 | } | 612 | } |
622 | 613 | ||
623 | static int lm3533_i2c_remove(struct i2c_client *i2c) | 614 | static int lm3533_i2c_remove(struct i2c_client *i2c) |
diff --git a/drivers/mfd/lpc_ich.c b/drivers/mfd/lpc_ich.c index c5a9a08b5dfb..b514f3cf140d 100644 --- a/drivers/mfd/lpc_ich.c +++ b/drivers/mfd/lpc_ich.c | |||
@@ -132,24 +132,18 @@ static struct resource gpio_ich_res[] = { | |||
132 | }, | 132 | }, |
133 | }; | 133 | }; |
134 | 134 | ||
135 | enum lpc_cells { | 135 | static struct mfd_cell lpc_ich_wdt_cell = { |
136 | LPC_WDT = 0, | 136 | .name = "iTCO_wdt", |
137 | LPC_GPIO, | 137 | .num_resources = ARRAY_SIZE(wdt_ich_res), |
138 | .resources = wdt_ich_res, | ||
139 | .ignore_resource_conflicts = true, | ||
138 | }; | 140 | }; |
139 | 141 | ||
140 | static struct mfd_cell lpc_ich_cells[] = { | 142 | static struct mfd_cell lpc_ich_gpio_cell = { |
141 | [LPC_WDT] = { | 143 | .name = "gpio_ich", |
142 | .name = "iTCO_wdt", | 144 | .num_resources = ARRAY_SIZE(gpio_ich_res), |
143 | .num_resources = ARRAY_SIZE(wdt_ich_res), | 145 | .resources = gpio_ich_res, |
144 | .resources = wdt_ich_res, | 146 | .ignore_resource_conflicts = true, |
145 | .ignore_resource_conflicts = true, | ||
146 | }, | ||
147 | [LPC_GPIO] = { | ||
148 | .name = "gpio_ich", | ||
149 | .num_resources = ARRAY_SIZE(gpio_ich_res), | ||
150 | .resources = gpio_ich_res, | ||
151 | .ignore_resource_conflicts = true, | ||
152 | }, | ||
153 | }; | 147 | }; |
154 | 148 | ||
155 | /* chipset related info */ | 149 | /* chipset related info */ |
@@ -841,7 +835,7 @@ static int lpc_ich_finalize_wdt_cell(struct pci_dev *dev) | |||
841 | struct itco_wdt_platform_data *pdata; | 835 | struct itco_wdt_platform_data *pdata; |
842 | struct lpc_ich_priv *priv = pci_get_drvdata(dev); | 836 | struct lpc_ich_priv *priv = pci_get_drvdata(dev); |
843 | struct lpc_ich_info *info; | 837 | struct lpc_ich_info *info; |
844 | struct mfd_cell *cell = &lpc_ich_cells[LPC_WDT]; | 838 | struct mfd_cell *cell = &lpc_ich_wdt_cell; |
845 | 839 | ||
846 | pdata = devm_kzalloc(&dev->dev, sizeof(*pdata), GFP_KERNEL); | 840 | pdata = devm_kzalloc(&dev->dev, sizeof(*pdata), GFP_KERNEL); |
847 | if (!pdata) | 841 | if (!pdata) |
@@ -860,7 +854,7 @@ static int lpc_ich_finalize_wdt_cell(struct pci_dev *dev) | |||
860 | static void lpc_ich_finalize_gpio_cell(struct pci_dev *dev) | 854 | static void lpc_ich_finalize_gpio_cell(struct pci_dev *dev) |
861 | { | 855 | { |
862 | struct lpc_ich_priv *priv = pci_get_drvdata(dev); | 856 | struct lpc_ich_priv *priv = pci_get_drvdata(dev); |
863 | struct mfd_cell *cell = &lpc_ich_cells[LPC_GPIO]; | 857 | struct mfd_cell *cell = &lpc_ich_gpio_cell; |
864 | 858 | ||
865 | cell->platform_data = &lpc_chipset_info[priv->chipset]; | 859 | cell->platform_data = &lpc_chipset_info[priv->chipset]; |
866 | cell->pdata_size = sizeof(struct lpc_ich_info); | 860 | cell->pdata_size = sizeof(struct lpc_ich_info); |
@@ -904,7 +898,7 @@ static int lpc_ich_init_gpio(struct pci_dev *dev) | |||
904 | base_addr = base_addr_cfg & 0x0000ff80; | 898 | base_addr = base_addr_cfg & 0x0000ff80; |
905 | if (!base_addr) { | 899 | if (!base_addr) { |
906 | dev_notice(&dev->dev, "I/O space for ACPI uninitialized\n"); | 900 | dev_notice(&dev->dev, "I/O space for ACPI uninitialized\n"); |
907 | lpc_ich_cells[LPC_GPIO].num_resources--; | 901 | lpc_ich_gpio_cell.num_resources--; |
908 | goto gpe0_done; | 902 | goto gpe0_done; |
909 | } | 903 | } |
910 | 904 | ||
@@ -918,7 +912,7 @@ static int lpc_ich_init_gpio(struct pci_dev *dev) | |||
918 | * the platform_device subsystem doesn't see this resource | 912 | * the platform_device subsystem doesn't see this resource |
919 | * or it will register an invalid region. | 913 | * or it will register an invalid region. |
920 | */ | 914 | */ |
921 | lpc_ich_cells[LPC_GPIO].num_resources--; | 915 | lpc_ich_gpio_cell.num_resources--; |
922 | acpi_conflict = true; | 916 | acpi_conflict = true; |
923 | } else { | 917 | } else { |
924 | lpc_ich_enable_acpi_space(dev); | 918 | lpc_ich_enable_acpi_space(dev); |
@@ -958,12 +952,12 @@ gpe0_done: | |||
958 | 952 | ||
959 | lpc_ich_finalize_gpio_cell(dev); | 953 | lpc_ich_finalize_gpio_cell(dev); |
960 | ret = mfd_add_devices(&dev->dev, PLATFORM_DEVID_AUTO, | 954 | ret = mfd_add_devices(&dev->dev, PLATFORM_DEVID_AUTO, |
961 | &lpc_ich_cells[LPC_GPIO], 1, NULL, 0, NULL); | 955 | &lpc_ich_gpio_cell, 1, NULL, 0, NULL); |
962 | 956 | ||
963 | gpio_done: | 957 | gpio_done: |
964 | if (acpi_conflict) | 958 | if (acpi_conflict) |
965 | pr_warn("Resource conflict(s) found affecting %s\n", | 959 | pr_warn("Resource conflict(s) found affecting %s\n", |
966 | lpc_ich_cells[LPC_GPIO].name); | 960 | lpc_ich_gpio_cell.name); |
967 | return ret; | 961 | return ret; |
968 | } | 962 | } |
969 | 963 | ||
@@ -1007,7 +1001,7 @@ static int lpc_ich_init_wdt(struct pci_dev *dev) | |||
1007 | */ | 1001 | */ |
1008 | if (lpc_chipset_info[priv->chipset].iTCO_version == 1) { | 1002 | if (lpc_chipset_info[priv->chipset].iTCO_version == 1) { |
1009 | /* Don't register iomem for TCO ver 1 */ | 1003 | /* Don't register iomem for TCO ver 1 */ |
1010 | lpc_ich_cells[LPC_WDT].num_resources--; | 1004 | lpc_ich_wdt_cell.num_resources--; |
1011 | } else if (lpc_chipset_info[priv->chipset].iTCO_version == 2) { | 1005 | } else if (lpc_chipset_info[priv->chipset].iTCO_version == 2) { |
1012 | pci_read_config_dword(dev, RCBABASE, &base_addr_cfg); | 1006 | pci_read_config_dword(dev, RCBABASE, &base_addr_cfg); |
1013 | base_addr = base_addr_cfg & 0xffffc000; | 1007 | base_addr = base_addr_cfg & 0xffffc000; |
@@ -1035,7 +1029,7 @@ static int lpc_ich_init_wdt(struct pci_dev *dev) | |||
1035 | goto wdt_done; | 1029 | goto wdt_done; |
1036 | 1030 | ||
1037 | ret = mfd_add_devices(&dev->dev, PLATFORM_DEVID_AUTO, | 1031 | ret = mfd_add_devices(&dev->dev, PLATFORM_DEVID_AUTO, |
1038 | &lpc_ich_cells[LPC_WDT], 1, NULL, 0, NULL); | 1032 | &lpc_ich_wdt_cell, 1, NULL, 0, NULL); |
1039 | 1033 | ||
1040 | wdt_done: | 1034 | wdt_done: |
1041 | return ret; | 1035 | return ret; |
diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c index d3cfa9cf5c8f..156ed6f92aa3 100644 --- a/drivers/mfd/max8997.c +++ b/drivers/mfd/max8997.c | |||
@@ -55,6 +55,7 @@ static const struct of_device_id max8997_pmic_dt_match[] = { | |||
55 | { .compatible = "maxim,max8997-pmic", .data = (void *)TYPE_MAX8997 }, | 55 | { .compatible = "maxim,max8997-pmic", .data = (void *)TYPE_MAX8997 }, |
56 | {}, | 56 | {}, |
57 | }; | 57 | }; |
58 | MODULE_DEVICE_TABLE(of, max8997_pmic_dt_match); | ||
58 | #endif | 59 | #endif |
59 | 60 | ||
60 | int max8997_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest) | 61 | int max8997_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest) |
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c index c17635d3e504..60b60dc63ddd 100644 --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c | |||
@@ -82,29 +82,49 @@ static int mfd_platform_add_cell(struct platform_device *pdev, | |||
82 | static void mfd_acpi_add_device(const struct mfd_cell *cell, | 82 | static void mfd_acpi_add_device(const struct mfd_cell *cell, |
83 | struct platform_device *pdev) | 83 | struct platform_device *pdev) |
84 | { | 84 | { |
85 | struct acpi_device *parent_adev; | 85 | const struct mfd_cell_acpi_match *match = cell->acpi_match; |
86 | struct acpi_device *parent, *child; | ||
86 | struct acpi_device *adev; | 87 | struct acpi_device *adev; |
87 | 88 | ||
88 | parent_adev = ACPI_COMPANION(pdev->dev.parent); | 89 | parent = ACPI_COMPANION(pdev->dev.parent); |
89 | if (!parent_adev) | 90 | if (!parent) |
90 | return; | 91 | return; |
91 | 92 | ||
92 | /* | 93 | /* |
93 | * MFD child device gets its ACPI handle either from the ACPI | 94 | * MFD child device gets its ACPI handle either from the ACPI device |
94 | * device directly under the parent that matches the acpi_pnpid or | 95 | * directly under the parent that matches the either _HID or _CID, or |
95 | * it will use the parent handle if is no acpi_pnpid is given. | 96 | * _ADR or it will use the parent handle if is no ID is given. |
97 | * | ||
98 | * Note that use of _ADR is a grey area in the ACPI specification, | ||
99 | * though Intel Galileo Gen2 is using it to distinguish the children | ||
100 | * devices. | ||
96 | */ | 101 | */ |
97 | adev = parent_adev; | 102 | adev = parent; |
98 | if (cell->acpi_pnpid) { | 103 | if (match) { |
99 | struct acpi_device_id ids[2] = {}; | 104 | if (match->pnpid) { |
100 | struct acpi_device *child_adev; | 105 | struct acpi_device_id ids[2] = {}; |
101 | 106 | ||
102 | strlcpy(ids[0].id, cell->acpi_pnpid, sizeof(ids[0].id)); | 107 | strlcpy(ids[0].id, match->pnpid, sizeof(ids[0].id)); |
103 | list_for_each_entry(child_adev, &parent_adev->children, node) | 108 | list_for_each_entry(child, &parent->children, node) { |
104 | if (acpi_match_device_ids(child_adev, ids)) { | 109 | if (acpi_match_device_ids(child, ids)) { |
105 | adev = child_adev; | 110 | adev = child; |
106 | break; | 111 | break; |
112 | } | ||
113 | } | ||
114 | } else { | ||
115 | unsigned long long adr; | ||
116 | acpi_status status; | ||
117 | |||
118 | list_for_each_entry(child, &parent->children, node) { | ||
119 | status = acpi_evaluate_integer(child->handle, | ||
120 | "_ADR", NULL, | ||
121 | &adr); | ||
122 | if (ACPI_SUCCESS(status) && match->adr == adr) { | ||
123 | adev = child; | ||
124 | break; | ||
125 | } | ||
107 | } | 126 | } |
127 | } | ||
108 | } | 128 | } |
109 | 129 | ||
110 | ACPI_COMPANION_SET(&pdev->dev, adev); | 130 | ACPI_COMPANION_SET(&pdev->dev, adev); |
diff --git a/drivers/mfd/pcf50633-irq.c b/drivers/mfd/pcf50633-irq.c index 498286cbb530..71d43edf110c 100644 --- a/drivers/mfd/pcf50633-irq.c +++ b/drivers/mfd/pcf50633-irq.c | |||
@@ -55,7 +55,7 @@ EXPORT_SYMBOL_GPL(pcf50633_free_irq); | |||
55 | static int __pcf50633_irq_mask_set(struct pcf50633 *pcf, int irq, u8 mask) | 55 | static int __pcf50633_irq_mask_set(struct pcf50633 *pcf, int irq, u8 mask) |
56 | { | 56 | { |
57 | u8 reg, bit; | 57 | u8 reg, bit; |
58 | int ret = 0, idx; | 58 | int idx; |
59 | 59 | ||
60 | idx = irq >> 3; | 60 | idx = irq >> 3; |
61 | reg = PCF50633_REG_INT1M + idx; | 61 | reg = PCF50633_REG_INT1M + idx; |
@@ -72,7 +72,7 @@ static int __pcf50633_irq_mask_set(struct pcf50633 *pcf, int irq, u8 mask) | |||
72 | 72 | ||
73 | mutex_unlock(&pcf->lock); | 73 | mutex_unlock(&pcf->lock); |
74 | 74 | ||
75 | return ret; | 75 | return 0; |
76 | } | 76 | } |
77 | 77 | ||
78 | int pcf50633_irq_mask(struct pcf50633 *pcf, int irq) | 78 | int pcf50633_irq_mask(struct pcf50633 *pcf, int irq) |
diff --git a/drivers/mfd/qcom_rpm.c b/drivers/mfd/qcom_rpm.c index 6afc9fabd94c..207a3bd68559 100644 --- a/drivers/mfd/qcom_rpm.c +++ b/drivers/mfd/qcom_rpm.c | |||
@@ -550,7 +550,7 @@ static int qcom_rpm_probe(struct platform_device *pdev) | |||
550 | ret = devm_request_irq(&pdev->dev, | 550 | ret = devm_request_irq(&pdev->dev, |
551 | irq_ack, | 551 | irq_ack, |
552 | qcom_rpm_ack_interrupt, | 552 | qcom_rpm_ack_interrupt, |
553 | IRQF_TRIGGER_RISING | IRQF_NO_SUSPEND, | 553 | IRQF_TRIGGER_RISING, |
554 | "qcom_rpm_ack", | 554 | "qcom_rpm_ack", |
555 | rpm); | 555 | rpm); |
556 | if (ret) { | 556 | if (ret) { |
diff --git a/drivers/mfd/rt5033.c b/drivers/mfd/rt5033.c index d60f91619c4a..2b95485f0057 100644 --- a/drivers/mfd/rt5033.c +++ b/drivers/mfd/rt5033.c | |||
@@ -47,6 +47,9 @@ static const struct mfd_cell rt5033_devs[] = { | |||
47 | }, { | 47 | }, { |
48 | .name = "rt5033-battery", | 48 | .name = "rt5033-battery", |
49 | .of_compatible = "richtek,rt5033-battery", | 49 | .of_compatible = "richtek,rt5033-battery", |
50 | }, { | ||
51 | .name = "rt5033-led", | ||
52 | .of_compatible = "richtek,rt5033-led", | ||
50 | }, | 53 | }, |
51 | }; | 54 | }; |
52 | 55 | ||
@@ -137,7 +140,6 @@ static struct i2c_driver rt5033_driver = { | |||
137 | }; | 140 | }; |
138 | module_i2c_driver(rt5033_driver); | 141 | module_i2c_driver(rt5033_driver); |
139 | 142 | ||
140 | MODULE_ALIAS("i2c:rt5033"); | ||
141 | MODULE_DESCRIPTION("Richtek RT5033 multi-function core driver"); | 143 | MODULE_DESCRIPTION("Richtek RT5033 multi-function core driver"); |
142 | MODULE_AUTHOR("Beomho Seo <beomho.seo@samsung.com>"); | 144 | MODULE_AUTHOR("Beomho Seo <beomho.seo@samsung.com>"); |
143 | MODULE_LICENSE("GPL"); | 145 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/mfd/rts5209.c b/drivers/mfd/rts5209.c index 373e253c33df..b95beecf767f 100644 --- a/drivers/mfd/rts5209.c +++ b/drivers/mfd/rts5209.c | |||
@@ -138,11 +138,7 @@ static int rts5209_card_power_on(struct rtsx_pcr *pcr, int card) | |||
138 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_PWR_CTL, pwr_mask, pwr_on); | 138 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_PWR_CTL, pwr_mask, pwr_on); |
139 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PWR_GATE_CTRL, | 139 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PWR_GATE_CTRL, |
140 | LDO3318_PWR_MASK, 0x00); | 140 | LDO3318_PWR_MASK, 0x00); |
141 | err = rtsx_pci_send_cmd(pcr, 100); | 141 | return rtsx_pci_send_cmd(pcr, 100); |
142 | if (err < 0) | ||
143 | return err; | ||
144 | |||
145 | return 0; | ||
146 | } | 142 | } |
147 | 143 | ||
148 | static int rts5209_card_power_off(struct rtsx_pcr *pcr, int card) | 144 | static int rts5209_card_power_off(struct rtsx_pcr *pcr, int card) |
diff --git a/drivers/mfd/rts5227.c b/drivers/mfd/rts5227.c index ce012d78ce2a..ff296a4bf3d2 100644 --- a/drivers/mfd/rts5227.c +++ b/drivers/mfd/rts5227.c | |||
@@ -26,6 +26,14 @@ | |||
26 | 26 | ||
27 | #include "rtsx_pcr.h" | 27 | #include "rtsx_pcr.h" |
28 | 28 | ||
29 | static u8 rts5227_get_ic_version(struct rtsx_pcr *pcr) | ||
30 | { | ||
31 | u8 val; | ||
32 | |||
33 | rtsx_pci_read_register(pcr, DUMMY_REG_RESET_0, &val); | ||
34 | return val & 0x0F; | ||
35 | } | ||
36 | |||
29 | static void rts5227_fill_driving(struct rtsx_pcr *pcr, u8 voltage) | 37 | static void rts5227_fill_driving(struct rtsx_pcr *pcr, u8 voltage) |
30 | { | 38 | { |
31 | u8 driving_3v3[4][3] = { | 39 | u8 driving_3v3[4][3] = { |
@@ -88,7 +96,7 @@ static void rts5227_force_power_down(struct rtsx_pcr *pcr, u8 pm_state) | |||
88 | rtsx_pci_write_register(pcr, AUTOLOAD_CFG_BASE + 3, 0x01, 0); | 96 | rtsx_pci_write_register(pcr, AUTOLOAD_CFG_BASE + 3, 0x01, 0); |
89 | 97 | ||
90 | if (pm_state == HOST_ENTER_S3) | 98 | if (pm_state == HOST_ENTER_S3) |
91 | rtsx_pci_write_register(pcr, PM_CTRL3, 0x10, 0x10); | 99 | rtsx_pci_write_register(pcr, pcr->reg_pm_ctrl3, 0x10, 0x10); |
92 | 100 | ||
93 | rtsx_pci_write_register(pcr, FPDCTL, 0x03, 0x03); | 101 | rtsx_pci_write_register(pcr, FPDCTL, 0x03, 0x03); |
94 | } | 102 | } |
@@ -121,7 +129,7 @@ static int rts5227_extra_init_hw(struct rtsx_pcr *pcr) | |||
121 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PETXCFG, 0xB8, 0xB8); | 129 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PETXCFG, 0xB8, 0xB8); |
122 | else | 130 | else |
123 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PETXCFG, 0xB8, 0x88); | 131 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PETXCFG, 0xB8, 0x88); |
124 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PM_CTRL3, 0x10, 0x00); | 132 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, pcr->reg_pm_ctrl3, 0x10, 0x00); |
125 | 133 | ||
126 | return rtsx_pci_send_cmd(pcr, 100); | 134 | return rtsx_pci_send_cmd(pcr, 100); |
127 | } | 135 | } |
@@ -179,11 +187,7 @@ static int rts5227_card_power_on(struct rtsx_pcr *pcr, int card) | |||
179 | SD_POWER_MASK, SD_POWER_ON); | 187 | SD_POWER_MASK, SD_POWER_ON); |
180 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PWR_GATE_CTRL, | 188 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PWR_GATE_CTRL, |
181 | LDO3318_PWR_MASK, 0x06); | 189 | LDO3318_PWR_MASK, 0x06); |
182 | err = rtsx_pci_send_cmd(pcr, 100); | 190 | return rtsx_pci_send_cmd(pcr, 100); |
183 | if (err < 0) | ||
184 | return err; | ||
185 | |||
186 | return 0; | ||
187 | } | 191 | } |
188 | 192 | ||
189 | static int rts5227_card_power_off(struct rtsx_pcr *pcr, int card) | 193 | static int rts5227_card_power_off(struct rtsx_pcr *pcr, int card) |
@@ -298,8 +302,73 @@ void rts5227_init_params(struct rtsx_pcr *pcr) | |||
298 | pcr->tx_initial_phase = SET_CLOCK_PHASE(27, 27, 15); | 302 | pcr->tx_initial_phase = SET_CLOCK_PHASE(27, 27, 15); |
299 | pcr->rx_initial_phase = SET_CLOCK_PHASE(30, 7, 7); | 303 | pcr->rx_initial_phase = SET_CLOCK_PHASE(30, 7, 7); |
300 | 304 | ||
305 | pcr->ic_version = rts5227_get_ic_version(pcr); | ||
301 | pcr->sd_pull_ctl_enable_tbl = rts5227_sd_pull_ctl_enable_tbl; | 306 | pcr->sd_pull_ctl_enable_tbl = rts5227_sd_pull_ctl_enable_tbl; |
302 | pcr->sd_pull_ctl_disable_tbl = rts5227_sd_pull_ctl_disable_tbl; | 307 | pcr->sd_pull_ctl_disable_tbl = rts5227_sd_pull_ctl_disable_tbl; |
303 | pcr->ms_pull_ctl_enable_tbl = rts5227_ms_pull_ctl_enable_tbl; | 308 | pcr->ms_pull_ctl_enable_tbl = rts5227_ms_pull_ctl_enable_tbl; |
304 | pcr->ms_pull_ctl_disable_tbl = rts5227_ms_pull_ctl_disable_tbl; | 309 | pcr->ms_pull_ctl_disable_tbl = rts5227_ms_pull_ctl_disable_tbl; |
310 | |||
311 | pcr->reg_pm_ctrl3 = PM_CTRL3; | ||
312 | } | ||
313 | |||
314 | static int rts522a_optimize_phy(struct rtsx_pcr *pcr) | ||
315 | { | ||
316 | int err; | ||
317 | |||
318 | err = rtsx_pci_write_register(pcr, RTS522A_PM_CTRL3, D3_DELINK_MODE_EN, | ||
319 | 0x00); | ||
320 | if (err < 0) | ||
321 | return err; | ||
322 | |||
323 | if (is_version(pcr, 0x522A, IC_VER_A)) { | ||
324 | err = rtsx_pci_write_phy_register(pcr, PHY_RCR2, | ||
325 | PHY_RCR2_INIT_27S); | ||
326 | if (err) | ||
327 | return err; | ||
328 | |||
329 | rtsx_pci_write_phy_register(pcr, PHY_RCR1, PHY_RCR1_INIT_27S); | ||
330 | rtsx_pci_write_phy_register(pcr, PHY_FLD0, PHY_FLD0_INIT_27S); | ||
331 | rtsx_pci_write_phy_register(pcr, PHY_FLD3, PHY_FLD3_INIT_27S); | ||
332 | rtsx_pci_write_phy_register(pcr, PHY_FLD4, PHY_FLD4_INIT_27S); | ||
333 | } | ||
334 | |||
335 | return 0; | ||
336 | } | ||
337 | |||
338 | static int rts522a_extra_init_hw(struct rtsx_pcr *pcr) | ||
339 | { | ||
340 | rts5227_extra_init_hw(pcr); | ||
341 | |||
342 | rtsx_pci_write_register(pcr, FUNC_FORCE_CTL, FUNC_FORCE_UPME_XMT_DBG, | ||
343 | FUNC_FORCE_UPME_XMT_DBG); | ||
344 | rtsx_pci_write_register(pcr, PCLK_CTL, 0x04, 0x04); | ||
345 | rtsx_pci_write_register(pcr, PM_EVENT_DEBUG, PME_DEBUG_0, PME_DEBUG_0); | ||
346 | rtsx_pci_write_register(pcr, PM_CLK_FORCE_CTL, 0xFF, 0x11); | ||
347 | |||
348 | return 0; | ||
349 | } | ||
350 | |||
351 | /* rts522a operations mainly derived from rts5227, except phy/hw init setting. | ||
352 | */ | ||
353 | static const struct pcr_ops rts522a_pcr_ops = { | ||
354 | .fetch_vendor_settings = rts5227_fetch_vendor_settings, | ||
355 | .extra_init_hw = rts522a_extra_init_hw, | ||
356 | .optimize_phy = rts522a_optimize_phy, | ||
357 | .turn_on_led = rts5227_turn_on_led, | ||
358 | .turn_off_led = rts5227_turn_off_led, | ||
359 | .enable_auto_blink = rts5227_enable_auto_blink, | ||
360 | .disable_auto_blink = rts5227_disable_auto_blink, | ||
361 | .card_power_on = rts5227_card_power_on, | ||
362 | .card_power_off = rts5227_card_power_off, | ||
363 | .switch_output_voltage = rts5227_switch_output_voltage, | ||
364 | .cd_deglitch = NULL, | ||
365 | .conv_clk_and_div_n = NULL, | ||
366 | .force_power_down = rts5227_force_power_down, | ||
367 | }; | ||
368 | |||
369 | void rts522a_init_params(struct rtsx_pcr *pcr) | ||
370 | { | ||
371 | rts5227_init_params(pcr); | ||
372 | |||
373 | pcr->reg_pm_ctrl3 = RTS522A_PM_CTRL3; | ||
305 | } | 374 | } |
diff --git a/drivers/mfd/rts5229.c b/drivers/mfd/rts5229.c index ace45384ec8b..9ed9dc84eac8 100644 --- a/drivers/mfd/rts5229.c +++ b/drivers/mfd/rts5229.c | |||
@@ -129,11 +129,7 @@ static int rts5229_card_power_on(struct rtsx_pcr *pcr, int card) | |||
129 | SD_POWER_MASK, SD_POWER_ON); | 129 | SD_POWER_MASK, SD_POWER_ON); |
130 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PWR_GATE_CTRL, | 130 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PWR_GATE_CTRL, |
131 | LDO3318_PWR_MASK, 0x06); | 131 | LDO3318_PWR_MASK, 0x06); |
132 | err = rtsx_pci_send_cmd(pcr, 100); | 132 | return rtsx_pci_send_cmd(pcr, 100); |
133 | if (err < 0) | ||
134 | return err; | ||
135 | |||
136 | return 0; | ||
137 | } | 133 | } |
138 | 134 | ||
139 | static int rts5229_card_power_off(struct rtsx_pcr *pcr, int card) | 135 | static int rts5229_card_power_off(struct rtsx_pcr *pcr, int card) |
diff --git a/drivers/mfd/rts5249.c b/drivers/mfd/rts5249.c index eb2d5866f719..40f8bb14fc59 100644 --- a/drivers/mfd/rts5249.c +++ b/drivers/mfd/rts5249.c | |||
@@ -234,11 +234,7 @@ static int rtsx_base_card_power_on(struct rtsx_pcr *pcr, int card) | |||
234 | SD_POWER_MASK, SD_VCC_POWER_ON); | 234 | SD_POWER_MASK, SD_VCC_POWER_ON); |
235 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PWR_GATE_CTRL, | 235 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PWR_GATE_CTRL, |
236 | LDO3318_PWR_MASK, 0x06); | 236 | LDO3318_PWR_MASK, 0x06); |
237 | err = rtsx_pci_send_cmd(pcr, 100); | 237 | return rtsx_pci_send_cmd(pcr, 100); |
238 | if (err < 0) | ||
239 | return err; | ||
240 | |||
241 | return 0; | ||
242 | } | 238 | } |
243 | 239 | ||
244 | static int rtsx_base_card_power_off(struct rtsx_pcr *pcr, int card) | 240 | static int rtsx_base_card_power_off(struct rtsx_pcr *pcr, int card) |
diff --git a/drivers/mfd/rtsx_pcr.c b/drivers/mfd/rtsx_pcr.c index a66540a49079..f3820d08c9a3 100644 --- a/drivers/mfd/rtsx_pcr.c +++ b/drivers/mfd/rtsx_pcr.c | |||
@@ -55,6 +55,7 @@ static const struct pci_device_id rtsx_pci_ids[] = { | |||
55 | { PCI_DEVICE(0x10EC, 0x5229), PCI_CLASS_OTHERS << 16, 0xFF0000 }, | 55 | { PCI_DEVICE(0x10EC, 0x5229), PCI_CLASS_OTHERS << 16, 0xFF0000 }, |
56 | { PCI_DEVICE(0x10EC, 0x5289), PCI_CLASS_OTHERS << 16, 0xFF0000 }, | 56 | { PCI_DEVICE(0x10EC, 0x5289), PCI_CLASS_OTHERS << 16, 0xFF0000 }, |
57 | { PCI_DEVICE(0x10EC, 0x5227), PCI_CLASS_OTHERS << 16, 0xFF0000 }, | 57 | { PCI_DEVICE(0x10EC, 0x5227), PCI_CLASS_OTHERS << 16, 0xFF0000 }, |
58 | { PCI_DEVICE(0x10EC, 0x522A), PCI_CLASS_OTHERS << 16, 0xFF0000 }, | ||
58 | { PCI_DEVICE(0x10EC, 0x5249), PCI_CLASS_OTHERS << 16, 0xFF0000 }, | 59 | { PCI_DEVICE(0x10EC, 0x5249), PCI_CLASS_OTHERS << 16, 0xFF0000 }, |
59 | { PCI_DEVICE(0x10EC, 0x5287), PCI_CLASS_OTHERS << 16, 0xFF0000 }, | 60 | { PCI_DEVICE(0x10EC, 0x5287), PCI_CLASS_OTHERS << 16, 0xFF0000 }, |
60 | { PCI_DEVICE(0x10EC, 0x5286), PCI_CLASS_OTHERS << 16, 0xFF0000 }, | 61 | { PCI_DEVICE(0x10EC, 0x5286), PCI_CLASS_OTHERS << 16, 0xFF0000 }, |
@@ -571,11 +572,7 @@ static int rtsx_pci_set_pull_ctl(struct rtsx_pcr *pcr, const u32 *tbl) | |||
571 | tbl++; | 572 | tbl++; |
572 | } | 573 | } |
573 | 574 | ||
574 | err = rtsx_pci_send_cmd(pcr, 100); | 575 | return rtsx_pci_send_cmd(pcr, 100); |
575 | if (err < 0) | ||
576 | return err; | ||
577 | |||
578 | return 0; | ||
579 | } | 576 | } |
580 | 577 | ||
581 | int rtsx_pci_card_pull_ctl_enable(struct rtsx_pcr *pcr, int card) | 578 | int rtsx_pci_card_pull_ctl_enable(struct rtsx_pcr *pcr, int card) |
@@ -1102,6 +1099,10 @@ static int rtsx_pci_init_chip(struct rtsx_pcr *pcr) | |||
1102 | rts5227_init_params(pcr); | 1099 | rts5227_init_params(pcr); |
1103 | break; | 1100 | break; |
1104 | 1101 | ||
1102 | case 0x522A: | ||
1103 | rts522a_init_params(pcr); | ||
1104 | break; | ||
1105 | |||
1105 | case 0x5249: | 1106 | case 0x5249: |
1106 | rts5249_init_params(pcr); | 1107 | rts5249_init_params(pcr); |
1107 | break; | 1108 | break; |
diff --git a/drivers/mfd/rtsx_pcr.h b/drivers/mfd/rtsx_pcr.h index ce48842570d7..931d1ae3ce32 100644 --- a/drivers/mfd/rtsx_pcr.h +++ b/drivers/mfd/rtsx_pcr.h | |||
@@ -27,6 +27,8 @@ | |||
27 | #define MIN_DIV_N_PCR 80 | 27 | #define MIN_DIV_N_PCR 80 |
28 | #define MAX_DIV_N_PCR 208 | 28 | #define MAX_DIV_N_PCR 208 |
29 | 29 | ||
30 | #define RTS522A_PM_CTRL3 0xFF7E | ||
31 | |||
30 | #define RTS524A_PME_FORCE_CTL 0xFF78 | 32 | #define RTS524A_PME_FORCE_CTL 0xFF78 |
31 | #define RTS524A_PM_CTRL3 0xFF7E | 33 | #define RTS524A_PM_CTRL3 0xFF7E |
32 | 34 | ||
@@ -38,6 +40,7 @@ void rts5229_init_params(struct rtsx_pcr *pcr); | |||
38 | void rtl8411_init_params(struct rtsx_pcr *pcr); | 40 | void rtl8411_init_params(struct rtsx_pcr *pcr); |
39 | void rtl8402_init_params(struct rtsx_pcr *pcr); | 41 | void rtl8402_init_params(struct rtsx_pcr *pcr); |
40 | void rts5227_init_params(struct rtsx_pcr *pcr); | 42 | void rts5227_init_params(struct rtsx_pcr *pcr); |
43 | void rts522a_init_params(struct rtsx_pcr *pcr); | ||
41 | void rts5249_init_params(struct rtsx_pcr *pcr); | 44 | void rts5249_init_params(struct rtsx_pcr *pcr); |
42 | void rts524a_init_params(struct rtsx_pcr *pcr); | 45 | void rts524a_init_params(struct rtsx_pcr *pcr); |
43 | void rts525a_init_params(struct rtsx_pcr *pcr); | 46 | void rts525a_init_params(struct rtsx_pcr *pcr); |
diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c index d206a3e8fe87..989076d6cb83 100644 --- a/drivers/mfd/sec-core.c +++ b/drivers/mfd/sec-core.c | |||
@@ -103,12 +103,9 @@ static const struct mfd_cell s2mpa01_devs[] = { | |||
103 | }; | 103 | }; |
104 | 104 | ||
105 | static const struct mfd_cell s2mpu02_devs[] = { | 105 | static const struct mfd_cell s2mpu02_devs[] = { |
106 | { .name = "s2mpu02-pmic", }, | ||
107 | { .name = "s2mpu02-rtc", }, | ||
108 | { | 106 | { |
109 | .name = "s2mpu02-clk", | 107 | .name = "s2mpu02-pmic", |
110 | .of_compatible = "samsung,s2mpu02-clk", | 108 | }, |
111 | } | ||
112 | }; | 109 | }; |
113 | 110 | ||
114 | #ifdef CONFIG_OF | 111 | #ifdef CONFIG_OF |
@@ -253,6 +250,38 @@ static const struct regmap_config s5m8767_regmap_config = { | |||
253 | .cache_type = REGCACHE_FLAT, | 250 | .cache_type = REGCACHE_FLAT, |
254 | }; | 251 | }; |
255 | 252 | ||
253 | static void sec_pmic_dump_rev(struct sec_pmic_dev *sec_pmic) | ||
254 | { | ||
255 | unsigned int val; | ||
256 | |||
257 | /* For each device type, the REG_ID is always the first register */ | ||
258 | if (!regmap_read(sec_pmic->regmap_pmic, S2MPS11_REG_ID, &val)) | ||
259 | dev_dbg(sec_pmic->dev, "Revision: 0x%x\n", val); | ||
260 | } | ||
261 | |||
262 | static void sec_pmic_configure(struct sec_pmic_dev *sec_pmic) | ||
263 | { | ||
264 | int err; | ||
265 | |||
266 | if (sec_pmic->device_type != S2MPS13X) | ||
267 | return; | ||
268 | |||
269 | if (sec_pmic->pdata->disable_wrstbi) { | ||
270 | /* | ||
271 | * If WRSTBI pin is pulled down this feature must be disabled | ||
272 | * because each Suspend to RAM will trigger buck voltage reset | ||
273 | * to default values. | ||
274 | */ | ||
275 | err = regmap_update_bits(sec_pmic->regmap_pmic, | ||
276 | S2MPS13_REG_WRSTBI, | ||
277 | S2MPS13_REG_WRSTBI_MASK, 0x0); | ||
278 | if (err) | ||
279 | dev_warn(sec_pmic->dev, | ||
280 | "Cannot initialize WRSTBI config: %d\n", | ||
281 | err); | ||
282 | } | ||
283 | } | ||
284 | |||
256 | #ifdef CONFIG_OF | 285 | #ifdef CONFIG_OF |
257 | /* | 286 | /* |
258 | * Only the common platform data elements for s5m8767 are parsed here from the | 287 | * Only the common platform data elements for s5m8767 are parsed here from the |
@@ -278,6 +307,10 @@ static struct sec_platform_data *sec_pmic_i2c_parse_dt_pdata( | |||
278 | * not parsed here. | 307 | * not parsed here. |
279 | */ | 308 | */ |
280 | 309 | ||
310 | pd->manual_poweroff = of_property_read_bool(dev->of_node, | ||
311 | "samsung,s2mps11-acokb-ground"); | ||
312 | pd->disable_wrstbi = of_property_read_bool(dev->of_node, | ||
313 | "samsung,s2mps11-wrstbi-ground"); | ||
281 | return pd; | 314 | return pd; |
282 | } | 315 | } |
283 | #else | 316 | #else |
@@ -423,6 +456,8 @@ static int sec_pmic_probe(struct i2c_client *i2c, | |||
423 | goto err_mfd; | 456 | goto err_mfd; |
424 | 457 | ||
425 | device_init_wakeup(sec_pmic->dev, sec_pmic->wakeup); | 458 | device_init_wakeup(sec_pmic->dev, sec_pmic->wakeup); |
459 | sec_pmic_configure(sec_pmic); | ||
460 | sec_pmic_dump_rev(sec_pmic); | ||
426 | 461 | ||
427 | return ret; | 462 | return ret; |
428 | 463 | ||
@@ -440,6 +475,33 @@ static int sec_pmic_remove(struct i2c_client *i2c) | |||
440 | return 0; | 475 | return 0; |
441 | } | 476 | } |
442 | 477 | ||
478 | static void sec_pmic_shutdown(struct i2c_client *i2c) | ||
479 | { | ||
480 | struct sec_pmic_dev *sec_pmic = i2c_get_clientdata(i2c); | ||
481 | unsigned int reg, mask; | ||
482 | |||
483 | if (!sec_pmic->pdata->manual_poweroff) | ||
484 | return; | ||
485 | |||
486 | switch (sec_pmic->device_type) { | ||
487 | case S2MPS11X: | ||
488 | reg = S2MPS11_REG_CTRL1; | ||
489 | mask = S2MPS11_CTRL1_PWRHOLD_MASK; | ||
490 | break; | ||
491 | default: | ||
492 | /* | ||
493 | * Currently only one board with S2MPS11 needs this, so just | ||
494 | * ignore the rest. | ||
495 | */ | ||
496 | dev_warn(sec_pmic->dev, | ||
497 | "Unsupported device %lu for manual power off\n", | ||
498 | sec_pmic->device_type); | ||
499 | return; | ||
500 | } | ||
501 | |||
502 | regmap_update_bits(sec_pmic->regmap_pmic, reg, mask, 0); | ||
503 | } | ||
504 | |||
443 | #ifdef CONFIG_PM_SLEEP | 505 | #ifdef CONFIG_PM_SLEEP |
444 | static int sec_pmic_suspend(struct device *dev) | 506 | static int sec_pmic_suspend(struct device *dev) |
445 | { | 507 | { |
@@ -491,6 +553,7 @@ static struct i2c_driver sec_pmic_driver = { | |||
491 | }, | 553 | }, |
492 | .probe = sec_pmic_probe, | 554 | .probe = sec_pmic_probe, |
493 | .remove = sec_pmic_remove, | 555 | .remove = sec_pmic_remove, |
556 | .shutdown = sec_pmic_shutdown, | ||
494 | .id_table = sec_pmic_id, | 557 | .id_table = sec_pmic_id, |
495 | }; | 558 | }; |
496 | 559 | ||
diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c index 91077efc8050..c646784c5a7d 100644 --- a/drivers/mfd/sm501.c +++ b/drivers/mfd/sm501.c | |||
@@ -1719,6 +1719,7 @@ static const struct of_device_id of_sm501_match_tbl[] = { | |||
1719 | { .compatible = "smi,sm501", }, | 1719 | { .compatible = "smi,sm501", }, |
1720 | { /* end */ } | 1720 | { /* end */ } |
1721 | }; | 1721 | }; |
1722 | MODULE_DEVICE_TABLE(of, of_sm501_match_tbl); | ||
1722 | 1723 | ||
1723 | static struct platform_driver sm501_plat_driver = { | 1724 | static struct platform_driver sm501_plat_driver = { |
1724 | .driver = { | 1725 | .driver = { |
diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c index e971af86ce1e..8222e374e4b1 100644 --- a/drivers/mfd/stmpe.c +++ b/drivers/mfd/stmpe.c | |||
@@ -795,6 +795,7 @@ static int stmpe24xx_get_altfunc(struct stmpe *stmpe, enum stmpe_block block) | |||
795 | return 2; | 795 | return 2; |
796 | 796 | ||
797 | case STMPE_BLOCK_KEYPAD: | 797 | case STMPE_BLOCK_KEYPAD: |
798 | case STMPE_BLOCK_PWM: | ||
798 | return 1; | 799 | return 1; |
799 | 800 | ||
800 | case STMPE_BLOCK_GPIO: | 801 | case STMPE_BLOCK_GPIO: |
diff --git a/drivers/mfd/tps6105x.c b/drivers/mfd/tps6105x.c index 4a174cdb50b6..51c54951c220 100644 --- a/drivers/mfd/tps6105x.c +++ b/drivers/mfd/tps6105x.c | |||
@@ -64,27 +64,47 @@ static int tps6105x_startup(struct tps6105x *tps6105x) | |||
64 | } | 64 | } |
65 | 65 | ||
66 | /* | 66 | /* |
67 | * MFD cells - we have one cell which is selected operation | 67 | * MFD cells - we always have a GPIO cell and we have one cell |
68 | * mode, and we always have a GPIO cell. | 68 | * which is selected operation mode. |
69 | */ | 69 | */ |
70 | static struct mfd_cell tps6105x_cells[] = { | 70 | static struct mfd_cell tps6105x_gpio_cell = { |
71 | { | 71 | .name = "tps6105x-gpio", |
72 | /* name will be runtime assigned */ | 72 | }; |
73 | .id = -1, | 73 | |
74 | }, | 74 | static struct mfd_cell tps6105x_leds_cell = { |
75 | { | 75 | .name = "tps6105x-leds", |
76 | .name = "tps6105x-gpio", | 76 | }; |
77 | .id = -1, | 77 | |
78 | }, | 78 | static struct mfd_cell tps6105x_flash_cell = { |
79 | .name = "tps6105x-flash", | ||
79 | }; | 80 | }; |
80 | 81 | ||
82 | static struct mfd_cell tps6105x_regulator_cell = { | ||
83 | .name = "tps6105x-regulator", | ||
84 | }; | ||
85 | |||
86 | static int tps6105x_add_device(struct tps6105x *tps6105x, | ||
87 | struct mfd_cell *cell) | ||
88 | { | ||
89 | cell->platform_data = tps6105x; | ||
90 | cell->pdata_size = sizeof(*tps6105x); | ||
91 | |||
92 | return mfd_add_devices(&tps6105x->client->dev, | ||
93 | PLATFORM_DEVID_AUTO, cell, 1, NULL, 0, NULL); | ||
94 | } | ||
95 | |||
81 | static int tps6105x_probe(struct i2c_client *client, | 96 | static int tps6105x_probe(struct i2c_client *client, |
82 | const struct i2c_device_id *id) | 97 | const struct i2c_device_id *id) |
83 | { | 98 | { |
84 | struct tps6105x *tps6105x; | 99 | struct tps6105x *tps6105x; |
85 | struct tps6105x_platform_data *pdata; | 100 | struct tps6105x_platform_data *pdata; |
86 | int ret; | 101 | int ret; |
87 | int i; | 102 | |
103 | pdata = dev_get_platdata(&client->dev); | ||
104 | if (!pdata) { | ||
105 | dev_err(&client->dev, "missing platform data\n"); | ||
106 | return -ENODEV; | ||
107 | } | ||
88 | 108 | ||
89 | tps6105x = devm_kmalloc(&client->dev, sizeof(*tps6105x), GFP_KERNEL); | 109 | tps6105x = devm_kmalloc(&client->dev, sizeof(*tps6105x), GFP_KERNEL); |
90 | if (!tps6105x) | 110 | if (!tps6105x) |
@@ -96,7 +116,6 @@ static int tps6105x_probe(struct i2c_client *client, | |||
96 | 116 | ||
97 | i2c_set_clientdata(client, tps6105x); | 117 | i2c_set_clientdata(client, tps6105x); |
98 | tps6105x->client = client; | 118 | tps6105x->client = client; |
99 | pdata = dev_get_platdata(&client->dev); | ||
100 | tps6105x->pdata = pdata; | 119 | tps6105x->pdata = pdata; |
101 | 120 | ||
102 | ret = tps6105x_startup(tps6105x); | 121 | ret = tps6105x_startup(tps6105x); |
@@ -105,38 +124,33 @@ static int tps6105x_probe(struct i2c_client *client, | |||
105 | return ret; | 124 | return ret; |
106 | } | 125 | } |
107 | 126 | ||
108 | /* Remove warning texts when you implement new cell drivers */ | 127 | ret = tps6105x_add_device(tps6105x, &tps6105x_gpio_cell); |
128 | if (ret) | ||
129 | return ret; | ||
130 | |||
109 | switch (pdata->mode) { | 131 | switch (pdata->mode) { |
110 | case TPS6105X_MODE_SHUTDOWN: | 132 | case TPS6105X_MODE_SHUTDOWN: |
111 | dev_info(&client->dev, | 133 | dev_info(&client->dev, |
112 | "present, not used for anything, only GPIO\n"); | 134 | "present, not used for anything, only GPIO\n"); |
113 | break; | 135 | break; |
114 | case TPS6105X_MODE_TORCH: | 136 | case TPS6105X_MODE_TORCH: |
115 | tps6105x_cells[0].name = "tps6105x-leds"; | 137 | ret = tps6105x_add_device(tps6105x, &tps6105x_leds_cell); |
116 | dev_warn(&client->dev, | ||
117 | "torch mode is unsupported\n"); | ||
118 | break; | 138 | break; |
119 | case TPS6105X_MODE_TORCH_FLASH: | 139 | case TPS6105X_MODE_TORCH_FLASH: |
120 | tps6105x_cells[0].name = "tps6105x-flash"; | 140 | ret = tps6105x_add_device(tps6105x, &tps6105x_flash_cell); |
121 | dev_warn(&client->dev, | ||
122 | "flash mode is unsupported\n"); | ||
123 | break; | 141 | break; |
124 | case TPS6105X_MODE_VOLTAGE: | 142 | case TPS6105X_MODE_VOLTAGE: |
125 | tps6105x_cells[0].name ="tps6105x-regulator"; | 143 | ret = tps6105x_add_device(tps6105x, &tps6105x_regulator_cell); |
126 | break; | 144 | break; |
127 | default: | 145 | default: |
146 | dev_warn(&client->dev, "invalid mode: %d\n", pdata->mode); | ||
128 | break; | 147 | break; |
129 | } | 148 | } |
130 | 149 | ||
131 | /* Set up and register the platform devices. */ | 150 | if (ret) |
132 | for (i = 0; i < ARRAY_SIZE(tps6105x_cells); i++) { | 151 | mfd_remove_devices(&client->dev); |
133 | /* One state holder for all drivers, this is simple */ | ||
134 | tps6105x_cells[i].platform_data = tps6105x; | ||
135 | tps6105x_cells[i].pdata_size = sizeof(*tps6105x); | ||
136 | } | ||
137 | 152 | ||
138 | return mfd_add_devices(&client->dev, 0, tps6105x_cells, | 153 | return ret; |
139 | ARRAY_SIZE(tps6105x_cells), NULL, 0, NULL); | ||
140 | } | 154 | } |
141 | 155 | ||
142 | static int tps6105x_remove(struct i2c_client *client) | 156 | static int tps6105x_remove(struct i2c_client *client) |
diff --git a/drivers/mfd/tps65217.c b/drivers/mfd/tps65217.c index 55add0453ae9..d32b54426b70 100644 --- a/drivers/mfd/tps65217.c +++ b/drivers/mfd/tps65217.c | |||
@@ -39,6 +39,10 @@ static const struct mfd_cell tps65217s[] = { | |||
39 | .name = "tps65217-bl", | 39 | .name = "tps65217-bl", |
40 | .of_compatible = "ti,tps65217-bl", | 40 | .of_compatible = "ti,tps65217-bl", |
41 | }, | 41 | }, |
42 | { | ||
43 | .name = "tps65217-charger", | ||
44 | .of_compatible = "ti,tps65217-charger", | ||
45 | }, | ||
42 | }; | 46 | }; |
43 | 47 | ||
44 | /** | 48 | /** |
diff --git a/drivers/mfd/twl6040.c b/drivers/mfd/twl6040.c index a151ee2eed2a..08a693cd38cc 100644 --- a/drivers/mfd/twl6040.c +++ b/drivers/mfd/twl6040.c | |||
@@ -647,6 +647,8 @@ static int twl6040_probe(struct i2c_client *client, | |||
647 | 647 | ||
648 | twl6040->clk32k = devm_clk_get(&client->dev, "clk32k"); | 648 | twl6040->clk32k = devm_clk_get(&client->dev, "clk32k"); |
649 | if (IS_ERR(twl6040->clk32k)) { | 649 | if (IS_ERR(twl6040->clk32k)) { |
650 | if (PTR_ERR(twl6040->clk32k) == -EPROBE_DEFER) | ||
651 | return -EPROBE_DEFER; | ||
650 | dev_info(&client->dev, "clk32k is not handled\n"); | 652 | dev_info(&client->dev, "clk32k is not handled\n"); |
651 | twl6040->clk32k = NULL; | 653 | twl6040->clk32k = NULL; |
652 | } | 654 | } |
diff --git a/drivers/mfd/wm5110-tables.c b/drivers/mfd/wm5110-tables.c index 28f2ae30507a..2bb2d0467a92 100644 --- a/drivers/mfd/wm5110-tables.c +++ b/drivers/mfd/wm5110-tables.c | |||
@@ -250,7 +250,7 @@ static const struct reg_sequence wm5110_revd_patch[] = { | |||
250 | }; | 250 | }; |
251 | 251 | ||
252 | /* Add extra headphone write sequence locations */ | 252 | /* Add extra headphone write sequence locations */ |
253 | static const struct reg_default wm5110_reve_patch[] = { | 253 | static const struct reg_sequence wm5110_reve_patch[] = { |
254 | { 0x80, 0x3 }, | 254 | { 0x80, 0x3 }, |
255 | { 0x80, 0x3 }, | 255 | { 0x80, 0x3 }, |
256 | { 0x4b, 0x138 }, | 256 | { 0x4b, 0x138 }, |
@@ -1633,6 +1633,185 @@ static const struct reg_default wm5110_reg_default[] = { | |||
1633 | { 0x00000EF8, 0x0000 }, /* R3832 - ISRC 3 CTRL 3 */ | 1633 | { 0x00000EF8, 0x0000 }, /* R3832 - ISRC 3 CTRL 3 */ |
1634 | { 0x00000F00, 0x0000 }, /* R3840 - Clock Control */ | 1634 | { 0x00000F00, 0x0000 }, /* R3840 - Clock Control */ |
1635 | { 0x00000F01, 0x0000 }, /* R3841 - ANC_SRC */ | 1635 | { 0x00000F01, 0x0000 }, /* R3841 - ANC_SRC */ |
1636 | { 0x00000F08, 0x001c }, /* R3848 - ANC Coefficient */ | ||
1637 | { 0x00000F09, 0x0000 }, /* R3849 - ANC Coefficient */ | ||
1638 | { 0x00000F0A, 0x0000 }, /* R3850 - ANC Coefficient */ | ||
1639 | { 0x00000F0B, 0x0000 }, /* R3851 - ANC Coefficient */ | ||
1640 | { 0x00000F0C, 0x0000 }, /* R3852 - ANC Coefficient */ | ||
1641 | { 0x00000F0D, 0x0000 }, /* R3853 - ANC Coefficient */ | ||
1642 | { 0x00000F0E, 0x0000 }, /* R3854 - ANC Coefficient */ | ||
1643 | { 0x00000F0F, 0x0000 }, /* R3855 - ANC Coefficient */ | ||
1644 | { 0x00000F10, 0x0000 }, /* R3856 - ANC Coefficient */ | ||
1645 | { 0x00000F11, 0x0000 }, /* R3857 - ANC Coefficient */ | ||
1646 | { 0x00000F12, 0x0000 }, /* R3858 - ANC Coefficient */ | ||
1647 | { 0x00000F15, 0x0000 }, /* R3861 - FCL Filter Control */ | ||
1648 | { 0x00000F17, 0x0004 }, /* R3863 - FCL ADC Reformatter Control */ | ||
1649 | { 0x00000F18, 0x0004 }, /* R3864 - ANC Coefficient */ | ||
1650 | { 0x00000F19, 0x0002 }, /* R3865 - ANC Coefficient */ | ||
1651 | { 0x00000F1A, 0x0000 }, /* R3866 - ANC Coefficient */ | ||
1652 | { 0x00000F1B, 0x0010 }, /* R3867 - ANC Coefficient */ | ||
1653 | { 0x00000F1C, 0x0000 }, /* R3868 - ANC Coefficient */ | ||
1654 | { 0x00000F1D, 0x0000 }, /* R3869 - ANC Coefficient */ | ||
1655 | { 0x00000F1E, 0x0000 }, /* R3870 - ANC Coefficient */ | ||
1656 | { 0x00000F1F, 0x0000 }, /* R3871 - ANC Coefficient */ | ||
1657 | { 0x00000F20, 0x0000 }, /* R3872 - ANC Coefficient */ | ||
1658 | { 0x00000F21, 0x0000 }, /* R3873 - ANC Coefficient */ | ||
1659 | { 0x00000F22, 0x0000 }, /* R3874 - ANC Coefficient */ | ||
1660 | { 0x00000F23, 0x0000 }, /* R3875 - ANC Coefficient */ | ||
1661 | { 0x00000F24, 0x0000 }, /* R3876 - ANC Coefficient */ | ||
1662 | { 0x00000F25, 0x0000 }, /* R3877 - ANC Coefficient */ | ||
1663 | { 0x00000F26, 0x0000 }, /* R3878 - ANC Coefficient */ | ||
1664 | { 0x00000F27, 0x0000 }, /* R3879 - ANC Coefficient */ | ||
1665 | { 0x00000F28, 0x0000 }, /* R3880 - ANC Coefficient */ | ||
1666 | { 0x00000F29, 0x0000 }, /* R3881 - ANC Coefficient */ | ||
1667 | { 0x00000F2A, 0x0000 }, /* R3882 - ANC Coefficient */ | ||
1668 | { 0x00000F2B, 0x0000 }, /* R3883 - ANC Coefficient */ | ||
1669 | { 0x00000F2C, 0x0000 }, /* R3884 - ANC Coefficient */ | ||
1670 | { 0x00000F2D, 0x0000 }, /* R3885 - ANC Coefficient */ | ||
1671 | { 0x00000F2E, 0x0000 }, /* R3886 - ANC Coefficient */ | ||
1672 | { 0x00000F2F, 0x0000 }, /* R3887 - ANC Coefficient */ | ||
1673 | { 0x00000F30, 0x0000 }, /* R3888 - ANC Coefficient */ | ||
1674 | { 0x00000F31, 0x0000 }, /* R3889 - ANC Coefficient */ | ||
1675 | { 0x00000F32, 0x0000 }, /* R3890 - ANC Coefficient */ | ||
1676 | { 0x00000F33, 0x0000 }, /* R3891 - ANC Coefficient */ | ||
1677 | { 0x00000F34, 0x0000 }, /* R3892 - ANC Coefficient */ | ||
1678 | { 0x00000F35, 0x0000 }, /* R3893 - ANC Coefficient */ | ||
1679 | { 0x00000F36, 0x0000 }, /* R3894 - ANC Coefficient */ | ||
1680 | { 0x00000F37, 0x0000 }, /* R3895 - ANC Coefficient */ | ||
1681 | { 0x00000F38, 0x0000 }, /* R3896 - ANC Coefficient */ | ||
1682 | { 0x00000F39, 0x0000 }, /* R3897 - ANC Coefficient */ | ||
1683 | { 0x00000F3A, 0x0000 }, /* R3898 - ANC Coefficient */ | ||
1684 | { 0x00000F3B, 0x0000 }, /* R3899 - ANC Coefficient */ | ||
1685 | { 0x00000F3C, 0x0000 }, /* R3900 - ANC Coefficient */ | ||
1686 | { 0x00000F3D, 0x0000 }, /* R3901 - ANC Coefficient */ | ||
1687 | { 0x00000F3E, 0x0000 }, /* R3902 - ANC Coefficient */ | ||
1688 | { 0x00000F3F, 0x0000 }, /* R3903 - ANC Coefficient */ | ||
1689 | { 0x00000F40, 0x0000 }, /* R3904 - ANC Coefficient */ | ||
1690 | { 0x00000F41, 0x0000 }, /* R3905 - ANC Coefficient */ | ||
1691 | { 0x00000F42, 0x0000 }, /* R3906 - ANC Coefficient */ | ||
1692 | { 0x00000F43, 0x0000 }, /* R3907 - ANC Coefficient */ | ||
1693 | { 0x00000F44, 0x0000 }, /* R3908 - ANC Coefficient */ | ||
1694 | { 0x00000F45, 0x0000 }, /* R3909 - ANC Coefficient */ | ||
1695 | { 0x00000F46, 0x0000 }, /* R3910 - ANC Coefficient */ | ||
1696 | { 0x00000F47, 0x0000 }, /* R3911 - ANC Coefficient */ | ||
1697 | { 0x00000F48, 0x0000 }, /* R3912 - ANC Coefficient */ | ||
1698 | { 0x00000F49, 0x0000 }, /* R3913 - ANC Coefficient */ | ||
1699 | { 0x00000F4A, 0x0000 }, /* R3914 - ANC Coefficient */ | ||
1700 | { 0x00000F4B, 0x0000 }, /* R3915 - ANC Coefficient */ | ||
1701 | { 0x00000F4C, 0x0000 }, /* R3916 - ANC Coefficient */ | ||
1702 | { 0x00000F4D, 0x0000 }, /* R3917 - ANC Coefficient */ | ||
1703 | { 0x00000F4E, 0x0000 }, /* R3918 - ANC Coefficient */ | ||
1704 | { 0x00000F4F, 0x0000 }, /* R3919 - ANC Coefficient */ | ||
1705 | { 0x00000F50, 0x0000 }, /* R3920 - ANC Coefficient */ | ||
1706 | { 0x00000F51, 0x0000 }, /* R3921 - ANC Coefficient */ | ||
1707 | { 0x00000F52, 0x0000 }, /* R3922 - ANC Coefficient */ | ||
1708 | { 0x00000F53, 0x0000 }, /* R3923 - ANC Coefficient */ | ||
1709 | { 0x00000F54, 0x0000 }, /* R3924 - ANC Coefficient */ | ||
1710 | { 0x00000F55, 0x0000 }, /* R3925 - ANC Coefficient */ | ||
1711 | { 0x00000F56, 0x0000 }, /* R3926 - ANC Coefficient */ | ||
1712 | { 0x00000F57, 0x0000 }, /* R3927 - ANC Coefficient */ | ||
1713 | { 0x00000F58, 0x0000 }, /* R3928 - ANC Coefficient */ | ||
1714 | { 0x00000F59, 0x0000 }, /* R3929 - ANC Coefficient */ | ||
1715 | { 0x00000F5A, 0x0000 }, /* R3930 - ANC Coefficient */ | ||
1716 | { 0x00000F5B, 0x0000 }, /* R3931 - ANC Coefficient */ | ||
1717 | { 0x00000F5C, 0x0000 }, /* R3932 - ANC Coefficient */ | ||
1718 | { 0x00000F5D, 0x0000 }, /* R3933 - ANC Coefficient */ | ||
1719 | { 0x00000F5E, 0x0000 }, /* R3934 - ANC Coefficient */ | ||
1720 | { 0x00000F5F, 0x0000 }, /* R3935 - ANC Coefficient */ | ||
1721 | { 0x00000F60, 0x0000 }, /* R3936 - ANC Coefficient */ | ||
1722 | { 0x00000F61, 0x0000 }, /* R3937 - ANC Coefficient */ | ||
1723 | { 0x00000F62, 0x0000 }, /* R3938 - ANC Coefficient */ | ||
1724 | { 0x00000F63, 0x0000 }, /* R3939 - ANC Coefficient */ | ||
1725 | { 0x00000F64, 0x0000 }, /* R3940 - ANC Coefficient */ | ||
1726 | { 0x00000F65, 0x0000 }, /* R3941 - ANC Coefficient */ | ||
1727 | { 0x00000F66, 0x0000 }, /* R3942 - ANC Coefficient */ | ||
1728 | { 0x00000F67, 0x0000 }, /* R3943 - ANC Coefficient */ | ||
1729 | { 0x00000F68, 0x0000 }, /* R3944 - ANC Coefficient */ | ||
1730 | { 0x00000F69, 0x0000 }, /* R3945 - ANC Coefficient */ | ||
1731 | { 0x00000F70, 0x0000 }, /* R3952 - FCR Filter Control */ | ||
1732 | { 0x00000F72, 0x0004 }, /* R3954 - FCR ADC Reformatter Control */ | ||
1733 | { 0x00000F73, 0x0004 }, /* R3955 - ANC Coefficient */ | ||
1734 | { 0x00000F74, 0x0002 }, /* R3956 - ANC Coefficient */ | ||
1735 | { 0x00000F75, 0x0000 }, /* R3957 - ANC Coefficient */ | ||
1736 | { 0x00000F76, 0x0010 }, /* R3958 - ANC Coefficient */ | ||
1737 | { 0x00000F77, 0x0000 }, /* R3959 - ANC Coefficient */ | ||
1738 | { 0x00000F78, 0x0000 }, /* R3960 - ANC Coefficient */ | ||
1739 | { 0x00000F79, 0x0000 }, /* R3961 - ANC Coefficient */ | ||
1740 | { 0x00000F7A, 0x0000 }, /* R3962 - ANC Coefficient */ | ||
1741 | { 0x00000F7B, 0x0000 }, /* R3963 - ANC Coefficient */ | ||
1742 | { 0x00000F7C, 0x0000 }, /* R3964 - ANC Coefficient */ | ||
1743 | { 0x00000F7D, 0x0000 }, /* R3965 - ANC Coefficient */ | ||
1744 | { 0x00000F7E, 0x0000 }, /* R3966 - ANC Coefficient */ | ||
1745 | { 0x00000F7F, 0x0000 }, /* R3967 - ANC Coefficient */ | ||
1746 | { 0x00000F80, 0x0000 }, /* R3968 - ANC Coefficient */ | ||
1747 | { 0x00000F81, 0x0000 }, /* R3969 - ANC Coefficient */ | ||
1748 | { 0x00000F82, 0x0000 }, /* R3970 - ANC Coefficient */ | ||
1749 | { 0x00000F83, 0x0000 }, /* R3971 - ANC Coefficient */ | ||
1750 | { 0x00000F84, 0x0000 }, /* R3972 - ANC Coefficient */ | ||
1751 | { 0x00000F85, 0x0000 }, /* R3973 - ANC Coefficient */ | ||
1752 | { 0x00000F86, 0x0000 }, /* R3974 - ANC Coefficient */ | ||
1753 | { 0x00000F87, 0x0000 }, /* R3975 - ANC Coefficient */ | ||
1754 | { 0x00000F88, 0x0000 }, /* R3976 - ANC Coefficient */ | ||
1755 | { 0x00000F89, 0x0000 }, /* R3977 - ANC Coefficient */ | ||
1756 | { 0x00000F8A, 0x0000 }, /* R3978 - ANC Coefficient */ | ||
1757 | { 0x00000F8B, 0x0000 }, /* R3979 - ANC Coefficient */ | ||
1758 | { 0x00000F8C, 0x0000 }, /* R3980 - ANC Coefficient */ | ||
1759 | { 0x00000F8D, 0x0000 }, /* R3981 - ANC Coefficient */ | ||
1760 | { 0x00000F8E, 0x0000 }, /* R3982 - ANC Coefficient */ | ||
1761 | { 0x00000F8F, 0x0000 }, /* R3983 - ANC Coefficient */ | ||
1762 | { 0x00000F90, 0x0000 }, /* R3984 - ANC Coefficient */ | ||
1763 | { 0x00000F91, 0x0000 }, /* R3985 - ANC Coefficient */ | ||
1764 | { 0x00000F92, 0x0000 }, /* R3986 - ANC Coefficient */ | ||
1765 | { 0x00000F93, 0x0000 }, /* R3987 - ANC Coefficient */ | ||
1766 | { 0x00000F94, 0x0000 }, /* R3988 - ANC Coefficient */ | ||
1767 | { 0x00000F95, 0x0000 }, /* R3989 - ANC Coefficient */ | ||
1768 | { 0x00000F96, 0x0000 }, /* R3990 - ANC Coefficient */ | ||
1769 | { 0x00000F97, 0x0000 }, /* R3991 - ANC Coefficient */ | ||
1770 | { 0x00000F98, 0x0000 }, /* R3992 - ANC Coefficient */ | ||
1771 | { 0x00000F99, 0x0000 }, /* R3993 - ANC Coefficient */ | ||
1772 | { 0x00000F9A, 0x0000 }, /* R3994 - ANC Coefficient */ | ||
1773 | { 0x00000F9B, 0x0000 }, /* R3995 - ANC Coefficient */ | ||
1774 | { 0x00000F9C, 0x0000 }, /* R3996 - ANC Coefficient */ | ||
1775 | { 0x00000F9D, 0x0000 }, /* R3997 - ANC Coefficient */ | ||
1776 | { 0x00000F9E, 0x0000 }, /* R3998 - ANC Coefficient */ | ||
1777 | { 0x00000F9F, 0x0000 }, /* R3999 - ANC Coefficient */ | ||
1778 | { 0x00000FA0, 0x0000 }, /* R4000 - ANC Coefficient */ | ||
1779 | { 0x00000FA1, 0x0000 }, /* R4001 - ANC Coefficient */ | ||
1780 | { 0x00000FA2, 0x0000 }, /* R4002 - ANC Coefficient */ | ||
1781 | { 0x00000FA3, 0x0000 }, /* R4003 - ANC Coefficient */ | ||
1782 | { 0x00000FA4, 0x0000 }, /* R4004 - ANC Coefficient */ | ||
1783 | { 0x00000FA5, 0x0000 }, /* R4005 - ANC Coefficient */ | ||
1784 | { 0x00000FA6, 0x0000 }, /* R4006 - ANC Coefficient */ | ||
1785 | { 0x00000FA7, 0x0000 }, /* R4007 - ANC Coefficient */ | ||
1786 | { 0x00000FA8, 0x0000 }, /* R4008 - ANC Coefficient */ | ||
1787 | { 0x00000FA9, 0x0000 }, /* R4009 - ANC Coefficient */ | ||
1788 | { 0x00000FAA, 0x0000 }, /* R4010 - ANC Coefficient */ | ||
1789 | { 0x00000FAB, 0x0000 }, /* R4011 - ANC Coefficient */ | ||
1790 | { 0x00000FAC, 0x0000 }, /* R4012 - ANC Coefficient */ | ||
1791 | { 0x00000FAD, 0x0000 }, /* R4013 - ANC Coefficient */ | ||
1792 | { 0x00000FAE, 0x0000 }, /* R4014 - ANC Coefficient */ | ||
1793 | { 0x00000FAF, 0x0000 }, /* R4015 - ANC Coefficient */ | ||
1794 | { 0x00000FB0, 0x0000 }, /* R4016 - ANC Coefficient */ | ||
1795 | { 0x00000FB1, 0x0000 }, /* R4017 - ANC Coefficient */ | ||
1796 | { 0x00000FB2, 0x0000 }, /* R4018 - ANC Coefficient */ | ||
1797 | { 0x00000FB3, 0x0000 }, /* R4019 - ANC Coefficient */ | ||
1798 | { 0x00000FB4, 0x0000 }, /* R4020 - ANC Coefficient */ | ||
1799 | { 0x00000FB5, 0x0000 }, /* R4021 - ANC Coefficient */ | ||
1800 | { 0x00000FB6, 0x0000 }, /* R4022 - ANC Coefficient */ | ||
1801 | { 0x00000FB7, 0x0000 }, /* R4023 - ANC Coefficient */ | ||
1802 | { 0x00000FB8, 0x0000 }, /* R4024 - ANC Coefficient */ | ||
1803 | { 0x00000FB9, 0x0000 }, /* R4025 - ANC Coefficient */ | ||
1804 | { 0x00000FBA, 0x0000 }, /* R4026 - ANC Coefficient */ | ||
1805 | { 0x00000FBB, 0x0000 }, /* R4027 - ANC Coefficient */ | ||
1806 | { 0x00000FBC, 0x0000 }, /* R4028 - ANC Coefficient */ | ||
1807 | { 0x00000FBD, 0x0000 }, /* R4029 - ANC Coefficient */ | ||
1808 | { 0x00000FBE, 0x0000 }, /* R4030 - ANC Coefficient */ | ||
1809 | { 0x00000FBF, 0x0000 }, /* R4031 - ANC Coefficient */ | ||
1810 | { 0x00000FC0, 0x0000 }, /* R4032 - ANC Coefficient */ | ||
1811 | { 0x00000FC1, 0x0000 }, /* R4033 - ANC Coefficient */ | ||
1812 | { 0x00000FC2, 0x0000 }, /* R4034 - ANC Coefficient */ | ||
1813 | { 0x00000FC3, 0x0000 }, /* R4035 - ANC Coefficient */ | ||
1814 | { 0x00000FC4, 0x0000 }, /* R4036 - ANC Coefficient */ | ||
1636 | { 0x00001100, 0x0010 }, /* R4352 - DSP1 Control 1 */ | 1815 | { 0x00001100, 0x0010 }, /* R4352 - DSP1 Control 1 */ |
1637 | { 0x00001200, 0x0010 }, /* R4608 - DSP2 Control 1 */ | 1816 | { 0x00001200, 0x0010 }, /* R4608 - DSP2 Control 1 */ |
1638 | { 0x00001300, 0x0010 }, /* R4864 - DSP3 Control 1 */ | 1817 | { 0x00001300, 0x0010 }, /* R4864 - DSP3 Control 1 */ |
@@ -2710,6 +2889,13 @@ static bool wm5110_readable_register(struct device *dev, unsigned int reg) | |||
2710 | case ARIZONA_CLOCK_CONTROL: | 2889 | case ARIZONA_CLOCK_CONTROL: |
2711 | case ARIZONA_ANC_SRC: | 2890 | case ARIZONA_ANC_SRC: |
2712 | case ARIZONA_DSP_STATUS: | 2891 | case ARIZONA_DSP_STATUS: |
2892 | case ARIZONA_ANC_COEFF_START ... ARIZONA_ANC_COEFF_END: | ||
2893 | case ARIZONA_FCL_FILTER_CONTROL: | ||
2894 | case ARIZONA_FCL_ADC_REFORMATTER_CONTROL: | ||
2895 | case ARIZONA_FCL_COEFF_START ... ARIZONA_FCL_COEFF_END: | ||
2896 | case ARIZONA_FCR_FILTER_CONTROL: | ||
2897 | case ARIZONA_FCR_ADC_REFORMATTER_CONTROL: | ||
2898 | case ARIZONA_FCR_COEFF_START ... ARIZONA_FCR_COEFF_END: | ||
2713 | case ARIZONA_DSP1_CONTROL_1: | 2899 | case ARIZONA_DSP1_CONTROL_1: |
2714 | case ARIZONA_DSP1_CLOCKING_1: | 2900 | case ARIZONA_DSP1_CLOCKING_1: |
2715 | case ARIZONA_DSP1_STATUS_1: | 2901 | case ARIZONA_DSP1_STATUS_1: |
diff --git a/drivers/mfd/wm831x-core.c b/drivers/mfd/wm831x-core.c index 28366a90e1ad..3e0e99ec5836 100644 --- a/drivers/mfd/wm831x-core.c +++ b/drivers/mfd/wm831x-core.c | |||
@@ -1626,7 +1626,9 @@ int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq) | |||
1626 | mutex_init(&wm831x->io_lock); | 1626 | mutex_init(&wm831x->io_lock); |
1627 | mutex_init(&wm831x->key_lock); | 1627 | mutex_init(&wm831x->key_lock); |
1628 | dev_set_drvdata(wm831x->dev, wm831x); | 1628 | dev_set_drvdata(wm831x->dev, wm831x); |
1629 | wm831x->soft_shutdown = pdata->soft_shutdown; | 1629 | |
1630 | if (pdata) | ||
1631 | wm831x->soft_shutdown = pdata->soft_shutdown; | ||
1630 | 1632 | ||
1631 | ret = wm831x_reg_read(wm831x, WM831X_PARENT_ID); | 1633 | ret = wm831x_reg_read(wm831x, WM831X_PARENT_ID); |
1632 | if (ret < 0) { | 1634 | if (ret < 0) { |
diff --git a/drivers/mfd/wm8998-tables.c b/drivers/mfd/wm8998-tables.c index e6de3cd8a9aa..4c2dce77cdfc 100644 --- a/drivers/mfd/wm8998-tables.c +++ b/drivers/mfd/wm8998-tables.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #define WM8998_NUM_AOD_ISR 2 | 21 | #define WM8998_NUM_AOD_ISR 2 |
22 | #define WM8998_NUM_ISR 5 | 22 | #define WM8998_NUM_ISR 5 |
23 | 23 | ||
24 | static const struct reg_default wm8998_rev_a_patch[] = { | 24 | static const struct reg_sequence wm8998_rev_a_patch[] = { |
25 | { 0x0212, 0x0000 }, | 25 | { 0x0212, 0x0000 }, |
26 | { 0x0211, 0x0014 }, | 26 | { 0x0211, 0x0014 }, |
27 | { 0x04E4, 0x0E0D }, | 27 | { 0x04E4, 0x0E0D }, |
@@ -199,8 +199,6 @@ static const struct reg_default wm8998_reg_default[] = { | |||
199 | { 0x00000069, 0x01FF }, /* R105 - Always On Triggers Sequence Select 4 */ | 199 | { 0x00000069, 0x01FF }, /* R105 - Always On Triggers Sequence Select 4 */ |
200 | { 0x0000006A, 0x01FF }, /* R106 - Always On Triggers Sequence Select 5 */ | 200 | { 0x0000006A, 0x01FF }, /* R106 - Always On Triggers Sequence Select 5 */ |
201 | { 0x0000006B, 0x01FF }, /* R107 - Always On Triggers Sequence Select 6 */ | 201 | { 0x0000006B, 0x01FF }, /* R107 - Always On Triggers Sequence Select 6 */ |
202 | { 0x0000006E, 0x01FF }, /* R110 - Trigger Sequence Select 32 */ | ||
203 | { 0x0000006F, 0x01FF }, /* R111 - Trigger Sequence Select 33 */ | ||
204 | { 0x00000090, 0x0000 }, /* R144 - Haptics Control 1 */ | 202 | { 0x00000090, 0x0000 }, /* R144 - Haptics Control 1 */ |
205 | { 0x00000091, 0x7FFF }, /* R145 - Haptics Control 2 */ | 203 | { 0x00000091, 0x7FFF }, /* R145 - Haptics Control 2 */ |
206 | { 0x00000092, 0x0000 }, /* R146 - Haptics phase 1 intensity */ | 204 | { 0x00000092, 0x0000 }, /* R146 - Haptics phase 1 intensity */ |
@@ -270,16 +268,13 @@ static const struct reg_default wm8998_reg_default[] = { | |||
270 | { 0x0000021A, 0x01A6 }, /* R538 - Mic Bias Ctrl 3 */ | 268 | { 0x0000021A, 0x01A6 }, /* R538 - Mic Bias Ctrl 3 */ |
271 | { 0x00000293, 0x0080 }, /* R659 - Accessory Detect Mode 1 */ | 269 | { 0x00000293, 0x0080 }, /* R659 - Accessory Detect Mode 1 */ |
272 | { 0x0000029B, 0x0000 }, /* R667 - Headphone Detect 1 */ | 270 | { 0x0000029B, 0x0000 }, /* R667 - Headphone Detect 1 */ |
273 | { 0x0000029C, 0x0000 }, /* R668 - Headphone Detect 2 */ | ||
274 | { 0x000002A2, 0x0000 }, /* R674 - Micd Clamp control */ | 271 | { 0x000002A2, 0x0000 }, /* R674 - Micd Clamp control */ |
275 | { 0x000002A3, 0x1102 }, /* R675 - Mic Detect 1 */ | 272 | { 0x000002A3, 0x1102 }, /* R675 - Mic Detect 1 */ |
276 | { 0x000002A4, 0x009F }, /* R676 - Mic Detect 2 */ | 273 | { 0x000002A4, 0x009F }, /* R676 - Mic Detect 2 */ |
277 | { 0x000002A5, 0x0000 }, /* R677 - Mic Detect 3 */ | ||
278 | { 0x000002A6, 0x3737 }, /* R678 - Mic Detect Level 1 */ | 274 | { 0x000002A6, 0x3737 }, /* R678 - Mic Detect Level 1 */ |
279 | { 0x000002A7, 0x2C37 }, /* R679 - Mic Detect Level 2 */ | 275 | { 0x000002A7, 0x2C37 }, /* R679 - Mic Detect Level 2 */ |
280 | { 0x000002A8, 0x1422 }, /* R680 - Mic Detect Level 3 */ | 276 | { 0x000002A8, 0x1422 }, /* R680 - Mic Detect Level 3 */ |
281 | { 0x000002A9, 0x030A }, /* R681 - Mic Detect Level 4 */ | 277 | { 0x000002A9, 0x030A }, /* R681 - Mic Detect Level 4 */ |
282 | { 0x000002AB, 0x0000 }, /* R683 - Mic Detect 4 */ | ||
283 | { 0x000002CB, 0x0000 }, /* R715 - Isolation control */ | 278 | { 0x000002CB, 0x0000 }, /* R715 - Isolation control */ |
284 | { 0x000002D3, 0x0000 }, /* R723 - Jack detect analogue */ | 279 | { 0x000002D3, 0x0000 }, /* R723 - Jack detect analogue */ |
285 | { 0x00000300, 0x0000 }, /* R768 - Input Enables */ | 280 | { 0x00000300, 0x0000 }, /* R768 - Input Enables */ |
@@ -707,13 +702,11 @@ static const struct reg_default wm8998_reg_default[] = { | |||
707 | { 0x00000D1A, 0xFFFF }, /* R3354 - IRQ2 Status 3 Mask */ | 702 | { 0x00000D1A, 0xFFFF }, /* R3354 - IRQ2 Status 3 Mask */ |
708 | { 0x00000D1B, 0xFFFF }, /* R3355 - IRQ2 Status 4 Mask */ | 703 | { 0x00000D1B, 0xFFFF }, /* R3355 - IRQ2 Status 4 Mask */ |
709 | { 0x00000D1C, 0xFEFF }, /* R3356 - IRQ2 Status 5 Mask */ | 704 | { 0x00000D1C, 0xFEFF }, /* R3356 - IRQ2 Status 5 Mask */ |
710 | { 0x00000D1D, 0xFFFF }, /* R3357 - IRQ2 Status 6 Mask */ | ||
711 | { 0x00000D1F, 0x0000 }, /* R3359 - IRQ2 Control */ | 705 | { 0x00000D1F, 0x0000 }, /* R3359 - IRQ2 Control */ |
712 | { 0x00000D53, 0xFFFF }, /* R3411 - AOD IRQ Mask IRQ1 */ | 706 | { 0x00000D53, 0xFFFF }, /* R3411 - AOD IRQ Mask IRQ1 */ |
713 | { 0x00000D54, 0xFFFF }, /* R3412 - AOD IRQ Mask IRQ2 */ | 707 | { 0x00000D54, 0xFFFF }, /* R3412 - AOD IRQ Mask IRQ2 */ |
714 | { 0x00000D56, 0x0000 }, /* R3414 - Jack detect debounce */ | 708 | { 0x00000D56, 0x0000 }, /* R3414 - Jack detect debounce */ |
715 | { 0x00000E00, 0x0000 }, /* R3584 - FX_Ctrl1 */ | 709 | { 0x00000E00, 0x0000 }, /* R3584 - FX_Ctrl1 */ |
716 | { 0x00000E01, 0x0000 }, /* R3585 - FX_Ctrl2 */ | ||
717 | { 0x00000E10, 0x6318 }, /* R3600 - EQ1_1 */ | 710 | { 0x00000E10, 0x6318 }, /* R3600 - EQ1_1 */ |
718 | { 0x00000E11, 0x6300 }, /* R3601 - EQ1_2 */ | 711 | { 0x00000E11, 0x6300 }, /* R3601 - EQ1_2 */ |
719 | { 0x00000E12, 0x0FC8 }, /* R3602 - EQ1_3 */ | 712 | { 0x00000E12, 0x0FC8 }, /* R3602 - EQ1_3 */ |
@@ -833,7 +826,6 @@ static bool wm8998_readable_register(struct device *dev, unsigned int reg) | |||
833 | switch (reg) { | 826 | switch (reg) { |
834 | case ARIZONA_SOFTWARE_RESET: | 827 | case ARIZONA_SOFTWARE_RESET: |
835 | case ARIZONA_DEVICE_REVISION: | 828 | case ARIZONA_DEVICE_REVISION: |
836 | case ARIZONA_CTRL_IF_SPI_CFG_1: | ||
837 | case ARIZONA_CTRL_IF_I2C1_CFG_1: | 829 | case ARIZONA_CTRL_IF_I2C1_CFG_1: |
838 | case ARIZONA_CTRL_IF_I2C1_CFG_2: | 830 | case ARIZONA_CTRL_IF_I2C1_CFG_2: |
839 | case ARIZONA_WRITE_SEQUENCER_CTRL_0: | 831 | case ARIZONA_WRITE_SEQUENCER_CTRL_0: |