diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-15 00:58:16 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-15 00:58:16 -0400 |
| commit | fcc3a5d277571bc6048e7b4ef8cd391b935de629 (patch) | |
| tree | 143954c115011c657f747a0e1470973b94ab3690 | |
| parent | 50fa86172bec2769979b5eb0cd1a244391ae4bb0 (diff) | |
| parent | d86c21fd31114e3ef9fae64be335c76aa22859dc (diff) | |
Merge tag 'mfd-for-linus-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd
Pull MFD updates from Lee Jones:
"Changes to existing drivers:
- DT clean-ups in da9055-core, max14577, rn5t618, arizona, hi6421, stmpe, twl4030
- Export symbols for use in modules in max14577
- Plenty of static code analysis/Coccinelle fixes throughout the SS
- Regmap clean-ups in arizona, wm5102, wm5110, da9052, tps65217, rk808
- Remove unused/duplicate code in da9052, 88pm860x, ti_ssp, lpc_sch, arizona
- Bug fixes in ti_am335x_tscadc, da9052, ti_am335x_tscadc, rtsx_pcr
- IRQ fixups in arizona, stmpe, max14577
- Regulator related changes in axp20x
- Pass DMA coherency information from parent => child in MFD core
- Rename DT document files for consistency
- Add ACPI support to the MFD core
- Add Andreas Werner to MAINTAINERS for MEN F21BMC
New drivers/supported devices:
- New driver for MEN 14F021P00 Board Management Controller
- New driver for Ricoh RN5T618 PMIC
- New driver for Rockchip RK808
- New driver for HiSilicon Hi6421 PMIC
- New driver for Qualcomm SPMI PMICs
- Add support for Intel Braswell in lpc_ich
- Add support for Intel 9 Series PCH in lpc_ich
- Add support for Intel Quark ILB in lpc_sch"
[ Delayed to after the poweer/reset pull due to Kconfig problems with
recursive Kconfig select/depends-on chains. - Linus ]
* tag 'mfd-for-linus-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (79 commits)
mfd: cros_ec: wait for completion of commands that return IN_PROGRESS
i2c: i2c-cros-ec-tunnel: Set retries to 3
mfd: cros_ec: move locking into cros_ec_cmd_xfer
mfd: cros_ec: stop calling ->cmd_xfer() directly
mfd: cros_ec: Delay for 50ms when we see EC_CMD_REBOOT_EC
MAINTAINERS: Adds Andreas Werner to maintainers list for MEN F21BMC
mfd: arizona: Correct mask to allow setting micbias external cap
mfd: Add ACPI support
Revert "mfd: wm5102: Manually apply register patch"
mfd: ti_am335x_tscadc: Update logic in CTRL register for 5-wire TS
mfd: dt-bindings: atmel-gpbr: Rename doc file to conform to naming convention
mfd: dt-bindings: qcom-pm8xxx: Rename doc file to conform to naming convention
mfd: Inherit coherent_dma_mask from parent device
mfd: Document DT bindings for Qualcomm SPMI PMICs
mfd: Add support for Qualcomm SPMI PMICs
mfd: dt-bindings: pm8xxx: Add new compatible string
mfd: axp209x: Drop the parent supplies field
mfd: twl4030-power: Use 'ti,system-power-controller' as alternative way to support system power off
mfd: dt-bindings: twl4030-power: Use the standard property to mark power control
mfd: syscon: Add Atmel GPBR DT bindings documention
...
70 files changed, 2061 insertions, 403 deletions
diff --git a/Documentation/acpi/enumeration.txt b/Documentation/acpi/enumeration.txt index e182be5e3c83..b60d2ab69497 100644 --- a/Documentation/acpi/enumeration.txt +++ b/Documentation/acpi/enumeration.txt | |||
| @@ -312,3 +312,30 @@ a code like this: | |||
| 312 | 312 | ||
| 313 | There are also devm_* versions of these functions which release the | 313 | There are also devm_* versions of these functions which release the |
| 314 | descriptors once the device is released. | 314 | descriptors once the device is released. |
| 315 | |||
| 316 | MFD devices | ||
| 317 | ~~~~~~~~~~~ | ||
| 318 | The MFD devices register their children as platform devices. For the child | ||
| 319 | devices there needs to be an ACPI handle that they can use to reference | ||
| 320 | parts of the ACPI namespace that relate to them. In the Linux MFD subsystem | ||
| 321 | we provide two ways: | ||
| 322 | |||
| 323 | o The children share the parent ACPI handle. | ||
| 324 | o The MFD cell can specify the ACPI id of the device. | ||
| 325 | |||
| 326 | For the first case, the MFD drivers do not need to do anything. The | ||
| 327 | resulting child platform device will have its ACPI_COMPANION() set to point | ||
| 328 | to the parent device. | ||
| 329 | |||
| 330 | If the ACPI namespace has a device that we can match using an ACPI id, | ||
| 331 | the id should be set like: | ||
| 332 | |||
| 333 | static struct mfd_cell my_subdevice_cell = { | ||
| 334 | .name = "my_subdevice", | ||
| 335 | /* set the resources relative to the parent */ | ||
| 336 | .acpi_pnpid = "XYZ0001", | ||
| 337 | }; | ||
| 338 | |||
| 339 | The ACPI id "XYZ0001" is then used to lookup an ACPI device directly under | ||
| 340 | the MFD device and if found, that ACPI companion device is bound to the | ||
| 341 | resulting child platform device. | ||
diff --git a/Documentation/devicetree/bindings/mfd/arizona.txt b/Documentation/devicetree/bindings/mfd/arizona.txt index 5c7e7230984a..7bd1273f571a 100644 --- a/Documentation/devicetree/bindings/mfd/arizona.txt +++ b/Documentation/devicetree/bindings/mfd/arizona.txt | |||
| @@ -42,6 +42,13 @@ Optional properties: | |||
| 42 | the chip default will be used. If present exactly five values must | 42 | the chip default will be used. If present exactly five values must |
| 43 | be specified. | 43 | be specified. |
| 44 | 44 | ||
| 45 | - wlf,inmode : A list of INn_MODE register values, where n is the number | ||
| 46 | of input signals. Valid values are 0 (Differential), 1 (Single-ended) and | ||
| 47 | 2 (Digital Microphone). If absent, INn_MODE registers set to 0 by default. | ||
| 48 | If present, values must be specified less than or equal to the number of | ||
| 49 | input singals. If values less than the number of input signals, elements | ||
| 50 | that has not been specifed are set to 0 by default. | ||
| 51 | |||
| 45 | - DCVDD-supply, MICVDD-supply : Power supplies, only need to be specified if | 52 | - DCVDD-supply, MICVDD-supply : Power supplies, only need to be specified if |
| 46 | they are being externally supplied. As covered in | 53 | they are being externally supplied. As covered in |
| 47 | Documentation/devicetree/bindings/regulator/regulator.txt | 54 | Documentation/devicetree/bindings/regulator/regulator.txt |
diff --git a/Documentation/devicetree/bindings/mfd/atmel-gpbr.txt b/Documentation/devicetree/bindings/mfd/atmel-gpbr.txt new file mode 100644 index 000000000000..a28569540683 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/atmel-gpbr.txt | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | * Device tree bindings for Atmel GPBR (General Purpose Backup Registers) | ||
| 2 | |||
| 3 | The GPBR are a set of battery-backed registers. | ||
| 4 | |||
| 5 | Required properties: | ||
| 6 | - compatible: "atmel,at91sam9260-gpbr", "syscon" | ||
| 7 | - reg: contains offset/length value of the GPBR memory | ||
| 8 | region. | ||
| 9 | |||
| 10 | Example: | ||
| 11 | |||
| 12 | gpbr: gpbr@fffffd50 { | ||
| 13 | compatible = "atmel,at91sam9260-gpbr", "syscon"; | ||
| 14 | reg = <0xfffffd50 0x10>; | ||
| 15 | }; | ||
diff --git a/Documentation/devicetree/bindings/mfd/hi6421.txt b/Documentation/devicetree/bindings/mfd/hi6421.txt new file mode 100644 index 000000000000..0d5a4466a494 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/hi6421.txt | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | * HI6421 Multi-Functional Device (MFD), by HiSilicon Ltd. | ||
| 2 | |||
| 3 | Required parent device properties: | ||
| 4 | - compatible : contains "hisilicon,hi6421-pmic"; | ||
| 5 | - reg : register range space of hi6421; | ||
| 6 | |||
| 7 | Supported Hi6421 sub-devices include: | ||
| 8 | |||
| 9 | Device IRQ Names Supply Names Description | ||
| 10 | ------ --------- ------------ ----------- | ||
| 11 | regulators : None : None : Regulators | ||
| 12 | |||
| 13 | Required child device properties: | ||
| 14 | None. | ||
| 15 | |||
| 16 | Example: | ||
| 17 | hi6421 { | ||
| 18 | compatible = "hisilicon,hi6421-pmic"; | ||
| 19 | reg = <0xfcc00000 0x0180>; /* 0x60 << 2 */ | ||
| 20 | |||
| 21 | regulators { | ||
| 22 | // supply for MLC NAND/ eMMC | ||
| 23 | hi6421_vout0_reg: hi6421_vout0 { | ||
| 24 | regulator-name = "VOUT0"; | ||
| 25 | regulator-min-microvolt = <2850000>; | ||
| 26 | regulator-max-microvolt = <2850000>; | ||
| 27 | }; | ||
| 28 | |||
| 29 | // supply for 26M Oscillator | ||
| 30 | hi6421_vout1_reg: hi6421_vout1 { | ||
| 31 | regulator-name = "VOUT1"; | ||
| 32 | regulator-min-microvolt = <1700000>; | ||
| 33 | regulator-max-microvolt = <2000000>; | ||
| 34 | regulator-boot-on; | ||
| 35 | regulator-always-on; | ||
| 36 | }; | ||
| 37 | }; | ||
| 38 | }; | ||
diff --git a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.txt b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.txt new file mode 100644 index 000000000000..7182b8857f57 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.txt | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | Qualcomm SPMI PMICs multi-function device bindings | ||
| 2 | |||
| 3 | The Qualcomm SPMI series presently includes PM8941, PM8841 and PMA8084 | ||
| 4 | PMICs. These PMICs use a QPNP scheme through SPMI interface. | ||
| 5 | QPNP is effectively a partitioning scheme for dividing the SPMI extended | ||
| 6 | register space up into logical pieces, and set of fixed register | ||
| 7 | locations/definitions within these regions, with some of these regions | ||
| 8 | specifically used for interrupt handling. | ||
| 9 | |||
| 10 | The QPNP PMICs are used with the Qualcomm Snapdragon series SoCs, and are | ||
| 11 | interfaced to the chip via the SPMI (System Power Management Interface) bus. | ||
| 12 | Support for multiple independent functions are implemented by splitting the | ||
| 13 | 16-bit SPMI slave address space into 256 smaller fixed-size regions, 256 bytes | ||
| 14 | each. A function can consume one or more of these fixed-size register regions. | ||
| 15 | |||
| 16 | Required properties: | ||
| 17 | - compatible: Should contain one of: | ||
| 18 | "qcom,pm8941" | ||
| 19 | "qcom,pm8841" | ||
| 20 | "qcom,pma8084" | ||
| 21 | or generalized "qcom,spmi-pmic". | ||
| 22 | - reg: Specifies the SPMI USID slave address for this device. | ||
| 23 | For more information see: | ||
| 24 | Documentation/devicetree/bindings/spmi/spmi.txt | ||
| 25 | |||
| 26 | Required properties for peripheral child nodes: | ||
| 27 | - compatible: Should contain "qcom,xxx", where "xxx" is a peripheral name. | ||
| 28 | |||
| 29 | Optional properties for peripheral child nodes: | ||
| 30 | - interrupts: Interrupts are specified as a 4-tuple. For more information | ||
| 31 | see: | ||
| 32 | Documentation/devicetree/bindings/spmi/qcom,spmi-pmic-arb.txt | ||
| 33 | - interrupt-names: Corresponding interrupt name to the interrupts property | ||
| 34 | |||
| 35 | Each child node of SPMI slave id represents a function of the PMIC. In the | ||
| 36 | example below the rtc device node represents a peripheral of pm8941 | ||
| 37 | SID = 0. The regulator device node represents a peripheral of pm8941 SID = 1. | ||
| 38 | |||
| 39 | Example: | ||
| 40 | |||
| 41 | spmi { | ||
| 42 | compatible = "qcom,spmi-pmic-arb"; | ||
| 43 | |||
| 44 | pm8941@0 { | ||
| 45 | compatible = "qcom,pm8941", "qcom,spmi-pmic"; | ||
| 46 | reg = <0x0 SPMI_USID>; | ||
| 47 | |||
| 48 | rtc { | ||
| 49 | compatible = "qcom,rtc"; | ||
| 50 | interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>; | ||
| 51 | interrupt-names = "alarm"; | ||
| 52 | }; | ||
| 53 | }; | ||
| 54 | |||
| 55 | pm8941@1 { | ||
| 56 | compatible = "qcom,pm8941", "qcom,spmi-pmic"; | ||
| 57 | reg = <0x1 SPMI_USID>; | ||
| 58 | |||
| 59 | regulator { | ||
| 60 | compatible = "qcom,regulator"; | ||
| 61 | regulator-name = "8941_boost"; | ||
| 62 | }; | ||
| 63 | }; | ||
| 64 | }; | ||
diff --git a/Documentation/devicetree/bindings/mfd/qcom,pm8xxx.txt b/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.txt index 03518dc8b6bd..f24f33409164 100644 --- a/Documentation/devicetree/bindings/mfd/qcom,pm8xxx.txt +++ b/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.txt | |||
| @@ -61,6 +61,7 @@ The below bindings specify the set of valid subnodes. | |||
| 61 | Definition: must be one of: | 61 | Definition: must be one of: |
| 62 | "qcom,pm8058-rtc" | 62 | "qcom,pm8058-rtc" |
| 63 | "qcom,pm8921-rtc" | 63 | "qcom,pm8921-rtc" |
| 64 | "qcom,pm8941-rtc" | ||
| 64 | 65 | ||
| 65 | - reg: | 66 | - reg: |
| 66 | Usage: required | 67 | Usage: required |
diff --git a/Documentation/devicetree/bindings/mfd/rk808.txt b/Documentation/devicetree/bindings/mfd/rk808.txt new file mode 100644 index 000000000000..9e6e2592e5c8 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/rk808.txt | |||
| @@ -0,0 +1,177 @@ | |||
| 1 | RK808 Power Management Integrated Circuit | ||
| 2 | |||
| 3 | Required properties: | ||
| 4 | - compatible: "rockchip,rk808" | ||
| 5 | - reg: I2C slave address | ||
| 6 | - interrupt-parent: The parent interrupt controller. | ||
| 7 | - interrupts: the interrupt outputs of the controller. | ||
| 8 | - #clock-cells: from common clock binding; shall be set to 1 (multiple clock | ||
| 9 | outputs). See <dt-bindings/clock/rockchip,rk808.h> for clock IDs. | ||
| 10 | |||
| 11 | Optional properties: | ||
| 12 | - clock-output-names: From common clock binding to override the | ||
| 13 | default output clock name | ||
| 14 | - rockchip,system-power-controller: Telling whether or not this pmic is controlling | ||
| 15 | the system power. | ||
| 16 | - vcc1-supply: The input supply for DCDC_REG1 | ||
| 17 | - vcc2-supply: The input supply for DCDC_REG2 | ||
| 18 | - vcc3-supply: The input supply for DCDC_REG3 | ||
| 19 | - vcc4-supply: The input supply for DCDC_REG4 | ||
| 20 | - vcc6-supply: The input supply for LDO_REG1 and LDO_REG2 | ||
| 21 | - vcc7-supply: The input supply for LDO_REG3 and LDO_REG7 | ||
| 22 | - vcc8-supply: The input supply for SWITCH_REG1 | ||
| 23 | - vcc9-supply: The input supply for LDO_REG4 and LDO_REG5 | ||
| 24 | - vcc10-supply: The input supply for LDO_REG6 | ||
| 25 | - vcc11-supply: The input supply for LDO_REG8 | ||
| 26 | - vcc12-supply: The input supply for SWITCH_REG2 | ||
| 27 | |||
| 28 | Regulators: All the regulators of RK808 to be instantiated shall be | ||
| 29 | listed in a child node named 'regulators'. Each regulator is represented | ||
| 30 | by a child node of the 'regulators' node. | ||
| 31 | |||
| 32 | regulator-name { | ||
| 33 | /* standard regulator bindings here */ | ||
| 34 | }; | ||
| 35 | |||
| 36 | Following regulators of the RK808 PMIC block are supported. Note that | ||
| 37 | the 'n' in regulator name, as in DCDC_REGn or LDOn, represents the DCDC or LDO | ||
| 38 | number as described in RK808 datasheet. | ||
| 39 | |||
| 40 | - DCDC_REGn | ||
| 41 | - valid values for n are 1 to 4. | ||
| 42 | - LDO_REGn | ||
| 43 | - valid values for n are 1 to 8. | ||
| 44 | - SWITCH_REGn | ||
| 45 | - valid values for n are 1 to 2 | ||
| 46 | |||
| 47 | Standard regulator bindings are used inside regulator subnodes. Check | ||
| 48 | Documentation/devicetree/bindings/regulator/regulator.txt | ||
| 49 | for more details | ||
| 50 | |||
| 51 | Example: | ||
| 52 | rk808: pmic@1b { | ||
| 53 | compatible = "rockchip,rk808"; | ||
| 54 | clock-output-names = "xin32k", "rk808-clkout2"; | ||
| 55 | interrupt-parent = <&gpio0>; | ||
| 56 | interrupts = <4 IRQ_TYPE_LEVEL_LOW>; | ||
| 57 | pinctrl-names = "default"; | ||
| 58 | pinctrl-0 = <&pmic_int>; | ||
| 59 | reg = <0x1b>; | ||
| 60 | rockchip,system-power-controller; | ||
| 61 | wakeup-source; | ||
| 62 | #clock-cells = <1>; | ||
| 63 | |||
| 64 | vcc8-supply = <&vcc_18>; | ||
| 65 | vcc9-supply = <&vcc_io>; | ||
| 66 | vcc10-supply = <&vcc_io>; | ||
| 67 | vcc12-supply = <&vcc_io>; | ||
| 68 | vddio-supply = <&vccio_pmu>; | ||
| 69 | |||
| 70 | regulators { | ||
| 71 | vdd_cpu: DCDC_REG1 { | ||
| 72 | regulator-always-on; | ||
| 73 | regulator-boot-on; | ||
| 74 | regulator-min-microvolt = <750000>; | ||
| 75 | regulator-max-microvolt = <1300000>; | ||
| 76 | regulator-name = "vdd_arm"; | ||
| 77 | }; | ||
| 78 | |||
| 79 | vdd_gpu: DCDC_REG2 { | ||
| 80 | regulator-always-on; | ||
| 81 | regulator-boot-on; | ||
| 82 | regulator-min-microvolt = <850000>; | ||
| 83 | regulator-max-microvolt = <1250000>; | ||
| 84 | regulator-name = "vdd_gpu"; | ||
| 85 | }; | ||
| 86 | |||
| 87 | vcc_ddr: DCDC_REG3 { | ||
| 88 | regulator-always-on; | ||
| 89 | regulator-boot-on; | ||
| 90 | regulator-name = "vcc_ddr"; | ||
| 91 | }; | ||
| 92 | |||
| 93 | vcc_io: DCDC_REG4 { | ||
| 94 | regulator-always-on; | ||
| 95 | regulator-boot-on; | ||
| 96 | regulator-min-microvolt = <3300000>; | ||
| 97 | regulator-max-microvolt = <3300000>; | ||
| 98 | regulator-name = "vcc_io"; | ||
| 99 | }; | ||
| 100 | |||
| 101 | vccio_pmu: LDO_REG1 { | ||
| 102 | regulator-always-on; | ||
| 103 | regulator-boot-on; | ||
| 104 | regulator-min-microvolt = <3300000>; | ||
| 105 | regulator-max-microvolt = <3300000>; | ||
| 106 | regulator-name = "vccio_pmu"; | ||
| 107 | }; | ||
| 108 | |||
| 109 | vcc_tp: LDO_REG2 { | ||
| 110 | regulator-always-on; | ||
| 111 | regulator-boot-on; | ||
| 112 | regulator-min-microvolt = <3300000>; | ||
| 113 | regulator-max-microvolt = <3300000>; | ||
| 114 | regulator-name = "vcc_tp"; | ||
| 115 | }; | ||
| 116 | |||
| 117 | vdd_10: LDO_REG3 { | ||
| 118 | regulator-always-on; | ||
| 119 | regulator-boot-on; | ||
| 120 | regulator-min-microvolt = <1000000>; | ||
| 121 | regulator-max-microvolt = <1000000>; | ||
| 122 | regulator-name = "vdd_10"; | ||
| 123 | }; | ||
| 124 | |||
| 125 | vcc18_lcd: LDO_REG4 { | ||
| 126 | regulator-always-on; | ||
| 127 | regulator-boot-on; | ||
| 128 | regulator-min-microvolt = <1800000>; | ||
| 129 | regulator-max-microvolt = <1800000>; | ||
| 130 | regulator-name = "vcc18_lcd"; | ||
| 131 | }; | ||
| 132 | |||
| 133 | vccio_sd: LDO_REG5 { | ||
| 134 | regulator-always-on; | ||
| 135 | regulator-boot-on; | ||
| 136 | regulator-min-microvolt = <1800000>; | ||
| 137 | regulator-max-microvolt = <3300000>; | ||
| 138 | regulator-name = "vccio_sd"; | ||
| 139 | }; | ||
| 140 | |||
| 141 | vdd10_lcd: LDO_REG6 { | ||
| 142 | regulator-always-on; | ||
| 143 | regulator-boot-on; | ||
| 144 | regulator-min-microvolt = <1000000>; | ||
| 145 | regulator-max-microvolt = <1000000>; | ||
| 146 | regulator-name = "vdd10_lcd"; | ||
| 147 | }; | ||
| 148 | |||
| 149 | vcc_18: LDO_REG7 { | ||
| 150 | regulator-always-on; | ||
| 151 | regulator-boot-on; | ||
| 152 | regulator-min-microvolt = <1800000>; | ||
| 153 | regulator-max-microvolt = <1800000>; | ||
| 154 | regulator-name = "vcc_18"; | ||
| 155 | }; | ||
| 156 | |||
| 157 | vcca_codec: LDO_REG8 { | ||
| 158 | regulator-always-on; | ||
| 159 | regulator-boot-on; | ||
| 160 | regulator-min-microvolt = <3300000>; | ||
| 161 | regulator-max-microvolt = <3300000>; | ||
| 162 | regulator-name = "vcca_codec"; | ||
| 163 | }; | ||
| 164 | |||
| 165 | vcc_wl: SWITCH_REG1 { | ||
| 166 | regulator-always-on; | ||
| 167 | regulator-boot-on; | ||
| 168 | regulator-name = "vcc_wl"; | ||
| 169 | }; | ||
| 170 | |||
| 171 | vcc_lcd: SWITCH_REG2 { | ||
| 172 | regulator-always-on; | ||
| 173 | regulator-boot-on; | ||
| 174 | regulator-name = "vcc_lcd"; | ||
| 175 | }; | ||
| 176 | }; | ||
| 177 | }; | ||
diff --git a/Documentation/devicetree/bindings/mfd/rn5t618.txt b/Documentation/devicetree/bindings/mfd/rn5t618.txt new file mode 100644 index 000000000000..937785a3eddc --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/rn5t618.txt | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | * Ricoh RN5T618 PMIC | ||
| 2 | |||
| 3 | Ricoh RN5T618 is a power management IC which integrates 3 step-down | ||
| 4 | DCDC converters, 7 low-dropout regulators, a Li-ion battery charger, | ||
| 5 | fuel gauge, ADC, GPIOs and a watchdog timer. It can be controlled | ||
| 6 | through a I2C interface. | ||
| 7 | |||
| 8 | Required properties: | ||
| 9 | - compatible: should be "ricoh,rn5t618" | ||
| 10 | - reg: the I2C slave address of the device | ||
| 11 | |||
| 12 | Sub-nodes: | ||
| 13 | - regulators: the node is required if the regulator functionality is | ||
| 14 | needed. The valid regulator names are: DCDC1, DCDC2, DCDC3, LDO1, | ||
| 15 | LDO2, LDO3, LDO4, LDO5, LDORTC1 and LDORTC2. | ||
| 16 | The common bindings for each individual regulator can be found in: | ||
| 17 | Documentation/devicetree/bindings/regulator/regulator.txt | ||
| 18 | |||
| 19 | Example: | ||
| 20 | |||
| 21 | pmic@32 { | ||
| 22 | compatible = "ricoh,rn5t618"; | ||
| 23 | reg = <0x32>; | ||
| 24 | |||
| 25 | regulators { | ||
| 26 | DCDC1 { | ||
| 27 | regulator-min-microvolt = <1050000>; | ||
| 28 | regulator-max-microvolt = <1050000>; | ||
| 29 | }; | ||
| 30 | |||
| 31 | DCDC2 { | ||
| 32 | regulator-min-microvolt = <1175000>; | ||
| 33 | regulator-max-microvolt = <1175000>; | ||
| 34 | }; | ||
| 35 | }; | ||
| 36 | }; | ||
diff --git a/Documentation/devicetree/bindings/mfd/stmpe.txt b/Documentation/devicetree/bindings/mfd/stmpe.txt index 56edb5520685..3fb68bfefc8b 100644 --- a/Documentation/devicetree/bindings/mfd/stmpe.txt +++ b/Documentation/devicetree/bindings/mfd/stmpe.txt | |||
| @@ -13,6 +13,7 @@ Optional properties: | |||
| 13 | - interrupt-parent : Specifies which IRQ controller we're connected to | 13 | - interrupt-parent : Specifies which IRQ controller we're connected to |
| 14 | - wakeup-source : Marks the input device as wakable | 14 | - wakeup-source : Marks the input device as wakable |
| 15 | - st,autosleep-timeout : Valid entries (ms); 4, 16, 32, 64, 128, 256, 512 and 1024 | 15 | - st,autosleep-timeout : Valid entries (ms); 4, 16, 32, 64, 128, 256, 512 and 1024 |
| 16 | - irq-gpio : If present, which GPIO to use for event IRQ | ||
| 16 | 17 | ||
| 17 | Example: | 18 | Example: |
| 18 | 19 | ||
diff --git a/Documentation/devicetree/bindings/mfd/twl4030-power.txt b/Documentation/devicetree/bindings/mfd/twl4030-power.txt index b9ee7b98d3e2..3d19963312ce 100644 --- a/Documentation/devicetree/bindings/mfd/twl4030-power.txt +++ b/Documentation/devicetree/bindings/mfd/twl4030-power.txt | |||
| @@ -23,8 +23,13 @@ down during off-idle. Note that this does not work on all boards | |||
| 23 | depending on how the external oscillator is wired. | 23 | depending on how the external oscillator is wired. |
| 24 | 24 | ||
| 25 | Optional properties: | 25 | Optional properties: |
| 26 | - ti,use_poweroff: With this flag, the chip will initiates an ACTIVE-to-OFF or | 26 | |
| 27 | SLEEP-to-OFF transition when the system poweroffs. | 27 | - ti,system-power-controller: This indicates that TWL4030 is the |
| 28 | power supply master of the system. With this flag, the chip will | ||
| 29 | initiate an ACTIVE-to-OFF or SLEEP-to-OFF transition when the | ||
| 30 | system poweroffs. | ||
| 31 | |||
| 32 | - ti,use_poweroff: Deprecated name for ti,system-power-controller | ||
| 28 | 33 | ||
| 29 | Example: | 34 | Example: |
| 30 | &i2c1 { | 35 | &i2c1 { |
diff --git a/MAINTAINERS b/MAINTAINERS index ee1bc5bc20ad..b0f17d59078e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -6010,6 +6010,15 @@ S: Supported | |||
| 6010 | F: drivers/mcb/ | 6010 | F: drivers/mcb/ |
| 6011 | F: include/linux/mcb.h | 6011 | F: include/linux/mcb.h |
| 6012 | 6012 | ||
| 6013 | MEN F21BMC (Board Management Controller) | ||
| 6014 | M: Andreas Werner <andreas.werner@men.de> | ||
| 6015 | S: Supported | ||
| 6016 | F: drivers/mfd/menf21bmc.c | ||
| 6017 | F: drivers/watchdog/menf21bmc_wdt.c | ||
| 6018 | F: drivers/leds/leds-menf21bmc.c | ||
| 6019 | F: drivers/hwmon/menf21bmc_hwmon.c | ||
| 6020 | F: Documentation/hwmon/menf21bmc | ||
| 6021 | |||
| 6013 | METAG ARCHITECTURE | 6022 | METAG ARCHITECTURE |
| 6014 | M: James Hogan <james.hogan@imgtec.com> | 6023 | M: James Hogan <james.hogan@imgtec.com> |
| 6015 | L: linux-metag@vger.kernel.org | 6024 | L: linux-metag@vger.kernel.org |
diff --git a/drivers/i2c/busses/i2c-cros-ec-tunnel.c b/drivers/i2c/busses/i2c-cros-ec-tunnel.c index 05e033c98115..8ca5cbbcec91 100644 --- a/drivers/i2c/busses/i2c-cros-ec-tunnel.c +++ b/drivers/i2c/busses/i2c-cros-ec-tunnel.c | |||
| @@ -16,6 +16,8 @@ | |||
| 16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
| 17 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
| 18 | 18 | ||
| 19 | #define I2C_MAX_RETRIES 3 | ||
| 20 | |||
| 19 | /** | 21 | /** |
| 20 | * struct ec_i2c_device - Driver data for I2C tunnel | 22 | * struct ec_i2c_device - Driver data for I2C tunnel |
| 21 | * | 23 | * |
| @@ -227,7 +229,7 @@ static int ec_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg i2c_msgs[], | |||
| 227 | msg.indata = response; | 229 | msg.indata = response; |
| 228 | msg.insize = response_len; | 230 | msg.insize = response_len; |
| 229 | 231 | ||
| 230 | result = bus->ec->cmd_xfer(bus->ec, &msg); | 232 | result = cros_ec_cmd_xfer(bus->ec, &msg); |
| 231 | if (result < 0) | 233 | if (result < 0) |
| 232 | goto exit; | 234 | goto exit; |
| 233 | 235 | ||
| @@ -290,6 +292,7 @@ static int ec_i2c_probe(struct platform_device *pdev) | |||
| 290 | bus->adap.algo_data = bus; | 292 | bus->adap.algo_data = bus; |
| 291 | bus->adap.dev.parent = &pdev->dev; | 293 | bus->adap.dev.parent = &pdev->dev; |
| 292 | bus->adap.dev.of_node = np; | 294 | bus->adap.dev.of_node = np; |
| 295 | bus->adap.retries = I2C_MAX_RETRIES; | ||
| 293 | 296 | ||
| 294 | err = i2c_add_adapter(&bus->adap); | 297 | err = i2c_add_adapter(&bus->adap); |
| 295 | if (err) { | 298 | if (err) { |
diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c index 72d3499bb029..5d773d20230a 100644 --- a/drivers/input/keyboard/cros_ec_keyb.c +++ b/drivers/input/keyboard/cros_ec_keyb.c | |||
| @@ -157,7 +157,7 @@ static int cros_ec_keyb_get_state(struct cros_ec_keyb *ckdev, uint8_t *kb_state) | |||
| 157 | .insize = ckdev->cols, | 157 | .insize = ckdev->cols, |
| 158 | }; | 158 | }; |
| 159 | 159 | ||
| 160 | return ckdev->ec->cmd_xfer(ckdev->ec, &msg); | 160 | return cros_ec_cmd_xfer(ckdev->ec, &msg); |
| 161 | } | 161 | } |
| 162 | 162 | ||
| 163 | static irqreturn_t cros_ec_keyb_irq(int irq, void *data) | 163 | static irqreturn_t cros_ec_keyb_irq(int irq, void *data) |
diff --git a/drivers/mfd/88pm860x-i2c.c b/drivers/mfd/88pm860x-i2c.c index a93b4d0134a2..84e313107233 100644 --- a/drivers/mfd/88pm860x-i2c.c +++ b/drivers/mfd/88pm860x-i2c.c | |||
| @@ -122,7 +122,7 @@ static int read_device(struct i2c_client *i2c, int reg, | |||
| 122 | static int write_device(struct i2c_client *i2c, int reg, | 122 | static int write_device(struct i2c_client *i2c, int reg, |
| 123 | int bytes, void *src) | 123 | int bytes, void *src) |
| 124 | { | 124 | { |
| 125 | unsigned char buf[bytes + 1]; | 125 | unsigned char buf[2]; |
| 126 | struct i2c_adapter *adap = i2c->adapter; | 126 | struct i2c_adapter *adap = i2c->adapter; |
| 127 | struct i2c_msg msg; | 127 | struct i2c_msg msg; |
| 128 | int ret; | 128 | int ret; |
| @@ -140,26 +140,6 @@ static int write_device(struct i2c_client *i2c, int reg, | |||
| 140 | return 0; | 140 | return 0; |
| 141 | } | 141 | } |
| 142 | 142 | ||
| 143 | int pm860x_page_reg_read(struct i2c_client *i2c, int reg) | ||
| 144 | { | ||
| 145 | unsigned char zero = 0; | ||
| 146 | unsigned char data; | ||
| 147 | int ret; | ||
| 148 | |||
| 149 | i2c_lock_adapter(i2c->adapter); | ||
| 150 | read_device(i2c, 0xFA, 0, &zero); | ||
| 151 | read_device(i2c, 0xFB, 0, &zero); | ||
| 152 | read_device(i2c, 0xFF, 0, &zero); | ||
| 153 | ret = read_device(i2c, reg, 1, &data); | ||
| 154 | if (ret >= 0) | ||
| 155 | ret = (int)data; | ||
| 156 | read_device(i2c, 0xFE, 0, &zero); | ||
| 157 | read_device(i2c, 0xFC, 0, &zero); | ||
| 158 | i2c_unlock_adapter(i2c->adapter); | ||
| 159 | return ret; | ||
| 160 | } | ||
| 161 | EXPORT_SYMBOL(pm860x_page_reg_read); | ||
| 162 | |||
| 163 | int pm860x_page_reg_write(struct i2c_client *i2c, int reg, | 143 | int pm860x_page_reg_write(struct i2c_client *i2c, int reg, |
| 164 | unsigned char data) | 144 | unsigned char data) |
| 165 | { | 145 | { |
| @@ -195,47 +175,3 @@ int pm860x_page_bulk_read(struct i2c_client *i2c, int reg, | |||
| 195 | return ret; | 175 | return ret; |
| 196 | } | 176 | } |
| 197 | EXPORT_SYMBOL(pm860x_page_bulk_read); | 177 | EXPORT_SYMBOL(pm860x_page_bulk_read); |
| 198 | |||
| 199 | int pm860x_page_bulk_write(struct i2c_client *i2c, int reg, | ||
| 200 | int count, unsigned char *buf) | ||
| 201 | { | ||
| 202 | unsigned char zero = 0; | ||
| 203 | int ret; | ||
| 204 | |||
| 205 | i2c_lock_adapter(i2c->adapter); | ||
| 206 | read_device(i2c, 0xFA, 0, &zero); | ||
| 207 | read_device(i2c, 0xFB, 0, &zero); | ||
| 208 | read_device(i2c, 0xFF, 0, &zero); | ||
| 209 | ret = write_device(i2c, reg, count, buf); | ||
| 210 | read_device(i2c, 0xFE, 0, &zero); | ||
| 211 | read_device(i2c, 0xFC, 0, &zero); | ||
| 212 | i2c_unlock_adapter(i2c->adapter); | ||
| 213 | i2c_unlock_adapter(i2c->adapter); | ||
| 214 | return ret; | ||
| 215 | } | ||
| 216 | EXPORT_SYMBOL(pm860x_page_bulk_write); | ||
| 217 | |||
| 218 | int pm860x_page_set_bits(struct i2c_client *i2c, int reg, | ||
| 219 | unsigned char mask, unsigned char data) | ||
| 220 | { | ||
| 221 | unsigned char zero; | ||
| 222 | unsigned char value; | ||
| 223 | int ret; | ||
| 224 | |||
| 225 | i2c_lock_adapter(i2c->adapter); | ||
| 226 | read_device(i2c, 0xFA, 0, &zero); | ||
| 227 | read_device(i2c, 0xFB, 0, &zero); | ||
| 228 | read_device(i2c, 0xFF, 0, &zero); | ||
| 229 | ret = read_device(i2c, reg, 1, &value); | ||
| 230 | if (ret < 0) | ||
| 231 | goto out; | ||
| 232 | value &= ~mask; | ||
| 233 | value |= data; | ||
| 234 | ret = write_device(i2c, reg, 1, &value); | ||
| 235 | out: | ||
| 236 | read_device(i2c, 0xFE, 0, &zero); | ||
| 237 | read_device(i2c, 0xFC, 0, &zero); | ||
| 238 | i2c_unlock_adapter(i2c->adapter); | ||
| 239 | return ret; | ||
| 240 | } | ||
| 241 | EXPORT_SYMBOL(pm860x_page_set_bits); | ||
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index cf66ef1ffaf3..1456ea70bbc7 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig | |||
| @@ -210,6 +210,19 @@ config MFD_MC13XXX_I2C | |||
| 210 | help | 210 | help |
| 211 | Select this if your MC13xxx is connected via an I2C bus. | 211 | Select this if your MC13xxx is connected via an I2C bus. |
| 212 | 212 | ||
| 213 | config MFD_HI6421_PMIC | ||
| 214 | tristate "HiSilicon Hi6421 PMU/Codec IC" | ||
| 215 | depends on OF | ||
| 216 | select MFD_CORE | ||
| 217 | select REGMAP_MMIO | ||
| 218 | help | ||
| 219 | Add support for HiSilicon Hi6421 PMIC. Hi6421 includes multi- | ||
| 220 | functions, such as regulators, RTC, codec, Coulomb counter, etc. | ||
| 221 | This driver includes core APIs _only_. You have to select | ||
| 222 | individul components like voltage regulators under corresponding | ||
| 223 | menus in order to enable them. | ||
| 224 | We communicate with the Hi6421 via memory-mapped I/O. | ||
| 225 | |||
| 213 | config HTC_EGPIO | 226 | config HTC_EGPIO |
| 214 | bool "HTC EGPIO support" | 227 | bool "HTC EGPIO support" |
| 215 | depends on GPIOLIB && ARM | 228 | depends on GPIOLIB && ARM |
| @@ -554,6 +567,21 @@ config MFD_PM8921_CORE | |||
| 554 | Say M here if you want to include support for PM8921 chip as a module. | 567 | Say M here if you want to include support for PM8921 chip as a module. |
| 555 | This will build a module called "pm8921-core". | 568 | This will build a module called "pm8921-core". |
| 556 | 569 | ||
| 570 | config MFD_SPMI_PMIC | ||
| 571 | tristate "Qualcomm SPMI PMICs" | ||
| 572 | depends on ARCH_QCOM || COMPILE_TEST | ||
| 573 | depends on OF | ||
| 574 | depends on SPMI | ||
| 575 | select REGMAP_SPMI | ||
| 576 | help | ||
| 577 | This enables support for the Qualcomm SPMI PMICs. | ||
| 578 | These PMICs are currently used with the Snapdragon 800 series of | ||
| 579 | SoCs. Note, that this will only be useful paired with descriptions | ||
| 580 | of the independent functions as children nodes in the device tree. | ||
| 581 | |||
| 582 | Say M here if you want to include support for the SPMI PMIC | ||
| 583 | series as a module. The module will be called "qcom-spmi-pmic". | ||
| 584 | |||
| 557 | config MFD_RDC321X | 585 | config MFD_RDC321X |
| 558 | tristate "RDC R-321x southbridge" | 586 | tristate "RDC R-321x southbridge" |
| 559 | select MFD_CORE | 587 | select MFD_CORE |
| @@ -597,6 +625,30 @@ config MFD_RC5T583 | |||
| 597 | Additional drivers must be enabled in order to use the | 625 | Additional drivers must be enabled in order to use the |
| 598 | different functionality of the device. | 626 | different functionality of the device. |
| 599 | 627 | ||
| 628 | config MFD_RK808 | ||
| 629 | tristate "Rockchip RK808 Power Management chip" | ||
| 630 | depends on I2C && OF | ||
| 631 | select MFD_CORE | ||
| 632 | select REGMAP_I2C | ||
| 633 | select REGMAP_IRQ | ||
| 634 | help | ||
| 635 | If you say yes here you get support for the RK808 | ||
| 636 | Power Management chips. | ||
| 637 | This driver provides common support for accessing the device | ||
| 638 | through I2C interface. The device supports multiple sub-devices | ||
| 639 | including interrupts, RTC, LDO & DCDC regulators, and onkey. | ||
| 640 | |||
| 641 | config MFD_RN5T618 | ||
| 642 | tristate "Ricoh RN5T5618 PMIC" | ||
| 643 | depends on I2C | ||
| 644 | select MFD_CORE | ||
| 645 | select REGMAP_I2C | ||
| 646 | help | ||
| 647 | Say yes here to add support for the Ricoh RN5T618 PMIC. This | ||
| 648 | driver provides common support for accessing the device, | ||
| 649 | additional drivers must be enabled in order to use the | ||
| 650 | functionality of the device. | ||
| 651 | |||
| 600 | config MFD_SEC_CORE | 652 | config MFD_SEC_CORE |
| 601 | bool "SAMSUNG Electronics PMIC Series Support" | 653 | bool "SAMSUNG Electronics PMIC Series Support" |
| 602 | depends on I2C=y | 654 | depends on I2C=y |
| @@ -1243,11 +1295,11 @@ config MFD_WM8350_I2C | |||
| 1243 | selected to enable support for the functionality of the chip. | 1295 | selected to enable support for the functionality of the chip. |
| 1244 | 1296 | ||
| 1245 | config MFD_WM8994 | 1297 | config MFD_WM8994 |
| 1246 | bool "Wolfson Microelectronics WM8994" | 1298 | tristate "Wolfson Microelectronics WM8994" |
| 1247 | select MFD_CORE | 1299 | select MFD_CORE |
| 1248 | select REGMAP_I2C | 1300 | select REGMAP_I2C |
| 1249 | select REGMAP_IRQ | 1301 | select REGMAP_IRQ |
| 1250 | depends on I2C=y | 1302 | depends on I2C |
| 1251 | help | 1303 | help |
| 1252 | The WM8994 is a highly integrated hi-fi CODEC designed for | 1304 | The WM8994 is a highly integrated hi-fi CODEC designed for |
| 1253 | smartphone applicatiosn. As well as audio functionality it | 1305 | smartphone applicatiosn. As well as audio functionality it |
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index d58068aa8aa9..8bd54b1253af 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile | |||
| @@ -153,6 +153,7 @@ obj-$(CONFIG_MFD_SI476X_CORE) += si476x-core.o | |||
| 153 | obj-$(CONFIG_MFD_CS5535) += cs5535-mfd.o | 153 | obj-$(CONFIG_MFD_CS5535) += cs5535-mfd.o |
| 154 | obj-$(CONFIG_MFD_OMAP_USB_HOST) += omap-usb-host.o omap-usb-tll.o | 154 | obj-$(CONFIG_MFD_OMAP_USB_HOST) += omap-usb-host.o omap-usb-tll.o |
| 155 | obj-$(CONFIG_MFD_PM8921_CORE) += pm8921-core.o ssbi.o | 155 | obj-$(CONFIG_MFD_PM8921_CORE) += pm8921-core.o ssbi.o |
| 156 | obj-$(CONFIG_MFD_SPMI_PMIC) += qcom-spmi-pmic.o | ||
| 156 | obj-$(CONFIG_TPS65911_COMPARATOR) += tps65911-comparator.o | 157 | obj-$(CONFIG_TPS65911_COMPARATOR) += tps65911-comparator.o |
| 157 | obj-$(CONFIG_MFD_TPS65090) += tps65090.o | 158 | obj-$(CONFIG_MFD_TPS65090) += tps65090.o |
| 158 | obj-$(CONFIG_MFD_AAT2870_CORE) += aat2870-core.o | 159 | obj-$(CONFIG_MFD_AAT2870_CORE) += aat2870-core.o |
| @@ -160,6 +161,8 @@ obj-$(CONFIG_MFD_INTEL_MSIC) += intel_msic.o | |||
| 160 | obj-$(CONFIG_MFD_PALMAS) += palmas.o | 161 | obj-$(CONFIG_MFD_PALMAS) += palmas.o |
| 161 | obj-$(CONFIG_MFD_VIPERBOARD) += viperboard.o | 162 | obj-$(CONFIG_MFD_VIPERBOARD) += viperboard.o |
| 162 | obj-$(CONFIG_MFD_RC5T583) += rc5t583.o rc5t583-irq.o | 163 | obj-$(CONFIG_MFD_RC5T583) += rc5t583.o rc5t583-irq.o |
| 164 | obj-$(CONFIG_MFD_RK808) += rk808.o | ||
| 165 | obj-$(CONFIG_MFD_RN5T618) += rn5t618.o | ||
| 163 | obj-$(CONFIG_MFD_SEC_CORE) += sec-core.o sec-irq.o | 166 | obj-$(CONFIG_MFD_SEC_CORE) += sec-core.o sec-irq.o |
| 164 | obj-$(CONFIG_MFD_SYSCON) += syscon.o | 167 | obj-$(CONFIG_MFD_SYSCON) += syscon.o |
| 165 | obj-$(CONFIG_MFD_LM3533) += lm3533-core.o lm3533-ctrlbank.o | 168 | obj-$(CONFIG_MFD_LM3533) += lm3533-core.o lm3533-ctrlbank.o |
| @@ -170,6 +173,7 @@ obj-$(CONFIG_MFD_AS3722) += as3722.o | |||
| 170 | obj-$(CONFIG_MFD_STW481X) += stw481x.o | 173 | obj-$(CONFIG_MFD_STW481X) += stw481x.o |
| 171 | obj-$(CONFIG_MFD_IPAQ_MICRO) += ipaq-micro.o | 174 | obj-$(CONFIG_MFD_IPAQ_MICRO) += ipaq-micro.o |
| 172 | obj-$(CONFIG_MFD_MENF21BMC) += menf21bmc.o | 175 | obj-$(CONFIG_MFD_MENF21BMC) += menf21bmc.o |
| 176 | obj-$(CONFIG_MFD_HI6421_PMIC) += hi6421-pmic-core.o | ||
| 173 | 177 | ||
| 174 | intel-soc-pmic-objs := intel_soc_pmic_core.o intel_soc_pmic_crc.o | 178 | intel-soc-pmic-objs := intel_soc_pmic_core.o intel_soc_pmic_crc.o |
| 175 | obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o | 179 | obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o |
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c index 10a0cb90619a..bce7c0784b6b 100644 --- a/drivers/mfd/arizona-core.c +++ b/drivers/mfd/arizona-core.c | |||
| @@ -393,18 +393,6 @@ static int arizona_runtime_resume(struct device *dev) | |||
| 393 | break; | 393 | break; |
| 394 | } | 394 | } |
| 395 | 395 | ||
| 396 | switch (arizona->type) { | ||
| 397 | case WM5102: | ||
| 398 | ret = wm5102_patch(arizona); | ||
| 399 | if (ret != 0) { | ||
| 400 | dev_err(arizona->dev, "Failed to apply patch: %d\n", | ||
| 401 | ret); | ||
| 402 | goto err; | ||
| 403 | } | ||
| 404 | default: | ||
| 405 | break; | ||
| 406 | } | ||
| 407 | |||
| 408 | ret = regcache_sync(arizona->regmap); | 396 | ret = regcache_sync(arizona->regmap); |
| 409 | if (ret != 0) { | 397 | if (ret != 0) { |
| 410 | dev_err(arizona->dev, "Failed to restore register cache\n"); | 398 | dev_err(arizona->dev, "Failed to restore register cache\n"); |
| @@ -534,7 +522,11 @@ EXPORT_SYMBOL_GPL(arizona_of_get_named_gpio); | |||
| 534 | static int arizona_of_get_core_pdata(struct arizona *arizona) | 522 | static int arizona_of_get_core_pdata(struct arizona *arizona) |
| 535 | { | 523 | { |
| 536 | struct arizona_pdata *pdata = &arizona->pdata; | 524 | struct arizona_pdata *pdata = &arizona->pdata; |
| 525 | struct property *prop; | ||
| 526 | const __be32 *cur; | ||
| 527 | u32 val; | ||
| 537 | int ret, i; | 528 | int ret, i; |
| 529 | int count = 0; | ||
| 538 | 530 | ||
| 539 | pdata->reset = arizona_of_get_named_gpio(arizona, "wlf,reset", true); | 531 | pdata->reset = arizona_of_get_named_gpio(arizona, "wlf,reset", true); |
| 540 | 532 | ||
| @@ -560,6 +552,15 @@ static int arizona_of_get_core_pdata(struct arizona *arizona) | |||
| 560 | ret); | 552 | ret); |
| 561 | } | 553 | } |
| 562 | 554 | ||
| 555 | of_property_for_each_u32(arizona->dev->of_node, "wlf,inmode", prop, | ||
| 556 | cur, val) { | ||
| 557 | if (count == ARRAY_SIZE(arizona->pdata.inmode)) | ||
| 558 | break; | ||
| 559 | |||
| 560 | arizona->pdata.inmode[count] = val; | ||
| 561 | count++; | ||
| 562 | } | ||
| 563 | |||
| 563 | return 0; | 564 | return 0; |
| 564 | } | 565 | } |
| 565 | 566 | ||
| @@ -784,7 +785,8 @@ int arizona_dev_init(struct arizona *arizona) | |||
| 784 | /* Ensure device startup is complete */ | 785 | /* Ensure device startup is complete */ |
| 785 | switch (arizona->type) { | 786 | switch (arizona->type) { |
| 786 | case WM5102: | 787 | case WM5102: |
| 787 | ret = regmap_read(arizona->regmap, 0x19, &val); | 788 | ret = regmap_read(arizona->regmap, |
| 789 | ARIZONA_WRITE_SEQUENCER_CTRL_3, &val); | ||
| 788 | if (ret != 0) | 790 | if (ret != 0) |
| 789 | dev_err(dev, | 791 | dev_err(dev, |
| 790 | "Failed to check write sequencer state: %d\n", | 792 | "Failed to check write sequencer state: %d\n", |
| @@ -945,6 +947,7 @@ int arizona_dev_init(struct arizona *arizona) | |||
| 945 | regmap_update_bits(arizona->regmap, | 947 | regmap_update_bits(arizona->regmap, |
| 946 | ARIZONA_MIC_BIAS_CTRL_1 + i, | 948 | ARIZONA_MIC_BIAS_CTRL_1 + i, |
| 947 | ARIZONA_MICB1_LVL_MASK | | 949 | ARIZONA_MICB1_LVL_MASK | |
| 950 | ARIZONA_MICB1_EXT_CAP | | ||
| 948 | ARIZONA_MICB1_DISCH | | 951 | ARIZONA_MICB1_DISCH | |
| 949 | ARIZONA_MICB1_BYPASS | | 952 | ARIZONA_MICB1_BYPASS | |
| 950 | ARIZONA_MICB1_RATE, val); | 953 | ARIZONA_MICB1_RATE, val); |
diff --git a/drivers/mfd/arizona-irq.c b/drivers/mfd/arizona-irq.c index d420dbc0e2b0..3a3fe7cc6d61 100644 --- a/drivers/mfd/arizona-irq.c +++ b/drivers/mfd/arizona-irq.c | |||
| @@ -152,10 +152,18 @@ static void arizona_irq_disable(struct irq_data *data) | |||
| 152 | { | 152 | { |
| 153 | } | 153 | } |
| 154 | 154 | ||
| 155 | static int arizona_irq_set_wake(struct irq_data *data, unsigned int on) | ||
| 156 | { | ||
| 157 | struct arizona *arizona = irq_data_get_irq_chip_data(data); | ||
| 158 | |||
| 159 | return irq_set_irq_wake(arizona->irq, on); | ||
| 160 | } | ||
| 161 | |||
| 155 | static struct irq_chip arizona_irq_chip = { | 162 | static struct irq_chip arizona_irq_chip = { |
| 156 | .name = "arizona", | 163 | .name = "arizona", |
| 157 | .irq_disable = arizona_irq_disable, | 164 | .irq_disable = arizona_irq_disable, |
| 158 | .irq_enable = arizona_irq_enable, | 165 | .irq_enable = arizona_irq_enable, |
| 166 | .irq_set_wake = arizona_irq_set_wake, | ||
| 159 | }; | 167 | }; |
| 160 | 168 | ||
| 161 | static int arizona_irq_map(struct irq_domain *h, unsigned int virq, | 169 | static int arizona_irq_map(struct irq_domain *h, unsigned int virq, |
| @@ -164,7 +172,7 @@ static int arizona_irq_map(struct irq_domain *h, unsigned int virq, | |||
| 164 | struct regmap_irq_chip_data *data = h->host_data; | 172 | struct regmap_irq_chip_data *data = h->host_data; |
| 165 | 173 | ||
| 166 | irq_set_chip_data(virq, data); | 174 | irq_set_chip_data(virq, data); |
| 167 | irq_set_chip_and_handler(virq, &arizona_irq_chip, handle_edge_irq); | 175 | irq_set_chip_and_handler(virq, &arizona_irq_chip, handle_simple_irq); |
| 168 | irq_set_nested_thread(virq, 1); | 176 | irq_set_nested_thread(virq, 1); |
| 169 | 177 | ||
| 170 | /* ARM needs us to explicitly flag the IRQ as valid | 178 | /* ARM needs us to explicitly flag the IRQ as valid |
| @@ -282,7 +290,7 @@ int arizona_irq_init(struct arizona *arizona) | |||
| 282 | 290 | ||
| 283 | ret = regmap_add_irq_chip(arizona->regmap, | 291 | ret = regmap_add_irq_chip(arizona->regmap, |
| 284 | irq_create_mapping(arizona->virq, 0), | 292 | irq_create_mapping(arizona->virq, 0), |
| 285 | IRQF_ONESHOT, -1, aod, | 293 | IRQF_ONESHOT, 0, aod, |
| 286 | &arizona->aod_irq_chip); | 294 | &arizona->aod_irq_chip); |
| 287 | if (ret != 0) { | 295 | if (ret != 0) { |
| 288 | dev_err(arizona->dev, "Failed to add AOD IRQs: %d\n", ret); | 296 | dev_err(arizona->dev, "Failed to add AOD IRQs: %d\n", ret); |
| @@ -291,7 +299,7 @@ int arizona_irq_init(struct arizona *arizona) | |||
| 291 | 299 | ||
| 292 | ret = regmap_add_irq_chip(arizona->regmap, | 300 | ret = regmap_add_irq_chip(arizona->regmap, |
| 293 | irq_create_mapping(arizona->virq, 1), | 301 | irq_create_mapping(arizona->virq, 1), |
| 294 | IRQF_ONESHOT, -1, irq, | 302 | IRQF_ONESHOT, 0, irq, |
| 295 | &arizona->irq_chip); | 303 | &arizona->irq_chip); |
| 296 | if (ret != 0) { | 304 | if (ret != 0) { |
| 297 | dev_err(arizona->dev, "Failed to add main IRQs: %d\n", ret); | 305 | dev_err(arizona->dev, "Failed to add main IRQs: %d\n", ret); |
diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c index dee653989e3a..6231adbb295d 100644 --- a/drivers/mfd/axp20x.c +++ b/drivers/mfd/axp20x.c | |||
| @@ -140,15 +140,6 @@ static const struct regmap_irq_chip axp20x_regmap_irq_chip = { | |||
| 140 | .init_ack_masked = true, | 140 | .init_ack_masked = true, |
| 141 | }; | 141 | }; |
| 142 | 142 | ||
| 143 | static const char * const axp20x_supplies[] = { | ||
| 144 | "acin", | ||
| 145 | "vin2", | ||
| 146 | "vin3", | ||
| 147 | "ldo24in", | ||
| 148 | "ldo3in", | ||
| 149 | "ldo5in", | ||
| 150 | }; | ||
| 151 | |||
| 152 | static struct mfd_cell axp20x_cells[] = { | 143 | static struct mfd_cell axp20x_cells[] = { |
| 153 | { | 144 | { |
| 154 | .name = "axp20x-pek", | 145 | .name = "axp20x-pek", |
| @@ -156,8 +147,6 @@ static struct mfd_cell axp20x_cells[] = { | |||
| 156 | .resources = axp20x_pek_resources, | 147 | .resources = axp20x_pek_resources, |
| 157 | }, { | 148 | }, { |
| 158 | .name = "axp20x-regulator", | 149 | .name = "axp20x-regulator", |
| 159 | .parent_supplies = axp20x_supplies, | ||
| 160 | .num_parent_supplies = ARRAY_SIZE(axp20x_supplies), | ||
| 161 | }, | 150 | }, |
| 162 | }; | 151 | }; |
| 163 | 152 | ||
diff --git a/drivers/mfd/cros_ec.c b/drivers/mfd/cros_ec.c index 4873f9c50452..fc0c81ef04ff 100644 --- a/drivers/mfd/cros_ec.c +++ b/drivers/mfd/cros_ec.c | |||
| @@ -23,6 +23,9 @@ | |||
| 23 | #include <linux/mfd/core.h> | 23 | #include <linux/mfd/core.h> |
| 24 | #include <linux/mfd/cros_ec.h> | 24 | #include <linux/mfd/cros_ec.h> |
| 25 | #include <linux/mfd/cros_ec_commands.h> | 25 | #include <linux/mfd/cros_ec_commands.h> |
| 26 | #include <linux/delay.h> | ||
| 27 | |||
| 28 | #define EC_COMMAND_RETRIES 50 | ||
| 26 | 29 | ||
| 27 | int cros_ec_prepare_tx(struct cros_ec_device *ec_dev, | 30 | int cros_ec_prepare_tx(struct cros_ec_device *ec_dev, |
| 28 | struct cros_ec_command *msg) | 31 | struct cros_ec_command *msg) |
| @@ -62,6 +65,49 @@ int cros_ec_check_result(struct cros_ec_device *ec_dev, | |||
| 62 | } | 65 | } |
| 63 | EXPORT_SYMBOL(cros_ec_check_result); | 66 | EXPORT_SYMBOL(cros_ec_check_result); |
| 64 | 67 | ||
| 68 | int cros_ec_cmd_xfer(struct cros_ec_device *ec_dev, | ||
| 69 | struct cros_ec_command *msg) | ||
| 70 | { | ||
| 71 | int ret; | ||
| 72 | |||
| 73 | mutex_lock(&ec_dev->lock); | ||
| 74 | ret = ec_dev->cmd_xfer(ec_dev, msg); | ||
| 75 | if (msg->result == EC_RES_IN_PROGRESS) { | ||
| 76 | int i; | ||
| 77 | struct cros_ec_command status_msg; | ||
| 78 | struct ec_response_get_comms_status status; | ||
| 79 | |||
| 80 | status_msg.version = 0; | ||
| 81 | status_msg.command = EC_CMD_GET_COMMS_STATUS; | ||
| 82 | status_msg.outdata = NULL; | ||
| 83 | status_msg.outsize = 0; | ||
| 84 | status_msg.indata = (uint8_t *)&status; | ||
| 85 | status_msg.insize = sizeof(status); | ||
| 86 | |||
| 87 | /* | ||
| 88 | * Query the EC's status until it's no longer busy or | ||
| 89 | * we encounter an error. | ||
| 90 | */ | ||
| 91 | for (i = 0; i < EC_COMMAND_RETRIES; i++) { | ||
| 92 | usleep_range(10000, 11000); | ||
| 93 | |||
| 94 | ret = ec_dev->cmd_xfer(ec_dev, &status_msg); | ||
| 95 | if (ret < 0) | ||
| 96 | break; | ||
| 97 | |||
| 98 | msg->result = status_msg.result; | ||
| 99 | if (status_msg.result != EC_RES_SUCCESS) | ||
| 100 | break; | ||
| 101 | if (!(status.flags & EC_COMMS_STATUS_PROCESSING)) | ||
| 102 | break; | ||
| 103 | } | ||
| 104 | } | ||
| 105 | mutex_unlock(&ec_dev->lock); | ||
| 106 | |||
| 107 | return ret; | ||
| 108 | } | ||
| 109 | EXPORT_SYMBOL(cros_ec_cmd_xfer); | ||
| 110 | |||
| 65 | static const struct mfd_cell cros_devs[] = { | 111 | static const struct mfd_cell cros_devs[] = { |
| 66 | { | 112 | { |
| 67 | .name = "cros-ec-keyb", | 113 | .name = "cros-ec-keyb", |
| @@ -91,6 +137,8 @@ int cros_ec_register(struct cros_ec_device *ec_dev) | |||
| 91 | return -ENOMEM; | 137 | return -ENOMEM; |
| 92 | } | 138 | } |
| 93 | 139 | ||
| 140 | mutex_init(&ec_dev->lock); | ||
| 141 | |||
| 94 | err = mfd_add_devices(dev, 0, cros_devs, | 142 | err = mfd_add_devices(dev, 0, cros_devs, |
| 95 | ARRAY_SIZE(cros_devs), | 143 | ARRAY_SIZE(cros_devs), |
| 96 | NULL, ec_dev->irq, NULL); | 144 | NULL, ec_dev->irq, NULL); |
diff --git a/drivers/mfd/cros_ec_spi.c b/drivers/mfd/cros_ec_spi.c index 588c700af39c..bf6e08e8013e 100644 --- a/drivers/mfd/cros_ec_spi.c +++ b/drivers/mfd/cros_ec_spi.c | |||
| @@ -65,6 +65,12 @@ | |||
| 65 | */ | 65 | */ |
| 66 | #define EC_SPI_RECOVERY_TIME_NS (200 * 1000) | 66 | #define EC_SPI_RECOVERY_TIME_NS (200 * 1000) |
| 67 | 67 | ||
| 68 | /* | ||
| 69 | * The EC is unresponsive for a time after a reboot command. Add a | ||
| 70 | * simple delay to make sure that the bus stays locked. | ||
| 71 | */ | ||
| 72 | #define EC_REBOOT_DELAY_MS 50 | ||
| 73 | |||
| 68 | /** | 74 | /** |
| 69 | * struct cros_ec_spi - information about a SPI-connected EC | 75 | * struct cros_ec_spi - information about a SPI-connected EC |
| 70 | * | 76 | * |
| @@ -73,13 +79,11 @@ | |||
| 73 | * if no record | 79 | * if no record |
| 74 | * @end_of_msg_delay: used to set the delay_usecs on the spi_transfer that | 80 | * @end_of_msg_delay: used to set the delay_usecs on the spi_transfer that |
| 75 | * is sent when we want to turn off CS at the end of a transaction. | 81 | * is sent when we want to turn off CS at the end of a transaction. |
| 76 | * @lock: mutex to ensure only one user of cros_ec_cmd_xfer_spi at a time | ||
| 77 | */ | 82 | */ |
| 78 | struct cros_ec_spi { | 83 | struct cros_ec_spi { |
| 79 | struct spi_device *spi; | 84 | struct spi_device *spi; |
| 80 | s64 last_transfer_ns; | 85 | s64 last_transfer_ns; |
| 81 | unsigned int end_of_msg_delay; | 86 | unsigned int end_of_msg_delay; |
| 82 | struct mutex lock; | ||
| 83 | }; | 87 | }; |
| 84 | 88 | ||
| 85 | static void debug_packet(struct device *dev, const char *name, u8 *ptr, | 89 | static void debug_packet(struct device *dev, const char *name, u8 *ptr, |
| @@ -226,13 +230,6 @@ static int cros_ec_cmd_xfer_spi(struct cros_ec_device *ec_dev, | |||
| 226 | int sum; | 230 | int sum; |
| 227 | int ret = 0, final_ret; | 231 | int ret = 0, final_ret; |
| 228 | 232 | ||
| 229 | /* | ||
| 230 | * We have the shared ec_dev buffer plus we do lots of separate spi_sync | ||
| 231 | * calls, so we need to make sure only one person is using this at a | ||
| 232 | * time. | ||
| 233 | */ | ||
| 234 | mutex_lock(&ec_spi->lock); | ||
| 235 | |||
| 236 | len = cros_ec_prepare_tx(ec_dev, ec_msg); | 233 | len = cros_ec_prepare_tx(ec_dev, ec_msg); |
| 237 | dev_dbg(ec_dev->dev, "prepared, len=%d\n", len); | 234 | dev_dbg(ec_dev->dev, "prepared, len=%d\n", len); |
| 238 | 235 | ||
| @@ -318,7 +315,9 @@ static int cros_ec_cmd_xfer_spi(struct cros_ec_device *ec_dev, | |||
| 318 | 315 | ||
| 319 | ret = len; | 316 | ret = len; |
| 320 | exit: | 317 | exit: |
| 321 | mutex_unlock(&ec_spi->lock); | 318 | if (ec_msg->command == EC_CMD_REBOOT_EC) |
| 319 | msleep(EC_REBOOT_DELAY_MS); | ||
| 320 | |||
| 322 | return ret; | 321 | return ret; |
| 323 | } | 322 | } |
| 324 | 323 | ||
| @@ -350,7 +349,6 @@ static int cros_ec_spi_probe(struct spi_device *spi) | |||
| 350 | if (ec_spi == NULL) | 349 | if (ec_spi == NULL) |
| 351 | return -ENOMEM; | 350 | return -ENOMEM; |
| 352 | ec_spi->spi = spi; | 351 | ec_spi->spi = spi; |
| 353 | mutex_init(&ec_spi->lock); | ||
| 354 | ec_dev = devm_kzalloc(dev, sizeof(*ec_dev), GFP_KERNEL); | 352 | ec_dev = devm_kzalloc(dev, sizeof(*ec_dev), GFP_KERNEL); |
| 355 | if (!ec_dev) | 353 | if (!ec_dev) |
| 356 | return -ENOMEM; | 354 | return -ENOMEM; |
diff --git a/drivers/mfd/da9052-core.c b/drivers/mfd/da9052-core.c index e8af816d73a9..52a0c2f6264f 100644 --- a/drivers/mfd/da9052-core.c +++ b/drivers/mfd/da9052-core.c | |||
| @@ -522,7 +522,7 @@ static const struct mfd_cell da9052_subdev_info[] = { | |||
| 522 | }, | 522 | }, |
| 523 | }; | 523 | }; |
| 524 | 524 | ||
| 525 | struct regmap_config da9052_regmap_config = { | 525 | const struct regmap_config da9052_regmap_config = { |
| 526 | .reg_bits = 8, | 526 | .reg_bits = 8, |
| 527 | .val_bits = 8, | 527 | .val_bits = 8, |
| 528 | 528 | ||
diff --git a/drivers/mfd/da9052-i2c.c b/drivers/mfd/da9052-i2c.c index 6da8ec8ff800..ec39287a245b 100644 --- a/drivers/mfd/da9052-i2c.c +++ b/drivers/mfd/da9052-i2c.c | |||
| @@ -140,13 +140,6 @@ static int da9052_i2c_probe(struct i2c_client *client, | |||
| 140 | if (!da9052) | 140 | if (!da9052) |
| 141 | return -ENOMEM; | 141 | return -ENOMEM; |
| 142 | 142 | ||
| 143 | if (!i2c_check_functionality(client->adapter, | ||
| 144 | I2C_FUNC_SMBUS_BYTE_DATA)) { | ||
| 145 | dev_info(&client->dev, "Error in %s:i2c_check_functionality\n", | ||
| 146 | __func__); | ||
| 147 | return -ENODEV; | ||
| 148 | } | ||
| 149 | |||
| 150 | da9052->dev = &client->dev; | 143 | da9052->dev = &client->dev; |
| 151 | da9052->chip_irq = client->irq; | 144 | da9052->chip_irq = client->irq; |
| 152 | da9052->fix_io = da9052_i2c_fix; | 145 | da9052->fix_io = da9052_i2c_fix; |
diff --git a/drivers/mfd/da9052-spi.c b/drivers/mfd/da9052-spi.c index 17666b40b70c..45ae0b7d13ef 100644 --- a/drivers/mfd/da9052-spi.c +++ b/drivers/mfd/da9052-spi.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | 23 | ||
| 24 | static int da9052_spi_probe(struct spi_device *spi) | 24 | static int da9052_spi_probe(struct spi_device *spi) |
| 25 | { | 25 | { |
| 26 | struct regmap_config config; | ||
| 26 | int ret; | 27 | int ret; |
| 27 | const struct spi_device_id *id = spi_get_device_id(spi); | 28 | const struct spi_device_id *id = spi_get_device_id(spi); |
| 28 | struct da9052 *da9052; | 29 | struct da9052 *da9052; |
| @@ -40,10 +41,10 @@ static int da9052_spi_probe(struct spi_device *spi) | |||
| 40 | 41 | ||
| 41 | spi_set_drvdata(spi, da9052); | 42 | spi_set_drvdata(spi, da9052); |
| 42 | 43 | ||
| 43 | da9052_regmap_config.read_flag_mask = 1; | 44 | config = da9052_regmap_config; |
| 44 | da9052_regmap_config.write_flag_mask = 0; | 45 | config.read_flag_mask = 1; |
| 45 | 46 | ||
| 46 | da9052->regmap = devm_regmap_init_spi(spi, &da9052_regmap_config); | 47 | da9052->regmap = devm_regmap_init_spi(spi, &config); |
| 47 | if (IS_ERR(da9052->regmap)) { | 48 | if (IS_ERR(da9052->regmap)) { |
| 48 | ret = PTR_ERR(da9052->regmap); | 49 | ret = PTR_ERR(da9052->regmap); |
| 49 | dev_err(&spi->dev, "Failed to allocate register map: %d\n", | 50 | dev_err(&spi->dev, "Failed to allocate register map: %d\n", |
diff --git a/drivers/mfd/hi6421-pmic-core.c b/drivers/mfd/hi6421-pmic-core.c new file mode 100644 index 000000000000..321a2656fd00 --- /dev/null +++ b/drivers/mfd/hi6421-pmic-core.c | |||
| @@ -0,0 +1,113 @@ | |||
| 1 | /* | ||
| 2 | * Device driver for Hi6421 IC | ||
| 3 | * | ||
| 4 | * Copyright (c) <2011-2014> HiSilicon Technologies Co., Ltd. | ||
| 5 | * http://www.hisilicon.com | ||
| 6 | * Copyright (c) <2013-2014> Linaro Ltd. | ||
| 7 | * http://www.linaro.org | ||
| 8 | * | ||
| 9 | * Author: Guodong Xu <guodong.xu@linaro.org> | ||
| 10 | * | ||
| 11 | * This program is free software; you can redistribute it and/or modify | ||
| 12 | * it under the terms of the GNU General Public License as published by | ||
| 13 | * the Free Software Foundation; either version 2 of the License, or | ||
| 14 | * (at your option) any later version. | ||
| 15 | * | ||
| 16 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 17 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 18 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 19 | * more details. | ||
| 20 | * | ||
| 21 | * You should have received a copy of the GNU General Public License | ||
| 22 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 23 | */ | ||
| 24 | |||
| 25 | #include <linux/device.h> | ||
| 26 | #include <linux/err.h> | ||
| 27 | #include <linux/mfd/core.h> | ||
| 28 | #include <linux/module.h> | ||
| 29 | #include <linux/of.h> | ||
| 30 | #include <linux/platform_device.h> | ||
| 31 | #include <linux/regmap.h> | ||
| 32 | #include <linux/mfd/hi6421-pmic.h> | ||
| 33 | |||
| 34 | static const struct mfd_cell hi6421_devs[] = { | ||
| 35 | { .name = "hi6421-regulator", }, | ||
| 36 | }; | ||
| 37 | |||
| 38 | static struct regmap_config hi6421_regmap_config = { | ||
| 39 | .reg_bits = 32, | ||
| 40 | .reg_stride = 4, | ||
| 41 | .val_bits = 8, | ||
| 42 | .max_register = HI6421_REG_TO_BUS_ADDR(HI6421_REG_MAX), | ||
| 43 | }; | ||
| 44 | |||
| 45 | static int hi6421_pmic_probe(struct platform_device *pdev) | ||
| 46 | { | ||
| 47 | struct hi6421_pmic *pmic; | ||
| 48 | struct resource *res; | ||
| 49 | void __iomem *base; | ||
| 50 | int ret; | ||
| 51 | |||
| 52 | pmic = devm_kzalloc(&pdev->dev, sizeof(*pmic), GFP_KERNEL); | ||
| 53 | if (!pmic) | ||
| 54 | return -ENOMEM; | ||
| 55 | |||
| 56 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
| 57 | base = devm_ioremap_resource(&pdev->dev, res); | ||
| 58 | if (IS_ERR(base)) | ||
| 59 | return PTR_ERR(base); | ||
| 60 | |||
| 61 | pmic->regmap = devm_regmap_init_mmio_clk(&pdev->dev, NULL, base, | ||
| 62 | &hi6421_regmap_config); | ||
| 63 | if (IS_ERR(pmic->regmap)) { | ||
| 64 | dev_err(&pdev->dev, | ||
| 65 | "regmap init failed: %ld\n", PTR_ERR(pmic->regmap)); | ||
| 66 | return PTR_ERR(pmic->regmap); | ||
| 67 | } | ||
| 68 | |||
| 69 | /* set over-current protection debounce 8ms */ | ||
| 70 | regmap_update_bits(pmic->regmap, HI6421_OCP_DEB_CTRL_REG, | ||
| 71 | (HI6421_OCP_DEB_SEL_MASK | ||
| 72 | | HI6421_OCP_EN_DEBOUNCE_MASK | ||
| 73 | | HI6421_OCP_AUTO_STOP_MASK), | ||
| 74 | (HI6421_OCP_DEB_SEL_8MS | ||
| 75 | | HI6421_OCP_EN_DEBOUNCE_ENABLE)); | ||
| 76 | |||
| 77 | platform_set_drvdata(pdev, pmic); | ||
| 78 | |||
| 79 | ret = mfd_add_devices(&pdev->dev, 0, hi6421_devs, | ||
| 80 | ARRAY_SIZE(hi6421_devs), NULL, 0, NULL); | ||
| 81 | if (ret) { | ||
| 82 | dev_err(&pdev->dev, "add mfd devices failed: %d\n", ret); | ||
| 83 | return ret; | ||
| 84 | } | ||
| 85 | |||
| 86 | return 0; | ||
| 87 | } | ||
| 88 | |||
| 89 | static int hi6421_pmic_remove(struct platform_device *pdev) | ||
| 90 | { | ||
| 91 | mfd_remove_devices(&pdev->dev); | ||
| 92 | |||
| 93 | return 0; | ||
| 94 | } | ||
| 95 | |||
| 96 | static struct of_device_id of_hi6421_pmic_match_tbl[] = { | ||
| 97 | { .compatible = "hisilicon,hi6421-pmic", }, | ||
| 98 | { }, | ||
| 99 | }; | ||
| 100 | |||
| 101 | static struct platform_driver hi6421_pmic_driver = { | ||
| 102 | .driver = { | ||
| 103 | .name = "hi6421_pmic", | ||
| 104 | .of_match_table = of_hi6421_pmic_match_tbl, | ||
| 105 | }, | ||
| 106 | .probe = hi6421_pmic_probe, | ||
| 107 | .remove = hi6421_pmic_remove, | ||
| 108 | }; | ||
| 109 | module_platform_driver(hi6421_pmic_driver); | ||
| 110 | |||
| 111 | MODULE_AUTHOR("Guodong Xu <guodong.xu@linaro.org>"); | ||
| 112 | MODULE_DESCRIPTION("Hi6421 PMIC driver"); | ||
| 113 | MODULE_LICENSE("GPL v2"); | ||
diff --git a/drivers/mfd/htc-i2cpld.c b/drivers/mfd/htc-i2cpld.c index adbbce0ff630..ebb9cf19e347 100644 --- a/drivers/mfd/htc-i2cpld.c +++ b/drivers/mfd/htc-i2cpld.c | |||
| @@ -227,15 +227,12 @@ static irqreturn_t htcpld_handler(int irq, void *dev) | |||
| 227 | static void htcpld_chip_set(struct gpio_chip *chip, unsigned offset, int val) | 227 | static void htcpld_chip_set(struct gpio_chip *chip, unsigned offset, int val) |
| 228 | { | 228 | { |
| 229 | struct i2c_client *client; | 229 | struct i2c_client *client; |
| 230 | struct htcpld_chip *chip_data; | 230 | struct htcpld_chip *chip_data = |
| 231 | container_of(chip, struct htcpld_chip, chip_out); | ||
| 231 | unsigned long flags; | 232 | unsigned long flags; |
| 232 | 233 | ||
| 233 | chip_data = container_of(chip, struct htcpld_chip, chip_out); | ||
| 234 | if (!chip_data) | ||
| 235 | return; | ||
| 236 | |||
| 237 | client = chip_data->client; | 234 | client = chip_data->client; |
| 238 | if (client == NULL) | 235 | if (!client) |
| 239 | return; | 236 | return; |
| 240 | 237 | ||
| 241 | spin_lock_irqsave(&chip_data->lock, flags); | 238 | spin_lock_irqsave(&chip_data->lock, flags); |
| @@ -261,31 +258,18 @@ static void htcpld_chip_set_ni(struct work_struct *work) | |||
| 261 | static int htcpld_chip_get(struct gpio_chip *chip, unsigned offset) | 258 | static int htcpld_chip_get(struct gpio_chip *chip, unsigned offset) |
| 262 | { | 259 | { |
| 263 | struct htcpld_chip *chip_data; | 260 | struct htcpld_chip *chip_data; |
| 264 | int val = 0; | 261 | u8 cache; |
| 265 | int is_input = 0; | ||
| 266 | |||
| 267 | /* Try out first */ | ||
| 268 | chip_data = container_of(chip, struct htcpld_chip, chip_out); | ||
| 269 | if (!chip_data) { | ||
| 270 | /* Try in */ | ||
| 271 | is_input = 1; | ||
| 272 | chip_data = container_of(chip, struct htcpld_chip, chip_in); | ||
| 273 | if (!chip_data) | ||
| 274 | return -EINVAL; | ||
| 275 | } | ||
| 276 | 262 | ||
| 277 | /* Determine if this is an input or output GPIO */ | 263 | if (!strncmp(chip->label, "htcpld-out", 10)) { |
| 278 | if (!is_input) | 264 | chip_data = container_of(chip, struct htcpld_chip, chip_out); |
| 279 | /* Use the output cache */ | 265 | cache = chip_data->cache_out; |
| 280 | val = (chip_data->cache_out >> offset) & 1; | 266 | } else if (!strncmp(chip->label, "htcpld-in", 9)) { |
| 281 | else | 267 | chip_data = container_of(chip, struct htcpld_chip, chip_in); |
| 282 | /* Use the input cache */ | 268 | cache = chip_data->cache_in; |
| 283 | val = (chip_data->cache_in >> offset) & 1; | 269 | } else |
| 270 | return -EINVAL; | ||
| 284 | 271 | ||
| 285 | if (val) | 272 | return (cache >> offset) & 1; |
| 286 | return 1; | ||
| 287 | else | ||
| 288 | return 0; | ||
| 289 | } | 273 | } |
| 290 | 274 | ||
| 291 | static int htcpld_direction_output(struct gpio_chip *chip, | 275 | static int htcpld_direction_output(struct gpio_chip *chip, |
| @@ -376,7 +360,7 @@ static int htcpld_register_chip_i2c( | |||
| 376 | plat_chip_data = &pdata->chip[chip_index]; | 360 | plat_chip_data = &pdata->chip[chip_index]; |
| 377 | 361 | ||
| 378 | adapter = i2c_get_adapter(pdata->i2c_adapter_id); | 362 | adapter = i2c_get_adapter(pdata->i2c_adapter_id); |
| 379 | if (adapter == NULL) { | 363 | if (!adapter) { |
| 380 | /* Eek, no such I2C adapter! Bail out. */ | 364 | /* Eek, no such I2C adapter! Bail out. */ |
| 381 | dev_warn(dev, "Chip at i2c address 0x%x: Invalid i2c adapter %d\n", | 365 | dev_warn(dev, "Chip at i2c address 0x%x: Invalid i2c adapter %d\n", |
| 382 | plat_chip_data->addr, pdata->i2c_adapter_id); | 366 | plat_chip_data->addr, pdata->i2c_adapter_id); |
diff --git a/drivers/mfd/intel_soc_pmic_core.c b/drivers/mfd/intel_soc_pmic_core.c index 2720922f90b4..df7b0642a5b4 100644 --- a/drivers/mfd/intel_soc_pmic_core.c +++ b/drivers/mfd/intel_soc_pmic_core.c | |||
| @@ -115,6 +115,7 @@ static void intel_soc_pmic_shutdown(struct i2c_client *i2c) | |||
| 115 | return; | 115 | return; |
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | #if defined(CONFIG_PM_SLEEP) | ||
| 118 | static int intel_soc_pmic_suspend(struct device *dev) | 119 | static int intel_soc_pmic_suspend(struct device *dev) |
| 119 | { | 120 | { |
| 120 | struct intel_soc_pmic *pmic = dev_get_drvdata(dev); | 121 | struct intel_soc_pmic *pmic = dev_get_drvdata(dev); |
| @@ -132,6 +133,7 @@ static int intel_soc_pmic_resume(struct device *dev) | |||
| 132 | 133 | ||
| 133 | return 0; | 134 | return 0; |
| 134 | } | 135 | } |
| 136 | #endif | ||
| 135 | 137 | ||
| 136 | static SIMPLE_DEV_PM_OPS(intel_soc_pmic_pm_ops, intel_soc_pmic_suspend, | 138 | static SIMPLE_DEV_PM_OPS(intel_soc_pmic_pm_ops, intel_soc_pmic_suspend, |
| 137 | intel_soc_pmic_resume); | 139 | intel_soc_pmic_resume); |
diff --git a/drivers/mfd/lpc_ich.c b/drivers/mfd/lpc_ich.c index 7d8482ff5868..f35d4280b2f7 100644 --- a/drivers/mfd/lpc_ich.c +++ b/drivers/mfd/lpc_ich.c | |||
| @@ -54,6 +54,7 @@ | |||
| 54 | * document number TBD : Avoton SoC | 54 | * document number TBD : Avoton SoC |
| 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 | */ | 58 | */ |
| 58 | 59 | ||
| 59 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 60 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
| @@ -216,6 +217,8 @@ enum lpc_chipsets { | |||
| 216 | LPC_BAYTRAIL, /* Bay Trail SoC */ | 217 | LPC_BAYTRAIL, /* Bay Trail SoC */ |
| 217 | LPC_COLETO, /* Coleto Creek */ | 218 | LPC_COLETO, /* Coleto Creek */ |
| 218 | LPC_WPT_LP, /* Wildcat Point-LP */ | 219 | LPC_WPT_LP, /* Wildcat Point-LP */ |
| 220 | LPC_BRASWELL, /* Braswell SoC */ | ||
| 221 | LPC_9S, /* 9 Series */ | ||
| 219 | }; | 222 | }; |
| 220 | 223 | ||
| 221 | static struct lpc_ich_info lpc_chipset_info[] = { | 224 | static struct lpc_ich_info lpc_chipset_info[] = { |
| @@ -519,6 +522,14 @@ static struct lpc_ich_info lpc_chipset_info[] = { | |||
| 519 | .name = "Wildcat Point_LP", | 522 | .name = "Wildcat Point_LP", |
| 520 | .iTCO_version = 2, | 523 | .iTCO_version = 2, |
| 521 | }, | 524 | }, |
| 525 | [LPC_BRASWELL] = { | ||
| 526 | .name = "Braswell SoC", | ||
| 527 | .iTCO_version = 3, | ||
| 528 | }, | ||
| 529 | [LPC_9S] = { | ||
| 530 | .name = "9 Series", | ||
| 531 | .iTCO_version = 2, | ||
| 532 | }, | ||
| 522 | }; | 533 | }; |
| 523 | 534 | ||
| 524 | /* | 535 | /* |
| @@ -745,6 +756,12 @@ static const struct pci_device_id lpc_ich_ids[] = { | |||
| 745 | { PCI_VDEVICE(INTEL, 0x9cc6), LPC_WPT_LP}, | 756 | { PCI_VDEVICE(INTEL, 0x9cc6), LPC_WPT_LP}, |
| 746 | { PCI_VDEVICE(INTEL, 0x9cc7), LPC_WPT_LP}, | 757 | { PCI_VDEVICE(INTEL, 0x9cc7), LPC_WPT_LP}, |
| 747 | { PCI_VDEVICE(INTEL, 0x9cc9), LPC_WPT_LP}, | 758 | { PCI_VDEVICE(INTEL, 0x9cc9), LPC_WPT_LP}, |
| 759 | { PCI_VDEVICE(INTEL, 0x229c), LPC_BRASWELL}, | ||
| 760 | { PCI_VDEVICE(INTEL, 0x8cc1), LPC_9S}, | ||
| 761 | { PCI_VDEVICE(INTEL, 0x8cc2), LPC_9S}, | ||
| 762 | { PCI_VDEVICE(INTEL, 0x8cc3), LPC_9S}, | ||
| 763 | { PCI_VDEVICE(INTEL, 0x8cc4), LPC_9S}, | ||
| 764 | { PCI_VDEVICE(INTEL, 0x8cc6), LPC_9S}, | ||
| 748 | { 0, }, /* End of list */ | 765 | { 0, }, /* End of list */ |
| 749 | }; | 766 | }; |
| 750 | MODULE_DEVICE_TABLE(pci, lpc_ich_ids); | 767 | MODULE_DEVICE_TABLE(pci, lpc_ich_ids); |
diff --git a/drivers/mfd/lpc_sch.c b/drivers/mfd/lpc_sch.c index 4ee755034f3b..c980da479a35 100644 --- a/drivers/mfd/lpc_sch.c +++ b/drivers/mfd/lpc_sch.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | * Configuration Registers. | 7 | * Configuration Registers. |
| 8 | * | 8 | * |
| 9 | * Copyright (c) 2010 CompuLab Ltd | 9 | * Copyright (c) 2010 CompuLab Ltd |
| 10 | * Copyright (c) 2014 Intel Corp. | ||
| 10 | * Author: Denis Turischev <denis@compulab.co.il> | 11 | * Author: Denis Turischev <denis@compulab.co.il> |
| 11 | * | 12 | * |
| 12 | * This program is free software; you can redistribute it and/or modify | 13 | * This program is free software; you can redistribute it and/or modify |
| @@ -17,10 +18,6 @@ | |||
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 | * GNU General Public License for more details. | 20 | * GNU General Public License for more details. |
| 20 | * | ||
| 21 | * You should have received a copy of the GNU General Public License | ||
| 22 | * along with this program; see the file COPYING. If not, write to | ||
| 23 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 24 | */ | 21 | */ |
| 25 | 22 | ||
| 26 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
| @@ -37,123 +34,165 @@ | |||
| 37 | #define GPIO_IO_SIZE 64 | 34 | #define GPIO_IO_SIZE 64 |
| 38 | #define GPIO_IO_SIZE_CENTERTON 128 | 35 | #define GPIO_IO_SIZE_CENTERTON 128 |
| 39 | 36 | ||
| 37 | /* Intel Quark X1000 GPIO IRQ Number */ | ||
| 38 | #define GPIO_IRQ_QUARK_X1000 9 | ||
| 39 | |||
| 40 | #define WDTBASE 0x84 | 40 | #define WDTBASE 0x84 |
| 41 | #define WDT_IO_SIZE 64 | 41 | #define WDT_IO_SIZE 64 |
| 42 | 42 | ||
| 43 | static struct resource smbus_sch_resource = { | 43 | enum sch_chipsets { |
| 44 | .flags = IORESOURCE_IO, | 44 | LPC_SCH = 0, /* Intel Poulsbo SCH */ |
| 45 | }; | 45 | LPC_ITC, /* Intel Tunnel Creek */ |
| 46 | 46 | LPC_CENTERTON, /* Intel Centerton */ | |
| 47 | static struct resource gpio_sch_resource = { | 47 | LPC_QUARK_X1000, /* Intel Quark X1000 */ |
| 48 | .flags = IORESOURCE_IO, | ||
| 49 | }; | ||
| 50 | |||
| 51 | static struct resource wdt_sch_resource = { | ||
| 52 | .flags = IORESOURCE_IO, | ||
| 53 | }; | 48 | }; |
| 54 | 49 | ||
| 55 | static struct mfd_cell lpc_sch_cells[3]; | 50 | struct lpc_sch_info { |
| 56 | 51 | unsigned int io_size_smbus; | |
| 57 | static struct mfd_cell isch_smbus_cell = { | 52 | unsigned int io_size_gpio; |
| 58 | .name = "isch_smbus", | 53 | unsigned int io_size_wdt; |
| 59 | .num_resources = 1, | 54 | int irq_gpio; |
| 60 | .resources = &smbus_sch_resource, | ||
| 61 | .ignore_resource_conflicts = true, | ||
| 62 | }; | 55 | }; |
| 63 | 56 | ||
| 64 | static struct mfd_cell sch_gpio_cell = { | 57 | static struct lpc_sch_info sch_chipset_info[] = { |
| 65 | .name = "sch_gpio", | 58 | [LPC_SCH] = { |
| 66 | .num_resources = 1, | 59 | .io_size_smbus = SMBUS_IO_SIZE, |
| 67 | .resources = &gpio_sch_resource, | 60 | .io_size_gpio = GPIO_IO_SIZE, |
| 68 | .ignore_resource_conflicts = true, | 61 | .irq_gpio = -1, |
| 69 | }; | 62 | }, |
| 70 | 63 | [LPC_ITC] = { | |
| 71 | static struct mfd_cell wdt_sch_cell = { | 64 | .io_size_smbus = SMBUS_IO_SIZE, |
| 72 | .name = "ie6xx_wdt", | 65 | .io_size_gpio = GPIO_IO_SIZE, |
| 73 | .num_resources = 1, | 66 | .io_size_wdt = WDT_IO_SIZE, |
| 74 | .resources = &wdt_sch_resource, | 67 | .irq_gpio = -1, |
| 75 | .ignore_resource_conflicts = true, | 68 | }, |
| 69 | [LPC_CENTERTON] = { | ||
| 70 | .io_size_smbus = SMBUS_IO_SIZE, | ||
| 71 | .io_size_gpio = GPIO_IO_SIZE_CENTERTON, | ||
| 72 | .io_size_wdt = WDT_IO_SIZE, | ||
| 73 | .irq_gpio = -1, | ||
| 74 | }, | ||
| 75 | [LPC_QUARK_X1000] = { | ||
| 76 | .io_size_gpio = GPIO_IO_SIZE, | ||
| 77 | .irq_gpio = GPIO_IRQ_QUARK_X1000, | ||
| 78 | }, | ||
| 76 | }; | 79 | }; |
| 77 | 80 | ||
| 78 | static const struct pci_device_id lpc_sch_ids[] = { | 81 | static const struct pci_device_id lpc_sch_ids[] = { |
| 79 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SCH_LPC) }, | 82 | { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_SCH_LPC), LPC_SCH }, |
| 80 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ITC_LPC) }, | 83 | { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ITC_LPC), LPC_ITC }, |
| 81 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CENTERTON_ILB) }, | 84 | { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_CENTERTON_ILB), LPC_CENTERTON }, |
| 85 | { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_QUARK_X1000_ILB), LPC_QUARK_X1000 }, | ||
| 82 | { 0, } | 86 | { 0, } |
| 83 | }; | 87 | }; |
| 84 | MODULE_DEVICE_TABLE(pci, lpc_sch_ids); | 88 | MODULE_DEVICE_TABLE(pci, lpc_sch_ids); |
| 85 | 89 | ||
| 86 | static int lpc_sch_probe(struct pci_dev *dev, | 90 | #define LPC_NO_RESOURCE 1 |
| 87 | const struct pci_device_id *id) | 91 | #define LPC_SKIP_RESOURCE 2 |
| 92 | |||
| 93 | static int lpc_sch_get_io(struct pci_dev *pdev, int where, const char *name, | ||
| 94 | struct resource *res, int size) | ||
| 88 | { | 95 | { |
| 89 | unsigned int base_addr_cfg; | 96 | unsigned int base_addr_cfg; |
| 90 | unsigned short base_addr; | 97 | unsigned short base_addr; |
| 91 | int i, cells = 0; | ||
| 92 | int ret; | ||
| 93 | 98 | ||
| 94 | pci_read_config_dword(dev, SMBASE, &base_addr_cfg); | 99 | if (size == 0) |
| 100 | return LPC_NO_RESOURCE; | ||
| 101 | |||
| 102 | pci_read_config_dword(pdev, where, &base_addr_cfg); | ||
| 95 | base_addr = 0; | 103 | base_addr = 0; |
| 96 | if (!(base_addr_cfg & (1 << 31))) | 104 | if (!(base_addr_cfg & (1 << 31))) |
| 97 | dev_warn(&dev->dev, "Decode of the SMBus I/O range disabled\n"); | 105 | dev_warn(&pdev->dev, "Decode of the %s I/O range disabled\n", |
| 106 | name); | ||
| 98 | else | 107 | else |
| 99 | base_addr = (unsigned short)base_addr_cfg; | 108 | base_addr = (unsigned short)base_addr_cfg; |
| 100 | 109 | ||
| 101 | if (base_addr == 0) { | 110 | if (base_addr == 0) { |
| 102 | dev_warn(&dev->dev, "I/O space for SMBus uninitialized\n"); | 111 | dev_warn(&pdev->dev, "I/O space for %s uninitialized\n", name); |
| 103 | } else { | 112 | return LPC_SKIP_RESOURCE; |
| 104 | lpc_sch_cells[cells++] = isch_smbus_cell; | ||
| 105 | smbus_sch_resource.start = base_addr; | ||
| 106 | smbus_sch_resource.end = base_addr + SMBUS_IO_SIZE - 1; | ||
| 107 | } | 113 | } |
| 108 | 114 | ||
| 109 | pci_read_config_dword(dev, GPIOBASE, &base_addr_cfg); | 115 | res->start = base_addr; |
| 110 | base_addr = 0; | 116 | res->end = base_addr + size - 1; |
| 111 | if (!(base_addr_cfg & (1 << 31))) | 117 | res->flags = IORESOURCE_IO; |
| 112 | dev_warn(&dev->dev, "Decode of the GPIO I/O range disabled\n"); | ||
| 113 | else | ||
| 114 | base_addr = (unsigned short)base_addr_cfg; | ||
| 115 | 118 | ||
| 116 | if (base_addr == 0) { | 119 | return 0; |
| 117 | dev_warn(&dev->dev, "I/O space for GPIO uninitialized\n"); | 120 | } |
| 118 | } else { | ||
| 119 | lpc_sch_cells[cells++] = sch_gpio_cell; | ||
| 120 | gpio_sch_resource.start = base_addr; | ||
| 121 | if (id->device == PCI_DEVICE_ID_INTEL_CENTERTON_ILB) | ||
| 122 | gpio_sch_resource.end = base_addr + GPIO_IO_SIZE_CENTERTON - 1; | ||
| 123 | else | ||
| 124 | gpio_sch_resource.end = base_addr + GPIO_IO_SIZE - 1; | ||
| 125 | } | ||
| 126 | 121 | ||
| 127 | if (id->device == PCI_DEVICE_ID_INTEL_ITC_LPC | 122 | static int lpc_sch_populate_cell(struct pci_dev *pdev, int where, |
| 128 | || id->device == PCI_DEVICE_ID_INTEL_CENTERTON_ILB) { | 123 | const char *name, int size, int irq, |
| 129 | pci_read_config_dword(dev, WDTBASE, &base_addr_cfg); | 124 | int id, struct mfd_cell *cell) |
| 130 | base_addr = 0; | 125 | { |
| 131 | if (!(base_addr_cfg & (1 << 31))) | 126 | struct resource *res; |
| 132 | dev_warn(&dev->dev, "Decode of the WDT I/O range disabled\n"); | 127 | int ret; |
| 133 | else | ||
| 134 | base_addr = (unsigned short)base_addr_cfg; | ||
| 135 | if (base_addr == 0) | ||
| 136 | dev_warn(&dev->dev, "I/O space for WDT uninitialized\n"); | ||
| 137 | else { | ||
| 138 | lpc_sch_cells[cells++] = wdt_sch_cell; | ||
| 139 | wdt_sch_resource.start = base_addr; | ||
| 140 | wdt_sch_resource.end = base_addr + WDT_IO_SIZE - 1; | ||
| 141 | } | ||
| 142 | } | ||
| 143 | 128 | ||
| 144 | if (WARN_ON(cells > ARRAY_SIZE(lpc_sch_cells))) { | 129 | res = devm_kcalloc(&pdev->dev, 2, sizeof(*res), GFP_KERNEL); |
| 145 | dev_err(&dev->dev, "Cell count exceeds array size"); | 130 | if (!res) |
| 146 | return -ENODEV; | 131 | return -ENOMEM; |
| 147 | } | 132 | |
| 133 | ret = lpc_sch_get_io(pdev, where, name, res, size); | ||
| 134 | if (ret) | ||
| 135 | return ret; | ||
| 136 | |||
| 137 | memset(cell, 0, sizeof(*cell)); | ||
| 138 | |||
| 139 | cell->name = name; | ||
| 140 | cell->resources = res; | ||
| 141 | cell->num_resources = 1; | ||
| 142 | cell->ignore_resource_conflicts = true; | ||
| 143 | cell->id = id; | ||
| 144 | |||
| 145 | /* Check if we need to add an IRQ resource */ | ||
| 146 | if (irq < 0) | ||
| 147 | return 0; | ||
| 148 | |||
| 149 | res++; | ||
| 150 | |||
| 151 | res->start = irq; | ||
| 152 | res->end = irq; | ||
| 153 | res->flags = IORESOURCE_IRQ; | ||
| 154 | |||
| 155 | cell->num_resources++; | ||
| 156 | |||
| 157 | return 0; | ||
| 158 | } | ||
| 159 | |||
| 160 | static int lpc_sch_probe(struct pci_dev *dev, const struct pci_device_id *id) | ||
| 161 | { | ||
| 162 | struct mfd_cell lpc_sch_cells[3]; | ||
| 163 | struct lpc_sch_info *info = &sch_chipset_info[id->driver_data]; | ||
| 164 | unsigned int cells = 0; | ||
| 165 | int ret; | ||
| 166 | |||
| 167 | ret = lpc_sch_populate_cell(dev, SMBASE, "isch_smbus", | ||
| 168 | info->io_size_smbus, -1, | ||
| 169 | id->device, &lpc_sch_cells[cells]); | ||
| 170 | if (ret < 0) | ||
| 171 | return ret; | ||
| 172 | if (ret == 0) | ||
| 173 | cells++; | ||
| 174 | |||
| 175 | ret = lpc_sch_populate_cell(dev, GPIOBASE, "sch_gpio", | ||
| 176 | info->io_size_gpio, info->irq_gpio, | ||
| 177 | id->device, &lpc_sch_cells[cells]); | ||
| 178 | if (ret < 0) | ||
| 179 | return ret; | ||
| 180 | if (ret == 0) | ||
| 181 | cells++; | ||
| 182 | |||
| 183 | ret = lpc_sch_populate_cell(dev, WDTBASE, "ie6xx_wdt", | ||
| 184 | info->io_size_wdt, -1, | ||
| 185 | id->device, &lpc_sch_cells[cells]); | ||
| 186 | if (ret < 0) | ||
| 187 | return ret; | ||
| 188 | if (ret == 0) | ||
| 189 | cells++; | ||
| 148 | 190 | ||
| 149 | if (cells == 0) { | 191 | if (cells == 0) { |
| 150 | dev_err(&dev->dev, "All decode registers disabled.\n"); | 192 | dev_err(&dev->dev, "All decode registers disabled.\n"); |
| 151 | return -ENODEV; | 193 | return -ENODEV; |
| 152 | } | 194 | } |
| 153 | 195 | ||
| 154 | for (i = 0; i < cells; i++) | ||
| 155 | lpc_sch_cells[i].id = id->device; | ||
| 156 | |||
| 157 | ret = mfd_add_devices(&dev->dev, 0, lpc_sch_cells, cells, NULL, 0, NULL); | 196 | ret = mfd_add_devices(&dev->dev, 0, lpc_sch_cells, cells, NULL, 0, NULL); |
| 158 | if (ret) | 197 | if (ret) |
| 159 | mfd_remove_devices(&dev->dev); | 198 | mfd_remove_devices(&dev->dev); |
diff --git a/drivers/mfd/max14577.c b/drivers/mfd/max14577.c index b8af263be594..de96b7fb1f6d 100644 --- a/drivers/mfd/max14577.c +++ b/drivers/mfd/max14577.c | |||
| @@ -456,8 +456,7 @@ static int max14577_i2c_probe(struct i2c_client *i2c, | |||
| 456 | } | 456 | } |
| 457 | 457 | ||
| 458 | ret = mfd_add_devices(max14577->dev, -1, mfd_devs, | 458 | ret = mfd_add_devices(max14577->dev, -1, mfd_devs, |
| 459 | mfd_devs_size, NULL, 0, | 459 | mfd_devs_size, NULL, 0, NULL); |
| 460 | regmap_irq_get_domain(max14577->irq_data)); | ||
| 461 | if (ret < 0) | 460 | if (ret < 0) |
| 462 | goto err_mfd; | 461 | goto err_mfd; |
| 463 | 462 | ||
diff --git a/drivers/mfd/max77686.c b/drivers/mfd/max77686.c index 86e552348db4..929795eae9fc 100644 --- a/drivers/mfd/max77686.c +++ b/drivers/mfd/max77686.c | |||
| @@ -52,7 +52,7 @@ static const struct mfd_cell max77802_devs[] = { | |||
| 52 | static bool max77802_pmic_is_accessible_reg(struct device *dev, | 52 | static bool max77802_pmic_is_accessible_reg(struct device *dev, |
| 53 | unsigned int reg) | 53 | unsigned int reg) |
| 54 | { | 54 | { |
| 55 | return (reg >= MAX77802_REG_DEVICE_ID && reg < MAX77802_REG_PMIC_END); | 55 | return reg < MAX77802_REG_PMIC_END; |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | static bool max77802_rtc_is_accessible_reg(struct device *dev, | 58 | static bool max77802_rtc_is_accessible_reg(struct device *dev, |
diff --git a/drivers/mfd/max77693.c b/drivers/mfd/max77693.c index 249c139ef04a..cf008f45968c 100644 --- a/drivers/mfd/max77693.c +++ b/drivers/mfd/max77693.c | |||
| @@ -44,9 +44,12 @@ | |||
| 44 | static const struct mfd_cell max77693_devs[] = { | 44 | static const struct mfd_cell max77693_devs[] = { |
| 45 | { .name = "max77693-pmic", }, | 45 | { .name = "max77693-pmic", }, |
| 46 | { .name = "max77693-charger", }, | 46 | { .name = "max77693-charger", }, |
| 47 | { .name = "max77693-flash", }, | ||
| 48 | { .name = "max77693-muic", }, | 47 | { .name = "max77693-muic", }, |
| 49 | { .name = "max77693-haptic", }, | 48 | { .name = "max77693-haptic", }, |
| 49 | { | ||
| 50 | .name = "max77693-flash", | ||
| 51 | .of_compatible = "maxim,max77693-flash", | ||
| 52 | }, | ||
| 50 | }; | 53 | }; |
| 51 | 54 | ||
| 52 | static const struct regmap_config max77693_regmap_config = { | 55 | static const struct regmap_config max77693_regmap_config = { |
diff --git a/drivers/mfd/max8925-i2c.c b/drivers/mfd/max8925-i2c.c index ecbe78ead3b6..c880c895c5a6 100644 --- a/drivers/mfd/max8925-i2c.c +++ b/drivers/mfd/max8925-i2c.c | |||
| @@ -37,7 +37,7 @@ static inline int max8925_read_device(struct i2c_client *i2c, | |||
| 37 | static inline int max8925_write_device(struct i2c_client *i2c, | 37 | static inline int max8925_write_device(struct i2c_client *i2c, |
| 38 | int reg, int bytes, void *src) | 38 | int reg, int bytes, void *src) |
| 39 | { | 39 | { |
| 40 | unsigned char buf[bytes + 1]; | 40 | unsigned char buf[9]; |
| 41 | int ret; | 41 | int ret; |
| 42 | 42 | ||
| 43 | buf[0] = (unsigned char)reg; | 43 | buf[0] = (unsigned char)reg; |
diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c index 2b6bc868cd3d..64dde5d24b32 100644 --- a/drivers/mfd/mc13xxx-core.c +++ b/drivers/mfd/mc13xxx-core.c | |||
| @@ -36,6 +36,9 @@ | |||
| 36 | #define MC34708_REVISION_FIN (0x07 << 6) | 36 | #define MC34708_REVISION_FIN (0x07 << 6) |
| 37 | #define MC34708_REVISION_FAB (0x07 << 9) | 37 | #define MC34708_REVISION_FAB (0x07 << 9) |
| 38 | 38 | ||
| 39 | #define MC13XXX_PWRCTRL 15 | ||
| 40 | #define MC13XXX_PWRCTRL_WDIRESET (1 << 12) | ||
| 41 | |||
| 39 | #define MC13XXX_ADC1 44 | 42 | #define MC13XXX_ADC1 44 |
| 40 | #define MC13XXX_ADC1_ADEN (1 << 0) | 43 | #define MC13XXX_ADC1_ADEN (1 << 0) |
| 41 | #define MC13XXX_ADC1_RAND (1 << 1) | 44 | #define MC13XXX_ADC1_RAND (1 << 1) |
| @@ -416,6 +419,11 @@ int mc13xxx_common_init(struct device *dev) | |||
| 416 | 419 | ||
| 417 | mc13xxx->variant->print_revision(mc13xxx, revision); | 420 | mc13xxx->variant->print_revision(mc13xxx, revision); |
| 418 | 421 | ||
| 422 | ret = mc13xxx_reg_rmw(mc13xxx, MC13XXX_PWRCTRL, | ||
| 423 | MC13XXX_PWRCTRL_WDIRESET, MC13XXX_PWRCTRL_WDIRESET); | ||
| 424 | if (ret) | ||
| 425 | return ret; | ||
| 426 | |||
| 419 | for (i = 0; i < ARRAY_SIZE(mc13xxx->irqs); i++) { | 427 | for (i = 0; i < ARRAY_SIZE(mc13xxx->irqs); i++) { |
| 420 | mc13xxx->irqs[i].reg_offset = i / MC13XXX_IRQ_PER_REG; | 428 | mc13xxx->irqs[i].reg_offset = i / MC13XXX_IRQ_PER_REG; |
| 421 | mc13xxx->irqs[i].mask = BIT(i % MC13XXX_IRQ_PER_REG); | 429 | mc13xxx->irqs[i].mask = BIT(i % MC13XXX_IRQ_PER_REG); |
diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c index 5e2667afe2bc..9f01aef539dd 100644 --- a/drivers/mfd/menelaus.c +++ b/drivers/mfd/menelaus.c | |||
| @@ -466,8 +466,6 @@ static int menelaus_set_voltage(const struct menelaus_vtg *vtg, int mV, | |||
| 466 | struct i2c_client *c = the_menelaus->client; | 466 | struct i2c_client *c = the_menelaus->client; |
| 467 | 467 | ||
| 468 | mutex_lock(&the_menelaus->lock); | 468 | mutex_lock(&the_menelaus->lock); |
| 469 | if (!vtg) | ||
| 470 | goto set_voltage; | ||
| 471 | 469 | ||
| 472 | ret = menelaus_read_reg(vtg->vtg_reg); | 470 | ret = menelaus_read_reg(vtg->vtg_reg); |
| 473 | if (ret < 0) | 471 | if (ret < 0) |
| @@ -482,7 +480,6 @@ static int menelaus_set_voltage(const struct menelaus_vtg *vtg, int mV, | |||
| 482 | ret = menelaus_write_reg(vtg->vtg_reg, val); | 480 | ret = menelaus_write_reg(vtg->vtg_reg, val); |
| 483 | if (ret < 0) | 481 | if (ret < 0) |
| 484 | goto out; | 482 | goto out; |
| 485 | set_voltage: | ||
| 486 | ret = menelaus_write_reg(vtg->mode_reg, mode); | 483 | ret = menelaus_write_reg(vtg->mode_reg, mode); |
| 487 | out: | 484 | out: |
| 488 | mutex_unlock(&the_menelaus->lock); | 485 | mutex_unlock(&the_menelaus->lock); |
| @@ -1186,7 +1183,7 @@ static int menelaus_probe(struct i2c_client *client, | |||
| 1186 | const struct i2c_device_id *id) | 1183 | const struct i2c_device_id *id) |
| 1187 | { | 1184 | { |
| 1188 | struct menelaus_chip *menelaus; | 1185 | struct menelaus_chip *menelaus; |
| 1189 | int rev = 0, val; | 1186 | int rev = 0; |
| 1190 | int err = 0; | 1187 | int err = 0; |
| 1191 | struct menelaus_platform_data *menelaus_pdata = | 1188 | struct menelaus_platform_data *menelaus_pdata = |
| 1192 | dev_get_platdata(&client->dev); | 1189 | dev_get_platdata(&client->dev); |
| @@ -1239,10 +1236,10 @@ static int menelaus_probe(struct i2c_client *client, | |||
| 1239 | 1236 | ||
| 1240 | pr_info("Menelaus rev %d.%d\n", rev >> 4, rev & 0x0f); | 1237 | pr_info("Menelaus rev %d.%d\n", rev >> 4, rev & 0x0f); |
| 1241 | 1238 | ||
| 1242 | val = menelaus_read_reg(MENELAUS_VCORE_CTRL1); | 1239 | err = menelaus_read_reg(MENELAUS_VCORE_CTRL1); |
| 1243 | if (val < 0) | 1240 | if (err < 0) |
| 1244 | goto fail; | 1241 | goto fail; |
| 1245 | if (val & (1 << 7)) | 1242 | if (err & BIT(7)) |
| 1246 | menelaus->vcore_hw_mode = 1; | 1243 | menelaus->vcore_hw_mode = 1; |
| 1247 | else | 1244 | else |
| 1248 | menelaus->vcore_hw_mode = 0; | 1245 | menelaus->vcore_hw_mode = 0; |
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c index 892d343193ad..f3338fe9d069 100644 --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c | |||
| @@ -78,6 +78,44 @@ static int mfd_platform_add_cell(struct platform_device *pdev, | |||
| 78 | return 0; | 78 | return 0; |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | #if IS_ENABLED(CONFIG_ACPI) | ||
| 82 | static void mfd_acpi_add_device(const struct mfd_cell *cell, | ||
| 83 | struct platform_device *pdev) | ||
| 84 | { | ||
| 85 | struct acpi_device *parent_adev; | ||
| 86 | struct acpi_device *adev; | ||
| 87 | |||
| 88 | parent_adev = ACPI_COMPANION(pdev->dev.parent); | ||
| 89 | if (!parent_adev) | ||
| 90 | return; | ||
| 91 | |||
| 92 | /* | ||
| 93 | * MFD child device gets its ACPI handle either from the ACPI | ||
| 94 | * device directly under the parent that matches the acpi_pnpid or | ||
| 95 | * it will use the parent handle if is no acpi_pnpid is given. | ||
| 96 | */ | ||
| 97 | adev = parent_adev; | ||
| 98 | if (cell->acpi_pnpid) { | ||
| 99 | struct acpi_device_id ids[2] = {}; | ||
| 100 | struct acpi_device *child_adev; | ||
| 101 | |||
| 102 | strlcpy(ids[0].id, cell->acpi_pnpid, sizeof(ids[0].id)); | ||
| 103 | list_for_each_entry(child_adev, &parent_adev->children, node) | ||
| 104 | if (acpi_match_device_ids(child_adev, ids)) { | ||
| 105 | adev = child_adev; | ||
| 106 | break; | ||
| 107 | } | ||
| 108 | } | ||
| 109 | |||
| 110 | ACPI_COMPANION_SET(&pdev->dev, adev); | ||
| 111 | } | ||
| 112 | #else | ||
| 113 | static inline void mfd_acpi_add_device(const struct mfd_cell *cell, | ||
| 114 | struct platform_device *pdev) | ||
| 115 | { | ||
| 116 | } | ||
| 117 | #endif | ||
| 118 | |||
| 81 | static int mfd_add_device(struct device *parent, int id, | 119 | static int mfd_add_device(struct device *parent, int id, |
| 82 | const struct mfd_cell *cell, atomic_t *usage_count, | 120 | const struct mfd_cell *cell, atomic_t *usage_count, |
| 83 | struct resource *mem_base, | 121 | struct resource *mem_base, |
| @@ -101,6 +139,7 @@ static int mfd_add_device(struct device *parent, int id, | |||
| 101 | pdev->dev.type = &mfd_dev_type; | 139 | pdev->dev.type = &mfd_dev_type; |
| 102 | pdev->dev.dma_mask = parent->dma_mask; | 140 | pdev->dev.dma_mask = parent->dma_mask; |
| 103 | pdev->dev.dma_parms = parent->dma_parms; | 141 | pdev->dev.dma_parms = parent->dma_parms; |
| 142 | pdev->dev.coherent_dma_mask = parent->coherent_dma_mask; | ||
| 104 | 143 | ||
| 105 | ret = regulator_bulk_register_supply_alias( | 144 | ret = regulator_bulk_register_supply_alias( |
| 106 | &pdev->dev, cell->parent_supplies, | 145 | &pdev->dev, cell->parent_supplies, |
| @@ -118,6 +157,8 @@ static int mfd_add_device(struct device *parent, int id, | |||
| 118 | } | 157 | } |
| 119 | } | 158 | } |
| 120 | 159 | ||
| 160 | mfd_acpi_add_device(cell, pdev); | ||
| 161 | |||
| 121 | if (cell->pdata_size) { | 162 | if (cell->pdata_size) { |
| 122 | ret = platform_device_add_data(pdev, | 163 | ret = platform_device_add_data(pdev, |
| 123 | cell->platform_data, cell->pdata_size); | 164 | cell->platform_data, cell->pdata_size); |
diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c index c87f7a0a53f8..43664eb69c93 100644 --- a/drivers/mfd/pcf50633-core.c +++ b/drivers/mfd/pcf50633-core.c | |||
| @@ -106,10 +106,7 @@ static ssize_t show_dump_regs(struct device *dev, struct device_attribute *attr, | |||
| 106 | } else | 106 | } else |
| 107 | dump[n1] = pcf50633_reg_read(pcf, n + n1); | 107 | dump[n1] = pcf50633_reg_read(pcf, n + n1); |
| 108 | 108 | ||
| 109 | hex_dump_to_buffer(dump, sizeof(dump), 16, 1, buf1, 128, 0); | 109 | buf1 += sprintf(buf1, "%*ph\n", (int)sizeof(dump), dump); |
| 110 | buf1 += strlen(buf1); | ||
| 111 | *buf1++ = '\n'; | ||
| 112 | *buf1 = '\0'; | ||
| 113 | } | 110 | } |
| 114 | 111 | ||
| 115 | return buf1 - buf; | 112 | return buf1 - buf; |
| @@ -195,8 +192,9 @@ static int pcf50633_probe(struct i2c_client *client, | |||
| 195 | const struct i2c_device_id *ids) | 192 | const struct i2c_device_id *ids) |
| 196 | { | 193 | { |
| 197 | struct pcf50633 *pcf; | 194 | struct pcf50633 *pcf; |
| 195 | struct platform_device *pdev; | ||
| 198 | struct pcf50633_platform_data *pdata = dev_get_platdata(&client->dev); | 196 | struct pcf50633_platform_data *pdata = dev_get_platdata(&client->dev); |
| 199 | int i, ret; | 197 | int i, j, ret; |
| 200 | int version, variant; | 198 | int version, variant; |
| 201 | 199 | ||
| 202 | if (!client->irq) { | 200 | if (!client->irq) { |
| @@ -243,9 +241,6 @@ static int pcf50633_probe(struct i2c_client *client, | |||
| 243 | 241 | ||
| 244 | 242 | ||
| 245 | for (i = 0; i < PCF50633_NUM_REGULATORS; i++) { | 243 | for (i = 0; i < PCF50633_NUM_REGULATORS; i++) { |
| 246 | struct platform_device *pdev; | ||
| 247 | int j; | ||
| 248 | |||
| 249 | pdev = platform_device_alloc("pcf50633-regulator", i); | 244 | pdev = platform_device_alloc("pcf50633-regulator", i); |
| 250 | if (!pdev) | 245 | if (!pdev) |
| 251 | return -ENOMEM; | 246 | return -ENOMEM; |
| @@ -253,25 +248,31 @@ static int pcf50633_probe(struct i2c_client *client, | |||
| 253 | pdev->dev.parent = pcf->dev; | 248 | pdev->dev.parent = pcf->dev; |
| 254 | ret = platform_device_add_data(pdev, &pdata->reg_init_data[i], | 249 | ret = platform_device_add_data(pdev, &pdata->reg_init_data[i], |
| 255 | sizeof(pdata->reg_init_data[i])); | 250 | sizeof(pdata->reg_init_data[i])); |
| 256 | if (ret) { | 251 | if (ret) |
| 257 | platform_device_put(pdev); | 252 | goto err; |
| 258 | for (j = 0; j < i; j++) | 253 | |
| 259 | platform_device_put(pcf->regulator_pdev[j]); | 254 | ret = platform_device_add(pdev); |
| 260 | return ret; | 255 | if (ret) |
| 261 | } | 256 | goto err; |
| 262 | pcf->regulator_pdev[i] = pdev; | ||
| 263 | 257 | ||
| 264 | platform_device_add(pdev); | 258 | pcf->regulator_pdev[i] = pdev; |
| 265 | } | 259 | } |
| 266 | 260 | ||
| 267 | ret = sysfs_create_group(&client->dev.kobj, &pcf_attr_group); | 261 | ret = sysfs_create_group(&client->dev.kobj, &pcf_attr_group); |
| 268 | if (ret) | 262 | if (ret) |
| 269 | dev_err(pcf->dev, "error creating sysfs entries\n"); | 263 | dev_warn(pcf->dev, "error creating sysfs entries\n"); |
| 270 | 264 | ||
| 271 | if (pdata->probe_done) | 265 | if (pdata->probe_done) |
| 272 | pdata->probe_done(pcf); | 266 | pdata->probe_done(pcf); |
| 273 | 267 | ||
| 274 | return 0; | 268 | return 0; |
| 269 | |||
| 270 | err: | ||
| 271 | platform_device_put(pdev); | ||
| 272 | for (j = 0; j < i; j++) | ||
| 273 | platform_device_put(pcf->regulator_pdev[j]); | ||
| 274 | |||
| 275 | return ret; | ||
| 275 | } | 276 | } |
| 276 | 277 | ||
| 277 | static int pcf50633_remove(struct i2c_client *client) | 278 | static int pcf50633_remove(struct i2c_client *client) |
diff --git a/drivers/mfd/qcom-spmi-pmic.c b/drivers/mfd/qcom-spmi-pmic.c new file mode 100644 index 000000000000..4b8beb2a1579 --- /dev/null +++ b/drivers/mfd/qcom-spmi-pmic.c | |||
| @@ -0,0 +1,67 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2014, The Linux Foundation. All rights reserved. | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License version 2 and | ||
| 6 | * only version 2 as published by the Free Software Foundation. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <linux/kernel.h> | ||
| 15 | #include <linux/module.h> | ||
| 16 | #include <linux/spmi.h> | ||
| 17 | #include <linux/regmap.h> | ||
| 18 | #include <linux/of_platform.h> | ||
| 19 | |||
| 20 | static const struct regmap_config spmi_regmap_config = { | ||
| 21 | .reg_bits = 16, | ||
| 22 | .val_bits = 8, | ||
| 23 | .max_register = 0xffff, | ||
| 24 | .fast_io = true, | ||
| 25 | }; | ||
| 26 | |||
| 27 | static int pmic_spmi_probe(struct spmi_device *sdev) | ||
| 28 | { | ||
| 29 | struct device_node *root = sdev->dev.of_node; | ||
| 30 | struct regmap *regmap; | ||
| 31 | |||
| 32 | regmap = devm_regmap_init_spmi_ext(sdev, &spmi_regmap_config); | ||
| 33 | if (IS_ERR(regmap)) | ||
| 34 | return PTR_ERR(regmap); | ||
| 35 | |||
| 36 | return of_platform_populate(root, NULL, NULL, &sdev->dev); | ||
| 37 | } | ||
| 38 | |||
| 39 | static void pmic_spmi_remove(struct spmi_device *sdev) | ||
| 40 | { | ||
| 41 | of_platform_depopulate(&sdev->dev); | ||
| 42 | } | ||
| 43 | |||
| 44 | static const struct of_device_id pmic_spmi_id_table[] = { | ||
| 45 | { .compatible = "qcom,spmi-pmic" }, | ||
| 46 | { .compatible = "qcom,pm8941" }, | ||
| 47 | { .compatible = "qcom,pm8841" }, | ||
| 48 | { .compatible = "qcom,pma8084" }, | ||
| 49 | { } | ||
| 50 | }; | ||
| 51 | MODULE_DEVICE_TABLE(of, pmic_spmi_id_table); | ||
| 52 | |||
| 53 | static struct spmi_driver pmic_spmi_driver = { | ||
| 54 | .probe = pmic_spmi_probe, | ||
| 55 | .remove = pmic_spmi_remove, | ||
| 56 | .driver = { | ||
| 57 | .name = "pmic-spmi", | ||
| 58 | .of_match_table = pmic_spmi_id_table, | ||
| 59 | }, | ||
| 60 | }; | ||
| 61 | module_spmi_driver(pmic_spmi_driver); | ||
| 62 | |||
| 63 | MODULE_DESCRIPTION("Qualcomm SPMI PMIC driver"); | ||
| 64 | MODULE_ALIAS("spmi:spmi-pmic"); | ||
| 65 | MODULE_LICENSE("GPL v2"); | ||
| 66 | MODULE_AUTHOR("Josh Cartwright <joshc@codeaurora.org>"); | ||
| 67 | MODULE_AUTHOR("Stanimir Varbanov <svarbanov@mm-sol.com>"); | ||
diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c new file mode 100644 index 000000000000..bd0215069875 --- /dev/null +++ b/drivers/mfd/rk808.c | |||
| @@ -0,0 +1,275 @@ | |||
| 1 | /* | ||
| 2 | * MFD core driver for Rockchip RK808 | ||
| 3 | * | ||
| 4 | * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd | ||
| 5 | * | ||
| 6 | * Author: Chris Zhong <zyw@rock-chips.com> | ||
| 7 | * Author: Zhang Qing <zhangqing@rock-chips.com> | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify it | ||
| 10 | * under the terms and conditions of the GNU General Public License, | ||
| 11 | * version 2, as published by the Free Software Foundation. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 16 | * more details. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #include <linux/i2c.h> | ||
| 20 | #include <linux/interrupt.h> | ||
| 21 | #include <linux/mfd/rk808.h> | ||
| 22 | #include <linux/mfd/core.h> | ||
| 23 | #include <linux/module.h> | ||
| 24 | #include <linux/regmap.h> | ||
| 25 | |||
| 26 | struct rk808_reg_data { | ||
| 27 | int addr; | ||
| 28 | int mask; | ||
| 29 | int value; | ||
| 30 | }; | ||
| 31 | |||
| 32 | static bool rk808_is_volatile_reg(struct device *dev, unsigned int reg) | ||
| 33 | { | ||
| 34 | /* | ||
| 35 | * Notes: | ||
| 36 | * - Technically the ROUND_30s bit makes RTC_CTRL_REG volatile, but | ||
| 37 | * we don't use that feature. It's better to cache. | ||
| 38 | * - It's unlikely we care that RK808_DEVCTRL_REG is volatile since | ||
| 39 | * bits are cleared in case when we shutoff anyway, but better safe. | ||
| 40 | */ | ||
| 41 | |||
| 42 | switch (reg) { | ||
| 43 | case RK808_SECONDS_REG ... RK808_WEEKS_REG: | ||
| 44 | case RK808_RTC_STATUS_REG: | ||
| 45 | case RK808_VB_MON_REG: | ||
| 46 | case RK808_THERMAL_REG: | ||
| 47 | case RK808_DCDC_UV_STS_REG: | ||
| 48 | case RK808_LDO_UV_STS_REG: | ||
| 49 | case RK808_DCDC_PG_REG: | ||
| 50 | case RK808_LDO_PG_REG: | ||
| 51 | case RK808_DEVCTRL_REG: | ||
| 52 | case RK808_INT_STS_REG1: | ||
| 53 | case RK808_INT_STS_REG2: | ||
| 54 | return true; | ||
| 55 | } | ||
| 56 | |||
| 57 | return false; | ||
| 58 | } | ||
| 59 | |||
| 60 | static const struct regmap_config rk808_regmap_config = { | ||
| 61 | .reg_bits = 8, | ||
| 62 | .val_bits = 8, | ||
| 63 | .max_register = RK808_IO_POL_REG, | ||
| 64 | .cache_type = REGCACHE_RBTREE, | ||
| 65 | .volatile_reg = rk808_is_volatile_reg, | ||
| 66 | }; | ||
| 67 | |||
| 68 | static struct resource rtc_resources[] = { | ||
| 69 | { | ||
| 70 | .start = RK808_IRQ_RTC_ALARM, | ||
| 71 | .end = RK808_IRQ_RTC_ALARM, | ||
| 72 | .flags = IORESOURCE_IRQ, | ||
| 73 | } | ||
| 74 | }; | ||
| 75 | |||
| 76 | static const struct mfd_cell rk808s[] = { | ||
| 77 | { .name = "rk808-clkout", }, | ||
| 78 | { .name = "rk808-regulator", }, | ||
| 79 | { | ||
| 80 | .name = "rk808-rtc", | ||
| 81 | .num_resources = ARRAY_SIZE(rtc_resources), | ||
| 82 | .resources = &rtc_resources[0], | ||
| 83 | }, | ||
| 84 | }; | ||
| 85 | |||
| 86 | static const struct rk808_reg_data pre_init_reg[] = { | ||
| 87 | { RK808_BUCK3_CONFIG_REG, BUCK_ILMIN_MASK, BUCK_ILMIN_150MA }, | ||
| 88 | { RK808_BUCK4_CONFIG_REG, BUCK_ILMIN_MASK, BUCK_ILMIN_200MA }, | ||
| 89 | { RK808_BOOST_CONFIG_REG, BOOST_ILMIN_MASK, BOOST_ILMIN_100MA }, | ||
| 90 | { RK808_BUCK1_CONFIG_REG, BUCK1_RATE_MASK, BUCK_ILMIN_200MA }, | ||
| 91 | { RK808_BUCK2_CONFIG_REG, BUCK2_RATE_MASK, BUCK_ILMIN_200MA }, | ||
| 92 | { RK808_VB_MON_REG, MASK_ALL, VB_LO_ACT | | ||
| 93 | VB_LO_SEL_3500MV }, | ||
| 94 | }; | ||
| 95 | |||
| 96 | static const struct regmap_irq rk808_irqs[] = { | ||
| 97 | /* INT_STS */ | ||
| 98 | [RK808_IRQ_VOUT_LO] = { | ||
| 99 | .mask = RK808_IRQ_VOUT_LO_MSK, | ||
| 100 | .reg_offset = 0, | ||
| 101 | }, | ||
| 102 | [RK808_IRQ_VB_LO] = { | ||
| 103 | .mask = RK808_IRQ_VB_LO_MSK, | ||
| 104 | .reg_offset = 0, | ||
| 105 | }, | ||
| 106 | [RK808_IRQ_PWRON] = { | ||
| 107 | .mask = RK808_IRQ_PWRON_MSK, | ||
| 108 | .reg_offset = 0, | ||
| 109 | }, | ||
| 110 | [RK808_IRQ_PWRON_LP] = { | ||
| 111 | .mask = RK808_IRQ_PWRON_LP_MSK, | ||
| 112 | .reg_offset = 0, | ||
| 113 | }, | ||
| 114 | [RK808_IRQ_HOTDIE] = { | ||
| 115 | .mask = RK808_IRQ_HOTDIE_MSK, | ||
| 116 | .reg_offset = 0, | ||
| 117 | }, | ||
| 118 | [RK808_IRQ_RTC_ALARM] = { | ||
| 119 | .mask = RK808_IRQ_RTC_ALARM_MSK, | ||
| 120 | .reg_offset = 0, | ||
| 121 | }, | ||
| 122 | [RK808_IRQ_RTC_PERIOD] = { | ||
| 123 | .mask = RK808_IRQ_RTC_PERIOD_MSK, | ||
| 124 | .reg_offset = 0, | ||
| 125 | }, | ||
| 126 | |||
| 127 | /* INT_STS2 */ | ||
| 128 | [RK808_IRQ_PLUG_IN_INT] = { | ||
| 129 | .mask = RK808_IRQ_PLUG_IN_INT_MSK, | ||
| 130 | .reg_offset = 1, | ||
| 131 | }, | ||
| 132 | [RK808_IRQ_PLUG_OUT_INT] = { | ||
| 133 | .mask = RK808_IRQ_PLUG_OUT_INT_MSK, | ||
| 134 | .reg_offset = 1, | ||
| 135 | }, | ||
| 136 | }; | ||
| 137 | |||
| 138 | static struct regmap_irq_chip rk808_irq_chip = { | ||
| 139 | .name = "rk808", | ||
| 140 | .irqs = rk808_irqs, | ||
| 141 | .num_irqs = ARRAY_SIZE(rk808_irqs), | ||
| 142 | .num_regs = 2, | ||
| 143 | .irq_reg_stride = 2, | ||
| 144 | .status_base = RK808_INT_STS_REG1, | ||
| 145 | .mask_base = RK808_INT_STS_MSK_REG1, | ||
| 146 | .ack_base = RK808_INT_STS_REG1, | ||
| 147 | .init_ack_masked = true, | ||
| 148 | }; | ||
| 149 | |||
| 150 | static struct i2c_client *rk808_i2c_client; | ||
| 151 | static void rk808_device_shutdown(void) | ||
| 152 | { | ||
| 153 | int ret; | ||
| 154 | struct rk808 *rk808 = i2c_get_clientdata(rk808_i2c_client); | ||
| 155 | |||
| 156 | if (!rk808) { | ||
| 157 | dev_warn(&rk808_i2c_client->dev, | ||
| 158 | "have no rk808, so do nothing here\n"); | ||
| 159 | return; | ||
| 160 | } | ||
| 161 | |||
| 162 | ret = regmap_update_bits(rk808->regmap, | ||
| 163 | RK808_DEVCTRL_REG, | ||
| 164 | DEV_OFF_RST, DEV_OFF_RST); | ||
| 165 | if (ret) | ||
| 166 | dev_err(&rk808_i2c_client->dev, "power off error!\n"); | ||
| 167 | } | ||
| 168 | |||
| 169 | static int rk808_probe(struct i2c_client *client, | ||
| 170 | const struct i2c_device_id *id) | ||
| 171 | { | ||
| 172 | struct device_node *np = client->dev.of_node; | ||
| 173 | struct rk808 *rk808; | ||
| 174 | int pm_off = 0; | ||
| 175 | int ret; | ||
| 176 | int i; | ||
| 177 | |||
| 178 | if (!client->irq) { | ||
| 179 | dev_err(&client->dev, "No interrupt support, no core IRQ\n"); | ||
| 180 | return -EINVAL; | ||
| 181 | } | ||
| 182 | |||
| 183 | rk808 = devm_kzalloc(&client->dev, sizeof(*rk808), GFP_KERNEL); | ||
| 184 | if (!rk808) | ||
| 185 | return -ENOMEM; | ||
| 186 | |||
| 187 | rk808->regmap = devm_regmap_init_i2c(client, &rk808_regmap_config); | ||
| 188 | if (IS_ERR(rk808->regmap)) { | ||
| 189 | dev_err(&client->dev, "regmap initialization failed\n"); | ||
| 190 | return PTR_ERR(rk808->regmap); | ||
| 191 | } | ||
| 192 | |||
| 193 | for (i = 0; i < ARRAY_SIZE(pre_init_reg); i++) { | ||
| 194 | ret = regmap_update_bits(rk808->regmap, pre_init_reg[i].addr, | ||
| 195 | pre_init_reg[i].mask, | ||
| 196 | pre_init_reg[i].value); | ||
| 197 | if (ret) { | ||
| 198 | dev_err(&client->dev, | ||
| 199 | "0x%x write err\n", pre_init_reg[i].addr); | ||
| 200 | return ret; | ||
| 201 | } | ||
| 202 | } | ||
| 203 | |||
| 204 | ret = regmap_add_irq_chip(rk808->regmap, client->irq, | ||
| 205 | IRQF_ONESHOT, -1, | ||
| 206 | &rk808_irq_chip, &rk808->irq_data); | ||
| 207 | if (ret) { | ||
| 208 | dev_err(&client->dev, "Failed to add irq_chip %d\n", ret); | ||
| 209 | return ret; | ||
| 210 | } | ||
| 211 | |||
| 212 | rk808->i2c = client; | ||
| 213 | i2c_set_clientdata(client, rk808); | ||
| 214 | |||
| 215 | ret = mfd_add_devices(&client->dev, -1, | ||
| 216 | rk808s, ARRAY_SIZE(rk808s), | ||
| 217 | NULL, 0, regmap_irq_get_domain(rk808->irq_data)); | ||
| 218 | if (ret) { | ||
| 219 | dev_err(&client->dev, "failed to add MFD devices %d\n", ret); | ||
| 220 | goto err_irq; | ||
| 221 | } | ||
| 222 | |||
| 223 | pm_off = of_property_read_bool(np, | ||
| 224 | "rockchip,system-power-controller"); | ||
| 225 | if (pm_off && !pm_power_off) { | ||
| 226 | rk808_i2c_client = client; | ||
| 227 | pm_power_off = rk808_device_shutdown; | ||
| 228 | } | ||
| 229 | |||
| 230 | return 0; | ||
| 231 | |||
| 232 | err_irq: | ||
| 233 | regmap_del_irq_chip(client->irq, rk808->irq_data); | ||
| 234 | return ret; | ||
| 235 | } | ||
| 236 | |||
| 237 | static int rk808_remove(struct i2c_client *client) | ||
| 238 | { | ||
| 239 | struct rk808 *rk808 = i2c_get_clientdata(client); | ||
| 240 | |||
| 241 | regmap_del_irq_chip(client->irq, rk808->irq_data); | ||
| 242 | mfd_remove_devices(&client->dev); | ||
| 243 | pm_power_off = NULL; | ||
| 244 | |||
| 245 | return 0; | ||
| 246 | } | ||
| 247 | |||
| 248 | static struct of_device_id rk808_of_match[] = { | ||
| 249 | { .compatible = "rockchip,rk808" }, | ||
| 250 | { }, | ||
| 251 | }; | ||
| 252 | MODULE_DEVICE_TABLE(of, rk808_of_match); | ||
| 253 | |||
| 254 | static const struct i2c_device_id rk808_ids[] = { | ||
| 255 | { "rk808" }, | ||
| 256 | { }, | ||
| 257 | }; | ||
| 258 | MODULE_DEVICE_TABLE(i2c, rk808_ids); | ||
| 259 | |||
| 260 | static struct i2c_driver rk808_i2c_driver = { | ||
| 261 | .driver = { | ||
| 262 | .name = "rk808", | ||
| 263 | .of_match_table = rk808_of_match, | ||
| 264 | }, | ||
| 265 | .probe = rk808_probe, | ||
| 266 | .remove = rk808_remove, | ||
| 267 | .id_table = rk808_ids, | ||
| 268 | }; | ||
| 269 | |||
| 270 | module_i2c_driver(rk808_i2c_driver); | ||
| 271 | |||
| 272 | MODULE_LICENSE("GPL"); | ||
| 273 | MODULE_AUTHOR("Chris Zhong <zyw@rock-chips.com>"); | ||
| 274 | MODULE_AUTHOR("Zhang Qing <zhangqing@rock-chips.com>"); | ||
| 275 | MODULE_DESCRIPTION("RK808 PMIC driver"); | ||
diff --git a/drivers/mfd/rn5t618.c b/drivers/mfd/rn5t618.c new file mode 100644 index 000000000000..666857192dbe --- /dev/null +++ b/drivers/mfd/rn5t618.c | |||
| @@ -0,0 +1,134 @@ | |||
| 1 | /* | ||
| 2 | * MFD core driver for Ricoh RN5T618 PMIC | ||
| 3 | * | ||
| 4 | * Copyright (C) 2014 Beniamino Galvani <b.galvani@gmail.com> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of the GNU General Public License | ||
| 8 | * version 2 as published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * You should have received a copy of the GNU General Public License | ||
| 11 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <linux/i2c.h> | ||
| 15 | #include <linux/mfd/core.h> | ||
| 16 | #include <linux/mfd/rn5t618.h> | ||
| 17 | #include <linux/module.h> | ||
| 18 | #include <linux/regmap.h> | ||
| 19 | |||
| 20 | static const struct mfd_cell rn5t618_cells[] = { | ||
| 21 | { .name = "rn5t618-regulator" }, | ||
| 22 | { .name = "rn5t618-wdt" }, | ||
| 23 | }; | ||
| 24 | |||
| 25 | static bool rn5t618_volatile_reg(struct device *dev, unsigned int reg) | ||
| 26 | { | ||
| 27 | switch (reg) { | ||
| 28 | case RN5T618_WATCHDOGCNT: | ||
| 29 | case RN5T618_DCIRQ: | ||
| 30 | case RN5T618_ILIMDATAH ... RN5T618_AIN0DATAL: | ||
| 31 | case RN5T618_IR_ADC1 ... RN5T618_IR_ADC3: | ||
| 32 | case RN5T618_IR_GPR: | ||
| 33 | case RN5T618_IR_GPF: | ||
| 34 | case RN5T618_MON_IOIN: | ||
| 35 | case RN5T618_INTMON: | ||
| 36 | return true; | ||
| 37 | default: | ||
| 38 | return false; | ||
| 39 | } | ||
| 40 | } | ||
| 41 | |||
| 42 | static const struct regmap_config rn5t618_regmap_config = { | ||
| 43 | .reg_bits = 8, | ||
| 44 | .val_bits = 8, | ||
| 45 | .volatile_reg = rn5t618_volatile_reg, | ||
| 46 | .max_register = RN5T618_MAX_REG, | ||
| 47 | .cache_type = REGCACHE_RBTREE, | ||
| 48 | }; | ||
| 49 | |||
| 50 | static struct rn5t618 *rn5t618_pm_power_off; | ||
| 51 | |||
| 52 | static void rn5t618_power_off(void) | ||
| 53 | { | ||
| 54 | /* disable automatic repower-on */ | ||
| 55 | regmap_update_bits(rn5t618_pm_power_off->regmap, RN5T618_REPCNT, | ||
| 56 | RN5T618_REPCNT_REPWRON, 0); | ||
| 57 | /* start power-off sequence */ | ||
| 58 | regmap_update_bits(rn5t618_pm_power_off->regmap, RN5T618_SLPCNT, | ||
| 59 | RN5T618_SLPCNT_SWPWROFF, RN5T618_SLPCNT_SWPWROFF); | ||
| 60 | } | ||
| 61 | |||
| 62 | static int rn5t618_i2c_probe(struct i2c_client *i2c, | ||
| 63 | const struct i2c_device_id *id) | ||
| 64 | { | ||
| 65 | struct rn5t618 *priv; | ||
| 66 | int ret; | ||
| 67 | |||
| 68 | priv = devm_kzalloc(&i2c->dev, sizeof(*priv), GFP_KERNEL); | ||
| 69 | if (!priv) | ||
| 70 | return -ENOMEM; | ||
| 71 | |||
| 72 | i2c_set_clientdata(i2c, priv); | ||
| 73 | |||
| 74 | priv->regmap = devm_regmap_init_i2c(i2c, &rn5t618_regmap_config); | ||
| 75 | if (IS_ERR(priv->regmap)) { | ||
| 76 | ret = PTR_ERR(priv->regmap); | ||
| 77 | dev_err(&i2c->dev, "regmap init failed: %d\n", ret); | ||
| 78 | return ret; | ||
| 79 | } | ||
| 80 | |||
| 81 | ret = mfd_add_devices(&i2c->dev, -1, rn5t618_cells, | ||
| 82 | ARRAY_SIZE(rn5t618_cells), NULL, 0, NULL); | ||
| 83 | if (ret) { | ||
| 84 | dev_err(&i2c->dev, "failed to add sub-devices: %d\n", ret); | ||
| 85 | return ret; | ||
| 86 | } | ||
| 87 | |||
| 88 | if (!pm_power_off) { | ||
| 89 | rn5t618_pm_power_off = priv; | ||
| 90 | pm_power_off = rn5t618_power_off; | ||
| 91 | } | ||
| 92 | |||
| 93 | return 0; | ||
| 94 | } | ||
| 95 | |||
| 96 | static int rn5t618_i2c_remove(struct i2c_client *i2c) | ||
| 97 | { | ||
| 98 | struct rn5t618 *priv = i2c_get_clientdata(i2c); | ||
| 99 | |||
| 100 | if (priv == rn5t618_pm_power_off) { | ||
| 101 | rn5t618_pm_power_off = NULL; | ||
| 102 | pm_power_off = NULL; | ||
| 103 | } | ||
| 104 | |||
| 105 | mfd_remove_devices(&i2c->dev); | ||
| 106 | return 0; | ||
| 107 | } | ||
| 108 | |||
| 109 | static const struct of_device_id rn5t618_of_match[] = { | ||
| 110 | { .compatible = "ricoh,rn5t618" }, | ||
| 111 | { } | ||
| 112 | }; | ||
| 113 | MODULE_DEVICE_TABLE(of, rn5t618_of_match); | ||
| 114 | |||
| 115 | static const struct i2c_device_id rn5t618_i2c_id[] = { | ||
| 116 | { } | ||
| 117 | }; | ||
| 118 | MODULE_DEVICE_TABLE(i2c, rn5t618_i2c_id); | ||
| 119 | |||
| 120 | static struct i2c_driver rn5t618_i2c_driver = { | ||
| 121 | .driver = { | ||
| 122 | .name = "rn5t618", | ||
| 123 | .of_match_table = of_match_ptr(rn5t618_of_match), | ||
| 124 | }, | ||
| 125 | .probe = rn5t618_i2c_probe, | ||
| 126 | .remove = rn5t618_i2c_remove, | ||
| 127 | .id_table = rn5t618_i2c_id, | ||
| 128 | }; | ||
| 129 | |||
| 130 | module_i2c_driver(rn5t618_i2c_driver); | ||
| 131 | |||
| 132 | MODULE_AUTHOR("Beniamino Galvani <b.galvani@gmail.com>"); | ||
| 133 | MODULE_DESCRIPTION("Ricoh RN5T618 MFD driver"); | ||
| 134 | MODULE_LICENSE("GPL v2"); | ||
diff --git a/drivers/mfd/rtsx_pcr.c b/drivers/mfd/rtsx_pcr.c index d01b8c249231..f2643c221d34 100644 --- a/drivers/mfd/rtsx_pcr.c +++ b/drivers/mfd/rtsx_pcr.c | |||
| @@ -1197,7 +1197,7 @@ static int rtsx_pci_probe(struct pci_dev *pcidev, | |||
| 1197 | pcr->msi_en = msi_en; | 1197 | pcr->msi_en = msi_en; |
| 1198 | if (pcr->msi_en) { | 1198 | if (pcr->msi_en) { |
| 1199 | ret = pci_enable_msi(pcidev); | 1199 | ret = pci_enable_msi(pcidev); |
| 1200 | if (ret < 0) | 1200 | if (ret) |
| 1201 | pcr->msi_en = false; | 1201 | pcr->msi_en = false; |
| 1202 | } | 1202 | } |
| 1203 | 1203 | ||
diff --git a/drivers/mfd/rtsx_usb.c b/drivers/mfd/rtsx_usb.c index 71f387ce8cbd..9cf98d142d9a 100644 --- a/drivers/mfd/rtsx_usb.c +++ b/drivers/mfd/rtsx_usb.c | |||
| @@ -684,7 +684,7 @@ static int rtsx_usb_suspend(struct usb_interface *intf, pm_message_t message) | |||
| 684 | struct rtsx_ucr *ucr = | 684 | struct rtsx_ucr *ucr = |
| 685 | (struct rtsx_ucr *)usb_get_intfdata(intf); | 685 | (struct rtsx_ucr *)usb_get_intfdata(intf); |
| 686 | 686 | ||
| 687 | dev_dbg(&intf->dev, "%s called with pm message 0x%04u\n", | 687 | dev_dbg(&intf->dev, "%s called with pm message 0x%04x\n", |
| 688 | __func__, message.event); | 688 | __func__, message.event); |
| 689 | 689 | ||
| 690 | /* | 690 | /* |
diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c index 02027b7f1223..6ce6e6200359 100644 --- a/drivers/mfd/sm501.c +++ b/drivers/mfd/sm501.c | |||
| @@ -514,9 +514,9 @@ unsigned long sm501_set_clock(struct device *dev, | |||
| 514 | unsigned long mode = smc501_readl(sm->regs + SM501_POWER_MODE_CONTROL); | 514 | unsigned long mode = smc501_readl(sm->regs + SM501_POWER_MODE_CONTROL); |
| 515 | unsigned long gate = smc501_readl(sm->regs + SM501_CURRENT_GATE); | 515 | unsigned long gate = smc501_readl(sm->regs + SM501_CURRENT_GATE); |
| 516 | unsigned long clock = smc501_readl(sm->regs + SM501_CURRENT_CLOCK); | 516 | unsigned long clock = smc501_readl(sm->regs + SM501_CURRENT_CLOCK); |
| 517 | unsigned char reg; | ||
| 518 | unsigned int pll_reg = 0; | 517 | unsigned int pll_reg = 0; |
| 519 | unsigned long sm501_freq; /* the actual frequency achieved */ | 518 | unsigned long sm501_freq; /* the actual frequency achieved */ |
| 519 | u64 reg; | ||
| 520 | 520 | ||
| 521 | struct sm501_clock to; | 521 | struct sm501_clock to; |
| 522 | 522 | ||
diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c index 02a17c388e87..e2f9df1c0c36 100644 --- a/drivers/mfd/stmpe.c +++ b/drivers/mfd/stmpe.c | |||
| @@ -249,7 +249,7 @@ int stmpe_set_altfunc(struct stmpe *stmpe, u32 pins, enum stmpe_block block) | |||
| 249 | int af_bits = variant->af_bits; | 249 | int af_bits = variant->af_bits; |
| 250 | int numregs = DIV_ROUND_UP(stmpe->num_gpios * af_bits, 8); | 250 | int numregs = DIV_ROUND_UP(stmpe->num_gpios * af_bits, 8); |
| 251 | int mask = (1 << af_bits) - 1; | 251 | int mask = (1 << af_bits) - 1; |
| 252 | u8 regs[numregs]; | 252 | u8 regs[8]; |
| 253 | int af, afperreg, ret; | 253 | int af, afperreg, ret; |
| 254 | 254 | ||
| 255 | if (!variant->get_altfunc) | 255 | if (!variant->get_altfunc) |
| @@ -854,7 +854,7 @@ static irqreturn_t stmpe_irq(int irq, void *data) | |||
| 854 | struct stmpe_variant_info *variant = stmpe->variant; | 854 | struct stmpe_variant_info *variant = stmpe->variant; |
| 855 | int num = DIV_ROUND_UP(variant->num_irqs, 8); | 855 | int num = DIV_ROUND_UP(variant->num_irqs, 8); |
| 856 | u8 israddr; | 856 | u8 israddr; |
| 857 | u8 isr[num]; | 857 | u8 isr[3]; |
| 858 | int ret; | 858 | int ret; |
| 859 | int i; | 859 | int i; |
| 860 | 860 | ||
| @@ -1122,7 +1122,12 @@ static void stmpe_of_probe(struct stmpe_platform_data *pdata, | |||
| 1122 | if (pdata->id < 0) | 1122 | if (pdata->id < 0) |
| 1123 | pdata->id = -1; | 1123 | pdata->id = -1; |
| 1124 | 1124 | ||
| 1125 | pdata->irq_trigger = IRQF_TRIGGER_NONE; | 1125 | pdata->irq_gpio = of_get_named_gpio_flags(np, "irq-gpio", 0, |
| 1126 | &pdata->irq_trigger); | ||
| 1127 | if (gpio_is_valid(pdata->irq_gpio)) | ||
| 1128 | pdata->irq_over_gpio = 1; | ||
| 1129 | else | ||
| 1130 | pdata->irq_trigger = IRQF_TRIGGER_NONE; | ||
| 1126 | 1131 | ||
| 1127 | of_property_read_u32(np, "st,autosleep-timeout", | 1132 | of_property_read_u32(np, "st,autosleep-timeout", |
| 1128 | &pdata->autosleep_timeout); | 1133 | &pdata->autosleep_timeout); |
diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c index dd4bf5816221..d877e777cce6 100644 --- a/drivers/mfd/ti_am335x_tscadc.c +++ b/drivers/mfd/ti_am335x_tscadc.c | |||
| @@ -53,11 +53,11 @@ void am335x_tsc_se_set_cache(struct ti_tscadc_dev *tsadc, u32 val) | |||
| 53 | unsigned long flags; | 53 | unsigned long flags; |
| 54 | 54 | ||
| 55 | spin_lock_irqsave(&tsadc->reg_lock, flags); | 55 | spin_lock_irqsave(&tsadc->reg_lock, flags); |
| 56 | tsadc->reg_se_cache = val; | 56 | tsadc->reg_se_cache |= val; |
| 57 | if (tsadc->adc_waiting) | 57 | if (tsadc->adc_waiting) |
| 58 | wake_up(&tsadc->reg_se_wait); | 58 | wake_up(&tsadc->reg_se_wait); |
| 59 | else if (!tsadc->adc_in_use) | 59 | else if (!tsadc->adc_in_use) |
| 60 | tscadc_writel(tsadc, REG_SE, val); | 60 | tscadc_writel(tsadc, REG_SE, tsadc->reg_se_cache); |
| 61 | 61 | ||
| 62 | spin_unlock_irqrestore(&tsadc->reg_lock, flags); | 62 | spin_unlock_irqrestore(&tsadc->reg_lock, flags); |
| 63 | } | 63 | } |
| @@ -96,6 +96,7 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev *tsadc) | |||
| 96 | void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val) | 96 | void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val) |
| 97 | { | 97 | { |
| 98 | spin_lock_irq(&tsadc->reg_lock); | 98 | spin_lock_irq(&tsadc->reg_lock); |
| 99 | tsadc->reg_se_cache |= val; | ||
| 99 | am335x_tscadc_need_adc(tsadc); | 100 | am335x_tscadc_need_adc(tsadc); |
| 100 | 101 | ||
| 101 | tscadc_writel(tsadc, REG_SE, val); | 102 | tscadc_writel(tsadc, REG_SE, val); |
| @@ -241,18 +242,20 @@ static int ti_tscadc_probe(struct platform_device *pdev) | |||
| 241 | tscadc_writel(tscadc, REG_CLKDIV, tscadc->clk_div); | 242 | tscadc_writel(tscadc, REG_CLKDIV, tscadc->clk_div); |
| 242 | 243 | ||
| 243 | /* Set the control register bits */ | 244 | /* Set the control register bits */ |
| 244 | ctrl = CNTRLREG_STEPCONFIGWRT | | 245 | ctrl = CNTRLREG_STEPCONFIGWRT | CNTRLREG_STEPID; |
| 245 | CNTRLREG_STEPID; | ||
| 246 | if (tsc_wires > 0) | ||
| 247 | ctrl |= CNTRLREG_4WIRE | CNTRLREG_TSCENB; | ||
| 248 | tscadc_writel(tscadc, REG_CTRL, ctrl); | 246 | tscadc_writel(tscadc, REG_CTRL, ctrl); |
| 249 | 247 | ||
| 250 | /* Set register bits for Idle Config Mode */ | 248 | /* Set register bits for Idle Config Mode */ |
| 251 | if (tsc_wires > 0) | 249 | if (tsc_wires > 0) { |
| 250 | tscadc->tsc_wires = tsc_wires; | ||
| 251 | if (tsc_wires == 5) | ||
| 252 | ctrl |= CNTRLREG_5WIRE | CNTRLREG_TSCENB; | ||
| 253 | else | ||
| 254 | ctrl |= CNTRLREG_4WIRE | CNTRLREG_TSCENB; | ||
| 252 | tscadc_idle_config(tscadc); | 255 | tscadc_idle_config(tscadc); |
| 256 | } | ||
| 253 | 257 | ||
| 254 | /* Enable the TSC module enable bit */ | 258 | /* Enable the TSC module enable bit */ |
| 255 | ctrl = tscadc_readl(tscadc, REG_CTRL); | ||
| 256 | ctrl |= CNTRLREG_TSCSSENB; | 259 | ctrl |= CNTRLREG_TSCSSENB; |
| 257 | tscadc_writel(tscadc, REG_CTRL, ctrl); | 260 | tscadc_writel(tscadc, REG_CTRL, ctrl); |
| 258 | 261 | ||
| @@ -324,21 +327,23 @@ static int tscadc_suspend(struct device *dev) | |||
| 324 | static int tscadc_resume(struct device *dev) | 327 | static int tscadc_resume(struct device *dev) |
| 325 | { | 328 | { |
| 326 | struct ti_tscadc_dev *tscadc_dev = dev_get_drvdata(dev); | 329 | struct ti_tscadc_dev *tscadc_dev = dev_get_drvdata(dev); |
| 327 | unsigned int restore, ctrl; | 330 | u32 ctrl; |
| 328 | 331 | ||
| 329 | pm_runtime_get_sync(dev); | 332 | pm_runtime_get_sync(dev); |
| 330 | 333 | ||
| 331 | /* context restore */ | 334 | /* context restore */ |
| 332 | ctrl = CNTRLREG_STEPCONFIGWRT | CNTRLREG_STEPID; | 335 | ctrl = CNTRLREG_STEPCONFIGWRT | CNTRLREG_STEPID; |
| 333 | if (tscadc_dev->tsc_cell != -1) | ||
| 334 | ctrl |= CNTRLREG_TSCENB | CNTRLREG_4WIRE; | ||
| 335 | tscadc_writel(tscadc_dev, REG_CTRL, ctrl); | 336 | tscadc_writel(tscadc_dev, REG_CTRL, ctrl); |
| 336 | 337 | ||
| 337 | if (tscadc_dev->tsc_cell != -1) | 338 | if (tscadc_dev->tsc_cell != -1) { |
| 339 | if (tscadc_dev->tsc_wires == 5) | ||
| 340 | ctrl |= CNTRLREG_5WIRE | CNTRLREG_TSCENB; | ||
| 341 | else | ||
| 342 | ctrl |= CNTRLREG_4WIRE | CNTRLREG_TSCENB; | ||
| 338 | tscadc_idle_config(tscadc_dev); | 343 | tscadc_idle_config(tscadc_dev); |
| 339 | restore = tscadc_readl(tscadc_dev, REG_CTRL); | 344 | } |
| 340 | tscadc_writel(tscadc_dev, REG_CTRL, | 345 | ctrl |= CNTRLREG_TSCSSENB; |
| 341 | (restore | CNTRLREG_TSCSSENB)); | 346 | tscadc_writel(tscadc_dev, REG_CTRL, ctrl); |
| 342 | 347 | ||
| 343 | tscadc_writel(tscadc_dev, REG_CLKDIV, tscadc_dev->clk_div); | 348 | tscadc_writel(tscadc_dev, REG_CLKDIV, tscadc_dev->clk_div); |
| 344 | 349 | ||
diff --git a/drivers/mfd/tps65217.c b/drivers/mfd/tps65217.c index 3cc4c7084b92..a8ee52c95f2f 100644 --- a/drivers/mfd/tps65217.c +++ b/drivers/mfd/tps65217.c | |||
| @@ -146,6 +146,8 @@ EXPORT_SYMBOL_GPL(tps65217_clear_bits); | |||
| 146 | static struct regmap_config tps65217_regmap_config = { | 146 | static struct regmap_config tps65217_regmap_config = { |
| 147 | .reg_bits = 8, | 147 | .reg_bits = 8, |
| 148 | .val_bits = 8, | 148 | .val_bits = 8, |
| 149 | |||
| 150 | .max_register = TPS65217_REG_MAX, | ||
| 149 | }; | 151 | }; |
| 150 | 152 | ||
| 151 | static const struct of_device_id tps65217_of_match[] = { | 153 | static const struct of_device_id tps65217_of_match[] = { |
diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c index f243e75d28f3..7612d89850dd 100644 --- a/drivers/mfd/tps65910.c +++ b/drivers/mfd/tps65910.c | |||
| @@ -486,6 +486,11 @@ static int tps65910_i2c_probe(struct i2c_client *i2c, | |||
| 486 | tps65910->i2c_client = i2c; | 486 | tps65910->i2c_client = i2c; |
| 487 | tps65910->id = chip_id; | 487 | tps65910->id = chip_id; |
| 488 | 488 | ||
| 489 | /* Work around silicon erratum SWCZ010: the tps65910 may miss the | ||
| 490 | * first I2C transfer. So issue a dummy transfer before the first | ||
| 491 | * real transfer. | ||
| 492 | */ | ||
| 493 | i2c_master_send(i2c, "", 1); | ||
| 489 | tps65910->regmap = devm_regmap_init_i2c(i2c, &tps65910_regmap_config); | 494 | tps65910->regmap = devm_regmap_init_i2c(i2c, &tps65910_regmap_config); |
| 490 | if (IS_ERR(tps65910->regmap)) { | 495 | if (IS_ERR(tps65910->regmap)) { |
| 491 | ret = PTR_ERR(tps65910->regmap); | 496 | ret = PTR_ERR(tps65910->regmap); |
diff --git a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c index b1dabba763cf..1b772ef761cb 100644 --- a/drivers/mfd/twl4030-irq.c +++ b/drivers/mfd/twl4030-irq.c | |||
| @@ -396,13 +396,17 @@ static int twl4030_init_sih_modules(unsigned line) | |||
| 396 | status = twl_i2c_read(sih->module, rxbuf, | 396 | status = twl_i2c_read(sih->module, rxbuf, |
| 397 | sih->mask[line].isr_offset, sih->bytes_ixr); | 397 | sih->mask[line].isr_offset, sih->bytes_ixr); |
| 398 | if (status < 0) | 398 | if (status < 0) |
| 399 | pr_err("twl4030: err %d initializing %s %s\n", | 399 | pr_warn("twl4030: err %d initializing %s %s\n", |
| 400 | status, sih->name, "ISR"); | 400 | status, sih->name, "ISR"); |
| 401 | 401 | ||
| 402 | if (!sih->set_cor) | 402 | if (!sih->set_cor) { |
| 403 | status = twl_i2c_write(sih->module, buf, | 403 | status = twl_i2c_write(sih->module, buf, |
| 404 | sih->mask[line].isr_offset, | 404 | sih->mask[line].isr_offset, |
| 405 | sih->bytes_ixr); | 405 | sih->bytes_ixr); |
| 406 | if (status < 0) | ||
| 407 | pr_warn("twl4030: write failed: %d\n", | ||
| 408 | status); | ||
| 409 | } | ||
| 406 | /* | 410 | /* |
| 407 | * else COR=1 means read sufficed. | 411 | * else COR=1 means read sufficed. |
| 408 | * (for most SIH modules...) | 412 | * (for most SIH modules...) |
diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c index 4d3ff3771491..cf92a6d1c532 100644 --- a/drivers/mfd/twl4030-power.c +++ b/drivers/mfd/twl4030-power.c | |||
| @@ -627,6 +627,9 @@ static bool twl4030_power_use_poweroff(const struct twl4030_power_data *pdata, | |||
| 627 | if (pdata && pdata->use_poweroff) | 627 | if (pdata && pdata->use_poweroff) |
| 628 | return true; | 628 | return true; |
| 629 | 629 | ||
| 630 | if (of_property_read_bool(node, "ti,system-power-controller")) | ||
| 631 | return true; | ||
| 632 | |||
| 630 | if (of_property_read_bool(node, "ti,use_poweroff")) | 633 | if (of_property_read_bool(node, "ti,use_poweroff")) |
| 631 | return true; | 634 | return true; |
| 632 | 635 | ||
diff --git a/drivers/mfd/twl6040.c b/drivers/mfd/twl6040.c index f9c06c542a41..9687645162ae 100644 --- a/drivers/mfd/twl6040.c +++ b/drivers/mfd/twl6040.c | |||
| @@ -679,6 +679,7 @@ static int twl6040_probe(struct i2c_client *client, | |||
| 679 | if (twl6040->rev < 0) { | 679 | if (twl6040->rev < 0) { |
| 680 | dev_err(&client->dev, "Failed to read revision register: %d\n", | 680 | dev_err(&client->dev, "Failed to read revision register: %d\n", |
| 681 | twl6040->rev); | 681 | twl6040->rev); |
| 682 | ret = twl6040->rev; | ||
| 682 | goto gpio_err; | 683 | goto gpio_err; |
| 683 | } | 684 | } |
| 684 | 685 | ||
diff --git a/drivers/mfd/wm5102-tables.c b/drivers/mfd/wm5102-tables.c index fb4d4bb0f47d..d6f35bbf795b 100644 --- a/drivers/mfd/wm5102-tables.c +++ b/drivers/mfd/wm5102-tables.c | |||
| @@ -87,6 +87,7 @@ int wm5102_patch(struct arizona *arizona) | |||
| 87 | case 0: | 87 | case 0: |
| 88 | wm5102_patch = wm5102_reva_patch; | 88 | wm5102_patch = wm5102_reva_patch; |
| 89 | patch_size = ARRAY_SIZE(wm5102_reva_patch); | 89 | patch_size = ARRAY_SIZE(wm5102_reva_patch); |
| 90 | break; | ||
| 90 | default: | 91 | default: |
| 91 | wm5102_patch = wm5102_revb_patch; | 92 | wm5102_patch = wm5102_revb_patch; |
| 92 | patch_size = ARRAY_SIZE(wm5102_revb_patch); | 93 | patch_size = ARRAY_SIZE(wm5102_revb_patch); |
| @@ -245,9 +246,6 @@ const struct regmap_irq_chip wm5102_irq = { | |||
| 245 | static const struct reg_default wm5102_reg_default[] = { | 246 | static const struct reg_default wm5102_reg_default[] = { |
| 246 | { 0x00000008, 0x0019 }, /* R8 - Ctrl IF SPI CFG 1 */ | 247 | { 0x00000008, 0x0019 }, /* R8 - Ctrl IF SPI CFG 1 */ |
| 247 | { 0x00000009, 0x0001 }, /* R9 - Ctrl IF I2C1 CFG 1 */ | 248 | { 0x00000009, 0x0001 }, /* R9 - Ctrl IF I2C1 CFG 1 */ |
| 248 | { 0x00000016, 0x0000 }, /* R22 - Write Sequencer Ctrl 0 */ | ||
| 249 | { 0x00000017, 0x0000 }, /* R23 - Write Sequencer Ctrl 1 */ | ||
| 250 | { 0x00000018, 0x0000 }, /* R24 - Write Sequencer Ctrl 2 */ | ||
| 251 | { 0x00000020, 0x0000 }, /* R32 - Tone Generator 1 */ | 249 | { 0x00000020, 0x0000 }, /* R32 - Tone Generator 1 */ |
| 252 | { 0x00000021, 0x1000 }, /* R33 - Tone Generator 2 */ | 250 | { 0x00000021, 0x1000 }, /* R33 - Tone Generator 2 */ |
| 253 | { 0x00000022, 0x0000 }, /* R34 - Tone Generator 3 */ | 251 | { 0x00000022, 0x0000 }, /* R34 - Tone Generator 3 */ |
| @@ -1016,6 +1014,7 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg) | |||
| 1016 | case ARIZONA_WRITE_SEQUENCER_CTRL_0: | 1014 | case ARIZONA_WRITE_SEQUENCER_CTRL_0: |
| 1017 | case ARIZONA_WRITE_SEQUENCER_CTRL_1: | 1015 | case ARIZONA_WRITE_SEQUENCER_CTRL_1: |
| 1018 | case ARIZONA_WRITE_SEQUENCER_CTRL_2: | 1016 | case ARIZONA_WRITE_SEQUENCER_CTRL_2: |
| 1017 | case ARIZONA_WRITE_SEQUENCER_CTRL_3: | ||
| 1019 | case ARIZONA_WRITE_SEQUENCER_PROM: | 1018 | case ARIZONA_WRITE_SEQUENCER_PROM: |
| 1020 | case ARIZONA_TONE_GENERATOR_1: | 1019 | case ARIZONA_TONE_GENERATOR_1: |
| 1021 | case ARIZONA_TONE_GENERATOR_2: | 1020 | case ARIZONA_TONE_GENERATOR_2: |
| @@ -1060,6 +1059,8 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg) | |||
| 1060 | case ARIZONA_ASYNC_CLOCK_1: | 1059 | case ARIZONA_ASYNC_CLOCK_1: |
| 1061 | case ARIZONA_ASYNC_SAMPLE_RATE_1: | 1060 | case ARIZONA_ASYNC_SAMPLE_RATE_1: |
| 1062 | case ARIZONA_ASYNC_SAMPLE_RATE_1_STATUS: | 1061 | case ARIZONA_ASYNC_SAMPLE_RATE_1_STATUS: |
| 1062 | case ARIZONA_ASYNC_SAMPLE_RATE_2: | ||
| 1063 | case ARIZONA_ASYNC_SAMPLE_RATE_2_STATUS: | ||
| 1063 | case ARIZONA_OUTPUT_SYSTEM_CLOCK: | 1064 | case ARIZONA_OUTPUT_SYSTEM_CLOCK: |
| 1064 | case ARIZONA_OUTPUT_ASYNC_CLOCK: | 1065 | case ARIZONA_OUTPUT_ASYNC_CLOCK: |
| 1065 | case ARIZONA_RATE_ESTIMATOR_1: | 1066 | case ARIZONA_RATE_ESTIMATOR_1: |
| @@ -1880,6 +1881,10 @@ static bool wm5102_volatile_register(struct device *dev, unsigned int reg) | |||
| 1880 | switch (reg) { | 1881 | switch (reg) { |
| 1881 | case ARIZONA_SOFTWARE_RESET: | 1882 | case ARIZONA_SOFTWARE_RESET: |
| 1882 | case ARIZONA_DEVICE_REVISION: | 1883 | case ARIZONA_DEVICE_REVISION: |
| 1884 | case ARIZONA_WRITE_SEQUENCER_CTRL_0: | ||
| 1885 | case ARIZONA_WRITE_SEQUENCER_CTRL_1: | ||
| 1886 | case ARIZONA_WRITE_SEQUENCER_CTRL_2: | ||
| 1887 | case ARIZONA_WRITE_SEQUENCER_CTRL_3: | ||
| 1883 | case ARIZONA_OUTPUT_STATUS_1: | 1888 | case ARIZONA_OUTPUT_STATUS_1: |
| 1884 | case ARIZONA_RAW_OUTPUT_STATUS_1: | 1889 | case ARIZONA_RAW_OUTPUT_STATUS_1: |
| 1885 | case ARIZONA_SLIMBUS_RX_PORT_STATUS: | 1890 | case ARIZONA_SLIMBUS_RX_PORT_STATUS: |
| @@ -1889,8 +1894,13 @@ static bool wm5102_volatile_register(struct device *dev, unsigned int reg) | |||
| 1889 | case ARIZONA_SAMPLE_RATE_3_STATUS: | 1894 | case ARIZONA_SAMPLE_RATE_3_STATUS: |
| 1890 | case ARIZONA_HAPTICS_STATUS: | 1895 | case ARIZONA_HAPTICS_STATUS: |
| 1891 | case ARIZONA_ASYNC_SAMPLE_RATE_1_STATUS: | 1896 | case ARIZONA_ASYNC_SAMPLE_RATE_1_STATUS: |
| 1897 | case ARIZONA_ASYNC_SAMPLE_RATE_2_STATUS: | ||
| 1892 | case ARIZONA_FLL1_NCO_TEST_0: | 1898 | case ARIZONA_FLL1_NCO_TEST_0: |
| 1893 | case ARIZONA_FLL2_NCO_TEST_0: | 1899 | case ARIZONA_FLL2_NCO_TEST_0: |
| 1900 | case ARIZONA_DAC_COMP_1: | ||
| 1901 | case ARIZONA_DAC_COMP_2: | ||
| 1902 | case ARIZONA_DAC_COMP_3: | ||
| 1903 | case ARIZONA_DAC_COMP_4: | ||
| 1894 | case ARIZONA_FX_CTRL2: | 1904 | case ARIZONA_FX_CTRL2: |
| 1895 | case ARIZONA_INTERRUPT_STATUS_1: | 1905 | case ARIZONA_INTERRUPT_STATUS_1: |
| 1896 | case ARIZONA_INTERRUPT_STATUS_2: | 1906 | case ARIZONA_INTERRUPT_STATUS_2: |
diff --git a/drivers/mfd/wm5110-tables.c b/drivers/mfd/wm5110-tables.c index 9b98ee559188..4642b5b816a0 100644 --- a/drivers/mfd/wm5110-tables.c +++ b/drivers/mfd/wm5110-tables.c | |||
| @@ -666,9 +666,6 @@ static const struct reg_default wm5110_reg_default[] = { | |||
| 666 | { 0x0000000A, 0x0001 }, /* R10 - Ctrl IF I2C2 CFG 1 */ | 666 | { 0x0000000A, 0x0001 }, /* R10 - Ctrl IF I2C2 CFG 1 */ |
| 667 | { 0x0000000B, 0x0036 }, /* R11 - Ctrl IF I2C1 CFG 2 */ | 667 | { 0x0000000B, 0x0036 }, /* R11 - Ctrl IF I2C1 CFG 2 */ |
| 668 | { 0x0000000C, 0x0036 }, /* R12 - Ctrl IF I2C2 CFG 2 */ | 668 | { 0x0000000C, 0x0036 }, /* R12 - Ctrl IF I2C2 CFG 2 */ |
| 669 | { 0x00000016, 0x0000 }, /* R22 - Write Sequencer Ctrl 0 */ | ||
| 670 | { 0x00000017, 0x0000 }, /* R23 - Write Sequencer Ctrl 1 */ | ||
| 671 | { 0x00000018, 0x0000 }, /* R24 - Write Sequencer Ctrl 2 */ | ||
| 672 | { 0x00000020, 0x0000 }, /* R32 - Tone Generator 1 */ | 669 | { 0x00000020, 0x0000 }, /* R32 - Tone Generator 1 */ |
| 673 | { 0x00000021, 0x1000 }, /* R33 - Tone Generator 2 */ | 670 | { 0x00000021, 0x1000 }, /* R33 - Tone Generator 2 */ |
| 674 | { 0x00000022, 0x0000 }, /* R34 - Tone Generator 3 */ | 671 | { 0x00000022, 0x0000 }, /* R34 - Tone Generator 3 */ |
| @@ -705,6 +702,7 @@ static const struct reg_default wm5110_reg_default[] = { | |||
| 705 | { 0x00000104, 0x0011 }, /* R260 - Sample rate 3 */ | 702 | { 0x00000104, 0x0011 }, /* R260 - Sample rate 3 */ |
| 706 | { 0x00000112, 0x0305 }, /* R274 - Async clock 1 */ | 703 | { 0x00000112, 0x0305 }, /* R274 - Async clock 1 */ |
| 707 | { 0x00000113, 0x0011 }, /* R275 - Async sample rate 1 */ | 704 | { 0x00000113, 0x0011 }, /* R275 - Async sample rate 1 */ |
| 705 | { 0x00000114, 0x0011 }, /* R276 - Async sample rate 2 */ | ||
| 708 | { 0x00000149, 0x0000 }, /* R329 - Output system clock */ | 706 | { 0x00000149, 0x0000 }, /* R329 - Output system clock */ |
| 709 | { 0x0000014A, 0x0000 }, /* R330 - Output async clock */ | 707 | { 0x0000014A, 0x0000 }, /* R330 - Output async clock */ |
| 710 | { 0x00000152, 0x0000 }, /* R338 - Rate Estimator 1 */ | 708 | { 0x00000152, 0x0000 }, /* R338 - Rate Estimator 1 */ |
| @@ -1741,6 +1739,8 @@ static bool wm5110_readable_register(struct device *dev, unsigned int reg) | |||
| 1741 | case ARIZONA_ASYNC_CLOCK_1: | 1739 | case ARIZONA_ASYNC_CLOCK_1: |
| 1742 | case ARIZONA_ASYNC_SAMPLE_RATE_1: | 1740 | case ARIZONA_ASYNC_SAMPLE_RATE_1: |
| 1743 | case ARIZONA_ASYNC_SAMPLE_RATE_1_STATUS: | 1741 | case ARIZONA_ASYNC_SAMPLE_RATE_1_STATUS: |
| 1742 | case ARIZONA_ASYNC_SAMPLE_RATE_2: | ||
| 1743 | case ARIZONA_ASYNC_SAMPLE_RATE_2_STATUS: | ||
| 1744 | case ARIZONA_OUTPUT_SYSTEM_CLOCK: | 1744 | case ARIZONA_OUTPUT_SYSTEM_CLOCK: |
| 1745 | case ARIZONA_OUTPUT_ASYNC_CLOCK: | 1745 | case ARIZONA_OUTPUT_ASYNC_CLOCK: |
| 1746 | case ARIZONA_RATE_ESTIMATOR_1: | 1746 | case ARIZONA_RATE_ESTIMATOR_1: |
| @@ -2815,11 +2815,15 @@ static bool wm5110_volatile_register(struct device *dev, unsigned int reg) | |||
| 2815 | switch (reg) { | 2815 | switch (reg) { |
| 2816 | case ARIZONA_SOFTWARE_RESET: | 2816 | case ARIZONA_SOFTWARE_RESET: |
| 2817 | case ARIZONA_DEVICE_REVISION: | 2817 | case ARIZONA_DEVICE_REVISION: |
| 2818 | case ARIZONA_WRITE_SEQUENCER_CTRL_0: | ||
| 2819 | case ARIZONA_WRITE_SEQUENCER_CTRL_1: | ||
| 2820 | case ARIZONA_WRITE_SEQUENCER_CTRL_2: | ||
| 2818 | case ARIZONA_HAPTICS_STATUS: | 2821 | case ARIZONA_HAPTICS_STATUS: |
| 2819 | case ARIZONA_SAMPLE_RATE_1_STATUS: | 2822 | case ARIZONA_SAMPLE_RATE_1_STATUS: |
| 2820 | case ARIZONA_SAMPLE_RATE_2_STATUS: | 2823 | case ARIZONA_SAMPLE_RATE_2_STATUS: |
| 2821 | case ARIZONA_SAMPLE_RATE_3_STATUS: | 2824 | case ARIZONA_SAMPLE_RATE_3_STATUS: |
| 2822 | case ARIZONA_ASYNC_SAMPLE_RATE_1_STATUS: | 2825 | case ARIZONA_ASYNC_SAMPLE_RATE_1_STATUS: |
| 2826 | case ARIZONA_ASYNC_SAMPLE_RATE_2_STATUS: | ||
| 2823 | case ARIZONA_MIC_DETECT_3: | 2827 | case ARIZONA_MIC_DETECT_3: |
| 2824 | case ARIZONA_HEADPHONE_DETECT_2: | 2828 | case ARIZONA_HEADPHONE_DETECT_2: |
| 2825 | case ARIZONA_INPUT_ENABLES_STATUS: | 2829 | case ARIZONA_INPUT_ENABLES_STATUS: |
diff --git a/drivers/mfd/wm8994-irq.c b/drivers/mfd/wm8994-irq.c index e74dedda5b55..a14407edbd89 100644 --- a/drivers/mfd/wm8994-irq.c +++ b/drivers/mfd/wm8994-irq.c | |||
| @@ -262,8 +262,10 @@ int wm8994_irq_init(struct wm8994 *wm8994) | |||
| 262 | 262 | ||
| 263 | return 0; | 263 | return 0; |
| 264 | } | 264 | } |
| 265 | EXPORT_SYMBOL(wm8994_irq_init); | ||
| 265 | 266 | ||
| 266 | void wm8994_irq_exit(struct wm8994 *wm8994) | 267 | void wm8994_irq_exit(struct wm8994 *wm8994) |
| 267 | { | 268 | { |
| 268 | regmap_del_irq_chip(wm8994->irq, wm8994->irq_data); | 269 | regmap_del_irq_chip(wm8994->irq, wm8994->irq_data); |
| 269 | } | 270 | } |
| 271 | EXPORT_SYMBOL(wm8994_irq_exit); | ||
diff --git a/drivers/mfd/wm8994-regmap.c b/drivers/mfd/wm8994-regmap.c index 770a25696468..300e9b6a2e96 100644 --- a/drivers/mfd/wm8994-regmap.c +++ b/drivers/mfd/wm8994-regmap.c | |||
| @@ -1252,6 +1252,7 @@ struct regmap_config wm1811_regmap_config = { | |||
| 1252 | .volatile_reg = wm1811_volatile_register, | 1252 | .volatile_reg = wm1811_volatile_register, |
| 1253 | .readable_reg = wm1811_readable_register, | 1253 | .readable_reg = wm1811_readable_register, |
| 1254 | }; | 1254 | }; |
| 1255 | EXPORT_SYMBOL(wm1811_regmap_config); | ||
| 1255 | 1256 | ||
| 1256 | struct regmap_config wm8994_regmap_config = { | 1257 | struct regmap_config wm8994_regmap_config = { |
| 1257 | .reg_bits = 16, | 1258 | .reg_bits = 16, |
| @@ -1266,6 +1267,7 @@ struct regmap_config wm8994_regmap_config = { | |||
| 1266 | .volatile_reg = wm8994_volatile_register, | 1267 | .volatile_reg = wm8994_volatile_register, |
| 1267 | .readable_reg = wm8994_readable_register, | 1268 | .readable_reg = wm8994_readable_register, |
| 1268 | }; | 1269 | }; |
| 1270 | EXPORT_SYMBOL(wm8994_regmap_config); | ||
| 1269 | 1271 | ||
| 1270 | struct regmap_config wm8958_regmap_config = { | 1272 | struct regmap_config wm8958_regmap_config = { |
| 1271 | .reg_bits = 16, | 1273 | .reg_bits = 16, |
| @@ -1280,8 +1282,10 @@ struct regmap_config wm8958_regmap_config = { | |||
| 1280 | .volatile_reg = wm8958_volatile_register, | 1282 | .volatile_reg = wm8958_volatile_register, |
| 1281 | .readable_reg = wm8958_readable_register, | 1283 | .readable_reg = wm8958_readable_register, |
| 1282 | }; | 1284 | }; |
| 1285 | EXPORT_SYMBOL(wm8958_regmap_config); | ||
| 1283 | 1286 | ||
| 1284 | struct regmap_config wm8994_base_regmap_config = { | 1287 | struct regmap_config wm8994_base_regmap_config = { |
| 1285 | .reg_bits = 16, | 1288 | .reg_bits = 16, |
| 1286 | .val_bits = 16, | 1289 | .val_bits = 16, |
| 1287 | }; | 1290 | }; |
| 1291 | EXPORT_SYMBOL(wm8994_base_regmap_config); | ||
diff --git a/include/dt-bindings/clock/rockchip,rk808.h b/include/dt-bindings/clock/rockchip,rk808.h new file mode 100644 index 000000000000..1a873432f965 --- /dev/null +++ b/include/dt-bindings/clock/rockchip,rk808.h | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | /* | ||
| 2 | * This header provides constants clk index RK808 pmic clkout | ||
| 3 | */ | ||
| 4 | #ifndef _CLK_ROCKCHIP_RK808 | ||
| 5 | #define _CLK_ROCKCHIP_RK808 | ||
| 6 | |||
| 7 | /* CLOCKOUT index */ | ||
| 8 | #define RK808_CLKOUT0 0 | ||
| 9 | #define RK808_CLKOUT1 1 | ||
| 10 | |||
| 11 | #endif | ||
diff --git a/include/linux/mfd/arizona/registers.h b/include/linux/mfd/arizona/registers.h index dbd23c36de21..c0b075f6bc35 100644 --- a/include/linux/mfd/arizona/registers.h +++ b/include/linux/mfd/arizona/registers.h | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #define ARIZONA_WRITE_SEQUENCER_CTRL_0 0x16 | 27 | #define ARIZONA_WRITE_SEQUENCER_CTRL_0 0x16 |
| 28 | #define ARIZONA_WRITE_SEQUENCER_CTRL_1 0x17 | 28 | #define ARIZONA_WRITE_SEQUENCER_CTRL_1 0x17 |
| 29 | #define ARIZONA_WRITE_SEQUENCER_CTRL_2 0x18 | 29 | #define ARIZONA_WRITE_SEQUENCER_CTRL_2 0x18 |
| 30 | #define ARIZONA_WRITE_SEQUENCER_CTRL_3 0x19 | ||
| 30 | #define ARIZONA_WRITE_SEQUENCER_PROM 0x1A | 31 | #define ARIZONA_WRITE_SEQUENCER_PROM 0x1A |
| 31 | #define ARIZONA_TONE_GENERATOR_1 0x20 | 32 | #define ARIZONA_TONE_GENERATOR_1 0x20 |
| 32 | #define ARIZONA_TONE_GENERATOR_2 0x21 | 33 | #define ARIZONA_TONE_GENERATOR_2 0x21 |
| @@ -70,7 +71,9 @@ | |||
| 70 | #define ARIZONA_SAMPLE_RATE_3_STATUS 0x10C | 71 | #define ARIZONA_SAMPLE_RATE_3_STATUS 0x10C |
| 71 | #define ARIZONA_ASYNC_CLOCK_1 0x112 | 72 | #define ARIZONA_ASYNC_CLOCK_1 0x112 |
| 72 | #define ARIZONA_ASYNC_SAMPLE_RATE_1 0x113 | 73 | #define ARIZONA_ASYNC_SAMPLE_RATE_1 0x113 |
| 74 | #define ARIZONA_ASYNC_SAMPLE_RATE_2 0x114 | ||
| 73 | #define ARIZONA_ASYNC_SAMPLE_RATE_1_STATUS 0x11B | 75 | #define ARIZONA_ASYNC_SAMPLE_RATE_1_STATUS 0x11B |
| 76 | #define ARIZONA_ASYNC_SAMPLE_RATE_2_STATUS 0x11C | ||
| 74 | #define ARIZONA_OUTPUT_SYSTEM_CLOCK 0x149 | 77 | #define ARIZONA_OUTPUT_SYSTEM_CLOCK 0x149 |
| 75 | #define ARIZONA_OUTPUT_ASYNC_CLOCK 0x14A | 78 | #define ARIZONA_OUTPUT_ASYNC_CLOCK 0x14A |
| 76 | #define ARIZONA_RATE_ESTIMATOR_1 0x152 | 79 | #define ARIZONA_RATE_ESTIMATOR_1 0x152 |
| @@ -1664,16 +1667,30 @@ | |||
| 1664 | /* | 1667 | /* |
| 1665 | * R275 (0x113) - Async sample rate 1 | 1668 | * R275 (0x113) - Async sample rate 1 |
| 1666 | */ | 1669 | */ |
| 1667 | #define ARIZONA_ASYNC_SAMPLE_RATE_MASK 0x001F /* ASYNC_SAMPLE_RATE - [4:0] */ | 1670 | #define ARIZONA_ASYNC_SAMPLE_RATE_1_MASK 0x001F /* ASYNC_SAMPLE_RATE_1 - [4:0] */ |
| 1668 | #define ARIZONA_ASYNC_SAMPLE_RATE_SHIFT 0 /* ASYNC_SAMPLE_RATE - [4:0] */ | 1671 | #define ARIZONA_ASYNC_SAMPLE_RATE_1_SHIFT 0 /* ASYNC_SAMPLE_RATE_1 - [4:0] */ |
| 1669 | #define ARIZONA_ASYNC_SAMPLE_RATE_WIDTH 5 /* ASYNC_SAMPLE_RATE - [4:0] */ | 1672 | #define ARIZONA_ASYNC_SAMPLE_RATE_1_WIDTH 5 /* ASYNC_SAMPLE_RATE_1 - [4:0] */ |
| 1673 | |||
| 1674 | /* | ||
| 1675 | * R276 (0x114) - Async sample rate 2 | ||
| 1676 | */ | ||
| 1677 | #define ARIZONA_ASYNC_SAMPLE_RATE_2_MASK 0x001F /* ASYNC_SAMPLE_RATE_2 - [4:0] */ | ||
| 1678 | #define ARIZONA_ASYNC_SAMPLE_RATE_2_SHIFT 0 /* ASYNC_SAMPLE_RATE_2 - [4:0] */ | ||
| 1679 | #define ARIZONA_ASYNC_SAMPLE_RATE_2_WIDTH 5 /* ASYNC_SAMPLE_RATE_2 - [4:0] */ | ||
| 1670 | 1680 | ||
| 1671 | /* | 1681 | /* |
| 1672 | * R283 (0x11B) - Async sample rate 1 status | 1682 | * R283 (0x11B) - Async sample rate 1 status |
| 1673 | */ | 1683 | */ |
| 1674 | #define ARIZONA_ASYNC_SAMPLE_RATE_STS_MASK 0x001F /* ASYNC_SAMPLE_RATE_STS - [4:0] */ | 1684 | #define ARIZONA_ASYNC_SAMPLE_RATE_1_STS_MASK 0x001F /* ASYNC_SAMPLE_RATE_1_STS - [4:0] */ |
| 1675 | #define ARIZONA_ASYNC_SAMPLE_RATE_STS_SHIFT 0 /* ASYNC_SAMPLE_RATE_STS - [4:0] */ | 1685 | #define ARIZONA_ASYNC_SAMPLE_RATE_1_STS_SHIFT 0 /* ASYNC_SAMPLE_RATE_1_STS - [4:0] */ |
| 1676 | #define ARIZONA_ASYNC_SAMPLE_RATE_STS_WIDTH 5 /* ASYNC_SAMPLE_RATE_STS - [4:0] */ | 1686 | #define ARIZONA_ASYNC_SAMPLE_RATE_1_STS_WIDTH 5 /* ASYNC_SAMPLE_RATE_1_STS - [4:0] */ |
| 1687 | |||
| 1688 | /* | ||
| 1689 | * R284 (0x11C) - Async sample rate 2 status | ||
| 1690 | */ | ||
| 1691 | #define ARIZONA_ASYNC_SAMPLE_RATE_2_STS_MASK 0x001F /* ASYNC_SAMPLE_RATE_2_STS - [4:0] */ | ||
| 1692 | #define ARIZONA_ASYNC_SAMPLE_RATE_2_STS_SHIFT 0 /* ASYNC_SAMPLE_RATE_2_STS - [4:0] */ | ||
| 1693 | #define ARIZONA_ASYNC_SAMPLE_RATE_2_STS_WIDTH 5 /* ASYNC_SAMPLE_RATE_2_STS - [4:0] */ | ||
| 1677 | 1694 | ||
| 1678 | /* | 1695 | /* |
| 1679 | * R329 (0x149) - Output system clock | 1696 | * R329 (0x149) - Output system clock |
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index f543de91ce19..73e1709d4c09 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h | |||
| @@ -44,6 +44,9 @@ struct mfd_cell { | |||
| 44 | */ | 44 | */ |
| 45 | const char *of_compatible; | 45 | const char *of_compatible; |
| 46 | 46 | ||
| 47 | /* Matches ACPI PNP id, either _HID or _CID */ | ||
| 48 | const char *acpi_pnpid; | ||
| 49 | |||
| 47 | /* | 50 | /* |
| 48 | * These resources can be specified relative to the parent device. | 51 | * These resources can be specified relative to the parent device. |
| 49 | * For accessing hardware you should use resources from the platform dev | 52 | * For accessing hardware you should use resources from the platform dev |
diff --git a/include/linux/mfd/cros_ec.h b/include/linux/mfd/cros_ec.h index fcbe9d129a9d..0e166b92f5b4 100644 --- a/include/linux/mfd/cros_ec.h +++ b/include/linux/mfd/cros_ec.h | |||
| @@ -62,10 +62,6 @@ struct cros_ec_command { | |||
| 62 | * @dev: Device pointer | 62 | * @dev: Device pointer |
| 63 | * @was_wake_device: true if this device was set to wake the system from | 63 | * @was_wake_device: true if this device was set to wake the system from |
| 64 | * sleep at the last suspend | 64 | * sleep at the last suspend |
| 65 | * @cmd_xfer: send command to EC and get response | ||
| 66 | * Returns the number of bytes received if the communication succeeded, but | ||
| 67 | * that doesn't mean the EC was happy with the command. The caller | ||
| 68 | * should check msg.result for the EC's result code. | ||
| 69 | * | 65 | * |
| 70 | * @priv: Private data | 66 | * @priv: Private data |
| 71 | * @irq: Interrupt to use | 67 | * @irq: Interrupt to use |
| @@ -82,6 +78,10 @@ struct cros_ec_command { | |||
| 82 | * @dout_size: size of dout buffer to allocate (zero to use static dout) | 78 | * @dout_size: size of dout buffer to allocate (zero to use static dout) |
| 83 | * @parent: pointer to parent device (e.g. i2c or spi device) | 79 | * @parent: pointer to parent device (e.g. i2c or spi device) |
| 84 | * @wake_enabled: true if this device can wake the system from sleep | 80 | * @wake_enabled: true if this device can wake the system from sleep |
| 81 | * @cmd_xfer: send command to EC and get response | ||
| 82 | * Returns the number of bytes received if the communication succeeded, but | ||
| 83 | * that doesn't mean the EC was happy with the command. The caller | ||
| 84 | * should check msg.result for the EC's result code. | ||
| 85 | * @lock: one transaction at a time | 85 | * @lock: one transaction at a time |
| 86 | */ | 86 | */ |
| 87 | struct cros_ec_device { | 87 | struct cros_ec_device { |
| @@ -92,8 +92,6 @@ struct cros_ec_device { | |||
| 92 | struct device *dev; | 92 | struct device *dev; |
| 93 | bool was_wake_device; | 93 | bool was_wake_device; |
| 94 | struct class *cros_class; | 94 | struct class *cros_class; |
| 95 | int (*cmd_xfer)(struct cros_ec_device *ec, | ||
| 96 | struct cros_ec_command *msg); | ||
| 97 | 95 | ||
| 98 | /* These are used to implement the platform-specific interface */ | 96 | /* These are used to implement the platform-specific interface */ |
| 99 | void *priv; | 97 | void *priv; |
| @@ -104,6 +102,8 @@ struct cros_ec_device { | |||
| 104 | int dout_size; | 102 | int dout_size; |
| 105 | struct device *parent; | 103 | struct device *parent; |
| 106 | bool wake_enabled; | 104 | bool wake_enabled; |
| 105 | int (*cmd_xfer)(struct cros_ec_device *ec, | ||
| 106 | struct cros_ec_command *msg); | ||
| 107 | struct mutex lock; | 107 | struct mutex lock; |
| 108 | }; | 108 | }; |
| 109 | 109 | ||
| @@ -153,6 +153,18 @@ int cros_ec_check_result(struct cros_ec_device *ec_dev, | |||
| 153 | struct cros_ec_command *msg); | 153 | struct cros_ec_command *msg); |
| 154 | 154 | ||
| 155 | /** | 155 | /** |
| 156 | * cros_ec_cmd_xfer - Send a command to the ChromeOS EC | ||
| 157 | * | ||
| 158 | * Call this to send a command to the ChromeOS EC. This should be used | ||
| 159 | * instead of calling the EC's cmd_xfer() callback directly. | ||
| 160 | * | ||
| 161 | * @ec_dev: EC device | ||
| 162 | * @msg: Message to write | ||
| 163 | */ | ||
| 164 | int cros_ec_cmd_xfer(struct cros_ec_device *ec_dev, | ||
| 165 | struct cros_ec_command *msg); | ||
| 166 | |||
| 167 | /** | ||
| 156 | * cros_ec_remove - Remove a ChromeOS EC | 168 | * cros_ec_remove - Remove a ChromeOS EC |
| 157 | * | 169 | * |
| 158 | * Call this to deregister a ChromeOS EC, then clean up any private data. | 170 | * Call this to deregister a ChromeOS EC, then clean up any private data. |
diff --git a/include/linux/mfd/da9052/da9052.h b/include/linux/mfd/da9052/da9052.h index bba65f51a0b5..c18a4c19d6fc 100644 --- a/include/linux/mfd/da9052/da9052.h +++ b/include/linux/mfd/da9052/da9052.h | |||
| @@ -211,7 +211,7 @@ static inline int da9052_reg_update(struct da9052 *da9052, unsigned char reg, | |||
| 211 | int da9052_device_init(struct da9052 *da9052, u8 chip_id); | 211 | int da9052_device_init(struct da9052 *da9052, u8 chip_id); |
| 212 | void da9052_device_exit(struct da9052 *da9052); | 212 | void da9052_device_exit(struct da9052 *da9052); |
| 213 | 213 | ||
| 214 | extern struct regmap_config da9052_regmap_config; | 214 | extern const struct regmap_config da9052_regmap_config; |
| 215 | 215 | ||
| 216 | int da9052_irq_init(struct da9052 *da9052); | 216 | int da9052_irq_init(struct da9052 *da9052); |
| 217 | int da9052_irq_exit(struct da9052 *da9052); | 217 | int da9052_irq_exit(struct da9052 *da9052); |
diff --git a/include/linux/mfd/davinci_voicecodec.h b/include/linux/mfd/davinci_voicecodec.h index 5166935ce66d..cb01496bfa49 100644 --- a/include/linux/mfd/davinci_voicecodec.h +++ b/include/linux/mfd/davinci_voicecodec.h | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | */ | 21 | */ |
| 22 | 22 | ||
| 23 | #ifndef __LINUX_MFD_DAVINCI_VOICECODEC_H_ | 23 | #ifndef __LINUX_MFD_DAVINCI_VOICECODEC_H_ |
| 24 | #define __LINUX_MFD_DAVINIC_VOICECODEC_H_ | 24 | #define __LINUX_MFD_DAVINCI_VOICECODEC_H_ |
| 25 | 25 | ||
| 26 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
| 27 | #include <linux/platform_device.h> | 27 | #include <linux/platform_device.h> |
diff --git a/include/linux/mfd/hi6421-pmic.h b/include/linux/mfd/hi6421-pmic.h new file mode 100644 index 000000000000..587273e35acf --- /dev/null +++ b/include/linux/mfd/hi6421-pmic.h | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | /* | ||
| 2 | * Header file for device driver Hi6421 PMIC | ||
| 3 | * | ||
| 4 | * Copyright (c) <2011-2014> HiSilicon Technologies Co., Ltd. | ||
| 5 | * http://www.hisilicon.com | ||
| 6 | * Copyright (c) <2013-2014> Linaro Ltd. | ||
| 7 | * http://www.linaro.org | ||
| 8 | * | ||
| 9 | * Author: Guodong Xu <guodong.xu@linaro.org> | ||
| 10 | * | ||
| 11 | * This program is free software; you can redistribute it and/or modify | ||
| 12 | * it under the terms of the GNU General Public License version 2 as | ||
| 13 | * published by the Free Software Foundation. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #ifndef __HI6421_PMIC_H | ||
| 17 | #define __HI6421_PMIC_H | ||
| 18 | |||
| 19 | /* Hi6421 registers are mapped to memory bus in 4 bytes stride */ | ||
| 20 | #define HI6421_REG_TO_BUS_ADDR(x) (x << 2) | ||
| 21 | |||
| 22 | /* Hi6421 maximum register number */ | ||
| 23 | #define HI6421_REG_MAX 0xFF | ||
| 24 | |||
| 25 | /* Hi6421 OCP (over current protection) and DEB (debounce) control register */ | ||
| 26 | #define HI6421_OCP_DEB_CTRL_REG HI6421_REG_TO_BUS_ADDR(0x51) | ||
| 27 | #define HI6421_OCP_DEB_SEL_MASK 0x0C | ||
| 28 | #define HI6421_OCP_DEB_SEL_8MS 0x00 | ||
| 29 | #define HI6421_OCP_DEB_SEL_16MS 0x04 | ||
| 30 | #define HI6421_OCP_DEB_SEL_32MS 0x08 | ||
| 31 | #define HI6421_OCP_DEB_SEL_64MS 0x0C | ||
| 32 | #define HI6421_OCP_EN_DEBOUNCE_MASK 0x02 | ||
| 33 | #define HI6421_OCP_EN_DEBOUNCE_ENABLE 0x02 | ||
| 34 | #define HI6421_OCP_AUTO_STOP_MASK 0x01 | ||
| 35 | #define HI6421_OCP_AUTO_STOP_ENABLE 0x01 | ||
| 36 | |||
| 37 | struct hi6421_pmic { | ||
| 38 | struct regmap *regmap; | ||
| 39 | }; | ||
| 40 | |||
| 41 | #endif /* __HI6421_PMIC_H */ | ||
diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h index d0e578fd7053..fc17d56581b2 100644 --- a/include/linux/mfd/max77693-private.h +++ b/include/linux/mfd/max77693-private.h | |||
| @@ -46,7 +46,7 @@ enum max77693_pmic_reg { | |||
| 46 | MAX77693_LED_REG_VOUT_FLASH2 = 0x0C, | 46 | MAX77693_LED_REG_VOUT_FLASH2 = 0x0C, |
| 47 | MAX77693_LED_REG_FLASH_INT = 0x0E, | 47 | MAX77693_LED_REG_FLASH_INT = 0x0E, |
| 48 | MAX77693_LED_REG_FLASH_INT_MASK = 0x0F, | 48 | MAX77693_LED_REG_FLASH_INT_MASK = 0x0F, |
| 49 | MAX77693_LED_REG_FLASH_INT_STATUS = 0x10, | 49 | MAX77693_LED_REG_FLASH_STATUS = 0x10, |
| 50 | 50 | ||
| 51 | MAX77693_PMIC_REG_PMIC_ID1 = 0x20, | 51 | MAX77693_PMIC_REG_PMIC_ID1 = 0x20, |
| 52 | MAX77693_PMIC_REG_PMIC_ID2 = 0x21, | 52 | MAX77693_PMIC_REG_PMIC_ID2 = 0x21, |
| @@ -85,6 +85,65 @@ enum max77693_pmic_reg { | |||
| 85 | MAX77693_PMIC_REG_END, | 85 | MAX77693_PMIC_REG_END, |
| 86 | }; | 86 | }; |
| 87 | 87 | ||
| 88 | /* MAX77693 ITORCH register */ | ||
| 89 | #define TORCH_IOUT1_SHIFT 0 | ||
| 90 | #define TORCH_IOUT2_SHIFT 4 | ||
| 91 | #define TORCH_IOUT_MIN 15625 | ||
| 92 | #define TORCH_IOUT_MAX 250000 | ||
| 93 | #define TORCH_IOUT_STEP 15625 | ||
| 94 | |||
| 95 | /* MAX77693 IFLASH1 and IFLASH2 registers */ | ||
| 96 | #define FLASH_IOUT_MIN 15625 | ||
| 97 | #define FLASH_IOUT_MAX_1LED 1000000 | ||
| 98 | #define FLASH_IOUT_MAX_2LEDS 625000 | ||
| 99 | #define FLASH_IOUT_STEP 15625 | ||
| 100 | |||
| 101 | /* MAX77693 TORCH_TIMER register */ | ||
| 102 | #define TORCH_TMR_NO_TIMER 0x40 | ||
| 103 | #define TORCH_TIMEOUT_MIN 262000 | ||
| 104 | #define TORCH_TIMEOUT_MAX 15728000 | ||
| 105 | |||
| 106 | /* MAX77693 FLASH_TIMER register */ | ||
| 107 | #define FLASH_TMR_LEVEL 0x80 | ||
| 108 | #define FLASH_TIMEOUT_MIN 62500 | ||
| 109 | #define FLASH_TIMEOUT_MAX 1000000 | ||
| 110 | #define FLASH_TIMEOUT_STEP 62500 | ||
| 111 | |||
| 112 | /* MAX77693 FLASH_EN register */ | ||
| 113 | #define FLASH_EN_OFF 0x0 | ||
| 114 | #define FLASH_EN_FLASH 0x1 | ||
| 115 | #define FLASH_EN_TORCH 0x2 | ||
| 116 | #define FLASH_EN_ON 0x3 | ||
| 117 | #define FLASH_EN_SHIFT(x) (6 - ((x) - 1) * 2) | ||
| 118 | #define TORCH_EN_SHIFT(x) (2 - ((x) - 1) * 2) | ||
| 119 | |||
| 120 | /* MAX77693 MAX_FLASH1 register */ | ||
| 121 | #define MAX_FLASH1_MAX_FL_EN 0x80 | ||
| 122 | #define MAX_FLASH1_VSYS_MIN 2400 | ||
| 123 | #define MAX_FLASH1_VSYS_MAX 3400 | ||
| 124 | #define MAX_FLASH1_VSYS_STEP 33 | ||
| 125 | |||
| 126 | /* MAX77693 VOUT_CNTL register */ | ||
| 127 | #define FLASH_BOOST_FIXED 0x04 | ||
| 128 | #define FLASH_BOOST_LEDNUM_2 0x80 | ||
| 129 | |||
| 130 | /* MAX77693 VOUT_FLASH1 register */ | ||
| 131 | #define FLASH_VOUT_MIN 3300 | ||
| 132 | #define FLASH_VOUT_MAX 5500 | ||
| 133 | #define FLASH_VOUT_STEP 25 | ||
| 134 | #define FLASH_VOUT_RMIN 0x0c | ||
| 135 | |||
| 136 | /* MAX77693 FLASH_STATUS register */ | ||
| 137 | #define FLASH_STATUS_FLASH_ON BIT(3) | ||
| 138 | #define FLASH_STATUS_TORCH_ON BIT(2) | ||
| 139 | |||
| 140 | /* MAX77693 FLASH_INT register */ | ||
| 141 | #define FLASH_INT_FLED2_OPEN BIT(0) | ||
| 142 | #define FLASH_INT_FLED2_SHORT BIT(1) | ||
| 143 | #define FLASH_INT_FLED1_OPEN BIT(2) | ||
| 144 | #define FLASH_INT_FLED1_SHORT BIT(3) | ||
| 145 | #define FLASH_INT_OVER_CURRENT BIT(4) | ||
| 146 | |||
| 88 | /* MAX77693 CHG_CNFG_00 register */ | 147 | /* MAX77693 CHG_CNFG_00 register */ |
| 89 | #define CHG_CNFG_00_CHG_MASK 0x1 | 148 | #define CHG_CNFG_00_CHG_MASK 0x1 |
| 90 | #define CHG_CNFG_00_BUCK_MASK 0x4 | 149 | #define CHG_CNFG_00_BUCK_MASK 0x4 |
diff --git a/include/linux/mfd/max77693.h b/include/linux/mfd/max77693.h index 3f3dc45f93ee..f0b6585cd874 100644 --- a/include/linux/mfd/max77693.h +++ b/include/linux/mfd/max77693.h | |||
| @@ -63,6 +63,45 @@ struct max77693_muic_platform_data { | |||
| 63 | int path_uart; | 63 | int path_uart; |
| 64 | }; | 64 | }; |
| 65 | 65 | ||
| 66 | /* MAX77693 led flash */ | ||
| 67 | |||
| 68 | /* triggers */ | ||
| 69 | enum max77693_led_trigger { | ||
| 70 | MAX77693_LED_TRIG_OFF, | ||
| 71 | MAX77693_LED_TRIG_FLASH, | ||
| 72 | MAX77693_LED_TRIG_TORCH, | ||
| 73 | MAX77693_LED_TRIG_EXT, | ||
| 74 | MAX77693_LED_TRIG_SOFT, | ||
| 75 | }; | ||
| 76 | |||
| 77 | /* trigger types */ | ||
| 78 | enum max77693_led_trigger_type { | ||
| 79 | MAX77693_LED_TRIG_TYPE_EDGE, | ||
| 80 | MAX77693_LED_TRIG_TYPE_LEVEL, | ||
| 81 | }; | ||
| 82 | |||
| 83 | /* boost modes */ | ||
| 84 | enum max77693_led_boost_mode { | ||
| 85 | MAX77693_LED_BOOST_NONE, | ||
| 86 | MAX77693_LED_BOOST_ADAPTIVE, | ||
| 87 | MAX77693_LED_BOOST_FIXED, | ||
| 88 | }; | ||
| 89 | |||
| 90 | struct max77693_led_platform_data { | ||
| 91 | u32 fleds[2]; | ||
| 92 | u32 iout_torch[2]; | ||
| 93 | u32 iout_flash[2]; | ||
| 94 | u32 trigger[2]; | ||
| 95 | u32 trigger_type[2]; | ||
| 96 | u32 num_leds; | ||
| 97 | u32 boost_mode; | ||
| 98 | u32 flash_timeout; | ||
| 99 | u32 boost_vout; | ||
| 100 | u32 low_vsys; | ||
| 101 | }; | ||
| 102 | |||
| 103 | /* MAX77693 */ | ||
| 104 | |||
| 66 | struct max77693_platform_data { | 105 | struct max77693_platform_data { |
| 67 | /* regulator data */ | 106 | /* regulator data */ |
| 68 | struct max77693_regulator_data *regulators; | 107 | struct max77693_regulator_data *regulators; |
| @@ -70,5 +109,6 @@ struct max77693_platform_data { | |||
| 70 | 109 | ||
| 71 | /* muic data */ | 110 | /* muic data */ |
| 72 | struct max77693_muic_platform_data *muic_data; | 111 | struct max77693_muic_platform_data *muic_data; |
| 112 | struct max77693_led_platform_data *led_data; | ||
| 73 | }; | 113 | }; |
| 74 | #endif /* __LINUX_MFD_MAX77693_H */ | 114 | #endif /* __LINUX_MFD_MAX77693_H */ |
diff --git a/include/linux/mfd/rk808.h b/include/linux/mfd/rk808.h new file mode 100644 index 000000000000..fb09312d854b --- /dev/null +++ b/include/linux/mfd/rk808.h | |||
| @@ -0,0 +1,196 @@ | |||
| 1 | /* | ||
| 2 | * rk808.h for Rockchip RK808 | ||
| 3 | * | ||
| 4 | * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd | ||
| 5 | * | ||
| 6 | * Author: Chris Zhong <zyw@rock-chips.com> | ||
| 7 | * Author: Zhang Qing <zhangqing@rock-chips.com> | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify it | ||
| 10 | * under the terms and conditions of the GNU General Public License, | ||
| 11 | * version 2, as published by the Free Software Foundation. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 16 | * more details. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef __LINUX_REGULATOR_rk808_H | ||
| 20 | #define __LINUX_REGULATOR_rk808_H | ||
| 21 | |||
| 22 | #include <linux/regulator/machine.h> | ||
| 23 | #include <linux/regmap.h> | ||
| 24 | |||
| 25 | /* | ||
| 26 | * rk808 Global Register Map. | ||
| 27 | */ | ||
| 28 | |||
| 29 | #define RK808_DCDC1 0 /* (0+RK808_START) */ | ||
| 30 | #define RK808_LDO1 4 /* (4+RK808_START) */ | ||
| 31 | #define RK808_NUM_REGULATORS 14 | ||
| 32 | |||
| 33 | enum rk808_reg { | ||
| 34 | RK808_ID_DCDC1, | ||
| 35 | RK808_ID_DCDC2, | ||
| 36 | RK808_ID_DCDC3, | ||
| 37 | RK808_ID_DCDC4, | ||
| 38 | RK808_ID_LDO1, | ||
| 39 | RK808_ID_LDO2, | ||
| 40 | RK808_ID_LDO3, | ||
| 41 | RK808_ID_LDO4, | ||
| 42 | RK808_ID_LDO5, | ||
| 43 | RK808_ID_LDO6, | ||
| 44 | RK808_ID_LDO7, | ||
| 45 | RK808_ID_LDO8, | ||
| 46 | RK808_ID_SWITCH1, | ||
| 47 | RK808_ID_SWITCH2, | ||
| 48 | }; | ||
| 49 | |||
| 50 | #define RK808_SECONDS_REG 0x00 | ||
| 51 | #define RK808_MINUTES_REG 0x01 | ||
| 52 | #define RK808_HOURS_REG 0x02 | ||
| 53 | #define RK808_DAYS_REG 0x03 | ||
| 54 | #define RK808_MONTHS_REG 0x04 | ||
| 55 | #define RK808_YEARS_REG 0x05 | ||
| 56 | #define RK808_WEEKS_REG 0x06 | ||
| 57 | #define RK808_ALARM_SECONDS_REG 0x08 | ||
| 58 | #define RK808_ALARM_MINUTES_REG 0x09 | ||
| 59 | #define RK808_ALARM_HOURS_REG 0x0a | ||
| 60 | #define RK808_ALARM_DAYS_REG 0x0b | ||
| 61 | #define RK808_ALARM_MONTHS_REG 0x0c | ||
| 62 | #define RK808_ALARM_YEARS_REG 0x0d | ||
| 63 | #define RK808_RTC_CTRL_REG 0x10 | ||
| 64 | #define RK808_RTC_STATUS_REG 0x11 | ||
| 65 | #define RK808_RTC_INT_REG 0x12 | ||
| 66 | #define RK808_RTC_COMP_LSB_REG 0x13 | ||
| 67 | #define RK808_RTC_COMP_MSB_REG 0x14 | ||
| 68 | #define RK808_CLK32OUT_REG 0x20 | ||
| 69 | #define RK808_VB_MON_REG 0x21 | ||
| 70 | #define RK808_THERMAL_REG 0x22 | ||
| 71 | #define RK808_DCDC_EN_REG 0x23 | ||
| 72 | #define RK808_LDO_EN_REG 0x24 | ||
| 73 | #define RK808_SLEEP_SET_OFF_REG1 0x25 | ||
| 74 | #define RK808_SLEEP_SET_OFF_REG2 0x26 | ||
| 75 | #define RK808_DCDC_UV_STS_REG 0x27 | ||
| 76 | #define RK808_DCDC_UV_ACT_REG 0x28 | ||
| 77 | #define RK808_LDO_UV_STS_REG 0x29 | ||
| 78 | #define RK808_LDO_UV_ACT_REG 0x2a | ||
| 79 | #define RK808_DCDC_PG_REG 0x2b | ||
| 80 | #define RK808_LDO_PG_REG 0x2c | ||
| 81 | #define RK808_VOUT_MON_TDB_REG 0x2d | ||
| 82 | #define RK808_BUCK1_CONFIG_REG 0x2e | ||
| 83 | #define RK808_BUCK1_ON_VSEL_REG 0x2f | ||
| 84 | #define RK808_BUCK1_SLP_VSEL_REG 0x30 | ||
| 85 | #define RK808_BUCK1_DVS_VSEL_REG 0x31 | ||
| 86 | #define RK808_BUCK2_CONFIG_REG 0x32 | ||
| 87 | #define RK808_BUCK2_ON_VSEL_REG 0x33 | ||
| 88 | #define RK808_BUCK2_SLP_VSEL_REG 0x34 | ||
| 89 | #define RK808_BUCK2_DVS_VSEL_REG 0x35 | ||
| 90 | #define RK808_BUCK3_CONFIG_REG 0x36 | ||
| 91 | #define RK808_BUCK4_CONFIG_REG 0x37 | ||
| 92 | #define RK808_BUCK4_ON_VSEL_REG 0x38 | ||
| 93 | #define RK808_BUCK4_SLP_VSEL_REG 0x39 | ||
| 94 | #define RK808_BOOST_CONFIG_REG 0x3a | ||
| 95 | #define RK808_LDO1_ON_VSEL_REG 0x3b | ||
| 96 | #define RK808_LDO1_SLP_VSEL_REG 0x3c | ||
| 97 | #define RK808_LDO2_ON_VSEL_REG 0x3d | ||
| 98 | #define RK808_LDO2_SLP_VSEL_REG 0x3e | ||
| 99 | #define RK808_LDO3_ON_VSEL_REG 0x3f | ||
| 100 | #define RK808_LDO3_SLP_VSEL_REG 0x40 | ||
| 101 | #define RK808_LDO4_ON_VSEL_REG 0x41 | ||
| 102 | #define RK808_LDO4_SLP_VSEL_REG 0x42 | ||
| 103 | #define RK808_LDO5_ON_VSEL_REG 0x43 | ||
| 104 | #define RK808_LDO5_SLP_VSEL_REG 0x44 | ||
| 105 | #define RK808_LDO6_ON_VSEL_REG 0x45 | ||
| 106 | #define RK808_LDO6_SLP_VSEL_REG 0x46 | ||
| 107 | #define RK808_LDO7_ON_VSEL_REG 0x47 | ||
| 108 | #define RK808_LDO7_SLP_VSEL_REG 0x48 | ||
| 109 | #define RK808_LDO8_ON_VSEL_REG 0x49 | ||
| 110 | #define RK808_LDO8_SLP_VSEL_REG 0x4a | ||
| 111 | #define RK808_DEVCTRL_REG 0x4b | ||
| 112 | #define RK808_INT_STS_REG1 0x4c | ||
| 113 | #define RK808_INT_STS_MSK_REG1 0x4d | ||
| 114 | #define RK808_INT_STS_REG2 0x4e | ||
| 115 | #define RK808_INT_STS_MSK_REG2 0x4f | ||
| 116 | #define RK808_IO_POL_REG 0x50 | ||
| 117 | |||
| 118 | /* IRQ Definitions */ | ||
| 119 | #define RK808_IRQ_VOUT_LO 0 | ||
| 120 | #define RK808_IRQ_VB_LO 1 | ||
| 121 | #define RK808_IRQ_PWRON 2 | ||
| 122 | #define RK808_IRQ_PWRON_LP 3 | ||
| 123 | #define RK808_IRQ_HOTDIE 4 | ||
| 124 | #define RK808_IRQ_RTC_ALARM 5 | ||
| 125 | #define RK808_IRQ_RTC_PERIOD 6 | ||
| 126 | #define RK808_IRQ_PLUG_IN_INT 7 | ||
| 127 | #define RK808_IRQ_PLUG_OUT_INT 8 | ||
| 128 | #define RK808_NUM_IRQ 9 | ||
| 129 | |||
| 130 | #define RK808_IRQ_VOUT_LO_MSK BIT(0) | ||
| 131 | #define RK808_IRQ_VB_LO_MSK BIT(1) | ||
| 132 | #define RK808_IRQ_PWRON_MSK BIT(2) | ||
| 133 | #define RK808_IRQ_PWRON_LP_MSK BIT(3) | ||
| 134 | #define RK808_IRQ_HOTDIE_MSK BIT(4) | ||
| 135 | #define RK808_IRQ_RTC_ALARM_MSK BIT(5) | ||
| 136 | #define RK808_IRQ_RTC_PERIOD_MSK BIT(6) | ||
| 137 | #define RK808_IRQ_PLUG_IN_INT_MSK BIT(0) | ||
| 138 | #define RK808_IRQ_PLUG_OUT_INT_MSK BIT(1) | ||
| 139 | |||
| 140 | #define RK808_VBAT_LOW_2V8 0x00 | ||
| 141 | #define RK808_VBAT_LOW_2V9 0x01 | ||
| 142 | #define RK808_VBAT_LOW_3V0 0x02 | ||
| 143 | #define RK808_VBAT_LOW_3V1 0x03 | ||
| 144 | #define RK808_VBAT_LOW_3V2 0x04 | ||
| 145 | #define RK808_VBAT_LOW_3V3 0x05 | ||
| 146 | #define RK808_VBAT_LOW_3V4 0x06 | ||
| 147 | #define RK808_VBAT_LOW_3V5 0x07 | ||
| 148 | #define VBAT_LOW_VOL_MASK (0x07 << 0) | ||
| 149 | #define EN_VABT_LOW_SHUT_DOWN (0x00 << 4) | ||
| 150 | #define EN_VBAT_LOW_IRQ (0x1 << 4) | ||
| 151 | #define VBAT_LOW_ACT_MASK (0x1 << 4) | ||
| 152 | |||
| 153 | #define BUCK_ILMIN_MASK (7 << 0) | ||
| 154 | #define BOOST_ILMIN_MASK (7 << 0) | ||
| 155 | #define BUCK1_RATE_MASK (3 << 3) | ||
| 156 | #define BUCK2_RATE_MASK (3 << 3) | ||
| 157 | #define MASK_ALL 0xff | ||
| 158 | |||
| 159 | #define SWITCH2_EN BIT(6) | ||
| 160 | #define SWITCH1_EN BIT(5) | ||
| 161 | #define DEV_OFF_RST BIT(3) | ||
| 162 | |||
| 163 | #define VB_LO_ACT BIT(4) | ||
| 164 | #define VB_LO_SEL_3500MV (7 << 0) | ||
| 165 | |||
| 166 | #define VOUT_LO_INT BIT(0) | ||
| 167 | #define CLK32KOUT2_EN BIT(0) | ||
| 168 | |||
| 169 | enum { | ||
| 170 | BUCK_ILMIN_50MA, | ||
| 171 | BUCK_ILMIN_100MA, | ||
| 172 | BUCK_ILMIN_150MA, | ||
| 173 | BUCK_ILMIN_200MA, | ||
| 174 | BUCK_ILMIN_250MA, | ||
| 175 | BUCK_ILMIN_300MA, | ||
| 176 | BUCK_ILMIN_350MA, | ||
| 177 | BUCK_ILMIN_400MA, | ||
| 178 | }; | ||
| 179 | |||
| 180 | enum { | ||
| 181 | BOOST_ILMIN_75MA, | ||
| 182 | BOOST_ILMIN_100MA, | ||
| 183 | BOOST_ILMIN_125MA, | ||
| 184 | BOOST_ILMIN_150MA, | ||
| 185 | BOOST_ILMIN_175MA, | ||
| 186 | BOOST_ILMIN_200MA, | ||
| 187 | BOOST_ILMIN_225MA, | ||
| 188 | BOOST_ILMIN_250MA, | ||
| 189 | }; | ||
| 190 | |||
| 191 | struct rk808 { | ||
| 192 | struct i2c_client *i2c; | ||
| 193 | struct regmap_irq_chip_data *irq_data; | ||
| 194 | struct regmap *regmap; | ||
| 195 | }; | ||
| 196 | #endif /* __LINUX_REGULATOR_rk808_H */ | ||
diff --git a/include/linux/mfd/rn5t618.h b/include/linux/mfd/rn5t618.h new file mode 100644 index 000000000000..c72d5344f3b3 --- /dev/null +++ b/include/linux/mfd/rn5t618.h | |||
| @@ -0,0 +1,228 @@ | |||
| 1 | /* | ||
| 2 | * MFD core driver for Ricoh RN5T618 PMIC | ||
| 3 | * | ||
| 4 | * Copyright (C) 2014 Beniamino Galvani <b.galvani@gmail.com> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of the GNU General Public License | ||
| 8 | * version 2 as published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * You should have received a copy of the GNU General Public License | ||
| 11 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __LINUX_MFD_RN5T618_H | ||
| 15 | #define __LINUX_MFD_RN5T618_H | ||
| 16 | |||
| 17 | #include <linux/regmap.h> | ||
| 18 | |||
| 19 | #define RN5T618_LSIVER 0x00 | ||
| 20 | #define RN5T618_OTPVER 0x01 | ||
| 21 | #define RN5T618_IODAC 0x02 | ||
| 22 | #define RN5T618_VINDAC 0x03 | ||
| 23 | #define RN5T618_CPUCNT 0x06 | ||
| 24 | #define RN5T618_PSWR 0x07 | ||
| 25 | #define RN5T618_PONHIS 0x09 | ||
| 26 | #define RN5T618_POFFHIS 0x0a | ||
| 27 | #define RN5T618_WATCHDOG 0x0b | ||
| 28 | #define RN5T618_WATCHDOGCNT 0x0c | ||
| 29 | #define RN5T618_PWRFUNC 0x0d | ||
| 30 | #define RN5T618_SLPCNT 0x0e | ||
| 31 | #define RN5T618_REPCNT 0x0f | ||
| 32 | #define RN5T618_PWRONTIMSET 0x10 | ||
| 33 | #define RN5T618_NOETIMSETCNT 0x11 | ||
| 34 | #define RN5T618_PWRIREN 0x12 | ||
| 35 | #define RN5T618_PWRIRQ 0x13 | ||
| 36 | #define RN5T618_PWRMON 0x14 | ||
| 37 | #define RN5T618_PWRIRSEL 0x15 | ||
| 38 | #define RN5T618_DC1_SLOT 0x16 | ||
| 39 | #define RN5T618_DC2_SLOT 0x17 | ||
| 40 | #define RN5T618_DC3_SLOT 0x18 | ||
| 41 | #define RN5T618_LDO1_SLOT 0x1b | ||
| 42 | #define RN5T618_LDO2_SLOT 0x1c | ||
| 43 | #define RN5T618_LDO3_SLOT 0x1d | ||
| 44 | #define RN5T618_LDO4_SLOT 0x1e | ||
| 45 | #define RN5T618_LDO5_SLOT 0x1f | ||
| 46 | #define RN5T618_PSO0_SLOT 0x25 | ||
| 47 | #define RN5T618_PSO1_SLOT 0x26 | ||
| 48 | #define RN5T618_PSO2_SLOT 0x27 | ||
| 49 | #define RN5T618_PSO3_SLOT 0x28 | ||
| 50 | #define RN5T618_LDORTC1_SLOT 0x2a | ||
| 51 | #define RN5T618_DC1CTL 0x2c | ||
| 52 | #define RN5T618_DC1CTL2 0x2d | ||
| 53 | #define RN5T618_DC2CTL 0x2e | ||
| 54 | #define RN5T618_DC2CTL2 0x2f | ||
| 55 | #define RN5T618_DC3CTL 0x30 | ||
| 56 | #define RN5T618_DC3CTL2 0x31 | ||
| 57 | #define RN5T618_DC1DAC 0x36 | ||
| 58 | #define RN5T618_DC2DAC 0x37 | ||
| 59 | #define RN5T618_DC3DAC 0x38 | ||
| 60 | #define RN5T618_DC1DAC_SLP 0x3b | ||
| 61 | #define RN5T618_DC2DAC_SLP 0x3c | ||
| 62 | #define RN5T618_DC3DAC_SLP 0x3d | ||
| 63 | #define RN5T618_DCIREN 0x40 | ||
| 64 | #define RN5T618_DCIRQ 0x41 | ||
| 65 | #define RN5T618_DCIRMON 0x42 | ||
| 66 | #define RN5T618_LDOEN1 0x44 | ||
| 67 | #define RN5T618_LDOEN2 0x45 | ||
| 68 | #define RN5T618_LDODIS 0x46 | ||
| 69 | #define RN5T618_LDO1DAC 0x4c | ||
| 70 | #define RN5T618_LDO2DAC 0x4d | ||
| 71 | #define RN5T618_LDO3DAC 0x4e | ||
| 72 | #define RN5T618_LDO4DAC 0x4f | ||
| 73 | #define RN5T618_LDO5DAC 0x50 | ||
| 74 | #define RN5T618_LDORTCDAC 0x56 | ||
| 75 | #define RN5T618_LDORTC2DAC 0x57 | ||
| 76 | #define RN5T618_LDO1DAC_SLP 0x58 | ||
| 77 | #define RN5T618_LDO2DAC_SLP 0x59 | ||
| 78 | #define RN5T618_LDO3DAC_SLP 0x5a | ||
| 79 | #define RN5T618_LDO4DAC_SLP 0x5b | ||
| 80 | #define RN5T618_LDO5DAC_SLP 0x5c | ||
| 81 | #define RN5T618_ADCCNT1 0x64 | ||
| 82 | #define RN5T618_ADCCNT2 0x65 | ||
| 83 | #define RN5T618_ADCCNT3 0x66 | ||
| 84 | #define RN5T618_ILIMDATAH 0x68 | ||
| 85 | #define RN5T618_ILIMDATAL 0x69 | ||
| 86 | #define RN5T618_VBATDATAH 0x6a | ||
| 87 | #define RN5T618_VBATDATAL 0x6b | ||
| 88 | #define RN5T618_VADPDATAH 0x6c | ||
| 89 | #define RN5T618_VADPDATAL 0x6d | ||
| 90 | #define RN5T618_VUSBDATAH 0x6e | ||
| 91 | #define RN5T618_VUSBDATAL 0x6f | ||
| 92 | #define RN5T618_VSYSDATAH 0x70 | ||
| 93 | #define RN5T618_VSYSDATAL 0x71 | ||
| 94 | #define RN5T618_VTHMDATAH 0x72 | ||
| 95 | #define RN5T618_VTHMDATAL 0x73 | ||
| 96 | #define RN5T618_AIN1DATAH 0x74 | ||
| 97 | #define RN5T618_AIN1DATAL 0x75 | ||
| 98 | #define RN5T618_AIN0DATAH 0x76 | ||
| 99 | #define RN5T618_AIN0DATAL 0x77 | ||
| 100 | #define RN5T618_ILIMTHL 0x78 | ||
| 101 | #define RN5T618_ILIMTHH 0x79 | ||
| 102 | #define RN5T618_VBATTHL 0x7a | ||
| 103 | #define RN5T618_VBATTHH 0x7b | ||
| 104 | #define RN5T618_VADPTHL 0x7c | ||
| 105 | #define RN5T618_VADPTHH 0x7d | ||
| 106 | #define RN5T618_VUSBTHL 0x7e | ||
| 107 | #define RN5T618_VUSBTHH 0x7f | ||
| 108 | #define RN5T618_VSYSTHL 0x80 | ||
| 109 | #define RN5T618_VSYSTHH 0x81 | ||
| 110 | #define RN5T618_VTHMTHL 0x82 | ||
| 111 | #define RN5T618_VTHMTHH 0x83 | ||
| 112 | #define RN5T618_AIN1THL 0x84 | ||
| 113 | #define RN5T618_AIN1THH 0x85 | ||
| 114 | #define RN5T618_AIN0THL 0x86 | ||
| 115 | #define RN5T618_AIN0THH 0x87 | ||
| 116 | #define RN5T618_EN_ADCIR1 0x88 | ||
| 117 | #define RN5T618_EN_ADCIR2 0x89 | ||
| 118 | #define RN5T618_EN_ADCIR3 0x8a | ||
| 119 | #define RN5T618_IR_ADC1 0x8c | ||
| 120 | #define RN5T618_IR_ADC2 0x8d | ||
| 121 | #define RN5T618_IR_ADC3 0x8e | ||
| 122 | #define RN5T618_IOSEL 0x90 | ||
| 123 | #define RN5T618_IOOUT 0x91 | ||
| 124 | #define RN5T618_GPEDGE1 0x92 | ||
| 125 | #define RN5T618_GPEDGE2 0x93 | ||
| 126 | #define RN5T618_EN_GPIR 0x94 | ||
| 127 | #define RN5T618_IR_GPR 0x95 | ||
| 128 | #define RN5T618_IR_GPF 0x96 | ||
| 129 | #define RN5T618_MON_IOIN 0x97 | ||
| 130 | #define RN5T618_GPLED_FUNC 0x98 | ||
| 131 | #define RN5T618_INTPOL 0x9c | ||
| 132 | #define RN5T618_INTEN 0x9d | ||
| 133 | #define RN5T618_INTMON 0x9e | ||
| 134 | #define RN5T618_PREVINDAC 0xb0 | ||
| 135 | #define RN5T618_BATDAC 0xb1 | ||
| 136 | #define RN5T618_CHGCTL1 0xb3 | ||
| 137 | #define RN5T618_CHGCTL2 0xb4 | ||
| 138 | #define RN5T618_VSYSSET 0xb5 | ||
| 139 | #define RN5T618_REGISET1 0xb6 | ||
| 140 | #define RN5T618_REGISET2 0xb7 | ||
| 141 | #define RN5T618_CHGISET 0xb8 | ||
| 142 | #define RN5T618_TIMSET 0xb9 | ||
| 143 | #define RN5T618_BATSET1 0xba | ||
| 144 | #define RN5T618_BATSET2 0xbb | ||
| 145 | #define RN5T618_DIESET 0xbc | ||
| 146 | #define RN5T618_CHGSTATE 0xbd | ||
| 147 | #define RN5T618_CHGCTRL_IRFMASK 0xbe | ||
| 148 | #define RN5T618_CHGSTAT_IRFMASK1 0xbf | ||
| 149 | #define RN5T618_CHGSTAT_IRFMASK2 0xc0 | ||
| 150 | #define RN5T618_CHGERR_IRFMASK 0xc1 | ||
| 151 | #define RN5T618_CHGCTRL_IRR 0xc2 | ||
| 152 | #define RN5T618_CHGSTAT_IRR1 0xc3 | ||
| 153 | #define RN5T618_CHGSTAT_IRR2 0xc4 | ||
| 154 | #define RN5T618_CHGERR_IRR 0xc5 | ||
| 155 | #define RN5T618_CHGCTRL_MONI 0xc6 | ||
| 156 | #define RN5T618_CHGSTAT_MONI1 0xc7 | ||
| 157 | #define RN5T618_CHGSTAT_MONI2 0xc8 | ||
| 158 | #define RN5T618_CHGERR_MONI 0xc9 | ||
| 159 | #define RN5T618_CHGCTRL_DETMOD1 0xca | ||
| 160 | #define RN5T618_CHGCTRL_DETMOD2 0xcb | ||
| 161 | #define RN5T618_CHGSTAT_DETMOD1 0xcc | ||
| 162 | #define RN5T618_CHGSTAT_DETMOD2 0xcd | ||
| 163 | #define RN5T618_CHGSTAT_DETMOD3 0xce | ||
| 164 | #define RN5T618_CHGERR_DETMOD1 0xcf | ||
| 165 | #define RN5T618_CHGERR_DETMOD2 0xd0 | ||
| 166 | #define RN5T618_CHGOSCCTL 0xd4 | ||
| 167 | #define RN5T618_CHGOSCSCORESET1 0xd5 | ||
| 168 | #define RN5T618_CHGOSCSCORESET2 0xd6 | ||
| 169 | #define RN5T618_CHGOSCSCORESET3 0xd7 | ||
| 170 | #define RN5T618_CHGOSCFREQSET1 0xd8 | ||
| 171 | #define RN5T618_CHGOSCFREQSET2 0xd9 | ||
| 172 | #define RN5T618_CONTROL 0xe0 | ||
| 173 | #define RN5T618_SOC 0xe1 | ||
| 174 | #define RN5T618_RE_CAP_H 0xe2 | ||
| 175 | #define RN5T618_RE_CAP_L 0xe3 | ||
| 176 | #define RN5T618_FA_CAP_H 0xe4 | ||
| 177 | #define RN5T618_FA_CAP_L 0xe5 | ||
| 178 | #define RN5T618_AGE 0xe6 | ||
| 179 | #define RN5T618_TT_EMPTY_H 0xe7 | ||
| 180 | #define RN5T618_TT_EMPTY_L 0xe8 | ||
| 181 | #define RN5T618_TT_FULL_H 0xe9 | ||
| 182 | #define RN5T618_TT_FULL_L 0xea | ||
| 183 | #define RN5T618_VOLTAGE_1 0xeb | ||
| 184 | #define RN5T618_VOLTAGE_0 0xec | ||
| 185 | #define RN5T618_TEMP_1 0xed | ||
| 186 | #define RN5T618_TEMP_0 0xee | ||
| 187 | #define RN5T618_CC_CTRL 0xef | ||
| 188 | #define RN5T618_CC_COUNT2 0xf0 | ||
| 189 | #define RN5T618_CC_COUNT1 0xf1 | ||
| 190 | #define RN5T618_CC_COUNT0 0xf2 | ||
| 191 | #define RN5T618_CC_SUMREG3 0xf3 | ||
| 192 | #define RN5T618_CC_SUMREG2 0xf4 | ||
| 193 | #define RN5T618_CC_SUMREG1 0xf5 | ||
| 194 | #define RN5T618_CC_SUMREG0 0xf6 | ||
| 195 | #define RN5T618_CC_OFFREG1 0xf7 | ||
| 196 | #define RN5T618_CC_OFFREG0 0xf8 | ||
| 197 | #define RN5T618_CC_GAINREG1 0xf9 | ||
| 198 | #define RN5T618_CC_GAINREG0 0xfa | ||
| 199 | #define RN5T618_CC_AVEREG1 0xfb | ||
| 200 | #define RN5T618_CC_AVEREG0 0xfc | ||
| 201 | #define RN5T618_MAX_REG 0xfc | ||
| 202 | |||
| 203 | #define RN5T618_REPCNT_REPWRON BIT(0) | ||
| 204 | #define RN5T618_SLPCNT_SWPWROFF BIT(0) | ||
| 205 | #define RN5T618_WATCHDOG_WDOGEN BIT(2) | ||
| 206 | #define RN5T618_WATCHDOG_WDOGTIM_M (BIT(0) | BIT(1)) | ||
| 207 | #define RN5T618_WATCHDOG_WDOGTIM_S 0 | ||
| 208 | #define RN5T618_PWRIRQ_IR_WDOG BIT(6) | ||
| 209 | |||
| 210 | enum { | ||
| 211 | RN5T618_DCDC1, | ||
| 212 | RN5T618_DCDC2, | ||
| 213 | RN5T618_DCDC3, | ||
| 214 | RN5T618_LDO1, | ||
| 215 | RN5T618_LDO2, | ||
| 216 | RN5T618_LDO3, | ||
| 217 | RN5T618_LDO4, | ||
| 218 | RN5T618_LDO5, | ||
| 219 | RN5T618_LDORTC1, | ||
| 220 | RN5T618_LDORTC2, | ||
| 221 | RN5T618_REG_NUM, | ||
| 222 | }; | ||
| 223 | |||
| 224 | struct rn5t618 { | ||
| 225 | struct regmap *regmap; | ||
| 226 | }; | ||
| 227 | |||
| 228 | #endif /* __LINUX_MFD_RN5T618_H */ | ||
diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h index fb96c84dada5..e2e70053470e 100644 --- a/include/linux/mfd/ti_am335x_tscadc.h +++ b/include/linux/mfd/ti_am335x_tscadc.h | |||
| @@ -155,6 +155,7 @@ struct ti_tscadc_dev { | |||
| 155 | void __iomem *tscadc_base; | 155 | void __iomem *tscadc_base; |
| 156 | int irq; | 156 | int irq; |
| 157 | int used_cells; /* 1-2 */ | 157 | int used_cells; /* 1-2 */ |
| 158 | int tsc_wires; | ||
| 158 | int tsc_cell; /* -1 if not used */ | 159 | int tsc_cell; /* -1 if not used */ |
| 159 | int adc_cell; /* -1 if not used */ | 160 | int adc_cell; /* -1 if not used */ |
| 160 | struct mfd_cell cells[TSCADC_CELLS]; | 161 | struct mfd_cell cells[TSCADC_CELLS]; |
diff --git a/include/linux/mfd/ti_ssp.h b/include/linux/mfd/ti_ssp.h deleted file mode 100644 index dbb4b43bd20e..000000000000 --- a/include/linux/mfd/ti_ssp.h +++ /dev/null | |||
| @@ -1,93 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Sequencer Serial Port (SSP) driver for Texas Instruments' SoCs | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010 Texas Instruments Inc | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2 of the License, or | ||
| 9 | * (at your option) any later version. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __TI_SSP_H__ | ||
| 22 | #define __TI_SSP_H__ | ||
| 23 | |||
| 24 | struct ti_ssp_dev_data { | ||
| 25 | const char *dev_name; | ||
| 26 | void *pdata; | ||
| 27 | size_t pdata_size; | ||
| 28 | }; | ||
| 29 | |||
| 30 | struct ti_ssp_data { | ||
| 31 | unsigned long out_clock; | ||
| 32 | struct ti_ssp_dev_data dev_data[2]; | ||
| 33 | }; | ||
| 34 | |||
| 35 | struct ti_ssp_spi_data { | ||
| 36 | unsigned long iosel; | ||
| 37 | int num_cs; | ||
| 38 | void (*select)(int cs); | ||
| 39 | }; | ||
| 40 | |||
| 41 | /* | ||
| 42 | * Sequencer port IO pin configuration bits. These do not correlate 1-1 with | ||
| 43 | * the hardware. The iosel field in the port data combines iosel1 and iosel2, | ||
| 44 | * and is therefore not a direct map to register space. It is best to use the | ||
| 45 | * macros below to construct iosel values. | ||
| 46 | * | ||
| 47 | * least significant 16 bits --> iosel1 | ||
| 48 | * most significant 16 bits --> iosel2 | ||
| 49 | */ | ||
| 50 | |||
| 51 | #define SSP_IN 0x0000 | ||
| 52 | #define SSP_DATA 0x0001 | ||
| 53 | #define SSP_CLOCK 0x0002 | ||
| 54 | #define SSP_CHIPSEL 0x0003 | ||
| 55 | #define SSP_OUT 0x0004 | ||
| 56 | #define SSP_PIN_SEL(pin, v) ((v) << ((pin) * 3)) | ||
| 57 | #define SSP_PIN_MASK(pin) SSP_PIN_SEL(pin, 0x7) | ||
| 58 | #define SSP_INPUT_SEL(pin) ((pin) << 16) | ||
| 59 | |||
| 60 | /* Sequencer port config bits */ | ||
| 61 | #define SSP_EARLY_DIN BIT(8) | ||
| 62 | #define SSP_DELAY_DOUT BIT(9) | ||
| 63 | |||
| 64 | /* Sequence map definitions */ | ||
| 65 | #define SSP_CLK_HIGH BIT(0) | ||
| 66 | #define SSP_CLK_LOW 0 | ||
| 67 | #define SSP_DATA_HIGH BIT(1) | ||
| 68 | #define SSP_DATA_LOW 0 | ||
| 69 | #define SSP_CS_HIGH BIT(2) | ||
| 70 | #define SSP_CS_LOW 0 | ||
| 71 | #define SSP_OUT_MODE BIT(3) | ||
| 72 | #define SSP_IN_MODE 0 | ||
| 73 | #define SSP_DATA_REG BIT(4) | ||
| 74 | #define SSP_ADDR_REG 0 | ||
| 75 | |||
| 76 | #define SSP_OPCODE_DIRECT ((0x0) << 5) | ||
| 77 | #define SSP_OPCODE_TOGGLE ((0x1) << 5) | ||
| 78 | #define SSP_OPCODE_SHIFT ((0x2) << 5) | ||
| 79 | #define SSP_OPCODE_BRANCH0 ((0x4) << 5) | ||
| 80 | #define SSP_OPCODE_BRANCH1 ((0x5) << 5) | ||
| 81 | #define SSP_OPCODE_BRANCH ((0x6) << 5) | ||
| 82 | #define SSP_OPCODE_STOP ((0x7) << 5) | ||
| 83 | #define SSP_BRANCH(addr) ((addr) << 8) | ||
| 84 | #define SSP_COUNT(cycles) ((cycles) << 8) | ||
| 85 | |||
| 86 | int ti_ssp_raw_read(struct device *dev); | ||
| 87 | int ti_ssp_raw_write(struct device *dev, u32 val); | ||
| 88 | int ti_ssp_load(struct device *dev, int offs, u32* prog, int len); | ||
| 89 | int ti_ssp_run(struct device *dev, u32 pc, u32 input, u32 *output); | ||
| 90 | int ti_ssp_set_mode(struct device *dev, int mode); | ||
| 91 | int ti_ssp_set_iosel(struct device *dev, u32 iosel); | ||
| 92 | |||
| 93 | #endif /* __TI_SSP_H__ */ | ||
diff --git a/include/linux/mfd/tps65217.h b/include/linux/mfd/tps65217.h index 95d6938737fd..ac7fba44d7e4 100644 --- a/include/linux/mfd/tps65217.h +++ b/include/linux/mfd/tps65217.h | |||
| @@ -60,6 +60,8 @@ | |||
| 60 | #define TPS65217_REG_SEQ5 0X1D | 60 | #define TPS65217_REG_SEQ5 0X1D |
| 61 | #define TPS65217_REG_SEQ6 0X1E | 61 | #define TPS65217_REG_SEQ6 0X1E |
| 62 | 62 | ||
| 63 | #define TPS65217_REG_MAX TPS65217_REG_SEQ6 | ||
| 64 | |||
| 63 | /* Register field definitions */ | 65 | /* Register field definitions */ |
| 64 | #define TPS65217_CHIPID_CHIP_MASK 0xF0 | 66 | #define TPS65217_CHIPID_CHIP_MASK 0xF0 |
| 65 | #define TPS65217_CHIPID_REV_MASK 0x0F | 67 | #define TPS65217_CHIPID_REV_MASK 0x0F |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 24f97bf74266..1fa99a301817 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -2560,6 +2560,7 @@ | |||
| 2560 | #define PCI_DEVICE_ID_INTEL_MFD_EMMC0 0x0823 | 2560 | #define PCI_DEVICE_ID_INTEL_MFD_EMMC0 0x0823 |
| 2561 | #define PCI_DEVICE_ID_INTEL_MFD_EMMC1 0x0824 | 2561 | #define PCI_DEVICE_ID_INTEL_MFD_EMMC1 0x0824 |
| 2562 | #define PCI_DEVICE_ID_INTEL_MRST_SD2 0x084F | 2562 | #define PCI_DEVICE_ID_INTEL_MRST_SD2 0x084F |
| 2563 | #define PCI_DEVICE_ID_INTEL_QUARK_X1000_ILB 0x095E | ||
| 2563 | #define PCI_DEVICE_ID_INTEL_I960 0x0960 | 2564 | #define PCI_DEVICE_ID_INTEL_I960 0x0960 |
| 2564 | #define PCI_DEVICE_ID_INTEL_I960RM 0x0962 | 2565 | #define PCI_DEVICE_ID_INTEL_I960RM 0x0962 |
| 2565 | #define PCI_DEVICE_ID_INTEL_CENTERTON_ILB 0x0c60 | 2566 | #define PCI_DEVICE_ID_INTEL_CENTERTON_ILB 0x0c60 |
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c index 2c71f16bd661..0c05e7a7945f 100644 --- a/sound/soc/codecs/arizona.c +++ b/sound/soc/codecs/arizona.c | |||
| @@ -1220,7 +1220,7 @@ static int arizona_hw_params_rate(struct snd_pcm_substream *substream, | |||
| 1220 | break; | 1220 | break; |
| 1221 | case ARIZONA_CLK_ASYNCCLK: | 1221 | case ARIZONA_CLK_ASYNCCLK: |
| 1222 | snd_soc_update_bits(codec, ARIZONA_ASYNC_SAMPLE_RATE_1, | 1222 | snd_soc_update_bits(codec, ARIZONA_ASYNC_SAMPLE_RATE_1, |
| 1223 | ARIZONA_ASYNC_SAMPLE_RATE_MASK, sr_val); | 1223 | ARIZONA_ASYNC_SAMPLE_RATE_1_MASK, sr_val); |
| 1224 | if (base) | 1224 | if (base) |
| 1225 | snd_soc_update_bits(codec, base + ARIZONA_AIF_RATE_CTRL, | 1225 | snd_soc_update_bits(codec, base + ARIZONA_AIF_RATE_CTRL, |
| 1226 | ARIZONA_AIF1_RATE_MASK, | 1226 | ARIZONA_AIF1_RATE_MASK, |
