aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-01-14 13:53:15 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-14 13:53:15 -0500
commitcf8d7e3850ee44dc2f0a69405d731af62528a948 (patch)
treee36f0dc08b60cf063dda46a258ee841aeb0e54ce
parent5c43019f25977fb6119dff471d592321ed0d2333 (diff)
parent9fb41166076b197318807a5f1829911450b43218 (diff)
Merge tag 'mfd-for-linus-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd
Pull MFD updates from Lee Jones: "New Device Support: - Add support for s2mps15; sec-core - Add support for Lewisburg; lpc_ich - Add support for cs47l24 and wm1831; arizona New Functionality: - Allow user to select syscon register width; syscon Fix-ups: - Lots of Checkpatch fixes - Rename -pmic/-regulator; s2mps11 - Build driver components into a single module; wm8994-* - Better handing of IRQ during suspend/resume; as3722 - Constify things; da903x - Remove unused code; ab8500-core - Improve error handing; qcom_rpm - Simplify code: wm831x-otp, sta2x11-mfd - Improve locking; cros_ec_spi - Fix incorrect DT binding filename reference; arizona, palmas, snps-dwapb-gpio, wm8994 Bug Fixes: - Fix broken SYSFS 'show ID' call; wm831x-otp - Protect reads from non-existent registers; qcom-spmi-pmic - Repair build warnings; as3722 - Fix IRQ request ordering; arizona-irq - Ensure return value is boolean; ucb1x00-core, tps65010, tc6393xb, htc-egpio, dm355evm_msp, asic3" * tag 'mfd-for-linus-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (58 commits) mfd: davinci_voicecodec: Remove pointless 'out of memory' error message mfd: da9052-irq: Fix trivial 'space before comma' error mfd: da9052-i2c: Fix tabbing/whitespace issue mfd: da903x: Fix white space and split string issues mfd: cs5535-mfd: Add missing line spacing and make local array static mfd: cros_ec_spi: Repair comparison ordering issue mfd: cros_ec_i2c: Fix trivial 'tabs before spaces' whitespace issue. mfd: asic3: Fix a plethora of Checkpatch errors and warnings mfd: as3711: Repair OOM and 'line over 80 chars' formatting warnings mfd: arizona-i2c: Add blank line formatting after declaration mfd: arizona-core: msleep() is unreliable for anything <20ms use usleep_range() instead mfd: adp5520: Some trivial 'no space before tab' fixes mfd: ab8500-sysctrl: Fix Constify, printk => pr_info and formatting issues mfd: ab8500-gpadc: Squash a whole bunch of Checkpatch warnings and one error mfd: ab8500-debugfs: Clean-up non-conforming commenting and print formatting mfd: ab8500-core: Fix many warnings reported by Checkpatch mfd: ab2100-otp: Remove pointless 'out of memory' error message mfd: ab3100-core.c: Fix multiple warnings reported by Checkpatch mfd: aat2870-core: Remove unnecessary 'out of memory' message mfd: 88pm860x-core: Fix commenting and declaration spacing ...
-rw-r--r--Documentation/devicetree/bindings/clock/samsung,s2mps11.txt49
-rw-r--r--Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt2
-rw-r--r--Documentation/devicetree/bindings/mfd/arizona.txt24
-rw-r--r--Documentation/devicetree/bindings/mfd/palmas.txt2
-rw-r--r--Documentation/devicetree/bindings/mfd/s2mpa01.txt90
-rw-r--r--Documentation/devicetree/bindings/mfd/s2mps11.txt153
-rw-r--r--Documentation/devicetree/bindings/mfd/samsung,sec-core.txt88
-rw-r--r--Documentation/devicetree/bindings/mfd/syscon.txt4
-rw-r--r--Documentation/devicetree/bindings/regulator/s5m8767-regulator.txt163
-rw-r--r--Documentation/devicetree/bindings/regulator/samsung,s2mpa01.txt79
-rw-r--r--Documentation/devicetree/bindings/regulator/samsung,s2mps11.txt102
-rw-r--r--Documentation/devicetree/bindings/regulator/samsung,s5m8767.txt145
-rw-r--r--Documentation/devicetree/bindings/sound/wm8994.txt2
-rw-r--r--MAINTAINERS8
-rw-r--r--drivers/gpio/gpio-arizona.c4
-rw-r--r--drivers/mfd/88pm80x.c4
-rw-r--r--drivers/mfd/88pm860x-core.c13
-rw-r--r--drivers/mfd/Kconfig20
-rw-r--r--drivers/mfd/Makefile6
-rw-r--r--drivers/mfd/aat2870-core.c5
-rw-r--r--drivers/mfd/ab3100-core.c23
-rw-r--r--drivers/mfd/ab3100-otp.c5
-rw-r--r--drivers/mfd/ab8500-core.c506
-rw-r--r--drivers/mfd/ab8500-debugfs.c25
-rw-r--r--drivers/mfd/ab8500-gpadc.c145
-rw-r--r--drivers/mfd/ab8500-sysctrl.c13
-rw-r--r--drivers/mfd/adp5520.c6
-rw-r--r--drivers/mfd/arizona-core.c92
-rw-r--r--drivers/mfd/arizona-i2c.c2
-rw-r--r--drivers/mfd/arizona-irq.c95
-rw-r--r--drivers/mfd/arizona-spi.c7
-rw-r--r--drivers/mfd/arizona.h4
-rw-r--r--drivers/mfd/as3711.c28
-rw-r--r--drivers/mfd/as3722.c30
-rw-r--r--drivers/mfd/asic3.c30
-rw-r--r--drivers/mfd/cros_ec_i2c.c2
-rw-r--r--drivers/mfd/cros_ec_spi.c34
-rw-r--r--drivers/mfd/cs47l24-tables.c1629
-rw-r--r--drivers/mfd/cs5535-mfd.c6
-rw-r--r--drivers/mfd/da903x.c14
-rw-r--r--drivers/mfd/da9052-i2c.c2
-rw-r--r--drivers/mfd/da9052-irq.c2
-rw-r--r--drivers/mfd/davinci_voicecodec.c5
-rw-r--r--drivers/mfd/dm355evm_msp.c2
-rw-r--r--drivers/mfd/htc-egpio.c2
-rw-r--r--drivers/mfd/lpc_ich.c15
-rw-r--r--drivers/mfd/max14577.c4
-rw-r--r--drivers/mfd/max77686.c4
-rw-r--r--drivers/mfd/max77693.c4
-rw-r--r--drivers/mfd/max77843.c4
-rw-r--r--drivers/mfd/max8925-i2c.c4
-rw-r--r--drivers/mfd/max8997.c8
-rw-r--r--drivers/mfd/max8998.c8
-rw-r--r--drivers/mfd/mc13xxx-core.c8
-rw-r--r--drivers/mfd/qcom-spmi-pmic.c4
-rw-r--r--drivers/mfd/qcom_rpm.c2
-rw-r--r--drivers/mfd/sec-core.c43
-rw-r--r--drivers/mfd/sec-irq.c8
-rw-r--r--drivers/mfd/sta2x11-mfd.c36
-rw-r--r--drivers/mfd/syscon.c13
-rw-r--r--drivers/mfd/tc6393xb.c4
-rw-r--r--drivers/mfd/tps65010.c4
-rw-r--r--drivers/mfd/ucb1x00-core.c2
-rw-r--r--drivers/mfd/wm5110-tables.c6
-rw-r--r--drivers/mfd/wm831x-otp.c10
-rw-r--r--drivers/regulator/Kconfig4
-rw-r--r--drivers/regulator/s2mps11.c143
-rw-r--r--drivers/rtc/rtc-s5m.c37
-rw-r--r--include/linux/mfd/arizona/core.h3
-rw-r--r--include/linux/mfd/arizona/pdata.h2
-rw-r--r--include/linux/mfd/samsung/core.h1
-rw-r--r--include/linux/mfd/samsung/rtc.h2
-rw-r--r--include/linux/mfd/samsung/s2mps15.h158
73 files changed, 2983 insertions, 1230 deletions
diff --git a/Documentation/devicetree/bindings/clock/samsung,s2mps11.txt b/Documentation/devicetree/bindings/clock/samsung,s2mps11.txt
new file mode 100644
index 000000000000..2726c1d58a79
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/samsung,s2mps11.txt
@@ -0,0 +1,49 @@
1Binding for Samsung S2M and S5M family clock generator block
2============================================================
3
4This is a part of device tree bindings for S2M and S5M family multi-function
5devices.
6More information can be found in bindings/mfd/sec-core.txt file.
7
8The S2MPS11/13/15 and S5M8767 provide three(AP/CP/BT) buffered 32.768 kHz
9outputs. The S2MPS14 provides two (AP/BT) buffered 32.768 KHz outputs.
10
11To register these as clocks with common clock framework instantiate under
12main device node a sub-node named "clocks".
13
14It uses the common clock binding documented in:
15 - Documentation/devicetree/bindings/clock/clock-bindings.txt
16
17
18Required properties of the "clocks" sub-node:
19 - #clock-cells: should be 1.
20 - compatible: Should be one of: "samsung,s2mps11-clk", "samsung,s2mps13-clk",
21 "samsung,s2mps14-clk", "samsung,s5m8767-clk"
22 The S2MPS15 uses the same compatible as S2MPS13, as both provides similar
23 clocks.
24
25
26Each clock is assigned an identifier and client nodes use this identifier
27to specify the clock which they consume.
28 Clock ID Devices
29 ----------------------------------------------------------
30 32KhzAP 0 S2MPS11/13/14/15, S5M8767
31 32KhzCP 1 S2MPS11/13/15, S5M8767
32 32KhzBT 2 S2MPS11/13/14/15, S5M8767
33
34Include dt-bindings/clock/samsung,s2mps11.h file to use preprocessor defines
35in device tree sources.
36
37
38Example:
39
40 s2mps11_pmic@66 {
41 compatible = "samsung,s2mps11-pmic";
42 reg = <0x66>;
43
44 s2m_osc: clocks {
45 compatible = "samsung,s2mps11-clk";
46 #clock-cells = <1>;
47 clock-output-names = "xx", "yy", "zz";
48 };
49 };
diff --git a/Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt b/Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt
index dd5d2c0394b1..4d6c8cdc8586 100644
--- a/Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt
+++ b/Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt
@@ -24,7 +24,7 @@ controller.
24- #interrupt-cells : Specifies the number of cells needed to encode an 24- #interrupt-cells : Specifies the number of cells needed to encode an
25 interrupt. Shall be set to 2. The first cell defines the interrupt number, 25 interrupt. Shall be set to 2. The first cell defines the interrupt number,
26 the second encodes the triger flags encoded as described in 26 the second encodes the triger flags encoded as described in
27 Documentation/devicetree/bindings/interrupts.txt 27 Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
28- interrupt-parent : The parent interrupt controller. 28- interrupt-parent : The parent interrupt controller.
29- interrupts : The interrupt to the parent controller raised when GPIOs 29- interrupts : The interrupt to the parent controller raised when GPIOs
30 generate the interrupts. 30 generate the interrupts.
diff --git a/Documentation/devicetree/bindings/mfd/arizona.txt b/Documentation/devicetree/bindings/mfd/arizona.txt
index 18be0cbfb456..9b30011ecabe 100644
--- a/Documentation/devicetree/bindings/mfd/arizona.txt
+++ b/Documentation/devicetree/bindings/mfd/arizona.txt
@@ -1,4 +1,4 @@
1Wolfson Arizona class audio SoCs 1Cirrus Logic/Wolfson Microelectronics Arizona class audio SoCs
2 2
3These devices are audio SoCs with extensive digital capabilites and a range 3These devices are audio SoCs with extensive digital capabilites and a range
4of analogue I/O. 4of analogue I/O.
@@ -6,12 +6,14 @@ of analogue I/O.
6Required properties: 6Required properties:
7 7
8 - compatible : One of the following chip-specific strings: 8 - compatible : One of the following chip-specific strings:
9 "cirrus,cs47l24"
9 "wlf,wm5102" 10 "wlf,wm5102"
10 "wlf,wm5110" 11 "wlf,wm5110"
11 "wlf,wm8280" 12 "wlf,wm8280"
12 "wlf,wm8997" 13 "wlf,wm8997"
13 "wlf,wm8998" 14 "wlf,wm8998"
14 "wlf,wm1814" 15 "wlf,wm1814"
16 "wlf,wm1831"
15 17
16 - reg : I2C slave address when connected using I2C, chip select number when 18 - reg : I2C slave address when connected using I2C, chip select number when
17 using SPI. 19 using SPI.
@@ -24,7 +26,7 @@ Required properties:
24 - #interrupt-cells: the number of cells to describe an IRQ, this should be 2. 26 - #interrupt-cells: the number of cells to describe an IRQ, this should be 2.
25 The first cell is the IRQ number. 27 The first cell is the IRQ number.
26 The second cell is the flags, encoded as the trigger masks from 28 The second cell is the flags, encoded as the trigger masks from
27 Documentation/devicetree/bindings/interrupts.txt 29 Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
28 30
29 - gpio-controller : Indicates this device is a GPIO controller. 31 - gpio-controller : Indicates this device is a GPIO controller.
30 - #gpio-cells : Must be 2. The first cell is the pin number and the 32 - #gpio-cells : Must be 2. The first cell is the pin number and the
@@ -41,10 +43,21 @@ Required properties:
41 43
42 - SPKVDD-supply : Speaker driver power supply (wm8997) 44 - SPKVDD-supply : Speaker driver power supply (wm8997)
43 45
46 - DCVDD-supply : Main power supply (cs47l24, wm1831)
47
48 - MICVDD-supply : Microphone power supply (cs47l24, wm1831)
49
44Optional properties: 50Optional properties:
45 51
46 - wlf,reset : GPIO specifier for the GPIO controlling /RESET 52 - wlf,reset : GPIO specifier for the GPIO controlling /RESET
47 53
54 - clocks: Should reference the clocks supplied on MCLK1 and MCLK2
55 - clock-names: Should contains two strings:
56 "mclk1" for the clock supplied on MCLK1, recommended to be a high
57 quality audio reference clock
58 "mclk2" for the clock supplied on MCLK2, recommended to be an always on
59 32k clock
60
48 - wlf,gpio-defaults : A list of GPIO configuration register values. Defines 61 - wlf,gpio-defaults : A list of GPIO configuration register values. Defines
49 for the appropriate values can found in <dt-bindings/mfd/arizona.txt>. If 62 for the appropriate values can found in <dt-bindings/mfd/arizona.txt>. If
50 absent, no configuration of these registers is performed. If any entry has 63 absent, no configuration of these registers is performed. If any entry has
@@ -59,6 +72,12 @@ Optional properties:
59 that have not been specified are set to 0 by default. Entries are: 72 that have not been specified are set to 0 by default. Entries are:
60 <IN1, IN2, IN3, IN4> (wm5102, wm5110, wm8280, wm8997) 73 <IN1, IN2, IN3, IN4> (wm5102, wm5110, wm8280, wm8997)
61 <IN1A, IN2A, IN1B, IN2B> (wm8998, wm1814) 74 <IN1A, IN2A, IN1B, IN2B> (wm8998, wm1814)
75 - wlf,out-mono : A list of boolean values indicating whether each output is
76 mono or stereo. Position within the list indicates the output affected
77 (eg. First entry in the list corresponds to output 1). A non-zero value
78 indicates a mono output. If present, the number of values should be less
79 than or equal to the number of outputs, if less values are supplied the
80 additional outputs will be treated as stereo.
62 81
63 - wlf,dmic-ref : DMIC reference voltage source for each input, can be 82 - wlf,dmic-ref : DMIC reference voltage source for each input, can be
64 selected from either MICVDD or one of the MICBIAS's, defines 83 selected from either MICVDD or one of the MICBIAS's, defines
@@ -69,6 +88,7 @@ Optional properties:
69 - DCVDD-supply, MICVDD-supply : Power supplies, only need to be specified if 88 - DCVDD-supply, MICVDD-supply : Power supplies, only need to be specified if
70 they are being externally supplied. As covered in 89 they are being externally supplied. As covered in
71 Documentation/devicetree/bindings/regulator/regulator.txt 90 Documentation/devicetree/bindings/regulator/regulator.txt
91 (wm5102, wm5110, wm8280, wm8997, wm8998, wm1814)
72 92
73Also see child specific device properties: 93Also see child specific device properties:
74 Regulator - ../regulator/arizona-regulator.txt 94 Regulator - ../regulator/arizona-regulator.txt
diff --git a/Documentation/devicetree/bindings/mfd/palmas.txt b/Documentation/devicetree/bindings/mfd/palmas.txt
index eda898978d33..8ae1a32bfb7e 100644
--- a/Documentation/devicetree/bindings/mfd/palmas.txt
+++ b/Documentation/devicetree/bindings/mfd/palmas.txt
@@ -24,7 +24,7 @@ and also the generic series names
24- #interrupt-cells : should be set to 2 for IRQ number and flags 24- #interrupt-cells : should be set to 2 for IRQ number and flags
25 The first cell is the IRQ number. 25 The first cell is the IRQ number.
26 The second cell is the flags, encoded as the trigger masks from 26 The second cell is the flags, encoded as the trigger masks from
27 Documentation/devicetree/bindings/interrupts.txt 27 Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
28- interrupt-parent : The parent interrupt controller. 28- interrupt-parent : The parent interrupt controller.
29 29
30Optional properties: 30Optional properties:
diff --git a/Documentation/devicetree/bindings/mfd/s2mpa01.txt b/Documentation/devicetree/bindings/mfd/s2mpa01.txt
deleted file mode 100644
index c13d3d8c3947..000000000000
--- a/Documentation/devicetree/bindings/mfd/s2mpa01.txt
+++ /dev/null
@@ -1,90 +0,0 @@
1
2* Samsung S2MPA01 Voltage and Current Regulator
3
4The Samsung S2MPA01 is a multi-function device which includes high
5efficiency buck converters including Dual-Phase buck converter, various LDOs,
6and an RTC. It is interfaced to the host controller using an I2C interface.
7Each sub-block is addressed by the host system using different I2C slave
8addresses.
9
10Required properties:
11- compatible: Should be "samsung,s2mpa01-pmic".
12- reg: Specifies the I2C slave address of the PMIC block. It should be 0x66.
13
14Optional properties:
15- interrupt-parent: Specifies the phandle of the interrupt controller to which
16 the interrupts from s2mpa01 are delivered to.
17- interrupts: An interrupt specifier for the sole interrupt generated by the
18 device.
19
20Optional nodes:
21- regulators: The regulators of s2mpa01 that have to be instantiated should be
22 included in a sub-node named 'regulators'. Regulator nodes and constraints
23 included in this sub-node use the standard regulator bindings which are
24 documented elsewhere.
25
26Properties for BUCK regulator nodes:
27- regulator-ramp-delay: ramp delay in uV/us. May be 6250, 12500
28 (default), 25000, or 50000. May be 0 for disabling the ramp delay on
29 BUCK{1,2,3,4}.
30
31 In the absence of the regulator-ramp-delay property, the default ramp
32 delay will be used.
33
34 NOTE: Some BUCKs share the ramp rate setting i.e. same ramp value will be set
35 for a particular group of BUCKs. So provide same regulator-ramp-delay=<value>.
36
37 The following BUCKs share ramp settings:
38 * 1 and 6
39 * 2 and 4
40 * 8, 9, and 10
41
42The following are the names of the regulators that the s2mpa01 PMIC block
43supports. Note: The 'n' in LDOn and BUCKn represents the LDO or BUCK number
44as per the datasheet of s2mpa01.
45
46 - LDOn
47 - valid values for n are 1 to 26
48 - Example: LDO1, LD02, LDO26
49 - BUCKn
50 - valid values for n are 1 to 10.
51 - Example: BUCK1, BUCK2, BUCK9
52
53Example:
54
55 s2mpa01_pmic@66 {
56 compatible = "samsung,s2mpa01-pmic";
57 reg = <0x66>;
58
59 regulators {
60 ldo1_reg: LDO1 {
61 regulator-name = "VDD_ALIVE";
62 regulator-min-microvolt = <1000000>;
63 regulator-max-microvolt = <1000000>;
64 };
65
66 ldo2_reg: LDO2 {
67 regulator-name = "VDDQ_MMC2";
68 regulator-min-microvolt = <2800000>;
69 regulator-max-microvolt = <2800000>;
70 regulator-always-on;
71 };
72
73 buck1_reg: BUCK1 {
74 regulator-name = "vdd_mif";
75 regulator-min-microvolt = <950000>;
76 regulator-max-microvolt = <1350000>;
77 regulator-always-on;
78 regulator-boot-on;
79 };
80
81 buck2_reg: BUCK2 {
82 regulator-name = "vdd_arm";
83 regulator-min-microvolt = <950000>;
84 regulator-max-microvolt = <1350000>;
85 regulator-always-on;
86 regulator-boot-on;
87 regulator-ramp-delay = <50000>;
88 };
89 };
90 };
diff --git a/Documentation/devicetree/bindings/mfd/s2mps11.txt b/Documentation/devicetree/bindings/mfd/s2mps11.txt
deleted file mode 100644
index 09b94c97faac..000000000000
--- a/Documentation/devicetree/bindings/mfd/s2mps11.txt
+++ /dev/null
@@ -1,153 +0,0 @@
1
2* Samsung S2MPS11/13/14/15 and S2MPU02 Voltage and Current Regulator
3
4The Samsung S2MPS11 is a multi-function device which includes voltage and
5current regulators, RTC, charger controller and other sub-blocks. It is
6interfaced to the host controller using an I2C interface. Each sub-block is
7addressed by the host system using different I2C slave addresses.
8
9Required properties:
10- compatible: Should be one of the following
11 - "samsung,s2mps11-pmic"
12 - "samsung,s2mps13-pmic"
13 - "samsung,s2mps14-pmic"
14 - "samsung,s2mps15-pmic"
15 - "samsung,s2mpu02-pmic".
16- reg: Specifies the I2C slave address of the pmic block. It should be 0x66.
17
18Optional properties:
19- interrupt-parent: Specifies the phandle of the interrupt controller to which
20 the interrupts from s2mps11 are delivered to.
21- interrupts: Interrupt specifiers for interrupt sources.
22- samsung,s2mps11-wrstbi-ground: Indicates that WRSTBI pin of PMIC is pulled
23 down. When the system is suspended it will always go down thus triggerring
24 unwanted buck warm reset (setting buck voltages to default values).
25- samsung,s2mps11-acokb-ground: Indicates that ACOKB pin of S2MPS11 PMIC is
26 connected to the ground so the PMIC must manually set PWRHOLD bit in CTRL1
27 register to turn off the power. Usually the ACOKB is pulled up to VBATT so
28 when PWRHOLD pin goes low, the rising ACOKB will trigger power off.
29
30Optional nodes:
31- clocks: s2mps11, s2mps13, s2mps15 and s5m8767 provide three(AP/CP/BT) buffered 32.768
32 KHz outputs, so to register these as clocks with common clock framework
33 instantiate a sub-node named "clocks". It uses the common clock binding
34 documented in :
35 [Documentation/devicetree/bindings/clock/clock-bindings.txt]
36 The s2mps14 provides two (AP/BT) buffered 32.768 KHz outputs.
37 - #clock-cells: should be 1.
38
39 - The following is the list of clocks generated by the controller. Each clock
40 is assigned an identifier and client nodes use this identifier to specify
41 the clock which they consume.
42 Clock ID Devices
43 ----------------------------------------------------------
44 32KhzAP 0 S2MPS11, S2MPS13, S2MPS14, S2MPS15, S5M8767
45 32KhzCP 1 S2MPS11, S2MPS13, S2MPS15, S5M8767
46 32KhzBT 2 S2MPS11, S2MPS13, S2MPS14, S2MPS15, S5M8767
47
48 - compatible: Should be one of: "samsung,s2mps11-clk", "samsung,s2mps13-clk",
49 "samsung,s2mps14-clk", "samsung,s5m8767-clk"
50 The s2msp15 uses the same compatible as s2mps13, as both provides similar clocks.
51
52- regulators: The regulators of s2mps11 that have to be instantiated should be
53included in a sub-node named 'regulators'. Regulator nodes included in this
54sub-node should be of the format as listed below.
55
56 regulator_name {
57 [standard regulator constraints....];
58 };
59
60 regulator-ramp-delay for BUCKs = [6250/12500/25000(default)/50000] uV/us
61
62 BUCK[2/3/4/6] supports disabling ramp delay on hardware, so explicitly
63 regulator-ramp-delay = <0> can be used for them to disable ramp delay.
64 In the absence of the regulator-ramp-delay property, the default ramp
65 delay will be used.
66
67NOTE: Some BUCKs share the ramp rate setting i.e. same ramp value will be set
68for a particular group of BUCKs. So provide same regulator-ramp-delay<value>.
69Grouping of BUCKs sharing ramp rate setting is as follow : BUCK[1, 6],
70BUCK[3, 4], and BUCK[7, 8, 10]
71
72On S2MPS14 the LDO10, LDO11 and LDO12 can be configured to external control
73over GPIO. To turn this feature on this property must be added to the regulator
74sub-node:
75 - samsung,ext-control-gpios: GPIO specifier for one GPIO
76 controlling this regulator (enable/disable);
77Example:
78 LDO12 {
79 regulator-name = "V_EMMC_2.8V";
80 regulator-min-microvolt = <2800000>;
81 regulator-max-microvolt = <2800000>;
82 samsung,ext-control-gpios = <&gpk0 2 0>;
83 };
84
85
86The regulator constraints inside the regulator nodes use the standard regulator
87bindings which are documented elsewhere.
88
89The following are the names of the regulators that the s2mps11 pmic block
90supports. Note: The 'n' in LDOn and BUCKn represents the LDO or BUCK number
91as per the datasheet of s2mps11.
92
93 - LDOn
94 - valid values for n are:
95 - S2MPS11: 1 to 38
96 - S2MPS13: 1 to 40
97 - S2MPS14: 1 to 25
98 - S2MPS15: 1 to 27
99 - S2MPU02: 1 to 28
100 - Example: LDO1, LDO2, LDO28
101 - BUCKn
102 - valid values for n are:
103 - S2MPS11: 1 to 10
104 - S2MPS13: 1 to 10
105 - S2MPS14: 1 to 5
106 - S2MPS15: 1 to 10
107 - S2MPU02: 1 to 7
108 - Example: BUCK1, BUCK2, BUCK9
109
110Example:
111
112 s2mps11_pmic@66 {
113 compatible = "samsung,s2mps11-pmic";
114 reg = <0x66>;
115
116 s2m_osc: clocks {
117 compatible = "samsung,s2mps11-clk";
118 #clock-cells = <1>;
119 clock-output-names = "xx", "yy", "zz";
120 };
121
122 regulators {
123 ldo1_reg: LDO1 {
124 regulator-name = "VDD_ABB_3.3V";
125 regulator-min-microvolt = <3300000>;
126 regulator-max-microvolt = <3300000>;
127 };
128
129 ldo2_reg: LDO2 {
130 regulator-name = "VDD_ALIVE_1.1V";
131 regulator-min-microvolt = <1100000>;
132 regulator-max-microvolt = <1100000>;
133 regulator-always-on;
134 };
135
136 buck1_reg: BUCK1 {
137 regulator-name = "vdd_mif";
138 regulator-min-microvolt = <950000>;
139 regulator-max-microvolt = <1350000>;
140 regulator-always-on;
141 regulator-boot-on;
142 };
143
144 buck2_reg: BUCK2 {
145 regulator-name = "vdd_arm";
146 regulator-min-microvolt = <950000>;
147 regulator-max-microvolt = <1350000>;
148 regulator-always-on;
149 regulator-boot-on;
150 regulator-ramp-delay = <50000>;
151 };
152 };
153 };
diff --git a/Documentation/devicetree/bindings/mfd/samsung,sec-core.txt b/Documentation/devicetree/bindings/mfd/samsung,sec-core.txt
new file mode 100644
index 000000000000..cdd079bfc287
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/samsung,sec-core.txt
@@ -0,0 +1,88 @@
1Binding for Samsung S2M and S5M family multi-function device
2============================================================
3
4This is a part of device tree bindings for S2M and S5M family multi-function
5devices.
6
7The Samsung S2MPA01, S2MPS11/13/14/15, S2MPU02 and S5M8767 is a family
8of multi-function devices which include voltage and current regulators, RTC,
9charger controller, clock outputs and other sub-blocks. It is interfaced
10to the host controller using an I2C interface. Each sub-block is usually
11addressed by the host system using different I2C slave addresses.
12
13
14This document describes bindings for main device node. Optional sub-blocks
15must be a sub-nodes to it. Bindings for them can be found in:
16 - bindings/regulator/samsung,s2mpa01.txt
17 - bindings/regulator/samsung,s2mps11.txt
18 - bindings/regulator/samsung,s5m8767.txt
19 - bindings/clock/samsung,s2mps11.txt
20
21
22Required properties:
23 - compatible: Should be one of the following
24 - "samsung,s2mpa01-pmic",
25 - "samsung,s2mps11-pmic",
26 - "samsung,s2mps13-pmic",
27 - "samsung,s2mps14-pmic",
28 - "samsung,s2mps15-pmic",
29 - "samsung,s2mpu02-pmic",
30 - "samsung,s5m8767-pmic".
31 - reg: Specifies the I2C slave address of the pmic block. It should be 0x66.
32
33Optional properties:
34 - interrupt-parent: Specifies the phandle of the interrupt controller to which
35 the interrupts from s2mps11 are delivered to.
36 - interrupts: Interrupt specifiers for interrupt sources.
37 - samsung,s2mps11-wrstbi-ground: Indicates that WRSTBI pin of PMIC is pulled
38 down. When the system is suspended it will always go down thus triggerring
39 unwanted buck warm reset (setting buck voltages to default values).
40 - samsung,s2mps11-acokb-ground: Indicates that ACOKB pin of S2MPS11 PMIC is
41 connected to the ground so the PMIC must manually set PWRHOLD bit in CTRL1
42 register to turn off the power. Usually the ACOKB is pulled up to VBATT so
43 when PWRHOLD pin goes low, the rising ACOKB will trigger power off.
44
45Example:
46
47 s2mps11_pmic@66 {
48 compatible = "samsung,s2mps11-pmic";
49 reg = <0x66>;
50
51 s2m_osc: clocks {
52 compatible = "samsung,s2mps11-clk";
53 #clock-cells = <1>;
54 clock-output-names = "xx", "yy", "zz";
55 };
56
57 regulators {
58 ldo1_reg: LDO1 {
59 regulator-name = "VDD_ABB_3.3V";
60 regulator-min-microvolt = <3300000>;
61 regulator-max-microvolt = <3300000>;
62 };
63
64 ldo2_reg: LDO2 {
65 regulator-name = "VDD_ALIVE_1.1V";
66 regulator-min-microvolt = <1100000>;
67 regulator-max-microvolt = <1100000>;
68 regulator-always-on;
69 };
70
71 buck1_reg: BUCK1 {
72 regulator-name = "vdd_mif";
73 regulator-min-microvolt = <950000>;
74 regulator-max-microvolt = <1350000>;
75 regulator-always-on;
76 regulator-boot-on;
77 };
78
79 buck2_reg: BUCK2 {
80 regulator-name = "vdd_arm";
81 regulator-min-microvolt = <950000>;
82 regulator-max-microvolt = <1350000>;
83 regulator-always-on;
84 regulator-boot-on;
85 regulator-ramp-delay = <50000>;
86 };
87 };
88 };
diff --git a/Documentation/devicetree/bindings/mfd/syscon.txt b/Documentation/devicetree/bindings/mfd/syscon.txt
index fe8150bb3248..408f768686f1 100644
--- a/Documentation/devicetree/bindings/mfd/syscon.txt
+++ b/Documentation/devicetree/bindings/mfd/syscon.txt
@@ -13,6 +13,10 @@ Required properties:
13- compatible: Should contain "syscon". 13- compatible: Should contain "syscon".
14- reg: the register region can be accessed from syscon 14- reg: the register region can be accessed from syscon
15 15
16Optional property:
17- reg-io-width: the size (in bytes) of the IO accesses that should be
18 performed on the device.
19
16Examples: 20Examples:
17gpr: iomuxc-gpr@020e0000 { 21gpr: iomuxc-gpr@020e0000 {
18 compatible = "fsl,imx6q-iomuxc-gpr", "syscon"; 22 compatible = "fsl,imx6q-iomuxc-gpr", "syscon";
diff --git a/Documentation/devicetree/bindings/regulator/s5m8767-regulator.txt b/Documentation/devicetree/bindings/regulator/s5m8767-regulator.txt
deleted file mode 100644
index 20191315e444..000000000000
--- a/Documentation/devicetree/bindings/regulator/s5m8767-regulator.txt
+++ /dev/null
@@ -1,163 +0,0 @@
1* Samsung S5M8767 Voltage and Current Regulator
2
3The Samsung S5M8767 is a multi-function device which includes voltage and
4current regulators, rtc, charger controller and other sub-blocks. It is
5interfaced to the host controller using a i2c interface. Each sub-block is
6addressed by the host system using different i2c slave address. This document
7describes the bindings for 'pmic' sub-block of s5m8767.
8
9Required properties:
10- compatible: Should be "samsung,s5m8767-pmic".
11- reg: Specifies the i2c slave address of the pmic block. It should be 0x66.
12
13- s5m8767,pmic-buck2-dvs-voltage: A set of 8 voltage values in micro-volt (uV)
14 units for buck2 when changing voltage using gpio dvs. Refer to [1] below
15 for additional information.
16
17- s5m8767,pmic-buck3-dvs-voltage: A set of 8 voltage values in micro-volt (uV)
18 units for buck3 when changing voltage using gpio dvs. Refer to [1] below
19 for additional information.
20
21- s5m8767,pmic-buck4-dvs-voltage: A set of 8 voltage values in micro-volt (uV)
22 units for buck4 when changing voltage using gpio dvs. Refer to [1] below
23 for additional information.
24
25- s5m8767,pmic-buck-ds-gpios: GPIO specifiers for three host gpio's used
26 for selecting GPIO DVS lines. It is one-to-one mapped to dvs gpio lines.
27
28[1] If none of the 's5m8767,pmic-buck[2/3/4]-uses-gpio-dvs' optional
29 property is specified, the 's5m8767,pmic-buck[2/3/4]-dvs-voltage'
30 property should specify atleast one voltage level (which would be a
31 safe operating voltage).
32
33 If either of the 's5m8767,pmic-buck[2/3/4]-uses-gpio-dvs' optional
34 property is specified, then all the eight voltage values for the
35 's5m8767,pmic-buck[2/3/4]-dvs-voltage' should be specified.
36
37Optional properties:
38- interrupt-parent: Specifies the phandle of the interrupt controller to which
39 the interrupts from s5m8767 are delivered to.
40- interrupts: Interrupt specifiers for two interrupt sources.
41 - First interrupt specifier is for 'irq1' interrupt.
42 - Second interrupt specifier is for 'alert' interrupt.
43- s5m8767,pmic-buck2-uses-gpio-dvs: 'buck2' can be controlled by gpio dvs.
44- s5m8767,pmic-buck3-uses-gpio-dvs: 'buck3' can be controlled by gpio dvs.
45- s5m8767,pmic-buck4-uses-gpio-dvs: 'buck4' can be controlled by gpio dvs.
46
47Additional properties required if either of the optional properties are used:
48
49- s5m8767,pmic-buck234-default-dvs-idx: Default voltage setting selected from
50 the possible 8 options selectable by the dvs gpios. The value of this
51 property should be between 0 and 7. If not specified or if out of range, the
52 default value of this property is set to 0.
53
54- s5m8767,pmic-buck-dvs-gpios: GPIO specifiers for three host gpio's used
55 for dvs. The format of the gpio specifier depends in the gpio controller.
56
57Regulators: The regulators of s5m8767 that have to be instantiated should be
58included in a sub-node named 'regulators'. Regulator nodes included in this
59sub-node should be of the format as listed below.
60
61 regulator_name {
62 ldo1_reg: LDO1 {
63 regulator-name = "VDD_ALIVE_1.0V";
64 regulator-min-microvolt = <1100000>;
65 regulator-max-microvolt = <1100000>;
66 regulator-always-on;
67 regulator-boot-on;
68 op_mode = <1>; /* Normal Mode */
69 };
70 };
71The above regulator entries are defined in regulator bindings documentation
72except these properties:
73 - op_mode: describes the different operating modes of the LDO's with
74 power mode change in SOC. The different possible values are,
75 0 - always off mode
76 1 - on in normal mode
77 2 - low power mode
78 3 - suspend mode
79 - s5m8767,pmic-ext-control-gpios: (optional) GPIO specifier for one
80 GPIO controlling this regulator (enable/disable); This is
81 valid only for buck9.
82
83The following are the names of the regulators that the s5m8767 pmic block
84supports. Note: The 'n' in LDOn and BUCKn represents the LDO or BUCK number
85as per the datasheet of s5m8767.
86
87 - LDOn
88 - valid values for n are 1 to 28
89 - Example: LDO1, LDO2, LDO28
90 - BUCKn
91 - valid values for n are 1 to 9.
92 - Example: BUCK1, BUCK2, BUCK9
93
94The bindings inside the regulator nodes use the standard regulator bindings
95which are documented elsewhere.
96
97Example:
98
99 s5m8767_pmic@66 {
100 compatible = "samsung,s5m8767-pmic";
101 reg = <0x66>;
102
103 s5m8767,pmic-buck2-uses-gpio-dvs;
104 s5m8767,pmic-buck3-uses-gpio-dvs;
105 s5m8767,pmic-buck4-uses-gpio-dvs;
106
107 s5m8767,pmic-buck-default-dvs-idx = <0>;
108
109 s5m8767,pmic-buck-dvs-gpios = <&gpx0 0 0>, /* DVS1 */
110 <&gpx0 1 0>, /* DVS2 */
111 <&gpx0 2 0>; /* DVS3 */
112
113 s5m8767,pmic-buck-ds-gpios = <&gpx2 3 0>, /* SET1 */
114 <&gpx2 4 0>, /* SET2 */
115 <&gpx2 5 0>; /* SET3 */
116
117 s5m8767,pmic-buck2-dvs-voltage = <1350000>, <1300000>,
118 <1250000>, <1200000>,
119 <1150000>, <1100000>,
120 <1000000>, <950000>;
121
122 s5m8767,pmic-buck3-dvs-voltage = <1100000>, <1100000>,
123 <1100000>, <1100000>,
124 <1000000>, <1000000>,
125 <1000000>, <1000000>;
126
127 s5m8767,pmic-buck4-dvs-voltage = <1200000>, <1200000>,
128 <1200000>, <1200000>,
129 <1200000>, <1200000>,
130 <1200000>, <1200000>;
131
132 regulators {
133 ldo1_reg: LDO1 {
134 regulator-name = "VDD_ABB_3.3V";
135 regulator-min-microvolt = <3300000>;
136 regulator-max-microvolt = <3300000>;
137 op_mode = <1>; /* Normal Mode */
138 };
139
140 ldo2_reg: LDO2 {
141 regulator-name = "VDD_ALIVE_1.1V";
142 regulator-min-microvolt = <1100000>;
143 regulator-max-microvolt = <1100000>;
144 regulator-always-on;
145 };
146
147 buck1_reg: BUCK1 {
148 regulator-name = "VDD_MIF_1.2V";
149 regulator-min-microvolt = <950000>;
150 regulator-max-microvolt = <1350000>;
151 regulator-always-on;
152 regulator-boot-on;
153 };
154
155 vemmc_reg: BUCK9 {
156 regulator-name = "VMEM_VDD_2.8V";
157 regulator-min-microvolt = <2800000>;
158 regulator-max-microvolt = <2800000>;
159 op_mode = <3>; /* Standby Mode */
160 s5m8767,pmic-ext-control-gpios = <&gpk0 2 0>;
161 };
162 };
163 };
diff --git a/Documentation/devicetree/bindings/regulator/samsung,s2mpa01.txt b/Documentation/devicetree/bindings/regulator/samsung,s2mpa01.txt
new file mode 100644
index 000000000000..bae3c7f838cf
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/samsung,s2mpa01.txt
@@ -0,0 +1,79 @@
1Binding for Samsung S2MPA01 regulator block
2===========================================
3
4This is a part of device tree bindings for S2M family multi-function devices.
5More information can be found in bindings/mfd/sec-core.txt file.
6
7The S2MPA01 device provide buck and LDO regulators.
8
9To register these with regulator framework instantiate under main device node
10a sub-node named "regulators" with more sub-nodes for each regulator using the
11common regulator binding documented in:
12 - Documentation/devicetree/bindings/regulator/regulator.txt
13
14
15Names of regulators supported by S2MPA01 device:
16 - LDOn
17 - valid values for n are 1 to 26
18 - Example: LDO1, LD02, LDO26
19 - BUCKn
20 - valid values for n are 1 to 10.
21 - Example: BUCK1, BUCK2, BUCK9
22Note: The 'n' in LDOn and BUCKn represents the LDO or BUCK number
23as per the datasheet of device.
24
25
26Optional properties of buck regulator nodes under "regulators" sub-node:
27 - regulator-ramp-delay: ramp delay in uV/us. May be 6250, 12500
28 (default), 25000, or 50000. May be 0 for disabling the ramp delay on
29 BUCK{1,2,3,4}.
30
31 In the absence of the regulator-ramp-delay property, the default ramp
32 delay will be used.
33
34 Note: Some bucks share the ramp rate setting i.e. same ramp value
35 will be set for a particular group of bucks so provide the same
36 regulator-ramp-delay value for them.
37 Groups sharing ramp rate:
38 - buck{1,6},
39 - buck{2,4},
40 - buck{8,9,10}.
41
42Example:
43
44 s2mpa01_pmic@66 {
45 compatible = "samsung,s2mpa01-pmic";
46 reg = <0x66>;
47
48 regulators {
49 ldo1_reg: LDO1 {
50 regulator-name = "VDD_ALIVE";
51 regulator-min-microvolt = <1000000>;
52 regulator-max-microvolt = <1000000>;
53 };
54
55 ldo2_reg: LDO2 {
56 regulator-name = "VDDQ_MMC2";
57 regulator-min-microvolt = <2800000>;
58 regulator-max-microvolt = <2800000>;
59 regulator-always-on;
60 };
61
62 buck1_reg: BUCK1 {
63 regulator-name = "vdd_mif";
64 regulator-min-microvolt = <950000>;
65 regulator-max-microvolt = <1350000>;
66 regulator-always-on;
67 regulator-boot-on;
68 };
69
70 buck2_reg: BUCK2 {
71 regulator-name = "vdd_arm";
72 regulator-min-microvolt = <950000>;
73 regulator-max-microvolt = <1350000>;
74 regulator-always-on;
75 regulator-boot-on;
76 regulator-ramp-delay = <50000>;
77 };
78 };
79 };
diff --git a/Documentation/devicetree/bindings/regulator/samsung,s2mps11.txt b/Documentation/devicetree/bindings/regulator/samsung,s2mps11.txt
new file mode 100644
index 000000000000..27a48bf1b185
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/samsung,s2mps11.txt
@@ -0,0 +1,102 @@
1Binding for Samsung S2M family regulator block
2==============================================
3
4This is a part of device tree bindings for S2M family multi-function devices.
5More information can be found in bindings/mfd/sec-core.txt file.
6
7The S2MPS11/13/14/15 and S2MPU02 devices provide buck and LDO regulators.
8
9To register these with regulator framework instantiate under main device node
10a sub-node named "regulators" with more sub-nodes for each regulator using the
11common regulator binding documented in:
12 - Documentation/devicetree/bindings/regulator/regulator.txt
13
14
15Names of regulators supported by different devices:
16 - LDOn
17 - valid values for n are:
18 - S2MPS11: 1 to 38
19 - S2MPS13: 1 to 40
20 - S2MPS14: 1 to 25
21 - S2MPS15: 1 to 27
22 - S2MPU02: 1 to 28
23 - Example: LDO1, LDO2, LDO28
24 - BUCKn
25 - valid values for n are:
26 - S2MPS11: 1 to 10
27 - S2MPS13: 1 to 10
28 - S2MPS14: 1 to 5
29 - S2MPS15: 1 to 10
30 - S2MPU02: 1 to 7
31 - Example: BUCK1, BUCK2, BUCK9
32Note: The 'n' in LDOn and BUCKn represents the LDO or BUCK number
33as per the datasheet of device.
34
35
36Optional properties of the nodes under "regulators" sub-node:
37 - regulator-ramp-delay: ramp delay in uV/us. May be 6250, 12500,
38 25000 (default) or 50000.
39
40 Additionally S2MPS11 supports disabling ramp delay for BUCK{2,3,4,6}
41 by setting it to <0>.
42
43 Note: On S2MPS11 some bucks share the ramp rate setting i.e. same ramp value
44 will be set for a particular group of bucks so provide the same
45 regulator-ramp-delay value for them.
46 Groups sharing ramp rate:
47 - buck{1,6},
48 - buck{3,4},
49 - buck{7,8,10}.
50
51 - samsung,ext-control-gpios: On S2MPS14 the LDO10, LDO11 and LDO12 can be
52 configured to external control over GPIO. To turn this feature on this
53 property must be added to the regulator sub-node:
54 - samsung,ext-control-gpios: GPIO specifier for one GPIO
55 controlling this regulator (enable/disable)
56 Example:
57 LDO12 {
58 regulator-name = "V_EMMC_2.8V";
59 regulator-min-microvolt = <2800000>;
60 regulator-max-microvolt = <2800000>;
61 samsung,ext-control-gpios = <&gpk0 2 0>;
62 };
63
64
65Example:
66
67 s2mps11_pmic@66 {
68 compatible = "samsung,s2mps11-pmic";
69 reg = <0x66>;
70
71 regulators {
72 ldo1_reg: LDO1 {
73 regulator-name = "VDD_ABB_3.3V";
74 regulator-min-microvolt = <3300000>;
75 regulator-max-microvolt = <3300000>;
76 };
77
78 ldo2_reg: LDO2 {
79 regulator-name = "VDD_ALIVE_1.1V";
80 regulator-min-microvolt = <1100000>;
81 regulator-max-microvolt = <1100000>;
82 regulator-always-on;
83 };
84
85 buck1_reg: BUCK1 {
86 regulator-name = "vdd_mif";
87 regulator-min-microvolt = <950000>;
88 regulator-max-microvolt = <1350000>;
89 regulator-always-on;
90 regulator-boot-on;
91 };
92
93 buck2_reg: BUCK2 {
94 regulator-name = "vdd_arm";
95 regulator-min-microvolt = <950000>;
96 regulator-max-microvolt = <1350000>;
97 regulator-always-on;
98 regulator-boot-on;
99 regulator-ramp-delay = <50000>;
100 };
101 };
102 };
diff --git a/Documentation/devicetree/bindings/regulator/samsung,s5m8767.txt b/Documentation/devicetree/bindings/regulator/samsung,s5m8767.txt
new file mode 100644
index 000000000000..093edda0c8df
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/samsung,s5m8767.txt
@@ -0,0 +1,145 @@
1Binding for Samsung S5M8767 regulator block
2===========================================
3
4This is a part of device tree bindings for S5M family multi-function devices.
5More information can be found in bindings/mfd/sec-core.txt file.
6
7The S5M8767 device provide buck and LDO regulators.
8
9To register these with regulator framework instantiate under main device node
10a sub-node named "regulators" with more sub-nodes for each regulator using the
11common regulator binding documented in:
12 - Documentation/devicetree/bindings/regulator/regulator.txt
13
14
15Required properties of the main device node (the parent!):
16 - s5m8767,pmic-buck2-dvs-voltage: A set of 8 voltage values in micro-volt (uV)
17 units for buck2 when changing voltage using gpio dvs. Refer to [1] below
18 for additional information.
19
20 - s5m8767,pmic-buck3-dvs-voltage: A set of 8 voltage values in micro-volt (uV)
21 units for buck3 when changing voltage using gpio dvs. Refer to [1] below
22 for additional information.
23
24 - s5m8767,pmic-buck4-dvs-voltage: A set of 8 voltage values in micro-volt (uV)
25 units for buck4 when changing voltage using gpio dvs. Refer to [1] below
26 for additional information.
27
28 - s5m8767,pmic-buck-ds-gpios: GPIO specifiers for three host gpio's used
29 for selecting GPIO DVS lines. It is one-to-one mapped to dvs gpio lines.
30
31 [1] If none of the 's5m8767,pmic-buck[2/3/4]-uses-gpio-dvs' optional
32 property is specified, the 's5m8767,pmic-buck[2/3/4]-dvs-voltage'
33 property should specify atleast one voltage level (which would be a
34 safe operating voltage).
35
36 If either of the 's5m8767,pmic-buck[2/3/4]-uses-gpio-dvs' optional
37 property is specified, then all the eight voltage values for the
38 's5m8767,pmic-buck[2/3/4]-dvs-voltage' should be specified.
39
40Optional properties of the main device node (the parent!):
41 - s5m8767,pmic-buck2-uses-gpio-dvs: 'buck2' can be controlled by gpio dvs.
42 - s5m8767,pmic-buck3-uses-gpio-dvs: 'buck3' can be controlled by gpio dvs.
43 - s5m8767,pmic-buck4-uses-gpio-dvs: 'buck4' can be controlled by gpio dvs.
44
45Additional properties required if either of the optional properties are used:
46
47 - s5m8767,pmic-buck234-default-dvs-idx: Default voltage setting selected from
48 the possible 8 options selectable by the dvs gpios. The value of this
49 property should be between 0 and 7. If not specified or if out of range, the
50 default value of this property is set to 0.
51
52 - s5m8767,pmic-buck-dvs-gpios: GPIO specifiers for three host gpio's used
53 for dvs. The format of the gpio specifier depends in the gpio controller.
54
55
56Names of regulators supported by S5M8767 device:
57 - LDOn
58 - valid values for n are 1 to 28
59 - Example: LDO1, LDO2, LDO28
60 - BUCKn
61 - valid values for n are 1 to 9.
62 - Example: BUCK1, BUCK2, BUCK9
63Note: The 'n' in LDOn and BUCKn represents the LDO or BUCK number
64as per the datasheet of device.
65
66
67Optional properties of the nodes under "regulators" sub-node:
68 - op_mode: describes the different operating modes of the LDO's with
69 power mode change in SOC. The different possible values are,
70 0 - always off mode
71 1 - on in normal mode
72 2 - low power mode
73 3 - suspend mode
74 - s5m8767,pmic-ext-control-gpios: (optional) GPIO specifier for one
75 GPIO controlling this regulator
76 (enable/disable); This is valid only
77 for buck9.
78
79Example:
80
81 s5m8767_pmic@66 {
82 compatible = "samsung,s5m8767-pmic";
83 reg = <0x66>;
84
85 s5m8767,pmic-buck2-uses-gpio-dvs;
86 s5m8767,pmic-buck3-uses-gpio-dvs;
87 s5m8767,pmic-buck4-uses-gpio-dvs;
88
89 s5m8767,pmic-buck-default-dvs-idx = <0>;
90
91 s5m8767,pmic-buck-dvs-gpios = <&gpx0 0 0>, /* DVS1 */
92 <&gpx0 1 0>, /* DVS2 */
93 <&gpx0 2 0>; /* DVS3 */
94
95 s5m8767,pmic-buck-ds-gpios = <&gpx2 3 0>, /* SET1 */
96 <&gpx2 4 0>, /* SET2 */
97 <&gpx2 5 0>; /* SET3 */
98
99 s5m8767,pmic-buck2-dvs-voltage = <1350000>, <1300000>,
100 <1250000>, <1200000>,
101 <1150000>, <1100000>,
102 <1000000>, <950000>;
103
104 s5m8767,pmic-buck3-dvs-voltage = <1100000>, <1100000>,
105 <1100000>, <1100000>,
106 <1000000>, <1000000>,
107 <1000000>, <1000000>;
108
109 s5m8767,pmic-buck4-dvs-voltage = <1200000>, <1200000>,
110 <1200000>, <1200000>,
111 <1200000>, <1200000>,
112 <1200000>, <1200000>;
113
114 regulators {
115 ldo1_reg: LDO1 {
116 regulator-name = "VDD_ABB_3.3V";
117 regulator-min-microvolt = <3300000>;
118 regulator-max-microvolt = <3300000>;
119 op_mode = <1>; /* Normal Mode */
120 };
121
122 ldo2_reg: LDO2 {
123 regulator-name = "VDD_ALIVE_1.1V";
124 regulator-min-microvolt = <1100000>;
125 regulator-max-microvolt = <1100000>;
126 regulator-always-on;
127 };
128
129 buck1_reg: BUCK1 {
130 regulator-name = "VDD_MIF_1.2V";
131 regulator-min-microvolt = <950000>;
132 regulator-max-microvolt = <1350000>;
133 regulator-always-on;
134 regulator-boot-on;
135 };
136
137 vemmc_reg: BUCK9 {
138 regulator-name = "VMEM_VDD_2.8V";
139 regulator-min-microvolt = <2800000>;
140 regulator-max-microvolt = <2800000>;
141 op_mode = <3>; /* Standby Mode */
142 s5m8767,pmic-ext-control-gpios = <&gpk0 2 0>;
143 };
144 };
145 };
diff --git a/Documentation/devicetree/bindings/sound/wm8994.txt b/Documentation/devicetree/bindings/sound/wm8994.txt
index e045e90a0924..68c4e8d96bed 100644
--- a/Documentation/devicetree/bindings/sound/wm8994.txt
+++ b/Documentation/devicetree/bindings/sound/wm8994.txt
@@ -30,7 +30,7 @@ Optional properties:
30 - #interrupt-cells: the number of cells to describe an IRQ, this should be 2. 30 - #interrupt-cells: the number of cells to describe an IRQ, this should be 2.
31 The first cell is the IRQ number. 31 The first cell is the IRQ number.
32 The second cell is the flags, encoded as the trigger masks from 32 The second cell is the flags, encoded as the trigger masks from
33 Documentation/devicetree/bindings/interrupts.txt 33 Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
34 34
35 - clocks : A list of up to two phandle and clock specifier pairs 35 - clocks : A list of up to two phandle and clock specifier pairs
36 - clock-names : A list of clock names sorted in the same order as clocks. 36 - clock-names : A list of clock names sorted in the same order as clocks.
diff --git a/MAINTAINERS b/MAINTAINERS
index a2956eb7ca95..ab68d0597542 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9285,8 +9285,10 @@ F: drivers/regulator/s5m*.c
9285F: drivers/clk/clk-s2mps11.c 9285F: drivers/clk/clk-s2mps11.c
9286F: drivers/rtc/rtc-s5m.c 9286F: drivers/rtc/rtc-s5m.c
9287F: include/linux/mfd/samsung/ 9287F: include/linux/mfd/samsung/
9288F: Documentation/devicetree/bindings/regulator/s5m8767-regulator.txt 9288F: Documentation/devicetree/bindings/mfd/samsung,sec-core.txt
9289F: Documentation/devicetree/bindings/mfd/s2mp*.txt 9289F: Documentation/devicetree/bindings/regulator/samsung,s2m*.txt
9290F: Documentation/devicetree/bindings/regulator/samsung,s5m*.txt
9291F: Documentation/devicetree/bindings/clock/samsung,s2mps11.txt
9290 9292
9291SAMSUNG S5P/EXYNOS4 SOC SERIES CAMERA SUBSYSTEM DRIVERS 9293SAMSUNG S5P/EXYNOS4 SOC SERIES CAMERA SUBSYSTEM DRIVERS
9292M: Kyungmin Park <kyungmin.park@samsung.com> 9294M: Kyungmin Park <kyungmin.park@samsung.com>
@@ -11743,6 +11745,7 @@ F: drivers/input/touchscreen/wm831x-ts.c
11743F: drivers/input/touchscreen/wm97*.c 11745F: drivers/input/touchscreen/wm97*.c
11744F: drivers/mfd/arizona* 11746F: drivers/mfd/arizona*
11745F: drivers/mfd/wm*.c 11747F: drivers/mfd/wm*.c
11748F: drivers/mfd/cs47l24*
11746F: drivers/power/wm83*.c 11749F: drivers/power/wm83*.c
11747F: drivers/rtc/rtc-wm83*.c 11750F: drivers/rtc/rtc-wm83*.c
11748F: drivers/regulator/wm8*.c 11751F: drivers/regulator/wm8*.c
@@ -11756,6 +11759,7 @@ F: include/linux/wm97xx.h
11756F: include/sound/wm????.h 11759F: include/sound/wm????.h
11757F: sound/soc/codecs/arizona.? 11760F: sound/soc/codecs/arizona.?
11758F: sound/soc/codecs/wm* 11761F: sound/soc/codecs/wm*
11762F: sound/soc/codecs/cs47l24*
11759 11763
11760WORKQUEUE 11764WORKQUEUE
11761M: Tejun Heo <tj@kernel.org> 11765M: Tejun Heo <tj@kernel.org>
diff --git a/drivers/gpio/gpio-arizona.c b/drivers/gpio/gpio-arizona.c
index ca002739616a..624ea5421995 100644
--- a/drivers/gpio/gpio-arizona.c
+++ b/drivers/gpio/gpio-arizona.c
@@ -122,6 +122,10 @@ static int arizona_gpio_probe(struct platform_device *pdev)
122 case WM1814: 122 case WM1814:
123 arizona_gpio->gpio_chip.ngpio = 5; 123 arizona_gpio->gpio_chip.ngpio = 5;
124 break; 124 break;
125 case WM1831:
126 case CS47L24:
127 arizona_gpio->gpio_chip.ngpio = 2;
128 break;
125 default: 129 default:
126 dev_err(&pdev->dev, "Unknown chip variant %d\n", 130 dev_err(&pdev->dev, "Unknown chip variant %d\n",
127 arizona->type); 131 arizona->type);
diff --git a/drivers/mfd/88pm80x.c b/drivers/mfd/88pm80x.c
index 63445ea6b0bf..3f24ecbe2576 100644
--- a/drivers/mfd/88pm80x.c
+++ b/drivers/mfd/88pm80x.c
@@ -135,7 +135,7 @@ EXPORT_SYMBOL_GPL(pm80x_deinit);
135#ifdef CONFIG_PM_SLEEP 135#ifdef CONFIG_PM_SLEEP
136static int pm80x_suspend(struct device *dev) 136static int pm80x_suspend(struct device *dev)
137{ 137{
138 struct i2c_client *client = container_of(dev, struct i2c_client, dev); 138 struct i2c_client *client = to_i2c_client(dev);
139 struct pm80x_chip *chip = i2c_get_clientdata(client); 139 struct pm80x_chip *chip = i2c_get_clientdata(client);
140 140
141 if (chip && chip->wu_flag) 141 if (chip && chip->wu_flag)
@@ -147,7 +147,7 @@ static int pm80x_suspend(struct device *dev)
147 147
148static int pm80x_resume(struct device *dev) 148static int pm80x_resume(struct device *dev)
149{ 149{
150 struct i2c_client *client = container_of(dev, struct i2c_client, dev); 150 struct i2c_client *client = to_i2c_client(dev);
151 struct pm80x_chip *chip = i2c_get_clientdata(client); 151 struct pm80x_chip *chip = i2c_get_clientdata(client);
152 152
153 if (chip && chip->wu_flag) 153 if (chip && chip->wu_flag)
diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
index 3269a9990b24..25e1aafae60c 100644
--- a/drivers/mfd/88pm860x-core.c
+++ b/drivers/mfd/88pm860x-core.c
@@ -705,10 +705,12 @@ int pm8606_osc_disable(struct pm860x_chip *chip, unsigned short client)
705 chip->osc_status); 705 chip->osc_status);
706 706
707 mutex_lock(&chip->osc_lock); 707 mutex_lock(&chip->osc_lock);
708 /*Update voting status */ 708 /* Update voting status */
709 chip->osc_vote &= ~(client); 709 chip->osc_vote &= ~(client);
710 /* If reference group is off and this is the last client to release 710 /*
711 * - turn off */ 711 * If reference group is off and this is the last client to release
712 * - turn off
713 */
712 if ((chip->osc_status != PM8606_REF_GP_OSC_OFF) && 714 if ((chip->osc_status != PM8606_REF_GP_OSC_OFF) &&
713 (chip->osc_vote == REF_GP_NO_CLIENTS)) { 715 (chip->osc_vote == REF_GP_NO_CLIENTS)) {
714 chip->osc_status = PM8606_REF_GP_OSC_UNKNOWN; 716 chip->osc_status = PM8606_REF_GP_OSC_UNKNOWN;
@@ -1218,7 +1220,7 @@ static int pm860x_remove(struct i2c_client *client)
1218#ifdef CONFIG_PM_SLEEP 1220#ifdef CONFIG_PM_SLEEP
1219static int pm860x_suspend(struct device *dev) 1221static int pm860x_suspend(struct device *dev)
1220{ 1222{
1221 struct i2c_client *client = container_of(dev, struct i2c_client, dev); 1223 struct i2c_client *client = to_i2c_client(dev);
1222 struct pm860x_chip *chip = i2c_get_clientdata(client); 1224 struct pm860x_chip *chip = i2c_get_clientdata(client);
1223 1225
1224 if (device_may_wakeup(dev) && chip->wakeup_flag) 1226 if (device_may_wakeup(dev) && chip->wakeup_flag)
@@ -1228,7 +1230,7 @@ static int pm860x_suspend(struct device *dev)
1228 1230
1229static int pm860x_resume(struct device *dev) 1231static int pm860x_resume(struct device *dev)
1230{ 1232{
1231 struct i2c_client *client = container_of(dev, struct i2c_client, dev); 1233 struct i2c_client *client = to_i2c_client(dev);
1232 struct pm860x_chip *chip = i2c_get_clientdata(client); 1234 struct pm860x_chip *chip = i2c_get_clientdata(client);
1233 1235
1234 if (device_may_wakeup(dev) && chip->wakeup_flag) 1236 if (device_may_wakeup(dev) && chip->wakeup_flag)
@@ -1265,6 +1267,7 @@ static struct i2c_driver pm860x_driver = {
1265static int __init pm860x_i2c_init(void) 1267static int __init pm860x_i2c_init(void)
1266{ 1268{
1267 int ret; 1269 int ret;
1270
1268 ret = i2c_add_driver(&pm860x_driver); 1271 ret = i2c_add_driver(&pm860x_driver);
1269 if (ret != 0) 1272 if (ret != 0)
1270 pr_err("Failed to register 88PM860x I2C driver: %d\n", ret); 1273 pr_err("Failed to register 88PM860x I2C driver: %d\n", ret);
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 4d92df6ef9fe..9ca66de0c1c1 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -211,7 +211,7 @@ config MFD_DA9062
211 of the device. 211 of the device.
212 212
213config MFD_DA9063 213config MFD_DA9063
214 bool "Dialog Semiconductor DA9063 PMIC Support" 214 tristate "Dialog Semiconductor DA9063 PMIC Support"
215 select MFD_CORE 215 select MFD_CORE
216 select REGMAP_I2C 216 select REGMAP_I2C
217 select REGMAP_IRQ 217 select REGMAP_IRQ
@@ -1370,24 +1370,30 @@ config MFD_ARIZONA
1370 bool 1370 bool
1371 1371
1372config MFD_ARIZONA_I2C 1372config MFD_ARIZONA_I2C
1373 tristate "Wolfson Microelectronics Arizona platform with I2C" 1373 tristate "Cirrus Logic/Wolfson Microelectronics Arizona platform with I2C"
1374 select MFD_ARIZONA 1374 select MFD_ARIZONA
1375 select MFD_CORE 1375 select MFD_CORE
1376 select REGMAP_I2C 1376 select REGMAP_I2C
1377 depends on I2C 1377 depends on I2C
1378 help 1378 help
1379 Support for the Wolfson Microelectronics Arizona platform audio SoC 1379 Support for the Cirrus Logic/Wolfson Microelectronics Arizona platform
1380 core functionality controlled via I2C. 1380 audio SoC core functionality controlled via I2C.
1381 1381
1382config MFD_ARIZONA_SPI 1382config MFD_ARIZONA_SPI
1383 tristate "Wolfson Microelectronics Arizona platform with SPI" 1383 tristate "Cirrus Logic/Wolfson Microelectronics Arizona platform with SPI"
1384 select MFD_ARIZONA 1384 select MFD_ARIZONA
1385 select MFD_CORE 1385 select MFD_CORE
1386 select REGMAP_SPI 1386 select REGMAP_SPI
1387 depends on SPI_MASTER 1387 depends on SPI_MASTER
1388 help 1388 help
1389 Support for the Wolfson Microelectronics Arizona platform audio SoC 1389 Support for the Cirrus Logic/Wolfson Microelectronics Arizona platform
1390 core functionality controlled via I2C. 1390 audio SoC core functionality controlled via I2C.
1391
1392config MFD_CS47L24
1393 bool "Cirrus Logic CS47L24 and WM1831"
1394 depends on MFD_ARIZONA
1395 help
1396 Support for Cirrus Logic CS47L24 and WM1831 low power audio SoC
1391 1397
1392config MFD_WM5102 1398config MFD_WM5102
1393 bool "Wolfson Microelectronics WM5102" 1399 bool "Wolfson Microelectronics WM5102"
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index a8b76b81b467..0f230a6103f8 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -51,6 +51,9 @@ endif
51ifeq ($(CONFIG_MFD_WM8998),y) 51ifeq ($(CONFIG_MFD_WM8998),y)
52obj-$(CONFIG_MFD_ARIZONA) += wm8998-tables.o 52obj-$(CONFIG_MFD_ARIZONA) += wm8998-tables.o
53endif 53endif
54ifeq ($(CONFIG_MFD_CS47L24),y)
55obj-$(CONFIG_MFD_ARIZONA) += cs47l24-tables.o
56endif
54obj-$(CONFIG_MFD_WM8400) += wm8400-core.o 57obj-$(CONFIG_MFD_WM8400) += wm8400-core.o
55wm831x-objs := wm831x-core.o wm831x-irq.o wm831x-otp.o 58wm831x-objs := wm831x-core.o wm831x-irq.o wm831x-otp.o
56wm831x-objs += wm831x-auxadc.o 59wm831x-objs += wm831x-auxadc.o
@@ -61,7 +64,8 @@ wm8350-objs := wm8350-core.o wm8350-regmap.o wm8350-gpio.o
61wm8350-objs += wm8350-irq.o 64wm8350-objs += wm8350-irq.o
62obj-$(CONFIG_MFD_WM8350) += wm8350.o 65obj-$(CONFIG_MFD_WM8350) += wm8350.o
63obj-$(CONFIG_MFD_WM8350_I2C) += wm8350-i2c.o 66obj-$(CONFIG_MFD_WM8350_I2C) += wm8350-i2c.o
64obj-$(CONFIG_MFD_WM8994) += wm8994-core.o wm8994-irq.o wm8994-regmap.o 67wm8994-objs := wm8994-core.o wm8994-irq.o wm8994-regmap.o
68obj-$(CONFIG_MFD_WM8994) += wm8994.o
65 69
66obj-$(CONFIG_TPS6105X) += tps6105x.o 70obj-$(CONFIG_TPS6105X) += tps6105x.o
67obj-$(CONFIG_TPS65010) += tps65010.o 71obj-$(CONFIG_TPS65010) += tps65010.o
diff --git a/drivers/mfd/aat2870-core.c b/drivers/mfd/aat2870-core.c
index 29b6a2d4ac72..3ba19a45f199 100644
--- a/drivers/mfd/aat2870-core.c
+++ b/drivers/mfd/aat2870-core.c
@@ -373,11 +373,8 @@ static int aat2870_i2c_probe(struct i2c_client *client,
373 373
374 aat2870 = devm_kzalloc(&client->dev, sizeof(struct aat2870_data), 374 aat2870 = devm_kzalloc(&client->dev, sizeof(struct aat2870_data),
375 GFP_KERNEL); 375 GFP_KERNEL);
376 if (!aat2870) { 376 if (!aat2870)
377 dev_err(&client->dev,
378 "Failed to allocate memory for aat2870\n");
379 return -ENOMEM; 377 return -ENOMEM;
380 }
381 378
382 aat2870->dev = &client->dev; 379 aat2870->dev = &client->dev;
383 dev_set_drvdata(aat2870->dev, aat2870); 380 dev_set_drvdata(aat2870->dev, aat2870);
diff --git a/drivers/mfd/ab3100-core.c b/drivers/mfd/ab3100-core.c
index f0afb44271f8..6a5a98806cb8 100644
--- a/drivers/mfd/ab3100-core.c
+++ b/drivers/mfd/ab3100-core.c
@@ -381,9 +381,11 @@ static int ab3100_event_registers_startup_state_get(struct device *dev,
381 u8 *event) 381 u8 *event)
382{ 382{
383 struct ab3100 *ab3100 = dev_get_drvdata(dev->parent); 383 struct ab3100 *ab3100 = dev_get_drvdata(dev->parent);
384
384 if (!ab3100->startup_events_read) 385 if (!ab3100->startup_events_read)
385 return -EAGAIN; /* Try again later */ 386 return -EAGAIN; /* Try again later */
386 memcpy(event, ab3100->startup_events, 3); 387 memcpy(event, ab3100->startup_events, 3);
388
387 return 0; 389 return 0;
388} 390}
389 391
@@ -858,10 +860,8 @@ static int ab3100_probe(struct i2c_client *client,
858 int i; 860 int i;
859 861
860 ab3100 = devm_kzalloc(&client->dev, sizeof(struct ab3100), GFP_KERNEL); 862 ab3100 = devm_kzalloc(&client->dev, sizeof(struct ab3100), GFP_KERNEL);
861 if (!ab3100) { 863 if (!ab3100)
862 dev_err(&client->dev, "could not allocate AB3100 device\n");
863 return -ENOMEM; 864 return -ENOMEM;
864 }
865 865
866 /* Initialize data structure */ 866 /* Initialize data structure */
867 mutex_init(&ab3100->access_mutex); 867 mutex_init(&ab3100->access_mutex);
@@ -883,20 +883,17 @@ static int ab3100_probe(struct i2c_client *client,
883 883
884 for (i = 0; ids[i].id != 0x0; i++) { 884 for (i = 0; ids[i].id != 0x0; i++) {
885 if (ids[i].id == ab3100->chip_id) { 885 if (ids[i].id == ab3100->chip_id) {
886 if (ids[i].name != NULL) { 886 if (ids[i].name)
887 snprintf(&ab3100->chip_name[0],
888 sizeof(ab3100->chip_name) - 1,
889 "AB3100 %s",
890 ids[i].name);
891 break; 887 break;
892 } else { 888
893 dev_err(&client->dev, 889 dev_err(&client->dev, "AB3000 is not supported\n");
894 "AB3000 is not supported\n"); 890 goto exit_no_detect;
895 goto exit_no_detect;
896 }
897 } 891 }
898 } 892 }
899 893
894 snprintf(&ab3100->chip_name[0],
895 sizeof(ab3100->chip_name) - 1, "AB3100 %s", ids[i].name);
896
900 if (ids[i].id == 0x0) { 897 if (ids[i].id == 0x0) {
901 dev_err(&client->dev, "unknown analog baseband chip id: 0x%x\n", 898 dev_err(&client->dev, "unknown analog baseband chip id: 0x%x\n",
902 ab3100->chip_id); 899 ab3100->chip_id);
diff --git a/drivers/mfd/ab3100-otp.c b/drivers/mfd/ab3100-otp.c
index f391c5fee1b0..55b207a4b336 100644
--- a/drivers/mfd/ab3100-otp.c
+++ b/drivers/mfd/ab3100-otp.c
@@ -188,10 +188,9 @@ static int __init ab3100_otp_probe(struct platform_device *pdev)
188 int i; 188 int i;
189 189
190 otp = devm_kzalloc(&pdev->dev, sizeof(struct ab3100_otp), GFP_KERNEL); 190 otp = devm_kzalloc(&pdev->dev, sizeof(struct ab3100_otp), GFP_KERNEL);
191 if (!otp) { 191 if (!otp)
192 dev_err(&pdev->dev, "could not allocate AB3100 OTP device\n");
193 return -ENOMEM; 192 return -ENOMEM;
194 } 193
195 otp->dev = &pdev->dev; 194 otp->dev = &pdev->dev;
196 195
197 /* Replace platform data coming in with a local struct */ 196 /* Replace platform data coming in with a local struct */
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index fefbe4cfa61d..f3d689176fc2 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -113,7 +113,7 @@
113#define AB8500_SWITCH_OFF_STATUS 0x00 113#define AB8500_SWITCH_OFF_STATUS 0x00
114 114
115#define AB8500_TURN_ON_STATUS 0x00 115#define AB8500_TURN_ON_STATUS 0x00
116#define AB8505_TURN_ON_STATUS_2 0x04 116#define AB8505_TURN_ON_STATUS_2 0x04
117 117
118#define AB8500_CH_USBCH_STAT1_REG 0x02 118#define AB8500_CH_USBCH_STAT1_REG 0x02
119#define VBUS_DET_DBNC100 0x02 119#define VBUS_DET_DBNC100 0x02
@@ -211,7 +211,7 @@ static int set_register_interruptible(struct ab8500 *ab8500, u8 bank,
211 /* 211 /*
212 * Put the u8 bank and u8 register together into a an u16. 212 * Put the u8 bank and u8 register together into a an u16.
213 * The bank on higher 8 bits and register in lower 8 bits. 213 * The bank on higher 8 bits and register in lower 8 bits.
214 * */ 214 */
215 u16 addr = ((u16)bank) << 8 | reg; 215 u16 addr = ((u16)bank) << 8 | reg;
216 216
217 dev_vdbg(ab8500->dev, "wr: addr %#x <= %#x\n", addr, data); 217 dev_vdbg(ab8500->dev, "wr: addr %#x <= %#x\n", addr, data);
@@ -243,8 +243,6 @@ static int get_register_interruptible(struct ab8500 *ab8500, u8 bank,
243 u8 reg, u8 *value) 243 u8 reg, u8 *value)
244{ 244{
245 int ret; 245 int ret;
246 /* put the u8 bank and u8 reg together into a an u16.
247 * bank on higher 8 bits and reg in lower */
248 u16 addr = ((u16)bank) << 8 | reg; 246 u16 addr = ((u16)bank) << 8 | reg;
249 247
250 mutex_lock(&ab8500->lock); 248 mutex_lock(&ab8500->lock);
@@ -278,8 +276,6 @@ static int mask_and_set_register_interruptible(struct ab8500 *ab8500, u8 bank,
278 u8 reg, u8 bitmask, u8 bitvalues) 276 u8 reg, u8 bitmask, u8 bitvalues)
279{ 277{
280 int ret; 278 int ret;
281 /* put the u8 bank and u8 reg together into a an u16.
282 * bank on higher 8 bits and reg in lower */
283 u16 addr = ((u16)bank) << 8 | reg; 279 u16 addr = ((u16)bank) << 8 | reg;
284 280
285 mutex_lock(&ab8500->lock); 281 mutex_lock(&ab8500->lock);
@@ -449,12 +445,12 @@ static void update_latch_offset(u8 *offset, int i)
449{ 445{
450 /* Fix inconsistent ITFromLatch25 bit mapping... */ 446 /* Fix inconsistent ITFromLatch25 bit mapping... */
451 if (unlikely(*offset == 17)) 447 if (unlikely(*offset == 17))
452 *offset = 24; 448 *offset = 24;
453 /* Fix inconsistent ab8540 bit mapping... */ 449 /* Fix inconsistent ab8540 bit mapping... */
454 if (unlikely(*offset == 16)) 450 if (unlikely(*offset == 16))
455 *offset = 25; 451 *offset = 25;
456 if ((i == 3) && (*offset >= 24)) 452 if ((i == 3) && (*offset >= 24))
457 *offset += 2; 453 *offset += 2;
458} 454}
459 455
460static int ab8500_handle_hierarchical_line(struct ab8500 *ab8500, 456static int ab8500_handle_hierarchical_line(struct ab8500 *ab8500,
@@ -590,12 +586,12 @@ static int ab8500_irq_init(struct ab8500 *ab8500, struct device_node *np)
590 586
591 /* If ->irq_base is zero this will give a linear mapping */ 587 /* If ->irq_base is zero this will give a linear mapping */
592 ab8500->domain = irq_domain_add_simple(ab8500->dev->of_node, 588 ab8500->domain = irq_domain_add_simple(ab8500->dev->of_node,
593 num_irqs, 0, 589 num_irqs, 0,
594 &ab8500_irq_ops, ab8500); 590 &ab8500_irq_ops, ab8500);
595 591
596 if (!ab8500->domain) { 592 if (!ab8500->domain) {
597 dev_err(ab8500->dev, "Failed to create irqdomain\n"); 593 dev_err(ab8500->dev, "Failed to create irqdomain\n");
598 return -ENOSYS; 594 return -ENODEV;
599 } 595 }
600 596
601 return 0; 597 return 0;
@@ -609,442 +605,28 @@ int ab8500_suspend(struct ab8500 *ab8500)
609 return 0; 605 return 0;
610} 606}
611 607
612static struct resource ab8500_gpadc_resources[] = {
613 {
614 .name = "HW_CONV_END",
615 .start = AB8500_INT_GP_HW_ADC_CONV_END,
616 .end = AB8500_INT_GP_HW_ADC_CONV_END,
617 .flags = IORESOURCE_IRQ,
618 },
619 {
620 .name = "SW_CONV_END",
621 .start = AB8500_INT_GP_SW_ADC_CONV_END,
622 .end = AB8500_INT_GP_SW_ADC_CONV_END,
623 .flags = IORESOURCE_IRQ,
624 },
625};
626
627static struct resource ab8505_gpadc_resources[] = {
628 {
629 .name = "SW_CONV_END",
630 .start = AB8500_INT_GP_SW_ADC_CONV_END,
631 .end = AB8500_INT_GP_SW_ADC_CONV_END,
632 .flags = IORESOURCE_IRQ,
633 },
634};
635
636static struct resource ab8500_rtc_resources[] = {
637 {
638 .name = "60S",
639 .start = AB8500_INT_RTC_60S,
640 .end = AB8500_INT_RTC_60S,
641 .flags = IORESOURCE_IRQ,
642 },
643 {
644 .name = "ALARM",
645 .start = AB8500_INT_RTC_ALARM,
646 .end = AB8500_INT_RTC_ALARM,
647 .flags = IORESOURCE_IRQ,
648 },
649};
650
651static struct resource ab8540_rtc_resources[] = {
652 {
653 .name = "1S",
654 .start = AB8540_INT_RTC_1S,
655 .end = AB8540_INT_RTC_1S,
656 .flags = IORESOURCE_IRQ,
657 },
658 {
659 .name = "ALARM",
660 .start = AB8500_INT_RTC_ALARM,
661 .end = AB8500_INT_RTC_ALARM,
662 .flags = IORESOURCE_IRQ,
663 },
664};
665
666static struct resource ab8500_poweronkey_db_resources[] = {
667 {
668 .name = "ONKEY_DBF",
669 .start = AB8500_INT_PON_KEY1DB_F,
670 .end = AB8500_INT_PON_KEY1DB_F,
671 .flags = IORESOURCE_IRQ,
672 },
673 {
674 .name = "ONKEY_DBR",
675 .start = AB8500_INT_PON_KEY1DB_R,
676 .end = AB8500_INT_PON_KEY1DB_R,
677 .flags = IORESOURCE_IRQ,
678 },
679};
680
681static struct resource ab8500_av_acc_detect_resources[] = {
682 {
683 .name = "ACC_DETECT_1DB_F",
684 .start = AB8500_INT_ACC_DETECT_1DB_F,
685 .end = AB8500_INT_ACC_DETECT_1DB_F,
686 .flags = IORESOURCE_IRQ,
687 },
688 {
689 .name = "ACC_DETECT_1DB_R",
690 .start = AB8500_INT_ACC_DETECT_1DB_R,
691 .end = AB8500_INT_ACC_DETECT_1DB_R,
692 .flags = IORESOURCE_IRQ,
693 },
694 {
695 .name = "ACC_DETECT_21DB_F",
696 .start = AB8500_INT_ACC_DETECT_21DB_F,
697 .end = AB8500_INT_ACC_DETECT_21DB_F,
698 .flags = IORESOURCE_IRQ,
699 },
700 {
701 .name = "ACC_DETECT_21DB_R",
702 .start = AB8500_INT_ACC_DETECT_21DB_R,
703 .end = AB8500_INT_ACC_DETECT_21DB_R,
704 .flags = IORESOURCE_IRQ,
705 },
706 {
707 .name = "ACC_DETECT_22DB_F",
708 .start = AB8500_INT_ACC_DETECT_22DB_F,
709 .end = AB8500_INT_ACC_DETECT_22DB_F,
710 .flags = IORESOURCE_IRQ,
711 },
712 {
713 .name = "ACC_DETECT_22DB_R",
714 .start = AB8500_INT_ACC_DETECT_22DB_R,
715 .end = AB8500_INT_ACC_DETECT_22DB_R,
716 .flags = IORESOURCE_IRQ,
717 },
718};
719
720static struct resource ab8500_charger_resources[] = {
721 {
722 .name = "MAIN_CH_UNPLUG_DET",
723 .start = AB8500_INT_MAIN_CH_UNPLUG_DET,
724 .end = AB8500_INT_MAIN_CH_UNPLUG_DET,
725 .flags = IORESOURCE_IRQ,
726 },
727 {
728 .name = "MAIN_CHARGE_PLUG_DET",
729 .start = AB8500_INT_MAIN_CH_PLUG_DET,
730 .end = AB8500_INT_MAIN_CH_PLUG_DET,
731 .flags = IORESOURCE_IRQ,
732 },
733 {
734 .name = "VBUS_DET_R",
735 .start = AB8500_INT_VBUS_DET_R,
736 .end = AB8500_INT_VBUS_DET_R,
737 .flags = IORESOURCE_IRQ,
738 },
739 {
740 .name = "VBUS_DET_F",
741 .start = AB8500_INT_VBUS_DET_F,
742 .end = AB8500_INT_VBUS_DET_F,
743 .flags = IORESOURCE_IRQ,
744 },
745 {
746 .name = "USB_LINK_STATUS",
747 .start = AB8500_INT_USB_LINK_STATUS,
748 .end = AB8500_INT_USB_LINK_STATUS,
749 .flags = IORESOURCE_IRQ,
750 },
751 {
752 .name = "VBUS_OVV",
753 .start = AB8500_INT_VBUS_OVV,
754 .end = AB8500_INT_VBUS_OVV,
755 .flags = IORESOURCE_IRQ,
756 },
757 {
758 .name = "USB_CH_TH_PROT_R",
759 .start = AB8500_INT_USB_CH_TH_PROT_R,
760 .end = AB8500_INT_USB_CH_TH_PROT_R,
761 .flags = IORESOURCE_IRQ,
762 },
763 {
764 .name = "USB_CH_TH_PROT_F",
765 .start = AB8500_INT_USB_CH_TH_PROT_F,
766 .end = AB8500_INT_USB_CH_TH_PROT_F,
767 .flags = IORESOURCE_IRQ,
768 },
769 {
770 .name = "MAIN_EXT_CH_NOT_OK",
771 .start = AB8500_INT_MAIN_EXT_CH_NOT_OK,
772 .end = AB8500_INT_MAIN_EXT_CH_NOT_OK,
773 .flags = IORESOURCE_IRQ,
774 },
775 {
776 .name = "MAIN_CH_TH_PROT_R",
777 .start = AB8500_INT_MAIN_CH_TH_PROT_R,
778 .end = AB8500_INT_MAIN_CH_TH_PROT_R,
779 .flags = IORESOURCE_IRQ,
780 },
781 {
782 .name = "MAIN_CH_TH_PROT_F",
783 .start = AB8500_INT_MAIN_CH_TH_PROT_F,
784 .end = AB8500_INT_MAIN_CH_TH_PROT_F,
785 .flags = IORESOURCE_IRQ,
786 },
787 {
788 .name = "USB_CHARGER_NOT_OKR",
789 .start = AB8500_INT_USB_CHARGER_NOT_OKR,
790 .end = AB8500_INT_USB_CHARGER_NOT_OKR,
791 .flags = IORESOURCE_IRQ,
792 },
793 {
794 .name = "CH_WD_EXP",
795 .start = AB8500_INT_CH_WD_EXP,
796 .end = AB8500_INT_CH_WD_EXP,
797 .flags = IORESOURCE_IRQ,
798 },
799 {
800 .name = "VBUS_CH_DROP_END",
801 .start = AB8500_INT_VBUS_CH_DROP_END,
802 .end = AB8500_INT_VBUS_CH_DROP_END,
803 .flags = IORESOURCE_IRQ,
804 },
805};
806
807static struct resource ab8500_btemp_resources[] = {
808 {
809 .name = "BAT_CTRL_INDB",
810 .start = AB8500_INT_BAT_CTRL_INDB,
811 .end = AB8500_INT_BAT_CTRL_INDB,
812 .flags = IORESOURCE_IRQ,
813 },
814 {
815 .name = "BTEMP_LOW",
816 .start = AB8500_INT_BTEMP_LOW,
817 .end = AB8500_INT_BTEMP_LOW,
818 .flags = IORESOURCE_IRQ,
819 },
820 {
821 .name = "BTEMP_HIGH",
822 .start = AB8500_INT_BTEMP_HIGH,
823 .end = AB8500_INT_BTEMP_HIGH,
824 .flags = IORESOURCE_IRQ,
825 },
826 {
827 .name = "BTEMP_LOW_MEDIUM",
828 .start = AB8500_INT_BTEMP_LOW_MEDIUM,
829 .end = AB8500_INT_BTEMP_LOW_MEDIUM,
830 .flags = IORESOURCE_IRQ,
831 },
832 {
833 .name = "BTEMP_MEDIUM_HIGH",
834 .start = AB8500_INT_BTEMP_MEDIUM_HIGH,
835 .end = AB8500_INT_BTEMP_MEDIUM_HIGH,
836 .flags = IORESOURCE_IRQ,
837 },
838};
839
840static struct resource ab8500_fg_resources[] = {
841 {
842 .name = "NCONV_ACCU",
843 .start = AB8500_INT_CCN_CONV_ACC,
844 .end = AB8500_INT_CCN_CONV_ACC,
845 .flags = IORESOURCE_IRQ,
846 },
847 {
848 .name = "BATT_OVV",
849 .start = AB8500_INT_BATT_OVV,
850 .end = AB8500_INT_BATT_OVV,
851 .flags = IORESOURCE_IRQ,
852 },
853 {
854 .name = "LOW_BAT_F",
855 .start = AB8500_INT_LOW_BAT_F,
856 .end = AB8500_INT_LOW_BAT_F,
857 .flags = IORESOURCE_IRQ,
858 },
859 {
860 .name = "LOW_BAT_R",
861 .start = AB8500_INT_LOW_BAT_R,
862 .end = AB8500_INT_LOW_BAT_R,
863 .flags = IORESOURCE_IRQ,
864 },
865 {
866 .name = "CC_INT_CALIB",
867 .start = AB8500_INT_CC_INT_CALIB,
868 .end = AB8500_INT_CC_INT_CALIB,
869 .flags = IORESOURCE_IRQ,
870 },
871 {
872 .name = "CCEOC",
873 .start = AB8500_INT_CCEOC,
874 .end = AB8500_INT_CCEOC,
875 .flags = IORESOURCE_IRQ,
876 },
877};
878
879static struct resource ab8500_chargalg_resources[] = {};
880
881#ifdef CONFIG_DEBUG_FS
882static struct resource ab8500_debug_resources[] = {
883 {
884 .name = "IRQ_AB8500",
885 /*
886 * Number will be filled in. NOTE: this is deliberately
887 * not flagged as an IRQ in ordet to avoid remapping using
888 * the irqdomain in the MFD core, so that this IRQ passes
889 * unremapped to the debug code.
890 */
891 },
892 {
893 .name = "IRQ_FIRST",
894 .start = AB8500_INT_MAIN_EXT_CH_NOT_OK,
895 .end = AB8500_INT_MAIN_EXT_CH_NOT_OK,
896 .flags = IORESOURCE_IRQ,
897 },
898 {
899 .name = "IRQ_LAST",
900 .start = AB8500_INT_XTAL32K_KO,
901 .end = AB8500_INT_XTAL32K_KO,
902 .flags = IORESOURCE_IRQ,
903 },
904};
905#endif
906
907static struct resource ab8500_usb_resources[] = {
908 {
909 .name = "ID_WAKEUP_R",
910 .start = AB8500_INT_ID_WAKEUP_R,
911 .end = AB8500_INT_ID_WAKEUP_R,
912 .flags = IORESOURCE_IRQ,
913 },
914 {
915 .name = "ID_WAKEUP_F",
916 .start = AB8500_INT_ID_WAKEUP_F,
917 .end = AB8500_INT_ID_WAKEUP_F,
918 .flags = IORESOURCE_IRQ,
919 },
920 {
921 .name = "VBUS_DET_F",
922 .start = AB8500_INT_VBUS_DET_F,
923 .end = AB8500_INT_VBUS_DET_F,
924 .flags = IORESOURCE_IRQ,
925 },
926 {
927 .name = "VBUS_DET_R",
928 .start = AB8500_INT_VBUS_DET_R,
929 .end = AB8500_INT_VBUS_DET_R,
930 .flags = IORESOURCE_IRQ,
931 },
932 {
933 .name = "USB_LINK_STATUS",
934 .start = AB8500_INT_USB_LINK_STATUS,
935 .end = AB8500_INT_USB_LINK_STATUS,
936 .flags = IORESOURCE_IRQ,
937 },
938 {
939 .name = "USB_ADP_PROBE_PLUG",
940 .start = AB8500_INT_ADP_PROBE_PLUG,
941 .end = AB8500_INT_ADP_PROBE_PLUG,
942 .flags = IORESOURCE_IRQ,
943 },
944 {
945 .name = "USB_ADP_PROBE_UNPLUG",
946 .start = AB8500_INT_ADP_PROBE_UNPLUG,
947 .end = AB8500_INT_ADP_PROBE_UNPLUG,
948 .flags = IORESOURCE_IRQ,
949 },
950};
951
952static struct resource ab8505_iddet_resources[] = {
953 {
954 .name = "KeyDeglitch",
955 .start = AB8505_INT_KEYDEGLITCH,
956 .end = AB8505_INT_KEYDEGLITCH,
957 .flags = IORESOURCE_IRQ,
958 },
959 {
960 .name = "KP",
961 .start = AB8505_INT_KP,
962 .end = AB8505_INT_KP,
963 .flags = IORESOURCE_IRQ,
964 },
965 {
966 .name = "IKP",
967 .start = AB8505_INT_IKP,
968 .end = AB8505_INT_IKP,
969 .flags = IORESOURCE_IRQ,
970 },
971 {
972 .name = "IKR",
973 .start = AB8505_INT_IKR,
974 .end = AB8505_INT_IKR,
975 .flags = IORESOURCE_IRQ,
976 },
977 {
978 .name = "KeyStuck",
979 .start = AB8505_INT_KEYSTUCK,
980 .end = AB8505_INT_KEYSTUCK,
981 .flags = IORESOURCE_IRQ,
982 },
983 {
984 .name = "VBUS_DET_R",
985 .start = AB8500_INT_VBUS_DET_R,
986 .end = AB8500_INT_VBUS_DET_R,
987 .flags = IORESOURCE_IRQ,
988 },
989 {
990 .name = "VBUS_DET_F",
991 .start = AB8500_INT_VBUS_DET_F,
992 .end = AB8500_INT_VBUS_DET_F,
993 .flags = IORESOURCE_IRQ,
994 },
995 {
996 .name = "ID_DET_PLUGR",
997 .start = AB8500_INT_ID_DET_PLUGR,
998 .end = AB8500_INT_ID_DET_PLUGR,
999 .flags = IORESOURCE_IRQ,
1000 },
1001 {
1002 .name = "ID_DET_PLUGF",
1003 .start = AB8500_INT_ID_DET_PLUGF,
1004 .end = AB8500_INT_ID_DET_PLUGF,
1005 .flags = IORESOURCE_IRQ,
1006 },
1007};
1008
1009static struct resource ab8500_temp_resources[] = {
1010 {
1011 .name = "ABX500_TEMP_WARM",
1012 .start = AB8500_INT_TEMP_WARM,
1013 .end = AB8500_INT_TEMP_WARM,
1014 .flags = IORESOURCE_IRQ,
1015 },
1016};
1017
1018static const struct mfd_cell ab8500_bm_devs[] = { 608static const struct mfd_cell ab8500_bm_devs[] = {
1019 { 609 {
1020 .name = "ab8500-charger", 610 .name = "ab8500-charger",
1021 .of_compatible = "stericsson,ab8500-charger", 611 .of_compatible = "stericsson,ab8500-charger",
1022 .num_resources = ARRAY_SIZE(ab8500_charger_resources),
1023 .resources = ab8500_charger_resources,
1024 .platform_data = &ab8500_bm_data, 612 .platform_data = &ab8500_bm_data,
1025 .pdata_size = sizeof(ab8500_bm_data), 613 .pdata_size = sizeof(ab8500_bm_data),
1026 }, 614 },
1027 { 615 {
1028 .name = "ab8500-btemp", 616 .name = "ab8500-btemp",
1029 .of_compatible = "stericsson,ab8500-btemp", 617 .of_compatible = "stericsson,ab8500-btemp",
1030 .num_resources = ARRAY_SIZE(ab8500_btemp_resources),
1031 .resources = ab8500_btemp_resources,
1032 .platform_data = &ab8500_bm_data, 618 .platform_data = &ab8500_bm_data,
1033 .pdata_size = sizeof(ab8500_bm_data), 619 .pdata_size = sizeof(ab8500_bm_data),
1034 }, 620 },
1035 { 621 {
1036 .name = "ab8500-fg", 622 .name = "ab8500-fg",
1037 .of_compatible = "stericsson,ab8500-fg", 623 .of_compatible = "stericsson,ab8500-fg",
1038 .num_resources = ARRAY_SIZE(ab8500_fg_resources),
1039 .resources = ab8500_fg_resources,
1040 .platform_data = &ab8500_bm_data, 624 .platform_data = &ab8500_bm_data,
1041 .pdata_size = sizeof(ab8500_bm_data), 625 .pdata_size = sizeof(ab8500_bm_data),
1042 }, 626 },
1043 { 627 {
1044 .name = "ab8500-chargalg", 628 .name = "ab8500-chargalg",
1045 .of_compatible = "stericsson,ab8500-chargalg", 629 .of_compatible = "stericsson,ab8500-chargalg",
1046 .num_resources = ARRAY_SIZE(ab8500_chargalg_resources),
1047 .resources = ab8500_chargalg_resources,
1048 .platform_data = &ab8500_bm_data, 630 .platform_data = &ab8500_bm_data,
1049 .pdata_size = sizeof(ab8500_bm_data), 631 .pdata_size = sizeof(ab8500_bm_data),
1050 }, 632 },
@@ -1055,8 +637,6 @@ static const struct mfd_cell ab8500_devs[] = {
1055 { 637 {
1056 .name = "ab8500-debug", 638 .name = "ab8500-debug",
1057 .of_compatible = "stericsson,ab8500-debug", 639 .of_compatible = "stericsson,ab8500-debug",
1058 .num_resources = ARRAY_SIZE(ab8500_debug_resources),
1059 .resources = ab8500_debug_resources,
1060 }, 640 },
1061#endif 641#endif
1062 { 642 {
@@ -1078,27 +658,19 @@ static const struct mfd_cell ab8500_devs[] = {
1078 { 658 {
1079 .name = "ab8500-gpadc", 659 .name = "ab8500-gpadc",
1080 .of_compatible = "stericsson,ab8500-gpadc", 660 .of_compatible = "stericsson,ab8500-gpadc",
1081 .num_resources = ARRAY_SIZE(ab8500_gpadc_resources),
1082 .resources = ab8500_gpadc_resources,
1083 }, 661 },
1084 { 662 {
1085 .name = "ab8500-rtc", 663 .name = "ab8500-rtc",
1086 .of_compatible = "stericsson,ab8500-rtc", 664 .of_compatible = "stericsson,ab8500-rtc",
1087 .num_resources = ARRAY_SIZE(ab8500_rtc_resources),
1088 .resources = ab8500_rtc_resources,
1089 }, 665 },
1090 { 666 {
1091 .name = "ab8500-acc-det", 667 .name = "ab8500-acc-det",
1092 .of_compatible = "stericsson,ab8500-acc-det", 668 .of_compatible = "stericsson,ab8500-acc-det",
1093 .num_resources = ARRAY_SIZE(ab8500_av_acc_detect_resources),
1094 .resources = ab8500_av_acc_detect_resources,
1095 }, 669 },
1096 { 670 {
1097 671
1098 .name = "ab8500-poweron-key", 672 .name = "ab8500-poweron-key",
1099 .of_compatible = "stericsson,ab8500-poweron-key", 673 .of_compatible = "stericsson,ab8500-poweron-key",
1100 .num_resources = ARRAY_SIZE(ab8500_poweronkey_db_resources),
1101 .resources = ab8500_poweronkey_db_resources,
1102 }, 674 },
1103 { 675 {
1104 .name = "ab8500-pwm", 676 .name = "ab8500-pwm",
@@ -1126,14 +698,10 @@ static const struct mfd_cell ab8500_devs[] = {
1126 { 698 {
1127 .name = "abx500-temp", 699 .name = "abx500-temp",
1128 .of_compatible = "stericsson,abx500-temp", 700 .of_compatible = "stericsson,abx500-temp",
1129 .num_resources = ARRAY_SIZE(ab8500_temp_resources),
1130 .resources = ab8500_temp_resources,
1131 }, 701 },
1132 { 702 {
1133 .name = "ab8500-usb", 703 .name = "ab8500-usb",
1134 .of_compatible = "stericsson,ab8500-usb", 704 .of_compatible = "stericsson,ab8500-usb",
1135 .num_resources = ARRAY_SIZE(ab8500_usb_resources),
1136 .resources = ab8500_usb_resources,
1137 }, 705 },
1138 { 706 {
1139 .name = "ab8500-codec", 707 .name = "ab8500-codec",
@@ -1145,8 +713,6 @@ static const struct mfd_cell ab9540_devs[] = {
1145#ifdef CONFIG_DEBUG_FS 713#ifdef CONFIG_DEBUG_FS
1146 { 714 {
1147 .name = "ab8500-debug", 715 .name = "ab8500-debug",
1148 .num_resources = ARRAY_SIZE(ab8500_debug_resources),
1149 .resources = ab8500_debug_resources,
1150 }, 716 },
1151#endif 717#endif
1152 { 718 {
@@ -1165,23 +731,15 @@ static const struct mfd_cell ab9540_devs[] = {
1165 { 731 {
1166 .name = "ab8500-gpadc", 732 .name = "ab8500-gpadc",
1167 .of_compatible = "stericsson,ab8500-gpadc", 733 .of_compatible = "stericsson,ab8500-gpadc",
1168 .num_resources = ARRAY_SIZE(ab8500_gpadc_resources),
1169 .resources = ab8500_gpadc_resources,
1170 }, 734 },
1171 { 735 {
1172 .name = "ab8500-rtc", 736 .name = "ab8500-rtc",
1173 .num_resources = ARRAY_SIZE(ab8500_rtc_resources),
1174 .resources = ab8500_rtc_resources,
1175 }, 737 },
1176 { 738 {
1177 .name = "ab8500-acc-det", 739 .name = "ab8500-acc-det",
1178 .num_resources = ARRAY_SIZE(ab8500_av_acc_detect_resources),
1179 .resources = ab8500_av_acc_detect_resources,
1180 }, 740 },
1181 { 741 {
1182 .name = "ab8500-poweron-key", 742 .name = "ab8500-poweron-key",
1183 .num_resources = ARRAY_SIZE(ab8500_poweronkey_db_resources),
1184 .resources = ab8500_poweronkey_db_resources,
1185 }, 743 },
1186 { 744 {
1187 .name = "ab8500-pwm", 745 .name = "ab8500-pwm",
@@ -1189,8 +747,6 @@ static const struct mfd_cell ab9540_devs[] = {
1189 }, 747 },
1190 { 748 {
1191 .name = "abx500-temp", 749 .name = "abx500-temp",
1192 .num_resources = ARRAY_SIZE(ab8500_temp_resources),
1193 .resources = ab8500_temp_resources,
1194 }, 750 },
1195 { 751 {
1196 .name = "pinctrl-ab9540", 752 .name = "pinctrl-ab9540",
@@ -1198,16 +754,12 @@ static const struct mfd_cell ab9540_devs[] = {
1198 }, 754 },
1199 { 755 {
1200 .name = "ab9540-usb", 756 .name = "ab9540-usb",
1201 .num_resources = ARRAY_SIZE(ab8500_usb_resources),
1202 .resources = ab8500_usb_resources,
1203 }, 757 },
1204 { 758 {
1205 .name = "ab9540-codec", 759 .name = "ab9540-codec",
1206 }, 760 },
1207 { 761 {
1208 .name = "ab-iddet", 762 .name = "ab-iddet",
1209 .num_resources = ARRAY_SIZE(ab8505_iddet_resources),
1210 .resources = ab8505_iddet_resources,
1211 }, 763 },
1212}; 764};
1213 765
@@ -1216,8 +768,6 @@ static const struct mfd_cell ab8505_devs[] = {
1216#ifdef CONFIG_DEBUG_FS 768#ifdef CONFIG_DEBUG_FS
1217 { 769 {
1218 .name = "ab8500-debug", 770 .name = "ab8500-debug",
1219 .num_resources = ARRAY_SIZE(ab8500_debug_resources),
1220 .resources = ab8500_debug_resources,
1221 }, 771 },
1222#endif 772#endif
1223 { 773 {
@@ -1233,23 +783,15 @@ static const struct mfd_cell ab8505_devs[] = {
1233 { 783 {
1234 .name = "ab8500-gpadc", 784 .name = "ab8500-gpadc",
1235 .of_compatible = "stericsson,ab8500-gpadc", 785 .of_compatible = "stericsson,ab8500-gpadc",
1236 .num_resources = ARRAY_SIZE(ab8505_gpadc_resources),
1237 .resources = ab8505_gpadc_resources,
1238 }, 786 },
1239 { 787 {
1240 .name = "ab8500-rtc", 788 .name = "ab8500-rtc",
1241 .num_resources = ARRAY_SIZE(ab8500_rtc_resources),
1242 .resources = ab8500_rtc_resources,
1243 }, 789 },
1244 { 790 {
1245 .name = "ab8500-acc-det", 791 .name = "ab8500-acc-det",
1246 .num_resources = ARRAY_SIZE(ab8500_av_acc_detect_resources),
1247 .resources = ab8500_av_acc_detect_resources,
1248 }, 792 },
1249 { 793 {
1250 .name = "ab8500-poweron-key", 794 .name = "ab8500-poweron-key",
1251 .num_resources = ARRAY_SIZE(ab8500_poweronkey_db_resources),
1252 .resources = ab8500_poweronkey_db_resources,
1253 }, 795 },
1254 { 796 {
1255 .name = "ab8500-pwm", 797 .name = "ab8500-pwm",
@@ -1260,16 +802,12 @@ static const struct mfd_cell ab8505_devs[] = {
1260 }, 802 },
1261 { 803 {
1262 .name = "ab8500-usb", 804 .name = "ab8500-usb",
1263 .num_resources = ARRAY_SIZE(ab8500_usb_resources),
1264 .resources = ab8500_usb_resources,
1265 }, 805 },
1266 { 806 {
1267 .name = "ab8500-codec", 807 .name = "ab8500-codec",
1268 }, 808 },
1269 { 809 {
1270 .name = "ab-iddet", 810 .name = "ab-iddet",
1271 .num_resources = ARRAY_SIZE(ab8505_iddet_resources),
1272 .resources = ab8505_iddet_resources,
1273 }, 811 },
1274}; 812};
1275 813
@@ -1277,8 +815,6 @@ static const struct mfd_cell ab8540_devs[] = {
1277#ifdef CONFIG_DEBUG_FS 815#ifdef CONFIG_DEBUG_FS
1278 { 816 {
1279 .name = "ab8500-debug", 817 .name = "ab8500-debug",
1280 .num_resources = ARRAY_SIZE(ab8500_debug_resources),
1281 .resources = ab8500_debug_resources,
1282 }, 818 },
1283#endif 819#endif
1284 { 820 {
@@ -1297,18 +833,12 @@ static const struct mfd_cell ab8540_devs[] = {
1297 { 833 {
1298 .name = "ab8500-gpadc", 834 .name = "ab8500-gpadc",
1299 .of_compatible = "stericsson,ab8500-gpadc", 835 .of_compatible = "stericsson,ab8500-gpadc",
1300 .num_resources = ARRAY_SIZE(ab8505_gpadc_resources),
1301 .resources = ab8505_gpadc_resources,
1302 }, 836 },
1303 { 837 {
1304 .name = "ab8500-acc-det", 838 .name = "ab8500-acc-det",
1305 .num_resources = ARRAY_SIZE(ab8500_av_acc_detect_resources),
1306 .resources = ab8500_av_acc_detect_resources,
1307 }, 839 },
1308 { 840 {
1309 .name = "ab8500-poweron-key", 841 .name = "ab8500-poweron-key",
1310 .num_resources = ARRAY_SIZE(ab8500_poweronkey_db_resources),
1311 .resources = ab8500_poweronkey_db_resources,
1312 }, 842 },
1313 { 843 {
1314 .name = "ab8500-pwm", 844 .name = "ab8500-pwm",
@@ -1316,24 +846,18 @@ static const struct mfd_cell ab8540_devs[] = {
1316 }, 846 },
1317 { 847 {
1318 .name = "abx500-temp", 848 .name = "abx500-temp",
1319 .num_resources = ARRAY_SIZE(ab8500_temp_resources),
1320 .resources = ab8500_temp_resources,
1321 }, 849 },
1322 { 850 {
1323 .name = "pinctrl-ab8540", 851 .name = "pinctrl-ab8540",
1324 }, 852 },
1325 { 853 {
1326 .name = "ab8540-usb", 854 .name = "ab8540-usb",
1327 .num_resources = ARRAY_SIZE(ab8500_usb_resources),
1328 .resources = ab8500_usb_resources,
1329 }, 855 },
1330 { 856 {
1331 .name = "ab8540-codec", 857 .name = "ab8540-codec",
1332 }, 858 },
1333 { 859 {
1334 .name = "ab-iddet", 860 .name = "ab-iddet",
1335 .num_resources = ARRAY_SIZE(ab8505_iddet_resources),
1336 .resources = ab8505_iddet_resources,
1337 }, 861 },
1338}; 862};
1339 863
@@ -1341,8 +865,6 @@ static const struct mfd_cell ab8540_cut1_devs[] = {
1341 { 865 {
1342 .name = "ab8500-rtc", 866 .name = "ab8500-rtc",
1343 .of_compatible = "stericsson,ab8500-rtc", 867 .of_compatible = "stericsson,ab8500-rtc",
1344 .num_resources = ARRAY_SIZE(ab8500_rtc_resources),
1345 .resources = ab8500_rtc_resources,
1346 }, 868 },
1347}; 869};
1348 870
@@ -1350,8 +872,6 @@ static const struct mfd_cell ab8540_cut2_devs[] = {
1350 { 872 {
1351 .name = "ab8540-rtc", 873 .name = "ab8540-rtc",
1352 .of_compatible = "stericsson,ab8540-rtc", 874 .of_compatible = "stericsson,ab8540-rtc",
1353 .num_resources = ARRAY_SIZE(ab8540_rtc_resources),
1354 .resources = ab8540_rtc_resources,
1355 }, 875 },
1356}; 876};
1357 877
@@ -1549,7 +1069,7 @@ static struct attribute_group ab9540_attr_group = {
1549 1069
1550static int ab8500_probe(struct platform_device *pdev) 1070static int ab8500_probe(struct platform_device *pdev)
1551{ 1071{
1552 static const char *switch_off_status[] = { 1072 static const char * const switch_off_status[] = {
1553 "Swoff bit programming", 1073 "Swoff bit programming",
1554 "Thermal protection activation", 1074 "Thermal protection activation",
1555 "Vbat lower then BattOk falling threshold", 1075 "Vbat lower then BattOk falling threshold",
@@ -1558,7 +1078,7 @@ static int ab8500_probe(struct platform_device *pdev)
1558 "Battery level lower than power on reset threshold", 1078 "Battery level lower than power on reset threshold",
1559 "Power on key 1 pressed longer than 10 seconds", 1079 "Power on key 1 pressed longer than 10 seconds",
1560 "DB8500 thermal shutdown"}; 1080 "DB8500 thermal shutdown"};
1561 static const char *turn_on_status[] = { 1081 static const char * const turn_on_status[] = {
1562 "Battery rising (Vbat)", 1082 "Battery rising (Vbat)",
1563 "Power On Key 1 dbF", 1083 "Power On Key 1 dbF",
1564 "Power On Key 2 dbF", 1084 "Power On Key 2 dbF",
@@ -1750,12 +1270,6 @@ static int ab8500_probe(struct platform_device *pdev)
1750 if (ret) 1270 if (ret)
1751 return ret; 1271 return ret;
1752 1272
1753#ifdef CONFIG_DEBUG_FS
1754 /* Pass to debugfs */
1755 ab8500_debug_resources[0].start = ab8500->irq;
1756 ab8500_debug_resources[0].end = ab8500->irq;
1757#endif
1758
1759 if (is_ab9540(ab8500)) 1273 if (is_ab9540(ab8500))
1760 ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs, 1274 ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs,
1761 ARRAY_SIZE(ab9540_devs), NULL, 1275 ARRAY_SIZE(ab9540_devs), NULL,
diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index 0236cd7cdce4..69d9fffe5b5c 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -242,8 +242,10 @@ static struct ab8500_prcmu_ranges ab8500_debug_ranges[AB8500_NUM_BANKS] = {
242 .first = 0x40, 242 .first = 0x40,
243 .last = 0x44, 243 .last = 0x44,
244 }, 244 },
245 /* 0x80-0x8B is SIM registers and should 245 /*
246 * not be accessed from here */ 246 * 0x80-0x8B are SIM registers and should
247 * not be accessed from here
248 */
247 }, 249 },
248 }, 250 },
249 [AB8500_USB] = { 251 [AB8500_USB] = {
@@ -587,8 +589,10 @@ static struct ab8500_prcmu_ranges ab8505_debug_ranges[AB8500_NUM_BANKS] = {
587 .first = 0x40, 589 .first = 0x40,
588 .last = 0x48, 590 .last = 0x48,
589 }, 591 },
590 /* 0x80-0x8B is SIM registers and should 592 /*
591 * not be accessed from here */ 593 * 0x80-0x8B are SIM registers and should
594 * not be accessed from here
595 */
592 }, 596 },
593 }, 597 },
594 [AB8500_USB] = { 598 [AB8500_USB] = {
@@ -1306,8 +1310,10 @@ static int ab8500_registers_print(struct device *dev, u32 bank,
1306 if (s) { 1310 if (s) {
1307 seq_printf(s, " [0x%02X/0x%02X]: 0x%02X\n", 1311 seq_printf(s, " [0x%02X/0x%02X]: 0x%02X\n",
1308 bank, reg, value); 1312 bank, reg, value);
1309 /* Error is not returned here since 1313 /*
1310 * the output is wanted in any case */ 1314 * Error is not returned here since
1315 * the output is wanted in any case
1316 */
1311 if (seq_has_overflowed(s)) 1317 if (seq_has_overflowed(s))
1312 return 0; 1318 return 0;
1313 } else { 1319 } else {
@@ -2740,10 +2746,9 @@ static ssize_t hwreg_common_write(char *b, struct hwreg_cfg *cfg,
2740 *cfg = loc; 2746 *cfg = loc;
2741 2747
2742#ifdef ABB_HWREG_DEBUG 2748#ifdef ABB_HWREG_DEBUG
2743 pr_warn("HWREG request: %s, %s,\n" 2749 pr_warn("HWREG request: %s, %s,\n", (write) ? "write" : "read",
2744 " addr=0x%08X, mask=0x%X, shift=%d" "value=0x%X\n", 2750 REG_FMT_DEC(cfg) ? "decimal" : "hexa");
2745 (write) ? "write" : "read", 2751 pr_warn(" addr=0x%08X, mask=0x%X, shift=%d" "value=0x%X\n",
2746 REG_FMT_DEC(cfg) ? "decimal" : "hexa",
2747 cfg->addr, cfg->mask, cfg->shift, val); 2752 cfg->addr, cfg->mask, cfg->shift, val);
2748#endif 2753#endif
2749 2754
diff --git a/drivers/mfd/ab8500-gpadc.c b/drivers/mfd/ab8500-gpadc.c
index c51c1b188d64..97dcadc8fa8b 100644
--- a/drivers/mfd/ab8500-gpadc.c
+++ b/drivers/mfd/ab8500-gpadc.c
@@ -49,61 +49,61 @@
49 * OTP register offsets 49 * OTP register offsets
50 * Bank : 0x15 50 * Bank : 0x15
51 */ 51 */
52#define AB8500_GPADC_CAL_1 0x0F 52#define AB8500_GPADC_CAL_1 0x0F
53#define AB8500_GPADC_CAL_2 0x10 53#define AB8500_GPADC_CAL_2 0x10
54#define AB8500_GPADC_CAL_3 0x11 54#define AB8500_GPADC_CAL_3 0x11
55#define AB8500_GPADC_CAL_4 0x12 55#define AB8500_GPADC_CAL_4 0x12
56#define AB8500_GPADC_CAL_5 0x13 56#define AB8500_GPADC_CAL_5 0x13
57#define AB8500_GPADC_CAL_6 0x14 57#define AB8500_GPADC_CAL_6 0x14
58#define AB8500_GPADC_CAL_7 0x15 58#define AB8500_GPADC_CAL_7 0x15
59/* New calibration for 8540 */ 59/* New calibration for 8540 */
60#define AB8540_GPADC_OTP4_REG_7 0x38 60#define AB8540_GPADC_OTP4_REG_7 0x38
61#define AB8540_GPADC_OTP4_REG_6 0x39 61#define AB8540_GPADC_OTP4_REG_6 0x39
62#define AB8540_GPADC_OTP4_REG_5 0x3A 62#define AB8540_GPADC_OTP4_REG_5 0x3A
63 63
64/* gpadc constants */ 64/* gpadc constants */
65#define EN_VINTCORE12 0x04 65#define EN_VINTCORE12 0x04
66#define EN_VTVOUT 0x02 66#define EN_VTVOUT 0x02
67#define EN_GPADC 0x01 67#define EN_GPADC 0x01
68#define DIS_GPADC 0x00 68#define DIS_GPADC 0x00
69#define AVG_1 0x00 69#define AVG_1 0x00
70#define AVG_4 0x20 70#define AVG_4 0x20
71#define AVG_8 0x40 71#define AVG_8 0x40
72#define AVG_16 0x60 72#define AVG_16 0x60
73#define ADC_SW_CONV 0x04 73#define ADC_SW_CONV 0x04
74#define EN_ICHAR 0x80 74#define EN_ICHAR 0x80
75#define BTEMP_PULL_UP 0x08 75#define BTEMP_PULL_UP 0x08
76#define EN_BUF 0x40 76#define EN_BUF 0x40
77#define DIS_ZERO 0x00 77#define DIS_ZERO 0x00
78#define GPADC_BUSY 0x01 78#define GPADC_BUSY 0x01
79#define EN_FALLING 0x10 79#define EN_FALLING 0x10
80#define EN_TRIG_EDGE 0x02 80#define EN_TRIG_EDGE 0x02
81#define EN_VBIAS_XTAL_TEMP 0x02 81#define EN_VBIAS_XTAL_TEMP 0x02
82 82
83/* GPADC constants from AB8500 spec, UM0836 */ 83/* GPADC constants from AB8500 spec, UM0836 */
84#define ADC_RESOLUTION 1024 84#define ADC_RESOLUTION 1024
85#define ADC_CH_BTEMP_MIN 0 85#define ADC_CH_BTEMP_MIN 0
86#define ADC_CH_BTEMP_MAX 1350 86#define ADC_CH_BTEMP_MAX 1350
87#define ADC_CH_DIETEMP_MIN 0 87#define ADC_CH_DIETEMP_MIN 0
88#define ADC_CH_DIETEMP_MAX 1350 88#define ADC_CH_DIETEMP_MAX 1350
89#define ADC_CH_CHG_V_MIN 0 89#define ADC_CH_CHG_V_MIN 0
90#define ADC_CH_CHG_V_MAX 20030 90#define ADC_CH_CHG_V_MAX 20030
91#define ADC_CH_ACCDET2_MIN 0 91#define ADC_CH_ACCDET2_MIN 0
92#define ADC_CH_ACCDET2_MAX 2500 92#define ADC_CH_ACCDET2_MAX 2500
93#define ADC_CH_VBAT_MIN 2300 93#define ADC_CH_VBAT_MIN 2300
94#define ADC_CH_VBAT_MAX 4800 94#define ADC_CH_VBAT_MAX 4800
95#define ADC_CH_CHG_I_MIN 0 95#define ADC_CH_CHG_I_MIN 0
96#define ADC_CH_CHG_I_MAX 1500 96#define ADC_CH_CHG_I_MAX 1500
97#define ADC_CH_BKBAT_MIN 0 97#define ADC_CH_BKBAT_MIN 0
98#define ADC_CH_BKBAT_MAX 3200 98#define ADC_CH_BKBAT_MAX 3200
99 99
100/* GPADC constants from AB8540 spec */ 100/* GPADC constants from AB8540 spec */
101#define ADC_CH_IBAT_MIN (-6000) /* mA range measured by ADC for ibat*/ 101#define ADC_CH_IBAT_MIN (-6000) /* mA range measured by ADC for ibat */
102#define ADC_CH_IBAT_MAX 6000 102#define ADC_CH_IBAT_MAX 6000
103#define ADC_CH_IBAT_MIN_V (-60) /* mV range measured by ADC for ibat*/ 103#define ADC_CH_IBAT_MIN_V (-60) /* mV range measured by ADC for ibat */
104#define ADC_CH_IBAT_MAX_V 60 104#define ADC_CH_IBAT_MAX_V 60
105#define IBAT_VDROP_L (-56) /* mV */ 105#define IBAT_VDROP_L (-56) /* mV */
106#define IBAT_VDROP_H 56 106#define IBAT_VDROP_H 56
107 107
108/* This is used to not lose precision when dividing to get gain and offset */ 108/* This is used to not lose precision when dividing to get gain and offset */
109#define CALIB_SCALE 1000 109#define CALIB_SCALE 1000
@@ -179,7 +179,7 @@ struct ab8500_gpadc *ab8500_gpadc_get(char *name)
179 179
180 list_for_each_entry(gpadc, &ab8500_gpadc_list, node) { 180 list_for_each_entry(gpadc, &ab8500_gpadc_list, node) {
181 if (!strcmp(name, dev_name(gpadc->dev))) 181 if (!strcmp(name, dev_name(gpadc->dev)))
182 return gpadc; 182 return gpadc;
183 } 183 }
184 184
185 return ERR_PTR(-ENOENT); 185 return ERR_PTR(-ENOENT);
@@ -315,11 +315,12 @@ int ab8500_gpadc_sw_hw_convert(struct ab8500_gpadc *gpadc, u8 channel,
315 315
316 ad_value = ab8500_gpadc_read_raw(gpadc, channel, avg_sample, 316 ad_value = ab8500_gpadc_read_raw(gpadc, channel, avg_sample,
317 trig_edge, trig_timer, conv_type); 317 trig_edge, trig_timer, conv_type);
318/* On failure retry a second time */ 318
319 /* On failure retry a second time */
319 if (ad_value < 0) 320 if (ad_value < 0)
320 ad_value = ab8500_gpadc_read_raw(gpadc, channel, avg_sample, 321 ad_value = ab8500_gpadc_read_raw(gpadc, channel, avg_sample,
321 trig_edge, trig_timer, conv_type); 322 trig_edge, trig_timer, conv_type);
322if (ad_value < 0) { 323 if (ad_value < 0) {
323 dev_err(gpadc->dev, "GPADC raw value failed ch: %d\n", 324 dev_err(gpadc->dev, "GPADC raw value failed ch: %d\n",
324 channel); 325 channel);
325 return ad_value; 326 return ad_value;
@@ -327,8 +328,9 @@ if (ad_value < 0) {
327 328
328 voltage = ab8500_gpadc_ad_to_voltage(gpadc, channel, ad_value); 329 voltage = ab8500_gpadc_ad_to_voltage(gpadc, channel, ad_value);
329 if (voltage < 0) 330 if (voltage < 0)
330 dev_err(gpadc->dev, "GPADC to voltage conversion failed ch:" 331 dev_err(gpadc->dev,
331 " %d AD: 0x%x\n", channel, ad_value); 332 "GPADC to voltage conversion failed ch: %d AD: 0x%x\n",
333 channel, ad_value);
332 334
333 return voltage; 335 return voltage;
334} 336}
@@ -348,10 +350,9 @@ EXPORT_SYMBOL(ab8500_gpadc_sw_hw_convert);
348int ab8500_gpadc_read_raw(struct ab8500_gpadc *gpadc, u8 channel, 350int ab8500_gpadc_read_raw(struct ab8500_gpadc *gpadc, u8 channel,
349 u8 avg_sample, u8 trig_edge, u8 trig_timer, u8 conv_type) 351 u8 avg_sample, u8 trig_edge, u8 trig_timer, u8 conv_type)
350{ 352{
351 int raw_data; 353 return ab8500_gpadc_double_read_raw(gpadc, channel, avg_sample,
352 raw_data = ab8500_gpadc_double_read_raw(gpadc, channel, 354 trig_edge, trig_timer, conv_type,
353 avg_sample, trig_edge, trig_timer, conv_type, NULL); 355 NULL);
354 return raw_data;
355} 356}
356 357
357int ab8500_gpadc_double_read_raw(struct ab8500_gpadc *gpadc, u8 channel, 358int ab8500_gpadc_double_read_raw(struct ab8500_gpadc *gpadc, u8 channel,
@@ -388,7 +389,7 @@ int ab8500_gpadc_double_read_raw(struct ab8500_gpadc *gpadc, u8 channel,
388 goto out; 389 goto out;
389 if (!(val & GPADC_BUSY)) 390 if (!(val & GPADC_BUSY))
390 break; 391 break;
391 msleep(10); 392 msleep(20);
392 } while (++looplimit < 10); 393 } while (++looplimit < 10);
393 if (looplimit >= 10 && (val & GPADC_BUSY)) { 394 if (looplimit >= 10 && (val & GPADC_BUSY)) {
394 dev_err(gpadc->dev, "gpadc_conversion: GPADC busy"); 395 dev_err(gpadc->dev, "gpadc_conversion: GPADC busy");
@@ -421,8 +422,7 @@ int ab8500_gpadc_double_read_raw(struct ab8500_gpadc *gpadc, u8 channel,
421 val_reg1 |= EN_TRIG_EDGE; 422 val_reg1 |= EN_TRIG_EDGE;
422 if (trig_edge) 423 if (trig_edge)
423 val_reg1 |= EN_FALLING; 424 val_reg1 |= EN_FALLING;
424 } 425 } else
425 else
426 ret = abx500_set_register_interruptible(gpadc->dev, 426 ret = abx500_set_register_interruptible(gpadc->dev,
427 AB8500_GPADC, AB8500_GPADC_CTRL2_REG, val); 427 AB8500_GPADC, AB8500_GPADC_CTRL2_REG, val);
428 if (ret < 0) { 428 if (ret < 0) {
@@ -449,7 +449,7 @@ int ab8500_gpadc_double_read_raw(struct ab8500_gpadc *gpadc, u8 channel,
449 * remove when hardware will be availible 449 * remove when hardware will be availible
450 */ 450 */
451 delay_min = 1000; /* Delay in micro seconds */ 451 delay_min = 1000; /* Delay in micro seconds */
452 delay_max = 10000; /* large range to optimise sleep mode */ 452 delay_max = 10000; /* large range optimises sleepmode */
453 break; 453 break;
454 } 454 }
455 /* Intentional fallthrough */ 455 /* Intentional fallthrough */
@@ -785,9 +785,10 @@ static void ab8500_gpadc_read_calibration_data(struct ab8500_gpadc *gpadc)
785 << CALIB_SHIFT_IBAT) 785 << CALIB_SHIFT_IBAT)
786 / (ADC_CH_IBAT_MAX_V - ADC_CH_IBAT_MIN_V); 786 / (ADC_CH_IBAT_MAX_V - ADC_CH_IBAT_MIN_V);
787 787
788 gpadc->cal_data[ADC_INPUT_IBAT].gain = V_gain * V2A_gain; 788 gpadc->cal_data[ADC_INPUT_IBAT].gain =
789 gpadc->cal_data[ADC_INPUT_IBAT].offset = V_offset * 789 V_gain * V2A_gain;
790 V2A_gain + V2A_offset; 790 gpadc->cal_data[ADC_INPUT_IBAT].offset =
791 V_offset * V2A_gain + V2A_offset;
791 } else { 792 } else {
792 gpadc->cal_data[ADC_INPUT_IBAT].gain = 0; 793 gpadc->cal_data[ADC_INPUT_IBAT].gain = 0;
793 } 794 }
@@ -923,11 +924,10 @@ static int ab8500_gpadc_probe(struct platform_device *pdev)
923 int ret = 0; 924 int ret = 0;
924 struct ab8500_gpadc *gpadc; 925 struct ab8500_gpadc *gpadc;
925 926
926 gpadc = devm_kzalloc(&pdev->dev, sizeof(struct ab8500_gpadc), GFP_KERNEL); 927 gpadc = devm_kzalloc(&pdev->dev,
927 if (!gpadc) { 928 sizeof(struct ab8500_gpadc), GFP_KERNEL);
928 dev_err(&pdev->dev, "Error: No memory\n"); 929 if (!gpadc)
929 return -ENOMEM; 930 return -ENOMEM;
930 }
931 931
932 gpadc->irq_sw = platform_get_irq_byname(pdev, "SW_CONV_END"); 932 gpadc->irq_sw = platform_get_irq_byname(pdev, "SW_CONV_END");
933 if (gpadc->irq_sw < 0) 933 if (gpadc->irq_sw < 0)
@@ -1072,18 +1072,19 @@ void ab8540_gpadc_get_otp(struct ab8500_gpadc *gpadc,
1072 *vmain_h = gpadc->cal_data[ADC_INPUT_VMAIN].otp_calib_hi; 1072 *vmain_h = gpadc->cal_data[ADC_INPUT_VMAIN].otp_calib_hi;
1073 *btemp_l = gpadc->cal_data[ADC_INPUT_BTEMP].otp_calib_lo; 1073 *btemp_l = gpadc->cal_data[ADC_INPUT_BTEMP].otp_calib_lo;
1074 *btemp_h = gpadc->cal_data[ADC_INPUT_BTEMP].otp_calib_hi; 1074 *btemp_h = gpadc->cal_data[ADC_INPUT_BTEMP].otp_calib_hi;
1075 *vbat_l = gpadc->cal_data[ADC_INPUT_VBAT].otp_calib_lo; 1075 *vbat_l = gpadc->cal_data[ADC_INPUT_VBAT].otp_calib_lo;
1076 *vbat_h = gpadc->cal_data[ADC_INPUT_VBAT].otp_calib_hi; 1076 *vbat_h = gpadc->cal_data[ADC_INPUT_VBAT].otp_calib_hi;
1077 *ibat_l = gpadc->cal_data[ADC_INPUT_IBAT].otp_calib_lo; 1077 *ibat_l = gpadc->cal_data[ADC_INPUT_IBAT].otp_calib_lo;
1078 *ibat_h = gpadc->cal_data[ADC_INPUT_IBAT].otp_calib_hi; 1078 *ibat_h = gpadc->cal_data[ADC_INPUT_IBAT].otp_calib_hi;
1079 return ;
1080} 1079}
1081 1080
1082subsys_initcall_sync(ab8500_gpadc_init); 1081subsys_initcall_sync(ab8500_gpadc_init);
1083module_exit(ab8500_gpadc_exit); 1082module_exit(ab8500_gpadc_exit);
1084 1083
1085MODULE_LICENSE("GPL v2"); 1084MODULE_LICENSE("GPL v2");
1086MODULE_AUTHOR("Arun R Murthy, Daniel Willerud, Johan Palsson," 1085MODULE_AUTHOR("Arun R Murthy");
1087 "M'boumba Cedric Madianga"); 1086MODULE_AUTHOR("Daniel Willerud");
1087MODULE_AUTHOR("Johan Palsson");
1088MODULE_AUTHOR("M'boumba Cedric Madianga");
1088MODULE_ALIAS("platform:ab8500_gpadc"); 1089MODULE_ALIAS("platform:ab8500_gpadc");
1089MODULE_DESCRIPTION("AB8500 GPADC driver"); 1090MODULE_DESCRIPTION("AB8500 GPADC driver");
diff --git a/drivers/mfd/ab8500-sysctrl.c b/drivers/mfd/ab8500-sysctrl.c
index 0d1825696153..b9f0010309f9 100644
--- a/drivers/mfd/ab8500-sysctrl.c
+++ b/drivers/mfd/ab8500-sysctrl.c
@@ -27,7 +27,7 @@ static void ab8500_power_off(void)
27{ 27{
28 sigset_t old; 28 sigset_t old;
29 sigset_t all; 29 sigset_t all;
30 static char *pss[] = {"ab8500_ac", "pm2301", "ab8500_usb"}; 30 static const char * const pss[] = {"ab8500_ac", "pm2301", "ab8500_usb"};
31 int i; 31 int i;
32 bool charger_present = false; 32 bool charger_present = false;
33 union power_supply_propval val; 33 union power_supply_propval val;
@@ -68,10 +68,9 @@ static void ab8500_power_off(void)
68 ret = power_supply_get_property(psy, 68 ret = power_supply_get_property(psy,
69 POWER_SUPPLY_PROP_TECHNOLOGY, &val); 69 POWER_SUPPLY_PROP_TECHNOLOGY, &val);
70 if (!ret && val.intval != POWER_SUPPLY_TECHNOLOGY_UNKNOWN) { 70 if (!ret && val.intval != POWER_SUPPLY_TECHNOLOGY_UNKNOWN) {
71 printk(KERN_INFO 71 pr_info("Charger '%s' is connected with known battery",
72 "Charger \"%s\" is connected with known battery." 72 pss[i]);
73 " Rebooting.\n", 73 pr_info(" - Rebooting.\n");
74 pss[i]);
75 machine_restart("charging"); 74 machine_restart("charging");
76 } 75 }
77 power_supply_put(psy); 76 power_supply_put(psy);
@@ -161,8 +160,8 @@ static int ab8500_sysctrl_probe(struct platform_device *pdev)
161 pdata->initial_req_buf_config[j]); 160 pdata->initial_req_buf_config[j]);
162 if (ret < 0) { 161 if (ret < 0) {
163 dev_err(&pdev->dev, 162 dev_err(&pdev->dev,
164 "unable to set sysClkReq%dRfClkBuf: " 163 "Can't set sysClkReq%dRfClkBuf: %d\n",
165 "%d\n", j + 1, ret); 164 j + 1, ret);
166 } 165 }
167 } 166 }
168 } 167 }
diff --git a/drivers/mfd/adp5520.c b/drivers/mfd/adp5520.c
index ae88654595dc..d817f202da5b 100644
--- a/drivers/mfd/adp5520.c
+++ b/drivers/mfd/adp5520.c
@@ -9,10 +9,10 @@
9 * 9 *
10 * Derived from da903x: 10 * Derived from da903x:
11 * Copyright (C) 2008 Compulab, Ltd. 11 * Copyright (C) 2008 Compulab, Ltd.
12 * Mike Rapoport <mike@compulab.co.il> 12 * Mike Rapoport <mike@compulab.co.il>
13 * 13 *
14 * Copyright (C) 2006-2008 Marvell International Ltd. 14 * Copyright (C) 2006-2008 Marvell International Ltd.
15 * Eric Miao <eric.miao@marvell.com> 15 * Eric Miao <eric.miao@marvell.com>
16 * 16 *
17 * Licensed under the GPL-2 or later. 17 * Licensed under the GPL-2 or later.
18 */ 18 */
@@ -355,7 +355,7 @@ static struct i2c_driver adp5520_driver = {
355 }, 355 },
356 .probe = adp5520_probe, 356 .probe = adp5520_probe,
357 .remove = adp5520_remove, 357 .remove = adp5520_remove,
358 .id_table = adp5520_id, 358 .id_table = adp5520_id,
359}; 359};
360 360
361module_i2c_driver(adp5520_driver); 361module_i2c_driver(adp5520_driver);
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index d474732cc65c..5319f252790b 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -238,7 +238,7 @@ static int arizona_poll_reg(struct arizona *arizona,
238 if ((val & mask) == target) 238 if ((val & mask) == target)
239 return 0; 239 return 0;
240 240
241 msleep(1); 241 usleep_range(1000, 5000);
242 } 242 }
243 243
244 dev_err(arizona->dev, "Polling reg %u timed out: %x\n", reg, val); 244 dev_err(arizona->dev, "Polling reg %u timed out: %x\n", reg, val);
@@ -279,14 +279,14 @@ static void arizona_disable_reset(struct arizona *arizona)
279 case WM5110: 279 case WM5110:
280 case WM8280: 280 case WM8280:
281 /* Meet requirements for minimum reset duration */ 281 /* Meet requirements for minimum reset duration */
282 msleep(5); 282 usleep_range(5000, 10000);
283 break; 283 break;
284 default: 284 default:
285 break; 285 break;
286 } 286 }
287 287
288 gpio_set_value_cansleep(arizona->pdata.reset, 1); 288 gpio_set_value_cansleep(arizona->pdata.reset, 1);
289 msleep(1); 289 usleep_range(1000, 5000);
290 } 290 }
291} 291}
292 292
@@ -598,6 +598,12 @@ static int arizona_runtime_resume(struct device *dev)
598 goto err; 598 goto err;
599 } 599 }
600 break; 600 break;
601 case WM1831:
602 case CS47L24:
603 ret = arizona_wait_for_boot(arizona);
604 if (ret != 0)
605 goto err;
606 break;
601 default: 607 default:
602 ret = arizona_wait_for_boot(arizona); 608 ret = arizona_wait_for_boot(arizona);
603 if (ret != 0) 609 if (ret != 0)
@@ -682,6 +688,9 @@ static int arizona_runtime_suspend(struct device *dev)
682 } 688 }
683 } 689 }
684 break; 690 break;
691 case WM1831:
692 case CS47L24:
693 break;
685 default: 694 default:
686 jd_active = arizona_is_jack_det_active(arizona); 695 jd_active = arizona_is_jack_det_active(arizona);
687 if (jd_active < 0) 696 if (jd_active < 0)
@@ -852,6 +861,16 @@ static int arizona_of_get_core_pdata(struct arizona *arizona)
852 count++; 861 count++;
853 } 862 }
854 863
864 count = 0;
865 of_property_for_each_u32(arizona->dev->of_node, "wlf,out-mono", prop,
866 cur, val) {
867 if (count == ARRAY_SIZE(pdata->out_mono))
868 break;
869
870 pdata->out_mono[count] = !!val;
871 count++;
872 }
873
855 return 0; 874 return 0;
856} 875}
857 876
@@ -862,6 +881,8 @@ const struct of_device_id arizona_of_match[] = {
862 { .compatible = "wlf,wm8997", .data = (void *)WM8997 }, 881 { .compatible = "wlf,wm8997", .data = (void *)WM8997 },
863 { .compatible = "wlf,wm8998", .data = (void *)WM8998 }, 882 { .compatible = "wlf,wm8998", .data = (void *)WM8998 },
864 { .compatible = "wlf,wm1814", .data = (void *)WM1814 }, 883 { .compatible = "wlf,wm1814", .data = (void *)WM1814 },
884 { .compatible = "wlf,wm1831", .data = (void *)WM1831 },
885 { .compatible = "cirrus,cs47l24", .data = (void *)CS47L24 },
865 {}, 886 {},
866}; 887};
867EXPORT_SYMBOL_GPL(arizona_of_match); 888EXPORT_SYMBOL_GPL(arizona_of_match);
@@ -919,6 +940,23 @@ static const struct mfd_cell wm5110_devs[] = {
919 }, 940 },
920}; 941};
921 942
943static const char * const cs47l24_supplies[] = {
944 "MICVDD",
945 "CPVDD",
946 "SPKVDD",
947};
948
949static const struct mfd_cell cs47l24_devs[] = {
950 { .name = "arizona-gpio" },
951 { .name = "arizona-haptics" },
952 { .name = "arizona-pwm" },
953 {
954 .name = "cs47l24-codec",
955 .parent_supplies = cs47l24_supplies,
956 .num_parent_supplies = ARRAY_SIZE(cs47l24_supplies),
957 },
958};
959
922static const char * const wm8997_supplies[] = { 960static const char * const wm8997_supplies[] = {
923 "MICVDD", 961 "MICVDD",
924 "DBVDD2", 962 "DBVDD2",
@@ -963,7 +1001,7 @@ static const struct mfd_cell wm8998_devs[] = {
963int arizona_dev_init(struct arizona *arizona) 1001int arizona_dev_init(struct arizona *arizona)
964{ 1002{
965 struct device *dev = arizona->dev; 1003 struct device *dev = arizona->dev;
966 const char *type_name; 1004 const char *type_name = NULL;
967 unsigned int reg, val, mask; 1005 unsigned int reg, val, mask;
968 int (*apply_patch)(struct arizona *) = NULL; 1006 int (*apply_patch)(struct arizona *) = NULL;
969 const struct mfd_cell *subdevs = NULL; 1007 const struct mfd_cell *subdevs = NULL;
@@ -987,6 +1025,8 @@ int arizona_dev_init(struct arizona *arizona)
987 case WM8997: 1025 case WM8997:
988 case WM8998: 1026 case WM8998:
989 case WM1814: 1027 case WM1814:
1028 case WM1831:
1029 case CS47L24:
990 for (i = 0; i < ARRAY_SIZE(wm5102_core_supplies); i++) 1030 for (i = 0; i < ARRAY_SIZE(wm5102_core_supplies); i++)
991 arizona->core_supplies[i].supply 1031 arizona->core_supplies[i].supply
992 = wm5102_core_supplies[i]; 1032 = wm5102_core_supplies[i];
@@ -1001,11 +1041,18 @@ int arizona_dev_init(struct arizona *arizona)
1001 /* Mark DCVDD as external, LDO1 driver will clear if internal */ 1041 /* Mark DCVDD as external, LDO1 driver will clear if internal */
1002 arizona->external_dcvdd = true; 1042 arizona->external_dcvdd = true;
1003 1043
1004 ret = mfd_add_devices(arizona->dev, -1, early_devs, 1044 switch (arizona->type) {
1005 ARRAY_SIZE(early_devs), NULL, 0, NULL); 1045 case WM1831:
1006 if (ret != 0) { 1046 case CS47L24:
1007 dev_err(dev, "Failed to add early children: %d\n", ret); 1047 break; /* No LDO1 regulator */
1008 return ret; 1048 default:
1049 ret = mfd_add_devices(arizona->dev, -1, early_devs,
1050 ARRAY_SIZE(early_devs), NULL, 0, NULL);
1051 if (ret != 0) {
1052 dev_err(dev, "Failed to add early children: %d\n", ret);
1053 return ret;
1054 }
1055 break;
1009 } 1056 }
1010 1057
1011 ret = devm_regulator_bulk_get(dev, arizona->num_core_supplies, 1058 ret = devm_regulator_bulk_get(dev, arizona->num_core_supplies,
@@ -1069,6 +1116,7 @@ int arizona_dev_init(struct arizona *arizona)
1069 case 0x5102: 1116 case 0x5102:
1070 case 0x5110: 1117 case 0x5110:
1071 case 0x6349: 1118 case 0x6349:
1119 case 0x6363:
1072 case 0x8997: 1120 case 0x8997:
1073 break; 1121 break;
1074 default: 1122 default:
@@ -1084,7 +1132,7 @@ int arizona_dev_init(struct arizona *arizona)
1084 goto err_reset; 1132 goto err_reset;
1085 } 1133 }
1086 1134
1087 msleep(1); 1135 usleep_range(1000, 5000);
1088 } 1136 }
1089 1137
1090 /* Ensure device startup is complete */ 1138 /* Ensure device startup is complete */
@@ -1167,6 +1215,30 @@ int arizona_dev_init(struct arizona *arizona)
1167 n_subdevs = ARRAY_SIZE(wm5110_devs); 1215 n_subdevs = ARRAY_SIZE(wm5110_devs);
1168 } 1216 }
1169 break; 1217 break;
1218 case 0x6363:
1219 if (IS_ENABLED(CONFIG_MFD_CS47L24)) {
1220 switch (arizona->type) {
1221 case CS47L24:
1222 type_name = "CS47L24";
1223 break;
1224
1225 case WM1831:
1226 type_name = "WM1831";
1227 break;
1228
1229 default:
1230 dev_warn(arizona->dev,
1231 "CS47L24 registered as %d\n",
1232 arizona->type);
1233 arizona->type = CS47L24;
1234 break;
1235 }
1236
1237 apply_patch = cs47l24_patch;
1238 subdevs = cs47l24_devs;
1239 n_subdevs = ARRAY_SIZE(cs47l24_devs);
1240 }
1241 break;
1170 case 0x8997: 1242 case 0x8997:
1171 if (IS_ENABLED(CONFIG_MFD_WM8997)) { 1243 if (IS_ENABLED(CONFIG_MFD_WM8997)) {
1172 type_name = "WM8997"; 1244 type_name = "WM8997";
diff --git a/drivers/mfd/arizona-i2c.c b/drivers/mfd/arizona-i2c.c
index 4e3afd1861fc..5fe12961cfe5 100644
--- a/drivers/mfd/arizona-i2c.c
+++ b/drivers/mfd/arizona-i2c.c
@@ -88,7 +88,9 @@ static int arizona_i2c_probe(struct i2c_client *i2c,
88static int arizona_i2c_remove(struct i2c_client *i2c) 88static int arizona_i2c_remove(struct i2c_client *i2c)
89{ 89{
90 struct arizona *arizona = dev_get_drvdata(&i2c->dev); 90 struct arizona *arizona = dev_get_drvdata(&i2c->dev);
91
91 arizona_dev_exit(arizona); 92 arizona_dev_exit(arizona);
93
92 return 0; 94 return 0;
93} 95}
94 96
diff --git a/drivers/mfd/arizona-irq.c b/drivers/mfd/arizona-irq.c
index 3d425e93ce84..5fef014920a3 100644
--- a/drivers/mfd/arizona-irq.c
+++ b/drivers/mfd/arizona-irq.c
@@ -30,11 +30,13 @@ static int arizona_map_irq(struct arizona *arizona, int irq)
30{ 30{
31 int ret; 31 int ret;
32 32
33 ret = regmap_irq_get_virq(arizona->aod_irq_chip, irq); 33 if (arizona->aod_irq_chip) {
34 if (ret < 0) 34 ret = regmap_irq_get_virq(arizona->aod_irq_chip, irq);
35 ret = regmap_irq_get_virq(arizona->irq_chip, irq); 35 if (ret >= 0)
36 return ret;
37 }
36 38
37 return ret; 39 return regmap_irq_get_virq(arizona->irq_chip, irq);
38} 40}
39 41
40int arizona_request_irq(struct arizona *arizona, int irq, char *name, 42int arizona_request_irq(struct arizona *arizona, int irq, char *name,
@@ -107,8 +109,8 @@ static irqreturn_t arizona_irq_thread(int irq, void *data)
107 do { 109 do {
108 poll = false; 110 poll = false;
109 111
110 /* Always handle the AoD domain */ 112 if (arizona->aod_irq_chip)
111 handle_nested_irq(irq_find_mapping(arizona->virq, 0)); 113 handle_nested_irq(irq_find_mapping(arizona->virq, 0));
112 114
113 /* 115 /*
114 * Check if one of the main interrupts is asserted and only 116 * Check if one of the main interrupts is asserted and only
@@ -219,6 +221,15 @@ int arizona_irq_init(struct arizona *arizona)
219 arizona->ctrlif_error = false; 221 arizona->ctrlif_error = false;
220 break; 222 break;
221#endif 223#endif
224#ifdef CONFIG_MFD_CS47L24
225 case WM1831:
226 case CS47L24:
227 aod = NULL;
228 irq = &cs47l24_irq;
229
230 arizona->ctrlif_error = false;
231 break;
232#endif
222#ifdef CONFIG_MFD_WM8997 233#ifdef CONFIG_MFD_WM8997
223 case WM8997: 234 case WM8997:
224 aod = &wm8997_aod; 235 aod = &wm8997_aod;
@@ -291,13 +302,16 @@ int arizona_irq_init(struct arizona *arizona)
291 goto err; 302 goto err;
292 } 303 }
293 304
294 ret = regmap_add_irq_chip(arizona->regmap, 305 if (aod) {
295 irq_create_mapping(arizona->virq, 0), 306 ret = regmap_add_irq_chip(arizona->regmap,
296 IRQF_ONESHOT, 0, aod, 307 irq_create_mapping(arizona->virq, 0),
297 &arizona->aod_irq_chip); 308 IRQF_ONESHOT, 0, aod,
298 if (ret != 0) { 309 &arizona->aod_irq_chip);
299 dev_err(arizona->dev, "Failed to add AOD IRQs: %d\n", ret); 310 if (ret != 0) {
300 goto err_domain; 311 dev_err(arizona->dev,
312 "Failed to add AOD IRQs: %d\n", ret);
313 goto err;
314 }
301 } 315 }
302 316
303 ret = regmap_add_irq_chip(arizona->regmap, 317 ret = regmap_add_irq_chip(arizona->regmap,
@@ -309,30 +323,6 @@ int arizona_irq_init(struct arizona *arizona)
309 goto err_aod; 323 goto err_aod;
310 } 324 }
311 325
312 /* Make sure the boot done IRQ is unmasked for resumes */
313 i = arizona_map_irq(arizona, ARIZONA_IRQ_BOOT_DONE);
314 ret = request_threaded_irq(i, NULL, arizona_boot_done, IRQF_ONESHOT,
315 "Boot done", arizona);
316 if (ret != 0) {
317 dev_err(arizona->dev, "Failed to request boot done %d: %d\n",
318 arizona->irq, ret);
319 goto err_boot_done;
320 }
321
322 /* Handle control interface errors in the core */
323 if (arizona->ctrlif_error) {
324 i = arizona_map_irq(arizona, ARIZONA_IRQ_CTRLIF_ERR);
325 ret = request_threaded_irq(i, NULL, arizona_ctrlif_err,
326 IRQF_ONESHOT,
327 "Control interface error", arizona);
328 if (ret != 0) {
329 dev_err(arizona->dev,
330 "Failed to request CTRLIF_ERR %d: %d\n",
331 arizona->irq, ret);
332 goto err_ctrlif;
333 }
334 }
335
336 /* Used to emulate edge trigger and to work around broken pinmux */ 326 /* Used to emulate edge trigger and to work around broken pinmux */
337 if (arizona->pdata.irq_gpio) { 327 if (arizona->pdata.irq_gpio) {
338 if (gpio_to_irq(arizona->pdata.irq_gpio) != arizona->irq) { 328 if (gpio_to_irq(arizona->pdata.irq_gpio) != arizona->irq) {
@@ -362,21 +352,42 @@ int arizona_irq_init(struct arizona *arizona)
362 goto err_main_irq; 352 goto err_main_irq;
363 } 353 }
364 354
355 /* Make sure the boot done IRQ is unmasked for resumes */
356 i = arizona_map_irq(arizona, ARIZONA_IRQ_BOOT_DONE);
357 ret = request_threaded_irq(i, NULL, arizona_boot_done, IRQF_ONESHOT,
358 "Boot done", arizona);
359 if (ret != 0) {
360 dev_err(arizona->dev, "Failed to request boot done %d: %d\n",
361 arizona->irq, ret);
362 goto err_boot_done;
363 }
364
365 /* Handle control interface errors in the core */
366 if (arizona->ctrlif_error) {
367 i = arizona_map_irq(arizona, ARIZONA_IRQ_CTRLIF_ERR);
368 ret = request_threaded_irq(i, NULL, arizona_ctrlif_err,
369 IRQF_ONESHOT,
370 "Control interface error", arizona);
371 if (ret != 0) {
372 dev_err(arizona->dev,
373 "Failed to request CTRLIF_ERR %d: %d\n",
374 arizona->irq, ret);
375 goto err_ctrlif;
376 }
377 }
378
365 return 0; 379 return 0;
366 380
367err_main_irq:
368 if (arizona->ctrlif_error)
369 free_irq(arizona_map_irq(arizona, ARIZONA_IRQ_CTRLIF_ERR),
370 arizona);
371err_ctrlif: 381err_ctrlif:
372 free_irq(arizona_map_irq(arizona, ARIZONA_IRQ_BOOT_DONE), arizona); 382 free_irq(arizona_map_irq(arizona, ARIZONA_IRQ_BOOT_DONE), arizona);
373err_boot_done: 383err_boot_done:
384 free_irq(arizona->irq, arizona);
385err_main_irq:
374 regmap_del_irq_chip(irq_create_mapping(arizona->virq, 1), 386 regmap_del_irq_chip(irq_create_mapping(arizona->virq, 1),
375 arizona->irq_chip); 387 arizona->irq_chip);
376err_aod: 388err_aod:
377 regmap_del_irq_chip(irq_create_mapping(arizona->virq, 0), 389 regmap_del_irq_chip(irq_create_mapping(arizona->virq, 0),
378 arizona->aod_irq_chip); 390 arizona->aod_irq_chip);
379err_domain:
380err: 391err:
381 return ret; 392 return ret;
382} 393}
diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c
index befbc89bfd34..5c1ccdeb9b70 100644
--- a/drivers/mfd/arizona-spi.c
+++ b/drivers/mfd/arizona-spi.c
@@ -46,6 +46,11 @@ static int arizona_spi_probe(struct spi_device *spi)
46 if (IS_ENABLED(CONFIG_MFD_WM5110)) 46 if (IS_ENABLED(CONFIG_MFD_WM5110))
47 regmap_config = &wm5110_spi_regmap; 47 regmap_config = &wm5110_spi_regmap;
48 break; 48 break;
49 case WM1831:
50 case CS47L24:
51 if (IS_ENABLED(CONFIG_MFD_CS47L24))
52 regmap_config = &cs47l24_spi_regmap;
53 break;
49 default: 54 default:
50 dev_err(&spi->dev, "Unknown device type %ld\n", type); 55 dev_err(&spi->dev, "Unknown device type %ld\n", type);
51 return -EINVAL; 56 return -EINVAL;
@@ -89,6 +94,8 @@ static const struct spi_device_id arizona_spi_ids[] = {
89 { "wm5102", WM5102 }, 94 { "wm5102", WM5102 },
90 { "wm5110", WM5110 }, 95 { "wm5110", WM5110 },
91 { "wm8280", WM8280 }, 96 { "wm8280", WM8280 },
97 { "wm1831", WM1831 },
98 { "cs47l24", CS47L24 },
92 { }, 99 { },
93}; 100};
94MODULE_DEVICE_TABLE(spi, arizona_spi_ids); 101MODULE_DEVICE_TABLE(spi, arizona_spi_ids);
diff --git a/drivers/mfd/arizona.h b/drivers/mfd/arizona.h
index 3af12e938f57..198e9cea77f9 100644
--- a/drivers/mfd/arizona.h
+++ b/drivers/mfd/arizona.h
@@ -25,6 +25,8 @@ extern const struct regmap_config wm5102_spi_regmap;
25extern const struct regmap_config wm5110_i2c_regmap; 25extern const struct regmap_config wm5110_i2c_regmap;
26extern const struct regmap_config wm5110_spi_regmap; 26extern const struct regmap_config wm5110_spi_regmap;
27 27
28extern const struct regmap_config cs47l24_spi_regmap;
29
28extern const struct regmap_config wm8997_i2c_regmap; 30extern const struct regmap_config wm8997_i2c_regmap;
29 31
30extern const struct regmap_config wm8998_i2c_regmap; 32extern const struct regmap_config wm8998_i2c_regmap;
@@ -40,6 +42,8 @@ extern const struct regmap_irq_chip wm5110_aod;
40extern const struct regmap_irq_chip wm5110_irq; 42extern const struct regmap_irq_chip wm5110_irq;
41extern const struct regmap_irq_chip wm5110_revd_irq; 43extern const struct regmap_irq_chip wm5110_revd_irq;
42 44
45extern const struct regmap_irq_chip cs47l24_irq;
46
43extern const struct regmap_irq_chip wm8997_aod; 47extern const struct regmap_irq_chip wm8997_aod;
44extern const struct regmap_irq_chip wm8997_irq; 48extern const struct regmap_irq_chip wm8997_irq;
45 49
diff --git a/drivers/mfd/as3711.c b/drivers/mfd/as3711.c
index d001f7e238f5..94d67a6e1eb7 100644
--- a/drivers/mfd/as3711.c
+++ b/drivers/mfd/as3711.c
@@ -136,17 +136,13 @@ static int as3711_i2c_probe(struct i2c_client *client,
136 } else { 136 } else {
137 pdata = devm_kzalloc(&client->dev, 137 pdata = devm_kzalloc(&client->dev,
138 sizeof(*pdata), GFP_KERNEL); 138 sizeof(*pdata), GFP_KERNEL);
139 if (!pdata) { 139 if (!pdata)
140 dev_err(&client->dev, "Failed to allocate pdata\n");
141 return -ENOMEM; 140 return -ENOMEM;
142 }
143 } 141 }
144 142
145 as3711 = devm_kzalloc(&client->dev, sizeof(struct as3711), GFP_KERNEL); 143 as3711 = devm_kzalloc(&client->dev, sizeof(struct as3711), GFP_KERNEL);
146 if (!as3711) { 144 if (!as3711)
147 dev_err(&client->dev, "Memory allocation failed\n");
148 return -ENOMEM; 145 return -ENOMEM;
149 }
150 146
151 as3711->dev = &client->dev; 147 as3711->dev = &client->dev;
152 i2c_set_clientdata(client, as3711); 148 i2c_set_clientdata(client, as3711);
@@ -157,7 +153,8 @@ static int as3711_i2c_probe(struct i2c_client *client,
157 as3711->regmap = devm_regmap_init_i2c(client, &as3711_regmap_config); 153 as3711->regmap = devm_regmap_init_i2c(client, &as3711_regmap_config);
158 if (IS_ERR(as3711->regmap)) { 154 if (IS_ERR(as3711->regmap)) {
159 ret = PTR_ERR(as3711->regmap); 155 ret = PTR_ERR(as3711->regmap);
160 dev_err(&client->dev, "regmap initialization failed: %d\n", ret); 156 dev_err(&client->dev,
157 "regmap initialization failed: %d\n", ret);
161 return ret; 158 return ret;
162 } 159 }
163 160
@@ -172,12 +169,19 @@ static int as3711_i2c_probe(struct i2c_client *client,
172 return -ENODEV; 169 return -ENODEV;
173 dev_info(as3711->dev, "AS3711 detected: %x:%x\n", id1, id2); 170 dev_info(as3711->dev, "AS3711 detected: %x:%x\n", id1, id2);
174 171
175 /* We can reuse as3711_subdevs[], it will be copied in mfd_add_devices() */ 172 /*
173 * We can reuse as3711_subdevs[],
174 * it will be copied in mfd_add_devices()
175 */
176 if (pdata) { 176 if (pdata) {
177 as3711_subdevs[AS3711_REGULATOR].platform_data = &pdata->regulator; 177 as3711_subdevs[AS3711_REGULATOR].platform_data =
178 as3711_subdevs[AS3711_REGULATOR].pdata_size = sizeof(pdata->regulator); 178 &pdata->regulator;
179 as3711_subdevs[AS3711_BACKLIGHT].platform_data = &pdata->backlight; 179 as3711_subdevs[AS3711_REGULATOR].pdata_size =
180 as3711_subdevs[AS3711_BACKLIGHT].pdata_size = sizeof(pdata->backlight); 180 sizeof(pdata->regulator);
181 as3711_subdevs[AS3711_BACKLIGHT].platform_data =
182 &pdata->backlight;
183 as3711_subdevs[AS3711_BACKLIGHT].pdata_size =
184 sizeof(pdata->backlight);
181 } else { 185 } else {
182 as3711_subdevs[AS3711_REGULATOR].platform_data = NULL; 186 as3711_subdevs[AS3711_REGULATOR].platform_data = NULL;
183 as3711_subdevs[AS3711_REGULATOR].pdata_size = 0; 187 as3711_subdevs[AS3711_REGULATOR].pdata_size = 0;
diff --git a/drivers/mfd/as3722.c b/drivers/mfd/as3722.c
index 924ea90494ae..e1f597f97f86 100644
--- a/drivers/mfd/as3722.c
+++ b/drivers/mfd/as3722.c
@@ -405,6 +405,8 @@ static int as3722_i2c_probe(struct i2c_client *i2c,
405 goto scrub; 405 goto scrub;
406 } 406 }
407 407
408 device_init_wakeup(as3722->dev, true);
409
408 dev_dbg(as3722->dev, "AS3722 core driver initialized successfully\n"); 410 dev_dbg(as3722->dev, "AS3722 core driver initialized successfully\n");
409 return 0; 411 return 0;
410 412
@@ -422,6 +424,29 @@ static int as3722_i2c_remove(struct i2c_client *i2c)
422 return 0; 424 return 0;
423} 425}
424 426
427static int __maybe_unused as3722_i2c_suspend(struct device *dev)
428{
429 struct as3722 *as3722 = dev_get_drvdata(dev);
430
431 if (device_may_wakeup(dev))
432 enable_irq_wake(as3722->chip_irq);
433 disable_irq(as3722->chip_irq);
434
435 return 0;
436}
437
438static int __maybe_unused as3722_i2c_resume(struct device *dev)
439{
440 struct as3722 *as3722 = dev_get_drvdata(dev);
441
442 enable_irq(as3722->chip_irq);
443
444 if (device_may_wakeup(dev))
445 disable_irq_wake(as3722->chip_irq);
446
447 return 0;
448}
449
425static const struct of_device_id as3722_of_match[] = { 450static const struct of_device_id as3722_of_match[] = {
426 { .compatible = "ams,as3722", }, 451 { .compatible = "ams,as3722", },
427 {}, 452 {},
@@ -434,10 +459,15 @@ static const struct i2c_device_id as3722_i2c_id[] = {
434}; 459};
435MODULE_DEVICE_TABLE(i2c, as3722_i2c_id); 460MODULE_DEVICE_TABLE(i2c, as3722_i2c_id);
436 461
462static const struct dev_pm_ops as3722_pm_ops = {
463 SET_SYSTEM_SLEEP_PM_OPS(as3722_i2c_suspend, as3722_i2c_resume)
464};
465
437static struct i2c_driver as3722_i2c_driver = { 466static struct i2c_driver as3722_i2c_driver = {
438 .driver = { 467 .driver = {
439 .name = "as3722", 468 .name = "as3722",
440 .of_match_table = as3722_of_match, 469 .of_match_table = as3722_of_match,
470 .pm = &as3722_pm_ops,
441 }, 471 },
442 .probe = as3722_i2c_probe, 472 .probe = as3722_i2c_probe,
443 .remove = as3722_i2c_remove, 473 .remove = as3722_i2c_remove,
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index a726f01e3b02..4dca6bc61f5b 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -167,7 +167,6 @@ static void asic3_irq_demux(struct irq_desc *desc)
167 167
168 base = ASIC3_GPIO_A_BASE 168 base = ASIC3_GPIO_A_BASE
169 + bank * ASIC3_GPIO_BASE_INCR; 169 + bank * ASIC3_GPIO_BASE_INCR;
170
171 spin_lock_irqsave(&asic->lock, flags); 170 spin_lock_irqsave(&asic->lock, flags);
172 istat = asic3_read_register(asic, 171 istat = asic3_read_register(asic,
173 base + 172 base +
@@ -502,7 +501,8 @@ static int asic3_gpio_get(struct gpio_chip *chip,
502 return -EINVAL; 501 return -EINVAL;
503 } 502 }
504 503
505 return asic3_read_register(asic, gpio_base + ASIC3_GPIO_STATUS) & mask; 504 return !!(asic3_read_register(asic,
505 gpio_base + ASIC3_GPIO_STATUS) & mask);
506} 506}
507 507
508static void asic3_gpio_set(struct gpio_chip *chip, 508static void asic3_gpio_set(struct gpio_chip *chip,
@@ -536,8 +536,6 @@ static void asic3_gpio_set(struct gpio_chip *chip,
536 asic3_write_register(asic, gpio_base + ASIC3_GPIO_OUT, out_reg); 536 asic3_write_register(asic, gpio_base + ASIC3_GPIO_OUT, out_reg);
537 537
538 spin_unlock_irqrestore(&asic->lock, flags); 538 spin_unlock_irqrestore(&asic->lock, flags);
539
540 return;
541} 539}
542 540
543static int asic3_gpio_to_irq(struct gpio_chip *chip, unsigned offset) 541static int asic3_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
@@ -665,18 +663,18 @@ static int ds1wm_enable(struct platform_device *pdev)
665 asic3_clk_enable(asic, &asic->clocks[ASIC3_CLOCK_EX0]); 663 asic3_clk_enable(asic, &asic->clocks[ASIC3_CLOCK_EX0]);
666 asic3_clk_enable(asic, &asic->clocks[ASIC3_CLOCK_EX1]); 664 asic3_clk_enable(asic, &asic->clocks[ASIC3_CLOCK_EX1]);
667 asic3_clk_enable(asic, &asic->clocks[ASIC3_CLOCK_OWM]); 665 asic3_clk_enable(asic, &asic->clocks[ASIC3_CLOCK_OWM]);
668 msleep(1); 666 usleep_range(1000, 5000);
669 667
670 /* Reset and enable DS1WM */ 668 /* Reset and enable DS1WM */
671 asic3_set_register(asic, ASIC3_OFFSET(EXTCF, RESET), 669 asic3_set_register(asic, ASIC3_OFFSET(EXTCF, RESET),
672 ASIC3_EXTCF_OWM_RESET, 1); 670 ASIC3_EXTCF_OWM_RESET, 1);
673 msleep(1); 671 usleep_range(1000, 5000);
674 asic3_set_register(asic, ASIC3_OFFSET(EXTCF, RESET), 672 asic3_set_register(asic, ASIC3_OFFSET(EXTCF, RESET),
675 ASIC3_EXTCF_OWM_RESET, 0); 673 ASIC3_EXTCF_OWM_RESET, 0);
676 msleep(1); 674 usleep_range(1000, 5000);
677 asic3_set_register(asic, ASIC3_OFFSET(EXTCF, SELECT), 675 asic3_set_register(asic, ASIC3_OFFSET(EXTCF, SELECT),
678 ASIC3_EXTCF_OWM_EN, 1); 676 ASIC3_EXTCF_OWM_EN, 1);
679 msleep(1); 677 usleep_range(1000, 5000);
680 678
681 return 0; 679 return 0;
682} 680}
@@ -757,7 +755,7 @@ static int asic3_mmc_enable(struct platform_device *pdev)
757 * when HCLK is stopped. 755 * when HCLK is stopped.
758 */ 756 */
759 asic3_clk_enable(asic, &asic->clocks[ASIC3_CLOCK_EX1]); 757 asic3_clk_enable(asic, &asic->clocks[ASIC3_CLOCK_EX1]);
760 msleep(1); 758 usleep_range(1000, 5000);
761 759
762 /* HCLK 24.576 MHz, BCLK 12.288 MHz: */ 760 /* HCLK 24.576 MHz, BCLK 12.288 MHz: */
763 asic3_write_register(asic, ASIC3_OFFSET(CLOCK, SEL), 761 asic3_write_register(asic, ASIC3_OFFSET(CLOCK, SEL),
@@ -765,7 +763,7 @@ static int asic3_mmc_enable(struct platform_device *pdev)
765 763
766 asic3_clk_enable(asic, &asic->clocks[ASIC3_CLOCK_SD_HOST]); 764 asic3_clk_enable(asic, &asic->clocks[ASIC3_CLOCK_SD_HOST]);
767 asic3_clk_enable(asic, &asic->clocks[ASIC3_CLOCK_SD_BUS]); 765 asic3_clk_enable(asic, &asic->clocks[ASIC3_CLOCK_SD_BUS]);
768 msleep(1); 766 usleep_range(1000, 5000);
769 767
770 asic3_set_register(asic, ASIC3_OFFSET(EXTCF, SELECT), 768 asic3_set_register(asic, ASIC3_OFFSET(EXTCF, SELECT),
771 ASIC3_EXTCF_SD_MEM_ENABLE, 1); 769 ASIC3_EXTCF_SD_MEM_ENABLE, 1);
@@ -841,7 +839,7 @@ static int asic3_leds_suspend(struct platform_device *pdev)
841 struct asic3 *asic = dev_get_drvdata(pdev->dev.parent); 839 struct asic3 *asic = dev_get_drvdata(pdev->dev.parent);
842 840
843 while (asic3_gpio_get(&asic->gpio, ASIC3_GPIO(C, cell->id)) != 0) 841 while (asic3_gpio_get(&asic->gpio, ASIC3_GPIO(C, cell->id)) != 0)
844 msleep(1); 842 usleep_range(1000, 5000);
845 843
846 asic3_clk_disable(asic, &asic->clocks[clock_ledn[cell->id]]); 844 asic3_clk_disable(asic, &asic->clocks[clock_ledn[cell->id]]);
847 845
@@ -900,8 +898,8 @@ static int __init asic3_mfd_probe(struct platform_device *pdev,
900 898
901 /* MMC */ 899 /* MMC */
902 if (mem_sdio) { 900 if (mem_sdio) {
903 asic->tmio_cnf = ioremap((ASIC3_SD_CONFIG_BASE >> asic->bus_shift) + 901 asic->tmio_cnf = ioremap((ASIC3_SD_CONFIG_BASE >>
904 mem_sdio->start, 902 asic->bus_shift) + mem_sdio->start,
905 ASIC3_SD_CONFIG_SIZE >> asic->bus_shift); 903 ASIC3_SD_CONFIG_SIZE >> asic->bus_shift);
906 if (!asic->tmio_cnf) { 904 if (!asic->tmio_cnf) {
907 ret = -ENOMEM; 905 ret = -ENOMEM;
@@ -962,10 +960,8 @@ static int __init asic3_probe(struct platform_device *pdev)
962 960
963 asic = devm_kzalloc(&pdev->dev, 961 asic = devm_kzalloc(&pdev->dev,
964 sizeof(struct asic3), GFP_KERNEL); 962 sizeof(struct asic3), GFP_KERNEL);
965 if (asic == NULL) { 963 if (!asic)
966 printk(KERN_ERR "kzalloc failed\n");
967 return -ENOMEM; 964 return -ENOMEM;
968 }
969 965
970 spin_lock_init(&asic->lock); 966 spin_lock_init(&asic->lock);
971 platform_set_drvdata(pdev, asic); 967 platform_set_drvdata(pdev, asic);
@@ -1074,7 +1070,9 @@ static struct platform_driver asic3_device_driver = {
1074static int __init asic3_init(void) 1070static int __init asic3_init(void)
1075{ 1071{
1076 int retval = 0; 1072 int retval = 0;
1073
1077 retval = platform_driver_probe(&asic3_device_driver, asic3_probe); 1074 retval = platform_driver_probe(&asic3_device_driver, asic3_probe);
1075
1078 return retval; 1076 return retval;
1079} 1077}
1080 1078
diff --git a/drivers/mfd/cros_ec_i2c.c b/drivers/mfd/cros_ec_i2c.c
index 56a466469664..9f70de1e4c70 100644
--- a/drivers/mfd/cros_ec_i2c.c
+++ b/drivers/mfd/cros_ec_i2c.c
@@ -292,7 +292,7 @@ static int cros_ec_i2c_probe(struct i2c_client *client,
292 struct cros_ec_device *ec_dev = NULL; 292 struct cros_ec_device *ec_dev = NULL;
293 int err; 293 int err;
294 294
295 ec_dev = devm_kzalloc(dev, sizeof(*ec_dev), GFP_KERNEL); 295 ec_dev = devm_kzalloc(dev, sizeof(*ec_dev), GFP_KERNEL);
296 if (!ec_dev) 296 if (!ec_dev)
297 return -ENOMEM; 297 return -ENOMEM;
298 298
diff --git a/drivers/mfd/cros_ec_spi.c b/drivers/mfd/cros_ec_spi.c
index 6a0f6ec67c6b..ebe9b9477cb2 100644
--- a/drivers/mfd/cros_ec_spi.c
+++ b/drivers/mfd/cros_ec_spi.c
@@ -113,7 +113,7 @@ static int terminate_request(struct cros_ec_device *ec_dev)
113 trans.delay_usecs = ec_spi->end_of_msg_delay; 113 trans.delay_usecs = ec_spi->end_of_msg_delay;
114 spi_message_add_tail(&trans, &msg); 114 spi_message_add_tail(&trans, &msg);
115 115
116 ret = spi_sync(ec_spi->spi, &msg); 116 ret = spi_sync_locked(ec_spi->spi, &msg);
117 117
118 /* Reset end-of-response timer */ 118 /* Reset end-of-response timer */
119 ec_spi->last_transfer_ns = ktime_get_ns(); 119 ec_spi->last_transfer_ns = ktime_get_ns();
@@ -147,7 +147,7 @@ static int receive_n_bytes(struct cros_ec_device *ec_dev, u8 *buf, int n)
147 147
148 spi_message_init(&msg); 148 spi_message_init(&msg);
149 spi_message_add_tail(&trans, &msg); 149 spi_message_add_tail(&trans, &msg);
150 ret = spi_sync(ec_spi->spi, &msg); 150 ret = spi_sync_locked(ec_spi->spi, &msg);
151 if (ret < 0) 151 if (ret < 0)
152 dev_err(ec_dev->dev, "spi transfer failed: %d\n", ret); 152 dev_err(ec_dev->dev, "spi transfer failed: %d\n", ret);
153 153
@@ -175,7 +175,7 @@ static int cros_ec_spi_receive_packet(struct cros_ec_device *ec_dev,
175 unsigned long deadline; 175 unsigned long deadline;
176 int todo; 176 int todo;
177 177
178 BUG_ON(EC_MSG_PREAMBLE_COUNT > ec_dev->din_size); 178 BUG_ON(ec_dev->din_size < EC_MSG_PREAMBLE_COUNT);
179 179
180 /* Receive data until we see the header byte */ 180 /* Receive data until we see the header byte */
181 deadline = jiffies + msecs_to_jiffies(EC_MSG_DEADLINE_MS); 181 deadline = jiffies + msecs_to_jiffies(EC_MSG_DEADLINE_MS);
@@ -283,7 +283,7 @@ static int cros_ec_spi_receive_response(struct cros_ec_device *ec_dev,
283 unsigned long deadline; 283 unsigned long deadline;
284 int todo; 284 int todo;
285 285
286 BUG_ON(EC_MSG_PREAMBLE_COUNT > ec_dev->din_size); 286 BUG_ON(ec_dev->din_size < EC_MSG_PREAMBLE_COUNT);
287 287
288 /* Receive data until we see the header byte */ 288 /* Receive data until we see the header byte */
289 deadline = jiffies + msecs_to_jiffies(EC_MSG_DEADLINE_MS); 289 deadline = jiffies + msecs_to_jiffies(EC_MSG_DEADLINE_MS);
@@ -391,10 +391,10 @@ static int cros_ec_pkt_xfer_spi(struct cros_ec_device *ec_dev,
391 } 391 }
392 392
393 rx_buf = kzalloc(len, GFP_KERNEL); 393 rx_buf = kzalloc(len, GFP_KERNEL);
394 if (!rx_buf) { 394 if (!rx_buf)
395 ret = -ENOMEM; 395 return -ENOMEM;
396 goto exit; 396
397 } 397 spi_bus_lock(ec_spi->spi->master);
398 398
399 /* 399 /*
400 * Leave a gap between CS assertion and clocking of data to allow the 400 * Leave a gap between CS assertion and clocking of data to allow the
@@ -414,7 +414,7 @@ static int cros_ec_pkt_xfer_spi(struct cros_ec_device *ec_dev,
414 trans.len = len; 414 trans.len = len;
415 trans.cs_change = 1; 415 trans.cs_change = 1;
416 spi_message_add_tail(&trans, &msg); 416 spi_message_add_tail(&trans, &msg);
417 ret = spi_sync(ec_spi->spi, &msg); 417 ret = spi_sync_locked(ec_spi->spi, &msg);
418 418
419 /* Get the response */ 419 /* Get the response */
420 if (!ret) { 420 if (!ret) {
@@ -440,6 +440,9 @@ static int cros_ec_pkt_xfer_spi(struct cros_ec_device *ec_dev,
440 } 440 }
441 441
442 final_ret = terminate_request(ec_dev); 442 final_ret = terminate_request(ec_dev);
443
444 spi_bus_unlock(ec_spi->spi->master);
445
443 if (!ret) 446 if (!ret)
444 ret = final_ret; 447 ret = final_ret;
445 if (ret < 0) 448 if (ret < 0)
@@ -520,10 +523,10 @@ static int cros_ec_cmd_xfer_spi(struct cros_ec_device *ec_dev,
520 } 523 }
521 524
522 rx_buf = kzalloc(len, GFP_KERNEL); 525 rx_buf = kzalloc(len, GFP_KERNEL);
523 if (!rx_buf) { 526 if (!rx_buf)
524 ret = -ENOMEM; 527 return -ENOMEM;
525 goto exit; 528
526 } 529 spi_bus_lock(ec_spi->spi->master);
527 530
528 /* Transmit phase - send our message */ 531 /* Transmit phase - send our message */
529 debug_packet(ec_dev->dev, "out", ec_dev->dout, len); 532 debug_packet(ec_dev->dev, "out", ec_dev->dout, len);
@@ -534,7 +537,7 @@ static int cros_ec_cmd_xfer_spi(struct cros_ec_device *ec_dev,
534 trans.cs_change = 1; 537 trans.cs_change = 1;
535 spi_message_init(&msg); 538 spi_message_init(&msg);
536 spi_message_add_tail(&trans, &msg); 539 spi_message_add_tail(&trans, &msg);
537 ret = spi_sync(ec_spi->spi, &msg); 540 ret = spi_sync_locked(ec_spi->spi, &msg);
538 541
539 /* Get the response */ 542 /* Get the response */
540 if (!ret) { 543 if (!ret) {
@@ -560,6 +563,9 @@ static int cros_ec_cmd_xfer_spi(struct cros_ec_device *ec_dev,
560 } 563 }
561 564
562 final_ret = terminate_request(ec_dev); 565 final_ret = terminate_request(ec_dev);
566
567 spi_bus_unlock(ec_spi->spi->master);
568
563 if (!ret) 569 if (!ret)
564 ret = final_ret; 570 ret = final_ret;
565 if (ret < 0) 571 if (ret < 0)
diff --git a/drivers/mfd/cs47l24-tables.c b/drivers/mfd/cs47l24-tables.c
new file mode 100644
index 000000000000..870800657594
--- /dev/null
+++ b/drivers/mfd/cs47l24-tables.c
@@ -0,0 +1,1629 @@
1/*
2 * Data tables for CS47L24 codec
3 *
4 * Copyright 2015 Cirrus Logic, Inc.
5 *
6 * Author: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/module.h>
14
15#include <linux/mfd/arizona/core.h>
16#include <linux/mfd/arizona/registers.h>
17#include <linux/device.h>
18
19#include "arizona.h"
20
21#define CS47L24_NUM_ISR 5
22
23static const struct reg_sequence cs47l24_reva_patch[] = {
24 { 0x80, 0x3 },
25 { 0x27C, 0x0010 },
26 { 0x221, 0x0070 },
27 { 0x80, 0x0 },
28};
29
30int cs47l24_patch(struct arizona *arizona)
31{
32 return regmap_register_patch(arizona->regmap,
33 cs47l24_reva_patch,
34 ARRAY_SIZE(cs47l24_reva_patch));
35}
36EXPORT_SYMBOL_GPL(cs47l24_patch);
37
38static const struct regmap_irq cs47l24_irqs[ARIZONA_NUM_IRQ] = {
39 [ARIZONA_IRQ_GP2] = { .reg_offset = 0, .mask = ARIZONA_GP2_EINT1 },
40 [ARIZONA_IRQ_GP1] = { .reg_offset = 0, .mask = ARIZONA_GP1_EINT1 },
41
42 [ARIZONA_IRQ_DSP3_RAM_RDY] = {
43 .reg_offset = 1, .mask = ARIZONA_DSP3_RAM_RDY_EINT1
44 },
45 [ARIZONA_IRQ_DSP2_RAM_RDY] = {
46 .reg_offset = 1, .mask = ARIZONA_DSP2_RAM_RDY_EINT1
47 },
48 [ARIZONA_IRQ_DSP_IRQ8] = {
49 .reg_offset = 1, .mask = ARIZONA_DSP_IRQ8_EINT1
50 },
51 [ARIZONA_IRQ_DSP_IRQ7] = {
52 .reg_offset = 1, .mask = ARIZONA_DSP_IRQ7_EINT1
53 },
54 [ARIZONA_IRQ_DSP_IRQ6] = {
55 .reg_offset = 1, .mask = ARIZONA_DSP_IRQ6_EINT1
56 },
57 [ARIZONA_IRQ_DSP_IRQ5] = {
58 .reg_offset = 1, .mask = ARIZONA_DSP_IRQ5_EINT1
59 },
60 [ARIZONA_IRQ_DSP_IRQ4] = {
61 .reg_offset = 1, .mask = ARIZONA_DSP_IRQ4_EINT1
62 },
63 [ARIZONA_IRQ_DSP_IRQ3] = {
64 .reg_offset = 1, .mask = ARIZONA_DSP_IRQ3_EINT1
65 },
66 [ARIZONA_IRQ_DSP_IRQ2] = {
67 .reg_offset = 1, .mask = ARIZONA_DSP_IRQ2_EINT1
68 },
69 [ARIZONA_IRQ_DSP_IRQ1] = {
70 .reg_offset = 1, .mask = ARIZONA_DSP_IRQ1_EINT1
71 },
72
73 [ARIZONA_IRQ_SPK_OVERHEAT_WARN] = {
74 .reg_offset = 2, .mask = ARIZONA_SPK_OVERHEAT_WARN_EINT1
75 },
76 [ARIZONA_IRQ_SPK_OVERHEAT] = {
77 .reg_offset = 2, .mask = ARIZONA_SPK_OVERHEAT_EINT1
78 },
79 [ARIZONA_IRQ_WSEQ_DONE] = {
80 .reg_offset = 2, .mask = ARIZONA_WSEQ_DONE_EINT1
81 },
82 [ARIZONA_IRQ_DRC2_SIG_DET] = {
83 .reg_offset = 2, .mask = ARIZONA_DRC2_SIG_DET_EINT1
84 },
85 [ARIZONA_IRQ_DRC1_SIG_DET] = {
86 .reg_offset = 2, .mask = ARIZONA_DRC1_SIG_DET_EINT1
87 },
88 [ARIZONA_IRQ_ASRC2_LOCK] = {
89 .reg_offset = 2, .mask = ARIZONA_ASRC2_LOCK_EINT1
90 },
91 [ARIZONA_IRQ_ASRC1_LOCK] = {
92 .reg_offset = 2, .mask = ARIZONA_ASRC1_LOCK_EINT1
93 },
94 [ARIZONA_IRQ_UNDERCLOCKED] = {
95 .reg_offset = 2, .mask = ARIZONA_UNDERCLOCKED_EINT1
96 },
97 [ARIZONA_IRQ_OVERCLOCKED] = {
98 .reg_offset = 2, .mask = ARIZONA_OVERCLOCKED_EINT1
99 },
100 [ARIZONA_IRQ_FLL2_LOCK] = {
101 .reg_offset = 2, .mask = ARIZONA_FLL2_LOCK_EINT1
102 },
103 [ARIZONA_IRQ_FLL1_LOCK] = {
104 .reg_offset = 2, .mask = ARIZONA_FLL1_LOCK_EINT1
105 },
106 [ARIZONA_IRQ_CLKGEN_ERR] = {
107 .reg_offset = 2, .mask = ARIZONA_CLKGEN_ERR_EINT1
108 },
109 [ARIZONA_IRQ_CLKGEN_ERR_ASYNC] = {
110 .reg_offset = 2, .mask = ARIZONA_CLKGEN_ERR_ASYNC_EINT1
111 },
112
113 [ARIZONA_IRQ_CTRLIF_ERR] = {
114 .reg_offset = 3, .mask = ARIZONA_V2_CTRLIF_ERR_EINT1
115 },
116 [ARIZONA_IRQ_MIXER_DROPPED_SAMPLES] = {
117 .reg_offset = 3, .mask = ARIZONA_V2_MIXER_DROPPED_SAMPLE_EINT1
118 },
119 [ARIZONA_IRQ_ASYNC_CLK_ENA_LOW] = {
120 .reg_offset = 3, .mask = ARIZONA_V2_ASYNC_CLK_ENA_LOW_EINT1
121 },
122 [ARIZONA_IRQ_SYSCLK_ENA_LOW] = {
123 .reg_offset = 3, .mask = ARIZONA_V2_SYSCLK_ENA_LOW_EINT1
124 },
125 [ARIZONA_IRQ_ISRC1_CFG_ERR] = {
126 .reg_offset = 3, .mask = ARIZONA_V2_ISRC1_CFG_ERR_EINT1
127 },
128 [ARIZONA_IRQ_ISRC2_CFG_ERR] = {
129 .reg_offset = 3, .mask = ARIZONA_V2_ISRC2_CFG_ERR_EINT1
130 },
131 [ARIZONA_IRQ_ISRC3_CFG_ERR] = {
132 .reg_offset = 3, .mask = ARIZONA_V2_ISRC3_CFG_ERR_EINT1
133 },
134 [ARIZONA_IRQ_HP1R_DONE] = {
135 .reg_offset = 3, .mask = ARIZONA_HP1R_DONE_EINT1
136 },
137 [ARIZONA_IRQ_HP1L_DONE] = {
138 .reg_offset = 3, .mask = ARIZONA_HP1L_DONE_EINT1
139 },
140
141 [ARIZONA_IRQ_BOOT_DONE] = {
142 .reg_offset = 4, .mask = ARIZONA_BOOT_DONE_EINT1
143 },
144 [ARIZONA_IRQ_ASRC_CFG_ERR] = {
145 .reg_offset = 4, .mask = ARIZONA_V2_ASRC_CFG_ERR_EINT1
146 },
147 [ARIZONA_IRQ_FLL2_CLOCK_OK] = {
148 .reg_offset = 4, .mask = ARIZONA_FLL2_CLOCK_OK_EINT1
149 },
150 [ARIZONA_IRQ_FLL1_CLOCK_OK] = {
151 .reg_offset = 4, .mask = ARIZONA_FLL1_CLOCK_OK_EINT1
152 },
153
154 [ARIZONA_IRQ_DSP_SHARED_WR_COLL] = {
155 .reg_offset = 5, .mask = ARIZONA_DSP_SHARED_WR_COLL_EINT1
156 },
157 [ARIZONA_IRQ_SPK_SHUTDOWN] = {
158 .reg_offset = 5, .mask = ARIZONA_SPK_SHUTDOWN_EINT1
159 },
160 [ARIZONA_IRQ_SPK1R_SHORT] = {
161 .reg_offset = 5, .mask = ARIZONA_SPK1R_SHORT_EINT1
162 },
163 [ARIZONA_IRQ_SPK1L_SHORT] = {
164 .reg_offset = 5, .mask = ARIZONA_SPK1L_SHORT_EINT1
165 },
166 [ARIZONA_IRQ_HP1R_SC_POS] = {
167 .reg_offset = 5, .mask = ARIZONA_HP1R_SC_POS_EINT1
168 },
169 [ARIZONA_IRQ_HP1L_SC_POS] = {
170 .reg_offset = 5, .mask = ARIZONA_HP1L_SC_POS_EINT1
171 },
172};
173
174const struct regmap_irq_chip cs47l24_irq = {
175 .name = "cs47l24 IRQ",
176 .status_base = ARIZONA_INTERRUPT_STATUS_1,
177 .mask_base = ARIZONA_INTERRUPT_STATUS_1_MASK,
178 .ack_base = ARIZONA_INTERRUPT_STATUS_1,
179 .num_regs = 6,
180 .irqs = cs47l24_irqs,
181 .num_irqs = ARRAY_SIZE(cs47l24_irqs),
182};
183EXPORT_SYMBOL_GPL(cs47l24_irq);
184
185static const struct reg_default cs47l24_reg_default[] = {
186 { 0x00000008, 0x0019 }, /* R8 - Ctrl IF SPI CFG 1 */
187 { 0x00000020, 0x0000 }, /* R32 - Tone Generator 1 */
188 { 0x00000021, 0x1000 }, /* R33 - Tone Generator 2 */
189 { 0x00000022, 0x0000 }, /* R34 - Tone Generator 3 */
190 { 0x00000023, 0x1000 }, /* R35 - Tone Generator 4 */
191 { 0x00000024, 0x0000 }, /* R36 - Tone Generator 5 */
192 { 0x00000030, 0x0000 }, /* R48 - PWM Drive 1 */
193 { 0x00000031, 0x0100 }, /* R49 - PWM Drive 2 */
194 { 0x00000032, 0x0100 }, /* R50 - PWM Drive 3 */
195 { 0x00000041, 0x0000 }, /* R65 - Sequence control */
196 { 0x00000061, 0x01FF }, /* R97 - Sample Rate Sequence Select 1 */
197 { 0x00000062, 0x01FF }, /* R98 - Sample Rate Sequence Select 2 */
198 { 0x00000063, 0x01FF }, /* R99 - Sample Rate Sequence Select 3 */
199 { 0x00000064, 0x01FF }, /* R100 - Sample Rate Sequence Select 4 */
200 { 0x00000070, 0x0000 }, /* R112 - Comfort Noise Generator */
201 { 0x00000090, 0x0000 }, /* R144 - Haptics Control 1 */
202 { 0x00000091, 0x7FFF }, /* R145 - Haptics Control 2 */
203 { 0x00000092, 0x0000 }, /* R146 - Haptics phase 1 intensity */
204 { 0x00000093, 0x0000 }, /* R147 - Haptics phase 1 duration */
205 { 0x00000094, 0x0000 }, /* R148 - Haptics phase 2 intensity */
206 { 0x00000095, 0x0000 }, /* R149 - Haptics phase 2 duration */
207 { 0x00000096, 0x0000 }, /* R150 - Haptics phase 3 intensity */
208 { 0x00000097, 0x0000 }, /* R151 - Haptics phase 3 duration */
209 { 0x00000100, 0x0002 }, /* R256 - Clock 32k 1 */
210 { 0x00000101, 0x0504 }, /* R257 - System Clock 1 */
211 { 0x00000102, 0x0011 }, /* R258 - Sample rate 1 */
212 { 0x00000103, 0x0011 }, /* R259 - Sample rate 2 */
213 { 0x00000104, 0x0011 }, /* R260 - Sample rate 3 */
214 { 0x00000112, 0x0305 }, /* R274 - Async clock 1 */
215 { 0x00000113, 0x0011 }, /* R275 - Async sample rate 1 */
216 { 0x00000114, 0x0011 }, /* R276 - Async sample rate 2 */
217 { 0x00000149, 0x0000 }, /* R329 - Output system clock */
218 { 0x0000014A, 0x0000 }, /* R330 - Output async clock */
219 { 0x00000152, 0x0000 }, /* R338 - Rate Estimator 1 */
220 { 0x00000153, 0x0000 }, /* R339 - Rate Estimator 2 */
221 { 0x00000154, 0x0000 }, /* R340 - Rate Estimator 3 */
222 { 0x00000155, 0x0000 }, /* R341 - Rate Estimator 4 */
223 { 0x00000156, 0x0000 }, /* R342 - Rate Estimator 5 */
224 { 0x00000171, 0x0002 }, /* R369 - FLL1 Control 1 */
225 { 0x00000172, 0x0008 }, /* R370 - FLL1 Control 2 */
226 { 0x00000173, 0x0018 }, /* R371 - FLL1 Control 3 */
227 { 0x00000174, 0x007D }, /* R372 - FLL1 Control 4 */
228 { 0x00000175, 0x0006 }, /* R373 - FLL1 Control 5 */
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 */
233 { 0x00000181, 0x0000 }, /* R385 - FLL1 Synchroniser 1 */
234 { 0x00000182, 0x0000 }, /* R386 - FLL1 Synchroniser 2 */
235 { 0x00000183, 0x0000 }, /* R387 - FLL1 Synchroniser 3 */
236 { 0x00000184, 0x0000 }, /* R388 - FLL1 Synchroniser 4 */
237 { 0x00000185, 0x0000 }, /* R389 - FLL1 Synchroniser 5 */
238 { 0x00000186, 0x0000 }, /* R390 - FLL1 Synchroniser 6 */
239 { 0x00000187, 0x0001 }, /* R390 - FLL1 Synchroniser 7 */
240 { 0x00000189, 0x0000 }, /* R393 - FLL1 Spread Spectrum */
241 { 0x0000018A, 0x000C }, /* R394 - FLL1 GPIO Clock */
242 { 0x00000191, 0x0002 }, /* R401 - FLL2 Control 1 */
243 { 0x00000192, 0x0008 }, /* R402 - FLL2 Control 2 */
244 { 0x00000193, 0x0018 }, /* R403 - FLL2 Control 3 */
245 { 0x00000194, 0x007D }, /* R404 - FLL2 Control 4 */
246 { 0x00000195, 0x000C }, /* R405 - FLL2 Control 5 */
247 { 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 */
251 { 0x000001A1, 0x0000 }, /* R417 - FLL2 Synchroniser 1 */
252 { 0x000001A2, 0x0000 }, /* R418 - FLL2 Synchroniser 2 */
253 { 0x000001A3, 0x0000 }, /* R419 - FLL2 Synchroniser 3 */
254 { 0x000001A4, 0x0000 }, /* R420 - FLL2 Synchroniser 4 */
255 { 0x000001A5, 0x0000 }, /* R421 - FLL2 Synchroniser 5 */
256 { 0x000001A6, 0x0000 }, /* R422 - FLL2 Synchroniser 6 */
257 { 0x000001A7, 0x0001 }, /* R422 - FLL2 Synchroniser 7 */
258 { 0x000001A9, 0x0000 }, /* R425 - FLL2 Spread Spectrum */
259 { 0x000001AA, 0x000C }, /* R426 - FLL2 GPIO Clock */
260 { 0x00000218, 0x00E6 }, /* R536 - Mic Bias Ctrl 1 */
261 { 0x00000219, 0x00E6 }, /* R537 - Mic Bias Ctrl 2 */
262 { 0x00000300, 0x0000 }, /* R768 - Input Enables */
263 { 0x00000308, 0x0000 }, /* R776 - Input Rate */
264 { 0x00000309, 0x0022 }, /* R777 - Input Volume Ramp */
265 { 0x0000030C, 0x0002 }, /* R780 - HPF Control */
266 { 0x00000310, 0x2000 }, /* R784 - IN1L Control */
267 { 0x00000311, 0x0180 }, /* R785 - ADC Digital Volume 1L */
268 { 0x00000312, 0x0000 }, /* R786 - DMIC1L Control */
269 { 0x00000314, 0x0000 }, /* R788 - IN1R Control */
270 { 0x00000315, 0x0180 }, /* R789 - ADC Digital Volume 1R */
271 { 0x00000316, 0x0000 }, /* R790 - DMIC1R Control */
272 { 0x00000318, 0x2000 }, /* R792 - IN2L Control */
273 { 0x00000319, 0x0180 }, /* R793 - ADC Digital Volume 2L */
274 { 0x0000031A, 0x0000 }, /* R794 - DMIC2L Control */
275 { 0x0000031C, 0x0000 }, /* R796 - IN2R Control */
276 { 0x0000031D, 0x0180 }, /* R797 - ADC Digital Volume 2R */
277 { 0x0000031E, 0x0000 }, /* R798 - DMIC2R Control */
278 { 0x00000400, 0x0000 }, /* R1024 - Output Enables 1 */
279 { 0x00000408, 0x0000 }, /* R1032 - Output Rate 1 */
280 { 0x00000409, 0x0022 }, /* R1033 - Output Volume Ramp */
281 { 0x00000410, 0x0080 }, /* R1040 - Output Path Config 1L */
282 { 0x00000411, 0x0180 }, /* R1041 - DAC Digital Volume 1L */
283 { 0x00000412, 0x0081 }, /* R1042 - DAC Volume Limit 1L */
284 { 0x00000413, 0x0001 }, /* R1043 - Noise Gate Select 1L */
285 { 0x00000415, 0x0180 }, /* R1045 - DAC Digital Volume 1R */
286 { 0x00000416, 0x0081 }, /* R1046 - DAC Volume Limit 1R */
287 { 0x00000417, 0x0002 }, /* R1047 - Noise Gate Select 1R */
288 { 0x00000429, 0x0180 }, /* R1065 - DAC Digital Volume 4L */
289 { 0x0000042A, 0x0081 }, /* R1066 - Out Volume 4L */
290 { 0x0000042B, 0x0040 }, /* R1067 - Noise Gate Select 4L */
291 { 0x00000450, 0x0000 }, /* R1104 - DAC AEC Control 1 */
292 { 0x00000458, 0x0000 }, /* R1112 - Noise Gate Control */
293 { 0x000004A0, 0x3480 }, /* R1184 - HP1 Short Circuit Ctrl */
294 { 0x00000500, 0x000C }, /* R1280 - AIF1 BCLK Ctrl */
295 { 0x00000501, 0x0008 }, /* R1281 - AIF1 Tx Pin Ctrl */
296 { 0x00000502, 0x0000 }, /* R1282 - AIF1 Rx Pin Ctrl */
297 { 0x00000503, 0x0000 }, /* R1283 - AIF1 Rate Ctrl */
298 { 0x00000504, 0x0000 }, /* R1284 - AIF1 Format */
299 { 0x00000506, 0x0040 }, /* R1286 - AIF1 Rx BCLK Rate */
300 { 0x00000507, 0x1818 }, /* R1287 - AIF1 Frame Ctrl 1 */
301 { 0x00000508, 0x1818 }, /* R1288 - AIF1 Frame Ctrl 2 */
302 { 0x00000509, 0x0000 }, /* R1289 - AIF1 Frame Ctrl 3 */
303 { 0x0000050A, 0x0001 }, /* R1290 - AIF1 Frame Ctrl 4 */
304 { 0x0000050B, 0x0002 }, /* R1291 - AIF1 Frame Ctrl 5 */
305 { 0x0000050C, 0x0003 }, /* R1292 - AIF1 Frame Ctrl 6 */
306 { 0x0000050D, 0x0004 }, /* R1293 - AIF1 Frame Ctrl 7 */
307 { 0x0000050E, 0x0005 }, /* R1294 - AIF1 Frame Ctrl 8 */
308 { 0x0000050F, 0x0006 }, /* R1295 - AIF1 Frame Ctrl 9 */
309 { 0x00000510, 0x0007 }, /* R1296 - AIF1 Frame Ctrl 10 */
310 { 0x00000511, 0x0000 }, /* R1297 - AIF1 Frame Ctrl 11 */
311 { 0x00000512, 0x0001 }, /* R1298 - AIF1 Frame Ctrl 12 */
312 { 0x00000513, 0x0002 }, /* R1299 - AIF1 Frame Ctrl 13 */
313 { 0x00000514, 0x0003 }, /* R1300 - AIF1 Frame Ctrl 14 */
314 { 0x00000515, 0x0004 }, /* R1301 - AIF1 Frame Ctrl 15 */
315 { 0x00000516, 0x0005 }, /* R1302 - AIF1 Frame Ctrl 16 */
316 { 0x00000517, 0x0006 }, /* R1303 - AIF1 Frame Ctrl 17 */
317 { 0x00000518, 0x0007 }, /* R1304 - AIF1 Frame Ctrl 18 */
318 { 0x00000519, 0x0000 }, /* R1305 - AIF1 Tx Enables */
319 { 0x0000051A, 0x0000 }, /* R1306 - AIF1 Rx Enables */
320 { 0x00000540, 0x000C }, /* R1344 - AIF2 BCLK Ctrl */
321 { 0x00000541, 0x0008 }, /* R1345 - AIF2 Tx Pin Ctrl */
322 { 0x00000542, 0x0000 }, /* R1346 - AIF2 Rx Pin Ctrl */
323 { 0x00000543, 0x0000 }, /* R1347 - AIF2 Rate Ctrl */
324 { 0x00000544, 0x0000 }, /* R1348 - AIF2 Format */
325 { 0x00000546, 0x0040 }, /* R1350 - AIF2 Rx BCLK Rate */
326 { 0x00000547, 0x1818 }, /* R1351 - AIF2 Frame Ctrl 1 */
327 { 0x00000548, 0x1818 }, /* R1352 - AIF2 Frame Ctrl 2 */
328 { 0x00000549, 0x0000 }, /* R1353 - AIF2 Frame Ctrl 3 */
329 { 0x0000054A, 0x0001 }, /* R1354 - AIF2 Frame Ctrl 4 */
330 { 0x0000054B, 0x0002 }, /* R1355 - AIF2 Frame Ctrl 5 */
331 { 0x0000054C, 0x0003 }, /* R1356 - AIF2 Frame Ctrl 6 */
332 { 0x0000054D, 0x0004 }, /* R1357 - AIF2 Frame Ctrl 7 */
333 { 0x0000054E, 0x0005 }, /* R1358 - AIF2 Frame Ctrl 8 */
334 { 0x00000551, 0x0000 }, /* R1361 - AIF2 Frame Ctrl 11 */
335 { 0x00000552, 0x0001 }, /* R1362 - AIF2 Frame Ctrl 12 */
336 { 0x00000553, 0x0002 }, /* R1363 - AIF2 Frame Ctrl 13 */
337 { 0x00000554, 0x0003 }, /* R1364 - AIF2 Frame Ctrl 14 */
338 { 0x00000555, 0x0004 }, /* R1365 - AIF2 Frame Ctrl 15 */
339 { 0x00000556, 0x0005 }, /* R1366 - AIF2 Frame Ctrl 16 */
340 { 0x00000559, 0x0000 }, /* R1369 - AIF2 Tx Enables */
341 { 0x0000055A, 0x0000 }, /* R1370 - AIF2 Rx Enables */
342 { 0x00000580, 0x000C }, /* R1408 - AIF3 BCLK Ctrl */
343 { 0x00000581, 0x0008 }, /* R1409 - AIF3 Tx Pin Ctrl */
344 { 0x00000582, 0x0000 }, /* R1410 - AIF3 Rx Pin Ctrl */
345 { 0x00000583, 0x0000 }, /* R1411 - AIF3 Rate Ctrl */
346 { 0x00000584, 0x0000 }, /* R1412 - AIF3 Format */
347 { 0x00000586, 0x0040 }, /* R1414 - AIF3 Rx BCLK Rate */
348 { 0x00000587, 0x1818 }, /* R1415 - AIF3 Frame Ctrl 1 */
349 { 0x00000588, 0x1818 }, /* R1416 - AIF3 Frame Ctrl 2 */
350 { 0x00000589, 0x0000 }, /* R1417 - AIF3 Frame Ctrl 3 */
351 { 0x0000058A, 0x0001 }, /* R1418 - AIF3 Frame Ctrl 4 */
352 { 0x00000591, 0x0000 }, /* R1425 - AIF3 Frame Ctrl 11 */
353 { 0x00000592, 0x0001 }, /* R1426 - AIF3 Frame Ctrl 12 */
354 { 0x00000599, 0x0000 }, /* R1433 - AIF3 Tx Enables */
355 { 0x0000059A, 0x0000 }, /* R1434 - AIF3 Rx Enables */
356 { 0x00000640, 0x0000 }, /* R1600 - PWM1MIX Input 1 Source */
357 { 0x00000641, 0x0080 }, /* R1601 - PWM1MIX Input 1 Volume */
358 { 0x00000642, 0x0000 }, /* R1602 - PWM1MIX Input 2 Source */
359 { 0x00000643, 0x0080 }, /* R1603 - PWM1MIX Input 2 Volume */
360 { 0x00000644, 0x0000 }, /* R1604 - PWM1MIX Input 3 Source */
361 { 0x00000645, 0x0080 }, /* R1605 - PWM1MIX Input 3 Volume */
362 { 0x00000646, 0x0000 }, /* R1606 - PWM1MIX Input 4 Source */
363 { 0x00000647, 0x0080 }, /* R1607 - PWM1MIX Input 4 Volume */
364 { 0x00000648, 0x0000 }, /* R1608 - PWM2MIX Input 1 Source */
365 { 0x00000649, 0x0080 }, /* R1609 - PWM2MIX Input 1 Volume */
366 { 0x0000064A, 0x0000 }, /* R1610 - PWM2MIX Input 2 Source */
367 { 0x0000064B, 0x0080 }, /* R1611 - PWM2MIX Input 2 Volume */
368 { 0x0000064C, 0x0000 }, /* R1612 - PWM2MIX Input 3 Source */
369 { 0x0000064D, 0x0080 }, /* R1613 - PWM2MIX Input 3 Volume */
370 { 0x0000064E, 0x0000 }, /* R1614 - PWM2MIX Input 4 Source */
371 { 0x0000064F, 0x0080 }, /* R1615 - PWM2MIX Input 4 Volume */
372 { 0x00000680, 0x0000 }, /* R1664 - OUT1LMIX Input 1 Source */
373 { 0x00000681, 0x0080 }, /* R1665 - OUT1LMIX Input 1 Volume */
374 { 0x00000682, 0x0000 }, /* R1666 - OUT1LMIX Input 2 Source */
375 { 0x00000683, 0x0080 }, /* R1667 - OUT1LMIX Input 2 Volume */
376 { 0x00000684, 0x0000 }, /* R1668 - OUT1LMIX Input 3 Source */
377 { 0x00000685, 0x0080 }, /* R1669 - OUT1LMIX Input 3 Volume */
378 { 0x00000686, 0x0000 }, /* R1670 - OUT1LMIX Input 4 Source */
379 { 0x00000687, 0x0080 }, /* R1671 - OUT1LMIX Input 4 Volume */
380 { 0x00000688, 0x0000 }, /* R1672 - OUT1RMIX Input 1 Source */
381 { 0x00000689, 0x0080 }, /* R1673 - OUT1RMIX Input 1 Volume */
382 { 0x0000068A, 0x0000 }, /* R1674 - OUT1RMIX Input 2 Source */
383 { 0x0000068B, 0x0080 }, /* R1675 - OUT1RMIX Input 2 Volume */
384 { 0x0000068C, 0x0000 }, /* R1676 - OUT1RMIX Input 3 Source */
385 { 0x0000068D, 0x0080 }, /* R1677 - OUT1RMIX Input 3 Volume */
386 { 0x0000068E, 0x0000 }, /* R1678 - OUT1RMIX Input 4 Source */
387 { 0x0000068F, 0x0080 }, /* R1679 - OUT1RMIX Input 4 Volume */
388 { 0x000006B0, 0x0000 }, /* R1712 - OUT4LMIX Input 1 Source */
389 { 0x000006B1, 0x0080 }, /* R1713 - OUT4LMIX Input 1 Volume */
390 { 0x000006B2, 0x0000 }, /* R1714 - OUT4LMIX Input 2 Source */
391 { 0x000006B3, 0x0080 }, /* R1715 - OUT4LMIX Input 2 Volume */
392 { 0x000006B4, 0x0000 }, /* R1716 - OUT4LMIX Input 3 Source */
393 { 0x000006B5, 0x0080 }, /* R1717 - OUT4LMIX Input 3 Volume */
394 { 0x000006B6, 0x0000 }, /* R1718 - OUT4LMIX Input 4 Source */
395 { 0x000006B7, 0x0080 }, /* R1719 - OUT4LMIX Input 4 Volume */
396 { 0x00000700, 0x0000 }, /* R1792 - AIF1TX1MIX Input 1 Source */
397 { 0x00000701, 0x0080 }, /* R1793 - AIF1TX1MIX Input 1 Volume */
398 { 0x00000702, 0x0000 }, /* R1794 - AIF1TX1MIX Input 2 Source */
399 { 0x00000703, 0x0080 }, /* R1795 - AIF1TX1MIX Input 2 Volume */
400 { 0x00000704, 0x0000 }, /* R1796 - AIF1TX1MIX Input 3 Source */
401 { 0x00000705, 0x0080 }, /* R1797 - AIF1TX1MIX Input 3 Volume */
402 { 0x00000706, 0x0000 }, /* R1798 - AIF1TX1MIX Input 4 Source */
403 { 0x00000707, 0x0080 }, /* R1799 - AIF1TX1MIX Input 4 Volume */
404 { 0x00000708, 0x0000 }, /* R1800 - AIF1TX2MIX Input 1 Source */
405 { 0x00000709, 0x0080 }, /* R1801 - AIF1TX2MIX Input 1 Volume */
406 { 0x0000070A, 0x0000 }, /* R1802 - AIF1TX2MIX Input 2 Source */
407 { 0x0000070B, 0x0080 }, /* R1803 - AIF1TX2MIX Input 2 Volume */
408 { 0x0000070C, 0x0000 }, /* R1804 - AIF1TX2MIX Input 3 Source */
409 { 0x0000070D, 0x0080 }, /* R1805 - AIF1TX2MIX Input 3 Volume */
410 { 0x0000070E, 0x0000 }, /* R1806 - AIF1TX2MIX Input 4 Source */
411 { 0x0000070F, 0x0080 }, /* R1807 - AIF1TX2MIX Input 4 Volume */
412 { 0x00000710, 0x0000 }, /* R1808 - AIF1TX3MIX Input 1 Source */
413 { 0x00000711, 0x0080 }, /* R1809 - AIF1TX3MIX Input 1 Volume */
414 { 0x00000712, 0x0000 }, /* R1810 - AIF1TX3MIX Input 2 Source */
415 { 0x00000713, 0x0080 }, /* R1811 - AIF1TX3MIX Input 2 Volume */
416 { 0x00000714, 0x0000 }, /* R1812 - AIF1TX3MIX Input 3 Source */
417 { 0x00000715, 0x0080 }, /* R1813 - AIF1TX3MIX Input 3 Volume */
418 { 0x00000716, 0x0000 }, /* R1814 - AIF1TX3MIX Input 4 Source */
419 { 0x00000717, 0x0080 }, /* R1815 - AIF1TX3MIX Input 4 Volume */
420 { 0x00000718, 0x0000 }, /* R1816 - AIF1TX4MIX Input 1 Source */
421 { 0x00000719, 0x0080 }, /* R1817 - AIF1TX4MIX Input 1 Volume */
422 { 0x0000071A, 0x0000 }, /* R1818 - AIF1TX4MIX Input 2 Source */
423 { 0x0000071B, 0x0080 }, /* R1819 - AIF1TX4MIX Input 2 Volume */
424 { 0x0000071C, 0x0000 }, /* R1820 - AIF1TX4MIX Input 3 Source */
425 { 0x0000071D, 0x0080 }, /* R1821 - AIF1TX4MIX Input 3 Volume */
426 { 0x0000071E, 0x0000 }, /* R1822 - AIF1TX4MIX Input 4 Source */
427 { 0x0000071F, 0x0080 }, /* R1823 - AIF1TX4MIX Input 4 Volume */
428 { 0x00000720, 0x0000 }, /* R1824 - AIF1TX5MIX Input 1 Source */
429 { 0x00000721, 0x0080 }, /* R1825 - AIF1TX5MIX Input 1 Volume */
430 { 0x00000722, 0x0000 }, /* R1826 - AIF1TX5MIX Input 2 Source */
431 { 0x00000723, 0x0080 }, /* R1827 - AIF1TX5MIX Input 2 Volume */
432 { 0x00000724, 0x0000 }, /* R1828 - AIF1TX5MIX Input 3 Source */
433 { 0x00000725, 0x0080 }, /* R1829 - AIF1TX5MIX Input 3 Volume */
434 { 0x00000726, 0x0000 }, /* R1830 - AIF1TX5MIX Input 4 Source */
435 { 0x00000727, 0x0080 }, /* R1831 - AIF1TX5MIX Input 4 Volume */
436 { 0x00000728, 0x0000 }, /* R1832 - AIF1TX6MIX Input 1 Source */
437 { 0x00000729, 0x0080 }, /* R1833 - AIF1TX6MIX Input 1 Volume */
438 { 0x0000072A, 0x0000 }, /* R1834 - AIF1TX6MIX Input 2 Source */
439 { 0x0000072B, 0x0080 }, /* R1835 - AIF1TX6MIX Input 2 Volume */
440 { 0x0000072C, 0x0000 }, /* R1836 - AIF1TX6MIX Input 3 Source */
441 { 0x0000072D, 0x0080 }, /* R1837 - AIF1TX6MIX Input 3 Volume */
442 { 0x0000072E, 0x0000 }, /* R1838 - AIF1TX6MIX Input 4 Source */
443 { 0x0000072F, 0x0080 }, /* R1839 - AIF1TX6MIX Input 4 Volume */
444 { 0x00000730, 0x0000 }, /* R1840 - AIF1TX7MIX Input 1 Source */
445 { 0x00000731, 0x0080 }, /* R1841 - AIF1TX7MIX Input 1 Volume */
446 { 0x00000732, 0x0000 }, /* R1842 - AIF1TX7MIX Input 2 Source */
447 { 0x00000733, 0x0080 }, /* R1843 - AIF1TX7MIX Input 2 Volume */
448 { 0x00000734, 0x0000 }, /* R1844 - AIF1TX7MIX Input 3 Source */
449 { 0x00000735, 0x0080 }, /* R1845 - AIF1TX7MIX Input 3 Volume */
450 { 0x00000736, 0x0000 }, /* R1846 - AIF1TX7MIX Input 4 Source */
451 { 0x00000737, 0x0080 }, /* R1847 - AIF1TX7MIX Input 4 Volume */
452 { 0x00000738, 0x0000 }, /* R1848 - AIF1TX8MIX Input 1 Source */
453 { 0x00000739, 0x0080 }, /* R1849 - AIF1TX8MIX Input 1 Volume */
454 { 0x0000073A, 0x0000 }, /* R1850 - AIF1TX8MIX Input 2 Source */
455 { 0x0000073B, 0x0080 }, /* R1851 - AIF1TX8MIX Input 2 Volume */
456 { 0x0000073C, 0x0000 }, /* R1852 - AIF1TX8MIX Input 3 Source */
457 { 0x0000073D, 0x0080 }, /* R1853 - AIF1TX8MIX Input 3 Volume */
458 { 0x0000073E, 0x0000 }, /* R1854 - AIF1TX8MIX Input 4 Source */
459 { 0x0000073F, 0x0080 }, /* R1855 - AIF1TX8MIX Input 4 Volume */
460 { 0x00000740, 0x0000 }, /* R1856 - AIF2TX1MIX Input 1 Source */
461 { 0x00000741, 0x0080 }, /* R1857 - AIF2TX1MIX Input 1 Volume */
462 { 0x00000742, 0x0000 }, /* R1858 - AIF2TX1MIX Input 2 Source */
463 { 0x00000743, 0x0080 }, /* R1859 - AIF2TX1MIX Input 2 Volume */
464 { 0x00000744, 0x0000 }, /* R1860 - AIF2TX1MIX Input 3 Source */
465 { 0x00000745, 0x0080 }, /* R1861 - AIF2TX1MIX Input 3 Volume */
466 { 0x00000746, 0x0000 }, /* R1862 - AIF2TX1MIX Input 4 Source */
467 { 0x00000747, 0x0080 }, /* R1863 - AIF2TX1MIX Input 4 Volume */
468 { 0x00000748, 0x0000 }, /* R1864 - AIF2TX2MIX Input 1 Source */
469 { 0x00000749, 0x0080 }, /* R1865 - AIF2TX2MIX Input 1 Volume */
470 { 0x0000074A, 0x0000 }, /* R1866 - AIF2TX2MIX Input 2 Source */
471 { 0x0000074B, 0x0080 }, /* R1867 - AIF2TX2MIX Input 2 Volume */
472 { 0x0000074C, 0x0000 }, /* R1868 - AIF2TX2MIX Input 3 Source */
473 { 0x0000074D, 0x0080 }, /* R1869 - AIF2TX2MIX Input 3 Volume */
474 { 0x0000074E, 0x0000 }, /* R1870 - AIF2TX2MIX Input 4 Source */
475 { 0x0000074F, 0x0080 }, /* R1871 - AIF2TX2MIX Input 4 Volume */
476 { 0x00000750, 0x0000 }, /* R1872 - AIF2TX3MIX Input 1 Source */
477 { 0x00000751, 0x0080 }, /* R1873 - AIF2TX3MIX Input 1 Volume */
478 { 0x00000752, 0x0000 }, /* R1874 - AIF2TX3MIX Input 2 Source */
479 { 0x00000753, 0x0080 }, /* R1875 - AIF2TX3MIX Input 2 Volume */
480 { 0x00000754, 0x0000 }, /* R1876 - AIF2TX3MIX Input 3 Source */
481 { 0x00000755, 0x0080 }, /* R1877 - AIF2TX3MIX Input 3 Volume */
482 { 0x00000756, 0x0000 }, /* R1878 - AIF2TX3MIX Input 4 Source */
483 { 0x00000757, 0x0080 }, /* R1879 - AIF2TX3MIX Input 4 Volume */
484 { 0x00000758, 0x0000 }, /* R1880 - AIF2TX4MIX Input 1 Source */
485 { 0x00000759, 0x0080 }, /* R1881 - AIF2TX4MIX Input 1 Volume */
486 { 0x0000075A, 0x0000 }, /* R1882 - AIF2TX4MIX Input 2 Source */
487 { 0x0000075B, 0x0080 }, /* R1883 - AIF2TX4MIX Input 2 Volume */
488 { 0x0000075C, 0x0000 }, /* R1884 - AIF2TX4MIX Input 3 Source */
489 { 0x0000075D, 0x0080 }, /* R1885 - AIF2TX4MIX Input 3 Volume */
490 { 0x0000075E, 0x0000 }, /* R1886 - AIF2TX4MIX Input 4 Source */
491 { 0x0000075F, 0x0080 }, /* R1887 - AIF2TX4MIX Input 4 Volume */
492 { 0x00000760, 0x0000 }, /* R1888 - AIF2TX5MIX Input 1 Source */
493 { 0x00000761, 0x0080 }, /* R1889 - AIF2TX5MIX Input 1 Volume */
494 { 0x00000762, 0x0000 }, /* R1890 - AIF2TX5MIX Input 2 Source */
495 { 0x00000763, 0x0080 }, /* R1891 - AIF2TX5MIX Input 2 Volume */
496 { 0x00000764, 0x0000 }, /* R1892 - AIF2TX5MIX Input 3 Source */
497 { 0x00000765, 0x0080 }, /* R1893 - AIF2TX5MIX Input 3 Volume */
498 { 0x00000766, 0x0000 }, /* R1894 - AIF2TX5MIX Input 4 Source */
499 { 0x00000767, 0x0080 }, /* R1895 - AIF2TX5MIX Input 4 Volume */
500 { 0x00000768, 0x0000 }, /* R1896 - AIF2TX6MIX Input 1 Source */
501 { 0x00000769, 0x0080 }, /* R1897 - AIF2TX6MIX Input 1 Volume */
502 { 0x0000076A, 0x0000 }, /* R1898 - AIF2TX6MIX Input 2 Source */
503 { 0x0000076B, 0x0080 }, /* R1899 - AIF2TX6MIX Input 2 Volume */
504 { 0x0000076C, 0x0000 }, /* R1900 - AIF2TX6MIX Input 3 Source */
505 { 0x0000076D, 0x0080 }, /* R1901 - AIF2TX6MIX Input 3 Volume */
506 { 0x0000076E, 0x0000 }, /* R1902 - AIF2TX6MIX Input 4 Source */
507 { 0x0000076F, 0x0080 }, /* R1903 - AIF2TX6MIX Input 4 Volume */
508 { 0x00000780, 0x0000 }, /* R1920 - AIF3TX1MIX Input 1 Source */
509 { 0x00000781, 0x0080 }, /* R1921 - AIF3TX1MIX Input 1 Volume */
510 { 0x00000782, 0x0000 }, /* R1922 - AIF3TX1MIX Input 2 Source */
511 { 0x00000783, 0x0080 }, /* R1923 - AIF3TX1MIX Input 2 Volume */
512 { 0x00000784, 0x0000 }, /* R1924 - AIF3TX1MIX Input 3 Source */
513 { 0x00000785, 0x0080 }, /* R1925 - AIF3TX1MIX Input 3 Volume */
514 { 0x00000786, 0x0000 }, /* R1926 - AIF3TX1MIX Input 4 Source */
515 { 0x00000787, 0x0080 }, /* R1927 - AIF3TX1MIX Input 4 Volume */
516 { 0x00000788, 0x0000 }, /* R1928 - AIF3TX2MIX Input 1 Source */
517 { 0x00000789, 0x0080 }, /* R1929 - AIF3TX2MIX Input 1 Volume */
518 { 0x0000078A, 0x0000 }, /* R1930 - AIF3TX2MIX Input 2 Source */
519 { 0x0000078B, 0x0080 }, /* R1931 - AIF3TX2MIX Input 2 Volume */
520 { 0x0000078C, 0x0000 }, /* R1932 - AIF3TX2MIX Input 3 Source */
521 { 0x0000078D, 0x0080 }, /* R1933 - AIF3TX2MIX Input 3 Volume */
522 { 0x0000078E, 0x0000 }, /* R1934 - AIF3TX2MIX Input 4 Source */
523 { 0x0000078F, 0x0080 }, /* R1935 - AIF3TX2MIX Input 4 Volume */
524 { 0x00000880, 0x0000 }, /* R2176 - EQ1MIX Input 1 Source */
525 { 0x00000881, 0x0080 }, /* R2177 - EQ1MIX Input 1 Volume */
526 { 0x00000882, 0x0000 }, /* R2178 - EQ1MIX Input 2 Source */
527 { 0x00000883, 0x0080 }, /* R2179 - EQ1MIX Input 2 Volume */
528 { 0x00000884, 0x0000 }, /* R2180 - EQ1MIX Input 3 Source */
529 { 0x00000885, 0x0080 }, /* R2181 - EQ1MIX Input 3 Volume */
530 { 0x00000886, 0x0000 }, /* R2182 - EQ1MIX Input 4 Source */
531 { 0x00000887, 0x0080 }, /* R2183 - EQ1MIX Input 4 Volume */
532 { 0x00000888, 0x0000 }, /* R2184 - EQ2MIX Input 1 Source */
533 { 0x00000889, 0x0080 }, /* R2185 - EQ2MIX Input 1 Volume */
534 { 0x0000088A, 0x0000 }, /* R2186 - EQ2MIX Input 2 Source */
535 { 0x0000088B, 0x0080 }, /* R2187 - EQ2MIX Input 2 Volume */
536 { 0x0000088C, 0x0000 }, /* R2188 - EQ2MIX Input 3 Source */
537 { 0x0000088D, 0x0080 }, /* R2189 - EQ2MIX Input 3 Volume */
538 { 0x0000088E, 0x0000 }, /* R2190 - EQ2MIX Input 4 Source */
539 { 0x0000088F, 0x0080 }, /* R2191 - EQ2MIX Input 4 Volume */
540 { 0x000008C0, 0x0000 }, /* R2240 - DRC1LMIX Input 1 Source */
541 { 0x000008C1, 0x0080 }, /* R2241 - DRC1LMIX Input 1 Volume */
542 { 0x000008C2, 0x0000 }, /* R2242 - DRC1LMIX Input 2 Source */
543 { 0x000008C3, 0x0080 }, /* R2243 - DRC1LMIX Input 2 Volume */
544 { 0x000008C4, 0x0000 }, /* R2244 - DRC1LMIX Input 3 Source */
545 { 0x000008C5, 0x0080 }, /* R2245 - DRC1LMIX Input 3 Volume */
546 { 0x000008C6, 0x0000 }, /* R2246 - DRC1LMIX Input 4 Source */
547 { 0x000008C7, 0x0080 }, /* R2247 - DRC1LMIX Input 4 Volume */
548 { 0x000008C8, 0x0000 }, /* R2248 - DRC1RMIX Input 1 Source */
549 { 0x000008C9, 0x0080 }, /* R2249 - DRC1RMIX Input 1 Volume */
550 { 0x000008CA, 0x0000 }, /* R2250 - DRC1RMIX Input 2 Source */
551 { 0x000008CB, 0x0080 }, /* R2251 - DRC1RMIX Input 2 Volume */
552 { 0x000008CC, 0x0000 }, /* R2252 - DRC1RMIX Input 3 Source */
553 { 0x000008CD, 0x0080 }, /* R2253 - DRC1RMIX Input 3 Volume */
554 { 0x000008CE, 0x0000 }, /* R2254 - DRC1RMIX Input 4 Source */
555 { 0x000008CF, 0x0080 }, /* R2255 - DRC1RMIX Input 4 Volume */
556 { 0x000008D0, 0x0000 }, /* R2256 - DRC2LMIX Input 1 Source */
557 { 0x000008D1, 0x0080 }, /* R2257 - DRC2LMIX Input 1 Volume */
558 { 0x000008D2, 0x0000 }, /* R2258 - DRC2LMIX Input 2 Source */
559 { 0x000008D3, 0x0080 }, /* R2259 - DRC2LMIX Input 2 Volume */
560 { 0x000008D4, 0x0000 }, /* R2260 - DRC2LMIX Input 3 Source */
561 { 0x000008D5, 0x0080 }, /* R2261 - DRC2LMIX Input 3 Volume */
562 { 0x000008D6, 0x0000 }, /* R2262 - DRC2LMIX Input 4 Source */
563 { 0x000008D7, 0x0080 }, /* R2263 - DRC2LMIX Input 4 Volume */
564 { 0x000008D8, 0x0000 }, /* R2264 - DRC2RMIX Input 1 Source */
565 { 0x000008D9, 0x0080 }, /* R2265 - DRC2RMIX Input 1 Volume */
566 { 0x000008DA, 0x0000 }, /* R2266 - DRC2RMIX Input 2 Source */
567 { 0x000008DB, 0x0080 }, /* R2267 - DRC2RMIX Input 2 Volume */
568 { 0x000008DC, 0x0000 }, /* R2268 - DRC2RMIX Input 3 Source */
569 { 0x000008DD, 0x0080 }, /* R2269 - DRC2RMIX Input 3 Volume */
570 { 0x000008DE, 0x0000 }, /* R2270 - DRC2RMIX Input 4 Source */
571 { 0x000008DF, 0x0080 }, /* R2271 - DRC2RMIX Input 4 Volume */
572 { 0x00000900, 0x0000 }, /* R2304 - HPLP1MIX Input 1 Source */
573 { 0x00000901, 0x0080 }, /* R2305 - HPLP1MIX Input 1 Volume */
574 { 0x00000902, 0x0000 }, /* R2306 - HPLP1MIX Input 2 Source */
575 { 0x00000903, 0x0080 }, /* R2307 - HPLP1MIX Input 2 Volume */
576 { 0x00000904, 0x0000 }, /* R2308 - HPLP1MIX Input 3 Source */
577 { 0x00000905, 0x0080 }, /* R2309 - HPLP1MIX Input 3 Volume */
578 { 0x00000906, 0x0000 }, /* R2310 - HPLP1MIX Input 4 Source */
579 { 0x00000907, 0x0080 }, /* R2311 - HPLP1MIX Input 4 Volume */
580 { 0x00000908, 0x0000 }, /* R2312 - HPLP2MIX Input 1 Source */
581 { 0x00000909, 0x0080 }, /* R2313 - HPLP2MIX Input 1 Volume */
582 { 0x0000090A, 0x0000 }, /* R2314 - HPLP2MIX Input 2 Source */
583 { 0x0000090B, 0x0080 }, /* R2315 - HPLP2MIX Input 2 Volume */
584 { 0x0000090C, 0x0000 }, /* R2316 - HPLP2MIX Input 3 Source */
585 { 0x0000090D, 0x0080 }, /* R2317 - HPLP2MIX Input 3 Volume */
586 { 0x0000090E, 0x0000 }, /* R2318 - HPLP2MIX Input 4 Source */
587 { 0x0000090F, 0x0080 }, /* R2319 - HPLP2MIX Input 4 Volume */
588 { 0x00000910, 0x0000 }, /* R2320 - HPLP3MIX Input 1 Source */
589 { 0x00000911, 0x0080 }, /* R2321 - HPLP3MIX Input 1 Volume */
590 { 0x00000912, 0x0000 }, /* R2322 - HPLP3MIX Input 2 Source */
591 { 0x00000913, 0x0080 }, /* R2323 - HPLP3MIX Input 2 Volume */
592 { 0x00000914, 0x0000 }, /* R2324 - HPLP3MIX Input 3 Source */
593 { 0x00000915, 0x0080 }, /* R2325 - HPLP3MIX Input 3 Volume */
594 { 0x00000916, 0x0000 }, /* R2326 - HPLP3MIX Input 4 Source */
595 { 0x00000917, 0x0080 }, /* R2327 - HPLP3MIX Input 4 Volume */
596 { 0x00000918, 0x0000 }, /* R2328 - HPLP4MIX Input 1 Source */
597 { 0x00000919, 0x0080 }, /* R2329 - HPLP4MIX Input 1 Volume */
598 { 0x0000091A, 0x0000 }, /* R2330 - HPLP4MIX Input 2 Source */
599 { 0x0000091B, 0x0080 }, /* R2331 - HPLP4MIX Input 2 Volume */
600 { 0x0000091C, 0x0000 }, /* R2332 - HPLP4MIX Input 3 Source */
601 { 0x0000091D, 0x0080 }, /* R2333 - HPLP4MIX Input 3 Volume */
602 { 0x0000091E, 0x0000 }, /* R2334 - HPLP4MIX Input 4 Source */
603 { 0x0000091F, 0x0080 }, /* R2335 - HPLP4MIX Input 4 Volume */
604 { 0x00000980, 0x0000 }, /* R2432 - DSP2LMIX Input 1 Source */
605 { 0x00000981, 0x0080 }, /* R2433 - DSP2LMIX Input 1 Volume */
606 { 0x00000982, 0x0000 }, /* R2434 - DSP2LMIX Input 2 Source */
607 { 0x00000983, 0x0080 }, /* R2435 - DSP2LMIX Input 2 Volume */
608 { 0x00000984, 0x0000 }, /* R2436 - DSP2LMIX Input 3 Source */
609 { 0x00000985, 0x0080 }, /* R2437 - DSP2LMIX Input 3 Volume */
610 { 0x00000986, 0x0000 }, /* R2438 - DSP2LMIX Input 4 Source */
611 { 0x00000987, 0x0080 }, /* R2439 - DSP2LMIX Input 4 Volume */
612 { 0x00000988, 0x0000 }, /* R2440 - DSP2RMIX Input 1 Source */
613 { 0x00000989, 0x0080 }, /* R2441 - DSP2RMIX Input 1 Volume */
614 { 0x0000098A, 0x0000 }, /* R2442 - DSP2RMIX Input 2 Source */
615 { 0x0000098B, 0x0080 }, /* R2443 - DSP2RMIX Input 2 Volume */
616 { 0x0000098C, 0x0000 }, /* R2444 - DSP2RMIX Input 3 Source */
617 { 0x0000098D, 0x0080 }, /* R2445 - DSP2RMIX Input 3 Volume */
618 { 0x0000098E, 0x0000 }, /* R2446 - DSP2RMIX Input 4 Source */
619 { 0x0000098F, 0x0080 }, /* R2447 - DSP2RMIX Input 4 Volume */
620 { 0x00000990, 0x0000 }, /* R2448 - DSP2AUX1MIX Input 1 Source */
621 { 0x00000998, 0x0000 }, /* R2456 - DSP2AUX2MIX Input 1 Source */
622 { 0x000009A0, 0x0000 }, /* R2464 - DSP2AUX3MIX Input 1 Source */
623 { 0x000009A8, 0x0000 }, /* R2472 - DSP2AUX4MIX Input 1 Source */
624 { 0x000009B0, 0x0000 }, /* R2480 - DSP2AUX5MIX Input 1 Source */
625 { 0x000009B8, 0x0000 }, /* R2488 - DSP2AUX6MIX Input 1 Source */
626 { 0x000009C0, 0x0000 }, /* R2496 - DSP3LMIX Input 1 Source */
627 { 0x000009C1, 0x0080 }, /* R2497 - DSP3LMIX Input 1 Volume */
628 { 0x000009C2, 0x0000 }, /* R2498 - DSP3LMIX Input 2 Source */
629 { 0x000009C3, 0x0080 }, /* R2499 - DSP3LMIX Input 2 Volume */
630 { 0x000009C4, 0x0000 }, /* R2500 - DSP3LMIX Input 3 Source */
631 { 0x000009C5, 0x0080 }, /* R2501 - DSP3LMIX Input 3 Volume */
632 { 0x000009C6, 0x0000 }, /* R2502 - DSP3LMIX Input 4 Source */
633 { 0x000009C7, 0x0080 }, /* R2503 - DSP3LMIX Input 4 Volume */
634 { 0x000009C8, 0x0000 }, /* R2504 - DSP3RMIX Input 1 Source */
635 { 0x000009C9, 0x0080 }, /* R2505 - DSP3RMIX Input 1 Volume */
636 { 0x000009CA, 0x0000 }, /* R2506 - DSP3RMIX Input 2 Source */
637 { 0x000009CB, 0x0080 }, /* R2507 - DSP3RMIX Input 2 Volume */
638 { 0x000009CC, 0x0000 }, /* R2508 - DSP3RMIX Input 3 Source */
639 { 0x000009CD, 0x0080 }, /* R2509 - DSP3RMIX Input 3 Volume */
640 { 0x000009CE, 0x0000 }, /* R2510 - DSP3RMIX Input 4 Source */
641 { 0x000009CF, 0x0080 }, /* R2511 - DSP3RMIX Input 4 Volume */
642 { 0x000009D0, 0x0000 }, /* R2512 - DSP3AUX1MIX Input 1 Source */
643 { 0x000009D8, 0x0000 }, /* R2520 - DSP3AUX2MIX Input 1 Source */
644 { 0x000009E0, 0x0000 }, /* R2528 - DSP3AUX3MIX Input 1 Source */
645 { 0x000009E8, 0x0000 }, /* R2536 - DSP3AUX4MIX Input 1 Source */
646 { 0x000009F0, 0x0000 }, /* R2544 - DSP3AUX5MIX Input 1 Source */
647 { 0x000009F8, 0x0000 }, /* R2552 - DSP3AUX6MIX Input 1 Source */
648 { 0x00000A80, 0x0000 }, /* R2688 - ASRC1LMIX Input 1 Source */
649 { 0x00000A88, 0x0000 }, /* R2696 - ASRC1RMIX Input 1 Source */
650 { 0x00000A90, 0x0000 }, /* R2704 - ASRC2LMIX Input 1 Source */
651 { 0x00000A98, 0x0000 }, /* R2712 - ASRC2RMIX Input 1 Source */
652 { 0x00000B00, 0x0000 }, /* R2816 - ISRC1DEC1MIX Input 1 Source */
653 { 0x00000B08, 0x0000 }, /* R2824 - ISRC1DEC2MIX Input 1 Source */
654 { 0x00000B10, 0x0000 }, /* R2832 - ISRC1DEC3MIX Input 1 Source */
655 { 0x00000B18, 0x0000 }, /* R2840 - ISRC1DEC4MIX Input 1 Source */
656 { 0x00000B20, 0x0000 }, /* R2848 - ISRC1INT1MIX Input 1 Source */
657 { 0x00000B28, 0x0000 }, /* R2856 - ISRC1INT2MIX Input 1 Source */
658 { 0x00000B30, 0x0000 }, /* R2864 - ISRC1INT3MIX Input 1 Source */
659 { 0x00000B38, 0x0000 }, /* R2872 - ISRC1INT4MIX Input 1 Source */
660 { 0x00000B40, 0x0000 }, /* R2880 - ISRC2DEC1MIX Input 1 Source */
661 { 0x00000B48, 0x0000 }, /* R2888 - ISRC2DEC2MIX Input 1 Source */
662 { 0x00000B50, 0x0000 }, /* R2896 - ISRC2DEC3MIX Input 1 Source */
663 { 0x00000B58, 0x0000 }, /* R2904 - ISRC2DEC4MIX Input 1 Source */
664 { 0x00000B60, 0x0000 }, /* R2912 - ISRC2INT1MIX Input 1 Source */
665 { 0x00000B68, 0x0000 }, /* R2920 - ISRC2INT2MIX Input 1 Source */
666 { 0x00000B70, 0x0000 }, /* R2928 - ISRC2INT3MIX Input 1 Source */
667 { 0x00000B78, 0x0000 }, /* R2936 - ISRC2INT4MIX Input 1 Source */
668 { 0x00000B80, 0x0000 }, /* R2944 - ISRC3DEC1MIX Input 1 Source */
669 { 0x00000B88, 0x0000 }, /* R2952 - ISRC3DEC2MIX Input 1 Source */
670 { 0x00000B90, 0x0000 }, /* R2960 - ISRC3DEC3MIX Input 1 Source */
671 { 0x00000B98, 0x0000 }, /* R2968 - ISRC3DEC4MIX Input 1 Source */
672 { 0x00000BA0, 0x0000 }, /* R2976 - ISRC3INT1MIX Input 1 Source */
673 { 0x00000BA8, 0x0000 }, /* R2984 - ISRC3INT2MIX Input 1 Source */
674 { 0x00000BB0, 0x0000 }, /* R2992 - ISRC3INT3MIX Input 1 Source */
675 { 0x00000BB8, 0x0000 }, /* R3000 - ISRC3INT4MIX Input 1 Source */
676 { 0x00000C00, 0xA101 }, /* R3072 - GPIO1 CTRL */
677 { 0x00000C01, 0xA101 }, /* R3073 - GPIO2 CTRL */
678 { 0x00000C0F, 0x0400 }, /* R3087 - IRQ CTRL 1 */
679 { 0x00000C10, 0x1000 }, /* R3088 - GPIO Debounce Config */
680 { 0x00000C20, 0x0002 }, /* R3104 - Misc Pad Ctrl 1 */
681 { 0x00000C21, 0x8001 }, /* R3105 - Misc Pad Ctrl 2 */
682 { 0x00000C22, 0x0000 }, /* R3106 - Misc Pad Ctrl 3 */
683 { 0x00000C23, 0x0000 }, /* R3107 - Misc Pad Ctrl 4 */
684 { 0x00000C24, 0x0000 }, /* R3108 - Misc Pad Ctrl 5 */
685 { 0x00000C25, 0x0000 }, /* R3109 - Misc Pad Ctrl 6 */
686 { 0x00000C30, 0x0404 }, /* R3120 - Misc Pad Ctrl 7 */
687 { 0x00000C32, 0x0404 }, /* R3122 - Misc Pad Ctrl 9 */
688 { 0x00000C33, 0x0404 }, /* R3123 - Misc Pad Ctrl 10 */
689 { 0x00000C34, 0x0404 }, /* R3124 - Misc Pad Ctrl 11 */
690 { 0x00000C35, 0x0404 }, /* R3125 - Misc Pad Ctrl 12 */
691 { 0x00000C36, 0x0400 }, /* R3126 - Misc Pad Ctrl 13 */
692 { 0x00000C37, 0x0404 }, /* R3127 - Misc Pad Ctrl 14 */
693 { 0x00000C39, 0x0400 }, /* R3129 - Misc Pad Ctrl 16 */
694 { 0x00000D08, 0x0007 }, /* R3336 - Interrupt Status 1 Mask */
695 { 0x00000D09, 0x06FF }, /* R3337 - Interrupt Status 2 Mask */
696 { 0x00000D0A, 0xCFEF }, /* R3338 - Interrupt Status 3 Mask */
697 { 0x00000D0B, 0xFFC3 }, /* R3339 - Interrupt Status 4 Mask */
698 { 0x00000D0C, 0x000B }, /* R3340 - Interrupt Status 5 Mask */
699 { 0x00000D0D, 0xD005 }, /* R3341 - Interrupt Status 6 Mask */
700 { 0x00000D0F, 0x0000 }, /* R3343 - Interrupt Control */
701 { 0x00000D18, 0x0007 }, /* R3352 - IRQ2 Status 1 Mask */
702 { 0x00000D19, 0x06FF }, /* R3353 - IRQ2 Status 2 Mask */
703 { 0x00000D1A, 0xCFEF }, /* R3354 - IRQ2 Status 3 Mask */
704 { 0x00000D1B, 0xFFC3 }, /* R3355 - IRQ2 Status 4 Mask */
705 { 0x00000D1C, 0x000B }, /* R3356 - IRQ2 Status 5 Mask */
706 { 0x00000D1D, 0xD005 }, /* R3357 - IRQ2 Status 6 Mask */
707 { 0x00000D1F, 0x0000 }, /* R3359 - IRQ2 Control */
708 { 0x00000E00, 0x0000 }, /* R3584 - FX_Ctrl1 */
709 { 0x00000E10, 0x6318 }, /* R3600 - EQ1_1 */
710 { 0x00000E11, 0x6300 }, /* R3601 - EQ1_2 */
711 { 0x00000E12, 0x0FC8 }, /* R3602 - EQ1_3 */
712 { 0x00000E13, 0x03FE }, /* R3603 - EQ1_4 */
713 { 0x00000E14, 0x00E0 }, /* R3604 - EQ1_5 */
714 { 0x00000E15, 0x1EC4 }, /* R3605 - EQ1_6 */
715 { 0x00000E16, 0xF136 }, /* R3606 - EQ1_7 */
716 { 0x00000E17, 0x0409 }, /* R3607 - EQ1_8 */
717 { 0x00000E18, 0x04CC }, /* R3608 - EQ1_9 */
718 { 0x00000E19, 0x1C9B }, /* R3609 - EQ1_10 */
719 { 0x00000E1A, 0xF337 }, /* R3610 - EQ1_11 */
720 { 0x00000E1B, 0x040B }, /* R3611 - EQ1_12 */
721 { 0x00000E1C, 0x0CBB }, /* R3612 - EQ1_13 */
722 { 0x00000E1D, 0x16F8 }, /* R3613 - EQ1_14 */
723 { 0x00000E1E, 0xF7D9 }, /* R3614 - EQ1_15 */
724 { 0x00000E1F, 0x040A }, /* R3615 - EQ1_16 */
725 { 0x00000E20, 0x1F14 }, /* R3616 - EQ1_17 */
726 { 0x00000E21, 0x058C }, /* R3617 - EQ1_18 */
727 { 0x00000E22, 0x0563 }, /* R3618 - EQ1_19 */
728 { 0x00000E23, 0x4000 }, /* R3619 - EQ1_20 */
729 { 0x00000E24, 0x0B75 }, /* R3620 - EQ1_21 */
730 { 0x00000E26, 0x6318 }, /* R3622 - EQ2_1 */
731 { 0x00000E27, 0x6300 }, /* R3623 - EQ2_2 */
732 { 0x00000E28, 0x0FC8 }, /* R3624 - EQ2_3 */
733 { 0x00000E29, 0x03FE }, /* R3625 - EQ2_4 */
734 { 0x00000E2A, 0x00E0 }, /* R3626 - EQ2_5 */
735 { 0x00000E2B, 0x1EC4 }, /* R3627 - EQ2_6 */
736 { 0x00000E2C, 0xF136 }, /* R3628 - EQ2_7 */
737 { 0x00000E2D, 0x0409 }, /* R3629 - EQ2_8 */
738 { 0x00000E2E, 0x04CC }, /* R3630 - EQ2_9 */
739 { 0x00000E2F, 0x1C9B }, /* R3631 - EQ2_10 */
740 { 0x00000E30, 0xF337 }, /* R3632 - EQ2_11 */
741 { 0x00000E31, 0x040B }, /* R3633 - EQ2_12 */
742 { 0x00000E32, 0x0CBB }, /* R3634 - EQ2_13 */
743 { 0x00000E33, 0x16F8 }, /* R3635 - EQ2_14 */
744 { 0x00000E34, 0xF7D9 }, /* R3636 - EQ2_15 */
745 { 0x00000E35, 0x040A }, /* R3637 - EQ2_16 */
746 { 0x00000E36, 0x1F14 }, /* R3638 - EQ2_17 */
747 { 0x00000E37, 0x058C }, /* R3639 - EQ2_18 */
748 { 0x00000E38, 0x0563 }, /* R3640 - EQ2_19 */
749 { 0x00000E39, 0x4000 }, /* R3641 - EQ2_20 */
750 { 0x00000E3A, 0x0B75 }, /* R3642 - EQ2_21 */
751 { 0x00000E80, 0x0018 }, /* R3712 - DRC1 ctrl1 */
752 { 0x00000E81, 0x0933 }, /* R3713 - DRC1 ctrl2 */
753 { 0x00000E82, 0x0018 }, /* R3714 - DRC1 ctrl3 */
754 { 0x00000E83, 0x0000 }, /* R3715 - DRC1 ctrl4 */
755 { 0x00000E84, 0x0000 }, /* R3716 - DRC1 ctrl5 */
756 { 0x00000E89, 0x0018 }, /* R3721 - DRC2 ctrl1 */
757 { 0x00000E8A, 0x0933 }, /* R3722 - DRC2 ctrl2 */
758 { 0x00000E8B, 0x0018 }, /* R3723 - DRC2 ctrl3 */
759 { 0x00000E8C, 0x0000 }, /* R3724 - DRC2 ctrl4 */
760 { 0x00000E8D, 0x0000 }, /* R3725 - DRC2 ctrl5 */
761 { 0x00000EC0, 0x0000 }, /* R3776 - HPLPF1_1 */
762 { 0x00000EC1, 0x0000 }, /* R3777 - HPLPF1_2 */
763 { 0x00000EC4, 0x0000 }, /* R3780 - HPLPF2_1 */
764 { 0x00000EC5, 0x0000 }, /* R3781 - HPLPF2_2 */
765 { 0x00000EC8, 0x0000 }, /* R3784 - HPLPF3_1 */
766 { 0x00000EC9, 0x0000 }, /* R3785 - HPLPF3_2 */
767 { 0x00000ECC, 0x0000 }, /* R3788 - HPLPF4_1 */
768 { 0x00000ECD, 0x0000 }, /* R3789 - HPLPF4_2 */
769 { 0x00000EE0, 0x0000 }, /* R3808 - ASRC_ENABLE */
770 { 0x00000EE2, 0x0000 }, /* R3810 - ASRC_RATE1 */
771 { 0x00000EE3, 0x4000 }, /* R3811 - ASRC_RATE2 */
772 { 0x00000EF0, 0x0000 }, /* R3824 - ISRC 1 CTRL 1 */
773 { 0x00000EF1, 0x0000 }, /* R3825 - ISRC 1 CTRL 2 */
774 { 0x00000EF2, 0x0000 }, /* R3826 - ISRC 1 CTRL 3 */
775 { 0x00000EF3, 0x0000 }, /* R3827 - ISRC 2 CTRL 1 */
776 { 0x00000EF4, 0x0000 }, /* R3828 - ISRC 2 CTRL 2 */
777 { 0x00000EF5, 0x0000 }, /* R3829 - ISRC 2 CTRL 3 */
778 { 0x00000EF6, 0x0000 }, /* R3830 - ISRC 3 CTRL 1 */
779 { 0x00000EF7, 0x0000 }, /* R3831 - ISRC 3 CTRL 2 */
780 { 0x00000EF8, 0x0000 }, /* R3832 - ISRC 3 CTRL 3 */
781 { 0x00001200, 0x0010 }, /* R4608 - DSP2 Control 1 */
782 { 0x00001300, 0x0010 }, /* R4864 - DSP3 Control 1 */
783};
784
785static bool cs47l24_is_adsp_memory(unsigned int reg)
786{
787 switch (reg) {
788 case 0x200000 ... 0x205fff: /* DSP2 PM */
789 case 0x280000 ... 0x281fff: /* DSP2 ZM */
790 case 0x290000 ... 0x2a7fff: /* DSP2 XM */
791 case 0x2a8000 ... 0x2b3fff: /* DSP2 YM */
792 case 0x300000 ... 0x308fff: /* DSP3 PM */
793 case 0x380000 ... 0x381fff: /* DSP3 ZM */
794 case 0x390000 ... 0x3a7fff: /* DSP3 XM */
795 case 0x3a8000 ... 0x3b3fff: /* DSP3 YM */
796 return true;
797 default:
798 return false;
799 }
800}
801
802static bool cs47l24_readable_register(struct device *dev, unsigned int reg)
803{
804 switch (reg) {
805 case ARIZONA_SOFTWARE_RESET:
806 case ARIZONA_DEVICE_REVISION:
807 case ARIZONA_CTRL_IF_SPI_CFG_1:
808 case ARIZONA_WRITE_SEQUENCER_CTRL_0:
809 case ARIZONA_WRITE_SEQUENCER_CTRL_1:
810 case ARIZONA_WRITE_SEQUENCER_CTRL_2:
811 case ARIZONA_TONE_GENERATOR_1:
812 case ARIZONA_TONE_GENERATOR_2:
813 case ARIZONA_TONE_GENERATOR_3:
814 case ARIZONA_TONE_GENERATOR_4:
815 case ARIZONA_TONE_GENERATOR_5:
816 case ARIZONA_PWM_DRIVE_1:
817 case ARIZONA_PWM_DRIVE_2:
818 case ARIZONA_PWM_DRIVE_3:
819 case ARIZONA_SEQUENCE_CONTROL:
820 case ARIZONA_SAMPLE_RATE_SEQUENCE_SELECT_1:
821 case ARIZONA_SAMPLE_RATE_SEQUENCE_SELECT_2:
822 case ARIZONA_SAMPLE_RATE_SEQUENCE_SELECT_3:
823 case ARIZONA_SAMPLE_RATE_SEQUENCE_SELECT_4:
824 case ARIZONA_COMFORT_NOISE_GENERATOR:
825 case ARIZONA_HAPTICS_CONTROL_1:
826 case ARIZONA_HAPTICS_CONTROL_2:
827 case ARIZONA_HAPTICS_PHASE_1_INTENSITY:
828 case ARIZONA_HAPTICS_PHASE_1_DURATION:
829 case ARIZONA_HAPTICS_PHASE_2_INTENSITY:
830 case ARIZONA_HAPTICS_PHASE_2_DURATION:
831 case ARIZONA_HAPTICS_PHASE_3_INTENSITY:
832 case ARIZONA_HAPTICS_PHASE_3_DURATION:
833 case ARIZONA_HAPTICS_STATUS:
834 case ARIZONA_CLOCK_32K_1:
835 case ARIZONA_SYSTEM_CLOCK_1:
836 case ARIZONA_SAMPLE_RATE_1:
837 case ARIZONA_SAMPLE_RATE_2:
838 case ARIZONA_SAMPLE_RATE_3:
839 case ARIZONA_SAMPLE_RATE_1_STATUS:
840 case ARIZONA_SAMPLE_RATE_2_STATUS:
841 case ARIZONA_SAMPLE_RATE_3_STATUS:
842 case ARIZONA_ASYNC_CLOCK_1:
843 case ARIZONA_ASYNC_SAMPLE_RATE_1:
844 case ARIZONA_ASYNC_SAMPLE_RATE_1_STATUS:
845 case ARIZONA_ASYNC_SAMPLE_RATE_2:
846 case ARIZONA_ASYNC_SAMPLE_RATE_2_STATUS:
847 case ARIZONA_OUTPUT_SYSTEM_CLOCK:
848 case ARIZONA_OUTPUT_ASYNC_CLOCK:
849 case ARIZONA_RATE_ESTIMATOR_1:
850 case ARIZONA_RATE_ESTIMATOR_2:
851 case ARIZONA_RATE_ESTIMATOR_3:
852 case ARIZONA_RATE_ESTIMATOR_4:
853 case ARIZONA_RATE_ESTIMATOR_5:
854 case ARIZONA_FLL1_CONTROL_1:
855 case ARIZONA_FLL1_CONTROL_2:
856 case ARIZONA_FLL1_CONTROL_3:
857 case ARIZONA_FLL1_CONTROL_4:
858 case ARIZONA_FLL1_CONTROL_5:
859 case ARIZONA_FLL1_CONTROL_6:
860 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:
864 case ARIZONA_FLL1_SYNCHRONISER_2:
865 case ARIZONA_FLL1_SYNCHRONISER_3:
866 case ARIZONA_FLL1_SYNCHRONISER_4:
867 case ARIZONA_FLL1_SYNCHRONISER_5:
868 case ARIZONA_FLL1_SYNCHRONISER_6:
869 case ARIZONA_FLL1_SYNCHRONISER_7:
870 case ARIZONA_FLL1_SPREAD_SPECTRUM:
871 case ARIZONA_FLL1_GPIO_CLOCK:
872 case ARIZONA_FLL2_CONTROL_1:
873 case ARIZONA_FLL2_CONTROL_2:
874 case ARIZONA_FLL2_CONTROL_3:
875 case ARIZONA_FLL2_CONTROL_4:
876 case ARIZONA_FLL2_CONTROL_5:
877 case ARIZONA_FLL2_CONTROL_6:
878 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:
882 case ARIZONA_FLL2_SYNCHRONISER_2:
883 case ARIZONA_FLL2_SYNCHRONISER_3:
884 case ARIZONA_FLL2_SYNCHRONISER_4:
885 case ARIZONA_FLL2_SYNCHRONISER_5:
886 case ARIZONA_FLL2_SYNCHRONISER_6:
887 case ARIZONA_FLL2_SYNCHRONISER_7:
888 case ARIZONA_FLL2_SPREAD_SPECTRUM:
889 case ARIZONA_FLL2_GPIO_CLOCK:
890 case ARIZONA_MIC_BIAS_CTRL_1:
891 case ARIZONA_MIC_BIAS_CTRL_2:
892 case ARIZONA_HP_CTRL_1L:
893 case ARIZONA_HP_CTRL_1R:
894 case ARIZONA_INPUT_ENABLES:
895 case ARIZONA_INPUT_ENABLES_STATUS:
896 case ARIZONA_INPUT_RATE:
897 case ARIZONA_INPUT_VOLUME_RAMP:
898 case ARIZONA_HPF_CONTROL:
899 case ARIZONA_IN1L_CONTROL:
900 case ARIZONA_ADC_DIGITAL_VOLUME_1L:
901 case ARIZONA_DMIC1L_CONTROL:
902 case ARIZONA_IN1R_CONTROL:
903 case ARIZONA_ADC_DIGITAL_VOLUME_1R:
904 case ARIZONA_DMIC1R_CONTROL:
905 case ARIZONA_IN2L_CONTROL:
906 case ARIZONA_ADC_DIGITAL_VOLUME_2L:
907 case ARIZONA_DMIC2L_CONTROL:
908 case ARIZONA_IN2R_CONTROL:
909 case ARIZONA_ADC_DIGITAL_VOLUME_2R:
910 case ARIZONA_DMIC2R_CONTROL:
911 case ARIZONA_OUTPUT_ENABLES_1:
912 case ARIZONA_OUTPUT_STATUS_1:
913 case ARIZONA_RAW_OUTPUT_STATUS_1:
914 case ARIZONA_OUTPUT_RATE_1:
915 case ARIZONA_OUTPUT_VOLUME_RAMP:
916 case ARIZONA_OUTPUT_PATH_CONFIG_1L:
917 case ARIZONA_DAC_DIGITAL_VOLUME_1L:
918 case ARIZONA_DAC_VOLUME_LIMIT_1L:
919 case ARIZONA_NOISE_GATE_SELECT_1L:
920 case ARIZONA_DAC_DIGITAL_VOLUME_1R:
921 case ARIZONA_DAC_VOLUME_LIMIT_1R:
922 case ARIZONA_NOISE_GATE_SELECT_1R:
923 case ARIZONA_DAC_DIGITAL_VOLUME_4L:
924 case ARIZONA_OUT_VOLUME_4L:
925 case ARIZONA_NOISE_GATE_SELECT_4L:
926 case ARIZONA_DAC_AEC_CONTROL_1:
927 case ARIZONA_NOISE_GATE_CONTROL:
928 case ARIZONA_HP1_SHORT_CIRCUIT_CTRL:
929 case ARIZONA_AIF1_BCLK_CTRL:
930 case ARIZONA_AIF1_TX_PIN_CTRL:
931 case ARIZONA_AIF1_RX_PIN_CTRL:
932 case ARIZONA_AIF1_RATE_CTRL:
933 case ARIZONA_AIF1_FORMAT:
934 case ARIZONA_AIF1_RX_BCLK_RATE:
935 case ARIZONA_AIF1_FRAME_CTRL_1:
936 case ARIZONA_AIF1_FRAME_CTRL_2:
937 case ARIZONA_AIF1_FRAME_CTRL_3:
938 case ARIZONA_AIF1_FRAME_CTRL_4:
939 case ARIZONA_AIF1_FRAME_CTRL_5:
940 case ARIZONA_AIF1_FRAME_CTRL_6:
941 case ARIZONA_AIF1_FRAME_CTRL_7:
942 case ARIZONA_AIF1_FRAME_CTRL_8:
943 case ARIZONA_AIF1_FRAME_CTRL_9:
944 case ARIZONA_AIF1_FRAME_CTRL_10:
945 case ARIZONA_AIF1_FRAME_CTRL_11:
946 case ARIZONA_AIF1_FRAME_CTRL_12:
947 case ARIZONA_AIF1_FRAME_CTRL_13:
948 case ARIZONA_AIF1_FRAME_CTRL_14:
949 case ARIZONA_AIF1_FRAME_CTRL_15:
950 case ARIZONA_AIF1_FRAME_CTRL_16:
951 case ARIZONA_AIF1_FRAME_CTRL_17:
952 case ARIZONA_AIF1_FRAME_CTRL_18:
953 case ARIZONA_AIF1_TX_ENABLES:
954 case ARIZONA_AIF1_RX_ENABLES:
955 case ARIZONA_AIF2_BCLK_CTRL:
956 case ARIZONA_AIF2_TX_PIN_CTRL:
957 case ARIZONA_AIF2_RX_PIN_CTRL:
958 case ARIZONA_AIF2_RATE_CTRL:
959 case ARIZONA_AIF2_FORMAT:
960 case ARIZONA_AIF2_RX_BCLK_RATE:
961 case ARIZONA_AIF2_FRAME_CTRL_1:
962 case ARIZONA_AIF2_FRAME_CTRL_2:
963 case ARIZONA_AIF2_FRAME_CTRL_3:
964 case ARIZONA_AIF2_FRAME_CTRL_4:
965 case ARIZONA_AIF2_FRAME_CTRL_5:
966 case ARIZONA_AIF2_FRAME_CTRL_6:
967 case ARIZONA_AIF2_FRAME_CTRL_7:
968 case ARIZONA_AIF2_FRAME_CTRL_8:
969 case ARIZONA_AIF2_FRAME_CTRL_11:
970 case ARIZONA_AIF2_FRAME_CTRL_12:
971 case ARIZONA_AIF2_FRAME_CTRL_13:
972 case ARIZONA_AIF2_FRAME_CTRL_14:
973 case ARIZONA_AIF2_FRAME_CTRL_15:
974 case ARIZONA_AIF2_FRAME_CTRL_16:
975 case ARIZONA_AIF2_TX_ENABLES:
976 case ARIZONA_AIF2_RX_ENABLES:
977 case ARIZONA_AIF3_BCLK_CTRL:
978 case ARIZONA_AIF3_TX_PIN_CTRL:
979 case ARIZONA_AIF3_RX_PIN_CTRL:
980 case ARIZONA_AIF3_RATE_CTRL:
981 case ARIZONA_AIF3_FORMAT:
982 case ARIZONA_AIF3_RX_BCLK_RATE:
983 case ARIZONA_AIF3_FRAME_CTRL_1:
984 case ARIZONA_AIF3_FRAME_CTRL_2:
985 case ARIZONA_AIF3_FRAME_CTRL_3:
986 case ARIZONA_AIF3_FRAME_CTRL_4:
987 case ARIZONA_AIF3_FRAME_CTRL_11:
988 case ARIZONA_AIF3_FRAME_CTRL_12:
989 case ARIZONA_AIF3_TX_ENABLES:
990 case ARIZONA_AIF3_RX_ENABLES:
991 case ARIZONA_PWM1MIX_INPUT_1_SOURCE:
992 case ARIZONA_PWM1MIX_INPUT_1_VOLUME:
993 case ARIZONA_PWM1MIX_INPUT_2_SOURCE:
994 case ARIZONA_PWM1MIX_INPUT_2_VOLUME:
995 case ARIZONA_PWM1MIX_INPUT_3_SOURCE:
996 case ARIZONA_PWM1MIX_INPUT_3_VOLUME:
997 case ARIZONA_PWM1MIX_INPUT_4_SOURCE:
998 case ARIZONA_PWM1MIX_INPUT_4_VOLUME:
999 case ARIZONA_PWM2MIX_INPUT_1_SOURCE:
1000 case ARIZONA_PWM2MIX_INPUT_1_VOLUME:
1001 case ARIZONA_PWM2MIX_INPUT_2_SOURCE:
1002 case ARIZONA_PWM2MIX_INPUT_2_VOLUME:
1003 case ARIZONA_PWM2MIX_INPUT_3_SOURCE:
1004 case ARIZONA_PWM2MIX_INPUT_3_VOLUME:
1005 case ARIZONA_PWM2MIX_INPUT_4_SOURCE:
1006 case ARIZONA_PWM2MIX_INPUT_4_VOLUME:
1007 case ARIZONA_OUT1LMIX_INPUT_1_SOURCE:
1008 case ARIZONA_OUT1LMIX_INPUT_1_VOLUME:
1009 case ARIZONA_OUT1LMIX_INPUT_2_SOURCE:
1010 case ARIZONA_OUT1LMIX_INPUT_2_VOLUME:
1011 case ARIZONA_OUT1LMIX_INPUT_3_SOURCE:
1012 case ARIZONA_OUT1LMIX_INPUT_3_VOLUME:
1013 case ARIZONA_OUT1LMIX_INPUT_4_SOURCE:
1014 case ARIZONA_OUT1LMIX_INPUT_4_VOLUME:
1015 case ARIZONA_OUT1RMIX_INPUT_1_SOURCE:
1016 case ARIZONA_OUT1RMIX_INPUT_1_VOLUME:
1017 case ARIZONA_OUT1RMIX_INPUT_2_SOURCE:
1018 case ARIZONA_OUT1RMIX_INPUT_2_VOLUME:
1019 case ARIZONA_OUT1RMIX_INPUT_3_SOURCE:
1020 case ARIZONA_OUT1RMIX_INPUT_3_VOLUME:
1021 case ARIZONA_OUT1RMIX_INPUT_4_SOURCE:
1022 case ARIZONA_OUT1RMIX_INPUT_4_VOLUME:
1023 case ARIZONA_OUT4LMIX_INPUT_1_SOURCE:
1024 case ARIZONA_OUT4LMIX_INPUT_1_VOLUME:
1025 case ARIZONA_OUT4LMIX_INPUT_2_SOURCE:
1026 case ARIZONA_OUT4LMIX_INPUT_2_VOLUME:
1027 case ARIZONA_OUT4LMIX_INPUT_3_SOURCE:
1028 case ARIZONA_OUT4LMIX_INPUT_3_VOLUME:
1029 case ARIZONA_OUT4LMIX_INPUT_4_SOURCE:
1030 case ARIZONA_OUT4LMIX_INPUT_4_VOLUME:
1031 case ARIZONA_AIF1TX1MIX_INPUT_1_SOURCE:
1032 case ARIZONA_AIF1TX1MIX_INPUT_1_VOLUME:
1033 case ARIZONA_AIF1TX1MIX_INPUT_2_SOURCE:
1034 case ARIZONA_AIF1TX1MIX_INPUT_2_VOLUME:
1035 case ARIZONA_AIF1TX1MIX_INPUT_3_SOURCE:
1036 case ARIZONA_AIF1TX1MIX_INPUT_3_VOLUME:
1037 case ARIZONA_AIF1TX1MIX_INPUT_4_SOURCE:
1038 case ARIZONA_AIF1TX1MIX_INPUT_4_VOLUME:
1039 case ARIZONA_AIF1TX2MIX_INPUT_1_SOURCE:
1040 case ARIZONA_AIF1TX2MIX_INPUT_1_VOLUME:
1041 case ARIZONA_AIF1TX2MIX_INPUT_2_SOURCE:
1042 case ARIZONA_AIF1TX2MIX_INPUT_2_VOLUME:
1043 case ARIZONA_AIF1TX2MIX_INPUT_3_SOURCE:
1044 case ARIZONA_AIF1TX2MIX_INPUT_3_VOLUME:
1045 case ARIZONA_AIF1TX2MIX_INPUT_4_SOURCE:
1046 case ARIZONA_AIF1TX2MIX_INPUT_4_VOLUME:
1047 case ARIZONA_AIF1TX3MIX_INPUT_1_SOURCE:
1048 case ARIZONA_AIF1TX3MIX_INPUT_1_VOLUME:
1049 case ARIZONA_AIF1TX3MIX_INPUT_2_SOURCE:
1050 case ARIZONA_AIF1TX3MIX_INPUT_2_VOLUME:
1051 case ARIZONA_AIF1TX3MIX_INPUT_3_SOURCE:
1052 case ARIZONA_AIF1TX3MIX_INPUT_3_VOLUME:
1053 case ARIZONA_AIF1TX3MIX_INPUT_4_SOURCE:
1054 case ARIZONA_AIF1TX3MIX_INPUT_4_VOLUME:
1055 case ARIZONA_AIF1TX4MIX_INPUT_1_SOURCE:
1056 case ARIZONA_AIF1TX4MIX_INPUT_1_VOLUME:
1057 case ARIZONA_AIF1TX4MIX_INPUT_2_SOURCE:
1058 case ARIZONA_AIF1TX4MIX_INPUT_2_VOLUME:
1059 case ARIZONA_AIF1TX4MIX_INPUT_3_SOURCE:
1060 case ARIZONA_AIF1TX4MIX_INPUT_3_VOLUME:
1061 case ARIZONA_AIF1TX4MIX_INPUT_4_SOURCE:
1062 case ARIZONA_AIF1TX4MIX_INPUT_4_VOLUME:
1063 case ARIZONA_AIF1TX5MIX_INPUT_1_SOURCE:
1064 case ARIZONA_AIF1TX5MIX_INPUT_1_VOLUME:
1065 case ARIZONA_AIF1TX5MIX_INPUT_2_SOURCE:
1066 case ARIZONA_AIF1TX5MIX_INPUT_2_VOLUME:
1067 case ARIZONA_AIF1TX5MIX_INPUT_3_SOURCE:
1068 case ARIZONA_AIF1TX5MIX_INPUT_3_VOLUME:
1069 case ARIZONA_AIF1TX5MIX_INPUT_4_SOURCE:
1070 case ARIZONA_AIF1TX5MIX_INPUT_4_VOLUME:
1071 case ARIZONA_AIF1TX6MIX_INPUT_1_SOURCE:
1072 case ARIZONA_AIF1TX6MIX_INPUT_1_VOLUME:
1073 case ARIZONA_AIF1TX6MIX_INPUT_2_SOURCE:
1074 case ARIZONA_AIF1TX6MIX_INPUT_2_VOLUME:
1075 case ARIZONA_AIF1TX6MIX_INPUT_3_SOURCE:
1076 case ARIZONA_AIF1TX6MIX_INPUT_3_VOLUME:
1077 case ARIZONA_AIF1TX6MIX_INPUT_4_SOURCE:
1078 case ARIZONA_AIF1TX6MIX_INPUT_4_VOLUME:
1079 case ARIZONA_AIF1TX7MIX_INPUT_1_SOURCE:
1080 case ARIZONA_AIF1TX7MIX_INPUT_1_VOLUME:
1081 case ARIZONA_AIF1TX7MIX_INPUT_2_SOURCE:
1082 case ARIZONA_AIF1TX7MIX_INPUT_2_VOLUME:
1083 case ARIZONA_AIF1TX7MIX_INPUT_3_SOURCE:
1084 case ARIZONA_AIF1TX7MIX_INPUT_3_VOLUME:
1085 case ARIZONA_AIF1TX7MIX_INPUT_4_SOURCE:
1086 case ARIZONA_AIF1TX7MIX_INPUT_4_VOLUME:
1087 case ARIZONA_AIF1TX8MIX_INPUT_1_SOURCE:
1088 case ARIZONA_AIF1TX8MIX_INPUT_1_VOLUME:
1089 case ARIZONA_AIF1TX8MIX_INPUT_2_SOURCE:
1090 case ARIZONA_AIF1TX8MIX_INPUT_2_VOLUME:
1091 case ARIZONA_AIF1TX8MIX_INPUT_3_SOURCE:
1092 case ARIZONA_AIF1TX8MIX_INPUT_3_VOLUME:
1093 case ARIZONA_AIF1TX8MIX_INPUT_4_SOURCE:
1094 case ARIZONA_AIF1TX8MIX_INPUT_4_VOLUME:
1095 case ARIZONA_AIF2TX1MIX_INPUT_1_SOURCE:
1096 case ARIZONA_AIF2TX1MIX_INPUT_1_VOLUME:
1097 case ARIZONA_AIF2TX1MIX_INPUT_2_SOURCE:
1098 case ARIZONA_AIF2TX1MIX_INPUT_2_VOLUME:
1099 case ARIZONA_AIF2TX1MIX_INPUT_3_SOURCE:
1100 case ARIZONA_AIF2TX1MIX_INPUT_3_VOLUME:
1101 case ARIZONA_AIF2TX1MIX_INPUT_4_SOURCE:
1102 case ARIZONA_AIF2TX1MIX_INPUT_4_VOLUME:
1103 case ARIZONA_AIF2TX2MIX_INPUT_1_SOURCE:
1104 case ARIZONA_AIF2TX2MIX_INPUT_1_VOLUME:
1105 case ARIZONA_AIF2TX2MIX_INPUT_2_SOURCE:
1106 case ARIZONA_AIF2TX2MIX_INPUT_2_VOLUME:
1107 case ARIZONA_AIF2TX2MIX_INPUT_3_SOURCE:
1108 case ARIZONA_AIF2TX2MIX_INPUT_3_VOLUME:
1109 case ARIZONA_AIF2TX2MIX_INPUT_4_SOURCE:
1110 case ARIZONA_AIF2TX2MIX_INPUT_4_VOLUME:
1111 case ARIZONA_AIF2TX3MIX_INPUT_1_SOURCE:
1112 case ARIZONA_AIF2TX3MIX_INPUT_1_VOLUME:
1113 case ARIZONA_AIF2TX3MIX_INPUT_2_SOURCE:
1114 case ARIZONA_AIF2TX3MIX_INPUT_2_VOLUME:
1115 case ARIZONA_AIF2TX3MIX_INPUT_3_SOURCE:
1116 case ARIZONA_AIF2TX3MIX_INPUT_3_VOLUME:
1117 case ARIZONA_AIF2TX3MIX_INPUT_4_SOURCE:
1118 case ARIZONA_AIF2TX3MIX_INPUT_4_VOLUME:
1119 case ARIZONA_AIF2TX4MIX_INPUT_1_SOURCE:
1120 case ARIZONA_AIF2TX4MIX_INPUT_1_VOLUME:
1121 case ARIZONA_AIF2TX4MIX_INPUT_2_SOURCE:
1122 case ARIZONA_AIF2TX4MIX_INPUT_2_VOLUME:
1123 case ARIZONA_AIF2TX4MIX_INPUT_3_SOURCE:
1124 case ARIZONA_AIF2TX4MIX_INPUT_3_VOLUME:
1125 case ARIZONA_AIF2TX4MIX_INPUT_4_SOURCE:
1126 case ARIZONA_AIF2TX4MIX_INPUT_4_VOLUME:
1127 case ARIZONA_AIF2TX5MIX_INPUT_1_SOURCE:
1128 case ARIZONA_AIF2TX5MIX_INPUT_1_VOLUME:
1129 case ARIZONA_AIF2TX5MIX_INPUT_2_SOURCE:
1130 case ARIZONA_AIF2TX5MIX_INPUT_2_VOLUME:
1131 case ARIZONA_AIF2TX5MIX_INPUT_3_SOURCE:
1132 case ARIZONA_AIF2TX5MIX_INPUT_3_VOLUME:
1133 case ARIZONA_AIF2TX5MIX_INPUT_4_SOURCE:
1134 case ARIZONA_AIF2TX5MIX_INPUT_4_VOLUME:
1135 case ARIZONA_AIF2TX6MIX_INPUT_1_SOURCE:
1136 case ARIZONA_AIF2TX6MIX_INPUT_1_VOLUME:
1137 case ARIZONA_AIF2TX6MIX_INPUT_2_SOURCE:
1138 case ARIZONA_AIF2TX6MIX_INPUT_2_VOLUME:
1139 case ARIZONA_AIF2TX6MIX_INPUT_3_SOURCE:
1140 case ARIZONA_AIF2TX6MIX_INPUT_3_VOLUME:
1141 case ARIZONA_AIF2TX6MIX_INPUT_4_SOURCE:
1142 case ARIZONA_AIF2TX6MIX_INPUT_4_VOLUME:
1143 case ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE:
1144 case ARIZONA_AIF3TX1MIX_INPUT_1_VOLUME:
1145 case ARIZONA_AIF3TX1MIX_INPUT_2_SOURCE:
1146 case ARIZONA_AIF3TX1MIX_INPUT_2_VOLUME:
1147 case ARIZONA_AIF3TX1MIX_INPUT_3_SOURCE:
1148 case ARIZONA_AIF3TX1MIX_INPUT_3_VOLUME:
1149 case ARIZONA_AIF3TX1MIX_INPUT_4_SOURCE:
1150 case ARIZONA_AIF3TX1MIX_INPUT_4_VOLUME:
1151 case ARIZONA_AIF3TX2MIX_INPUT_1_SOURCE:
1152 case ARIZONA_AIF3TX2MIX_INPUT_1_VOLUME:
1153 case ARIZONA_AIF3TX2MIX_INPUT_2_SOURCE:
1154 case ARIZONA_AIF3TX2MIX_INPUT_2_VOLUME:
1155 case ARIZONA_AIF3TX2MIX_INPUT_3_SOURCE:
1156 case ARIZONA_AIF3TX2MIX_INPUT_3_VOLUME:
1157 case ARIZONA_AIF3TX2MIX_INPUT_4_SOURCE:
1158 case ARIZONA_AIF3TX2MIX_INPUT_4_VOLUME:
1159 case ARIZONA_EQ1MIX_INPUT_1_SOURCE:
1160 case ARIZONA_EQ1MIX_INPUT_1_VOLUME:
1161 case ARIZONA_EQ1MIX_INPUT_2_SOURCE:
1162 case ARIZONA_EQ1MIX_INPUT_2_VOLUME:
1163 case ARIZONA_EQ1MIX_INPUT_3_SOURCE:
1164 case ARIZONA_EQ1MIX_INPUT_3_VOLUME:
1165 case ARIZONA_EQ1MIX_INPUT_4_SOURCE:
1166 case ARIZONA_EQ1MIX_INPUT_4_VOLUME:
1167 case ARIZONA_EQ2MIX_INPUT_1_SOURCE:
1168 case ARIZONA_EQ2MIX_INPUT_1_VOLUME:
1169 case ARIZONA_EQ2MIX_INPUT_2_SOURCE:
1170 case ARIZONA_EQ2MIX_INPUT_2_VOLUME:
1171 case ARIZONA_EQ2MIX_INPUT_3_SOURCE:
1172 case ARIZONA_EQ2MIX_INPUT_3_VOLUME:
1173 case ARIZONA_EQ2MIX_INPUT_4_SOURCE:
1174 case ARIZONA_EQ2MIX_INPUT_4_VOLUME:
1175 case ARIZONA_DRC1LMIX_INPUT_1_SOURCE:
1176 case ARIZONA_DRC1LMIX_INPUT_1_VOLUME:
1177 case ARIZONA_DRC1LMIX_INPUT_2_SOURCE:
1178 case ARIZONA_DRC1LMIX_INPUT_2_VOLUME:
1179 case ARIZONA_DRC1LMIX_INPUT_3_SOURCE:
1180 case ARIZONA_DRC1LMIX_INPUT_3_VOLUME:
1181 case ARIZONA_DRC1LMIX_INPUT_4_SOURCE:
1182 case ARIZONA_DRC1LMIX_INPUT_4_VOLUME:
1183 case ARIZONA_DRC1RMIX_INPUT_1_SOURCE:
1184 case ARIZONA_DRC1RMIX_INPUT_1_VOLUME:
1185 case ARIZONA_DRC1RMIX_INPUT_2_SOURCE:
1186 case ARIZONA_DRC1RMIX_INPUT_2_VOLUME:
1187 case ARIZONA_DRC1RMIX_INPUT_3_SOURCE:
1188 case ARIZONA_DRC1RMIX_INPUT_3_VOLUME:
1189 case ARIZONA_DRC1RMIX_INPUT_4_SOURCE:
1190 case ARIZONA_DRC1RMIX_INPUT_4_VOLUME:
1191 case ARIZONA_DRC2LMIX_INPUT_1_SOURCE:
1192 case ARIZONA_DRC2LMIX_INPUT_1_VOLUME:
1193 case ARIZONA_DRC2LMIX_INPUT_2_SOURCE:
1194 case ARIZONA_DRC2LMIX_INPUT_2_VOLUME:
1195 case ARIZONA_DRC2LMIX_INPUT_3_SOURCE:
1196 case ARIZONA_DRC2LMIX_INPUT_3_VOLUME:
1197 case ARIZONA_DRC2LMIX_INPUT_4_SOURCE:
1198 case ARIZONA_DRC2LMIX_INPUT_4_VOLUME:
1199 case ARIZONA_DRC2RMIX_INPUT_1_SOURCE:
1200 case ARIZONA_DRC2RMIX_INPUT_1_VOLUME:
1201 case ARIZONA_DRC2RMIX_INPUT_2_SOURCE:
1202 case ARIZONA_DRC2RMIX_INPUT_2_VOLUME:
1203 case ARIZONA_DRC2RMIX_INPUT_3_SOURCE:
1204 case ARIZONA_DRC2RMIX_INPUT_3_VOLUME:
1205 case ARIZONA_DRC2RMIX_INPUT_4_SOURCE:
1206 case ARIZONA_DRC2RMIX_INPUT_4_VOLUME:
1207 case ARIZONA_HPLP1MIX_INPUT_1_SOURCE:
1208 case ARIZONA_HPLP1MIX_INPUT_1_VOLUME:
1209 case ARIZONA_HPLP1MIX_INPUT_2_SOURCE:
1210 case ARIZONA_HPLP1MIX_INPUT_2_VOLUME:
1211 case ARIZONA_HPLP1MIX_INPUT_3_SOURCE:
1212 case ARIZONA_HPLP1MIX_INPUT_3_VOLUME:
1213 case ARIZONA_HPLP1MIX_INPUT_4_SOURCE:
1214 case ARIZONA_HPLP1MIX_INPUT_4_VOLUME:
1215 case ARIZONA_HPLP2MIX_INPUT_1_SOURCE:
1216 case ARIZONA_HPLP2MIX_INPUT_1_VOLUME:
1217 case ARIZONA_HPLP2MIX_INPUT_2_SOURCE:
1218 case ARIZONA_HPLP2MIX_INPUT_2_VOLUME:
1219 case ARIZONA_HPLP2MIX_INPUT_3_SOURCE:
1220 case ARIZONA_HPLP2MIX_INPUT_3_VOLUME:
1221 case ARIZONA_HPLP2MIX_INPUT_4_SOURCE:
1222 case ARIZONA_HPLP2MIX_INPUT_4_VOLUME:
1223 case ARIZONA_HPLP3MIX_INPUT_1_SOURCE:
1224 case ARIZONA_HPLP3MIX_INPUT_1_VOLUME:
1225 case ARIZONA_HPLP3MIX_INPUT_2_SOURCE:
1226 case ARIZONA_HPLP3MIX_INPUT_2_VOLUME:
1227 case ARIZONA_HPLP3MIX_INPUT_3_SOURCE:
1228 case ARIZONA_HPLP3MIX_INPUT_3_VOLUME:
1229 case ARIZONA_HPLP3MIX_INPUT_4_SOURCE:
1230 case ARIZONA_HPLP3MIX_INPUT_4_VOLUME:
1231 case ARIZONA_HPLP4MIX_INPUT_1_SOURCE:
1232 case ARIZONA_HPLP4MIX_INPUT_1_VOLUME:
1233 case ARIZONA_HPLP4MIX_INPUT_2_SOURCE:
1234 case ARIZONA_HPLP4MIX_INPUT_2_VOLUME:
1235 case ARIZONA_HPLP4MIX_INPUT_3_SOURCE:
1236 case ARIZONA_HPLP4MIX_INPUT_3_VOLUME:
1237 case ARIZONA_HPLP4MIX_INPUT_4_SOURCE:
1238 case ARIZONA_HPLP4MIX_INPUT_4_VOLUME:
1239 case ARIZONA_DSP2LMIX_INPUT_1_SOURCE:
1240 case ARIZONA_DSP2LMIX_INPUT_1_VOLUME:
1241 case ARIZONA_DSP2LMIX_INPUT_2_SOURCE:
1242 case ARIZONA_DSP2LMIX_INPUT_2_VOLUME:
1243 case ARIZONA_DSP2LMIX_INPUT_3_SOURCE:
1244 case ARIZONA_DSP2LMIX_INPUT_3_VOLUME:
1245 case ARIZONA_DSP2LMIX_INPUT_4_SOURCE:
1246 case ARIZONA_DSP2LMIX_INPUT_4_VOLUME:
1247 case ARIZONA_DSP2RMIX_INPUT_1_SOURCE:
1248 case ARIZONA_DSP2RMIX_INPUT_1_VOLUME:
1249 case ARIZONA_DSP2RMIX_INPUT_2_SOURCE:
1250 case ARIZONA_DSP2RMIX_INPUT_2_VOLUME:
1251 case ARIZONA_DSP2RMIX_INPUT_3_SOURCE:
1252 case ARIZONA_DSP2RMIX_INPUT_3_VOLUME:
1253 case ARIZONA_DSP2RMIX_INPUT_4_SOURCE:
1254 case ARIZONA_DSP2RMIX_INPUT_4_VOLUME:
1255 case ARIZONA_DSP2AUX1MIX_INPUT_1_SOURCE:
1256 case ARIZONA_DSP2AUX2MIX_INPUT_1_SOURCE:
1257 case ARIZONA_DSP2AUX3MIX_INPUT_1_SOURCE:
1258 case ARIZONA_DSP2AUX4MIX_INPUT_1_SOURCE:
1259 case ARIZONA_DSP2AUX5MIX_INPUT_1_SOURCE:
1260 case ARIZONA_DSP2AUX6MIX_INPUT_1_SOURCE:
1261 case ARIZONA_DSP3LMIX_INPUT_1_SOURCE:
1262 case ARIZONA_DSP3LMIX_INPUT_1_VOLUME:
1263 case ARIZONA_DSP3LMIX_INPUT_2_SOURCE:
1264 case ARIZONA_DSP3LMIX_INPUT_2_VOLUME:
1265 case ARIZONA_DSP3LMIX_INPUT_3_SOURCE:
1266 case ARIZONA_DSP3LMIX_INPUT_3_VOLUME:
1267 case ARIZONA_DSP3LMIX_INPUT_4_SOURCE:
1268 case ARIZONA_DSP3LMIX_INPUT_4_VOLUME:
1269 case ARIZONA_DSP3RMIX_INPUT_1_SOURCE:
1270 case ARIZONA_DSP3RMIX_INPUT_1_VOLUME:
1271 case ARIZONA_DSP3RMIX_INPUT_2_SOURCE:
1272 case ARIZONA_DSP3RMIX_INPUT_2_VOLUME:
1273 case ARIZONA_DSP3RMIX_INPUT_3_SOURCE:
1274 case ARIZONA_DSP3RMIX_INPUT_3_VOLUME:
1275 case ARIZONA_DSP3RMIX_INPUT_4_SOURCE:
1276 case ARIZONA_DSP3RMIX_INPUT_4_VOLUME:
1277 case ARIZONA_DSP3AUX1MIX_INPUT_1_SOURCE:
1278 case ARIZONA_DSP3AUX2MIX_INPUT_1_SOURCE:
1279 case ARIZONA_DSP3AUX3MIX_INPUT_1_SOURCE:
1280 case ARIZONA_DSP3AUX4MIX_INPUT_1_SOURCE:
1281 case ARIZONA_DSP3AUX5MIX_INPUT_1_SOURCE:
1282 case ARIZONA_DSP3AUX6MIX_INPUT_1_SOURCE:
1283 case ARIZONA_ASRC1LMIX_INPUT_1_SOURCE:
1284 case ARIZONA_ASRC1RMIX_INPUT_1_SOURCE:
1285 case ARIZONA_ASRC2LMIX_INPUT_1_SOURCE:
1286 case ARIZONA_ASRC2RMIX_INPUT_1_SOURCE:
1287 case ARIZONA_ISRC1DEC1MIX_INPUT_1_SOURCE:
1288 case ARIZONA_ISRC1DEC2MIX_INPUT_1_SOURCE:
1289 case ARIZONA_ISRC1DEC3MIX_INPUT_1_SOURCE:
1290 case ARIZONA_ISRC1DEC4MIX_INPUT_1_SOURCE:
1291 case ARIZONA_ISRC1INT1MIX_INPUT_1_SOURCE:
1292 case ARIZONA_ISRC1INT2MIX_INPUT_1_SOURCE:
1293 case ARIZONA_ISRC1INT3MIX_INPUT_1_SOURCE:
1294 case ARIZONA_ISRC1INT4MIX_INPUT_1_SOURCE:
1295 case ARIZONA_ISRC2DEC1MIX_INPUT_1_SOURCE:
1296 case ARIZONA_ISRC2DEC2MIX_INPUT_1_SOURCE:
1297 case ARIZONA_ISRC2DEC3MIX_INPUT_1_SOURCE:
1298 case ARIZONA_ISRC2DEC4MIX_INPUT_1_SOURCE:
1299 case ARIZONA_ISRC2INT1MIX_INPUT_1_SOURCE:
1300 case ARIZONA_ISRC2INT2MIX_INPUT_1_SOURCE:
1301 case ARIZONA_ISRC2INT3MIX_INPUT_1_SOURCE:
1302 case ARIZONA_ISRC2INT4MIX_INPUT_1_SOURCE:
1303 case ARIZONA_ISRC3DEC1MIX_INPUT_1_SOURCE:
1304 case ARIZONA_ISRC3DEC2MIX_INPUT_1_SOURCE:
1305 case ARIZONA_ISRC3DEC3MIX_INPUT_1_SOURCE:
1306 case ARIZONA_ISRC3DEC4MIX_INPUT_1_SOURCE:
1307 case ARIZONA_ISRC3INT1MIX_INPUT_1_SOURCE:
1308 case ARIZONA_ISRC3INT2MIX_INPUT_1_SOURCE:
1309 case ARIZONA_ISRC3INT3MIX_INPUT_1_SOURCE:
1310 case ARIZONA_ISRC3INT4MIX_INPUT_1_SOURCE:
1311 case ARIZONA_GPIO1_CTRL:
1312 case ARIZONA_GPIO2_CTRL:
1313 case ARIZONA_IRQ_CTRL_1:
1314 case ARIZONA_GPIO_DEBOUNCE_CONFIG:
1315 case ARIZONA_MISC_PAD_CTRL_1:
1316 case ARIZONA_MISC_PAD_CTRL_2:
1317 case ARIZONA_MISC_PAD_CTRL_3:
1318 case ARIZONA_MISC_PAD_CTRL_4:
1319 case ARIZONA_MISC_PAD_CTRL_5:
1320 case ARIZONA_MISC_PAD_CTRL_6:
1321 case ARIZONA_MISC_PAD_CTRL_7:
1322 case ARIZONA_MISC_PAD_CTRL_9:
1323 case ARIZONA_MISC_PAD_CTRL_10:
1324 case ARIZONA_MISC_PAD_CTRL_11:
1325 case ARIZONA_MISC_PAD_CTRL_12:
1326 case ARIZONA_MISC_PAD_CTRL_13:
1327 case ARIZONA_MISC_PAD_CTRL_14:
1328 case ARIZONA_MISC_PAD_CTRL_16:
1329 case ARIZONA_INTERRUPT_STATUS_1:
1330 case ARIZONA_INTERRUPT_STATUS_2:
1331 case ARIZONA_INTERRUPT_STATUS_3:
1332 case ARIZONA_INTERRUPT_STATUS_4:
1333 case ARIZONA_INTERRUPT_STATUS_5:
1334 case ARIZONA_INTERRUPT_STATUS_6:
1335 case ARIZONA_INTERRUPT_STATUS_1_MASK:
1336 case ARIZONA_INTERRUPT_STATUS_2_MASK:
1337 case ARIZONA_INTERRUPT_STATUS_3_MASK:
1338 case ARIZONA_INTERRUPT_STATUS_4_MASK:
1339 case ARIZONA_INTERRUPT_STATUS_5_MASK:
1340 case ARIZONA_INTERRUPT_STATUS_6_MASK:
1341 case ARIZONA_INTERRUPT_CONTROL:
1342 case ARIZONA_IRQ2_STATUS_1:
1343 case ARIZONA_IRQ2_STATUS_2:
1344 case ARIZONA_IRQ2_STATUS_3:
1345 case ARIZONA_IRQ2_STATUS_4:
1346 case ARIZONA_IRQ2_STATUS_5:
1347 case ARIZONA_IRQ2_STATUS_6:
1348 case ARIZONA_IRQ2_STATUS_1_MASK:
1349 case ARIZONA_IRQ2_STATUS_2_MASK:
1350 case ARIZONA_IRQ2_STATUS_3_MASK:
1351 case ARIZONA_IRQ2_STATUS_4_MASK:
1352 case ARIZONA_IRQ2_STATUS_5_MASK:
1353 case ARIZONA_IRQ2_STATUS_6_MASK:
1354 case ARIZONA_IRQ2_CONTROL:
1355 case ARIZONA_INTERRUPT_RAW_STATUS_2:
1356 case ARIZONA_INTERRUPT_RAW_STATUS_3:
1357 case ARIZONA_INTERRUPT_RAW_STATUS_4:
1358 case ARIZONA_INTERRUPT_RAW_STATUS_5:
1359 case ARIZONA_INTERRUPT_RAW_STATUS_6:
1360 case ARIZONA_INTERRUPT_RAW_STATUS_7:
1361 case ARIZONA_INTERRUPT_RAW_STATUS_8:
1362 case ARIZONA_INTERRUPT_RAW_STATUS_9:
1363 case ARIZONA_IRQ_PIN_STATUS:
1364 case ARIZONA_FX_CTRL1:
1365 case ARIZONA_FX_CTRL2:
1366 case ARIZONA_EQ1_1:
1367 case ARIZONA_EQ1_2:
1368 case ARIZONA_EQ1_3:
1369 case ARIZONA_EQ1_4:
1370 case ARIZONA_EQ1_5:
1371 case ARIZONA_EQ1_6:
1372 case ARIZONA_EQ1_7:
1373 case ARIZONA_EQ1_8:
1374 case ARIZONA_EQ1_9:
1375 case ARIZONA_EQ1_10:
1376 case ARIZONA_EQ1_11:
1377 case ARIZONA_EQ1_12:
1378 case ARIZONA_EQ1_13:
1379 case ARIZONA_EQ1_14:
1380 case ARIZONA_EQ1_15:
1381 case ARIZONA_EQ1_16:
1382 case ARIZONA_EQ1_17:
1383 case ARIZONA_EQ1_18:
1384 case ARIZONA_EQ1_19:
1385 case ARIZONA_EQ1_20:
1386 case ARIZONA_EQ1_21:
1387 case ARIZONA_EQ2_1:
1388 case ARIZONA_EQ2_2:
1389 case ARIZONA_EQ2_3:
1390 case ARIZONA_EQ2_4:
1391 case ARIZONA_EQ2_5:
1392 case ARIZONA_EQ2_6:
1393 case ARIZONA_EQ2_7:
1394 case ARIZONA_EQ2_8:
1395 case ARIZONA_EQ2_9:
1396 case ARIZONA_EQ2_10:
1397 case ARIZONA_EQ2_11:
1398 case ARIZONA_EQ2_12:
1399 case ARIZONA_EQ2_13:
1400 case ARIZONA_EQ2_14:
1401 case ARIZONA_EQ2_15:
1402 case ARIZONA_EQ2_16:
1403 case ARIZONA_EQ2_17:
1404 case ARIZONA_EQ2_18:
1405 case ARIZONA_EQ2_19:
1406 case ARIZONA_EQ2_20:
1407 case ARIZONA_EQ2_21:
1408 case ARIZONA_DRC1_CTRL1:
1409 case ARIZONA_DRC1_CTRL2:
1410 case ARIZONA_DRC1_CTRL3:
1411 case ARIZONA_DRC1_CTRL4:
1412 case ARIZONA_DRC1_CTRL5:
1413 case ARIZONA_DRC2_CTRL1:
1414 case ARIZONA_DRC2_CTRL2:
1415 case ARIZONA_DRC2_CTRL3:
1416 case ARIZONA_DRC2_CTRL4:
1417 case ARIZONA_DRC2_CTRL5:
1418 case ARIZONA_HPLPF1_1:
1419 case ARIZONA_HPLPF1_2:
1420 case ARIZONA_HPLPF2_1:
1421 case ARIZONA_HPLPF2_2:
1422 case ARIZONA_HPLPF3_1:
1423 case ARIZONA_HPLPF3_2:
1424 case ARIZONA_HPLPF4_1:
1425 case ARIZONA_HPLPF4_2:
1426 case ARIZONA_ASRC_ENABLE:
1427 case ARIZONA_ASRC_STATUS:
1428 case ARIZONA_ASRC_RATE1:
1429 case ARIZONA_ASRC_RATE2:
1430 case ARIZONA_ISRC_1_CTRL_1:
1431 case ARIZONA_ISRC_1_CTRL_2:
1432 case ARIZONA_ISRC_1_CTRL_3:
1433 case ARIZONA_ISRC_2_CTRL_1:
1434 case ARIZONA_ISRC_2_CTRL_2:
1435 case ARIZONA_ISRC_2_CTRL_3:
1436 case ARIZONA_ISRC_3_CTRL_1:
1437 case ARIZONA_ISRC_3_CTRL_2:
1438 case ARIZONA_ISRC_3_CTRL_3:
1439 case ARIZONA_DSP2_CONTROL_1:
1440 case ARIZONA_DSP2_CLOCKING_1:
1441 case ARIZONA_DSP2_STATUS_1:
1442 case ARIZONA_DSP2_STATUS_2:
1443 case ARIZONA_DSP2_STATUS_3:
1444 case ARIZONA_DSP2_STATUS_4:
1445 case ARIZONA_DSP2_WDMA_BUFFER_1:
1446 case ARIZONA_DSP2_WDMA_BUFFER_2:
1447 case ARIZONA_DSP2_WDMA_BUFFER_3:
1448 case ARIZONA_DSP2_WDMA_BUFFER_4:
1449 case ARIZONA_DSP2_WDMA_BUFFER_5:
1450 case ARIZONA_DSP2_WDMA_BUFFER_6:
1451 case ARIZONA_DSP2_WDMA_BUFFER_7:
1452 case ARIZONA_DSP2_WDMA_BUFFER_8:
1453 case ARIZONA_DSP2_RDMA_BUFFER_1:
1454 case ARIZONA_DSP2_RDMA_BUFFER_2:
1455 case ARIZONA_DSP2_RDMA_BUFFER_3:
1456 case ARIZONA_DSP2_RDMA_BUFFER_4:
1457 case ARIZONA_DSP2_RDMA_BUFFER_5:
1458 case ARIZONA_DSP2_RDMA_BUFFER_6:
1459 case ARIZONA_DSP2_WDMA_CONFIG_1:
1460 case ARIZONA_DSP2_WDMA_CONFIG_2:
1461 case ARIZONA_DSP2_WDMA_OFFSET_1:
1462 case ARIZONA_DSP2_RDMA_CONFIG_1:
1463 case ARIZONA_DSP2_RDMA_OFFSET_1:
1464 case ARIZONA_DSP2_EXTERNAL_START_SELECT_1:
1465 case ARIZONA_DSP2_SCRATCH_0:
1466 case ARIZONA_DSP2_SCRATCH_1:
1467 case ARIZONA_DSP2_SCRATCH_2:
1468 case ARIZONA_DSP2_SCRATCH_3:
1469 case ARIZONA_DSP3_CONTROL_1:
1470 case ARIZONA_DSP3_CLOCKING_1:
1471 case ARIZONA_DSP3_STATUS_1:
1472 case ARIZONA_DSP3_STATUS_2:
1473 case ARIZONA_DSP3_STATUS_3:
1474 case ARIZONA_DSP3_STATUS_4:
1475 case ARIZONA_DSP3_WDMA_BUFFER_1:
1476 case ARIZONA_DSP3_WDMA_BUFFER_2:
1477 case ARIZONA_DSP3_WDMA_BUFFER_3:
1478 case ARIZONA_DSP3_WDMA_BUFFER_4:
1479 case ARIZONA_DSP3_WDMA_BUFFER_5:
1480 case ARIZONA_DSP3_WDMA_BUFFER_6:
1481 case ARIZONA_DSP3_WDMA_BUFFER_7:
1482 case ARIZONA_DSP3_WDMA_BUFFER_8:
1483 case ARIZONA_DSP3_RDMA_BUFFER_1:
1484 case ARIZONA_DSP3_RDMA_BUFFER_2:
1485 case ARIZONA_DSP3_RDMA_BUFFER_3:
1486 case ARIZONA_DSP3_RDMA_BUFFER_4:
1487 case ARIZONA_DSP3_RDMA_BUFFER_5:
1488 case ARIZONA_DSP3_RDMA_BUFFER_6:
1489 case ARIZONA_DSP3_WDMA_CONFIG_1:
1490 case ARIZONA_DSP3_WDMA_CONFIG_2:
1491 case ARIZONA_DSP3_WDMA_OFFSET_1:
1492 case ARIZONA_DSP3_RDMA_CONFIG_1:
1493 case ARIZONA_DSP3_RDMA_OFFSET_1:
1494 case ARIZONA_DSP3_EXTERNAL_START_SELECT_1:
1495 case ARIZONA_DSP3_SCRATCH_0:
1496 case ARIZONA_DSP3_SCRATCH_1:
1497 case ARIZONA_DSP3_SCRATCH_2:
1498 case ARIZONA_DSP3_SCRATCH_3:
1499 return true;
1500 default:
1501 return cs47l24_is_adsp_memory(reg);
1502 }
1503}
1504
1505static bool cs47l24_volatile_register(struct device *dev, unsigned int reg)
1506{
1507 switch (reg) {
1508 case ARIZONA_SOFTWARE_RESET:
1509 case ARIZONA_DEVICE_REVISION:
1510 case ARIZONA_WRITE_SEQUENCER_CTRL_0:
1511 case ARIZONA_WRITE_SEQUENCER_CTRL_1:
1512 case ARIZONA_WRITE_SEQUENCER_CTRL_2:
1513 case ARIZONA_HAPTICS_STATUS:
1514 case ARIZONA_SAMPLE_RATE_1_STATUS:
1515 case ARIZONA_SAMPLE_RATE_2_STATUS:
1516 case ARIZONA_SAMPLE_RATE_3_STATUS:
1517 case ARIZONA_ASYNC_SAMPLE_RATE_1_STATUS:
1518 case ARIZONA_ASYNC_SAMPLE_RATE_2_STATUS:
1519 case ARIZONA_HP_CTRL_1L:
1520 case ARIZONA_HP_CTRL_1R:
1521 case ARIZONA_INPUT_ENABLES_STATUS:
1522 case ARIZONA_OUTPUT_STATUS_1:
1523 case ARIZONA_RAW_OUTPUT_STATUS_1:
1524 case ARIZONA_INTERRUPT_STATUS_1:
1525 case ARIZONA_INTERRUPT_STATUS_2:
1526 case ARIZONA_INTERRUPT_STATUS_3:
1527 case ARIZONA_INTERRUPT_STATUS_4:
1528 case ARIZONA_INTERRUPT_STATUS_5:
1529 case ARIZONA_INTERRUPT_STATUS_6:
1530 case ARIZONA_IRQ2_STATUS_1:
1531 case ARIZONA_IRQ2_STATUS_2:
1532 case ARIZONA_IRQ2_STATUS_3:
1533 case ARIZONA_IRQ2_STATUS_4:
1534 case ARIZONA_IRQ2_STATUS_5:
1535 case ARIZONA_IRQ2_STATUS_6:
1536 case ARIZONA_INTERRUPT_RAW_STATUS_2:
1537 case ARIZONA_INTERRUPT_RAW_STATUS_3:
1538 case ARIZONA_INTERRUPT_RAW_STATUS_4:
1539 case ARIZONA_INTERRUPT_RAW_STATUS_5:
1540 case ARIZONA_INTERRUPT_RAW_STATUS_6:
1541 case ARIZONA_INTERRUPT_RAW_STATUS_7:
1542 case ARIZONA_INTERRUPT_RAW_STATUS_8:
1543 case ARIZONA_INTERRUPT_RAW_STATUS_9:
1544 case ARIZONA_IRQ_PIN_STATUS:
1545 case ARIZONA_FX_CTRL2:
1546 case ARIZONA_ASRC_STATUS:
1547 case ARIZONA_DSP2_STATUS_1:
1548 case ARIZONA_DSP2_STATUS_2:
1549 case ARIZONA_DSP2_STATUS_3:
1550 case ARIZONA_DSP2_STATUS_4:
1551 case ARIZONA_DSP2_WDMA_BUFFER_1:
1552 case ARIZONA_DSP2_WDMA_BUFFER_2:
1553 case ARIZONA_DSP2_WDMA_BUFFER_3:
1554 case ARIZONA_DSP2_WDMA_BUFFER_4:
1555 case ARIZONA_DSP2_WDMA_BUFFER_5:
1556 case ARIZONA_DSP2_WDMA_BUFFER_6:
1557 case ARIZONA_DSP2_WDMA_BUFFER_7:
1558 case ARIZONA_DSP2_WDMA_BUFFER_8:
1559 case ARIZONA_DSP2_RDMA_BUFFER_1:
1560 case ARIZONA_DSP2_RDMA_BUFFER_2:
1561 case ARIZONA_DSP2_RDMA_BUFFER_3:
1562 case ARIZONA_DSP2_RDMA_BUFFER_4:
1563 case ARIZONA_DSP2_RDMA_BUFFER_5:
1564 case ARIZONA_DSP2_RDMA_BUFFER_6:
1565 case ARIZONA_DSP2_WDMA_CONFIG_1:
1566 case ARIZONA_DSP2_WDMA_CONFIG_2:
1567 case ARIZONA_DSP2_WDMA_OFFSET_1:
1568 case ARIZONA_DSP2_RDMA_CONFIG_1:
1569 case ARIZONA_DSP2_RDMA_OFFSET_1:
1570 case ARIZONA_DSP2_EXTERNAL_START_SELECT_1:
1571 case ARIZONA_DSP2_SCRATCH_0:
1572 case ARIZONA_DSP2_SCRATCH_1:
1573 case ARIZONA_DSP2_SCRATCH_2:
1574 case ARIZONA_DSP2_SCRATCH_3:
1575 case ARIZONA_DSP2_CLOCKING_1:
1576 case ARIZONA_DSP3_STATUS_1:
1577 case ARIZONA_DSP3_STATUS_2:
1578 case ARIZONA_DSP3_STATUS_3:
1579 case ARIZONA_DSP3_STATUS_4:
1580 case ARIZONA_DSP3_WDMA_BUFFER_1:
1581 case ARIZONA_DSP3_WDMA_BUFFER_2:
1582 case ARIZONA_DSP3_WDMA_BUFFER_3:
1583 case ARIZONA_DSP3_WDMA_BUFFER_4:
1584 case ARIZONA_DSP3_WDMA_BUFFER_5:
1585 case ARIZONA_DSP3_WDMA_BUFFER_6:
1586 case ARIZONA_DSP3_WDMA_BUFFER_7:
1587 case ARIZONA_DSP3_WDMA_BUFFER_8:
1588 case ARIZONA_DSP3_RDMA_BUFFER_1:
1589 case ARIZONA_DSP3_RDMA_BUFFER_2:
1590 case ARIZONA_DSP3_RDMA_BUFFER_3:
1591 case ARIZONA_DSP3_RDMA_BUFFER_4:
1592 case ARIZONA_DSP3_RDMA_BUFFER_5:
1593 case ARIZONA_DSP3_RDMA_BUFFER_6:
1594 case ARIZONA_DSP3_WDMA_CONFIG_1:
1595 case ARIZONA_DSP3_WDMA_CONFIG_2:
1596 case ARIZONA_DSP3_WDMA_OFFSET_1:
1597 case ARIZONA_DSP3_RDMA_CONFIG_1:
1598 case ARIZONA_DSP3_RDMA_OFFSET_1:
1599 case ARIZONA_DSP3_EXTERNAL_START_SELECT_1:
1600 case ARIZONA_DSP3_SCRATCH_0:
1601 case ARIZONA_DSP3_SCRATCH_1:
1602 case ARIZONA_DSP3_SCRATCH_2:
1603 case ARIZONA_DSP3_SCRATCH_3:
1604 case ARIZONA_DSP3_CLOCKING_1:
1605 return true;
1606 default:
1607 return cs47l24_is_adsp_memory(reg);
1608 }
1609}
1610
1611#define CS47L24_MAX_REGISTER 0x3b3fff
1612
1613const struct regmap_config cs47l24_spi_regmap = {
1614 .reg_bits = 32,
1615 .pad_bits = 16,
1616 .val_bits = 16,
1617 .reg_format_endian = REGMAP_ENDIAN_BIG,
1618 .val_format_endian = REGMAP_ENDIAN_BIG,
1619
1620 .max_register = CS47L24_MAX_REGISTER,
1621 .readable_reg = cs47l24_readable_register,
1622 .volatile_reg = cs47l24_volatile_register,
1623
1624 .cache_type = REGCACHE_RBTREE,
1625 .reg_defaults = cs47l24_reg_default,
1626 .num_reg_defaults = ARRAY_SIZE(cs47l24_reg_default),
1627};
1628EXPORT_SYMBOL_GPL(cs47l24_spi_regmap);
1629
diff --git a/drivers/mfd/cs5535-mfd.c b/drivers/mfd/cs5535-mfd.c
index be91cb5d6e78..f9d277ff4aaf 100644
--- a/drivers/mfd/cs5535-mfd.c
+++ b/drivers/mfd/cs5535-mfd.c
@@ -60,6 +60,7 @@ static int cs5535_mfd_res_enable(struct platform_device *pdev)
60static int cs5535_mfd_res_disable(struct platform_device *pdev) 60static int cs5535_mfd_res_disable(struct platform_device *pdev)
61{ 61{
62 struct resource *res; 62 struct resource *res;
63
63 res = platform_get_resource(pdev, IORESOURCE_IO, 0); 64 res = platform_get_resource(pdev, IORESOURCE_IO, 0);
64 if (!res) { 65 if (!res) {
65 dev_err(&pdev->dev, "can't fetch device resource info\n"); 66 dev_err(&pdev->dev, "can't fetch device resource info\n");
@@ -114,7 +115,10 @@ static struct mfd_cell cs5535_mfd_cells[] = {
114#ifdef CONFIG_OLPC 115#ifdef CONFIG_OLPC
115static void cs5535_clone_olpc_cells(void) 116static void cs5535_clone_olpc_cells(void)
116{ 117{
117 const char *acpi_clones[] = { "olpc-xo1-pm-acpi", "olpc-xo1-sci-acpi" }; 118 static const char *acpi_clones[] = {
119 "olpc-xo1-pm-acpi",
120 "olpc-xo1-sci-acpi"
121 };
118 122
119 if (!machine_is_olpc()) 123 if (!machine_is_olpc())
120 return; 124 return;
diff --git a/drivers/mfd/da903x.c b/drivers/mfd/da903x.c
index 37e4426ef061..09f367571c58 100644
--- a/drivers/mfd/da903x.c
+++ b/drivers/mfd/da903x.c
@@ -2,10 +2,10 @@
2 * Base driver for Dialog Semiconductor DA9030/DA9034 2 * Base driver for Dialog Semiconductor DA9030/DA9034
3 * 3 *
4 * Copyright (C) 2008 Compulab, Ltd. 4 * Copyright (C) 2008 Compulab, Ltd.
5 * Mike Rapoport <mike@compulab.co.il> 5 * Mike Rapoport <mike@compulab.co.il>
6 * 6 *
7 * Copyright (C) 2006-2008 Marvell International Ltd. 7 * Copyright (C) 2006-2008 Marvell International Ltd.
8 * Eric Miao <eric.miao@marvell.com> 8 * Eric Miao <eric.miao@marvell.com>
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
@@ -60,7 +60,7 @@ struct da903x_chip_ops {
60struct da903x_chip { 60struct da903x_chip {
61 struct i2c_client *client; 61 struct i2c_client *client;
62 struct device *dev; 62 struct device *dev;
63 struct da903x_chip_ops *ops; 63 const struct da903x_chip_ops *ops;
64 64
65 int type; 65 int type;
66 uint32_t events_mask; 66 uint32_t events_mask;
@@ -424,7 +424,7 @@ static irqreturn_t da903x_irq_handler(int irq, void *data)
424 return IRQ_HANDLED; 424 return IRQ_HANDLED;
425} 425}
426 426
427static struct da903x_chip_ops da903x_ops[] = { 427static const struct da903x_chip_ops da903x_ops[] = {
428 [0] = { 428 [0] = {
429 .init_chip = da9030_init_chip, 429 .init_chip = da9030_init_chip,
430 .unmask_events = da9030_unmask_events, 430 .unmask_events = da9030_unmask_events,
@@ -565,6 +565,6 @@ static void __exit da903x_exit(void)
565module_exit(da903x_exit); 565module_exit(da903x_exit);
566 566
567MODULE_DESCRIPTION("PMIC Driver for Dialog Semiconductor DA9034"); 567MODULE_DESCRIPTION("PMIC Driver for Dialog Semiconductor DA9034");
568MODULE_AUTHOR("Eric Miao <eric.miao@marvell.com>" 568MODULE_AUTHOR("Eric Miao <eric.miao@marvell.com>");
569 "Mike Rapoport <mike@compulab.co.il>"); 569MODULE_AUTHOR("Mike Rapoport <mike@compulab.co.il>");
570MODULE_LICENSE("GPL"); 570MODULE_LICENSE("GPL v2");
diff --git a/drivers/mfd/da9052-i2c.c b/drivers/mfd/da9052-i2c.c
index 2697ffb08009..578e881067a5 100644
--- a/drivers/mfd/da9052-i2c.c
+++ b/drivers/mfd/da9052-i2c.c
@@ -70,7 +70,7 @@ static int da9052_i2c_fix(struct da9052 *da9052, unsigned char reg)
70 case DA9053_BA: 70 case DA9053_BA:
71 case DA9053_BB: 71 case DA9053_BB:
72 /* A dummy read to a safe register address. */ 72 /* A dummy read to a safe register address. */
73 if (!i2c_safe_reg(reg)) 73 if (!i2c_safe_reg(reg))
74 return regmap_read(da9052->regmap, 74 return regmap_read(da9052->regmap,
75 DA9052_PARK_REGISTER, 75 DA9052_PARK_REGISTER,
76 &val); 76 &val);
diff --git a/drivers/mfd/da9052-irq.c b/drivers/mfd/da9052-irq.c
index f4cb4613140b..cd4ca849ca44 100644
--- a/drivers/mfd/da9052-irq.c
+++ b/drivers/mfd/da9052-irq.c
@@ -283,7 +283,7 @@ regmap_err:
283 283
284int da9052_irq_exit(struct da9052 *da9052) 284int da9052_irq_exit(struct da9052 *da9052)
285{ 285{
286 da9052_free_irq(da9052, DA9052_IRQ_ADC_EOM , da9052); 286 da9052_free_irq(da9052, DA9052_IRQ_ADC_EOM, da9052);
287 regmap_del_irq_chip(da9052->chip_irq, da9052->irq_data); 287 regmap_del_irq_chip(da9052->chip_irq, da9052->irq_data);
288 288
289 return 0; 289 return 0;
diff --git a/drivers/mfd/davinci_voicecodec.c b/drivers/mfd/davinci_voicecodec.c
index 9bbc642a7b9d..dff2f19296b8 100644
--- a/drivers/mfd/davinci_voicecodec.c
+++ b/drivers/mfd/davinci_voicecodec.c
@@ -47,11 +47,8 @@ static int __init davinci_vc_probe(struct platform_device *pdev)
47 47
48 davinci_vc = devm_kzalloc(&pdev->dev, 48 davinci_vc = devm_kzalloc(&pdev->dev,
49 sizeof(struct davinci_vc), GFP_KERNEL); 49 sizeof(struct davinci_vc), GFP_KERNEL);
50 if (!davinci_vc) { 50 if (!davinci_vc)
51 dev_dbg(&pdev->dev,
52 "could not allocate memory for private data\n");
53 return -ENOMEM; 51 return -ENOMEM;
54 }
55 52
56 davinci_vc->clk = devm_clk_get(&pdev->dev, NULL); 53 davinci_vc->clk = devm_clk_get(&pdev->dev, NULL);
57 if (IS_ERR(davinci_vc->clk)) { 54 if (IS_ERR(davinci_vc->clk)) {
diff --git a/drivers/mfd/dm355evm_msp.c b/drivers/mfd/dm355evm_msp.c
index 4c826f78acd0..bf3e0b21b247 100644
--- a/drivers/mfd/dm355evm_msp.c
+++ b/drivers/mfd/dm355evm_msp.c
@@ -147,7 +147,7 @@ static int msp_gpio_get(struct gpio_chip *chip, unsigned offset)
147 return status; 147 return status;
148 if (reg == DM355EVM_MSP_LED) 148 if (reg == DM355EVM_MSP_LED)
149 msp_led_cache = status; 149 msp_led_cache = status;
150 return status & MSP_GPIO_MASK(offset); 150 return !!(status & MSP_GPIO_MASK(offset));
151} 151}
152 152
153static int msp_gpio_out(struct gpio_chip *chip, unsigned offset, int value) 153static int msp_gpio_out(struct gpio_chip *chip, unsigned offset, int value)
diff --git a/drivers/mfd/htc-egpio.c b/drivers/mfd/htc-egpio.c
index 6ccaf90d98fd..e4f4a31b76d9 100644
--- a/drivers/mfd/htc-egpio.c
+++ b/drivers/mfd/htc-egpio.c
@@ -163,7 +163,7 @@ static int egpio_get(struct gpio_chip *chip, unsigned offset)
163 value = egpio_readw(ei, reg); 163 value = egpio_readw(ei, reg);
164 pr_debug("readw(%p + %x) = %x\n", 164 pr_debug("readw(%p + %x) = %x\n",
165 ei->base_addr, reg << ei->bus_shift, value); 165 ei->base_addr, reg << ei->bus_shift, value);
166 return value & bit; 166 return !!(value & bit);
167} 167}
168 168
169static int egpio_direction_input(struct gpio_chip *chip, unsigned offset) 169static int egpio_direction_input(struct gpio_chip *chip, unsigned offset)
diff --git a/drivers/mfd/lpc_ich.c b/drivers/mfd/lpc_ich.c
index b514f3cf140d..bd3aa4578346 100644
--- a/drivers/mfd/lpc_ich.c
+++ b/drivers/mfd/lpc_ich.c
@@ -55,6 +55,7 @@
55 * document number TBD : Coleto Creek 55 * document number TBD : Coleto Creek
56 * document number TBD : Wildcat Point-LP 56 * document number TBD : Wildcat Point-LP
57 * document number TBD : 9 Series 57 * document number TBD : 9 Series
58 * document number TBD : Lewisburg
58 */ 59 */
59 60
60#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 61#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
@@ -213,6 +214,7 @@ enum lpc_chipsets {
213 LPC_COLETO, /* Coleto Creek */ 214 LPC_COLETO, /* Coleto Creek */
214 LPC_WPT_LP, /* Wildcat Point-LP */ 215 LPC_WPT_LP, /* Wildcat Point-LP */
215 LPC_BRASWELL, /* Braswell SoC */ 216 LPC_BRASWELL, /* Braswell SoC */
217 LPC_LEWISBURG, /* Lewisburg */
216 LPC_9S, /* 9 Series */ 218 LPC_9S, /* 9 Series */
217}; 219};
218 220
@@ -521,6 +523,10 @@ static struct lpc_ich_info lpc_chipset_info[] = {
521 .name = "Braswell SoC", 523 .name = "Braswell SoC",
522 .iTCO_version = 3, 524 .iTCO_version = 3,
523 }, 525 },
526 [LPC_LEWISBURG] = {
527 .name = "Lewisburg",
528 .iTCO_version = 2,
529 },
524 [LPC_9S] = { 530 [LPC_9S] = {
525 .name = "9 Series", 531 .name = "9 Series",
526 .iTCO_version = 2, 532 .iTCO_version = 2,
@@ -757,6 +763,15 @@ static const struct pci_device_id lpc_ich_ids[] = {
757 { PCI_VDEVICE(INTEL, 0x9cc6), LPC_WPT_LP}, 763 { PCI_VDEVICE(INTEL, 0x9cc6), LPC_WPT_LP},
758 { PCI_VDEVICE(INTEL, 0x9cc7), LPC_WPT_LP}, 764 { PCI_VDEVICE(INTEL, 0x9cc7), LPC_WPT_LP},
759 { PCI_VDEVICE(INTEL, 0x9cc9), LPC_WPT_LP}, 765 { PCI_VDEVICE(INTEL, 0x9cc9), LPC_WPT_LP},
766 { PCI_VDEVICE(INTEL, 0xa1c1), LPC_LEWISBURG},
767 { PCI_VDEVICE(INTEL, 0xa1c2), LPC_LEWISBURG},
768 { PCI_VDEVICE(INTEL, 0xa1c3), LPC_LEWISBURG},
769 { PCI_VDEVICE(INTEL, 0xa1c4), LPC_LEWISBURG},
770 { PCI_VDEVICE(INTEL, 0xa1c5), LPC_LEWISBURG},
771 { PCI_VDEVICE(INTEL, 0xa1c6), LPC_LEWISBURG},
772 { PCI_VDEVICE(INTEL, 0xa1c7), LPC_LEWISBURG},
773 { PCI_VDEVICE(INTEL, 0xa242), LPC_LEWISBURG},
774 { PCI_VDEVICE(INTEL, 0xa243), LPC_LEWISBURG},
760 { 0, }, /* End of list */ 775 { 0, }, /* End of list */
761}; 776};
762MODULE_DEVICE_TABLE(pci, lpc_ich_ids); 777MODULE_DEVICE_TABLE(pci, lpc_ich_ids);
diff --git a/drivers/mfd/max14577.c b/drivers/mfd/max14577.c
index 56e216dedc91..2280b3fdcf68 100644
--- a/drivers/mfd/max14577.c
+++ b/drivers/mfd/max14577.c
@@ -495,7 +495,7 @@ MODULE_DEVICE_TABLE(i2c, max14577_i2c_id);
495#ifdef CONFIG_PM_SLEEP 495#ifdef CONFIG_PM_SLEEP
496static int max14577_suspend(struct device *dev) 496static int max14577_suspend(struct device *dev)
497{ 497{
498 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 498 struct i2c_client *i2c = to_i2c_client(dev);
499 struct max14577 *max14577 = i2c_get_clientdata(i2c); 499 struct max14577 *max14577 = i2c_get_clientdata(i2c);
500 500
501 if (device_may_wakeup(dev)) 501 if (device_may_wakeup(dev))
@@ -516,7 +516,7 @@ static int max14577_suspend(struct device *dev)
516 516
517static int max14577_resume(struct device *dev) 517static int max14577_resume(struct device *dev)
518{ 518{
519 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 519 struct i2c_client *i2c = to_i2c_client(dev);
520 struct max14577 *max14577 = i2c_get_clientdata(i2c); 520 struct max14577 *max14577 = i2c_get_clientdata(i2c);
521 521
522 if (device_may_wakeup(dev)) 522 if (device_may_wakeup(dev))
diff --git a/drivers/mfd/max77686.c b/drivers/mfd/max77686.c
index d19be64cd32b..d959ebbb2194 100644
--- a/drivers/mfd/max77686.c
+++ b/drivers/mfd/max77686.c
@@ -352,7 +352,7 @@ MODULE_DEVICE_TABLE(i2c, max77686_i2c_id);
352#ifdef CONFIG_PM_SLEEP 352#ifdef CONFIG_PM_SLEEP
353static int max77686_suspend(struct device *dev) 353static int max77686_suspend(struct device *dev)
354{ 354{
355 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 355 struct i2c_client *i2c = to_i2c_client(dev);
356 struct max77686_dev *max77686 = i2c_get_clientdata(i2c); 356 struct max77686_dev *max77686 = i2c_get_clientdata(i2c);
357 357
358 if (device_may_wakeup(dev)) 358 if (device_may_wakeup(dev))
@@ -374,7 +374,7 @@ static int max77686_suspend(struct device *dev)
374 374
375static int max77686_resume(struct device *dev) 375static int max77686_resume(struct device *dev)
376{ 376{
377 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 377 struct i2c_client *i2c = to_i2c_client(dev);
378 struct max77686_dev *max77686 = i2c_get_clientdata(i2c); 378 struct max77686_dev *max77686 = i2c_get_clientdata(i2c);
379 379
380 if (device_may_wakeup(dev)) 380 if (device_may_wakeup(dev))
diff --git a/drivers/mfd/max77693.c b/drivers/mfd/max77693.c
index 007f729e150b..b83b7a7da1ae 100644
--- a/drivers/mfd/max77693.c
+++ b/drivers/mfd/max77693.c
@@ -334,7 +334,7 @@ MODULE_DEVICE_TABLE(i2c, max77693_i2c_id);
334 334
335static int max77693_suspend(struct device *dev) 335static int max77693_suspend(struct device *dev)
336{ 336{
337 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 337 struct i2c_client *i2c = to_i2c_client(dev);
338 struct max77693_dev *max77693 = i2c_get_clientdata(i2c); 338 struct max77693_dev *max77693 = i2c_get_clientdata(i2c);
339 339
340 if (device_may_wakeup(dev)) { 340 if (device_may_wakeup(dev)) {
@@ -347,7 +347,7 @@ static int max77693_suspend(struct device *dev)
347 347
348static int max77693_resume(struct device *dev) 348static int max77693_resume(struct device *dev)
349{ 349{
350 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 350 struct i2c_client *i2c = to_i2c_client(dev);
351 struct max77693_dev *max77693 = i2c_get_clientdata(i2c); 351 struct max77693_dev *max77693 = i2c_get_clientdata(i2c);
352 352
353 if (device_may_wakeup(dev)) { 353 if (device_may_wakeup(dev)) {
diff --git a/drivers/mfd/max77843.c b/drivers/mfd/max77843.c
index 586098f1b233..7cfc95b49c5d 100644
--- a/drivers/mfd/max77843.c
+++ b/drivers/mfd/max77843.c
@@ -197,7 +197,7 @@ MODULE_DEVICE_TABLE(i2c, max77843_id);
197 197
198static int __maybe_unused max77843_suspend(struct device *dev) 198static int __maybe_unused max77843_suspend(struct device *dev)
199{ 199{
200 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 200 struct i2c_client *i2c = to_i2c_client(dev);
201 struct max77693_dev *max77843 = i2c_get_clientdata(i2c); 201 struct max77693_dev *max77843 = i2c_get_clientdata(i2c);
202 202
203 disable_irq(max77843->irq); 203 disable_irq(max77843->irq);
@@ -209,7 +209,7 @@ static int __maybe_unused max77843_suspend(struct device *dev)
209 209
210static int __maybe_unused max77843_resume(struct device *dev) 210static int __maybe_unused max77843_resume(struct device *dev)
211{ 211{
212 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 212 struct i2c_client *i2c = to_i2c_client(dev);
213 struct max77693_dev *max77843 = i2c_get_clientdata(i2c); 213 struct max77693_dev *max77843 = i2c_get_clientdata(i2c);
214 214
215 if (device_may_wakeup(dev)) 215 if (device_may_wakeup(dev))
diff --git a/drivers/mfd/max8925-i2c.c b/drivers/mfd/max8925-i2c.c
index b0fe8103e401..70443b161a5b 100644
--- a/drivers/mfd/max8925-i2c.c
+++ b/drivers/mfd/max8925-i2c.c
@@ -215,7 +215,7 @@ static int max8925_remove(struct i2c_client *client)
215#ifdef CONFIG_PM_SLEEP 215#ifdef CONFIG_PM_SLEEP
216static int max8925_suspend(struct device *dev) 216static int max8925_suspend(struct device *dev)
217{ 217{
218 struct i2c_client *client = container_of(dev, struct i2c_client, dev); 218 struct i2c_client *client = to_i2c_client(dev);
219 struct max8925_chip *chip = i2c_get_clientdata(client); 219 struct max8925_chip *chip = i2c_get_clientdata(client);
220 220
221 if (device_may_wakeup(dev) && chip->wakeup_flag) 221 if (device_may_wakeup(dev) && chip->wakeup_flag)
@@ -225,7 +225,7 @@ static int max8925_suspend(struct device *dev)
225 225
226static int max8925_resume(struct device *dev) 226static int max8925_resume(struct device *dev)
227{ 227{
228 struct i2c_client *client = container_of(dev, struct i2c_client, dev); 228 struct i2c_client *client = to_i2c_client(dev);
229 struct max8925_chip *chip = i2c_get_clientdata(client); 229 struct max8925_chip *chip = i2c_get_clientdata(client);
230 230
231 if (device_may_wakeup(dev) && chip->wakeup_flag) 231 if (device_may_wakeup(dev) && chip->wakeup_flag)
diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c
index 156ed6f92aa3..f316348e3d98 100644
--- a/drivers/mfd/max8997.c
+++ b/drivers/mfd/max8997.c
@@ -437,7 +437,7 @@ static u8 max8997_dumpaddr_haptic[] = {
437 437
438static int max8997_freeze(struct device *dev) 438static int max8997_freeze(struct device *dev)
439{ 439{
440 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 440 struct i2c_client *i2c = to_i2c_client(dev);
441 struct max8997_dev *max8997 = i2c_get_clientdata(i2c); 441 struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
442 int i; 442 int i;
443 443
@@ -459,7 +459,7 @@ static int max8997_freeze(struct device *dev)
459 459
460static int max8997_restore(struct device *dev) 460static int max8997_restore(struct device *dev)
461{ 461{
462 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 462 struct i2c_client *i2c = to_i2c_client(dev);
463 struct max8997_dev *max8997 = i2c_get_clientdata(i2c); 463 struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
464 int i; 464 int i;
465 465
@@ -481,7 +481,7 @@ static int max8997_restore(struct device *dev)
481 481
482static int max8997_suspend(struct device *dev) 482static int max8997_suspend(struct device *dev)
483{ 483{
484 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 484 struct i2c_client *i2c = to_i2c_client(dev);
485 struct max8997_dev *max8997 = i2c_get_clientdata(i2c); 485 struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
486 486
487 if (device_may_wakeup(dev)) 487 if (device_may_wakeup(dev))
@@ -491,7 +491,7 @@ static int max8997_suspend(struct device *dev)
491 491
492static int max8997_resume(struct device *dev) 492static int max8997_resume(struct device *dev)
493{ 493{
494 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 494 struct i2c_client *i2c = to_i2c_client(dev);
495 struct max8997_dev *max8997 = i2c_get_clientdata(i2c); 495 struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
496 496
497 if (device_may_wakeup(dev)) 497 if (device_may_wakeup(dev))
diff --git a/drivers/mfd/max8998.c b/drivers/mfd/max8998.c
index a7afe3bf27fc..ab28b29400f6 100644
--- a/drivers/mfd/max8998.c
+++ b/drivers/mfd/max8998.c
@@ -274,7 +274,7 @@ MODULE_DEVICE_TABLE(i2c, max8998_i2c_id);
274 274
275static int max8998_suspend(struct device *dev) 275static int max8998_suspend(struct device *dev)
276{ 276{
277 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 277 struct i2c_client *i2c = to_i2c_client(dev);
278 struct max8998_dev *max8998 = i2c_get_clientdata(i2c); 278 struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
279 279
280 if (device_may_wakeup(dev)) 280 if (device_may_wakeup(dev))
@@ -284,7 +284,7 @@ static int max8998_suspend(struct device *dev)
284 284
285static int max8998_resume(struct device *dev) 285static int max8998_resume(struct device *dev)
286{ 286{
287 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 287 struct i2c_client *i2c = to_i2c_client(dev);
288 struct max8998_dev *max8998 = i2c_get_clientdata(i2c); 288 struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
289 289
290 if (device_may_wakeup(dev)) 290 if (device_may_wakeup(dev))
@@ -344,7 +344,7 @@ static struct max8998_reg_dump max8998_dump[] = {
344/* Save registers before hibernation */ 344/* Save registers before hibernation */
345static int max8998_freeze(struct device *dev) 345static int max8998_freeze(struct device *dev)
346{ 346{
347 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 347 struct i2c_client *i2c = to_i2c_client(dev);
348 int i; 348 int i;
349 349
350 for (i = 0; i < ARRAY_SIZE(max8998_dump); i++) 350 for (i = 0; i < ARRAY_SIZE(max8998_dump); i++)
@@ -357,7 +357,7 @@ static int max8998_freeze(struct device *dev)
357/* Restore registers after hibernation */ 357/* Restore registers after hibernation */
358static int max8998_restore(struct device *dev) 358static int max8998_restore(struct device *dev)
359{ 359{
360 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 360 struct i2c_client *i2c = to_i2c_client(dev);
361 int i; 361 int i;
362 362
363 for (i = 0; i < ARRAY_SIZE(max8998_dump); i++) 363 for (i = 0; i < ARRAY_SIZE(max8998_dump); i++)
diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c
index 3f9f4c874d2a..d7f54e492aa6 100644
--- a/drivers/mfd/mc13xxx-core.c
+++ b/drivers/mfd/mc13xxx-core.c
@@ -383,16 +383,16 @@ static int mc13xxx_probe_flags_dt(struct mc13xxx *mc13xxx)
383 if (!np) 383 if (!np)
384 return -ENODEV; 384 return -ENODEV;
385 385
386 if (of_get_property(np, "fsl,mc13xxx-uses-adc", NULL)) 386 if (of_property_read_bool(np, "fsl,mc13xxx-uses-adc"))
387 mc13xxx->flags |= MC13XXX_USE_ADC; 387 mc13xxx->flags |= MC13XXX_USE_ADC;
388 388
389 if (of_get_property(np, "fsl,mc13xxx-uses-codec", NULL)) 389 if (of_property_read_bool(np, "fsl,mc13xxx-uses-codec"))
390 mc13xxx->flags |= MC13XXX_USE_CODEC; 390 mc13xxx->flags |= MC13XXX_USE_CODEC;
391 391
392 if (of_get_property(np, "fsl,mc13xxx-uses-rtc", NULL)) 392 if (of_property_read_bool(np, "fsl,mc13xxx-uses-rtc"))
393 mc13xxx->flags |= MC13XXX_USE_RTC; 393 mc13xxx->flags |= MC13XXX_USE_RTC;
394 394
395 if (of_get_property(np, "fsl,mc13xxx-uses-touch", NULL)) 395 if (of_property_read_bool(np, "fsl,mc13xxx-uses-touch"))
396 mc13xxx->flags |= MC13XXX_USE_TOUCHSCREEN; 396 mc13xxx->flags |= MC13XXX_USE_TOUCHSCREEN;
397 397
398 return 0; 398 return 0;
diff --git a/drivers/mfd/qcom-spmi-pmic.c b/drivers/mfd/qcom-spmi-pmic.c
index af6ac1c4b45c..8653e8b9bb4f 100644
--- a/drivers/mfd/qcom-spmi-pmic.c
+++ b/drivers/mfd/qcom-spmi-pmic.c
@@ -127,7 +127,9 @@ static int pmic_spmi_probe(struct spmi_device *sdev)
127 if (IS_ERR(regmap)) 127 if (IS_ERR(regmap))
128 return PTR_ERR(regmap); 128 return PTR_ERR(regmap);
129 129
130 pmic_spmi_show_revid(regmap, &sdev->dev); 130 /* Only the first slave id for a PMIC contains this information */
131 if (sdev->usid % 2 == 0)
132 pmic_spmi_show_revid(regmap, &sdev->dev);
131 133
132 return of_platform_populate(root, NULL, NULL, &sdev->dev); 134 return of_platform_populate(root, NULL, NULL, &sdev->dev);
133} 135}
diff --git a/drivers/mfd/qcom_rpm.c b/drivers/mfd/qcom_rpm.c
index 207a3bd68559..1be47ad6441b 100644
--- a/drivers/mfd/qcom_rpm.c
+++ b/drivers/mfd/qcom_rpm.c
@@ -495,6 +495,8 @@ static int qcom_rpm_probe(struct platform_device *pdev)
495 } 495 }
496 496
497 match = of_match_device(qcom_rpm_of_match, &pdev->dev); 497 match = of_match_device(qcom_rpm_of_match, &pdev->dev);
498 if (!match)
499 return -ENODEV;
498 rpm->data = match->data; 500 rpm->data = match->data;
499 501
500 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 502 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index 989076d6cb83..400e1d7d8d08 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -29,6 +29,7 @@
29#include <linux/mfd/samsung/s2mps11.h> 29#include <linux/mfd/samsung/s2mps11.h>
30#include <linux/mfd/samsung/s2mps13.h> 30#include <linux/mfd/samsung/s2mps13.h>
31#include <linux/mfd/samsung/s2mps14.h> 31#include <linux/mfd/samsung/s2mps14.h>
32#include <linux/mfd/samsung/s2mps15.h>
32#include <linux/mfd/samsung/s2mpu02.h> 33#include <linux/mfd/samsung/s2mpu02.h>
33#include <linux/mfd/samsung/s5m8763.h> 34#include <linux/mfd/samsung/s5m8763.h>
34#include <linux/mfd/samsung/s5m8767.h> 35#include <linux/mfd/samsung/s5m8767.h>
@@ -67,7 +68,7 @@ static const struct mfd_cell s5m8767_devs[] = {
67 68
68static const struct mfd_cell s2mps11_devs[] = { 69static const struct mfd_cell s2mps11_devs[] = {
69 { 70 {
70 .name = "s2mps11-pmic", 71 .name = "s2mps11-regulator",
71 }, { 72 }, {
72 .name = "s2mps14-rtc", 73 .name = "s2mps14-rtc",
73 }, { 74 }, {
@@ -77,7 +78,7 @@ static const struct mfd_cell s2mps11_devs[] = {
77}; 78};
78 79
79static const struct mfd_cell s2mps13_devs[] = { 80static const struct mfd_cell s2mps13_devs[] = {
80 { .name = "s2mps13-pmic", }, 81 { .name = "s2mps13-regulator", },
81 { .name = "s2mps13-rtc", }, 82 { .name = "s2mps13-rtc", },
82 { 83 {
83 .name = "s2mps13-clk", 84 .name = "s2mps13-clk",
@@ -87,7 +88,7 @@ static const struct mfd_cell s2mps13_devs[] = {
87 88
88static const struct mfd_cell s2mps14_devs[] = { 89static const struct mfd_cell s2mps14_devs[] = {
89 { 90 {
90 .name = "s2mps14-pmic", 91 .name = "s2mps14-regulator",
91 }, { 92 }, {
92 .name = "s2mps14-rtc", 93 .name = "s2mps14-rtc",
93 }, { 94 }, {
@@ -96,6 +97,17 @@ static const struct mfd_cell s2mps14_devs[] = {
96 } 97 }
97}; 98};
98 99
100static const struct mfd_cell s2mps15_devs[] = {
101 {
102 .name = "s2mps15-regulator",
103 }, {
104 .name = "s2mps15-rtc",
105 }, {
106 .name = "s2mps13-clk",
107 .of_compatible = "samsung,s2mps13-clk",
108 },
109};
110
99static const struct mfd_cell s2mpa01_devs[] = { 111static const struct mfd_cell s2mpa01_devs[] = {
100 { 112 {
101 .name = "s2mpa01-pmic", 113 .name = "s2mpa01-pmic",
@@ -104,7 +116,7 @@ static const struct mfd_cell s2mpa01_devs[] = {
104 116
105static const struct mfd_cell s2mpu02_devs[] = { 117static const struct mfd_cell s2mpu02_devs[] = {
106 { 118 {
107 .name = "s2mpu02-pmic", 119 .name = "s2mpu02-regulator",
108 }, 120 },
109}; 121};
110 122
@@ -122,6 +134,9 @@ static const struct of_device_id sec_dt_match[] = {
122 .compatible = "samsung,s2mps14-pmic", 134 .compatible = "samsung,s2mps14-pmic",
123 .data = (void *)S2MPS14X, 135 .data = (void *)S2MPS14X,
124 }, { 136 }, {
137 .compatible = "samsung,s2mps15-pmic",
138 .data = (void *)S2MPS15X,
139 }, {
125 .compatible = "samsung,s2mpa01-pmic", 140 .compatible = "samsung,s2mpa01-pmic",
126 .data = (void *)S2MPA01, 141 .data = (void *)S2MPA01,
127 }, { 142 }, {
@@ -223,6 +238,15 @@ static const struct regmap_config s2mps14_regmap_config = {
223 .cache_type = REGCACHE_FLAT, 238 .cache_type = REGCACHE_FLAT,
224}; 239};
225 240
241static const struct regmap_config s2mps15_regmap_config = {
242 .reg_bits = 8,
243 .val_bits = 8,
244
245 .max_register = S2MPS15_REG_LDODSCH4,
246 .volatile_reg = s2mps11_volatile,
247 .cache_type = REGCACHE_FLAT,
248};
249
226static const struct regmap_config s2mpu02_regmap_config = { 250static const struct regmap_config s2mpu02_regmap_config = {
227 .reg_bits = 8, 251 .reg_bits = 8,
228 .val_bits = 8, 252 .val_bits = 8,
@@ -384,6 +408,9 @@ static int sec_pmic_probe(struct i2c_client *i2c,
384 case S2MPS14X: 408 case S2MPS14X:
385 regmap = &s2mps14_regmap_config; 409 regmap = &s2mps14_regmap_config;
386 break; 410 break;
411 case S2MPS15X:
412 regmap = &s2mps15_regmap_config;
413 break;
387 case S5M8763X: 414 case S5M8763X:
388 regmap = &s5m8763_regmap_config; 415 regmap = &s5m8763_regmap_config;
389 break; 416 break;
@@ -442,6 +469,10 @@ static int sec_pmic_probe(struct i2c_client *i2c,
442 sec_devs = s2mps14_devs; 469 sec_devs = s2mps14_devs;
443 num_sec_devs = ARRAY_SIZE(s2mps14_devs); 470 num_sec_devs = ARRAY_SIZE(s2mps14_devs);
444 break; 471 break;
472 case S2MPS15X:
473 sec_devs = s2mps15_devs;
474 num_sec_devs = ARRAY_SIZE(s2mps15_devs);
475 break;
445 case S2MPU02: 476 case S2MPU02:
446 sec_devs = s2mpu02_devs; 477 sec_devs = s2mpu02_devs;
447 num_sec_devs = ARRAY_SIZE(s2mpu02_devs); 478 num_sec_devs = ARRAY_SIZE(s2mpu02_devs);
@@ -505,7 +536,7 @@ static void sec_pmic_shutdown(struct i2c_client *i2c)
505#ifdef CONFIG_PM_SLEEP 536#ifdef CONFIG_PM_SLEEP
506static int sec_pmic_suspend(struct device *dev) 537static int sec_pmic_suspend(struct device *dev)
507{ 538{
508 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 539 struct i2c_client *i2c = to_i2c_client(dev);
509 struct sec_pmic_dev *sec_pmic = i2c_get_clientdata(i2c); 540 struct sec_pmic_dev *sec_pmic = i2c_get_clientdata(i2c);
510 541
511 if (device_may_wakeup(dev)) 542 if (device_may_wakeup(dev))
@@ -526,7 +557,7 @@ static int sec_pmic_suspend(struct device *dev)
526 557
527static int sec_pmic_resume(struct device *dev) 558static int sec_pmic_resume(struct device *dev)
528{ 559{
529 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 560 struct i2c_client *i2c = to_i2c_client(dev);
530 struct sec_pmic_dev *sec_pmic = i2c_get_clientdata(i2c); 561 struct sec_pmic_dev *sec_pmic = i2c_get_clientdata(i2c);
531 562
532 if (device_may_wakeup(dev)) 563 if (device_may_wakeup(dev))
diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c
index 806fa8dbb22d..d77de431cc50 100644
--- a/drivers/mfd/sec-irq.c
+++ b/drivers/mfd/sec-irq.c
@@ -407,6 +407,11 @@ static const struct regmap_irq_chip s2mps14_irq_chip = {
407 S2MPS1X_IRQ_CHIP_COMMON_DATA, 407 S2MPS1X_IRQ_CHIP_COMMON_DATA,
408}; 408};
409 409
410static const struct regmap_irq_chip s2mps15_irq_chip = {
411 .name = "s2mps15",
412 S2MPS1X_IRQ_CHIP_COMMON_DATA,
413};
414
410static const struct regmap_irq_chip s2mpu02_irq_chip = { 415static const struct regmap_irq_chip s2mpu02_irq_chip = {
411 .name = "s2mpu02", 416 .name = "s2mpu02",
412 .irqs = s2mpu02_irqs, 417 .irqs = s2mpu02_irqs,
@@ -466,6 +471,9 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic)
466 case S2MPS14X: 471 case S2MPS14X:
467 sec_irq_chip = &s2mps14_irq_chip; 472 sec_irq_chip = &s2mps14_irq_chip;
468 break; 473 break;
474 case S2MPS15X:
475 sec_irq_chip = &s2mps15_irq_chip;
476 break;
469 case S2MPU02: 477 case S2MPU02:
470 sec_irq_chip = &s2mpu02_irq_chip; 478 sec_irq_chip = &s2mpu02_irq_chip;
471 break; 479 break;
diff --git a/drivers/mfd/sta2x11-mfd.c b/drivers/mfd/sta2x11-mfd.c
index b3e5c6f45105..9292202039ee 100644
--- a/drivers/mfd/sta2x11-mfd.c
+++ b/drivers/mfd/sta2x11-mfd.c
@@ -372,12 +372,6 @@ static struct platform_driver sta2x11_sctl_platform_driver = {
372 .probe = sta2x11_sctl_probe, 372 .probe = sta2x11_sctl_probe,
373}; 373};
374 374
375static int __init sta2x11_sctl_init(void)
376{
377 pr_info("%s\n", __func__);
378 return platform_driver_register(&sta2x11_sctl_platform_driver);
379}
380
381static struct platform_driver sta2x11_platform_driver = { 375static struct platform_driver sta2x11_platform_driver = {
382 .driver = { 376 .driver = {
383 .name = STA2X11_MFD_APBREG_NAME, 377 .name = STA2X11_MFD_APBREG_NAME,
@@ -385,12 +379,6 @@ static struct platform_driver sta2x11_platform_driver = {
385 .probe = sta2x11_apbreg_probe, 379 .probe = sta2x11_apbreg_probe,
386}; 380};
387 381
388static int __init sta2x11_apbreg_init(void)
389{
390 pr_info("%s\n", __func__);
391 return platform_driver_register(&sta2x11_platform_driver);
392}
393
394static struct platform_driver sta2x11_apb_soc_regs_platform_driver = { 382static struct platform_driver sta2x11_apb_soc_regs_platform_driver = {
395 .driver = { 383 .driver = {
396 .name = STA2X11_MFD_APB_SOC_REGS_NAME, 384 .name = STA2X11_MFD_APB_SOC_REGS_NAME,
@@ -398,12 +386,6 @@ static struct platform_driver sta2x11_apb_soc_regs_platform_driver = {
398 .probe = sta2x11_apb_soc_regs_probe, 386 .probe = sta2x11_apb_soc_regs_probe,
399}; 387};
400 388
401static int __init sta2x11_apb_soc_regs_init(void)
402{
403 pr_info("%s\n", __func__);
404 return platform_driver_register(&sta2x11_apb_soc_regs_platform_driver);
405}
406
407static struct platform_driver sta2x11_scr_platform_driver = { 389static struct platform_driver sta2x11_scr_platform_driver = {
408 .driver = { 390 .driver = {
409 .name = STA2X11_MFD_SCR_NAME, 391 .name = STA2X11_MFD_SCR_NAME,
@@ -411,13 +393,18 @@ static struct platform_driver sta2x11_scr_platform_driver = {
411 .probe = sta2x11_scr_probe, 393 .probe = sta2x11_scr_probe,
412}; 394};
413 395
414static int __init sta2x11_scr_init(void) 396static struct platform_driver * const drivers[] = {
397 &sta2x11_platform_driver,
398 &sta2x11_sctl_platform_driver,
399 &sta2x11_apb_soc_regs_platform_driver,
400 &sta2x11_scr_platform_driver,
401};
402
403static int __init sta2x11_drivers_init(void)
415{ 404{
416 pr_info("%s\n", __func__); 405 return platform_register_drivers(drivers, ARRAY_SIZE(drivers));
417 return platform_driver_register(&sta2x11_scr_platform_driver);
418} 406}
419 407
420
421/* 408/*
422 * What follows are the PCI devices that host the above pdevs. 409 * What follows are the PCI devices that host the above pdevs.
423 * Each logic block is 4kB and they are all consecutive: we use this info. 410 * Each logic block is 4kB and they are all consecutive: we use this info.
@@ -664,10 +651,7 @@ static int __init sta2x11_mfd_init(void)
664 * prepares platform drivers very early and probe the PCI device later, 651 * prepares platform drivers very early and probe the PCI device later,
665 * but before other PCI devices. 652 * but before other PCI devices.
666 */ 653 */
667subsys_initcall(sta2x11_apbreg_init); 654subsys_initcall(sta2x11_drivers_init);
668subsys_initcall(sta2x11_sctl_init);
669subsys_initcall(sta2x11_apb_soc_regs_init);
670subsys_initcall(sta2x11_scr_init);
671rootfs_initcall(sta2x11_mfd_init); 655rootfs_initcall(sta2x11_mfd_init);
672 656
673MODULE_LICENSE("GPL v2"); 657MODULE_LICENSE("GPL v2");
diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index 176bf0fa2685..b7aabeefab07 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -47,6 +47,7 @@ static struct syscon *of_syscon_register(struct device_node *np)
47 struct syscon *syscon; 47 struct syscon *syscon;
48 struct regmap *regmap; 48 struct regmap *regmap;
49 void __iomem *base; 49 void __iomem *base;
50 u32 reg_io_width;
50 int ret; 51 int ret;
51 struct regmap_config syscon_config = syscon_regmap_config; 52 struct regmap_config syscon_config = syscon_regmap_config;
52 53
@@ -69,6 +70,18 @@ static struct syscon *of_syscon_register(struct device_node *np)
69 else if (of_property_read_bool(np, "little-endian")) 70 else if (of_property_read_bool(np, "little-endian"))
70 syscon_config.val_format_endian = REGMAP_ENDIAN_LITTLE; 71 syscon_config.val_format_endian = REGMAP_ENDIAN_LITTLE;
71 72
73 /*
74 * search for reg-io-width property in DT. If it is not provided,
75 * default to 4 bytes. regmap_init_mmio will return an error if values
76 * are invalid so there is no need to check them here.
77 */
78 ret = of_property_read_u32(np, "reg-io-width", &reg_io_width);
79 if (ret)
80 reg_io_width = 4;
81
82 syscon_config.reg_stride = reg_io_width;
83 syscon_config.val_bits = reg_io_width * 8;
84
72 regmap = regmap_init_mmio(NULL, base, &syscon_config); 85 regmap = regmap_init_mmio(NULL, base, &syscon_config);
73 if (IS_ERR(regmap)) { 86 if (IS_ERR(regmap)) {
74 pr_err("regmap init failed\n"); 87 pr_err("regmap init failed\n");
diff --git a/drivers/mfd/tc6393xb.c b/drivers/mfd/tc6393xb.c
index 8c84a513016b..1ecbfa40d1b3 100644
--- a/drivers/mfd/tc6393xb.c
+++ b/drivers/mfd/tc6393xb.c
@@ -437,8 +437,8 @@ static int tc6393xb_gpio_get(struct gpio_chip *chip,
437 struct tc6393xb *tc6393xb = container_of(chip, struct tc6393xb, gpio); 437 struct tc6393xb *tc6393xb = container_of(chip, struct tc6393xb, gpio);
438 438
439 /* XXX: does dsr also represent inputs? */ 439 /* XXX: does dsr also represent inputs? */
440 return tmio_ioread8(tc6393xb->scr + SCR_GPO_DSR(offset / 8)) 440 return !!(tmio_ioread8(tc6393xb->scr + SCR_GPO_DSR(offset / 8))
441 & TC_GPIO_BIT(offset); 441 & TC_GPIO_BIT(offset));
442} 442}
443 443
444static void __tc6393xb_gpio_set(struct gpio_chip *chip, 444static void __tc6393xb_gpio_set(struct gpio_chip *chip,
diff --git a/drivers/mfd/tps65010.c b/drivers/mfd/tps65010.c
index 448f0a182dc4..677a127619d4 100644
--- a/drivers/mfd/tps65010.c
+++ b/drivers/mfd/tps65010.c
@@ -499,11 +499,11 @@ static int tps65010_gpio_get(struct gpio_chip *chip, unsigned offset)
499 if (offset < 4) { 499 if (offset < 4) {
500 value = i2c_smbus_read_byte_data(tps->client, TPS_DEFGPIO); 500 value = i2c_smbus_read_byte_data(tps->client, TPS_DEFGPIO);
501 if (value < 0) 501 if (value < 0)
502 return 0; 502 return value;
503 if (value & (1 << (offset + 4))) /* output */ 503 if (value & (1 << (offset + 4))) /* output */
504 return !(value & (1 << offset)); 504 return !(value & (1 << offset));
505 else /* input */ 505 else /* input */
506 return (value & (1 << offset)); 506 return !!(value & (1 << offset));
507 } 507 }
508 508
509 /* REVISIT we *could* report LED1/nPG and LED2 state ... */ 509 /* REVISIT we *could* report LED1/nPG and LED2 state ... */
diff --git a/drivers/mfd/ucb1x00-core.c b/drivers/mfd/ucb1x00-core.c
index f691d7ecad52..e0dd83fb95d3 100644
--- a/drivers/mfd/ucb1x00-core.c
+++ b/drivers/mfd/ucb1x00-core.c
@@ -133,7 +133,7 @@ static int ucb1x00_gpio_get(struct gpio_chip *chip, unsigned offset)
133 val = ucb1x00_reg_read(ucb, UCB_IO_DATA); 133 val = ucb1x00_reg_read(ucb, UCB_IO_DATA);
134 ucb1x00_disable(ucb); 134 ucb1x00_disable(ucb);
135 135
136 return val & (1 << offset); 136 return !!(val & (1 << offset));
137} 137}
138 138
139static int ucb1x00_gpio_direction_input(struct gpio_chip *chip, unsigned offset) 139static int ucb1x00_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
diff --git a/drivers/mfd/wm5110-tables.c b/drivers/mfd/wm5110-tables.c
index 2bb2d0467a92..c18e11f42b3f 100644
--- a/drivers/mfd/wm5110-tables.c
+++ b/drivers/mfd/wm5110-tables.c
@@ -762,9 +762,9 @@ static const struct reg_default wm5110_reg_default[] = {
762 { 0x00000200, 0x0006 }, /* R512 - Mic Charge Pump 1 */ 762 { 0x00000200, 0x0006 }, /* R512 - Mic Charge Pump 1 */
763 { 0x00000210, 0x0184 }, /* R528 - LDO1 Control 1 */ 763 { 0x00000210, 0x0184 }, /* R528 - LDO1 Control 1 */
764 { 0x00000213, 0x03E4 }, /* R531 - LDO2 Control 1 */ 764 { 0x00000213, 0x03E4 }, /* R531 - LDO2 Control 1 */
765 { 0x00000218, 0x01A6 }, /* R536 - Mic Bias Ctrl 1 */ 765 { 0x00000218, 0x00E6 }, /* R536 - Mic Bias Ctrl 1 */
766 { 0x00000219, 0x01A6 }, /* R537 - Mic Bias Ctrl 2 */ 766 { 0x00000219, 0x00E6 }, /* R537 - Mic Bias Ctrl 2 */
767 { 0x0000021A, 0x01A6 }, /* R538 - Mic Bias Ctrl 3 */ 767 { 0x0000021A, 0x00E6 }, /* R538 - Mic Bias Ctrl 3 */
768 { 0x00000293, 0x0000 }, /* R659 - Accessory Detect Mode 1 */ 768 { 0x00000293, 0x0000 }, /* R659 - Accessory Detect Mode 1 */
769 { 0x0000029B, 0x0028 }, /* R667 - Headphone Detect 1 */ 769 { 0x0000029B, 0x0028 }, /* R667 - Headphone Detect 1 */
770 { 0x000002A2, 0x0000 }, /* R674 - Micd clamp control */ 770 { 0x000002A2, 0x0000 }, /* R674 - Micd clamp control */
diff --git a/drivers/mfd/wm831x-otp.c b/drivers/mfd/wm831x-otp.c
index b90f3e06b6c9..ebac0027f8e0 100644
--- a/drivers/mfd/wm831x-otp.c
+++ b/drivers/mfd/wm831x-otp.c
@@ -47,20 +47,14 @@ static ssize_t wm831x_unique_id_show(struct device *dev,
47 struct device_attribute *attr, char *buf) 47 struct device_attribute *attr, char *buf)
48{ 48{
49 struct wm831x *wm831x = dev_get_drvdata(dev); 49 struct wm831x *wm831x = dev_get_drvdata(dev);
50 int i, rval; 50 int rval;
51 char id[WM831X_UNIQUE_ID_LEN]; 51 char id[WM831X_UNIQUE_ID_LEN];
52 ssize_t ret = 0;
53 52
54 rval = wm831x_unique_id_read(wm831x, id); 53 rval = wm831x_unique_id_read(wm831x, id);
55 if (rval < 0) 54 if (rval < 0)
56 return 0; 55 return 0;
57 56
58 for (i = 0; i < WM831X_UNIQUE_ID_LEN; i++) 57 return sprintf(buf, "%*phN\n", WM831X_UNIQUE_ID_LEN, id);
59 ret += sprintf(&buf[ret], "%02x", buf[i]);
60
61 ret += sprintf(&buf[ret], "\n");
62
63 return ret;
64} 58}
65 59
66static DEVICE_ATTR(unique_id, 0444, wm831x_unique_id_show, NULL); 60static DEVICE_ATTR(unique_id, 0444, wm831x_unique_id_show, NULL);
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 8df0b0e62976..2805b014ae31 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -588,10 +588,10 @@ config REGULATOR_S2MPA01
588 via I2C bus. S2MPA01 has 10 Bucks and 26 LDO outputs. 588 via I2C bus. S2MPA01 has 10 Bucks and 26 LDO outputs.
589 589
590config REGULATOR_S2MPS11 590config REGULATOR_S2MPS11
591 tristate "Samsung S2MPS11/S2MPS13/S2MPS14/S2MPU02 voltage regulator" 591 tristate "Samsung S2MPS11/13/14/15/S2MPU02 voltage regulator"
592 depends on MFD_SEC_CORE 592 depends on MFD_SEC_CORE
593 help 593 help
594 This driver supports a Samsung S2MPS11/S2MPS13/S2MPS14/S2MPU02 voltage 594 This driver supports a Samsung S2MPS11/13/14/15/S2MPU02 voltage
595 output regulator via I2C bus. The chip is comprised of high efficient 595 output regulator via I2C bus. The chip is comprised of high efficient
596 Buck converters including Dual-Phase Buck converter, Buck-Boost 596 Buck converters including Dual-Phase Buck converter, Buck-Boost
597 converter, various LDOs. 597 converter, various LDOs.
diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c
index 72fc3c32db49..3242ffc0cb25 100644
--- a/drivers/regulator/s2mps11.c
+++ b/drivers/regulator/s2mps11.c
@@ -32,6 +32,7 @@
32#include <linux/mfd/samsung/s2mps11.h> 32#include <linux/mfd/samsung/s2mps11.h>
33#include <linux/mfd/samsung/s2mps13.h> 33#include <linux/mfd/samsung/s2mps13.h>
34#include <linux/mfd/samsung/s2mps14.h> 34#include <linux/mfd/samsung/s2mps14.h>
35#include <linux/mfd/samsung/s2mps15.h>
35#include <linux/mfd/samsung/s2mpu02.h> 36#include <linux/mfd/samsung/s2mpu02.h>
36 37
37/* The highest number of possible regulators for supported devices. */ 38/* The highest number of possible regulators for supported devices. */
@@ -661,6 +662,133 @@ static const struct regulator_desc s2mps14_regulators[] = {
661 S2MPS14_BUCK1235_START_SEL), 662 S2MPS14_BUCK1235_START_SEL),
662}; 663};
663 664
665static struct regulator_ops s2mps15_reg_ldo_ops = {
666 .list_voltage = regulator_list_voltage_linear_range,
667 .map_voltage = regulator_map_voltage_linear_range,
668 .is_enabled = regulator_is_enabled_regmap,
669 .enable = regulator_enable_regmap,
670 .disable = regulator_disable_regmap,
671 .get_voltage_sel = regulator_get_voltage_sel_regmap,
672 .set_voltage_sel = regulator_set_voltage_sel_regmap,
673};
674
675static struct regulator_ops s2mps15_reg_buck_ops = {
676 .list_voltage = regulator_list_voltage_linear_range,
677 .map_voltage = regulator_map_voltage_linear_range,
678 .is_enabled = regulator_is_enabled_regmap,
679 .enable = regulator_enable_regmap,
680 .disable = regulator_disable_regmap,
681 .get_voltage_sel = regulator_get_voltage_sel_regmap,
682 .set_voltage_sel = regulator_set_voltage_sel_regmap,
683 .set_voltage_time_sel = regulator_set_voltage_time_sel,
684};
685
686#define regulator_desc_s2mps15_ldo(num, range) { \
687 .name = "LDO"#num, \
688 .id = S2MPS15_LDO##num, \
689 .ops = &s2mps15_reg_ldo_ops, \
690 .type = REGULATOR_VOLTAGE, \
691 .owner = THIS_MODULE, \
692 .linear_ranges = range, \
693 .n_linear_ranges = ARRAY_SIZE(range), \
694 .n_voltages = S2MPS15_LDO_N_VOLTAGES, \
695 .vsel_reg = S2MPS15_REG_L1CTRL + num - 1, \
696 .vsel_mask = S2MPS15_LDO_VSEL_MASK, \
697 .enable_reg = S2MPS15_REG_L1CTRL + num - 1, \
698 .enable_mask = S2MPS15_ENABLE_MASK \
699}
700
701#define regulator_desc_s2mps15_buck(num, range) { \
702 .name = "BUCK"#num, \
703 .id = S2MPS15_BUCK##num, \
704 .ops = &s2mps15_reg_buck_ops, \
705 .type = REGULATOR_VOLTAGE, \
706 .owner = THIS_MODULE, \
707 .linear_ranges = range, \
708 .n_linear_ranges = ARRAY_SIZE(range), \
709 .ramp_delay = 12500, \
710 .n_voltages = S2MPS15_BUCK_N_VOLTAGES, \
711 .vsel_reg = S2MPS15_REG_B1CTRL2 + ((num - 1) * 2), \
712 .vsel_mask = S2MPS15_BUCK_VSEL_MASK, \
713 .enable_reg = S2MPS15_REG_B1CTRL1 + ((num - 1) * 2), \
714 .enable_mask = S2MPS15_ENABLE_MASK \
715}
716
717/* voltage range for s2mps15 LDO 3, 5, 15, 16, 18, 20, 23 and 27 */
718static const struct regulator_linear_range s2mps15_ldo_voltage_ranges1[] = {
719 REGULATOR_LINEAR_RANGE(1000000, 0xc, 0x38, 25000),
720};
721
722/* voltage range for s2mps15 LDO 2, 6, 14, 17, 19, 21, 24 and 25 */
723static const struct regulator_linear_range s2mps15_ldo_voltage_ranges2[] = {
724 REGULATOR_LINEAR_RANGE(1800000, 0x0, 0x3f, 25000),
725};
726
727/* voltage range for s2mps15 LDO 4, 11, 12, 13, 22 and 26 */
728static const struct regulator_linear_range s2mps15_ldo_voltage_ranges3[] = {
729 REGULATOR_LINEAR_RANGE(700000, 0x0, 0x34, 12500),
730};
731
732/* voltage range for s2mps15 LDO 7, 8, 9 and 10 */
733static const struct regulator_linear_range s2mps15_ldo_voltage_ranges4[] = {
734 REGULATOR_LINEAR_RANGE(700000, 0xc, 0x18, 25000),
735};
736
737/* voltage range for s2mps15 LDO 1 */
738static const struct regulator_linear_range s2mps15_ldo_voltage_ranges5[] = {
739 REGULATOR_LINEAR_RANGE(500000, 0x0, 0x20, 12500),
740};
741
742/* voltage range for s2mps15 BUCK 1, 2, 3, 4, 5, 6 and 7 */
743static const struct regulator_linear_range s2mps15_buck_voltage_ranges1[] = {
744 REGULATOR_LINEAR_RANGE(500000, 0x20, 0xb0, 6250),
745};
746
747/* voltage range for s2mps15 BUCK 8, 9 and 10 */
748static const struct regulator_linear_range s2mps15_buck_voltage_ranges2[] = {
749 REGULATOR_LINEAR_RANGE(1000000, 0x20, 0xc0, 12500),
750};
751
752static const struct regulator_desc s2mps15_regulators[] = {
753 regulator_desc_s2mps15_ldo(1, s2mps15_ldo_voltage_ranges5),
754 regulator_desc_s2mps15_ldo(2, s2mps15_ldo_voltage_ranges2),
755 regulator_desc_s2mps15_ldo(3, s2mps15_ldo_voltage_ranges1),
756 regulator_desc_s2mps15_ldo(4, s2mps15_ldo_voltage_ranges3),
757 regulator_desc_s2mps15_ldo(5, s2mps15_ldo_voltage_ranges1),
758 regulator_desc_s2mps15_ldo(6, s2mps15_ldo_voltage_ranges2),
759 regulator_desc_s2mps15_ldo(7, s2mps15_ldo_voltage_ranges4),
760 regulator_desc_s2mps15_ldo(8, s2mps15_ldo_voltage_ranges4),
761 regulator_desc_s2mps15_ldo(9, s2mps15_ldo_voltage_ranges4),
762 regulator_desc_s2mps15_ldo(10, s2mps15_ldo_voltage_ranges4),
763 regulator_desc_s2mps15_ldo(11, s2mps15_ldo_voltage_ranges3),
764 regulator_desc_s2mps15_ldo(12, s2mps15_ldo_voltage_ranges3),
765 regulator_desc_s2mps15_ldo(13, s2mps15_ldo_voltage_ranges3),
766 regulator_desc_s2mps15_ldo(14, s2mps15_ldo_voltage_ranges2),
767 regulator_desc_s2mps15_ldo(15, s2mps15_ldo_voltage_ranges1),
768 regulator_desc_s2mps15_ldo(16, s2mps15_ldo_voltage_ranges1),
769 regulator_desc_s2mps15_ldo(17, s2mps15_ldo_voltage_ranges2),
770 regulator_desc_s2mps15_ldo(18, s2mps15_ldo_voltage_ranges1),
771 regulator_desc_s2mps15_ldo(19, s2mps15_ldo_voltage_ranges2),
772 regulator_desc_s2mps15_ldo(20, s2mps15_ldo_voltage_ranges1),
773 regulator_desc_s2mps15_ldo(21, s2mps15_ldo_voltage_ranges2),
774 regulator_desc_s2mps15_ldo(22, s2mps15_ldo_voltage_ranges3),
775 regulator_desc_s2mps15_ldo(23, s2mps15_ldo_voltage_ranges1),
776 regulator_desc_s2mps15_ldo(24, s2mps15_ldo_voltage_ranges2),
777 regulator_desc_s2mps15_ldo(25, s2mps15_ldo_voltage_ranges2),
778 regulator_desc_s2mps15_ldo(26, s2mps15_ldo_voltage_ranges3),
779 regulator_desc_s2mps15_ldo(27, s2mps15_ldo_voltage_ranges1),
780 regulator_desc_s2mps15_buck(1, s2mps15_buck_voltage_ranges1),
781 regulator_desc_s2mps15_buck(2, s2mps15_buck_voltage_ranges1),
782 regulator_desc_s2mps15_buck(3, s2mps15_buck_voltage_ranges1),
783 regulator_desc_s2mps15_buck(4, s2mps15_buck_voltage_ranges1),
784 regulator_desc_s2mps15_buck(5, s2mps15_buck_voltage_ranges1),
785 regulator_desc_s2mps15_buck(6, s2mps15_buck_voltage_ranges1),
786 regulator_desc_s2mps15_buck(7, s2mps15_buck_voltage_ranges1),
787 regulator_desc_s2mps15_buck(8, s2mps15_buck_voltage_ranges2),
788 regulator_desc_s2mps15_buck(9, s2mps15_buck_voltage_ranges2),
789 regulator_desc_s2mps15_buck(10, s2mps15_buck_voltage_ranges2),
790};
791
664static int s2mps14_pmic_enable_ext_control(struct s2mps11_info *s2mps11, 792static int s2mps14_pmic_enable_ext_control(struct s2mps11_info *s2mps11,
665 struct regulator_dev *rdev) 793 struct regulator_dev *rdev)
666{ 794{
@@ -974,6 +1102,10 @@ static int s2mps11_pmic_probe(struct platform_device *pdev)
974 regulators = s2mps14_regulators; 1102 regulators = s2mps14_regulators;
975 BUILD_BUG_ON(S2MPS_REGULATOR_MAX < s2mps11->rdev_num); 1103 BUILD_BUG_ON(S2MPS_REGULATOR_MAX < s2mps11->rdev_num);
976 break; 1104 break;
1105 case S2MPS15X:
1106 s2mps11->rdev_num = ARRAY_SIZE(s2mps15_regulators);
1107 regulators = s2mps15_regulators;
1108 break;
977 case S2MPU02: 1109 case S2MPU02:
978 s2mps11->rdev_num = ARRAY_SIZE(s2mpu02_regulators); 1110 s2mps11->rdev_num = ARRAY_SIZE(s2mpu02_regulators);
979 regulators = s2mpu02_regulators; 1111 regulators = s2mpu02_regulators;
@@ -1067,10 +1199,11 @@ out:
1067} 1199}
1068 1200
1069static const struct platform_device_id s2mps11_pmic_id[] = { 1201static const struct platform_device_id s2mps11_pmic_id[] = {
1070 { "s2mps11-pmic", S2MPS11X}, 1202 { "s2mps11-regulator", S2MPS11X},
1071 { "s2mps13-pmic", S2MPS13X}, 1203 { "s2mps13-regulator", S2MPS13X},
1072 { "s2mps14-pmic", S2MPS14X}, 1204 { "s2mps14-regulator", S2MPS14X},
1073 { "s2mpu02-pmic", S2MPU02}, 1205 { "s2mps15-regulator", S2MPS15X},
1206 { "s2mpu02-regulator", S2MPU02},
1074 { }, 1207 { },
1075}; 1208};
1076MODULE_DEVICE_TABLE(platform, s2mps11_pmic_id); 1209MODULE_DEVICE_TABLE(platform, s2mps11_pmic_id);
@@ -1097,5 +1230,5 @@ module_exit(s2mps11_pmic_exit);
1097 1230
1098/* Module information */ 1231/* Module information */
1099MODULE_AUTHOR("Sangbeom Kim <sbkim73@samsung.com>"); 1232MODULE_AUTHOR("Sangbeom Kim <sbkim73@samsung.com>");
1100MODULE_DESCRIPTION("SAMSUNG S2MPS11/S2MPS14/S2MPU02 Regulator Driver"); 1233MODULE_DESCRIPTION("SAMSUNG S2MPS11/S2MPS14/S2MPS15/S2MPU02 Regulator Driver");
1101MODULE_LICENSE("GPL"); 1234MODULE_LICENSE("GPL");
diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c
index f2504b4eef34..0d68a85dd429 100644
--- a/drivers/rtc/rtc-s5m.c
+++ b/drivers/rtc/rtc-s5m.c
@@ -188,6 +188,7 @@ static inline int s5m_check_peding_alarm_interrupt(struct s5m_rtc_info *info,
188 ret = regmap_read(info->regmap, S5M_RTC_STATUS, &val); 188 ret = regmap_read(info->regmap, S5M_RTC_STATUS, &val);
189 val &= S5M_ALARM0_STATUS; 189 val &= S5M_ALARM0_STATUS;
190 break; 190 break;
191 case S2MPS15X:
191 case S2MPS14X: 192 case S2MPS14X:
192 case S2MPS13X: 193 case S2MPS13X:
193 ret = regmap_read(info->s5m87xx->regmap_pmic, S2MPS14_REG_ST2, 194 ret = regmap_read(info->s5m87xx->regmap_pmic, S2MPS14_REG_ST2,
@@ -219,9 +220,22 @@ static inline int s5m8767_rtc_set_time_reg(struct s5m_rtc_info *info)
219 return ret; 220 return ret;
220 } 221 }
221 222
222 data |= info->regs->rtc_udr_mask; 223 switch (info->device_type) {
223 if (info->device_type == S5M8763X || info->device_type == S5M8767X) 224 case S5M8763X:
224 data |= S5M_RTC_TIME_EN_MASK; 225 case S5M8767X:
226 data |= info->regs->rtc_udr_mask | S5M_RTC_TIME_EN_MASK;
227 case S2MPS15X:
228 /* As per UM, for write time register, set WUDR bit to high */
229 data |= S2MPS15_RTC_WUDR_MASK;
230 break;
231 case S2MPS14X:
232 case S2MPS13X:
233 data |= info->regs->rtc_udr_mask;
234 break;
235 default:
236 return -EINVAL;
237 }
238
225 239
226 ret = regmap_write(info->regmap, info->regs->rtc_udr_update, data); 240 ret = regmap_write(info->regmap, info->regs->rtc_udr_update, data);
227 if (ret < 0) { 241 if (ret < 0) {
@@ -252,6 +266,11 @@ static inline int s5m8767_rtc_set_alarm_reg(struct s5m_rtc_info *info)
252 case S5M8767X: 266 case S5M8767X:
253 data &= ~S5M_RTC_TIME_EN_MASK; 267 data &= ~S5M_RTC_TIME_EN_MASK;
254 break; 268 break;
269 case S2MPS15X:
270 /* As per UM, for write alarm, set A_UDR(bit[4]) to high
271 * rtc_udr_mask above sets bit[4]
272 */
273 break;
255 case S2MPS14X: 274 case S2MPS14X:
256 data |= S2MPS_RTC_RUDR_MASK; 275 data |= S2MPS_RTC_RUDR_MASK;
257 break; 276 break;
@@ -317,7 +336,8 @@ static int s5m_rtc_read_time(struct device *dev, struct rtc_time *tm)
317 u8 data[info->regs->regs_count]; 336 u8 data[info->regs->regs_count];
318 int ret; 337 int ret;
319 338
320 if (info->device_type == S2MPS14X || info->device_type == S2MPS13X) { 339 if (info->device_type == S2MPS15X || info->device_type == S2MPS14X ||
340 info->device_type == S2MPS13X) {
321 ret = regmap_update_bits(info->regmap, 341 ret = regmap_update_bits(info->regmap,
322 info->regs->rtc_udr_update, 342 info->regs->rtc_udr_update,
323 S2MPS_RTC_RUDR_MASK, S2MPS_RTC_RUDR_MASK); 343 S2MPS_RTC_RUDR_MASK, S2MPS_RTC_RUDR_MASK);
@@ -339,6 +359,7 @@ static int s5m_rtc_read_time(struct device *dev, struct rtc_time *tm)
339 break; 359 break;
340 360
341 case S5M8767X: 361 case S5M8767X:
362 case S2MPS15X:
342 case S2MPS14X: 363 case S2MPS14X:
343 case S2MPS13X: 364 case S2MPS13X:
344 s5m8767_data_to_tm(data, tm, info->rtc_24hr_mode); 365 s5m8767_data_to_tm(data, tm, info->rtc_24hr_mode);
@@ -366,6 +387,7 @@ static int s5m_rtc_set_time(struct device *dev, struct rtc_time *tm)
366 s5m8763_tm_to_data(tm, data); 387 s5m8763_tm_to_data(tm, data);
367 break; 388 break;
368 case S5M8767X: 389 case S5M8767X:
390 case S2MPS15X:
369 case S2MPS14X: 391 case S2MPS14X:
370 case S2MPS13X: 392 case S2MPS13X:
371 ret = s5m8767_tm_to_data(tm, data); 393 ret = s5m8767_tm_to_data(tm, data);
@@ -414,6 +436,7 @@ static int s5m_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
414 break; 436 break;
415 437
416 case S5M8767X: 438 case S5M8767X:
439 case S2MPS15X:
417 case S2MPS14X: 440 case S2MPS14X:
418 case S2MPS13X: 441 case S2MPS13X:
419 s5m8767_data_to_tm(data, &alrm->time, info->rtc_24hr_mode); 442 s5m8767_data_to_tm(data, &alrm->time, info->rtc_24hr_mode);
@@ -463,6 +486,7 @@ static int s5m_rtc_stop_alarm(struct s5m_rtc_info *info)
463 break; 486 break;
464 487
465 case S5M8767X: 488 case S5M8767X:
489 case S2MPS15X:
466 case S2MPS14X: 490 case S2MPS14X:
467 case S2MPS13X: 491 case S2MPS13X:
468 for (i = 0; i < info->regs->regs_count; i++) 492 for (i = 0; i < info->regs->regs_count; i++)
@@ -508,6 +532,7 @@ static int s5m_rtc_start_alarm(struct s5m_rtc_info *info)
508 break; 532 break;
509 533
510 case S5M8767X: 534 case S5M8767X:
535 case S2MPS15X:
511 case S2MPS14X: 536 case S2MPS14X:
512 case S2MPS13X: 537 case S2MPS13X:
513 data[RTC_SEC] |= ALARM_ENABLE_MASK; 538 data[RTC_SEC] |= ALARM_ENABLE_MASK;
@@ -548,6 +573,7 @@ static int s5m_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
548 break; 573 break;
549 574
550 case S5M8767X: 575 case S5M8767X:
576 case S2MPS15X:
551 case S2MPS14X: 577 case S2MPS14X:
552 case S2MPS13X: 578 case S2MPS13X:
553 s5m8767_tm_to_data(&alrm->time, data); 579 s5m8767_tm_to_data(&alrm->time, data);
@@ -631,6 +657,7 @@ static int s5m8767_rtc_init_reg(struct s5m_rtc_info *info)
631 ret = regmap_raw_write(info->regmap, S5M_ALARM0_CONF, data, 2); 657 ret = regmap_raw_write(info->regmap, S5M_ALARM0_CONF, data, 2);
632 break; 658 break;
633 659
660 case S2MPS15X:
634 case S2MPS14X: 661 case S2MPS14X:
635 case S2MPS13X: 662 case S2MPS13X:
636 data[0] = (0 << BCD_EN_SHIFT) | (1 << MODEL24_SHIFT); 663 data[0] = (0 << BCD_EN_SHIFT) | (1 << MODEL24_SHIFT);
@@ -679,6 +706,7 @@ static int s5m_rtc_probe(struct platform_device *pdev)
679 return -ENOMEM; 706 return -ENOMEM;
680 707
681 switch (platform_get_device_id(pdev)->driver_data) { 708 switch (platform_get_device_id(pdev)->driver_data) {
709 case S2MPS15X:
682 case S2MPS14X: 710 case S2MPS14X:
683 case S2MPS13X: 711 case S2MPS13X:
684 regmap_cfg = &s2mps14_rtc_regmap_config; 712 regmap_cfg = &s2mps14_rtc_regmap_config;
@@ -805,6 +833,7 @@ static const struct platform_device_id s5m_rtc_id[] = {
805 { "s5m-rtc", S5M8767X }, 833 { "s5m-rtc", S5M8767X },
806 { "s2mps13-rtc", S2MPS13X }, 834 { "s2mps13-rtc", S2MPS13X },
807 { "s2mps14-rtc", S2MPS14X }, 835 { "s2mps14-rtc", S2MPS14X },
836 { "s2mps15-rtc", S2MPS15X },
808 { }, 837 { },
809}; 838};
810MODULE_DEVICE_TABLE(platform, s5m_rtc_id); 839MODULE_DEVICE_TABLE(platform, s5m_rtc_id);
diff --git a/include/linux/mfd/arizona/core.h b/include/linux/mfd/arizona/core.h
index 79e607e2f081..d55a42297d49 100644
--- a/include/linux/mfd/arizona/core.h
+++ b/include/linux/mfd/arizona/core.h
@@ -27,6 +27,8 @@ enum arizona_type {
27 WM8280 = 4, 27 WM8280 = 4,
28 WM8998 = 5, 28 WM8998 = 5,
29 WM1814 = 6, 29 WM1814 = 6,
30 WM1831 = 7,
31 CS47L24 = 8,
30}; 32};
31 33
32#define ARIZONA_IRQ_GP1 0 34#define ARIZONA_IRQ_GP1 0
@@ -166,6 +168,7 @@ static inline int wm5102_patch(struct arizona *arizona)
166#endif 168#endif
167 169
168int wm5110_patch(struct arizona *arizona); 170int wm5110_patch(struct arizona *arizona);
171int cs47l24_patch(struct arizona *arizona);
169int wm8997_patch(struct arizona *arizona); 172int wm8997_patch(struct arizona *arizona);
170int wm8998_patch(struct arizona *arizona); 173int wm8998_patch(struct arizona *arizona);
171 174
diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h
index 57b45caaea80..64faeeff698c 100644
--- a/include/linux/mfd/arizona/pdata.h
+++ b/include/linux/mfd/arizona/pdata.h
@@ -171,7 +171,7 @@ struct arizona_pdata {
171 int inmode[ARIZONA_MAX_INPUT]; 171 int inmode[ARIZONA_MAX_INPUT];
172 172
173 /** Mode for outputs */ 173 /** Mode for outputs */
174 bool out_mono[ARIZONA_MAX_OUTPUT]; 174 int out_mono[ARIZONA_MAX_OUTPUT];
175 175
176 /** PDM speaker mute setting */ 176 /** PDM speaker mute setting */
177 unsigned int spk_mute[ARIZONA_MAX_PDM_SPK]; 177 unsigned int spk_mute[ARIZONA_MAX_PDM_SPK];
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h
index a06098639399..6bc4bcd488ac 100644
--- a/include/linux/mfd/samsung/core.h
+++ b/include/linux/mfd/samsung/core.h
@@ -44,6 +44,7 @@ enum sec_device_type {
44 S2MPS11X, 44 S2MPS11X,
45 S2MPS13X, 45 S2MPS13X,
46 S2MPS14X, 46 S2MPS14X,
47 S2MPS15X,
47 S2MPU02, 48 S2MPU02,
48}; 49};
49 50
diff --git a/include/linux/mfd/samsung/rtc.h b/include/linux/mfd/samsung/rtc.h
index 29c30ac36020..a65e4655d470 100644
--- a/include/linux/mfd/samsung/rtc.h
+++ b/include/linux/mfd/samsung/rtc.h
@@ -107,6 +107,8 @@ enum s2mps_rtc_reg {
107#define S2MPS_RTC_WUDR_MASK (1 << S2MPS_RTC_WUDR_SHIFT) 107#define S2MPS_RTC_WUDR_MASK (1 << S2MPS_RTC_WUDR_SHIFT)
108#define S2MPS13_RTC_AUDR_SHIFT 1 108#define S2MPS13_RTC_AUDR_SHIFT 1
109#define S2MPS13_RTC_AUDR_MASK (1 << S2MPS13_RTC_AUDR_SHIFT) 109#define S2MPS13_RTC_AUDR_MASK (1 << S2MPS13_RTC_AUDR_SHIFT)
110#define S2MPS15_RTC_WUDR_SHIFT 1
111#define S2MPS15_RTC_WUDR_MASK (1 << S2MPS15_RTC_WUDR_SHIFT)
110#define S2MPS_RTC_RUDR_SHIFT 0 112#define S2MPS_RTC_RUDR_SHIFT 0
111#define S2MPS_RTC_RUDR_MASK (1 << S2MPS_RTC_RUDR_SHIFT) 113#define S2MPS_RTC_RUDR_MASK (1 << S2MPS_RTC_RUDR_SHIFT)
112#define RTC_TCON_SHIFT 1 114#define RTC_TCON_SHIFT 1
diff --git a/include/linux/mfd/samsung/s2mps15.h b/include/linux/mfd/samsung/s2mps15.h
new file mode 100644
index 000000000000..36d35287c3c0
--- /dev/null
+++ b/include/linux/mfd/samsung/s2mps15.h
@@ -0,0 +1,158 @@
1/*
2 * Copyright (c) 2015 Samsung Electronics Co., Ltd
3 * http://www.samsung.com
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#ifndef __LINUX_MFD_S2MPS15_H
17#define __LINUX_MFD_S2MPS15_H
18
19/* S2MPS15 registers */
20enum s2mps15_reg {
21 S2MPS15_REG_ID,
22 S2MPS15_REG_INT1,
23 S2MPS15_REG_INT2,
24 S2MPS15_REG_INT3,
25 S2MPS15_REG_INT1M,
26 S2MPS15_REG_INT2M,
27 S2MPS15_REG_INT3M,
28 S2MPS15_REG_ST1,
29 S2MPS15_REG_ST2,
30 S2MPS15_REG_PWRONSRC,
31 S2MPS15_REG_OFFSRC,
32 S2MPS15_REG_BU_CHG,
33 S2MPS15_REG_RTC_BUF,
34 S2MPS15_REG_CTRL1,
35 S2MPS15_REG_CTRL2,
36 S2MPS15_REG_RSVD1,
37 S2MPS15_REG_RSVD2,
38 S2MPS15_REG_RSVD3,
39 S2MPS15_REG_RSVD4,
40 S2MPS15_REG_RSVD5,
41 S2MPS15_REG_RSVD6,
42 S2MPS15_REG_CTRL3,
43 S2MPS15_REG_RSVD7,
44 S2MPS15_REG_RSVD8,
45 S2MPS15_REG_RSVD9,
46 S2MPS15_REG_B1CTRL1,
47 S2MPS15_REG_B1CTRL2,
48 S2MPS15_REG_B2CTRL1,
49 S2MPS15_REG_B2CTRL2,
50 S2MPS15_REG_B3CTRL1,
51 S2MPS15_REG_B3CTRL2,
52 S2MPS15_REG_B4CTRL1,
53 S2MPS15_REG_B4CTRL2,
54 S2MPS15_REG_B5CTRL1,
55 S2MPS15_REG_B5CTRL2,
56 S2MPS15_REG_B6CTRL1,
57 S2MPS15_REG_B6CTRL2,
58 S2MPS15_REG_B7CTRL1,
59 S2MPS15_REG_B7CTRL2,
60 S2MPS15_REG_B8CTRL1,
61 S2MPS15_REG_B8CTRL2,
62 S2MPS15_REG_B9CTRL1,
63 S2MPS15_REG_B9CTRL2,
64 S2MPS15_REG_B10CTRL1,
65 S2MPS15_REG_B10CTRL2,
66 S2MPS15_REG_BBCTRL1,
67 S2MPS15_REG_BBCTRL2,
68 S2MPS15_REG_BRAMP,
69 S2MPS15_REG_LDODVS1,
70 S2MPS15_REG_LDODVS2,
71 S2MPS15_REG_LDODVS3,
72 S2MPS15_REG_LDODVS4,
73 S2MPS15_REG_L1CTRL,
74 S2MPS15_REG_L2CTRL,
75 S2MPS15_REG_L3CTRL,
76 S2MPS15_REG_L4CTRL,
77 S2MPS15_REG_L5CTRL,
78 S2MPS15_REG_L6CTRL,
79 S2MPS15_REG_L7CTRL,
80 S2MPS15_REG_L8CTRL,
81 S2MPS15_REG_L9CTRL,
82 S2MPS15_REG_L10CTRL,
83 S2MPS15_REG_L11CTRL,
84 S2MPS15_REG_L12CTRL,
85 S2MPS15_REG_L13CTRL,
86 S2MPS15_REG_L14CTRL,
87 S2MPS15_REG_L15CTRL,
88 S2MPS15_REG_L16CTRL,
89 S2MPS15_REG_L17CTRL,
90 S2MPS15_REG_L18CTRL,
91 S2MPS15_REG_L19CTRL,
92 S2MPS15_REG_L20CTRL,
93 S2MPS15_REG_L21CTRL,
94 S2MPS15_REG_L22CTRL,
95 S2MPS15_REG_L23CTRL,
96 S2MPS15_REG_L24CTRL,
97 S2MPS15_REG_L25CTRL,
98 S2MPS15_REG_L26CTRL,
99 S2MPS15_REG_L27CTRL,
100 S2MPS15_REG_LDODSCH1,
101 S2MPS15_REG_LDODSCH2,
102 S2MPS15_REG_LDODSCH3,
103 S2MPS15_REG_LDODSCH4,
104};
105
106/* S2MPS15 regulator ids */
107enum s2mps15_regulators {
108 S2MPS15_LDO1,
109 S2MPS15_LDO2,
110 S2MPS15_LDO3,
111 S2MPS15_LDO4,
112 S2MPS15_LDO5,
113 S2MPS15_LDO6,
114 S2MPS15_LDO7,
115 S2MPS15_LDO8,
116 S2MPS15_LDO9,
117 S2MPS15_LDO10,
118 S2MPS15_LDO11,
119 S2MPS15_LDO12,
120 S2MPS15_LDO13,
121 S2MPS15_LDO14,
122 S2MPS15_LDO15,
123 S2MPS15_LDO16,
124 S2MPS15_LDO17,
125 S2MPS15_LDO18,
126 S2MPS15_LDO19,
127 S2MPS15_LDO20,
128 S2MPS15_LDO21,
129 S2MPS15_LDO22,
130 S2MPS15_LDO23,
131 S2MPS15_LDO24,
132 S2MPS15_LDO25,
133 S2MPS15_LDO26,
134 S2MPS15_LDO27,
135 S2MPS15_BUCK1,
136 S2MPS15_BUCK2,
137 S2MPS15_BUCK3,
138 S2MPS15_BUCK4,
139 S2MPS15_BUCK5,
140 S2MPS15_BUCK6,
141 S2MPS15_BUCK7,
142 S2MPS15_BUCK8,
143 S2MPS15_BUCK9,
144 S2MPS15_BUCK10,
145 S2MPS15_BUCK11,
146 S2MPS15_REGULATOR_MAX,
147};
148
149#define S2MPS15_LDO_VSEL_MASK (0x3F)
150#define S2MPS15_BUCK_VSEL_MASK (0xFF)
151
152#define S2MPS15_ENABLE_SHIFT (0x06)
153#define S2MPS15_ENABLE_MASK (0x03 << S2MPS15_ENABLE_SHIFT)
154
155#define S2MPS15_LDO_N_VOLTAGES (S2MPS15_LDO_VSEL_MASK + 1)
156#define S2MPS15_BUCK_N_VOLTAGES (S2MPS15_BUCK_VSEL_MASK + 1)
157
158#endif /* __LINUX_MFD_S2MPS15_H */