aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-03-18 13:15:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-03-18 13:15:11 -0400
commit12e7b0a62752234497de51356903f5f4e6bd2f77 (patch)
tree700601b833bf3e4097eb9307ed3fcc5d32d8d117 /drivers/mfd
parent021f163d696caed5a336fa1569efdd22216da340 (diff)
parent0343b2f4e4a52c907d7676ce3159e0b5e7f0301c (diff)
Merge tag 'mfd-for-linus-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd
Pull MFD updates from Lee Jones: "New Drivers: - Freescale Touch Screen ADC - X-Powers AXP PMIC with RSB - TI TPS65086 Power Management IC (PMIC) New Device Support: - Supply device PCI IDs for Intel Broxton Fix-ups: - Move to clkdev_create() API; intel_quark_i2c_gpio - Complete re-write of TI's TPS65912 Power Management IC (PMIC) - Remove unnecessary function argument; axp20x - Separate out bus related code; axp20x - Coding Style changes; axp20x - Allow more drivers to be compiled as modules - Work around false positive 'used uninitialised' warning; db8500-prcmu Bug Fixes: - Remove do_div(); fsl-imx25-gcq - Fix driver init when built-in; tps65010 - Fix clock-unregister leak; intel-lpss" * tag 'mfd-for-linus-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (53 commits) mfd: intel-lpss: Pass I2C configuration via properties on BXT mfd: imx6sx: Add PCIe register definitions for iomuxc gpr mfd: ipaq-micro: Use __maybe_unused to hide pm functions mfd: max77686: Add max77802 to I2C device ID table mfd: max77686: Export OF module alias information mfd: max77686: Allow driver to be built as a module mfd: stmpe: Add the proper PWM resources mfd: tps65090: Set regmap config reg counts properly mfd: syscon: Return ENOTSUPP instead of ENOSYS when disabled mfd: as3711: Set regmap config reg counts properly mfd: rc5t583: Set regmap config reg counts properly gpio: tps65086: Add GPO driver for the TPS65086 PMIC mfd: mt6397: Add platform device ID table mfd: da9063: Fix missing volatile registers in the core regmap_range volatile lists mfd: mt6397: Add MT6323 support to MT6397 driver mfd: mt6397: Add support for different Slave types mfd: mt6397: int_con and int_status may vary in location dt-bindings: mfd: Add bindings for the MediaTek MT6323 PMIC mfd: da9062: Fix missing volatile registers in the core regmap_range volatile lists mfd: Add documentation for ACT8945A DT bindings ...
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/Kconfig80
-rw-r--r--drivers/mfd/Makefile6
-rw-r--r--drivers/mfd/act8945a.c102
-rw-r--r--drivers/mfd/as3711.c4
-rw-r--r--drivers/mfd/axp20x-i2c.c104
-rw-r--r--drivers/mfd/axp20x-rsb.c80
-rw-r--r--drivers/mfd/axp20x.c105
-rw-r--r--drivers/mfd/cs47l24-tables.c10
-rw-r--r--drivers/mfd/da9062-core.c23
-rw-r--r--drivers/mfd/da9063-i2c.c36
-rw-r--r--drivers/mfd/db8500-prcmu.c7
-rw-r--r--drivers/mfd/fsl-imx25-tsadc.c203
-rw-r--r--drivers/mfd/intel-lpss-acpi.c12
-rw-r--r--drivers/mfd/intel-lpss-pci.c31
-rw-r--r--drivers/mfd/intel-lpss.c1
-rw-r--r--drivers/mfd/intel_quark_i2c_gpio.c26
-rw-r--r--drivers/mfd/ipaq-micro.c2
-rw-r--r--drivers/mfd/max77686.c2
-rw-r--r--drivers/mfd/mt6397-core.c105
-rw-r--r--drivers/mfd/rc5t583.c4
-rw-r--r--drivers/mfd/stmpe.c35
-rw-r--r--drivers/mfd/syscon.c19
-rw-r--r--drivers/mfd/tps65010.c21
-rw-r--r--drivers/mfd/tps65086.c149
-rw-r--r--drivers/mfd/tps65090.c5
-rw-r--r--drivers/mfd/wm5102-tables.c16
-rw-r--r--drivers/mfd/wm5110-tables.c82
-rw-r--r--drivers/mfd/wm8998-tables.c12
28 files changed, 1021 insertions, 261 deletions
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 1bc97c2761e4..eea61e349e26 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -18,6 +18,17 @@ config MFD_CS5535
18 This is the core driver for CS5535/CS5536 MFD functions. This is 18 This is the core driver for CS5535/CS5536 MFD functions. This is
19 necessary for using the board's GPIO and MFGPT functionality. 19 necessary for using the board's GPIO and MFGPT functionality.
20 20
21config MFD_ACT8945A
22 tristate "Active-semi ACT8945A"
23 select MFD_CORE
24 select REGMAP_I2C
25 depends on I2C && OF
26 help
27 Support for the ACT8945A PMIC from Active-semi. This device
28 features three step-down DC/DC converters and four low-dropout
29 linear regulators, along with a complete ActivePath battery
30 charger.
31
21config MFD_AS3711 32config MFD_AS3711
22 bool "AMS AS3711" 33 bool "AMS AS3711"
23 select MFD_CORE 34 select MFD_CORE
@@ -91,14 +102,29 @@ config MFD_BCM590XX
91 Support for the BCM590xx PMUs from Broadcom 102 Support for the BCM590xx PMUs from Broadcom
92 103
93config MFD_AXP20X 104config MFD_AXP20X
94 bool "X-Powers AXP20X" 105 tristate
95 select MFD_CORE 106 select MFD_CORE
96 select REGMAP_I2C
97 select REGMAP_IRQ 107 select REGMAP_IRQ
98 depends on I2C=y 108
109config MFD_AXP20X_I2C
110 tristate "X-Powers AXP series PMICs with I2C"
111 select MFD_AXP20X
112 select REGMAP_I2C
113 depends on I2C
114 help
115 If you say Y here you get support for the X-Powers AXP series power
116 management ICs (PMICs) controlled with I2C.
117 This driver include only the core APIs. You have to select individual
118 components like regulators or the PEK (Power Enable Key) under the
119 corresponding menus.
120
121config MFD_AXP20X_RSB
122 tristate "X-Powers AXP series PMICs with RSB"
123 select MFD_AXP20X
124 depends on SUNXI_RSB
99 help 125 help
100 If you say Y here you get support for the X-Powers AXP202, AXP209 and 126 If you say Y here you get support for the X-Powers AXP series power
101 AXP288 power management IC (PMIC). 127 management ICs (PMICs) controlled with RSB.
102 This driver include only the core APIs. You have to select individual 128 This driver include only the core APIs. You have to select individual
103 components like regulators or the PEK (Power Enable Key) under the 129 components like regulators or the PEK (Power Enable Key) under the
104 corresponding menus. 130 corresponding menus.
@@ -203,7 +229,7 @@ config MFD_DA9062
203 select MFD_CORE 229 select MFD_CORE
204 select REGMAP_I2C 230 select REGMAP_I2C
205 select REGMAP_IRQ 231 select REGMAP_IRQ
206 depends on I2C=y 232 depends on I2C
207 help 233 help
208 Say yes here for support for the Dialog Semiconductor DA9062 PMIC. 234 Say yes here for support for the Dialog Semiconductor DA9062 PMIC.
209 This includes the I2C driver and core APIs. 235 This includes the I2C driver and core APIs.
@@ -215,7 +241,7 @@ config MFD_DA9063
215 select MFD_CORE 241 select MFD_CORE
216 select REGMAP_I2C 242 select REGMAP_I2C
217 select REGMAP_IRQ 243 select REGMAP_IRQ
218 depends on I2C=y 244 depends on I2C
219 help 245 help
220 Say yes here for support for the Dialog Semiconductor DA9063 PMIC. 246 Say yes here for support for the Dialog Semiconductor DA9063 PMIC.
221 This includes the I2C driver and core APIs. 247 This includes the I2C driver and core APIs.
@@ -224,7 +250,7 @@ config MFD_DA9063
224 250
225config MFD_DA9150 251config MFD_DA9150
226 tristate "Dialog Semiconductor DA9150 Charger Fuel-Gauge chip" 252 tristate "Dialog Semiconductor DA9150 Charger Fuel-Gauge chip"
227 depends on I2C=y 253 depends on I2C
228 select MFD_CORE 254 select MFD_CORE
229 select REGMAP_I2C 255 select REGMAP_I2C
230 select REGMAP_IRQ 256 select REGMAP_IRQ
@@ -271,6 +297,15 @@ config MFD_MC13XXX_I2C
271 help 297 help
272 Select this if your MC13xxx is connected via an I2C bus. 298 Select this if your MC13xxx is connected via an I2C bus.
273 299
300config MFD_MX25_TSADC
301 tristate "Freescale i.MX25 integrated Touchscreen and ADC unit"
302 select REGMAP_MMIO
303 depends on (SOC_IMX25 && OF) || COMPILE_TEST
304 help
305 Enable support for the integrated Touchscreen and ADC unit of the
306 i.MX25 processors. They consist of a conversion queue for general
307 purpose ADC and a queue for Touchscreens.
308
274config MFD_HI6421_PMIC 309config MFD_HI6421_PMIC
275 tristate "HiSilicon Hi6421 PMU/Codec IC" 310 tristate "HiSilicon Hi6421 PMU/Codec IC"
276 depends on OF 311 depends on OF
@@ -445,7 +480,7 @@ config MFD_KEMPLD
445 480
446config MFD_88PM800 481config MFD_88PM800
447 tristate "Marvell 88PM800" 482 tristate "Marvell 88PM800"
448 depends on I2C=y 483 depends on I2C
449 select REGMAP_I2C 484 select REGMAP_I2C
450 select REGMAP_IRQ 485 select REGMAP_IRQ
451 select MFD_CORE 486 select MFD_CORE
@@ -457,7 +492,7 @@ config MFD_88PM800
457 492
458config MFD_88PM805 493config MFD_88PM805
459 tristate "Marvell 88PM805" 494 tristate "Marvell 88PM805"
460 depends on I2C=y 495 depends on I2C
461 select REGMAP_I2C 496 select REGMAP_I2C
462 select REGMAP_IRQ 497 select REGMAP_IRQ
463 select MFD_CORE 498 select MFD_CORE
@@ -493,8 +528,8 @@ config MFD_MAX14577
493 of the device. 528 of the device.
494 529
495config MFD_MAX77686 530config MFD_MAX77686
496 bool "Maxim Semiconductor MAX77686/802 PMIC Support" 531 tristate "Maxim Semiconductor MAX77686/802 PMIC Support"
497 depends on I2C=y 532 depends on I2C
498 depends on OF 533 depends on OF
499 select MFD_CORE 534 select MFD_CORE
500 select REGMAP_I2C 535 select REGMAP_I2C
@@ -538,7 +573,7 @@ config MFD_MAX77843
538config MFD_MAX8907 573config MFD_MAX8907
539 tristate "Maxim Semiconductor MAX8907 PMIC Support" 574 tristate "Maxim Semiconductor MAX8907 PMIC Support"
540 select MFD_CORE 575 select MFD_CORE
541 depends on I2C=y 576 depends on I2C
542 select REGMAP_I2C 577 select REGMAP_I2C
543 select REGMAP_IRQ 578 select REGMAP_IRQ
544 help 579 help
@@ -743,7 +778,7 @@ config MFD_RTSX_PCI
743 778
744config MFD_RT5033 779config MFD_RT5033
745 tristate "Richtek RT5033 Power Management IC" 780 tristate "Richtek RT5033 Power Management IC"
746 depends on I2C=y 781 depends on I2C
747 select MFD_CORE 782 select MFD_CORE
748 select REGMAP_I2C 783 select REGMAP_I2C
749 select REGMAP_IRQ 784 select REGMAP_IRQ
@@ -1106,6 +1141,19 @@ config TPS6507X
1106 This driver can also be built as a module. If so, the module 1141 This driver can also be built as a module. If so, the module
1107 will be called tps6507x. 1142 will be called tps6507x.
1108 1143
1144config MFD_TPS65086
1145 tristate "TI TPS65086 Power Management Integrated Chips (PMICs)"
1146 select REGMAP
1147 select REGMAP_IRQ
1148 select REGMAP_I2C
1149 depends on I2C
1150 help
1151 If you say yes here you get support for the TPS65086 series of
1152 Power Management chips.
1153 This driver provides common support for accessing the device,
1154 additional drivers must be enabled in order to use the
1155 functionality of the device.
1156
1109config TPS65911_COMPARATOR 1157config TPS65911_COMPARATOR
1110 tristate 1158 tristate
1111 1159
@@ -1370,7 +1418,6 @@ config MFD_ARIZONA
1370config MFD_ARIZONA_I2C 1418config MFD_ARIZONA_I2C
1371 tristate "Cirrus Logic/Wolfson Microelectronics Arizona platform with I2C" 1419 tristate "Cirrus Logic/Wolfson Microelectronics Arizona platform with I2C"
1372 select MFD_ARIZONA 1420 select MFD_ARIZONA
1373 select MFD_CORE
1374 select REGMAP_I2C 1421 select REGMAP_I2C
1375 depends on I2C 1422 depends on I2C
1376 help 1423 help
@@ -1380,12 +1427,11 @@ config MFD_ARIZONA_I2C
1380config MFD_ARIZONA_SPI 1427config MFD_ARIZONA_SPI
1381 tristate "Cirrus Logic/Wolfson Microelectronics Arizona platform with SPI" 1428 tristate "Cirrus Logic/Wolfson Microelectronics Arizona platform with SPI"
1382 select MFD_ARIZONA 1429 select MFD_ARIZONA
1383 select MFD_CORE
1384 select REGMAP_SPI 1430 select REGMAP_SPI
1385 depends on SPI_MASTER 1431 depends on SPI_MASTER
1386 help 1432 help
1387 Support for the Cirrus Logic/Wolfson Microelectronics Arizona platform 1433 Support for the Cirrus Logic/Wolfson Microelectronics Arizona platform
1388 audio SoC core functionality controlled via I2C. 1434 audio SoC core functionality controlled via SPI.
1389 1435
1390config MFD_CS47L24 1436config MFD_CS47L24
1391 bool "Cirrus Logic CS47L24 and WM1831" 1437 bool "Cirrus Logic CS47L24 and WM1831"
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 1811202cee19..5eaa6465d0a6 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -6,6 +6,7 @@
6obj-$(CONFIG_MFD_88PM860X) += 88pm860x.o 6obj-$(CONFIG_MFD_88PM860X) += 88pm860x.o
7obj-$(CONFIG_MFD_88PM800) += 88pm800.o 88pm80x.o 7obj-$(CONFIG_MFD_88PM800) += 88pm800.o 88pm80x.o
8obj-$(CONFIG_MFD_88PM805) += 88pm805.o 88pm80x.o 8obj-$(CONFIG_MFD_88PM805) += 88pm805.o 88pm80x.o
9obj-$(CONFIG_MFD_ACT8945A) += act8945a.o
9obj-$(CONFIG_MFD_SM501) += sm501.o 10obj-$(CONFIG_MFD_SM501) += sm501.o
10obj-$(CONFIG_MFD_ASIC3) += asic3.o tmio_core.o 11obj-$(CONFIG_MFD_ASIC3) += asic3.o tmio_core.o
11obj-$(CONFIG_MFD_BCM590XX) += bcm590xx.o 12obj-$(CONFIG_MFD_BCM590XX) += bcm590xx.o
@@ -70,6 +71,7 @@ obj-$(CONFIG_MFD_WM8994) += wm8994.o
70obj-$(CONFIG_TPS6105X) += tps6105x.o 71obj-$(CONFIG_TPS6105X) += tps6105x.o
71obj-$(CONFIG_TPS65010) += tps65010.o 72obj-$(CONFIG_TPS65010) += tps65010.o
72obj-$(CONFIG_TPS6507X) += tps6507x.o 73obj-$(CONFIG_TPS6507X) += tps6507x.o
74obj-$(CONFIG_MFD_TPS65086) += tps65086.o
73obj-$(CONFIG_MFD_TPS65217) += tps65217.o 75obj-$(CONFIG_MFD_TPS65217) += tps65217.o
74obj-$(CONFIG_MFD_TPS65218) += tps65218.o 76obj-$(CONFIG_MFD_TPS65218) += tps65218.o
75obj-$(CONFIG_MFD_TPS65910) += tps65910.o 77obj-$(CONFIG_MFD_TPS65910) += tps65910.o
@@ -84,6 +86,8 @@ obj-$(CONFIG_TWL4030_POWER) += twl4030-power.o
84obj-$(CONFIG_MFD_TWL4030_AUDIO) += twl4030-audio.o 86obj-$(CONFIG_MFD_TWL4030_AUDIO) += twl4030-audio.o
85obj-$(CONFIG_TWL6040_CORE) += twl6040.o 87obj-$(CONFIG_TWL6040_CORE) += twl6040.o
86 88
89obj-$(CONFIG_MFD_MX25_TSADC) += fsl-imx25-tsadc.o
90
87obj-$(CONFIG_MFD_MC13XXX) += mc13xxx-core.o 91obj-$(CONFIG_MFD_MC13XXX) += mc13xxx-core.o
88obj-$(CONFIG_MFD_MC13XXX_SPI) += mc13xxx-spi.o 92obj-$(CONFIG_MFD_MC13XXX_SPI) += mc13xxx-spi.o
89obj-$(CONFIG_MFD_MC13XXX_I2C) += mc13xxx-i2c.o 93obj-$(CONFIG_MFD_MC13XXX_I2C) += mc13xxx-i2c.o
@@ -110,6 +114,8 @@ obj-$(CONFIG_PMIC_DA9052) += da9052-core.o
110obj-$(CONFIG_MFD_DA9052_SPI) += da9052-spi.o 114obj-$(CONFIG_MFD_DA9052_SPI) += da9052-spi.o
111obj-$(CONFIG_MFD_DA9052_I2C) += da9052-i2c.o 115obj-$(CONFIG_MFD_DA9052_I2C) += da9052-i2c.o
112obj-$(CONFIG_MFD_AXP20X) += axp20x.o 116obj-$(CONFIG_MFD_AXP20X) += axp20x.o
117obj-$(CONFIG_MFD_AXP20X_I2C) += axp20x-i2c.o
118obj-$(CONFIG_MFD_AXP20X_RSB) += axp20x-rsb.o
113 119
114obj-$(CONFIG_MFD_LP3943) += lp3943.o 120obj-$(CONFIG_MFD_LP3943) += lp3943.o
115obj-$(CONFIG_MFD_LP8788) += lp8788.o lp8788-irq.o 121obj-$(CONFIG_MFD_LP8788) += lp8788.o lp8788-irq.o
diff --git a/drivers/mfd/act8945a.c b/drivers/mfd/act8945a.c
new file mode 100644
index 000000000000..525b546ba42f
--- /dev/null
+++ b/drivers/mfd/act8945a.c
@@ -0,0 +1,102 @@
1/*
2 * MFD driver for Active-semi ACT8945a PMIC
3 *
4 * Copyright (C) 2015 Atmel Corporation.
5 *
6 * Author: Wenyou Yang <wenyou.yang@atmel.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13
14#include <linux/i2c.h>
15#include <linux/mfd/core.h>
16#include <linux/module.h>
17#include <linux/of_device.h>
18#include <linux/regmap.h>
19
20static const struct mfd_cell act8945a_devs[] = {
21 {
22 .name = "act8945a-regulator",
23 },
24 {
25 .name = "act8945a-charger",
26 },
27};
28
29static const struct regmap_config act8945a_regmap_config = {
30 .reg_bits = 8,
31 .val_bits = 8,
32};
33
34static int act8945a_i2c_probe(struct i2c_client *i2c,
35 const struct i2c_device_id *id)
36{
37 int ret;
38 struct regmap *regmap;
39
40 regmap = devm_regmap_init_i2c(i2c, &act8945a_regmap_config);
41 if (IS_ERR(regmap)) {
42 ret = PTR_ERR(regmap);
43 dev_err(&i2c->dev, "regmap init failed: %d\n", ret);
44 return ret;
45 }
46
47 i2c_set_clientdata(i2c, regmap);
48
49 ret = mfd_add_devices(&i2c->dev, PLATFORM_DEVID_NONE, act8945a_devs,
50 ARRAY_SIZE(act8945a_devs), NULL, 0, NULL);
51 if (ret) {
52 dev_err(&i2c->dev, "Failed to add sub devices\n");
53 return ret;
54 }
55
56 return 0;
57}
58
59static int act8945a_i2c_remove(struct i2c_client *i2c)
60{
61 mfd_remove_devices(&i2c->dev);
62
63 return 0;
64}
65
66static const struct i2c_device_id act8945a_i2c_id[] = {
67 { "act8945a", 0 },
68 {}
69};
70MODULE_DEVICE_TABLE(i2c, act8945a_i2c_id);
71
72static const struct of_device_id act8945a_of_match[] = {
73 { .compatible = "active-semi,act8945a", },
74 {},
75};
76MODULE_DEVICE_TABLE(of, act8945a_of_match);
77
78static struct i2c_driver act8945a_i2c_driver = {
79 .driver = {
80 .name = "act8945a",
81 .of_match_table = of_match_ptr(act8945a_of_match),
82 },
83 .probe = act8945a_i2c_probe,
84 .remove = act8945a_i2c_remove,
85 .id_table = act8945a_i2c_id,
86};
87
88static int __init act8945a_i2c_init(void)
89{
90 return i2c_add_driver(&act8945a_i2c_driver);
91}
92subsys_initcall(act8945a_i2c_init);
93
94static void __exit act8945a_i2c_exit(void)
95{
96 i2c_del_driver(&act8945a_i2c_driver);
97}
98module_exit(act8945a_i2c_exit);
99
100MODULE_DESCRIPTION("ACT8945A PMIC multi-function driver");
101MODULE_AUTHOR("Wenyou Yang <wenyou.yang@atmel.com>");
102MODULE_LICENSE("GPL");
diff --git a/drivers/mfd/as3711.c b/drivers/mfd/as3711.c
index 94d67a6e1eb7..09e1483b99bc 100644
--- a/drivers/mfd/as3711.c
+++ b/drivers/mfd/as3711.c
@@ -108,8 +108,8 @@ static const struct regmap_config as3711_regmap_config = {
108 .volatile_reg = as3711_volatile_reg, 108 .volatile_reg = as3711_volatile_reg,
109 .readable_reg = as3711_readable_reg, 109 .readable_reg = as3711_readable_reg,
110 .precious_reg = as3711_precious_reg, 110 .precious_reg = as3711_precious_reg,
111 .max_register = AS3711_MAX_REGS, 111 .max_register = AS3711_MAX_REG,
112 .num_reg_defaults_raw = AS3711_MAX_REGS, 112 .num_reg_defaults_raw = AS3711_NUM_REGS,
113 .cache_type = REGCACHE_RBTREE, 113 .cache_type = REGCACHE_RBTREE,
114}; 114};
115 115
diff --git a/drivers/mfd/axp20x-i2c.c b/drivers/mfd/axp20x-i2c.c
new file mode 100644
index 000000000000..b1b865822c07
--- /dev/null
+++ b/drivers/mfd/axp20x-i2c.c
@@ -0,0 +1,104 @@
1/*
2 * I2C driver for the X-Powers' Power Management ICs
3 *
4 * AXP20x typically comprises an adaptive USB-Compatible PWM charger, BUCK DC-DC
5 * converters, LDOs, multiple 12-bit ADCs of voltage, current and temperature
6 * as well as configurable GPIOs.
7 *
8 * This driver supports the I2C variants.
9 *
10 * Copyright (C) 2014 Carlo Caione
11 *
12 * Author: Carlo Caione <carlo@caione.org>
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
17 */
18
19#include <linux/acpi.h>
20#include <linux/err.h>
21#include <linux/i2c.h>
22#include <linux/module.h>
23#include <linux/mfd/axp20x.h>
24#include <linux/of.h>
25#include <linux/regmap.h>
26#include <linux/slab.h>
27
28static int axp20x_i2c_probe(struct i2c_client *i2c,
29 const struct i2c_device_id *id)
30{
31 struct axp20x_dev *axp20x;
32 int ret;
33
34 axp20x = devm_kzalloc(&i2c->dev, sizeof(*axp20x), GFP_KERNEL);
35 if (!axp20x)
36 return -ENOMEM;
37
38 axp20x->dev = &i2c->dev;
39 axp20x->irq = i2c->irq;
40 dev_set_drvdata(axp20x->dev, axp20x);
41
42 ret = axp20x_match_device(axp20x);
43 if (ret)
44 return ret;
45
46 axp20x->regmap = devm_regmap_init_i2c(i2c, axp20x->regmap_cfg);
47 if (IS_ERR(axp20x->regmap)) {
48 ret = PTR_ERR(axp20x->regmap);
49 dev_err(&i2c->dev, "regmap init failed: %d\n", ret);
50 return ret;
51 }
52
53 return axp20x_device_probe(axp20x);
54}
55
56static int axp20x_i2c_remove(struct i2c_client *i2c)
57{
58 struct axp20x_dev *axp20x = i2c_get_clientdata(i2c);
59
60 return axp20x_device_remove(axp20x);
61}
62
63static const struct of_device_id axp20x_i2c_of_match[] = {
64 { .compatible = "x-powers,axp152", .data = (void *)AXP152_ID },
65 { .compatible = "x-powers,axp202", .data = (void *)AXP202_ID },
66 { .compatible = "x-powers,axp209", .data = (void *)AXP209_ID },
67 { .compatible = "x-powers,axp221", .data = (void *)AXP221_ID },
68 { },
69};
70MODULE_DEVICE_TABLE(of, axp20x_i2c_of_match);
71
72/*
73 * This is useless for OF-enabled devices, but it is needed by I2C subsystem
74 */
75static const struct i2c_device_id axp20x_i2c_id[] = {
76 { },
77};
78MODULE_DEVICE_TABLE(i2c, axp20x_i2c_id);
79
80static const struct acpi_device_id axp20x_i2c_acpi_match[] = {
81 {
82 .id = "INT33F4",
83 .driver_data = AXP288_ID,
84 },
85 { },
86};
87MODULE_DEVICE_TABLE(acpi, axp20x_i2c_acpi_match);
88
89static struct i2c_driver axp20x_i2c_driver = {
90 .driver = {
91 .name = "axp20x-i2c",
92 .of_match_table = of_match_ptr(axp20x_i2c_of_match),
93 .acpi_match_table = ACPI_PTR(axp20x_i2c_acpi_match),
94 },
95 .probe = axp20x_i2c_probe,
96 .remove = axp20x_i2c_remove,
97 .id_table = axp20x_i2c_id,
98};
99
100module_i2c_driver(axp20x_i2c_driver);
101
102MODULE_DESCRIPTION("PMIC MFD I2C driver for AXP20X");
103MODULE_AUTHOR("Carlo Caione <carlo@caione.org>");
104MODULE_LICENSE("GPL");
diff --git a/drivers/mfd/axp20x-rsb.c b/drivers/mfd/axp20x-rsb.c
new file mode 100644
index 000000000000..28c20247c112
--- /dev/null
+++ b/drivers/mfd/axp20x-rsb.c
@@ -0,0 +1,80 @@
1/*
2 * RSB driver for the X-Powers' Power Management ICs
3 *
4 * AXP20x typically comprises an adaptive USB-Compatible PWM charger, BUCK DC-DC
5 * converters, LDOs, multiple 12-bit ADCs of voltage, current and temperature
6 * as well as configurable GPIOs.
7 *
8 * This driver supports the RSB variants.
9 *
10 * Copyright (C) 2015 Chen-Yu Tsai
11 *
12 * Author: Chen-Yu Tsai <wens@csie.org>
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
17 */
18
19#include <linux/acpi.h>
20#include <linux/err.h>
21#include <linux/mfd/axp20x.h>
22#include <linux/module.h>
23#include <linux/of.h>
24#include <linux/regmap.h>
25#include <linux/slab.h>
26#include <linux/sunxi-rsb.h>
27
28static int axp20x_rsb_probe(struct sunxi_rsb_device *rdev)
29{
30 struct axp20x_dev *axp20x;
31 int ret;
32
33 axp20x = devm_kzalloc(&rdev->dev, sizeof(*axp20x), GFP_KERNEL);
34 if (!axp20x)
35 return -ENOMEM;
36
37 axp20x->dev = &rdev->dev;
38 axp20x->irq = rdev->irq;
39 dev_set_drvdata(&rdev->dev, axp20x);
40
41 ret = axp20x_match_device(axp20x);
42 if (ret)
43 return ret;
44
45 axp20x->regmap = devm_regmap_init_sunxi_rsb(rdev, axp20x->regmap_cfg);
46 if (IS_ERR(axp20x->regmap)) {
47 ret = PTR_ERR(axp20x->regmap);
48 dev_err(&rdev->dev, "regmap init failed: %d\n", ret);
49 return ret;
50 }
51
52 return axp20x_device_probe(axp20x);
53}
54
55static int axp20x_rsb_remove(struct sunxi_rsb_device *rdev)
56{
57 struct axp20x_dev *axp20x = sunxi_rsb_device_get_drvdata(rdev);
58
59 return axp20x_device_remove(axp20x);
60}
61
62static const struct of_device_id axp20x_rsb_of_match[] = {
63 { .compatible = "x-powers,axp223", .data = (void *)AXP223_ID },
64 { },
65};
66MODULE_DEVICE_TABLE(of, axp20x_rsb_of_match);
67
68static struct sunxi_rsb_driver axp20x_rsb_driver = {
69 .driver = {
70 .name = "axp20x-rsb",
71 .of_match_table = of_match_ptr(axp20x_rsb_of_match),
72 },
73 .probe = axp20x_rsb_probe,
74 .remove = axp20x_rsb_remove,
75};
76module_sunxi_rsb_driver(axp20x_rsb_driver);
77
78MODULE_DESCRIPTION("PMIC MFD sunXi RSB driver for AXP20X");
79MODULE_AUTHOR("Chen-Yu Tsai <wens@csie.org>");
80MODULE_LICENSE("GPL v2");
diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
index 9842199e2e6c..a57d6e940610 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -1,10 +1,14 @@
1/* 1/*
2 * axp20x.c - MFD core driver for the X-Powers' Power Management ICs 2 * MFD core driver for the X-Powers' Power Management ICs
3 * 3 *
4 * AXP20x typically comprises an adaptive USB-Compatible PWM charger, BUCK DC-DC 4 * AXP20x typically comprises an adaptive USB-Compatible PWM charger, BUCK DC-DC
5 * converters, LDOs, multiple 12-bit ADCs of voltage, current and temperature 5 * converters, LDOs, multiple 12-bit ADCs of voltage, current and temperature
6 * as well as configurable GPIOs. 6 * as well as configurable GPIOs.
7 * 7 *
8 * This file contains the interface independent core functions.
9 *
10 * Copyright (C) 2014 Carlo Caione
11 *
8 * Author: Carlo Caione <carlo@caione.org> 12 * Author: Carlo Caione <carlo@caione.org>
9 * 13 *
10 * This program is free software; you can redistribute it and/or modify 14 * This program is free software; you can redistribute it and/or modify
@@ -13,18 +17,15 @@
13 */ 17 */
14 18
15#include <linux/err.h> 19#include <linux/err.h>
16#include <linux/i2c.h>
17#include <linux/interrupt.h> 20#include <linux/interrupt.h>
18#include <linux/kernel.h> 21#include <linux/kernel.h>
19#include <linux/module.h> 22#include <linux/module.h>
20#include <linux/pm_runtime.h> 23#include <linux/pm_runtime.h>
21#include <linux/regmap.h> 24#include <linux/regmap.h>
22#include <linux/slab.h>
23#include <linux/regulator/consumer.h> 25#include <linux/regulator/consumer.h>
24#include <linux/mfd/axp20x.h> 26#include <linux/mfd/axp20x.h>
25#include <linux/mfd/core.h> 27#include <linux/mfd/core.h>
26#include <linux/of_device.h> 28#include <linux/of_device.h>
27#include <linux/of_irq.h>
28#include <linux/acpi.h> 29#include <linux/acpi.h>
29 30
30#define AXP20X_OFF 0x80 31#define AXP20X_OFF 0x80
@@ -34,6 +35,7 @@ static const char * const axp20x_model_names[] = {
34 "AXP202", 35 "AXP202",
35 "AXP209", 36 "AXP209",
36 "AXP221", 37 "AXP221",
38 "AXP223",
37 "AXP288", 39 "AXP288",
38}; 40};
39 41
@@ -376,32 +378,6 @@ static const struct regmap_irq axp288_regmap_irqs[] = {
376 INIT_REGMAP_IRQ(AXP288, BC_USB_CHNG, 5, 1), 378 INIT_REGMAP_IRQ(AXP288, BC_USB_CHNG, 5, 1),
377}; 379};
378 380
379static const struct of_device_id axp20x_of_match[] = {
380 { .compatible = "x-powers,axp152", .data = (void *) AXP152_ID },
381 { .compatible = "x-powers,axp202", .data = (void *) AXP202_ID },
382 { .compatible = "x-powers,axp209", .data = (void *) AXP209_ID },
383 { .compatible = "x-powers,axp221", .data = (void *) AXP221_ID },
384 { },
385};
386MODULE_DEVICE_TABLE(of, axp20x_of_match);
387
388/*
389 * This is useless for OF-enabled devices, but it is needed by I2C subsystem
390 */
391static const struct i2c_device_id axp20x_i2c_id[] = {
392 { },
393};
394MODULE_DEVICE_TABLE(i2c, axp20x_i2c_id);
395
396static const struct acpi_device_id axp20x_acpi_match[] = {
397 {
398 .id = "INT33F4",
399 .driver_data = AXP288_ID,
400 },
401 { },
402};
403MODULE_DEVICE_TABLE(acpi, axp20x_acpi_match);
404
405static const struct regmap_irq_chip axp152_regmap_irq_chip = { 381static const struct regmap_irq_chip axp152_regmap_irq_chip = {
406 .name = "axp152_irq_chip", 382 .name = "axp152_irq_chip",
407 .status_base = AXP152_IRQ1_STATE, 383 .status_base = AXP152_IRQ1_STATE,
@@ -606,25 +582,26 @@ static void axp20x_power_off(void)
606 AXP20X_OFF); 582 AXP20X_OFF);
607} 583}
608 584
609static int axp20x_match_device(struct axp20x_dev *axp20x, struct device *dev) 585int axp20x_match_device(struct axp20x_dev *axp20x)
610{ 586{
587 struct device *dev = axp20x->dev;
611 const struct acpi_device_id *acpi_id; 588 const struct acpi_device_id *acpi_id;
612 const struct of_device_id *of_id; 589 const struct of_device_id *of_id;
613 590
614 if (dev->of_node) { 591 if (dev->of_node) {
615 of_id = of_match_device(axp20x_of_match, dev); 592 of_id = of_match_device(dev->driver->of_match_table, dev);
616 if (!of_id) { 593 if (!of_id) {
617 dev_err(dev, "Unable to match OF ID\n"); 594 dev_err(dev, "Unable to match OF ID\n");
618 return -ENODEV; 595 return -ENODEV;
619 } 596 }
620 axp20x->variant = (long) of_id->data; 597 axp20x->variant = (long)of_id->data;
621 } else { 598 } else {
622 acpi_id = acpi_match_device(dev->driver->acpi_match_table, dev); 599 acpi_id = acpi_match_device(dev->driver->acpi_match_table, dev);
623 if (!acpi_id || !acpi_id->driver_data) { 600 if (!acpi_id || !acpi_id->driver_data) {
624 dev_err(dev, "Unable to match ACPI ID and data\n"); 601 dev_err(dev, "Unable to match ACPI ID and data\n");
625 return -ENODEV; 602 return -ENODEV;
626 } 603 }
627 axp20x->variant = (long) acpi_id->driver_data; 604 axp20x->variant = (long)acpi_id->driver_data;
628 } 605 }
629 606
630 switch (axp20x->variant) { 607 switch (axp20x->variant) {
@@ -642,6 +619,7 @@ static int axp20x_match_device(struct axp20x_dev *axp20x, struct device *dev)
642 axp20x->regmap_irq_chip = &axp20x_regmap_irq_chip; 619 axp20x->regmap_irq_chip = &axp20x_regmap_irq_chip;
643 break; 620 break;
644 case AXP221_ID: 621 case AXP221_ID:
622 case AXP223_ID:
645 axp20x->nr_cells = ARRAY_SIZE(axp22x_cells); 623 axp20x->nr_cells = ARRAY_SIZE(axp22x_cells);
646 axp20x->cells = axp22x_cells; 624 axp20x->cells = axp22x_cells;
647 axp20x->regmap_cfg = &axp22x_regmap_config; 625 axp20x->regmap_cfg = &axp22x_regmap_config;
@@ -658,51 +636,31 @@ static int axp20x_match_device(struct axp20x_dev *axp20x, struct device *dev)
658 return -EINVAL; 636 return -EINVAL;
659 } 637 }
660 dev_info(dev, "AXP20x variant %s found\n", 638 dev_info(dev, "AXP20x variant %s found\n",
661 axp20x_model_names[axp20x->variant]); 639 axp20x_model_names[axp20x->variant]);
662 640
663 return 0; 641 return 0;
664} 642}
643EXPORT_SYMBOL(axp20x_match_device);
665 644
666static int axp20x_i2c_probe(struct i2c_client *i2c, 645int axp20x_device_probe(struct axp20x_dev *axp20x)
667 const struct i2c_device_id *id)
668{ 646{
669 struct axp20x_dev *axp20x;
670 int ret; 647 int ret;
671 648
672 axp20x = devm_kzalloc(&i2c->dev, sizeof(*axp20x), GFP_KERNEL); 649 ret = regmap_add_irq_chip(axp20x->regmap, axp20x->irq,
673 if (!axp20x)
674 return -ENOMEM;
675
676 ret = axp20x_match_device(axp20x, &i2c->dev);
677 if (ret)
678 return ret;
679
680 axp20x->i2c_client = i2c;
681 axp20x->dev = &i2c->dev;
682 dev_set_drvdata(axp20x->dev, axp20x);
683
684 axp20x->regmap = devm_regmap_init_i2c(i2c, axp20x->regmap_cfg);
685 if (IS_ERR(axp20x->regmap)) {
686 ret = PTR_ERR(axp20x->regmap);
687 dev_err(&i2c->dev, "regmap init failed: %d\n", ret);
688 return ret;
689 }
690
691 ret = regmap_add_irq_chip(axp20x->regmap, i2c->irq,
692 IRQF_ONESHOT | IRQF_SHARED, -1, 650 IRQF_ONESHOT | IRQF_SHARED, -1,
693 axp20x->regmap_irq_chip, 651 axp20x->regmap_irq_chip,
694 &axp20x->regmap_irqc); 652 &axp20x->regmap_irqc);
695 if (ret) { 653 if (ret) {
696 dev_err(&i2c->dev, "failed to add irq chip: %d\n", ret); 654 dev_err(axp20x->dev, "failed to add irq chip: %d\n", ret);
697 return ret; 655 return ret;
698 } 656 }
699 657
700 ret = mfd_add_devices(axp20x->dev, -1, axp20x->cells, 658 ret = mfd_add_devices(axp20x->dev, -1, axp20x->cells,
701 axp20x->nr_cells, NULL, 0, NULL); 659 axp20x->nr_cells, NULL, 0, NULL);
702 660
703 if (ret) { 661 if (ret) {
704 dev_err(&i2c->dev, "failed to add MFD devices: %d\n", ret); 662 dev_err(axp20x->dev, "failed to add MFD devices: %d\n", ret);
705 regmap_del_irq_chip(i2c->irq, axp20x->regmap_irqc); 663 regmap_del_irq_chip(axp20x->irq, axp20x->regmap_irqc);
706 return ret; 664 return ret;
707 } 665 }
708 666
@@ -711,38 +669,25 @@ static int axp20x_i2c_probe(struct i2c_client *i2c,
711 pm_power_off = axp20x_power_off; 669 pm_power_off = axp20x_power_off;
712 } 670 }
713 671
714 dev_info(&i2c->dev, "AXP20X driver loaded\n"); 672 dev_info(axp20x->dev, "AXP20X driver loaded\n");
715 673
716 return 0; 674 return 0;
717} 675}
676EXPORT_SYMBOL(axp20x_device_probe);
718 677
719static int axp20x_i2c_remove(struct i2c_client *i2c) 678int axp20x_device_remove(struct axp20x_dev *axp20x)
720{ 679{
721 struct axp20x_dev *axp20x = i2c_get_clientdata(i2c);
722
723 if (axp20x == axp20x_pm_power_off) { 680 if (axp20x == axp20x_pm_power_off) {
724 axp20x_pm_power_off = NULL; 681 axp20x_pm_power_off = NULL;
725 pm_power_off = NULL; 682 pm_power_off = NULL;
726 } 683 }
727 684
728 mfd_remove_devices(axp20x->dev); 685 mfd_remove_devices(axp20x->dev);
729 regmap_del_irq_chip(axp20x->i2c_client->irq, axp20x->regmap_irqc); 686 regmap_del_irq_chip(axp20x->irq, axp20x->regmap_irqc);
730 687
731 return 0; 688 return 0;
732} 689}
733 690EXPORT_SYMBOL(axp20x_device_remove);
734static struct i2c_driver axp20x_i2c_driver = {
735 .driver = {
736 .name = "axp20x",
737 .of_match_table = of_match_ptr(axp20x_of_match),
738 .acpi_match_table = ACPI_PTR(axp20x_acpi_match),
739 },
740 .probe = axp20x_i2c_probe,
741 .remove = axp20x_i2c_remove,
742 .id_table = axp20x_i2c_id,
743};
744
745module_i2c_driver(axp20x_i2c_driver);
746 691
747MODULE_DESCRIPTION("PMIC MFD core driver for AXP20X"); 692MODULE_DESCRIPTION("PMIC MFD core driver for AXP20X");
748MODULE_AUTHOR("Carlo Caione <carlo@caione.org>"); 693MODULE_AUTHOR("Carlo Caione <carlo@caione.org>");
diff --git a/drivers/mfd/cs47l24-tables.c b/drivers/mfd/cs47l24-tables.c
index 870800657594..f6b78aafdb55 100644
--- a/drivers/mfd/cs47l24-tables.c
+++ b/drivers/mfd/cs47l24-tables.c
@@ -227,8 +227,6 @@ static const struct reg_default cs47l24_reg_default[] = {
227 { 0x00000174, 0x007D }, /* R372 - FLL1 Control 4 */ 227 { 0x00000174, 0x007D }, /* R372 - FLL1 Control 4 */
228 { 0x00000175, 0x0006 }, /* R373 - FLL1 Control 5 */ 228 { 0x00000175, 0x0006 }, /* R373 - FLL1 Control 5 */
229 { 0x00000176, 0x0000 }, /* R374 - FLL1 Control 6 */ 229 { 0x00000176, 0x0000 }, /* R374 - FLL1 Control 6 */
230 { 0x00000177, 0x0281 }, /* R375 - FLL1 Loop Filter Test 1 */
231 { 0x00000178, 0x0000 }, /* R376 - FLL1 NCO Test 0 */
232 { 0x00000179, 0x0000 }, /* R376 - FLL1 Control 7 */ 230 { 0x00000179, 0x0000 }, /* R376 - FLL1 Control 7 */
233 { 0x00000181, 0x0000 }, /* R385 - FLL1 Synchroniser 1 */ 231 { 0x00000181, 0x0000 }, /* R385 - FLL1 Synchroniser 1 */
234 { 0x00000182, 0x0000 }, /* R386 - FLL1 Synchroniser 2 */ 232 { 0x00000182, 0x0000 }, /* R386 - FLL1 Synchroniser 2 */
@@ -245,8 +243,6 @@ static const struct reg_default cs47l24_reg_default[] = {
245 { 0x00000194, 0x007D }, /* R404 - FLL2 Control 4 */ 243 { 0x00000194, 0x007D }, /* R404 - FLL2 Control 4 */
246 { 0x00000195, 0x000C }, /* R405 - FLL2 Control 5 */ 244 { 0x00000195, 0x000C }, /* R405 - FLL2 Control 5 */
247 { 0x00000196, 0x0000 }, /* R406 - FLL2 Control 6 */ 245 { 0x00000196, 0x0000 }, /* R406 - FLL2 Control 6 */
248 { 0x00000197, 0x0000 }, /* R407 - FLL2 Loop Filter Test 1 */
249 { 0x00000198, 0x0000 }, /* R408 - FLL2 NCO Test 0 */
250 { 0x00000199, 0x0000 }, /* R408 - FLL2 Control 7 */ 246 { 0x00000199, 0x0000 }, /* R408 - FLL2 Control 7 */
251 { 0x000001A1, 0x0000 }, /* R417 - FLL2 Synchroniser 1 */ 247 { 0x000001A1, 0x0000 }, /* R417 - FLL2 Synchroniser 1 */
252 { 0x000001A2, 0x0000 }, /* R418 - FLL2 Synchroniser 2 */ 248 { 0x000001A2, 0x0000 }, /* R418 - FLL2 Synchroniser 2 */
@@ -678,7 +674,7 @@ static const struct reg_default cs47l24_reg_default[] = {
678 { 0x00000C0F, 0x0400 }, /* R3087 - IRQ CTRL 1 */ 674 { 0x00000C0F, 0x0400 }, /* R3087 - IRQ CTRL 1 */
679 { 0x00000C10, 0x1000 }, /* R3088 - GPIO Debounce Config */ 675 { 0x00000C10, 0x1000 }, /* R3088 - GPIO Debounce Config */
680 { 0x00000C20, 0x0002 }, /* R3104 - Misc Pad Ctrl 1 */ 676 { 0x00000C20, 0x0002 }, /* R3104 - Misc Pad Ctrl 1 */
681 { 0x00000C21, 0x8001 }, /* R3105 - Misc Pad Ctrl 2 */ 677 { 0x00000C21, 0x0000 }, /* R3105 - Misc Pad Ctrl 2 */
682 { 0x00000C22, 0x0000 }, /* R3106 - Misc Pad Ctrl 3 */ 678 { 0x00000C22, 0x0000 }, /* R3106 - Misc Pad Ctrl 3 */
683 { 0x00000C23, 0x0000 }, /* R3107 - Misc Pad Ctrl 4 */ 679 { 0x00000C23, 0x0000 }, /* R3107 - Misc Pad Ctrl 4 */
684 { 0x00000C24, 0x0000 }, /* R3108 - Misc Pad Ctrl 5 */ 680 { 0x00000C24, 0x0000 }, /* R3108 - Misc Pad Ctrl 5 */
@@ -858,8 +854,6 @@ static bool cs47l24_readable_register(struct device *dev, unsigned int reg)
858 case ARIZONA_FLL1_CONTROL_5: 854 case ARIZONA_FLL1_CONTROL_5:
859 case ARIZONA_FLL1_CONTROL_6: 855 case ARIZONA_FLL1_CONTROL_6:
860 case ARIZONA_FLL1_CONTROL_7: 856 case ARIZONA_FLL1_CONTROL_7:
861 case ARIZONA_FLL1_LOOP_FILTER_TEST_1:
862 case ARIZONA_FLL1_NCO_TEST_0:
863 case ARIZONA_FLL1_SYNCHRONISER_1: 857 case ARIZONA_FLL1_SYNCHRONISER_1:
864 case ARIZONA_FLL1_SYNCHRONISER_2: 858 case ARIZONA_FLL1_SYNCHRONISER_2:
865 case ARIZONA_FLL1_SYNCHRONISER_3: 859 case ARIZONA_FLL1_SYNCHRONISER_3:
@@ -876,8 +870,6 @@ static bool cs47l24_readable_register(struct device *dev, unsigned int reg)
876 case ARIZONA_FLL2_CONTROL_5: 870 case ARIZONA_FLL2_CONTROL_5:
877 case ARIZONA_FLL2_CONTROL_6: 871 case ARIZONA_FLL2_CONTROL_6:
878 case ARIZONA_FLL2_CONTROL_7: 872 case ARIZONA_FLL2_CONTROL_7:
879 case ARIZONA_FLL2_LOOP_FILTER_TEST_1:
880 case ARIZONA_FLL2_NCO_TEST_0:
881 case ARIZONA_FLL2_SYNCHRONISER_1: 873 case ARIZONA_FLL2_SYNCHRONISER_1:
882 case ARIZONA_FLL2_SYNCHRONISER_2: 874 case ARIZONA_FLL2_SYNCHRONISER_2:
883 case ARIZONA_FLL2_SYNCHRONISER_3: 875 case ARIZONA_FLL2_SYNCHRONISER_3:
diff --git a/drivers/mfd/da9062-core.c b/drivers/mfd/da9062-core.c
index a9ad024ec6b0..8f873866ea60 100644
--- a/drivers/mfd/da9062-core.c
+++ b/drivers/mfd/da9062-core.c
@@ -388,11 +388,32 @@ static const struct regmap_range da9062_aa_volatile_ranges[] = {
388 .range_min = DA9062AA_STATUS_D, 388 .range_min = DA9062AA_STATUS_D,
389 .range_max = DA9062AA_EVENT_C, 389 .range_max = DA9062AA_EVENT_C,
390 }, { 390 }, {
391 .range_min = DA9062AA_CONTROL_F, 391 .range_min = DA9062AA_CONTROL_A,
392 .range_max = DA9062AA_CONTROL_B,
393 }, {
394 .range_min = DA9062AA_CONTROL_E,
392 .range_max = DA9062AA_CONTROL_F, 395 .range_max = DA9062AA_CONTROL_F,
393 }, { 396 }, {
397 .range_min = DA9062AA_BUCK2_CONT,
398 .range_max = DA9062AA_BUCK4_CONT,
399 }, {
400 .range_min = DA9062AA_BUCK3_CONT,
401 .range_max = DA9062AA_BUCK3_CONT,
402 }, {
403 .range_min = DA9062AA_LDO1_CONT,
404 .range_max = DA9062AA_LDO4_CONT,
405 }, {
406 .range_min = DA9062AA_DVC_1,
407 .range_max = DA9062AA_DVC_1,
408 }, {
394 .range_min = DA9062AA_COUNT_S, 409 .range_min = DA9062AA_COUNT_S,
395 .range_max = DA9062AA_SECOND_D, 410 .range_max = DA9062AA_SECOND_D,
411 }, {
412 .range_min = DA9062AA_SEQ,
413 .range_max = DA9062AA_SEQ,
414 }, {
415 .range_min = DA9062AA_EN_32K,
416 .range_max = DA9062AA_EN_32K,
396 }, 417 },
397}; 418};
398 419
diff --git a/drivers/mfd/da9063-i2c.c b/drivers/mfd/da9063-i2c.c
index 2d4e3e0f4e94..73901084945f 100644
--- a/drivers/mfd/da9063-i2c.c
+++ b/drivers/mfd/da9063-i2c.c
@@ -74,18 +74,30 @@ static const struct regmap_range da9063_ad_writeable_ranges[] = {
74 74
75static const struct regmap_range da9063_ad_volatile_ranges[] = { 75static const struct regmap_range da9063_ad_volatile_ranges[] = {
76 { 76 {
77 .range_min = DA9063_REG_STATUS_A, 77 .range_min = DA9063_REG_PAGE_CON,
78 .range_max = DA9063_REG_EVENT_D, 78 .range_max = DA9063_REG_EVENT_D,
79 }, { 79 }, {
80 .range_min = DA9063_REG_CONTROL_F, 80 .range_min = DA9063_REG_CONTROL_A,
81 .range_max = DA9063_REG_CONTROL_B,
82 }, {
83 .range_min = DA9063_REG_CONTROL_E,
81 .range_max = DA9063_REG_CONTROL_F, 84 .range_max = DA9063_REG_CONTROL_F,
82 }, { 85 }, {
83 .range_min = DA9063_REG_ADC_MAN, 86 .range_min = DA9063_REG_BCORE2_CONT,
87 .range_max = DA9063_REG_LDO11_CONT,
88 }, {
89 .range_min = DA9063_REG_DVC_1,
84 .range_max = DA9063_REG_ADC_MAN, 90 .range_max = DA9063_REG_ADC_MAN,
85 }, { 91 }, {
86 .range_min = DA9063_REG_ADC_RES_L, 92 .range_min = DA9063_REG_ADC_RES_L,
87 .range_max = DA9063_AD_REG_SECOND_D, 93 .range_max = DA9063_AD_REG_SECOND_D,
88 }, { 94 }, {
95 .range_min = DA9063_REG_SEQ,
96 .range_max = DA9063_REG_SEQ,
97 }, {
98 .range_min = DA9063_REG_EN_32K,
99 .range_max = DA9063_REG_EN_32K,
100 }, {
89 .range_min = DA9063_AD_REG_MON_REG_5, 101 .range_min = DA9063_AD_REG_MON_REG_5,
90 .range_max = DA9063_AD_REG_MON_REG_6, 102 .range_max = DA9063_AD_REG_MON_REG_6,
91 }, 103 },
@@ -152,18 +164,30 @@ static const struct regmap_range da9063_bb_writeable_ranges[] = {
152 164
153static const struct regmap_range da9063_bb_volatile_ranges[] = { 165static const struct regmap_range da9063_bb_volatile_ranges[] = {
154 { 166 {
155 .range_min = DA9063_REG_STATUS_A, 167 .range_min = DA9063_REG_PAGE_CON,
156 .range_max = DA9063_REG_EVENT_D, 168 .range_max = DA9063_REG_EVENT_D,
157 }, { 169 }, {
158 .range_min = DA9063_REG_CONTROL_F, 170 .range_min = DA9063_REG_CONTROL_A,
171 .range_max = DA9063_REG_CONTROL_B,
172 }, {
173 .range_min = DA9063_REG_CONTROL_E,
159 .range_max = DA9063_REG_CONTROL_F, 174 .range_max = DA9063_REG_CONTROL_F,
160 }, { 175 }, {
161 .range_min = DA9063_REG_ADC_MAN, 176 .range_min = DA9063_REG_BCORE2_CONT,
177 .range_max = DA9063_REG_LDO11_CONT,
178 }, {
179 .range_min = DA9063_REG_DVC_1,
162 .range_max = DA9063_REG_ADC_MAN, 180 .range_max = DA9063_REG_ADC_MAN,
163 }, { 181 }, {
164 .range_min = DA9063_REG_ADC_RES_L, 182 .range_min = DA9063_REG_ADC_RES_L,
165 .range_max = DA9063_BB_REG_SECOND_D, 183 .range_max = DA9063_BB_REG_SECOND_D,
166 }, { 184 }, {
185 .range_min = DA9063_REG_SEQ,
186 .range_max = DA9063_REG_SEQ,
187 }, {
188 .range_min = DA9063_REG_EN_32K,
189 .range_max = DA9063_REG_EN_32K,
190 }, {
167 .range_min = DA9063_BB_REG_MON_REG_5, 191 .range_min = DA9063_BB_REG_MON_REG_5,
168 .range_max = DA9063_BB_REG_MON_REG_6, 192 .range_max = DA9063_BB_REG_MON_REG_6,
169 }, 193 },
diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
index 12099b09a9a7..c0a86aeb1733 100644
--- a/drivers/mfd/db8500-prcmu.c
+++ b/drivers/mfd/db8500-prcmu.c
@@ -739,20 +739,17 @@ int prcmu_config_clkout(u8 clkout, u8 source, u8 div)
739 if (!div && !requests[clkout]) 739 if (!div && !requests[clkout])
740 return -EINVAL; 740 return -EINVAL;
741 741
742 switch (clkout) { 742 if (clkout == 0) {
743 case 0:
744 div_mask = PRCM_CLKOCR_CLKODIV0_MASK; 743 div_mask = PRCM_CLKOCR_CLKODIV0_MASK;
745 mask = (PRCM_CLKOCR_CLKODIV0_MASK | PRCM_CLKOCR_CLKOSEL0_MASK); 744 mask = (PRCM_CLKOCR_CLKODIV0_MASK | PRCM_CLKOCR_CLKOSEL0_MASK);
746 bits = ((source << PRCM_CLKOCR_CLKOSEL0_SHIFT) | 745 bits = ((source << PRCM_CLKOCR_CLKOSEL0_SHIFT) |
747 (div << PRCM_CLKOCR_CLKODIV0_SHIFT)); 746 (div << PRCM_CLKOCR_CLKODIV0_SHIFT));
748 break; 747 } else {
749 case 1:
750 div_mask = PRCM_CLKOCR_CLKODIV1_MASK; 748 div_mask = PRCM_CLKOCR_CLKODIV1_MASK;
751 mask = (PRCM_CLKOCR_CLKODIV1_MASK | PRCM_CLKOCR_CLKOSEL1_MASK | 749 mask = (PRCM_CLKOCR_CLKODIV1_MASK | PRCM_CLKOCR_CLKOSEL1_MASK |
752 PRCM_CLKOCR_CLK1TYPE); 750 PRCM_CLKOCR_CLK1TYPE);
753 bits = ((source << PRCM_CLKOCR_CLKOSEL1_SHIFT) | 751 bits = ((source << PRCM_CLKOCR_CLKOSEL1_SHIFT) |
754 (div << PRCM_CLKOCR_CLKODIV1_SHIFT)); 752 (div << PRCM_CLKOCR_CLKODIV1_SHIFT));
755 break;
756 } 753 }
757 bits &= mask; 754 bits &= mask;
758 755
diff --git a/drivers/mfd/fsl-imx25-tsadc.c b/drivers/mfd/fsl-imx25-tsadc.c
new file mode 100644
index 000000000000..77b2675cf8f5
--- /dev/null
+++ b/drivers/mfd/fsl-imx25-tsadc.c
@@ -0,0 +1,203 @@
1/*
2 * Copyright (C) 2014-2015 Pengutronix, Markus Pargmann <mpa@pengutronix.de>
3 *
4 * This program is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License version 2 as published by the
6 * Free Software Foundation.
7 */
8
9#include <linux/clk.h>
10#include <linux/interrupt.h>
11#include <linux/irqchip/chained_irq.h>
12#include <linux/irqdesc.h>
13#include <linux/irqdomain.h>
14#include <linux/irq.h>
15#include <linux/mfd/imx25-tsadc.h>
16#include <linux/module.h>
17#include <linux/of.h>
18#include <linux/of_platform.h>
19#include <linux/platform_device.h>
20#include <linux/regmap.h>
21
22static struct regmap_config mx25_tsadc_regmap_config = {
23 .fast_io = true,
24 .max_register = 8,
25 .reg_bits = 32,
26 .val_bits = 32,
27 .reg_stride = 4,
28};
29
30static void mx25_tsadc_irq_handler(struct irq_desc *desc)
31{
32 struct mx25_tsadc *tsadc = irq_desc_get_handler_data(desc);
33 struct irq_chip *chip = irq_desc_get_chip(desc);
34 u32 status;
35
36 chained_irq_enter(chip, desc);
37
38 regmap_read(tsadc->regs, MX25_TSC_TGSR, &status);
39
40 if (status & MX25_TGSR_GCQ_INT)
41 generic_handle_irq(irq_find_mapping(tsadc->domain, 1));
42
43 if (status & MX25_TGSR_TCQ_INT)
44 generic_handle_irq(irq_find_mapping(tsadc->domain, 0));
45
46 chained_irq_exit(chip, desc);
47}
48
49static int mx25_tsadc_domain_map(struct irq_domain *d, unsigned int irq,
50 irq_hw_number_t hwirq)
51{
52 struct mx25_tsadc *tsadc = d->host_data;
53
54 irq_set_chip_data(irq, tsadc);
55 irq_set_chip_and_handler(irq, &dummy_irq_chip,
56 handle_level_irq);
57 irq_modify_status(irq, IRQ_NOREQUEST, IRQ_NOPROBE);
58
59 return 0;
60}
61
62static struct irq_domain_ops mx25_tsadc_domain_ops = {
63 .map = mx25_tsadc_domain_map,
64 .xlate = irq_domain_xlate_onecell,
65};
66
67static int mx25_tsadc_setup_irq(struct platform_device *pdev,
68 struct mx25_tsadc *tsadc)
69{
70 struct device *dev = &pdev->dev;
71 struct device_node *np = dev->of_node;
72 int irq;
73
74 irq = platform_get_irq(pdev, 0);
75 if (irq <= 0) {
76 dev_err(dev, "Failed to get irq\n");
77 return irq;
78 }
79
80 tsadc->domain = irq_domain_add_simple(np, 2, 0, &mx25_tsadc_domain_ops,
81 tsadc);
82 if (!tsadc->domain) {
83 dev_err(dev, "Failed to add irq domain\n");
84 return -ENOMEM;
85 }
86
87 irq_set_chained_handler(irq, mx25_tsadc_irq_handler);
88 irq_set_handler_data(irq, tsadc);
89
90 return 0;
91}
92
93static void mx25_tsadc_setup_clk(struct platform_device *pdev,
94 struct mx25_tsadc *tsadc)
95{
96 unsigned clk_div;
97
98 /*
99 * According to the datasheet the ADC clock should never
100 * exceed 1,75 MHz. Base clock is the IPG and the ADC unit uses
101 * a funny clock divider. To keep the ADC conversion time constant
102 * adapt the ADC internal clock divider to the IPG clock rate.
103 */
104
105 dev_dbg(&pdev->dev, "Found master clock at %lu Hz\n",
106 clk_get_rate(tsadc->clk));
107
108 clk_div = DIV_ROUND_UP(clk_get_rate(tsadc->clk), 1750000);
109 dev_dbg(&pdev->dev, "Setting up ADC clock divider to %u\n", clk_div);
110
111 /* adc clock = IPG clock / (2 * div + 2) */
112 clk_div -= 2;
113 clk_div /= 2;
114
115 /*
116 * the ADC clock divider changes its behaviour when values below 4
117 * are used: it is fixed to "/ 10" in this case
118 */
119 clk_div = max_t(unsigned, 4, clk_div);
120
121 dev_dbg(&pdev->dev, "Resulting ADC conversion clock at %lu Hz\n",
122 clk_get_rate(tsadc->clk) / (2 * clk_div + 2));
123
124 regmap_update_bits(tsadc->regs, MX25_TSC_TGCR,
125 MX25_TGCR_ADCCLKCFG(0x1f),
126 MX25_TGCR_ADCCLKCFG(clk_div));
127}
128
129static int mx25_tsadc_probe(struct platform_device *pdev)
130{
131 struct device *dev = &pdev->dev;
132 struct device_node *np = dev->of_node;
133 struct mx25_tsadc *tsadc;
134 struct resource *res;
135 int ret;
136 void __iomem *iomem;
137
138 tsadc = devm_kzalloc(dev, sizeof(*tsadc), GFP_KERNEL);
139 if (!tsadc)
140 return -ENOMEM;
141
142 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
143 iomem = devm_ioremap_resource(dev, res);
144 if (IS_ERR(iomem))
145 return PTR_ERR(iomem);
146
147 tsadc->regs = devm_regmap_init_mmio(dev, iomem,
148 &mx25_tsadc_regmap_config);
149 if (IS_ERR(tsadc->regs)) {
150 dev_err(dev, "Failed to initialize regmap\n");
151 return PTR_ERR(tsadc->regs);
152 }
153
154 tsadc->clk = devm_clk_get(dev, "ipg");
155 if (IS_ERR(tsadc->clk)) {
156 dev_err(dev, "Failed to get ipg clock\n");
157 return PTR_ERR(tsadc->clk);
158 }
159
160 /* setup clock according to the datasheet */
161 mx25_tsadc_setup_clk(pdev, tsadc);
162
163 /* Enable clock and reset the component */
164 regmap_update_bits(tsadc->regs, MX25_TSC_TGCR, MX25_TGCR_CLK_EN,
165 MX25_TGCR_CLK_EN);
166 regmap_update_bits(tsadc->regs, MX25_TSC_TGCR, MX25_TGCR_TSC_RST,
167 MX25_TGCR_TSC_RST);
168
169 /* Setup powersaving mode, but enable internal reference voltage */
170 regmap_update_bits(tsadc->regs, MX25_TSC_TGCR, MX25_TGCR_POWERMODE_MASK,
171 MX25_TGCR_POWERMODE_SAVE);
172 regmap_update_bits(tsadc->regs, MX25_TSC_TGCR, MX25_TGCR_INTREFEN,
173 MX25_TGCR_INTREFEN);
174
175 ret = mx25_tsadc_setup_irq(pdev, tsadc);
176 if (ret)
177 return ret;
178
179 platform_set_drvdata(pdev, tsadc);
180
181 of_platform_populate(np, NULL, NULL, dev);
182
183 return 0;
184}
185
186static const struct of_device_id mx25_tsadc_ids[] = {
187 { .compatible = "fsl,imx25-tsadc" },
188 { /* Sentinel */ }
189};
190
191static struct platform_driver mx25_tsadc_driver = {
192 .driver = {
193 .name = "mx25-tsadc",
194 .of_match_table = of_match_ptr(mx25_tsadc_ids),
195 },
196 .probe = mx25_tsadc_probe,
197};
198module_platform_driver(mx25_tsadc_driver);
199
200MODULE_DESCRIPTION("MFD for ADC/TSC for Freescale mx25");
201MODULE_AUTHOR("Markus Pargmann <mpa@pengutronix.de>");
202MODULE_LICENSE("GPL v2");
203MODULE_ALIAS("platform:mx25-tsadc");
diff --git a/drivers/mfd/intel-lpss-acpi.c b/drivers/mfd/intel-lpss-acpi.c
index 06f00d60be46..5a8d9c766633 100644
--- a/drivers/mfd/intel-lpss-acpi.c
+++ b/drivers/mfd/intel-lpss-acpi.c
@@ -44,8 +44,20 @@ static const struct intel_lpss_platform_info bxt_info = {
44 .clk_rate = 100000000, 44 .clk_rate = 100000000,
45}; 45};
46 46
47static struct property_entry bxt_i2c_properties[] = {
48 PROPERTY_ENTRY_U32("i2c-sda-hold-time-ns", 42),
49 PROPERTY_ENTRY_U32("i2c-sda-falling-time-ns", 171),
50 PROPERTY_ENTRY_U32("i2c-scl-falling-time-ns", 208),
51 { },
52};
53
54static struct property_set bxt_i2c_pset = {
55 .properties = bxt_i2c_properties,
56};
57
47static const struct intel_lpss_platform_info bxt_i2c_info = { 58static const struct intel_lpss_platform_info bxt_i2c_info = {
48 .clk_rate = 133000000, 59 .clk_rate = 133000000,
60 .pset = &bxt_i2c_pset,
49}; 61};
50 62
51static const struct acpi_device_id intel_lpss_acpi_ids[] = { 63static const struct acpi_device_id intel_lpss_acpi_ids[] = {
diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c
index a7136c7ae9fb..a19e57118641 100644
--- a/drivers/mfd/intel-lpss-pci.c
+++ b/drivers/mfd/intel-lpss-pci.c
@@ -107,12 +107,24 @@ static const struct intel_lpss_platform_info bxt_uart_info = {
107 .pset = &uart_pset, 107 .pset = &uart_pset,
108}; 108};
109 109
110static struct property_entry bxt_i2c_properties[] = {
111 PROPERTY_ENTRY_U32("i2c-sda-hold-time-ns", 42),
112 PROPERTY_ENTRY_U32("i2c-sda-falling-time-ns", 171),
113 PROPERTY_ENTRY_U32("i2c-scl-falling-time-ns", 208),
114 { },
115};
116
117static struct property_set bxt_i2c_pset = {
118 .properties = bxt_i2c_properties,
119};
120
110static const struct intel_lpss_platform_info bxt_i2c_info = { 121static const struct intel_lpss_platform_info bxt_i2c_info = {
111 .clk_rate = 133000000, 122 .clk_rate = 133000000,
123 .pset = &bxt_i2c_pset,
112}; 124};
113 125
114static const struct pci_device_id intel_lpss_pci_ids[] = { 126static const struct pci_device_id intel_lpss_pci_ids[] = {
115 /* BXT */ 127 /* BXT A-Step */
116 { PCI_VDEVICE(INTEL, 0x0aac), (kernel_ulong_t)&bxt_i2c_info }, 128 { PCI_VDEVICE(INTEL, 0x0aac), (kernel_ulong_t)&bxt_i2c_info },
117 { PCI_VDEVICE(INTEL, 0x0aae), (kernel_ulong_t)&bxt_i2c_info }, 129 { PCI_VDEVICE(INTEL, 0x0aae), (kernel_ulong_t)&bxt_i2c_info },
118 { PCI_VDEVICE(INTEL, 0x0ab0), (kernel_ulong_t)&bxt_i2c_info }, 130 { PCI_VDEVICE(INTEL, 0x0ab0), (kernel_ulong_t)&bxt_i2c_info },
@@ -128,6 +140,23 @@ static const struct pci_device_id intel_lpss_pci_ids[] = {
128 { PCI_VDEVICE(INTEL, 0x0ac4), (kernel_ulong_t)&bxt_info }, 140 { PCI_VDEVICE(INTEL, 0x0ac4), (kernel_ulong_t)&bxt_info },
129 { PCI_VDEVICE(INTEL, 0x0ac6), (kernel_ulong_t)&bxt_info }, 141 { PCI_VDEVICE(INTEL, 0x0ac6), (kernel_ulong_t)&bxt_info },
130 { PCI_VDEVICE(INTEL, 0x0aee), (kernel_ulong_t)&bxt_uart_info }, 142 { PCI_VDEVICE(INTEL, 0x0aee), (kernel_ulong_t)&bxt_uart_info },
143 /* BXT B-Step */
144 { PCI_VDEVICE(INTEL, 0x1aac), (kernel_ulong_t)&bxt_i2c_info },
145 { PCI_VDEVICE(INTEL, 0x1aae), (kernel_ulong_t)&bxt_i2c_info },
146 { PCI_VDEVICE(INTEL, 0x1ab0), (kernel_ulong_t)&bxt_i2c_info },
147 { PCI_VDEVICE(INTEL, 0x1ab2), (kernel_ulong_t)&bxt_i2c_info },
148 { PCI_VDEVICE(INTEL, 0x1ab4), (kernel_ulong_t)&bxt_i2c_info },
149 { PCI_VDEVICE(INTEL, 0x1ab6), (kernel_ulong_t)&bxt_i2c_info },
150 { PCI_VDEVICE(INTEL, 0x1ab8), (kernel_ulong_t)&bxt_i2c_info },
151 { PCI_VDEVICE(INTEL, 0x1aba), (kernel_ulong_t)&bxt_i2c_info },
152 { PCI_VDEVICE(INTEL, 0x1abc), (kernel_ulong_t)&bxt_uart_info },
153 { PCI_VDEVICE(INTEL, 0x1abe), (kernel_ulong_t)&bxt_uart_info },
154 { PCI_VDEVICE(INTEL, 0x1ac0), (kernel_ulong_t)&bxt_uart_info },
155 { PCI_VDEVICE(INTEL, 0x1ac2), (kernel_ulong_t)&bxt_info },
156 { PCI_VDEVICE(INTEL, 0x1ac4), (kernel_ulong_t)&bxt_info },
157 { PCI_VDEVICE(INTEL, 0x1ac6), (kernel_ulong_t)&bxt_info },
158 { PCI_VDEVICE(INTEL, 0x1aee), (kernel_ulong_t)&bxt_uart_info },
159
131 /* APL */ 160 /* APL */
132 { PCI_VDEVICE(INTEL, 0x5aac), (kernel_ulong_t)&bxt_i2c_info }, 161 { PCI_VDEVICE(INTEL, 0x5aac), (kernel_ulong_t)&bxt_i2c_info },
133 { PCI_VDEVICE(INTEL, 0x5aae), (kernel_ulong_t)&bxt_i2c_info }, 162 { PCI_VDEVICE(INTEL, 0x5aae), (kernel_ulong_t)&bxt_i2c_info },
diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c
index 1743788f1595..1bbbe877ba7e 100644
--- a/drivers/mfd/intel-lpss.c
+++ b/drivers/mfd/intel-lpss.c
@@ -453,6 +453,7 @@ int intel_lpss_probe(struct device *dev,
453err_remove_ltr: 453err_remove_ltr:
454 intel_lpss_debugfs_remove(lpss); 454 intel_lpss_debugfs_remove(lpss);
455 intel_lpss_ltr_hide(lpss); 455 intel_lpss_ltr_hide(lpss);
456 intel_lpss_unregister_clock(lpss);
456 457
457err_clk_register: 458err_clk_register:
458 ida_simple_remove(&intel_lpss_devid_ida, lpss->devid); 459 ida_simple_remove(&intel_lpss_devid_ida, lpss->devid);
diff --git a/drivers/mfd/intel_quark_i2c_gpio.c b/drivers/mfd/intel_quark_i2c_gpio.c
index 042137465300..bdc5e27222c0 100644
--- a/drivers/mfd/intel_quark_i2c_gpio.c
+++ b/drivers/mfd/intel_quark_i2c_gpio.c
@@ -52,8 +52,6 @@
52/* The Quark I2C controller source clock */ 52/* The Quark I2C controller source clock */
53#define INTEL_QUARK_I2C_CLK_HZ 33000000 53#define INTEL_QUARK_I2C_CLK_HZ 33000000
54 54
55#define INTEL_QUARK_I2C_NCLK 1
56
57struct intel_quark_mfd { 55struct intel_quark_mfd {
58 struct pci_dev *pdev; 56 struct pci_dev *pdev;
59 struct clk *i2c_clk; 57 struct clk *i2c_clk;
@@ -128,30 +126,24 @@ MODULE_DEVICE_TABLE(pci, intel_quark_mfd_ids);
128static int intel_quark_register_i2c_clk(struct intel_quark_mfd *quark_mfd) 126static int intel_quark_register_i2c_clk(struct intel_quark_mfd *quark_mfd)
129{ 127{
130 struct pci_dev *pdev = quark_mfd->pdev; 128 struct pci_dev *pdev = quark_mfd->pdev;
131 struct clk_lookup *i2c_clk_lookup;
132 struct clk *i2c_clk; 129 struct clk *i2c_clk;
133 int ret;
134
135 i2c_clk_lookup = devm_kcalloc(&pdev->dev, INTEL_QUARK_I2C_NCLK,
136 sizeof(*i2c_clk_lookup), GFP_KERNEL);
137 if (!i2c_clk_lookup)
138 return -ENOMEM;
139
140 i2c_clk_lookup[0].dev_id = INTEL_QUARK_I2C_CONTROLLER_CLK;
141 130
142 i2c_clk = clk_register_fixed_rate(&pdev->dev, 131 i2c_clk = clk_register_fixed_rate(&pdev->dev,
143 INTEL_QUARK_I2C_CONTROLLER_CLK, NULL, 132 INTEL_QUARK_I2C_CONTROLLER_CLK, NULL,
144 CLK_IS_ROOT, INTEL_QUARK_I2C_CLK_HZ); 133 CLK_IS_ROOT, INTEL_QUARK_I2C_CLK_HZ);
134 if (IS_ERR(i2c_clk))
135 return PTR_ERR(i2c_clk);
145 136
146 quark_mfd->i2c_clk_lookup = i2c_clk_lookup;
147 quark_mfd->i2c_clk = i2c_clk; 137 quark_mfd->i2c_clk = i2c_clk;
138 quark_mfd->i2c_clk_lookup = clkdev_create(i2c_clk, NULL,
139 INTEL_QUARK_I2C_CONTROLLER_CLK);
148 140
149 ret = clk_register_clkdevs(i2c_clk, i2c_clk_lookup, 141 if (!quark_mfd->i2c_clk_lookup) {
150 INTEL_QUARK_I2C_NCLK); 142 dev_err(&pdev->dev, "Fixed clk register failed\n");
151 if (ret) 143 return -ENOMEM;
152 dev_err(&pdev->dev, "Fixed clk register failed: %d\n", ret); 144 }
153 145
154 return ret; 146 return 0;
155} 147}
156 148
157static void intel_quark_unregister_i2c_clk(struct pci_dev *pdev) 149static void intel_quark_unregister_i2c_clk(struct pci_dev *pdev)
diff --git a/drivers/mfd/ipaq-micro.c b/drivers/mfd/ipaq-micro.c
index a41859c55bda..df16fd1df68b 100644
--- a/drivers/mfd/ipaq-micro.c
+++ b/drivers/mfd/ipaq-micro.c
@@ -376,7 +376,7 @@ static const struct mfd_cell micro_cells[] = {
376 { .name = "ipaq-micro-leds", }, 376 { .name = "ipaq-micro-leds", },
377}; 377};
378 378
379static int micro_resume(struct device *dev) 379static int __maybe_unused micro_resume(struct device *dev)
380{ 380{
381 struct ipaq_micro *micro = dev_get_drvdata(dev); 381 struct ipaq_micro *micro = dev_get_drvdata(dev);
382 382
diff --git a/drivers/mfd/max77686.c b/drivers/mfd/max77686.c
index 98ecd136a21b..c1aff46e89d9 100644
--- a/drivers/mfd/max77686.c
+++ b/drivers/mfd/max77686.c
@@ -169,6 +169,7 @@ static const struct of_device_id max77686_pmic_dt_match[] = {
169 }, 169 },
170 { }, 170 { },
171}; 171};
172MODULE_DEVICE_TABLE(of, max77686_pmic_dt_match);
172 173
173static int max77686_i2c_probe(struct i2c_client *i2c, 174static int max77686_i2c_probe(struct i2c_client *i2c,
174 const struct i2c_device_id *id) 175 const struct i2c_device_id *id)
@@ -265,6 +266,7 @@ static int max77686_i2c_remove(struct i2c_client *i2c)
265 266
266static const struct i2c_device_id max77686_i2c_id[] = { 267static const struct i2c_device_id max77686_i2c_id[] = {
267 { "max77686", TYPE_MAX77686 }, 268 { "max77686", TYPE_MAX77686 },
269 { "max77802", TYPE_MAX77802 },
268 { } 270 { }
269}; 271};
270MODULE_DEVICE_TABLE(i2c, max77686_i2c_id); 272MODULE_DEVICE_TABLE(i2c, max77686_i2c_id);
diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c
index 1749c1c9f405..8e8d93249c09 100644
--- a/drivers/mfd/mt6397-core.c
+++ b/drivers/mfd/mt6397-core.c
@@ -19,11 +19,17 @@
19#include <linux/regmap.h> 19#include <linux/regmap.h>
20#include <linux/mfd/core.h> 20#include <linux/mfd/core.h>
21#include <linux/mfd/mt6397/core.h> 21#include <linux/mfd/mt6397/core.h>
22#include <linux/mfd/mt6323/core.h>
22#include <linux/mfd/mt6397/registers.h> 23#include <linux/mfd/mt6397/registers.h>
24#include <linux/mfd/mt6323/registers.h>
23 25
24#define MT6397_RTC_BASE 0xe000 26#define MT6397_RTC_BASE 0xe000
25#define MT6397_RTC_SIZE 0x3e 27#define MT6397_RTC_SIZE 0x3e
26 28
29#define MT6323_CID_CODE 0x23
30#define MT6391_CID_CODE 0x91
31#define MT6397_CID_CODE 0x97
32
27static const struct resource mt6397_rtc_resources[] = { 33static const struct resource mt6397_rtc_resources[] = {
28 { 34 {
29 .start = MT6397_RTC_BASE, 35 .start = MT6397_RTC_BASE,
@@ -37,6 +43,13 @@ static const struct resource mt6397_rtc_resources[] = {
37 }, 43 },
38}; 44};
39 45
46static const struct mfd_cell mt6323_devs[] = {
47 {
48 .name = "mt6323-regulator",
49 .of_compatible = "mediatek,mt6323-regulator"
50 },
51};
52
40static const struct mfd_cell mt6397_devs[] = { 53static const struct mfd_cell mt6397_devs[] = {
41 { 54 {
42 .name = "mt6397-rtc", 55 .name = "mt6397-rtc",
@@ -69,8 +82,10 @@ static void mt6397_irq_sync_unlock(struct irq_data *data)
69{ 82{
70 struct mt6397_chip *mt6397 = irq_data_get_irq_chip_data(data); 83 struct mt6397_chip *mt6397 = irq_data_get_irq_chip_data(data);
71 84
72 regmap_write(mt6397->regmap, MT6397_INT_CON0, mt6397->irq_masks_cur[0]); 85 regmap_write(mt6397->regmap, mt6397->int_con[0],
73 regmap_write(mt6397->regmap, MT6397_INT_CON1, mt6397->irq_masks_cur[1]); 86 mt6397->irq_masks_cur[0]);
87 regmap_write(mt6397->regmap, mt6397->int_con[1],
88 mt6397->irq_masks_cur[1]);
74 89
75 mutex_unlock(&mt6397->irqlock); 90 mutex_unlock(&mt6397->irqlock);
76} 91}
@@ -147,8 +162,8 @@ static irqreturn_t mt6397_irq_thread(int irq, void *data)
147{ 162{
148 struct mt6397_chip *mt6397 = data; 163 struct mt6397_chip *mt6397 = data;
149 164
150 mt6397_irq_handle_reg(mt6397, MT6397_INT_STATUS0, 0); 165 mt6397_irq_handle_reg(mt6397, mt6397->int_status[0], 0);
151 mt6397_irq_handle_reg(mt6397, MT6397_INT_STATUS1, 16); 166 mt6397_irq_handle_reg(mt6397, mt6397->int_status[1], 16);
152 167
153 return IRQ_HANDLED; 168 return IRQ_HANDLED;
154} 169}
@@ -177,8 +192,8 @@ static int mt6397_irq_init(struct mt6397_chip *mt6397)
177 mutex_init(&mt6397->irqlock); 192 mutex_init(&mt6397->irqlock);
178 193
179 /* Mask all interrupt sources */ 194 /* Mask all interrupt sources */
180 regmap_write(mt6397->regmap, MT6397_INT_CON0, 0x0); 195 regmap_write(mt6397->regmap, mt6397->int_con[0], 0x0);
181 regmap_write(mt6397->regmap, MT6397_INT_CON1, 0x0); 196 regmap_write(mt6397->regmap, mt6397->int_con[1], 0x0);
182 197
183 mt6397->irq_domain = irq_domain_add_linear(mt6397->dev->of_node, 198 mt6397->irq_domain = irq_domain_add_linear(mt6397->dev->of_node,
184 MT6397_IRQ_NR, &mt6397_irq_domain_ops, mt6397); 199 MT6397_IRQ_NR, &mt6397_irq_domain_ops, mt6397);
@@ -203,8 +218,8 @@ static int mt6397_irq_suspend(struct device *dev)
203{ 218{
204 struct mt6397_chip *chip = dev_get_drvdata(dev); 219 struct mt6397_chip *chip = dev_get_drvdata(dev);
205 220
206 regmap_write(chip->regmap, MT6397_INT_CON0, chip->wake_mask[0]); 221 regmap_write(chip->regmap, chip->int_con[0], chip->wake_mask[0]);
207 regmap_write(chip->regmap, MT6397_INT_CON1, chip->wake_mask[1]); 222 regmap_write(chip->regmap, chip->int_con[1], chip->wake_mask[1]);
208 223
209 enable_irq_wake(chip->irq); 224 enable_irq_wake(chip->irq);
210 225
@@ -215,8 +230,8 @@ static int mt6397_irq_resume(struct device *dev)
215{ 230{
216 struct mt6397_chip *chip = dev_get_drvdata(dev); 231 struct mt6397_chip *chip = dev_get_drvdata(dev);
217 232
218 regmap_write(chip->regmap, MT6397_INT_CON0, chip->irq_masks_cur[0]); 233 regmap_write(chip->regmap, chip->int_con[0], chip->irq_masks_cur[0]);
219 regmap_write(chip->regmap, MT6397_INT_CON1, chip->irq_masks_cur[1]); 234 regmap_write(chip->regmap, chip->int_con[1], chip->irq_masks_cur[1]);
220 235
221 disable_irq_wake(chip->irq); 236 disable_irq_wake(chip->irq);
222 237
@@ -230,34 +245,69 @@ static SIMPLE_DEV_PM_OPS(mt6397_pm_ops, mt6397_irq_suspend,
230static int mt6397_probe(struct platform_device *pdev) 245static int mt6397_probe(struct platform_device *pdev)
231{ 246{
232 int ret; 247 int ret;
233 struct mt6397_chip *mt6397; 248 unsigned int id;
249 struct mt6397_chip *pmic;
234 250
235 mt6397 = devm_kzalloc(&pdev->dev, sizeof(*mt6397), GFP_KERNEL); 251 pmic = devm_kzalloc(&pdev->dev, sizeof(*pmic), GFP_KERNEL);
236 if (!mt6397) 252 if (!pmic)
237 return -ENOMEM; 253 return -ENOMEM;
238 254
239 mt6397->dev = &pdev->dev; 255 pmic->dev = &pdev->dev;
256
240 /* 257 /*
241 * mt6397 MFD is child device of soc pmic wrapper. 258 * mt6397 MFD is child device of soc pmic wrapper.
242 * Regmap is set from its parent. 259 * Regmap is set from its parent.
243 */ 260 */
244 mt6397->regmap = dev_get_regmap(pdev->dev.parent, NULL); 261 pmic->regmap = dev_get_regmap(pdev->dev.parent, NULL);
245 if (!mt6397->regmap) 262 if (!pmic->regmap)
246 return -ENODEV; 263 return -ENODEV;
247 264
248 platform_set_drvdata(pdev, mt6397); 265 platform_set_drvdata(pdev, pmic);
249 266
250 mt6397->irq = platform_get_irq(pdev, 0); 267 ret = regmap_read(pmic->regmap, MT6397_CID, &id);
251 if (mt6397->irq > 0) { 268 if (ret) {
252 ret = mt6397_irq_init(mt6397); 269 dev_err(pmic->dev, "Failed to read chip id: %d\n", ret);
270 goto fail_irq;
271 }
272
273 switch (id & 0xff) {
274 case MT6323_CID_CODE:
275 pmic->int_con[0] = MT6323_INT_CON0;
276 pmic->int_con[1] = MT6323_INT_CON1;
277 pmic->int_status[0] = MT6323_INT_STATUS0;
278 pmic->int_status[1] = MT6323_INT_STATUS1;
279 ret = mfd_add_devices(&pdev->dev, -1, mt6323_devs,
280 ARRAY_SIZE(mt6323_devs), NULL, 0, NULL);
281 break;
282
283 case MT6397_CID_CODE:
284 case MT6391_CID_CODE:
285 pmic->int_con[0] = MT6397_INT_CON0;
286 pmic->int_con[1] = MT6397_INT_CON1;
287 pmic->int_status[0] = MT6397_INT_STATUS0;
288 pmic->int_status[1] = MT6397_INT_STATUS1;
289 ret = mfd_add_devices(&pdev->dev, -1, mt6397_devs,
290 ARRAY_SIZE(mt6397_devs), NULL, 0, NULL);
291 break;
292
293 default:
294 dev_err(&pdev->dev, "unsupported chip: %d\n", id);
295 ret = -ENODEV;
296 break;
297 }
298
299 pmic->irq = platform_get_irq(pdev, 0);
300 if (pmic->irq > 0) {
301 ret = mt6397_irq_init(pmic);
253 if (ret) 302 if (ret)
254 return ret; 303 return ret;
255 } 304 }
256 305
257 ret = mfd_add_devices(&pdev->dev, -1, mt6397_devs, 306fail_irq:
258 ARRAY_SIZE(mt6397_devs), NULL, 0, NULL); 307 if (ret) {
259 if (ret) 308 irq_domain_remove(pmic->irq_domain);
260 dev_err(&pdev->dev, "failed to add child devices: %d\n", ret); 309 dev_err(&pdev->dev, "failed to add child devices: %d\n", ret);
310 }
261 311
262 return ret; 312 return ret;
263} 313}
@@ -271,10 +321,17 @@ static int mt6397_remove(struct platform_device *pdev)
271 321
272static const struct of_device_id mt6397_of_match[] = { 322static const struct of_device_id mt6397_of_match[] = {
273 { .compatible = "mediatek,mt6397" }, 323 { .compatible = "mediatek,mt6397" },
324 { .compatible = "mediatek,mt6323" },
274 { } 325 { }
275}; 326};
276MODULE_DEVICE_TABLE(of, mt6397_of_match); 327MODULE_DEVICE_TABLE(of, mt6397_of_match);
277 328
329static const struct platform_device_id mt6397_id[] = {
330 { "mt6397", 0 },
331 { },
332};
333MODULE_DEVICE_TABLE(platform, mt6397_id);
334
278static struct platform_driver mt6397_driver = { 335static struct platform_driver mt6397_driver = {
279 .probe = mt6397_probe, 336 .probe = mt6397_probe,
280 .remove = mt6397_remove, 337 .remove = mt6397_remove,
@@ -283,6 +340,7 @@ static struct platform_driver mt6397_driver = {
283 .of_match_table = of_match_ptr(mt6397_of_match), 340 .of_match_table = of_match_ptr(mt6397_of_match),
284 .pm = &mt6397_pm_ops, 341 .pm = &mt6397_pm_ops,
285 }, 342 },
343 .id_table = mt6397_id,
286}; 344};
287 345
288module_platform_driver(mt6397_driver); 346module_platform_driver(mt6397_driver);
@@ -290,4 +348,3 @@ module_platform_driver(mt6397_driver);
290MODULE_AUTHOR("Flora Fu, MediaTek"); 348MODULE_AUTHOR("Flora Fu, MediaTek");
291MODULE_DESCRIPTION("Driver for MediaTek MT6397 PMIC"); 349MODULE_DESCRIPTION("Driver for MediaTek MT6397 PMIC");
292MODULE_LICENSE("GPL"); 350MODULE_LICENSE("GPL");
293MODULE_ALIAS("platform:mt6397");
diff --git a/drivers/mfd/rc5t583.c b/drivers/mfd/rc5t583.c
index e10f02f5d551..fc2b2d93f354 100644
--- a/drivers/mfd/rc5t583.c
+++ b/drivers/mfd/rc5t583.c
@@ -241,8 +241,8 @@ static const struct regmap_config rc5t583_regmap_config = {
241 .reg_bits = 8, 241 .reg_bits = 8,
242 .val_bits = 8, 242 .val_bits = 8,
243 .volatile_reg = volatile_reg, 243 .volatile_reg = volatile_reg,
244 .max_register = RC5T583_MAX_REGS, 244 .max_register = RC5T583_MAX_REG,
245 .num_reg_defaults_raw = RC5T583_MAX_REGS, 245 .num_reg_defaults_raw = RC5T583_NUM_REGS,
246 .cache_type = REGCACHE_RBTREE, 246 .cache_type = REGCACHE_RBTREE,
247}; 247};
248 248
diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
index 8222e374e4b1..fb8f9e8b75df 100644
--- a/drivers/mfd/stmpe.c
+++ b/drivers/mfd/stmpe.c
@@ -334,6 +334,31 @@ static const struct mfd_cell stmpe_keypad_cell = {
334}; 334};
335 335
336/* 336/*
337 * PWM (1601, 2401, 2403)
338 */
339static struct resource stmpe_pwm_resources[] = {
340 {
341 .name = "PWM0",
342 .flags = IORESOURCE_IRQ,
343 },
344 {
345 .name = "PWM1",
346 .flags = IORESOURCE_IRQ,
347 },
348 {
349 .name = "PWM2",
350 .flags = IORESOURCE_IRQ,
351 },
352};
353
354static const struct mfd_cell stmpe_pwm_cell = {
355 .name = "stmpe-pwm",
356 .of_compatible = "st,stmpe-pwm",
357 .resources = stmpe_pwm_resources,
358 .num_resources = ARRAY_SIZE(stmpe_pwm_resources),
359};
360
361/*
337 * STMPE801 362 * STMPE801
338 */ 363 */
339static const u8 stmpe801_regs[] = { 364static const u8 stmpe801_regs[] = {
@@ -537,6 +562,11 @@ static struct stmpe_variant_block stmpe1601_blocks[] = {
537 .irq = STMPE1601_IRQ_KEYPAD, 562 .irq = STMPE1601_IRQ_KEYPAD,
538 .block = STMPE_BLOCK_KEYPAD, 563 .block = STMPE_BLOCK_KEYPAD,
539 }, 564 },
565 {
566 .cell = &stmpe_pwm_cell,
567 .irq = STMPE1601_IRQ_PWM0,
568 .block = STMPE_BLOCK_PWM,
569 },
540}; 570};
541 571
542/* supported autosleep timeout delay (in msecs) */ 572/* supported autosleep timeout delay (in msecs) */
@@ -771,6 +801,11 @@ static struct stmpe_variant_block stmpe24xx_blocks[] = {
771 .irq = STMPE24XX_IRQ_KEYPAD, 801 .irq = STMPE24XX_IRQ_KEYPAD,
772 .block = STMPE_BLOCK_KEYPAD, 802 .block = STMPE_BLOCK_KEYPAD,
773 }, 803 },
804 {
805 .cell = &stmpe_pwm_cell,
806 .irq = STMPE24XX_IRQ_PWM0,
807 .block = STMPE_BLOCK_PWM,
808 },
774}; 809};
775 810
776static int stmpe24xx_enable(struct stmpe *stmpe, unsigned int blocks, 811static int stmpe24xx_enable(struct stmpe *stmpe, unsigned int blocks,
diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index b7aabeefab07..2f2225e845ef 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -36,7 +36,7 @@ struct syscon {
36 struct list_head list; 36 struct list_head list;
37}; 37};
38 38
39static struct regmap_config syscon_regmap_config = { 39static const struct regmap_config syscon_regmap_config = {
40 .reg_bits = 32, 40 .reg_bits = 32,
41 .val_bits = 32, 41 .val_bits = 32,
42 .reg_stride = 4, 42 .reg_stride = 4,
@@ -50,6 +50,7 @@ static struct syscon *of_syscon_register(struct device_node *np)
50 u32 reg_io_width; 50 u32 reg_io_width;
51 int ret; 51 int ret;
52 struct regmap_config syscon_config = syscon_regmap_config; 52 struct regmap_config syscon_config = syscon_regmap_config;
53 struct resource res;
53 54
54 if (!of_device_is_compatible(np, "syscon")) 55 if (!of_device_is_compatible(np, "syscon"))
55 return ERR_PTR(-EINVAL); 56 return ERR_PTR(-EINVAL);
@@ -58,7 +59,12 @@ static struct syscon *of_syscon_register(struct device_node *np)
58 if (!syscon) 59 if (!syscon)
59 return ERR_PTR(-ENOMEM); 60 return ERR_PTR(-ENOMEM);
60 61
61 base = of_iomap(np, 0); 62 if (of_address_to_resource(np, 0, &res)) {
63 ret = -ENOMEM;
64 goto err_map;
65 }
66
67 base = ioremap(res.start, resource_size(&res));
62 if (!base) { 68 if (!base) {
63 ret = -ENOMEM; 69 ret = -ENOMEM;
64 goto err_map; 70 goto err_map;
@@ -81,6 +87,7 @@ static struct syscon *of_syscon_register(struct device_node *np)
81 87
82 syscon_config.reg_stride = reg_io_width; 88 syscon_config.reg_stride = reg_io_width;
83 syscon_config.val_bits = reg_io_width * 8; 89 syscon_config.val_bits = reg_io_width * 8;
90 syscon_config.max_register = resource_size(&res) - reg_io_width;
84 91
85 regmap = regmap_init_mmio(NULL, base, &syscon_config); 92 regmap = regmap_init_mmio(NULL, base, &syscon_config);
86 if (IS_ERR(regmap)) { 93 if (IS_ERR(regmap)) {
@@ -192,6 +199,7 @@ static int syscon_probe(struct platform_device *pdev)
192 struct device *dev = &pdev->dev; 199 struct device *dev = &pdev->dev;
193 struct syscon_platform_data *pdata = dev_get_platdata(dev); 200 struct syscon_platform_data *pdata = dev_get_platdata(dev);
194 struct syscon *syscon; 201 struct syscon *syscon;
202 struct regmap_config syscon_config = syscon_regmap_config;
195 struct resource *res; 203 struct resource *res;
196 void __iomem *base; 204 void __iomem *base;
197 205
@@ -207,11 +215,10 @@ static int syscon_probe(struct platform_device *pdev)
207 if (!base) 215 if (!base)
208 return -ENOMEM; 216 return -ENOMEM;
209 217
210 syscon_regmap_config.max_register = res->end - res->start - 3; 218 syscon_config.max_register = res->end - res->start - 3;
211 if (pdata) 219 if (pdata)
212 syscon_regmap_config.name = pdata->label; 220 syscon_config.name = pdata->label;
213 syscon->regmap = devm_regmap_init_mmio(dev, base, 221 syscon->regmap = devm_regmap_init_mmio(dev, base, &syscon_config);
214 &syscon_regmap_config);
215 if (IS_ERR(syscon->regmap)) { 222 if (IS_ERR(syscon->regmap)) {
216 dev_err(dev, "regmap init failed\n"); 223 dev_err(dev, "regmap init failed\n");
217 return PTR_ERR(syscon->regmap); 224 return PTR_ERR(syscon->regmap);
diff --git a/drivers/mfd/tps65010.c b/drivers/mfd/tps65010.c
index 83e615ed100a..495e4518fc29 100644
--- a/drivers/mfd/tps65010.c
+++ b/drivers/mfd/tps65010.c
@@ -1059,26 +1059,7 @@ EXPORT_SYMBOL(tps65013_set_low_pwr);
1059 1059
1060static int __init tps_init(void) 1060static int __init tps_init(void)
1061{ 1061{
1062 u32 tries = 3; 1062 return i2c_add_driver(&tps65010_driver);
1063 int status = -ENODEV;
1064
1065 printk(KERN_INFO "%s: version %s\n", DRIVER_NAME, DRIVER_VERSION);
1066
1067 /* some boards have startup glitches */
1068 while (tries--) {
1069 status = i2c_add_driver(&tps65010_driver);
1070 if (the_tps)
1071 break;
1072 i2c_del_driver(&tps65010_driver);
1073 if (!tries) {
1074 printk(KERN_ERR "%s: no chip?\n", DRIVER_NAME);
1075 return -ENODEV;
1076 }
1077 pr_debug("%s: re-probe ...\n", DRIVER_NAME);
1078 msleep(10);
1079 }
1080
1081 return status;
1082} 1063}
1083/* NOTE: this MUST be initialized before the other parts of the system 1064/* NOTE: this MUST be initialized before the other parts of the system
1084 * that rely on it ... but after the i2c bus on which this relies. 1065 * that rely on it ... but after the i2c bus on which this relies.
diff --git a/drivers/mfd/tps65086.c b/drivers/mfd/tps65086.c
new file mode 100644
index 000000000000..43119a6867fe
--- /dev/null
+++ b/drivers/mfd/tps65086.c
@@ -0,0 +1,149 @@
1/*
2 * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
3 * Andrew F. Davis <afd@ti.com>
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
10 * kind, whether expressed or implied; without even the implied warranty
11 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License version 2 for more details.
13 *
14 * Based on the TPS65912 driver
15 */
16
17#include <linux/i2c.h>
18#include <linux/interrupt.h>
19#include <linux/mfd/core.h>
20#include <linux/module.h>
21
22#include <linux/mfd/tps65086.h>
23
24static const struct mfd_cell tps65086_cells[] = {
25 { .name = "tps65086-regulator", },
26 { .name = "tps65086-gpio", },
27};
28
29static const struct regmap_range tps65086_yes_ranges[] = {
30 regmap_reg_range(TPS65086_IRQ, TPS65086_IRQ),
31 regmap_reg_range(TPS65086_PMICSTAT, TPS65086_SHUTDNSRC),
32 regmap_reg_range(TPS65086_GPOCTRL, TPS65086_GPOCTRL),
33 regmap_reg_range(TPS65086_PG_STATUS1, TPS65086_OC_STATUS),
34};
35
36static const struct regmap_access_table tps65086_volatile_table = {
37 .yes_ranges = tps65086_yes_ranges,
38 .n_yes_ranges = ARRAY_SIZE(tps65086_yes_ranges),
39};
40
41static const struct regmap_config tps65086_regmap_config = {
42 .reg_bits = 8,
43 .val_bits = 8,
44 .cache_type = REGCACHE_RBTREE,
45 .volatile_table = &tps65086_volatile_table,
46};
47
48static const struct regmap_irq tps65086_irqs[] = {
49 REGMAP_IRQ_REG(TPS65086_IRQ_DIETEMP, 0, TPS65086_IRQ_DIETEMP_MASK),
50 REGMAP_IRQ_REG(TPS65086_IRQ_SHUTDN, 0, TPS65086_IRQ_SHUTDN_MASK),
51 REGMAP_IRQ_REG(TPS65086_IRQ_FAULT, 0, TPS65086_IRQ_FAULT_MASK),
52};
53
54static struct regmap_irq_chip tps65086_irq_chip = {
55 .name = "tps65086",
56 .status_base = TPS65086_IRQ,
57 .mask_base = TPS65086_IRQ_MASK,
58 .ack_base = TPS65086_IRQ,
59 .init_ack_masked = true,
60 .num_regs = 1,
61 .irqs = tps65086_irqs,
62 .num_irqs = ARRAY_SIZE(tps65086_irqs),
63};
64
65static const struct of_device_id tps65086_of_match_table[] = {
66 { .compatible = "ti,tps65086", },
67 { /* sentinel */ }
68};
69MODULE_DEVICE_TABLE(of, tps65086_of_match_table);
70
71static int tps65086_probe(struct i2c_client *client,
72 const struct i2c_device_id *ids)
73{
74 struct tps65086 *tps;
75 unsigned int version;
76 int ret;
77
78 tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL);
79 if (!tps)
80 return -ENOMEM;
81
82 i2c_set_clientdata(client, tps);
83 tps->dev = &client->dev;
84 tps->irq = client->irq;
85
86 tps->regmap = devm_regmap_init_i2c(client, &tps65086_regmap_config);
87 if (IS_ERR(tps->regmap)) {
88 dev_err(tps->dev, "Failed to initialize register map\n");
89 return PTR_ERR(tps->regmap);
90 }
91
92 ret = regmap_read(tps->regmap, TPS65086_DEVICEID, &version);
93 if (ret) {
94 dev_err(tps->dev, "Failed to read revision register\n");
95 return ret;
96 }
97
98 dev_info(tps->dev, "Device: TPS65086%01lX, OTP: %c, Rev: %ld\n",
99 (version & TPS65086_DEVICEID_PART_MASK),
100 (char)((version & TPS65086_DEVICEID_OTP_MASK) >> 4) + 'A',
101 (version & TPS65086_DEVICEID_REV_MASK) >> 6);
102
103 ret = regmap_add_irq_chip(tps->regmap, tps->irq, IRQF_ONESHOT, 0,
104 &tps65086_irq_chip, &tps->irq_data);
105 if (ret) {
106 dev_err(tps->dev, "Failed to register IRQ chip\n");
107 return ret;
108 }
109
110 ret = mfd_add_devices(tps->dev, PLATFORM_DEVID_AUTO, tps65086_cells,
111 ARRAY_SIZE(tps65086_cells), NULL, 0,
112 regmap_irq_get_domain(tps->irq_data));
113 if (ret) {
114 regmap_del_irq_chip(tps->irq, tps->irq_data);
115 return ret;
116 }
117
118 return 0;
119}
120
121static int tps65086_remove(struct i2c_client *client)
122{
123 struct tps65086 *tps = i2c_get_clientdata(client);
124
125 regmap_del_irq_chip(tps->irq, tps->irq_data);
126
127 return 0;
128}
129
130static const struct i2c_device_id tps65086_id_table[] = {
131 { "tps65086", 0 },
132 { /* sentinel */ }
133};
134MODULE_DEVICE_TABLE(i2c, tps65086_id_table);
135
136static struct i2c_driver tps65086_driver = {
137 .driver = {
138 .name = "tps65086",
139 .of_match_table = tps65086_of_match_table,
140 },
141 .probe = tps65086_probe,
142 .remove = tps65086_remove,
143 .id_table = tps65086_id_table,
144};
145module_i2c_driver(tps65086_driver);
146
147MODULE_AUTHOR("Andrew F. Davis <afd@ti.com>");
148MODULE_DESCRIPTION("TPS65086 PMIC Driver");
149MODULE_LICENSE("GPL v2");
diff --git a/drivers/mfd/tps65090.c b/drivers/mfd/tps65090.c
index f88085ad9772..d7ec318c40c3 100644
--- a/drivers/mfd/tps65090.c
+++ b/drivers/mfd/tps65090.c
@@ -30,7 +30,6 @@
30#include <linux/err.h> 30#include <linux/err.h>
31 31
32#define NUM_INT_REG 2 32#define NUM_INT_REG 2
33#define TOTAL_NUM_REG 0x18
34 33
35#define TPS65090_INT1_MASK_VAC_STATUS_CHANGE 1 34#define TPS65090_INT1_MASK_VAC_STATUS_CHANGE 1
36#define TPS65090_INT1_MASK_VSYS_STATUS_CHANGE 2 35#define TPS65090_INT1_MASK_VSYS_STATUS_CHANGE 2
@@ -161,8 +160,8 @@ static bool is_volatile_reg(struct device *dev, unsigned int reg)
161static const struct regmap_config tps65090_regmap_config = { 160static const struct regmap_config tps65090_regmap_config = {
162 .reg_bits = 8, 161 .reg_bits = 8,
163 .val_bits = 8, 162 .val_bits = 8,
164 .max_register = TOTAL_NUM_REG, 163 .max_register = TPS65090_MAX_REG,
165 .num_reg_defaults_raw = TOTAL_NUM_REG, 164 .num_reg_defaults_raw = TPS65090_NUM_REGS,
166 .cache_type = REGCACHE_RBTREE, 165 .cache_type = REGCACHE_RBTREE,
167 .volatile_reg = is_volatile_reg, 166 .volatile_reg = is_volatile_reg,
168}; 167};
diff --git a/drivers/mfd/wm5102-tables.c b/drivers/mfd/wm5102-tables.c
index 0386eaf6be32..ab8b23b5bd22 100644
--- a/drivers/mfd/wm5102-tables.c
+++ b/drivers/mfd/wm5102-tables.c
@@ -297,7 +297,6 @@ static const struct reg_default wm5102_reg_default[] = {
297 { 0x00000174, 0x007D }, /* R372 - FLL1 Control 4 */ 297 { 0x00000174, 0x007D }, /* R372 - FLL1 Control 4 */
298 { 0x00000175, 0x0004 }, /* R373 - FLL1 Control 5 */ 298 { 0x00000175, 0x0004 }, /* R373 - FLL1 Control 5 */
299 { 0x00000176, 0x0000 }, /* R374 - FLL1 Control 6 */ 299 { 0x00000176, 0x0000 }, /* R374 - FLL1 Control 6 */
300 { 0x00000177, 0x0181 }, /* R375 - FLL1 Loop Filter Test 1 */
301 { 0x00000179, 0x0000 }, /* R377 - FLL1 Control 7 */ 300 { 0x00000179, 0x0000 }, /* R377 - FLL1 Control 7 */
302 { 0x00000181, 0x0000 }, /* R385 - FLL1 Synchroniser 1 */ 301 { 0x00000181, 0x0000 }, /* R385 - FLL1 Synchroniser 1 */
303 { 0x00000182, 0x0000 }, /* R386 - FLL1 Synchroniser 2 */ 302 { 0x00000182, 0x0000 }, /* R386 - FLL1 Synchroniser 2 */
@@ -314,7 +313,6 @@ static const struct reg_default wm5102_reg_default[] = {
314 { 0x00000194, 0x007D }, /* R404 - FLL2 Control 4 */ 313 { 0x00000194, 0x007D }, /* R404 - FLL2 Control 4 */
315 { 0x00000195, 0x0004 }, /* R405 - FLL2 Control 5 */ 314 { 0x00000195, 0x0004 }, /* R405 - FLL2 Control 5 */
316 { 0x00000196, 0x0000 }, /* R406 - FLL2 Control 6 */ 315 { 0x00000196, 0x0000 }, /* R406 - FLL2 Control 6 */
317 { 0x00000197, 0x0000 }, /* R407 - FLL2 Loop Filter Test 1 */
318 { 0x00000199, 0x0000 }, /* R409 - FLL2 Control 7 */ 316 { 0x00000199, 0x0000 }, /* R409 - FLL2 Control 7 */
319 { 0x000001A1, 0x0000 }, /* R417 - FLL2 Synchroniser 1 */ 317 { 0x000001A1, 0x0000 }, /* R417 - FLL2 Synchroniser 1 */
320 { 0x000001A2, 0x0000 }, /* R418 - FLL2 Synchroniser 2 */ 318 { 0x000001A2, 0x0000 }, /* R418 - FLL2 Synchroniser 2 */
@@ -338,7 +336,7 @@ static const struct reg_default wm5102_reg_default[] = {
338 { 0x000002A3, 0x1102 }, /* R675 - Mic Detect 1 */ 336 { 0x000002A3, 0x1102 }, /* R675 - Mic Detect 1 */
339 { 0x000002A4, 0x009F }, /* R676 - Mic Detect 2 */ 337 { 0x000002A4, 0x009F }, /* R676 - Mic Detect 2 */
340 { 0x000002A6, 0x3737 }, /* R678 - Mic Detect Level 1 */ 338 { 0x000002A6, 0x3737 }, /* R678 - Mic Detect Level 1 */
341 { 0x000002A7, 0x372C }, /* R679 - Mic Detect Level 2 */ 339 { 0x000002A7, 0x2C37 }, /* R679 - Mic Detect Level 2 */
342 { 0x000002A8, 0x1422 }, /* R680 - Mic Detect Level 3 */ 340 { 0x000002A8, 0x1422 }, /* R680 - Mic Detect Level 3 */
343 { 0x000002A9, 0x030A }, /* R681 - Mic Detect Level 4 */ 341 { 0x000002A9, 0x030A }, /* R681 - Mic Detect Level 4 */
344 { 0x000002C3, 0x0000 }, /* R707 - Mic noise mix control 1 */ 342 { 0x000002C3, 0x0000 }, /* R707 - Mic noise mix control 1 */
@@ -402,7 +400,7 @@ static const struct reg_default wm5102_reg_default[] = {
402 { 0x00000435, 0x0180 }, /* R1077 - DAC Digital Volume 5R */ 400 { 0x00000435, 0x0180 }, /* R1077 - DAC Digital Volume 5R */
403 { 0x00000436, 0x0081 }, /* R1078 - DAC Volume Limit 5R */ 401 { 0x00000436, 0x0081 }, /* R1078 - DAC Volume Limit 5R */
404 { 0x00000437, 0x0200 }, /* R1079 - Noise Gate Select 5R */ 402 { 0x00000437, 0x0200 }, /* R1079 - Noise Gate Select 5R */
405 { 0x00000440, 0x8FFF }, /* R1088 - DRE Enable */ 403 { 0x00000440, 0x0FFF }, /* R1088 - DRE Enable */
406 { 0x00000442, 0x3F0A }, /* R1090 - DRE Control 2 */ 404 { 0x00000442, 0x3F0A }, /* R1090 - DRE Control 2 */
407 { 0x00000443, 0xDC1F }, /* R1090 - DRE Control 3 */ 405 { 0x00000443, 0xDC1F }, /* R1090 - DRE Control 3 */
408 { 0x00000450, 0x0000 }, /* R1104 - DAC AEC Control 1 */ 406 { 0x00000450, 0x0000 }, /* R1104 - DAC AEC Control 1 */
@@ -863,7 +861,7 @@ static const struct reg_default wm5102_reg_default[] = {
863 { 0x00000C0F, 0x0400 }, /* R3087 - IRQ CTRL 1 */ 861 { 0x00000C0F, 0x0400 }, /* R3087 - IRQ CTRL 1 */
864 { 0x00000C10, 0x1000 }, /* R3088 - GPIO Debounce Config */ 862 { 0x00000C10, 0x1000 }, /* R3088 - GPIO Debounce Config */
865 { 0x00000C20, 0x8002 }, /* R3104 - Misc Pad Ctrl 1 */ 863 { 0x00000C20, 0x8002 }, /* R3104 - Misc Pad Ctrl 1 */
866 { 0x00000C21, 0x8001 }, /* R3105 - Misc Pad Ctrl 2 */ 864 { 0x00000C21, 0x0001 }, /* R3105 - Misc Pad Ctrl 2 */
867 { 0x00000C22, 0x0000 }, /* R3106 - Misc Pad Ctrl 3 */ 865 { 0x00000C22, 0x0000 }, /* R3106 - Misc Pad Ctrl 3 */
868 { 0x00000C23, 0x0000 }, /* R3107 - Misc Pad Ctrl 4 */ 866 { 0x00000C23, 0x0000 }, /* R3107 - Misc Pad Ctrl 4 */
869 { 0x00000C24, 0x0000 }, /* R3108 - Misc Pad Ctrl 5 */ 867 { 0x00000C24, 0x0000 }, /* R3108 - Misc Pad Ctrl 5 */
@@ -984,7 +982,7 @@ static const struct reg_default wm5102_reg_default[] = {
984 { 0x00000ECD, 0x0000 }, /* R3789 - HPLPF4_2 */ 982 { 0x00000ECD, 0x0000 }, /* R3789 - HPLPF4_2 */
985 { 0x00000EE0, 0x0000 }, /* R3808 - ASRC_ENABLE */ 983 { 0x00000EE0, 0x0000 }, /* R3808 - ASRC_ENABLE */
986 { 0x00000EE2, 0x0000 }, /* R3810 - ASRC_RATE1 */ 984 { 0x00000EE2, 0x0000 }, /* R3810 - ASRC_RATE1 */
987 { 0x00000EE3, 0x0400 }, /* R3811 - ASRC_RATE2 */ 985 { 0x00000EE3, 0x4000 }, /* R3811 - ASRC_RATE2 */
988 { 0x00000EF0, 0x0000 }, /* R3824 - ISRC 1 CTRL 1 */ 986 { 0x00000EF0, 0x0000 }, /* R3824 - ISRC 1 CTRL 1 */
989 { 0x00000EF1, 0x0000 }, /* R3825 - ISRC 1 CTRL 2 */ 987 { 0x00000EF1, 0x0000 }, /* R3825 - ISRC 1 CTRL 2 */
990 { 0x00000EF2, 0x0000 }, /* R3826 - ISRC 1 CTRL 3 */ 988 { 0x00000EF2, 0x0000 }, /* R3826 - ISRC 1 CTRL 3 */
@@ -1062,8 +1060,6 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg)
1062 case ARIZONA_FLL1_CONTROL_4: 1060 case ARIZONA_FLL1_CONTROL_4:
1063 case ARIZONA_FLL1_CONTROL_5: 1061 case ARIZONA_FLL1_CONTROL_5:
1064 case ARIZONA_FLL1_CONTROL_6: 1062 case ARIZONA_FLL1_CONTROL_6:
1065 case ARIZONA_FLL1_LOOP_FILTER_TEST_1:
1066 case ARIZONA_FLL1_NCO_TEST_0:
1067 case ARIZONA_FLL1_CONTROL_7: 1063 case ARIZONA_FLL1_CONTROL_7:
1068 case ARIZONA_FLL1_SYNCHRONISER_1: 1064 case ARIZONA_FLL1_SYNCHRONISER_1:
1069 case ARIZONA_FLL1_SYNCHRONISER_2: 1065 case ARIZONA_FLL1_SYNCHRONISER_2:
@@ -1080,8 +1076,6 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg)
1080 case ARIZONA_FLL2_CONTROL_4: 1076 case ARIZONA_FLL2_CONTROL_4:
1081 case ARIZONA_FLL2_CONTROL_5: 1077 case ARIZONA_FLL2_CONTROL_5:
1082 case ARIZONA_FLL2_CONTROL_6: 1078 case ARIZONA_FLL2_CONTROL_6:
1083 case ARIZONA_FLL2_LOOP_FILTER_TEST_1:
1084 case ARIZONA_FLL2_NCO_TEST_0:
1085 case ARIZONA_FLL2_CONTROL_7: 1079 case ARIZONA_FLL2_CONTROL_7:
1086 case ARIZONA_FLL2_SYNCHRONISER_1: 1080 case ARIZONA_FLL2_SYNCHRONISER_1:
1087 case ARIZONA_FLL2_SYNCHRONISER_2: 1081 case ARIZONA_FLL2_SYNCHRONISER_2:
@@ -1849,8 +1843,6 @@ static bool wm5102_volatile_register(struct device *dev, unsigned int reg)
1849 case ARIZONA_HAPTICS_STATUS: 1843 case ARIZONA_HAPTICS_STATUS:
1850 case ARIZONA_ASYNC_SAMPLE_RATE_1_STATUS: 1844 case ARIZONA_ASYNC_SAMPLE_RATE_1_STATUS:
1851 case ARIZONA_ASYNC_SAMPLE_RATE_2_STATUS: 1845 case ARIZONA_ASYNC_SAMPLE_RATE_2_STATUS:
1852 case ARIZONA_FLL1_NCO_TEST_0:
1853 case ARIZONA_FLL2_NCO_TEST_0:
1854 case ARIZONA_DAC_COMP_1: 1846 case ARIZONA_DAC_COMP_1:
1855 case ARIZONA_DAC_COMP_2: 1847 case ARIZONA_DAC_COMP_2:
1856 case ARIZONA_DAC_COMP_3: 1848 case ARIZONA_DAC_COMP_3:
diff --git a/drivers/mfd/wm5110-tables.c b/drivers/mfd/wm5110-tables.c
index c18e11f42b3f..8e74e71507e7 100644
--- a/drivers/mfd/wm5110-tables.c
+++ b/drivers/mfd/wm5110-tables.c
@@ -676,8 +676,8 @@ static const struct reg_default wm5110_reg_default[] = {
676 { 0x00000008, 0x0019 }, /* R8 - Ctrl IF SPI CFG 1 */ 676 { 0x00000008, 0x0019 }, /* R8 - Ctrl IF SPI CFG 1 */
677 { 0x00000009, 0x0001 }, /* R9 - Ctrl IF I2C1 CFG 1 */ 677 { 0x00000009, 0x0001 }, /* R9 - Ctrl IF I2C1 CFG 1 */
678 { 0x0000000A, 0x0001 }, /* R10 - Ctrl IF I2C2 CFG 1 */ 678 { 0x0000000A, 0x0001 }, /* R10 - Ctrl IF I2C2 CFG 1 */
679 { 0x0000000B, 0x0036 }, /* R11 - Ctrl IF I2C1 CFG 2 */ 679 { 0x0000000B, 0x001A }, /* R11 - Ctrl IF I2C1 CFG 2 */
680 { 0x0000000C, 0x0036 }, /* R12 - Ctrl IF I2C2 CFG 2 */ 680 { 0x0000000C, 0x001A }, /* R12 - Ctrl IF I2C2 CFG 2 */
681 { 0x00000020, 0x0000 }, /* R32 - Tone Generator 1 */ 681 { 0x00000020, 0x0000 }, /* R32 - Tone Generator 1 */
682 { 0x00000021, 0x1000 }, /* R33 - Tone Generator 2 */ 682 { 0x00000021, 0x1000 }, /* R33 - Tone Generator 2 */
683 { 0x00000022, 0x0000 }, /* R34 - Tone Generator 3 */ 683 { 0x00000022, 0x0000 }, /* R34 - Tone Generator 3 */
@@ -723,14 +723,12 @@ static const struct reg_default wm5110_reg_default[] = {
723 { 0x00000154, 0x0000 }, /* R340 - Rate Estimator 3 */ 723 { 0x00000154, 0x0000 }, /* R340 - Rate Estimator 3 */
724 { 0x00000155, 0x0000 }, /* R341 - Rate Estimator 4 */ 724 { 0x00000155, 0x0000 }, /* R341 - Rate Estimator 4 */
725 { 0x00000156, 0x0000 }, /* R342 - Rate Estimator 5 */ 725 { 0x00000156, 0x0000 }, /* R342 - Rate Estimator 5 */
726 { 0x00000171, 0x0000 }, /* R369 - FLL1 Control 1 */ 726 { 0x00000171, 0x0002 }, /* R369 - FLL1 Control 1 */
727 { 0x00000172, 0x0008 }, /* R370 - FLL1 Control 2 */ 727 { 0x00000172, 0x0008 }, /* R370 - FLL1 Control 2 */
728 { 0x00000173, 0x0018 }, /* R371 - FLL1 Control 3 */ 728 { 0x00000173, 0x0018 }, /* R371 - FLL1 Control 3 */
729 { 0x00000174, 0x007D }, /* R372 - FLL1 Control 4 */ 729 { 0x00000174, 0x007D }, /* R372 - FLL1 Control 4 */
730 { 0x00000175, 0x0006 }, /* R373 - FLL1 Control 5 */ 730 { 0x00000175, 0x0006 }, /* R373 - FLL1 Control 5 */
731 { 0x00000176, 0x0000 }, /* R374 - FLL1 Control 6 */ 731 { 0x00000176, 0x0000 }, /* R374 - FLL1 Control 6 */
732 { 0x00000177, 0x0281 }, /* R375 - FLL1 Loop Filter Test 1 */
733 { 0x00000178, 0x0000 }, /* R376 - FLL1 NCO Test 0 */
734 { 0x00000179, 0x0000 }, /* R376 - FLL1 Control 7 */ 732 { 0x00000179, 0x0000 }, /* R376 - FLL1 Control 7 */
735 { 0x00000181, 0x0000 }, /* R385 - FLL1 Synchroniser 1 */ 733 { 0x00000181, 0x0000 }, /* R385 - FLL1 Synchroniser 1 */
736 { 0x00000182, 0x0000 }, /* R386 - FLL1 Synchroniser 2 */ 734 { 0x00000182, 0x0000 }, /* R386 - FLL1 Synchroniser 2 */
@@ -740,15 +738,13 @@ static const struct reg_default wm5110_reg_default[] = {
740 { 0x00000186, 0x0000 }, /* R390 - FLL1 Synchroniser 6 */ 738 { 0x00000186, 0x0000 }, /* R390 - FLL1 Synchroniser 6 */
741 { 0x00000187, 0x0001 }, /* R390 - FLL1 Synchroniser 7 */ 739 { 0x00000187, 0x0001 }, /* R390 - FLL1 Synchroniser 7 */
742 { 0x00000189, 0x0000 }, /* R393 - FLL1 Spread Spectrum */ 740 { 0x00000189, 0x0000 }, /* R393 - FLL1 Spread Spectrum */
743 { 0x0000018A, 0x0004 }, /* R394 - FLL1 GPIO Clock */ 741 { 0x0000018A, 0x000C }, /* R394 - FLL1 GPIO Clock */
744 { 0x00000191, 0x0000 }, /* R401 - FLL2 Control 1 */ 742 { 0x00000191, 0x0002 }, /* R401 - FLL2 Control 1 */
745 { 0x00000192, 0x0008 }, /* R402 - FLL2 Control 2 */ 743 { 0x00000192, 0x0008 }, /* R402 - FLL2 Control 2 */
746 { 0x00000193, 0x0018 }, /* R403 - FLL2 Control 3 */ 744 { 0x00000193, 0x0018 }, /* R403 - FLL2 Control 3 */
747 { 0x00000194, 0x007D }, /* R404 - FLL2 Control 4 */ 745 { 0x00000194, 0x007D }, /* R404 - FLL2 Control 4 */
748 { 0x00000195, 0x000C }, /* R405 - FLL2 Control 5 */ 746 { 0x00000195, 0x000C }, /* R405 - FLL2 Control 5 */
749 { 0x00000196, 0x0000 }, /* R406 - FLL2 Control 6 */ 747 { 0x00000196, 0x0000 }, /* R406 - FLL2 Control 6 */
750 { 0x00000197, 0x0000 }, /* R407 - FLL2 Loop Filter Test 1 */
751 { 0x00000198, 0x0000 }, /* R408 - FLL2 NCO Test 0 */
752 { 0x00000199, 0x0000 }, /* R408 - FLL2 Control 7 */ 748 { 0x00000199, 0x0000 }, /* R408 - FLL2 Control 7 */
753 { 0x000001A1, 0x0000 }, /* R417 - FLL2 Synchroniser 1 */ 749 { 0x000001A1, 0x0000 }, /* R417 - FLL2 Synchroniser 1 */
754 { 0x000001A2, 0x0000 }, /* R418 - FLL2 Synchroniser 2 */ 750 { 0x000001A2, 0x0000 }, /* R418 - FLL2 Synchroniser 2 */
@@ -758,7 +754,7 @@ static const struct reg_default wm5110_reg_default[] = {
758 { 0x000001A6, 0x0000 }, /* R422 - FLL2 Synchroniser 6 */ 754 { 0x000001A6, 0x0000 }, /* R422 - FLL2 Synchroniser 6 */
759 { 0x000001A7, 0x0001 }, /* R422 - FLL2 Synchroniser 7 */ 755 { 0x000001A7, 0x0001 }, /* R422 - FLL2 Synchroniser 7 */
760 { 0x000001A9, 0x0000 }, /* R425 - FLL2 Spread Spectrum */ 756 { 0x000001A9, 0x0000 }, /* R425 - FLL2 Spread Spectrum */
761 { 0x000001AA, 0x0004 }, /* R426 - FLL2 GPIO Clock */ 757 { 0x000001AA, 0x000C }, /* R426 - FLL2 GPIO Clock */
762 { 0x00000200, 0x0006 }, /* R512 - Mic Charge Pump 1 */ 758 { 0x00000200, 0x0006 }, /* R512 - Mic Charge Pump 1 */
763 { 0x00000210, 0x0184 }, /* R528 - LDO1 Control 1 */ 759 { 0x00000210, 0x0184 }, /* R528 - LDO1 Control 1 */
764 { 0x00000213, 0x03E4 }, /* R531 - LDO2 Control 1 */ 760 { 0x00000213, 0x03E4 }, /* R531 - LDO2 Control 1 */
@@ -771,9 +767,9 @@ static const struct reg_default wm5110_reg_default[] = {
771 { 0x000002A3, 0x1102 }, /* R675 - Mic Detect 1 */ 767 { 0x000002A3, 0x1102 }, /* R675 - Mic Detect 1 */
772 { 0x000002A4, 0x009F }, /* R676 - Mic Detect 2 */ 768 { 0x000002A4, 0x009F }, /* R676 - Mic Detect 2 */
773 { 0x000002A6, 0x3737 }, /* R678 - Mic Detect Level 1 */ 769 { 0x000002A6, 0x3737 }, /* R678 - Mic Detect Level 1 */
774 { 0x000002A7, 0x372C }, /* R679 - Mic Detect Level 2 */ 770 { 0x000002A7, 0x2C37 }, /* R679 - Mic Detect Level 2 */
775 { 0x000002A8, 0x1422 }, /* R680 - Mic Detect Level 3 */ 771 { 0x000002A8, 0x1422 }, /* R680 - Mic Detect Level 3 */
776 { 0x000002A9, 0x300A }, /* R681 - Mic Detect Level 4 */ 772 { 0x000002A9, 0x030A }, /* R681 - Mic Detect Level 4 */
777 { 0x000002C3, 0x0000 }, /* R707 - Mic noise mix control 1 */ 773 { 0x000002C3, 0x0000 }, /* R707 - Mic noise mix control 1 */
778 { 0x000002CB, 0x0000 }, /* R715 - Isolation control */ 774 { 0x000002CB, 0x0000 }, /* R715 - Isolation control */
779 { 0x000002D3, 0x0000 }, /* R723 - Jack detect analogue */ 775 { 0x000002D3, 0x0000 }, /* R723 - Jack detect analogue */
@@ -810,53 +806,53 @@ static const struct reg_default wm5110_reg_default[] = {
810 { 0x00000409, 0x0022 }, /* R1033 - Output Volume Ramp */ 806 { 0x00000409, 0x0022 }, /* R1033 - Output Volume Ramp */
811 { 0x00000410, 0x0080 }, /* R1040 - Output Path Config 1L */ 807 { 0x00000410, 0x0080 }, /* R1040 - Output Path Config 1L */
812 { 0x00000411, 0x0180 }, /* R1041 - DAC Digital Volume 1L */ 808 { 0x00000411, 0x0180 }, /* R1041 - DAC Digital Volume 1L */
813 { 0x00000412, 0x0080 }, /* R1042 - DAC Volume Limit 1L */ 809 { 0x00000412, 0x0081 }, /* R1042 - DAC Volume Limit 1L */
814 { 0x00000413, 0x0001 }, /* R1043 - Noise Gate Select 1L */ 810 { 0x00000413, 0x0001 }, /* R1043 - Noise Gate Select 1L */
815 { 0x00000414, 0x0080 }, /* R1044 - Output Path Config 1R */ 811 { 0x00000414, 0x0080 }, /* R1044 - Output Path Config 1R */
816 { 0x00000415, 0x0180 }, /* R1045 - DAC Digital Volume 1R */ 812 { 0x00000415, 0x0180 }, /* R1045 - DAC Digital Volume 1R */
817 { 0x00000416, 0x0080 }, /* R1046 - DAC Volume Limit 1R */ 813 { 0x00000416, 0x0081 }, /* R1046 - DAC Volume Limit 1R */
818 { 0x00000417, 0x0002 }, /* R1047 - Noise Gate Select 1R */ 814 { 0x00000417, 0x0002 }, /* R1047 - Noise Gate Select 1R */
819 { 0x00000418, 0x0080 }, /* R1048 - Output Path Config 2L */ 815 { 0x00000418, 0x0080 }, /* R1048 - Output Path Config 2L */
820 { 0x00000419, 0x0180 }, /* R1049 - DAC Digital Volume 2L */ 816 { 0x00000419, 0x0180 }, /* R1049 - DAC Digital Volume 2L */
821 { 0x0000041A, 0x0080 }, /* R1050 - DAC Volume Limit 2L */ 817 { 0x0000041A, 0x0081 }, /* R1050 - DAC Volume Limit 2L */
822 { 0x0000041B, 0x0004 }, /* R1051 - Noise Gate Select 2L */ 818 { 0x0000041B, 0x0004 }, /* R1051 - Noise Gate Select 2L */
823 { 0x0000041C, 0x0080 }, /* R1052 - Output Path Config 2R */ 819 { 0x0000041C, 0x0080 }, /* R1052 - Output Path Config 2R */
824 { 0x0000041D, 0x0180 }, /* R1053 - DAC Digital Volume 2R */ 820 { 0x0000041D, 0x0180 }, /* R1053 - DAC Digital Volume 2R */
825 { 0x0000041E, 0x0080 }, /* R1054 - DAC Volume Limit 2R */ 821 { 0x0000041E, 0x0081 }, /* R1054 - DAC Volume Limit 2R */
826 { 0x0000041F, 0x0008 }, /* R1055 - Noise Gate Select 2R */ 822 { 0x0000041F, 0x0008 }, /* R1055 - Noise Gate Select 2R */
827 { 0x00000420, 0x0080 }, /* R1056 - Output Path Config 3L */ 823 { 0x00000420, 0x0080 }, /* R1056 - Output Path Config 3L */
828 { 0x00000421, 0x0180 }, /* R1057 - DAC Digital Volume 3L */ 824 { 0x00000421, 0x0180 }, /* R1057 - DAC Digital Volume 3L */
829 { 0x00000422, 0x0080 }, /* R1058 - DAC Volume Limit 3L */ 825 { 0x00000422, 0x0081 }, /* R1058 - DAC Volume Limit 3L */
830 { 0x00000423, 0x0010 }, /* R1059 - Noise Gate Select 3L */ 826 { 0x00000423, 0x0010 }, /* R1059 - Noise Gate Select 3L */
831 { 0x00000424, 0x0080 }, /* R1060 - Output Path Config 3R */ 827 { 0x00000424, 0x0080 }, /* R1060 - Output Path Config 3R */
832 { 0x00000425, 0x0180 }, /* R1061 - DAC Digital Volume 3R */ 828 { 0x00000425, 0x0180 }, /* R1061 - DAC Digital Volume 3R */
833 { 0x00000426, 0x0080 }, /* R1062 - DAC Volume Limit 3R */ 829 { 0x00000426, 0x0081 }, /* R1062 - DAC Volume Limit 3R */
834 { 0x00000427, 0x0020 }, /* R1063 - Noise Gate Select 3R */ 830 { 0x00000427, 0x0020 }, /* R1063 - Noise Gate Select 3R */
835 { 0x00000428, 0x0000 }, /* R1064 - Output Path Config 4L */ 831 { 0x00000428, 0x0000 }, /* R1064 - Output Path Config 4L */
836 { 0x00000429, 0x0180 }, /* R1065 - DAC Digital Volume 4L */ 832 { 0x00000429, 0x0180 }, /* R1065 - DAC Digital Volume 4L */
837 { 0x0000042A, 0x0080 }, /* R1066 - Out Volume 4L */ 833 { 0x0000042A, 0x0081 }, /* R1066 - Out Volume 4L */
838 { 0x0000042B, 0x0040 }, /* R1067 - Noise Gate Select 4L */ 834 { 0x0000042B, 0x0040 }, /* R1067 - Noise Gate Select 4L */
839 { 0x0000042C, 0x0000 }, /* R1068 - Output Path Config 4R */ 835 { 0x0000042C, 0x0000 }, /* R1068 - Output Path Config 4R */
840 { 0x0000042D, 0x0180 }, /* R1069 - DAC Digital Volume 4R */ 836 { 0x0000042D, 0x0180 }, /* R1069 - DAC Digital Volume 4R */
841 { 0x0000042E, 0x0080 }, /* R1070 - Out Volume 4R */ 837 { 0x0000042E, 0x0081 }, /* R1070 - Out Volume 4R */
842 { 0x0000042F, 0x0080 }, /* R1071 - Noise Gate Select 4R */ 838 { 0x0000042F, 0x0080 }, /* R1071 - Noise Gate Select 4R */
843 { 0x00000430, 0x0000 }, /* R1072 - Output Path Config 5L */ 839 { 0x00000430, 0x0000 }, /* R1072 - Output Path Config 5L */
844 { 0x00000431, 0x0180 }, /* R1073 - DAC Digital Volume 5L */ 840 { 0x00000431, 0x0180 }, /* R1073 - DAC Digital Volume 5L */
845 { 0x00000432, 0x0080 }, /* R1074 - DAC Volume Limit 5L */ 841 { 0x00000432, 0x0081 }, /* R1074 - DAC Volume Limit 5L */
846 { 0x00000433, 0x0100 }, /* R1075 - Noise Gate Select 5L */ 842 { 0x00000433, 0x0100 }, /* R1075 - Noise Gate Select 5L */
847 { 0x00000434, 0x0000 }, /* R1076 - Output Path Config 5R */ 843 { 0x00000434, 0x0000 }, /* R1076 - Output Path Config 5R */
848 { 0x00000435, 0x0180 }, /* R1077 - DAC Digital Volume 5R */ 844 { 0x00000435, 0x0180 }, /* R1077 - DAC Digital Volume 5R */
849 { 0x00000436, 0x0080 }, /* R1078 - DAC Volume Limit 5R */ 845 { 0x00000436, 0x0081 }, /* R1078 - DAC Volume Limit 5R */
850 { 0x00000437, 0x0200 }, /* R1079 - Noise Gate Select 5R */ 846 { 0x00000437, 0x0200 }, /* R1079 - Noise Gate Select 5R */
851 { 0x00000438, 0x0000 }, /* R1080 - Output Path Config 6L */ 847 { 0x00000438, 0x0000 }, /* R1080 - Output Path Config 6L */
852 { 0x00000439, 0x0180 }, /* R1081 - DAC Digital Volume 6L */ 848 { 0x00000439, 0x0180 }, /* R1081 - DAC Digital Volume 6L */
853 { 0x0000043A, 0x0080 }, /* R1082 - DAC Volume Limit 6L */ 849 { 0x0000043A, 0x0081 }, /* R1082 - DAC Volume Limit 6L */
854 { 0x0000043B, 0x0400 }, /* R1083 - Noise Gate Select 6L */ 850 { 0x0000043B, 0x0400 }, /* R1083 - Noise Gate Select 6L */
855 { 0x0000043C, 0x0000 }, /* R1084 - Output Path Config 6R */ 851 { 0x0000043C, 0x0000 }, /* R1084 - Output Path Config 6R */
856 { 0x0000043D, 0x0180 }, /* R1085 - DAC Digital Volume 6R */ 852 { 0x0000043D, 0x0180 }, /* R1085 - DAC Digital Volume 6R */
857 { 0x0000043E, 0x0080 }, /* R1086 - DAC Volume Limit 6R */ 853 { 0x0000043E, 0x0081 }, /* R1086 - DAC Volume Limit 6R */
858 { 0x0000043F, 0x0800 }, /* R1087 - Noise Gate Select 6R */ 854 { 0x0000043F, 0x0800 }, /* R1087 - Noise Gate Select 6R */
859 { 0x00000440, 0x8FFF }, /* R1088 - DRE Enable */ 855 { 0x00000440, 0x003F }, /* R1088 - DRE Enable */
860 { 0x00000450, 0x0000 }, /* R1104 - DAC AEC Control 1 */ 856 { 0x00000450, 0x0000 }, /* R1104 - DAC AEC Control 1 */
861 { 0x00000458, 0x0000 }, /* R1112 - Noise Gate Control */ 857 { 0x00000458, 0x0000 }, /* R1112 - Noise Gate Control */
862 { 0x00000490, 0x0069 }, /* R1168 - PDM SPK1 CTRL 1 */ 858 { 0x00000490, 0x0069 }, /* R1168 - PDM SPK1 CTRL 1 */
@@ -864,8 +860,8 @@ static const struct reg_default wm5110_reg_default[] = {
864 { 0x00000492, 0x0069 }, /* R1170 - PDM SPK2 CTRL 1 */ 860 { 0x00000492, 0x0069 }, /* R1170 - PDM SPK2 CTRL 1 */
865 { 0x00000493, 0x0000 }, /* R1171 - PDM SPK2 CTRL 2 */ 861 { 0x00000493, 0x0000 }, /* R1171 - PDM SPK2 CTRL 2 */
866 { 0x000004A0, 0x3480 }, /* R1184 - HP1 Short Circuit Ctrl */ 862 { 0x000004A0, 0x3480 }, /* R1184 - HP1 Short Circuit Ctrl */
867 { 0x000004A1, 0x3480 }, /* R1185 - HP2 Short Circuit Ctrl */ 863 { 0x000004A1, 0x3400 }, /* R1185 - HP2 Short Circuit Ctrl */
868 { 0x000004A2, 0x3480 }, /* R1186 - HP3 Short Circuit Ctrl */ 864 { 0x000004A2, 0x3400 }, /* R1186 - HP3 Short Circuit Ctrl */
869 { 0x00000500, 0x000C }, /* R1280 - AIF1 BCLK Ctrl */ 865 { 0x00000500, 0x000C }, /* R1280 - AIF1 BCLK Ctrl */
870 { 0x00000501, 0x0008 }, /* R1281 - AIF1 Tx Pin Ctrl */ 866 { 0x00000501, 0x0008 }, /* R1281 - AIF1 Tx Pin Ctrl */
871 { 0x00000502, 0x0000 }, /* R1282 - AIF1 Rx Pin Ctrl */ 867 { 0x00000502, 0x0000 }, /* R1282 - AIF1 Rx Pin Ctrl */
@@ -1483,23 +1479,23 @@ static const struct reg_default wm5110_reg_default[] = {
1483 { 0x00000C10, 0x1000 }, /* R3088 - GPIO Debounce Config */ 1479 { 0x00000C10, 0x1000 }, /* R3088 - GPIO Debounce Config */
1484 { 0x00000C18, 0x0000 }, /* R3096 - GP Switch 1 */ 1480 { 0x00000C18, 0x0000 }, /* R3096 - GP Switch 1 */
1485 { 0x00000C20, 0x8002 }, /* R3104 - Misc Pad Ctrl 1 */ 1481 { 0x00000C20, 0x8002 }, /* R3104 - Misc Pad Ctrl 1 */
1486 { 0x00000C21, 0x8001 }, /* R3105 - Misc Pad Ctrl 2 */ 1482 { 0x00000C21, 0x0001 }, /* R3105 - Misc Pad Ctrl 2 */
1487 { 0x00000C22, 0x0000 }, /* R3106 - Misc Pad Ctrl 3 */ 1483 { 0x00000C22, 0x0000 }, /* R3106 - Misc Pad Ctrl 3 */
1488 { 0x00000C23, 0x0000 }, /* R3107 - Misc Pad Ctrl 4 */ 1484 { 0x00000C23, 0x0000 }, /* R3107 - Misc Pad Ctrl 4 */
1489 { 0x00000C24, 0x0000 }, /* R3108 - Misc Pad Ctrl 5 */ 1485 { 0x00000C24, 0x0000 }, /* R3108 - Misc Pad Ctrl 5 */
1490 { 0x00000C25, 0x0000 }, /* R3109 - Misc Pad Ctrl 6 */ 1486 { 0x00000C25, 0x0000 }, /* R3109 - Misc Pad Ctrl 6 */
1491 { 0x00000C30, 0x8282 }, /* R3120 - Misc Pad Ctrl 7 */ 1487 { 0x00000C30, 0x0404 }, /* R3120 - Misc Pad Ctrl 7 */
1492 { 0x00000C31, 0x0082 }, /* R3121 - Misc Pad Ctrl 8 */ 1488 { 0x00000C31, 0x0004 }, /* R3121 - Misc Pad Ctrl 8 */
1493 { 0x00000C32, 0x8282 }, /* R3122 - Misc Pad Ctrl 9 */ 1489 { 0x00000C32, 0x0404 }, /* R3122 - Misc Pad Ctrl 9 */
1494 { 0x00000C33, 0x8282 }, /* R3123 - Misc Pad Ctrl 10 */ 1490 { 0x00000C33, 0x0404 }, /* R3123 - Misc Pad Ctrl 10 */
1495 { 0x00000C34, 0x8282 }, /* R3124 - Misc Pad Ctrl 11 */ 1491 { 0x00000C34, 0x0404 }, /* R3124 - Misc Pad Ctrl 11 */
1496 { 0x00000C35, 0x8282 }, /* R3125 - Misc Pad Ctrl 12 */ 1492 { 0x00000C35, 0x0404 }, /* R3125 - Misc Pad Ctrl 12 */
1497 { 0x00000C36, 0x8282 }, /* R3126 - Misc Pad Ctrl 13 */ 1493 { 0x00000C36, 0x0404 }, /* R3126 - Misc Pad Ctrl 13 */
1498 { 0x00000C37, 0x8282 }, /* R3127 - Misc Pad Ctrl 14 */ 1494 { 0x00000C37, 0x0404 }, /* R3127 - Misc Pad Ctrl 14 */
1499 { 0x00000C38, 0x8282 }, /* R3128 - Misc Pad Ctrl 15 */ 1495 { 0x00000C38, 0x0004 }, /* R3128 - Misc Pad Ctrl 15 */
1500 { 0x00000C39, 0x8282 }, /* R3129 - Misc Pad Ctrl 16 */ 1496 { 0x00000C39, 0x0404 }, /* R3129 - Misc Pad Ctrl 16 */
1501 { 0x00000C3A, 0x8282 }, /* R3130 - Misc Pad Ctrl 17 */ 1497 { 0x00000C3A, 0x0404 }, /* R3130 - Misc Pad Ctrl 17 */
1502 { 0x00000C3B, 0x8282 }, /* R3131 - Misc Pad Ctrl 18 */ 1498 { 0x00000C3B, 0x0404 }, /* R3131 - Misc Pad Ctrl 18 */
1503 { 0x00000D08, 0xFFFF }, /* R3336 - Interrupt Status 1 Mask */ 1499 { 0x00000D08, 0xFFFF }, /* R3336 - Interrupt Status 1 Mask */
1504 { 0x00000D09, 0xFFFF }, /* R3337 - Interrupt Status 2 Mask */ 1500 { 0x00000D09, 0xFFFF }, /* R3337 - Interrupt Status 2 Mask */
1505 { 0x00000D0A, 0xFFFF }, /* R3338 - Interrupt Status 3 Mask */ 1501 { 0x00000D0A, 0xFFFF }, /* R3338 - Interrupt Status 3 Mask */
@@ -1641,7 +1637,7 @@ static const struct reg_default wm5110_reg_default[] = {
1641 { 0x00000F0D, 0x0000 }, /* R3853 - ANC Coefficient */ 1637 { 0x00000F0D, 0x0000 }, /* R3853 - ANC Coefficient */
1642 { 0x00000F0E, 0x0000 }, /* R3854 - ANC Coefficient */ 1638 { 0x00000F0E, 0x0000 }, /* R3854 - ANC Coefficient */
1643 { 0x00000F0F, 0x0000 }, /* R3855 - ANC Coefficient */ 1639 { 0x00000F0F, 0x0000 }, /* R3855 - ANC Coefficient */
1644 { 0x00000F10, 0x0000 }, /* R3856 - ANC Coefficient */ 1640 { 0x00000F10, 0x0001 }, /* R3856 - ANC Coefficient */
1645 { 0x00000F11, 0x0000 }, /* R3857 - ANC Coefficient */ 1641 { 0x00000F11, 0x0000 }, /* R3857 - ANC Coefficient */
1646 { 0x00000F12, 0x0000 }, /* R3858 - ANC Coefficient */ 1642 { 0x00000F12, 0x0000 }, /* R3858 - ANC Coefficient */
1647 { 0x00000F15, 0x0000 }, /* R3861 - FCL Filter Control */ 1643 { 0x00000F15, 0x0000 }, /* R3861 - FCL Filter Control */
@@ -1947,8 +1943,6 @@ static bool wm5110_readable_register(struct device *dev, unsigned int reg)
1947 case ARIZONA_FLL1_CONTROL_5: 1943 case ARIZONA_FLL1_CONTROL_5:
1948 case ARIZONA_FLL1_CONTROL_6: 1944 case ARIZONA_FLL1_CONTROL_6:
1949 case ARIZONA_FLL1_CONTROL_7: 1945 case ARIZONA_FLL1_CONTROL_7:
1950 case ARIZONA_FLL1_LOOP_FILTER_TEST_1:
1951 case ARIZONA_FLL1_NCO_TEST_0:
1952 case ARIZONA_FLL1_SYNCHRONISER_1: 1946 case ARIZONA_FLL1_SYNCHRONISER_1:
1953 case ARIZONA_FLL1_SYNCHRONISER_2: 1947 case ARIZONA_FLL1_SYNCHRONISER_2:
1954 case ARIZONA_FLL1_SYNCHRONISER_3: 1948 case ARIZONA_FLL1_SYNCHRONISER_3:
@@ -1965,8 +1959,6 @@ static bool wm5110_readable_register(struct device *dev, unsigned int reg)
1965 case ARIZONA_FLL2_CONTROL_5: 1959 case ARIZONA_FLL2_CONTROL_5:
1966 case ARIZONA_FLL2_CONTROL_6: 1960 case ARIZONA_FLL2_CONTROL_6:
1967 case ARIZONA_FLL2_CONTROL_7: 1961 case ARIZONA_FLL2_CONTROL_7:
1968 case ARIZONA_FLL2_LOOP_FILTER_TEST_1:
1969 case ARIZONA_FLL2_NCO_TEST_0:
1970 case ARIZONA_FLL2_SYNCHRONISER_1: 1962 case ARIZONA_FLL2_SYNCHRONISER_1:
1971 case ARIZONA_FLL2_SYNCHRONISER_2: 1963 case ARIZONA_FLL2_SYNCHRONISER_2:
1972 case ARIZONA_FLL2_SYNCHRONISER_3: 1964 case ARIZONA_FLL2_SYNCHRONISER_3:
diff --git a/drivers/mfd/wm8998-tables.c b/drivers/mfd/wm8998-tables.c
index 4c2dce77cdfc..a0de3002cdad 100644
--- a/drivers/mfd/wm8998-tables.c
+++ b/drivers/mfd/wm8998-tables.c
@@ -229,8 +229,6 @@ static const struct reg_default wm8998_reg_default[] = {
229 { 0x00000174, 0x007D }, /* R372 - FLL1 Control 4 */ 229 { 0x00000174, 0x007D }, /* R372 - FLL1 Control 4 */
230 { 0x00000175, 0x0004 }, /* R373 - FLL1 Control 5 */ 230 { 0x00000175, 0x0004 }, /* R373 - FLL1 Control 5 */
231 { 0x00000176, 0x0000 }, /* R374 - FLL1 Control 6 */ 231 { 0x00000176, 0x0000 }, /* R374 - FLL1 Control 6 */
232 { 0x00000177, 0x0181 }, /* R375 - FLL1 Loop Filter Test 1 */
233 { 0x00000178, 0x0000 }, /* R376 - FLL1 NCO Test 0 */
234 { 0x00000179, 0x0000 }, /* R377 - FLL1 Control 7 */ 232 { 0x00000179, 0x0000 }, /* R377 - FLL1 Control 7 */
235 { 0x00000181, 0x0000 }, /* R385 - FLL1 Synchroniser 1 */ 233 { 0x00000181, 0x0000 }, /* R385 - FLL1 Synchroniser 1 */
236 { 0x00000182, 0x0000 }, /* R386 - FLL1 Synchroniser 2 */ 234 { 0x00000182, 0x0000 }, /* R386 - FLL1 Synchroniser 2 */
@@ -247,8 +245,6 @@ static const struct reg_default wm8998_reg_default[] = {
247 { 0x00000194, 0x007D }, /* R404 - FLL2 Control 4 */ 245 { 0x00000194, 0x007D }, /* R404 - FLL2 Control 4 */
248 { 0x00000195, 0x0004 }, /* R405 - FLL2 Control 5 */ 246 { 0x00000195, 0x0004 }, /* R405 - FLL2 Control 5 */
249 { 0x00000196, 0x0000 }, /* R406 - FLL2 Control 6 */ 247 { 0x00000196, 0x0000 }, /* R406 - FLL2 Control 6 */
250 { 0x00000197, 0x0000 }, /* R407 - FLL2 Loop Filter Test 1 */
251 { 0x00000198, 0x0000 }, /* R408 - FLL2 NCO Test 0 */
252 { 0x00000199, 0x0000 }, /* R409 - FLL2 Control 7 */ 248 { 0x00000199, 0x0000 }, /* R409 - FLL2 Control 7 */
253 { 0x000001A1, 0x0000 }, /* R417 - FLL2 Synchroniser 1 */ 249 { 0x000001A1, 0x0000 }, /* R417 - FLL2 Synchroniser 1 */
254 { 0x000001A2, 0x0000 }, /* R418 - FLL2 Synchroniser 2 */ 250 { 0x000001A2, 0x0000 }, /* R418 - FLL2 Synchroniser 2 */
@@ -320,7 +316,7 @@ static const struct reg_default wm8998_reg_default[] = {
320 { 0x00000434, 0x0000 }, /* R1076 - Output Path Config 5R */ 316 { 0x00000434, 0x0000 }, /* R1076 - Output Path Config 5R */
321 { 0x00000435, 0x0180 }, /* R1077 - DAC Digital Volume 5R */ 317 { 0x00000435, 0x0180 }, /* R1077 - DAC Digital Volume 5R */
322 { 0x00000437, 0x0200 }, /* R1079 - Noise Gate Select 5R */ 318 { 0x00000437, 0x0200 }, /* R1079 - Noise Gate Select 5R */
323 { 0x00000440, 0x8FFF }, /* R1088 - DRE Enable */ 319 { 0x00000440, 0x002F }, /* R1088 - DRE Enable */
324 { 0x00000441, 0xC759 }, /* R1089 - DRE Control 1 */ 320 { 0x00000441, 0xC759 }, /* R1089 - DRE Control 1 */
325 { 0x00000442, 0x2A08 }, /* R1089 - DRE Control 2 */ 321 { 0x00000442, 0x2A08 }, /* R1089 - DRE Control 2 */
326 { 0x00000443, 0x5CFA }, /* R1089 - DRE Control 3 */ 322 { 0x00000443, 0x5CFA }, /* R1089 - DRE Control 3 */
@@ -686,7 +682,7 @@ static const struct reg_default wm8998_reg_default[] = {
686 { 0x00000C10, 0x1000 }, /* R3088 - GPIO Debounce Config */ 682 { 0x00000C10, 0x1000 }, /* R3088 - GPIO Debounce Config */
687 { 0x00000C18, 0x0000 }, /* R3096 - GP Switch 1 */ 683 { 0x00000C18, 0x0000 }, /* R3096 - GP Switch 1 */
688 { 0x00000C20, 0x8002 }, /* R3104 - Misc Pad Ctrl 1 */ 684 { 0x00000C20, 0x8002 }, /* R3104 - Misc Pad Ctrl 1 */
689 { 0x00000C21, 0x8001 }, /* R3105 - Misc Pad Ctrl 2 */ 685 { 0x00000C21, 0x0001 }, /* R3105 - Misc Pad Ctrl 2 */
690 { 0x00000C22, 0x0000 }, /* R3106 - Misc Pad Ctrl 3 */ 686 { 0x00000C22, 0x0000 }, /* R3106 - Misc Pad Ctrl 3 */
691 { 0x00000C23, 0x0000 }, /* R3107 - Misc Pad Ctrl 4 */ 687 { 0x00000C23, 0x0000 }, /* R3107 - Misc Pad Ctrl 4 */
692 { 0x00000C24, 0x0000 }, /* R3108 - Misc Pad Ctrl 5 */ 688 { 0x00000C24, 0x0000 }, /* R3108 - Misc Pad Ctrl 5 */
@@ -888,8 +884,6 @@ static bool wm8998_readable_register(struct device *dev, unsigned int reg)
888 case ARIZONA_FLL1_CONTROL_5: 884 case ARIZONA_FLL1_CONTROL_5:
889 case ARIZONA_FLL1_CONTROL_6: 885 case ARIZONA_FLL1_CONTROL_6:
890 case ARIZONA_FLL1_CONTROL_7: 886 case ARIZONA_FLL1_CONTROL_7:
891 case ARIZONA_FLL1_LOOP_FILTER_TEST_1:
892 case ARIZONA_FLL1_NCO_TEST_0:
893 case ARIZONA_FLL1_SYNCHRONISER_1: 887 case ARIZONA_FLL1_SYNCHRONISER_1:
894 case ARIZONA_FLL1_SYNCHRONISER_2: 888 case ARIZONA_FLL1_SYNCHRONISER_2:
895 case ARIZONA_FLL1_SYNCHRONISER_3: 889 case ARIZONA_FLL1_SYNCHRONISER_3:
@@ -906,8 +900,6 @@ static bool wm8998_readable_register(struct device *dev, unsigned int reg)
906 case ARIZONA_FLL2_CONTROL_5: 900 case ARIZONA_FLL2_CONTROL_5:
907 case ARIZONA_FLL2_CONTROL_6: 901 case ARIZONA_FLL2_CONTROL_6:
908 case ARIZONA_FLL2_CONTROL_7: 902 case ARIZONA_FLL2_CONTROL_7:
909 case ARIZONA_FLL2_LOOP_FILTER_TEST_1:
910 case ARIZONA_FLL2_NCO_TEST_0:
911 case ARIZONA_FLL2_SYNCHRONISER_1: 903 case ARIZONA_FLL2_SYNCHRONISER_1:
912 case ARIZONA_FLL2_SYNCHRONISER_2: 904 case ARIZONA_FLL2_SYNCHRONISER_2:
913 case ARIZONA_FLL2_SYNCHRONISER_3: 905 case ARIZONA_FLL2_SYNCHRONISER_3: