Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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
...

+2065 -407
+27
Documentation/acpi/enumeration.txt
··· 312 312 313 313 There are also devm_* versions of these functions which release the 314 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.
+7
Documentation/devicetree/bindings/mfd/arizona.txt
··· 42 42 the chip default will be used. If present exactly five values must 43 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 52 - DCVDD-supply, MICVDD-supply : Power supplies, only need to be specified if 46 53 they are being externally supplied. As covered in 47 54 Documentation/devicetree/bindings/regulator/regulator.txt
+15
Documentation/devicetree/bindings/mfd/atmel-gpbr.txt
··· 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 + };
+38
Documentation/devicetree/bindings/mfd/hi6421.txt
··· 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 + };
+1
Documentation/devicetree/bindings/mfd/qcom,pm8xxx.txt Documentation/devicetree/bindings/mfd/qcom-pm8xxx.txt
··· 61 61 Definition: must be one of: 62 62 "qcom,pm8058-rtc" 63 63 "qcom,pm8921-rtc" 64 + "qcom,pm8941-rtc" 64 65 65 66 - reg: 66 67 Usage: required
+64
Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.txt
··· 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 + };
+177
Documentation/devicetree/bindings/mfd/rk808.txt
··· 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 + };
+36
Documentation/devicetree/bindings/mfd/rn5t618.txt
··· 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 + };
+1
Documentation/devicetree/bindings/mfd/stmpe.txt
··· 13 13 - interrupt-parent : Specifies which IRQ controller we're connected to 14 14 - wakeup-source : Marks the input device as wakable 15 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 18 Example: 18 19
+7 -2
Documentation/devicetree/bindings/mfd/twl4030-power.txt
··· 23 23 depending on how the external oscillator is wired. 24 24 25 25 Optional properties: 26 - - ti,use_poweroff: With this flag, the chip will initiates an ACTIVE-to-OFF or 27 - SLEEP-to-OFF transition when the system poweroffs. 26 + 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 34 Example: 30 35 &i2c1 {
+9
MAINTAINERS
··· 6010 6010 F: drivers/mcb/ 6011 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 6022 METAG ARCHITECTURE 6014 6023 M: James Hogan <james.hogan@imgtec.com> 6015 6024 L: linux-metag@vger.kernel.org
+4 -1
drivers/i2c/busses/i2c-cros-ec-tunnel.c
··· 16 16 #include <linux/platform_device.h> 17 17 #include <linux/slab.h> 18 18 19 + #define I2C_MAX_RETRIES 3 20 + 19 21 /** 20 22 * struct ec_i2c_device - Driver data for I2C tunnel 21 23 * ··· 229 227 msg.indata = response; 230 228 msg.insize = response_len; 231 229 232 - result = bus->ec->cmd_xfer(bus->ec, &msg); 230 + result = cros_ec_cmd_xfer(bus->ec, &msg); 233 231 if (result < 0) 234 232 goto exit; 235 233 ··· 292 290 bus->adap.algo_data = bus; 293 291 bus->adap.dev.parent = &pdev->dev; 294 292 bus->adap.dev.of_node = np; 293 + bus->adap.retries = I2C_MAX_RETRIES; 295 294 296 295 err = i2c_add_adapter(&bus->adap); 297 296 if (err) {
+1 -1
drivers/input/keyboard/cros_ec_keyb.c
··· 157 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 163 static irqreturn_t cros_ec_keyb_irq(int irq, void *data)
+1 -65
drivers/mfd/88pm860x-i2c.c
··· 122 122 static int write_device(struct i2c_client *i2c, int reg, 123 123 int bytes, void *src) 124 124 { 125 - unsigned char buf[bytes + 1]; 125 + unsigned char buf[2]; 126 126 struct i2c_adapter *adap = i2c->adapter; 127 127 struct i2c_msg msg; 128 128 int ret; ··· 139 139 return ret; 140 140 return 0; 141 141 } 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 142 163 143 int pm860x_page_reg_write(struct i2c_client *i2c, int reg, 164 144 unsigned char data) ··· 175 195 return ret; 176 196 } 177 197 EXPORT_SYMBOL(pm860x_page_bulk_read); 178 - 179 - int pm860x_page_bulk_write(struct i2c_client *i2c, int reg, 180 - int count, unsigned char *buf) 181 - { 182 - unsigned char zero = 0; 183 - int ret; 184 - 185 - i2c_lock_adapter(i2c->adapter); 186 - read_device(i2c, 0xFA, 0, &zero); 187 - read_device(i2c, 0xFB, 0, &zero); 188 - read_device(i2c, 0xFF, 0, &zero); 189 - ret = write_device(i2c, reg, count, buf); 190 - read_device(i2c, 0xFE, 0, &zero); 191 - read_device(i2c, 0xFC, 0, &zero); 192 - i2c_unlock_adapter(i2c->adapter); 193 - i2c_unlock_adapter(i2c->adapter); 194 - return ret; 195 - } 196 - EXPORT_SYMBOL(pm860x_page_bulk_write); 197 - 198 - int pm860x_page_set_bits(struct i2c_client *i2c, int reg, 199 - unsigned char mask, unsigned char data) 200 - { 201 - unsigned char zero; 202 - unsigned char value; 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 = read_device(i2c, reg, 1, &value); 210 - if (ret < 0) 211 - goto out; 212 - value &= ~mask; 213 - value |= data; 214 - ret = write_device(i2c, reg, 1, &value); 215 - out: 216 - read_device(i2c, 0xFE, 0, &zero); 217 - read_device(i2c, 0xFC, 0, &zero); 218 - i2c_unlock_adapter(i2c->adapter); 219 - return ret; 220 - } 221 - EXPORT_SYMBOL(pm860x_page_set_bits);
+54 -2
drivers/mfd/Kconfig
··· 210 210 help 211 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 226 config HTC_EGPIO 214 227 bool "HTC EGPIO support" 215 228 depends on GPIOLIB && ARM ··· 567 554 Say M here if you want to include support for PM8921 chip as a module. 568 555 This will build a module called "pm8921-core". 569 556 557 + config MFD_SPMI_PMIC 558 + tristate "Qualcomm SPMI PMICs" 559 + depends on ARCH_QCOM || COMPILE_TEST 560 + depends on OF 561 + depends on SPMI 562 + select REGMAP_SPMI 563 + help 564 + This enables support for the Qualcomm SPMI PMICs. 565 + These PMICs are currently used with the Snapdragon 800 series of 566 + SoCs. Note, that this will only be useful paired with descriptions 567 + of the independent functions as children nodes in the device tree. 568 + 569 + Say M here if you want to include support for the SPMI PMIC 570 + series as a module. The module will be called "qcom-spmi-pmic". 571 + 570 572 config MFD_RDC321X 571 573 tristate "RDC R-321x southbridge" 572 574 select MFD_CORE ··· 624 596 like GPIO, interrupts, RTC, LDO and DCDC regulators, onkey. 625 597 Additional drivers must be enabled in order to use the 626 598 different functionality of the device. 599 + 600 + config MFD_RK808 601 + tristate "Rockchip RK808 Power Management chip" 602 + depends on I2C && OF 603 + select MFD_CORE 604 + select REGMAP_I2C 605 + select REGMAP_IRQ 606 + help 607 + If you say yes here you get support for the RK808 608 + Power Management chips. 609 + This driver provides common support for accessing the device 610 + through I2C interface. The device supports multiple sub-devices 611 + including interrupts, RTC, LDO & DCDC regulators, and onkey. 612 + 613 + config MFD_RN5T618 614 + tristate "Ricoh RN5T5618 PMIC" 615 + depends on I2C 616 + select MFD_CORE 617 + select REGMAP_I2C 618 + help 619 + Say yes here to add support for the Ricoh RN5T618 PMIC. This 620 + driver provides common support for accessing the device, 621 + additional drivers must be enabled in order to use the 622 + functionality of the device. 627 623 628 624 config MFD_SEC_CORE 629 625 bool "SAMSUNG Electronics PMIC Series Support" ··· 1295 1243 selected to enable support for the functionality of the chip. 1296 1244 1297 1245 config MFD_WM8994 1298 - bool "Wolfson Microelectronics WM8994" 1246 + tristate "Wolfson Microelectronics WM8994" 1299 1247 select MFD_CORE 1300 1248 select REGMAP_I2C 1301 1249 select REGMAP_IRQ 1302 - depends on I2C=y 1250 + depends on I2C 1303 1251 help 1304 1252 The WM8994 is a highly integrated hi-fi CODEC designed for 1305 1253 smartphone applicatiosn. As well as audio functionality it
+4
drivers/mfd/Makefile
··· 153 153 obj-$(CONFIG_MFD_CS5535) += cs5535-mfd.o 154 154 obj-$(CONFIG_MFD_OMAP_USB_HOST) += omap-usb-host.o omap-usb-tll.o 155 155 obj-$(CONFIG_MFD_PM8921_CORE) += pm8921-core.o ssbi.o 156 + obj-$(CONFIG_MFD_SPMI_PMIC) += qcom-spmi-pmic.o 156 157 obj-$(CONFIG_TPS65911_COMPARATOR) += tps65911-comparator.o 157 158 obj-$(CONFIG_MFD_TPS65090) += tps65090.o 158 159 obj-$(CONFIG_MFD_AAT2870_CORE) += aat2870-core.o ··· 161 160 obj-$(CONFIG_MFD_PALMAS) += palmas.o 162 161 obj-$(CONFIG_MFD_VIPERBOARD) += viperboard.o 163 162 obj-$(CONFIG_MFD_RC5T583) += rc5t583.o rc5t583-irq.o 163 + obj-$(CONFIG_MFD_RK808) += rk808.o 164 + obj-$(CONFIG_MFD_RN5T618) += rn5t618.o 164 165 obj-$(CONFIG_MFD_SEC_CORE) += sec-core.o sec-irq.o 165 166 obj-$(CONFIG_MFD_SYSCON) += syscon.o 166 167 obj-$(CONFIG_MFD_LM3533) += lm3533-core.o lm3533-ctrlbank.o ··· 173 170 obj-$(CONFIG_MFD_STW481X) += stw481x.o 174 171 obj-$(CONFIG_MFD_IPAQ_MICRO) += ipaq-micro.o 175 172 obj-$(CONFIG_MFD_MENF21BMC) += menf21bmc.o 173 + obj-$(CONFIG_MFD_HI6421_PMIC) += hi6421-pmic-core.o 176 174 177 175 intel-soc-pmic-objs := intel_soc_pmic_core.o intel_soc_pmic_crc.o 178 176 obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o
+16 -13
drivers/mfd/arizona-core.c
··· 393 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 396 ret = regcache_sync(arizona->regmap); 409 397 if (ret != 0) { 410 398 dev_err(arizona->dev, "Failed to restore register cache\n"); ··· 522 534 static int arizona_of_get_core_pdata(struct arizona *arizona) 523 535 { 524 536 struct arizona_pdata *pdata = &arizona->pdata; 537 + struct property *prop; 538 + const __be32 *cur; 539 + u32 val; 525 540 int ret, i; 541 + int count = 0; 526 542 527 543 pdata->reset = arizona_of_get_named_gpio(arizona, "wlf,reset", true); 528 544 ··· 550 558 } else { 551 559 dev_err(arizona->dev, "Failed to parse GPIO defaults: %d\n", 552 560 ret); 561 + } 562 + 563 + of_property_for_each_u32(arizona->dev->of_node, "wlf,inmode", prop, 564 + cur, val) { 565 + if (count == ARRAY_SIZE(arizona->pdata.inmode)) 566 + break; 567 + 568 + arizona->pdata.inmode[count] = val; 569 + count++; 553 570 } 554 571 555 572 return 0; ··· 785 784 /* Ensure device startup is complete */ 786 785 switch (arizona->type) { 787 786 case WM5102: 788 - ret = regmap_read(arizona->regmap, 0x19, &val); 787 + ret = regmap_read(arizona->regmap, 788 + ARIZONA_WRITE_SEQUENCER_CTRL_3, &val); 789 789 if (ret != 0) 790 790 dev_err(dev, 791 791 "Failed to check write sequencer state: %d\n", ··· 947 945 regmap_update_bits(arizona->regmap, 948 946 ARIZONA_MIC_BIAS_CTRL_1 + i, 949 947 ARIZONA_MICB1_LVL_MASK | 948 + ARIZONA_MICB1_EXT_CAP | 950 949 ARIZONA_MICB1_DISCH | 951 950 ARIZONA_MICB1_BYPASS | 952 951 ARIZONA_MICB1_RATE, val);
+11 -3
drivers/mfd/arizona-irq.c
··· 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 162 static struct irq_chip arizona_irq_chip = { 156 163 .name = "arizona", 157 164 .irq_disable = arizona_irq_disable, 158 165 .irq_enable = arizona_irq_enable, 166 + .irq_set_wake = arizona_irq_set_wake, 159 167 }; 160 168 161 169 static int arizona_irq_map(struct irq_domain *h, unsigned int virq, ··· 172 164 struct regmap_irq_chip_data *data = h->host_data; 173 165 174 166 irq_set_chip_data(virq, data); 175 - irq_set_chip_and_handler(virq, &arizona_irq_chip, handle_edge_irq); 167 + irq_set_chip_and_handler(virq, &arizona_irq_chip, handle_simple_irq); 176 168 irq_set_nested_thread(virq, 1); 177 169 178 170 /* ARM needs us to explicitly flag the IRQ as valid ··· 290 282 291 283 ret = regmap_add_irq_chip(arizona->regmap, 292 284 irq_create_mapping(arizona->virq, 0), 293 - IRQF_ONESHOT, -1, aod, 285 + IRQF_ONESHOT, 0, aod, 294 286 &arizona->aod_irq_chip); 295 287 if (ret != 0) { 296 288 dev_err(arizona->dev, "Failed to add AOD IRQs: %d\n", ret); ··· 299 291 300 292 ret = regmap_add_irq_chip(arizona->regmap, 301 293 irq_create_mapping(arizona->virq, 1), 302 - IRQF_ONESHOT, -1, irq, 294 + IRQF_ONESHOT, 0, irq, 303 295 &arizona->irq_chip); 304 296 if (ret != 0) { 305 297 dev_err(arizona->dev, "Failed to add main IRQs: %d\n", ret);
-11
drivers/mfd/axp20x.c
··· 140 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 143 static struct mfd_cell axp20x_cells[] = { 153 144 { 154 145 .name = "axp20x-pek", ··· 147 156 .resources = axp20x_pek_resources, 148 157 }, { 149 158 .name = "axp20x-regulator", 150 - .parent_supplies = axp20x_supplies, 151 - .num_parent_supplies = ARRAY_SIZE(axp20x_supplies), 152 159 }, 153 160 }; 154 161
+48
drivers/mfd/cros_ec.c
··· 23 23 #include <linux/mfd/core.h> 24 24 #include <linux/mfd/cros_ec.h> 25 25 #include <linux/mfd/cros_ec_commands.h> 26 + #include <linux/delay.h> 27 + 28 + #define EC_COMMAND_RETRIES 50 26 29 27 30 int cros_ec_prepare_tx(struct cros_ec_device *ec_dev, 28 31 struct cros_ec_command *msg) ··· 65 62 } 66 63 EXPORT_SYMBOL(cros_ec_check_result); 67 64 65 + int cros_ec_cmd_xfer(struct cros_ec_device *ec_dev, 66 + struct cros_ec_command *msg) 67 + { 68 + int ret; 69 + 70 + mutex_lock(&ec_dev->lock); 71 + ret = ec_dev->cmd_xfer(ec_dev, msg); 72 + if (msg->result == EC_RES_IN_PROGRESS) { 73 + int i; 74 + struct cros_ec_command status_msg; 75 + struct ec_response_get_comms_status status; 76 + 77 + status_msg.version = 0; 78 + status_msg.command = EC_CMD_GET_COMMS_STATUS; 79 + status_msg.outdata = NULL; 80 + status_msg.outsize = 0; 81 + status_msg.indata = (uint8_t *)&status; 82 + status_msg.insize = sizeof(status); 83 + 84 + /* 85 + * Query the EC's status until it's no longer busy or 86 + * we encounter an error. 87 + */ 88 + for (i = 0; i < EC_COMMAND_RETRIES; i++) { 89 + usleep_range(10000, 11000); 90 + 91 + ret = ec_dev->cmd_xfer(ec_dev, &status_msg); 92 + if (ret < 0) 93 + break; 94 + 95 + msg->result = status_msg.result; 96 + if (status_msg.result != EC_RES_SUCCESS) 97 + break; 98 + if (!(status.flags & EC_COMMS_STATUS_PROCESSING)) 99 + break; 100 + } 101 + } 102 + mutex_unlock(&ec_dev->lock); 103 + 104 + return ret; 105 + } 106 + EXPORT_SYMBOL(cros_ec_cmd_xfer); 107 + 68 108 static const struct mfd_cell cros_devs[] = { 69 109 { 70 110 .name = "cros-ec-keyb", ··· 136 90 if (!ec_dev->dout) 137 91 return -ENOMEM; 138 92 } 93 + 94 + mutex_init(&ec_dev->lock); 139 95 140 96 err = mfd_add_devices(dev, 0, cros_devs, 141 97 ARRAY_SIZE(cros_devs),
+9 -11
drivers/mfd/cros_ec_spi.c
··· 65 65 */ 66 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 75 * struct cros_ec_spi - information about a SPI-connected EC 70 76 * ··· 79 73 * if no record 80 74 * @end_of_msg_delay: used to set the delay_usecs on the spi_transfer that 81 75 * is sent when we want to turn off CS at the end of a transaction. 82 - * @lock: mutex to ensure only one user of cros_ec_cmd_xfer_spi at a time 83 76 */ 84 77 struct cros_ec_spi { 85 78 struct spi_device *spi; 86 79 s64 last_transfer_ns; 87 80 unsigned int end_of_msg_delay; 88 - struct mutex lock; 89 81 }; 90 82 91 83 static void debug_packet(struct device *dev, const char *name, u8 *ptr, ··· 230 226 int sum; 231 227 int ret = 0, final_ret; 232 228 233 - /* 234 - * We have the shared ec_dev buffer plus we do lots of separate spi_sync 235 - * calls, so we need to make sure only one person is using this at a 236 - * time. 237 - */ 238 - mutex_lock(&ec_spi->lock); 239 - 240 229 len = cros_ec_prepare_tx(ec_dev, ec_msg); 241 230 dev_dbg(ec_dev->dev, "prepared, len=%d\n", len); 242 231 ··· 315 318 316 319 ret = len; 317 320 exit: 318 - mutex_unlock(&ec_spi->lock); 321 + if (ec_msg->command == EC_CMD_REBOOT_EC) 322 + msleep(EC_REBOOT_DELAY_MS); 323 + 319 324 return ret; 320 325 } 321 326 ··· 349 350 if (ec_spi == NULL) 350 351 return -ENOMEM; 351 352 ec_spi->spi = spi; 352 - mutex_init(&ec_spi->lock); 353 353 ec_dev = devm_kzalloc(dev, sizeof(*ec_dev), GFP_KERNEL); 354 354 if (!ec_dev) 355 355 return -ENOMEM;
+1 -1
drivers/mfd/da9052-core.c
··· 522 522 }, 523 523 }; 524 524 525 - struct regmap_config da9052_regmap_config = { 525 + const struct regmap_config da9052_regmap_config = { 526 526 .reg_bits = 8, 527 527 .val_bits = 8, 528 528
-7
drivers/mfd/da9052-i2c.c
··· 140 140 if (!da9052) 141 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 143 da9052->dev = &client->dev; 151 144 da9052->chip_irq = client->irq; 152 145 da9052->fix_io = da9052_i2c_fix;
+4 -3
drivers/mfd/da9052-spi.c
··· 23 23 24 24 static int da9052_spi_probe(struct spi_device *spi) 25 25 { 26 + struct regmap_config config; 26 27 int ret; 27 28 const struct spi_device_id *id = spi_get_device_id(spi); 28 29 struct da9052 *da9052; ··· 41 40 42 41 spi_set_drvdata(spi, da9052); 43 42 44 - da9052_regmap_config.read_flag_mask = 1; 45 - da9052_regmap_config.write_flag_mask = 0; 43 + config = da9052_regmap_config; 44 + config.read_flag_mask = 1; 46 45 47 - da9052->regmap = devm_regmap_init_spi(spi, &da9052_regmap_config); 46 + da9052->regmap = devm_regmap_init_spi(spi, &config); 48 47 if (IS_ERR(da9052->regmap)) { 49 48 ret = PTR_ERR(da9052->regmap); 50 49 dev_err(&spi->dev, "Failed to allocate register map: %d\n",
+113
drivers/mfd/hi6421-pmic-core.c
··· 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");
+13 -29
drivers/mfd/htc-i2cpld.c
··· 227 227 static void htcpld_chip_set(struct gpio_chip *chip, unsigned offset, int val) 228 228 { 229 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 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 234 client = chip_data->client; 238 - if (client == NULL) 235 + if (!client) 239 236 return; 240 237 241 238 spin_lock_irqsave(&chip_data->lock, flags); ··· 258 261 static int htcpld_chip_get(struct gpio_chip *chip, unsigned offset) 259 262 { 260 263 struct htcpld_chip *chip_data; 261 - int val = 0; 262 - int is_input = 0; 264 + u8 cache; 263 265 264 - /* Try out first */ 265 - chip_data = container_of(chip, struct htcpld_chip, chip_out); 266 - if (!chip_data) { 267 - /* Try in */ 268 - is_input = 1; 266 + if (!strncmp(chip->label, "htcpld-out", 10)) { 267 + chip_data = container_of(chip, struct htcpld_chip, chip_out); 268 + cache = chip_data->cache_out; 269 + } else if (!strncmp(chip->label, "htcpld-in", 9)) { 269 270 chip_data = container_of(chip, struct htcpld_chip, chip_in); 270 - if (!chip_data) 271 - return -EINVAL; 272 - } 271 + cache = chip_data->cache_in; 272 + } else 273 + return -EINVAL; 273 274 274 - /* Determine if this is an input or output GPIO */ 275 - if (!is_input) 276 - /* Use the output cache */ 277 - val = (chip_data->cache_out >> offset) & 1; 278 - else 279 - /* Use the input cache */ 280 - val = (chip_data->cache_in >> offset) & 1; 281 - 282 - if (val) 283 - return 1; 284 - else 285 - return 0; 275 + return (cache >> offset) & 1; 286 276 } 287 277 288 278 static int htcpld_direction_output(struct gpio_chip *chip, ··· 360 376 plat_chip_data = &pdata->chip[chip_index]; 361 377 362 378 adapter = i2c_get_adapter(pdata->i2c_adapter_id); 363 - if (adapter == NULL) { 379 + if (!adapter) { 364 380 /* Eek, no such I2C adapter! Bail out. */ 365 381 dev_warn(dev, "Chip at i2c address 0x%x: Invalid i2c adapter %d\n", 366 382 plat_chip_data->addr, pdata->i2c_adapter_id);
+2
drivers/mfd/intel_soc_pmic_core.c
··· 115 115 return; 116 116 } 117 117 118 + #if defined(CONFIG_PM_SLEEP) 118 119 static int intel_soc_pmic_suspend(struct device *dev) 119 120 { 120 121 struct intel_soc_pmic *pmic = dev_get_drvdata(dev); ··· 133 132 134 133 return 0; 135 134 } 135 + #endif 136 136 137 137 static SIMPLE_DEV_PM_OPS(intel_soc_pmic_pm_ops, intel_soc_pmic_suspend, 138 138 intel_soc_pmic_resume);
+17
drivers/mfd/lpc_ich.c
··· 54 54 * document number TBD : Avoton SoC 55 55 * document number TBD : Coleto Creek 56 56 * document number TBD : Wildcat Point-LP 57 + * document number TBD : 9 Series 57 58 */ 58 59 59 60 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt ··· 217 216 LPC_BAYTRAIL, /* Bay Trail SoC */ 218 217 LPC_COLETO, /* Coleto Creek */ 219 218 LPC_WPT_LP, /* Wildcat Point-LP */ 219 + LPC_BRASWELL, /* Braswell SoC */ 220 + LPC_9S, /* 9 Series */ 220 221 }; 221 222 222 223 static struct lpc_ich_info lpc_chipset_info[] = { ··· 522 519 .name = "Wildcat Point_LP", 523 520 .iTCO_version = 2, 524 521 }, 522 + [LPC_BRASWELL] = { 523 + .name = "Braswell SoC", 524 + .iTCO_version = 3, 525 + }, 526 + [LPC_9S] = { 527 + .name = "9 Series", 528 + .iTCO_version = 2, 529 + }, 525 530 }; 526 531 527 532 /* ··· 756 745 { PCI_VDEVICE(INTEL, 0x9cc6), LPC_WPT_LP}, 757 746 { PCI_VDEVICE(INTEL, 0x9cc7), LPC_WPT_LP}, 758 747 { PCI_VDEVICE(INTEL, 0x9cc9), LPC_WPT_LP}, 748 + { PCI_VDEVICE(INTEL, 0x229c), LPC_BRASWELL}, 749 + { PCI_VDEVICE(INTEL, 0x8cc1), LPC_9S}, 750 + { PCI_VDEVICE(INTEL, 0x8cc2), LPC_9S}, 751 + { PCI_VDEVICE(INTEL, 0x8cc3), LPC_9S}, 752 + { PCI_VDEVICE(INTEL, 0x8cc4), LPC_9S}, 753 + { PCI_VDEVICE(INTEL, 0x8cc6), LPC_9S}, 759 754 { 0, }, /* End of list */ 760 755 }; 761 756 MODULE_DEVICE_TABLE(pci, lpc_ich_ids);
+130 -91
drivers/mfd/lpc_sch.c
··· 7 7 * Configuration Registers. 8 8 * 9 9 * Copyright (c) 2010 CompuLab Ltd 10 + * Copyright (c) 2014 Intel Corp. 10 11 * Author: Denis Turischev <denis@compulab.co.il> 11 12 * 12 13 * This program is free software; you can redistribute it and/or modify ··· 18 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 19 * GNU General Public License for more details. 21 - * 22 - * You should have received a copy of the GNU General Public License 23 - * along with this program; see the file COPYING. If not, write to 24 - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 25 20 */ 26 21 27 22 #include <linux/kernel.h> ··· 34 37 #define GPIO_IO_SIZE 64 35 38 #define GPIO_IO_SIZE_CENTERTON 128 36 39 40 + /* Intel Quark X1000 GPIO IRQ Number */ 41 + #define GPIO_IRQ_QUARK_X1000 9 42 + 37 43 #define WDTBASE 0x84 38 44 #define WDT_IO_SIZE 64 39 45 40 - static struct resource smbus_sch_resource = { 41 - .flags = IORESOURCE_IO, 46 + enum sch_chipsets { 47 + LPC_SCH = 0, /* Intel Poulsbo SCH */ 48 + LPC_ITC, /* Intel Tunnel Creek */ 49 + LPC_CENTERTON, /* Intel Centerton */ 50 + LPC_QUARK_X1000, /* Intel Quark X1000 */ 42 51 }; 43 52 44 - static struct resource gpio_sch_resource = { 45 - .flags = IORESOURCE_IO, 53 + struct lpc_sch_info { 54 + unsigned int io_size_smbus; 55 + unsigned int io_size_gpio; 56 + unsigned int io_size_wdt; 57 + int irq_gpio; 46 58 }; 47 59 48 - static struct resource wdt_sch_resource = { 49 - .flags = IORESOURCE_IO, 50 - }; 51 - 52 - static struct mfd_cell lpc_sch_cells[3]; 53 - 54 - static struct mfd_cell isch_smbus_cell = { 55 - .name = "isch_smbus", 56 - .num_resources = 1, 57 - .resources = &smbus_sch_resource, 58 - .ignore_resource_conflicts = true, 59 - }; 60 - 61 - static struct mfd_cell sch_gpio_cell = { 62 - .name = "sch_gpio", 63 - .num_resources = 1, 64 - .resources = &gpio_sch_resource, 65 - .ignore_resource_conflicts = true, 66 - }; 67 - 68 - static struct mfd_cell wdt_sch_cell = { 69 - .name = "ie6xx_wdt", 70 - .num_resources = 1, 71 - .resources = &wdt_sch_resource, 72 - .ignore_resource_conflicts = true, 60 + static struct lpc_sch_info sch_chipset_info[] = { 61 + [LPC_SCH] = { 62 + .io_size_smbus = SMBUS_IO_SIZE, 63 + .io_size_gpio = GPIO_IO_SIZE, 64 + .irq_gpio = -1, 65 + }, 66 + [LPC_ITC] = { 67 + .io_size_smbus = SMBUS_IO_SIZE, 68 + .io_size_gpio = GPIO_IO_SIZE, 69 + .io_size_wdt = WDT_IO_SIZE, 70 + .irq_gpio = -1, 71 + }, 72 + [LPC_CENTERTON] = { 73 + .io_size_smbus = SMBUS_IO_SIZE, 74 + .io_size_gpio = GPIO_IO_SIZE_CENTERTON, 75 + .io_size_wdt = WDT_IO_SIZE, 76 + .irq_gpio = -1, 77 + }, 78 + [LPC_QUARK_X1000] = { 79 + .io_size_gpio = GPIO_IO_SIZE, 80 + .irq_gpio = GPIO_IRQ_QUARK_X1000, 81 + }, 73 82 }; 74 83 75 84 static const struct pci_device_id lpc_sch_ids[] = { 76 - { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SCH_LPC) }, 77 - { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ITC_LPC) }, 78 - { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CENTERTON_ILB) }, 85 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_SCH_LPC), LPC_SCH }, 86 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ITC_LPC), LPC_ITC }, 87 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_CENTERTON_ILB), LPC_CENTERTON }, 88 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_QUARK_X1000_ILB), LPC_QUARK_X1000 }, 79 89 { 0, } 80 90 }; 81 91 MODULE_DEVICE_TABLE(pci, lpc_sch_ids); 82 92 83 - static int lpc_sch_probe(struct pci_dev *dev, 84 - const struct pci_device_id *id) 93 + #define LPC_NO_RESOURCE 1 94 + #define LPC_SKIP_RESOURCE 2 95 + 96 + static int lpc_sch_get_io(struct pci_dev *pdev, int where, const char *name, 97 + struct resource *res, int size) 85 98 { 86 99 unsigned int base_addr_cfg; 87 100 unsigned short base_addr; 88 - int i, cells = 0; 101 + 102 + if (size == 0) 103 + return LPC_NO_RESOURCE; 104 + 105 + pci_read_config_dword(pdev, where, &base_addr_cfg); 106 + base_addr = 0; 107 + if (!(base_addr_cfg & (1 << 31))) 108 + dev_warn(&pdev->dev, "Decode of the %s I/O range disabled\n", 109 + name); 110 + else 111 + base_addr = (unsigned short)base_addr_cfg; 112 + 113 + if (base_addr == 0) { 114 + dev_warn(&pdev->dev, "I/O space for %s uninitialized\n", name); 115 + return LPC_SKIP_RESOURCE; 116 + } 117 + 118 + res->start = base_addr; 119 + res->end = base_addr + size - 1; 120 + res->flags = IORESOURCE_IO; 121 + 122 + return 0; 123 + } 124 + 125 + static int lpc_sch_populate_cell(struct pci_dev *pdev, int where, 126 + const char *name, int size, int irq, 127 + int id, struct mfd_cell *cell) 128 + { 129 + struct resource *res; 89 130 int ret; 90 131 91 - pci_read_config_dword(dev, SMBASE, &base_addr_cfg); 92 - base_addr = 0; 93 - if (!(base_addr_cfg & (1 << 31))) 94 - dev_warn(&dev->dev, "Decode of the SMBus I/O range disabled\n"); 95 - else 96 - base_addr = (unsigned short)base_addr_cfg; 132 + res = devm_kcalloc(&pdev->dev, 2, sizeof(*res), GFP_KERNEL); 133 + if (!res) 134 + return -ENOMEM; 97 135 98 - if (base_addr == 0) { 99 - dev_warn(&dev->dev, "I/O space for SMBus uninitialized\n"); 100 - } else { 101 - lpc_sch_cells[cells++] = isch_smbus_cell; 102 - smbus_sch_resource.start = base_addr; 103 - smbus_sch_resource.end = base_addr + SMBUS_IO_SIZE - 1; 104 - } 136 + ret = lpc_sch_get_io(pdev, where, name, res, size); 137 + if (ret) 138 + return ret; 105 139 106 - pci_read_config_dword(dev, GPIOBASE, &base_addr_cfg); 107 - base_addr = 0; 108 - if (!(base_addr_cfg & (1 << 31))) 109 - dev_warn(&dev->dev, "Decode of the GPIO I/O range disabled\n"); 110 - else 111 - base_addr = (unsigned short)base_addr_cfg; 140 + memset(cell, 0, sizeof(*cell)); 112 141 113 - if (base_addr == 0) { 114 - dev_warn(&dev->dev, "I/O space for GPIO uninitialized\n"); 115 - } else { 116 - lpc_sch_cells[cells++] = sch_gpio_cell; 117 - gpio_sch_resource.start = base_addr; 118 - if (id->device == PCI_DEVICE_ID_INTEL_CENTERTON_ILB) 119 - gpio_sch_resource.end = base_addr + GPIO_IO_SIZE_CENTERTON - 1; 120 - else 121 - gpio_sch_resource.end = base_addr + GPIO_IO_SIZE - 1; 122 - } 142 + cell->name = name; 143 + cell->resources = res; 144 + cell->num_resources = 1; 145 + cell->ignore_resource_conflicts = true; 146 + cell->id = id; 123 147 124 - if (id->device == PCI_DEVICE_ID_INTEL_ITC_LPC 125 - || id->device == PCI_DEVICE_ID_INTEL_CENTERTON_ILB) { 126 - pci_read_config_dword(dev, WDTBASE, &base_addr_cfg); 127 - base_addr = 0; 128 - if (!(base_addr_cfg & (1 << 31))) 129 - dev_warn(&dev->dev, "Decode of the WDT I/O range disabled\n"); 130 - else 131 - base_addr = (unsigned short)base_addr_cfg; 132 - if (base_addr == 0) 133 - dev_warn(&dev->dev, "I/O space for WDT uninitialized\n"); 134 - else { 135 - lpc_sch_cells[cells++] = wdt_sch_cell; 136 - wdt_sch_resource.start = base_addr; 137 - wdt_sch_resource.end = base_addr + WDT_IO_SIZE - 1; 138 - } 139 - } 148 + /* Check if we need to add an IRQ resource */ 149 + if (irq < 0) 150 + return 0; 140 151 141 - if (WARN_ON(cells > ARRAY_SIZE(lpc_sch_cells))) { 142 - dev_err(&dev->dev, "Cell count exceeds array size"); 143 - return -ENODEV; 144 - } 152 + res++; 153 + 154 + res->start = irq; 155 + res->end = irq; 156 + res->flags = IORESOURCE_IRQ; 157 + 158 + cell->num_resources++; 159 + 160 + return 0; 161 + } 162 + 163 + static int lpc_sch_probe(struct pci_dev *dev, const struct pci_device_id *id) 164 + { 165 + struct mfd_cell lpc_sch_cells[3]; 166 + struct lpc_sch_info *info = &sch_chipset_info[id->driver_data]; 167 + unsigned int cells = 0; 168 + int ret; 169 + 170 + ret = lpc_sch_populate_cell(dev, SMBASE, "isch_smbus", 171 + info->io_size_smbus, -1, 172 + id->device, &lpc_sch_cells[cells]); 173 + if (ret < 0) 174 + return ret; 175 + if (ret == 0) 176 + cells++; 177 + 178 + ret = lpc_sch_populate_cell(dev, GPIOBASE, "sch_gpio", 179 + info->io_size_gpio, info->irq_gpio, 180 + id->device, &lpc_sch_cells[cells]); 181 + if (ret < 0) 182 + return ret; 183 + if (ret == 0) 184 + cells++; 185 + 186 + ret = lpc_sch_populate_cell(dev, WDTBASE, "ie6xx_wdt", 187 + info->io_size_wdt, -1, 188 + id->device, &lpc_sch_cells[cells]); 189 + if (ret < 0) 190 + return ret; 191 + if (ret == 0) 192 + cells++; 145 193 146 194 if (cells == 0) { 147 195 dev_err(&dev->dev, "All decode registers disabled.\n"); 148 196 return -ENODEV; 149 197 } 150 - 151 - for (i = 0; i < cells; i++) 152 - lpc_sch_cells[i].id = id->device; 153 198 154 199 ret = mfd_add_devices(&dev->dev, 0, lpc_sch_cells, cells, NULL, 0, NULL); 155 200 if (ret)
+1 -2
drivers/mfd/max14577.c
··· 456 456 } 457 457 458 458 ret = mfd_add_devices(max14577->dev, -1, mfd_devs, 459 - mfd_devs_size, NULL, 0, 460 - regmap_irq_get_domain(max14577->irq_data)); 459 + mfd_devs_size, NULL, 0, NULL); 461 460 if (ret < 0) 462 461 goto err_mfd; 463 462
+1 -1
drivers/mfd/max77686.c
··· 52 52 static bool max77802_pmic_is_accessible_reg(struct device *dev, 53 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 58 static bool max77802_rtc_is_accessible_reg(struct device *dev,
+4 -1
drivers/mfd/max77693.c
··· 44 44 static const struct mfd_cell max77693_devs[] = { 45 45 { .name = "max77693-pmic", }, 46 46 { .name = "max77693-charger", }, 47 - { .name = "max77693-flash", }, 48 47 { .name = "max77693-muic", }, 49 48 { .name = "max77693-haptic", }, 49 + { 50 + .name = "max77693-flash", 51 + .of_compatible = "maxim,max77693-flash", 52 + }, 50 53 }; 51 54 52 55 static const struct regmap_config max77693_regmap_config = {
+1 -1
drivers/mfd/max8925-i2c.c
··· 37 37 static inline int max8925_write_device(struct i2c_client *i2c, 38 38 int reg, int bytes, void *src) 39 39 { 40 - unsigned char buf[bytes + 1]; 40 + unsigned char buf[9]; 41 41 int ret; 42 42 43 43 buf[0] = (unsigned char)reg;
+8
drivers/mfd/mc13xxx-core.c
··· 36 36 #define MC34708_REVISION_FIN (0x07 << 6) 37 37 #define MC34708_REVISION_FAB (0x07 << 9) 38 38 39 + #define MC13XXX_PWRCTRL 15 40 + #define MC13XXX_PWRCTRL_WDIRESET (1 << 12) 41 + 39 42 #define MC13XXX_ADC1 44 40 43 #define MC13XXX_ADC1_ADEN (1 << 0) 41 44 #define MC13XXX_ADC1_RAND (1 << 1) ··· 418 415 return ret; 419 416 420 417 mc13xxx->variant->print_revision(mc13xxx, revision); 418 + 419 + ret = mc13xxx_reg_rmw(mc13xxx, MC13XXX_PWRCTRL, 420 + MC13XXX_PWRCTRL_WDIRESET, MC13XXX_PWRCTRL_WDIRESET); 421 + if (ret) 422 + return ret; 421 423 422 424 for (i = 0; i < ARRAY_SIZE(mc13xxx->irqs); i++) { 423 425 mc13xxx->irqs[i].reg_offset = i / MC13XXX_IRQ_PER_REG;
+4 -7
drivers/mfd/menelaus.c
··· 466 466 struct i2c_client *c = the_menelaus->client; 467 467 468 468 mutex_lock(&the_menelaus->lock); 469 - if (!vtg) 470 - goto set_voltage; 471 469 472 470 ret = menelaus_read_reg(vtg->vtg_reg); 473 471 if (ret < 0) ··· 480 482 ret = menelaus_write_reg(vtg->vtg_reg, val); 481 483 if (ret < 0) 482 484 goto out; 483 - set_voltage: 484 485 ret = menelaus_write_reg(vtg->mode_reg, mode); 485 486 out: 486 487 mutex_unlock(&the_menelaus->lock); ··· 1183 1186 const struct i2c_device_id *id) 1184 1187 { 1185 1188 struct menelaus_chip *menelaus; 1186 - int rev = 0, val; 1189 + int rev = 0; 1187 1190 int err = 0; 1188 1191 struct menelaus_platform_data *menelaus_pdata = 1189 1192 dev_get_platdata(&client->dev); ··· 1236 1239 1237 1240 pr_info("Menelaus rev %d.%d\n", rev >> 4, rev & 0x0f); 1238 1241 1239 - val = menelaus_read_reg(MENELAUS_VCORE_CTRL1); 1240 - if (val < 0) 1242 + err = menelaus_read_reg(MENELAUS_VCORE_CTRL1); 1243 + if (err < 0) 1241 1244 goto fail; 1242 - if (val & (1 << 7)) 1245 + if (err & BIT(7)) 1243 1246 menelaus->vcore_hw_mode = 1; 1244 1247 else 1245 1248 menelaus->vcore_hw_mode = 0;
+41
drivers/mfd/mfd-core.c
··· 78 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 119 static int mfd_add_device(struct device *parent, int id, 82 120 const struct mfd_cell *cell, atomic_t *usage_count, 83 121 struct resource *mem_base, ··· 139 101 pdev->dev.type = &mfd_dev_type; 140 102 pdev->dev.dma_mask = parent->dma_mask; 141 103 pdev->dev.dma_parms = parent->dma_parms; 104 + pdev->dev.coherent_dma_mask = parent->coherent_dma_mask; 142 105 143 106 ret = regulator_bulk_register_supply_alias( 144 107 &pdev->dev, cell->parent_supplies, ··· 156 117 } 157 118 } 158 119 } 120 + 121 + mfd_acpi_add_device(cell, pdev); 159 122 160 123 if (cell->pdata_size) { 161 124 ret = platform_device_add_data(pdev,
+18 -17
drivers/mfd/pcf50633-core.c
··· 106 106 } else 107 107 dump[n1] = pcf50633_reg_read(pcf, n + n1); 108 108 109 - hex_dump_to_buffer(dump, sizeof(dump), 16, 1, buf1, 128, 0); 110 - buf1 += strlen(buf1); 111 - *buf1++ = '\n'; 112 - *buf1 = '\0'; 109 + buf1 += sprintf(buf1, "%*ph\n", (int)sizeof(dump), dump); 113 110 } 114 111 115 112 return buf1 - buf; ··· 192 195 const struct i2c_device_id *ids) 193 196 { 194 197 struct pcf50633 *pcf; 198 + struct platform_device *pdev; 195 199 struct pcf50633_platform_data *pdata = dev_get_platdata(&client->dev); 196 - int i, ret; 200 + int i, j, ret; 197 201 int version, variant; 198 202 199 203 if (!client->irq) { ··· 241 243 242 244 243 245 for (i = 0; i < PCF50633_NUM_REGULATORS; i++) { 244 - struct platform_device *pdev; 245 - int j; 246 - 247 246 pdev = platform_device_alloc("pcf50633-regulator", i); 248 247 if (!pdev) 249 248 return -ENOMEM; ··· 248 253 pdev->dev.parent = pcf->dev; 249 254 ret = platform_device_add_data(pdev, &pdata->reg_init_data[i], 250 255 sizeof(pdata->reg_init_data[i])); 251 - if (ret) { 252 - platform_device_put(pdev); 253 - for (j = 0; j < i; j++) 254 - platform_device_put(pcf->regulator_pdev[j]); 255 - return ret; 256 - } 257 - pcf->regulator_pdev[i] = pdev; 256 + if (ret) 257 + goto err; 258 258 259 - platform_device_add(pdev); 259 + ret = platform_device_add(pdev); 260 + if (ret) 261 + goto err; 262 + 263 + pcf->regulator_pdev[i] = pdev; 260 264 } 261 265 262 266 ret = sysfs_create_group(&client->dev.kobj, &pcf_attr_group); 263 267 if (ret) 264 - dev_err(pcf->dev, "error creating sysfs entries\n"); 268 + dev_warn(pcf->dev, "error creating sysfs entries\n"); 265 269 266 270 if (pdata->probe_done) 267 271 pdata->probe_done(pcf); 268 272 269 273 return 0; 274 + 275 + err: 276 + platform_device_put(pdev); 277 + for (j = 0; j < i; j++) 278 + platform_device_put(pcf->regulator_pdev[j]); 279 + 280 + return ret; 270 281 } 271 282 272 283 static int pcf50633_remove(struct i2c_client *client)
+67
drivers/mfd/qcom-spmi-pmic.c
··· 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>");
+275
drivers/mfd/rk808.c
··· 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");
+134
drivers/mfd/rn5t618.c
··· 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");
+1 -1
drivers/mfd/rtsx_pcr.c
··· 1197 1197 pcr->msi_en = msi_en; 1198 1198 if (pcr->msi_en) { 1199 1199 ret = pci_enable_msi(pcidev); 1200 - if (ret < 0) 1200 + if (ret) 1201 1201 pcr->msi_en = false; 1202 1202 } 1203 1203
+1 -1
drivers/mfd/rtsx_usb.c
··· 684 684 struct rtsx_ucr *ucr = 685 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 688 __func__, message.event); 689 689 690 690 /*
+1 -1
drivers/mfd/sm501.c
··· 514 514 unsigned long mode = smc501_readl(sm->regs + SM501_POWER_MODE_CONTROL); 515 515 unsigned long gate = smc501_readl(sm->regs + SM501_CURRENT_GATE); 516 516 unsigned long clock = smc501_readl(sm->regs + SM501_CURRENT_CLOCK); 517 - unsigned char reg; 518 517 unsigned int pll_reg = 0; 519 518 unsigned long sm501_freq; /* the actual frequency achieved */ 519 + u64 reg; 520 520 521 521 struct sm501_clock to; 522 522
+8 -3
drivers/mfd/stmpe.c
··· 249 249 int af_bits = variant->af_bits; 250 250 int numregs = DIV_ROUND_UP(stmpe->num_gpios * af_bits, 8); 251 251 int mask = (1 << af_bits) - 1; 252 - u8 regs[numregs]; 252 + u8 regs[8]; 253 253 int af, afperreg, ret; 254 254 255 255 if (!variant->get_altfunc) ··· 854 854 struct stmpe_variant_info *variant = stmpe->variant; 855 855 int num = DIV_ROUND_UP(variant->num_irqs, 8); 856 856 u8 israddr; 857 - u8 isr[num]; 857 + u8 isr[3]; 858 858 int ret; 859 859 int i; 860 860 ··· 1122 1122 if (pdata->id < 0) 1123 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 1132 of_property_read_u32(np, "st,autosleep-timeout", 1128 1133 &pdata->autosleep_timeout);
+20 -15
drivers/mfd/ti_am335x_tscadc.c
··· 53 53 unsigned long flags; 54 54 55 55 spin_lock_irqsave(&tsadc->reg_lock, flags); 56 - tsadc->reg_se_cache = val; 56 + tsadc->reg_se_cache |= val; 57 57 if (tsadc->adc_waiting) 58 58 wake_up(&tsadc->reg_se_wait); 59 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 62 spin_unlock_irqrestore(&tsadc->reg_lock, flags); 63 63 } ··· 96 96 void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val) 97 97 { 98 98 spin_lock_irq(&tsadc->reg_lock); 99 + tsadc->reg_se_cache |= val; 99 100 am335x_tscadc_need_adc(tsadc); 100 101 101 102 tscadc_writel(tsadc, REG_SE, val); ··· 242 241 tscadc_writel(tscadc, REG_CLKDIV, tscadc->clk_div); 243 242 244 243 /* Set the control register bits */ 245 - ctrl = CNTRLREG_STEPCONFIGWRT | 246 - CNTRLREG_STEPID; 247 - if (tsc_wires > 0) 248 - ctrl |= CNTRLREG_4WIRE | CNTRLREG_TSCENB; 244 + ctrl = CNTRLREG_STEPCONFIGWRT | CNTRLREG_STEPID; 249 245 tscadc_writel(tscadc, REG_CTRL, ctrl); 250 246 251 247 /* Set register bits for Idle Config Mode */ 252 - if (tsc_wires > 0) 248 + if (tsc_wires > 0) { 249 + tscadc->tsc_wires = tsc_wires; 250 + if (tsc_wires == 5) 251 + ctrl |= CNTRLREG_5WIRE | CNTRLREG_TSCENB; 252 + else 253 + ctrl |= CNTRLREG_4WIRE | CNTRLREG_TSCENB; 253 254 tscadc_idle_config(tscadc); 255 + } 254 256 255 257 /* Enable the TSC module enable bit */ 256 - ctrl = tscadc_readl(tscadc, REG_CTRL); 257 258 ctrl |= CNTRLREG_TSCSSENB; 258 259 tscadc_writel(tscadc, REG_CTRL, ctrl); 259 260 ··· 327 324 static int tscadc_resume(struct device *dev) 328 325 { 329 326 struct ti_tscadc_dev *tscadc_dev = dev_get_drvdata(dev); 330 - unsigned int restore, ctrl; 327 + u32 ctrl; 331 328 332 329 pm_runtime_get_sync(dev); 333 330 334 331 /* context restore */ 335 332 ctrl = CNTRLREG_STEPCONFIGWRT | CNTRLREG_STEPID; 336 - if (tscadc_dev->tsc_cell != -1) 337 - ctrl |= CNTRLREG_TSCENB | CNTRLREG_4WIRE; 338 333 tscadc_writel(tscadc_dev, REG_CTRL, ctrl); 339 334 340 - if (tscadc_dev->tsc_cell != -1) 335 + if (tscadc_dev->tsc_cell != -1) { 336 + if (tscadc_dev->tsc_wires == 5) 337 + ctrl |= CNTRLREG_5WIRE | CNTRLREG_TSCENB; 338 + else 339 + ctrl |= CNTRLREG_4WIRE | CNTRLREG_TSCENB; 341 340 tscadc_idle_config(tscadc_dev); 342 - restore = tscadc_readl(tscadc_dev, REG_CTRL); 343 - tscadc_writel(tscadc_dev, REG_CTRL, 344 - (restore | CNTRLREG_TSCSSENB)); 341 + } 342 + ctrl |= CNTRLREG_TSCSSENB; 343 + tscadc_writel(tscadc_dev, REG_CTRL, ctrl); 345 344 346 345 tscadc_writel(tscadc_dev, REG_CLKDIV, tscadc_dev->clk_div); 347 346
+2
drivers/mfd/tps65217.c
··· 146 146 static struct regmap_config tps65217_regmap_config = { 147 147 .reg_bits = 8, 148 148 .val_bits = 8, 149 + 150 + .max_register = TPS65217_REG_MAX, 149 151 }; 150 152 151 153 static const struct of_device_id tps65217_of_match[] = {
+5
drivers/mfd/tps65910.c
··· 486 486 tps65910->i2c_client = i2c; 487 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 494 tps65910->regmap = devm_regmap_init_i2c(i2c, &tps65910_regmap_config); 490 495 if (IS_ERR(tps65910->regmap)) { 491 496 ret = PTR_ERR(tps65910->regmap);
+6 -2
drivers/mfd/twl4030-irq.c
··· 396 396 status = twl_i2c_read(sih->module, rxbuf, 397 397 sih->mask[line].isr_offset, sih->bytes_ixr); 398 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 400 status, sih->name, "ISR"); 401 401 402 - if (!sih->set_cor) 402 + if (!sih->set_cor) { 403 403 status = twl_i2c_write(sih->module, buf, 404 404 sih->mask[line].isr_offset, 405 405 sih->bytes_ixr); 406 + if (status < 0) 407 + pr_warn("twl4030: write failed: %d\n", 408 + status); 409 + } 406 410 /* 407 411 * else COR=1 means read sufficed. 408 412 * (for most SIH modules...)
+3
drivers/mfd/twl4030-power.c
··· 627 627 if (pdata && pdata->use_poweroff) 628 628 return true; 629 629 630 + if (of_property_read_bool(node, "ti,system-power-controller")) 631 + return true; 632 + 630 633 if (of_property_read_bool(node, "ti,use_poweroff")) 631 634 return true; 632 635
+1
drivers/mfd/twl6040.c
··· 679 679 if (twl6040->rev < 0) { 680 680 dev_err(&client->dev, "Failed to read revision register: %d\n", 681 681 twl6040->rev); 682 + ret = twl6040->rev; 682 683 goto gpio_err; 683 684 } 684 685
+13 -3
drivers/mfd/wm5102-tables.c
··· 87 87 case 0: 88 88 wm5102_patch = wm5102_reva_patch; 89 89 patch_size = ARRAY_SIZE(wm5102_reva_patch); 90 + break; 90 91 default: 91 92 wm5102_patch = wm5102_revb_patch; 92 93 patch_size = ARRAY_SIZE(wm5102_revb_patch); ··· 246 245 static const struct reg_default wm5102_reg_default[] = { 247 246 { 0x00000008, 0x0019 }, /* R8 - Ctrl IF SPI CFG 1 */ 248 247 { 0x00000009, 0x0001 }, /* R9 - Ctrl IF I2C1 CFG 1 */ 249 - { 0x00000016, 0x0000 }, /* R22 - Write Sequencer Ctrl 0 */ 250 - { 0x00000017, 0x0000 }, /* R23 - Write Sequencer Ctrl 1 */ 251 - { 0x00000018, 0x0000 }, /* R24 - Write Sequencer Ctrl 2 */ 252 248 { 0x00000020, 0x0000 }, /* R32 - Tone Generator 1 */ 253 249 { 0x00000021, 0x1000 }, /* R33 - Tone Generator 2 */ 254 250 { 0x00000022, 0x0000 }, /* R34 - Tone Generator 3 */ ··· 1014 1016 case ARIZONA_WRITE_SEQUENCER_CTRL_0: 1015 1017 case ARIZONA_WRITE_SEQUENCER_CTRL_1: 1016 1018 case ARIZONA_WRITE_SEQUENCER_CTRL_2: 1019 + case ARIZONA_WRITE_SEQUENCER_CTRL_3: 1017 1020 case ARIZONA_WRITE_SEQUENCER_PROM: 1018 1021 case ARIZONA_TONE_GENERATOR_1: 1019 1022 case ARIZONA_TONE_GENERATOR_2: ··· 1059 1060 case ARIZONA_ASYNC_CLOCK_1: 1060 1061 case ARIZONA_ASYNC_SAMPLE_RATE_1: 1061 1062 case ARIZONA_ASYNC_SAMPLE_RATE_1_STATUS: 1063 + case ARIZONA_ASYNC_SAMPLE_RATE_2: 1064 + case ARIZONA_ASYNC_SAMPLE_RATE_2_STATUS: 1062 1065 case ARIZONA_OUTPUT_SYSTEM_CLOCK: 1063 1066 case ARIZONA_OUTPUT_ASYNC_CLOCK: 1064 1067 case ARIZONA_RATE_ESTIMATOR_1: ··· 1881 1880 switch (reg) { 1882 1881 case ARIZONA_SOFTWARE_RESET: 1883 1882 case ARIZONA_DEVICE_REVISION: 1883 + case ARIZONA_WRITE_SEQUENCER_CTRL_0: 1884 + case ARIZONA_WRITE_SEQUENCER_CTRL_1: 1885 + case ARIZONA_WRITE_SEQUENCER_CTRL_2: 1886 + case ARIZONA_WRITE_SEQUENCER_CTRL_3: 1884 1887 case ARIZONA_OUTPUT_STATUS_1: 1885 1888 case ARIZONA_RAW_OUTPUT_STATUS_1: 1886 1889 case ARIZONA_SLIMBUS_RX_PORT_STATUS: ··· 1894 1889 case ARIZONA_SAMPLE_RATE_3_STATUS: 1895 1890 case ARIZONA_HAPTICS_STATUS: 1896 1891 case ARIZONA_ASYNC_SAMPLE_RATE_1_STATUS: 1892 + case ARIZONA_ASYNC_SAMPLE_RATE_2_STATUS: 1897 1893 case ARIZONA_FLL1_NCO_TEST_0: 1898 1894 case ARIZONA_FLL2_NCO_TEST_0: 1895 + case ARIZONA_DAC_COMP_1: 1896 + case ARIZONA_DAC_COMP_2: 1897 + case ARIZONA_DAC_COMP_3: 1898 + case ARIZONA_DAC_COMP_4: 1899 1899 case ARIZONA_FX_CTRL2: 1900 1900 case ARIZONA_INTERRUPT_STATUS_1: 1901 1901 case ARIZONA_INTERRUPT_STATUS_2:
+7 -3
drivers/mfd/wm5110-tables.c
··· 666 666 { 0x0000000A, 0x0001 }, /* R10 - Ctrl IF I2C2 CFG 1 */ 667 667 { 0x0000000B, 0x0036 }, /* R11 - Ctrl IF I2C1 CFG 2 */ 668 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 669 { 0x00000020, 0x0000 }, /* R32 - Tone Generator 1 */ 673 670 { 0x00000021, 0x1000 }, /* R33 - Tone Generator 2 */ 674 671 { 0x00000022, 0x0000 }, /* R34 - Tone Generator 3 */ ··· 702 705 { 0x00000104, 0x0011 }, /* R260 - Sample rate 3 */ 703 706 { 0x00000112, 0x0305 }, /* R274 - Async clock 1 */ 704 707 { 0x00000113, 0x0011 }, /* R275 - Async sample rate 1 */ 708 + { 0x00000114, 0x0011 }, /* R276 - Async sample rate 2 */ 705 709 { 0x00000149, 0x0000 }, /* R329 - Output system clock */ 706 710 { 0x0000014A, 0x0000 }, /* R330 - Output async clock */ 707 711 { 0x00000152, 0x0000 }, /* R338 - Rate Estimator 1 */ ··· 1739 1741 case ARIZONA_ASYNC_CLOCK_1: 1740 1742 case ARIZONA_ASYNC_SAMPLE_RATE_1: 1741 1743 case ARIZONA_ASYNC_SAMPLE_RATE_1_STATUS: 1744 + case ARIZONA_ASYNC_SAMPLE_RATE_2: 1745 + case ARIZONA_ASYNC_SAMPLE_RATE_2_STATUS: 1742 1746 case ARIZONA_OUTPUT_SYSTEM_CLOCK: 1743 1747 case ARIZONA_OUTPUT_ASYNC_CLOCK: 1744 1748 case ARIZONA_RATE_ESTIMATOR_1: ··· 2815 2815 switch (reg) { 2816 2816 case ARIZONA_SOFTWARE_RESET: 2817 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 2821 case ARIZONA_HAPTICS_STATUS: 2819 2822 case ARIZONA_SAMPLE_RATE_1_STATUS: 2820 2823 case ARIZONA_SAMPLE_RATE_2_STATUS: 2821 2824 case ARIZONA_SAMPLE_RATE_3_STATUS: 2822 2825 case ARIZONA_ASYNC_SAMPLE_RATE_1_STATUS: 2826 + case ARIZONA_ASYNC_SAMPLE_RATE_2_STATUS: 2823 2827 case ARIZONA_MIC_DETECT_3: 2824 2828 case ARIZONA_HEADPHONE_DETECT_2: 2825 2829 case ARIZONA_INPUT_ENABLES_STATUS:
+2
drivers/mfd/wm8994-irq.c
··· 262 262 263 263 return 0; 264 264 } 265 + EXPORT_SYMBOL(wm8994_irq_init); 265 266 266 267 void wm8994_irq_exit(struct wm8994 *wm8994) 267 268 { 268 269 regmap_del_irq_chip(wm8994->irq, wm8994->irq_data); 269 270 } 271 + EXPORT_SYMBOL(wm8994_irq_exit);
+4
drivers/mfd/wm8994-regmap.c
··· 1252 1252 .volatile_reg = wm1811_volatile_register, 1253 1253 .readable_reg = wm1811_readable_register, 1254 1254 }; 1255 + EXPORT_SYMBOL(wm1811_regmap_config); 1255 1256 1256 1257 struct regmap_config wm8994_regmap_config = { 1257 1258 .reg_bits = 16, ··· 1267 1266 .volatile_reg = wm8994_volatile_register, 1268 1267 .readable_reg = wm8994_readable_register, 1269 1268 }; 1269 + EXPORT_SYMBOL(wm8994_regmap_config); 1270 1270 1271 1271 struct regmap_config wm8958_regmap_config = { 1272 1272 .reg_bits = 16, ··· 1282 1280 .volatile_reg = wm8958_volatile_register, 1283 1281 .readable_reg = wm8958_readable_register, 1284 1282 }; 1283 + EXPORT_SYMBOL(wm8958_regmap_config); 1285 1284 1286 1285 struct regmap_config wm8994_base_regmap_config = { 1287 1286 .reg_bits = 16, 1288 1287 .val_bits = 16, 1289 1288 }; 1289 + EXPORT_SYMBOL(wm8994_base_regmap_config);
+11
include/dt-bindings/clock/rockchip,rk808.h
··· 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
+23 -6
include/linux/mfd/arizona/registers.h
··· 27 27 #define ARIZONA_WRITE_SEQUENCER_CTRL_0 0x16 28 28 #define ARIZONA_WRITE_SEQUENCER_CTRL_1 0x17 29 29 #define ARIZONA_WRITE_SEQUENCER_CTRL_2 0x18 30 + #define ARIZONA_WRITE_SEQUENCER_CTRL_3 0x19 30 31 #define ARIZONA_WRITE_SEQUENCER_PROM 0x1A 31 32 #define ARIZONA_TONE_GENERATOR_1 0x20 32 33 #define ARIZONA_TONE_GENERATOR_2 0x21 ··· 71 70 #define ARIZONA_SAMPLE_RATE_3_STATUS 0x10C 72 71 #define ARIZONA_ASYNC_CLOCK_1 0x112 73 72 #define ARIZONA_ASYNC_SAMPLE_RATE_1 0x113 73 + #define ARIZONA_ASYNC_SAMPLE_RATE_2 0x114 74 74 #define ARIZONA_ASYNC_SAMPLE_RATE_1_STATUS 0x11B 75 + #define ARIZONA_ASYNC_SAMPLE_RATE_2_STATUS 0x11C 75 76 #define ARIZONA_OUTPUT_SYSTEM_CLOCK 0x149 76 77 #define ARIZONA_OUTPUT_ASYNC_CLOCK 0x14A 77 78 #define ARIZONA_RATE_ESTIMATOR_1 0x152 ··· 1667 1664 /* 1668 1665 * R275 (0x113) - Async sample rate 1 1669 1666 */ 1670 - #define ARIZONA_ASYNC_SAMPLE_RATE_MASK 0x001F /* ASYNC_SAMPLE_RATE - [4:0] */ 1671 - #define ARIZONA_ASYNC_SAMPLE_RATE_SHIFT 0 /* ASYNC_SAMPLE_RATE - [4:0] */ 1672 - #define ARIZONA_ASYNC_SAMPLE_RATE_WIDTH 5 /* ASYNC_SAMPLE_RATE - [4:0] */ 1667 + #define ARIZONA_ASYNC_SAMPLE_RATE_1_MASK 0x001F /* ASYNC_SAMPLE_RATE_1 - [4:0] */ 1668 + #define ARIZONA_ASYNC_SAMPLE_RATE_1_SHIFT 0 /* ASYNC_SAMPLE_RATE_1 - [4:0] */ 1669 + #define ARIZONA_ASYNC_SAMPLE_RATE_1_WIDTH 5 /* ASYNC_SAMPLE_RATE_1 - [4:0] */ 1670 + 1671 + /* 1672 + * R276 (0x114) - Async sample rate 2 1673 + */ 1674 + #define ARIZONA_ASYNC_SAMPLE_RATE_2_MASK 0x001F /* ASYNC_SAMPLE_RATE_2 - [4:0] */ 1675 + #define ARIZONA_ASYNC_SAMPLE_RATE_2_SHIFT 0 /* ASYNC_SAMPLE_RATE_2 - [4:0] */ 1676 + #define ARIZONA_ASYNC_SAMPLE_RATE_2_WIDTH 5 /* ASYNC_SAMPLE_RATE_2 - [4:0] */ 1673 1677 1674 1678 /* 1675 1679 * R283 (0x11B) - Async sample rate 1 status 1676 1680 */ 1677 - #define ARIZONA_ASYNC_SAMPLE_RATE_STS_MASK 0x001F /* ASYNC_SAMPLE_RATE_STS - [4:0] */ 1678 - #define ARIZONA_ASYNC_SAMPLE_RATE_STS_SHIFT 0 /* ASYNC_SAMPLE_RATE_STS - [4:0] */ 1679 - #define ARIZONA_ASYNC_SAMPLE_RATE_STS_WIDTH 5 /* ASYNC_SAMPLE_RATE_STS - [4:0] */ 1681 + #define ARIZONA_ASYNC_SAMPLE_RATE_1_STS_MASK 0x001F /* ASYNC_SAMPLE_RATE_1_STS - [4:0] */ 1682 + #define ARIZONA_ASYNC_SAMPLE_RATE_1_STS_SHIFT 0 /* ASYNC_SAMPLE_RATE_1_STS - [4:0] */ 1683 + #define ARIZONA_ASYNC_SAMPLE_RATE_1_STS_WIDTH 5 /* ASYNC_SAMPLE_RATE_1_STS - [4:0] */ 1684 + 1685 + /* 1686 + * R284 (0x11C) - Async sample rate 2 status 1687 + */ 1688 + #define ARIZONA_ASYNC_SAMPLE_RATE_2_STS_MASK 0x001F /* ASYNC_SAMPLE_RATE_2_STS - [4:0] */ 1689 + #define ARIZONA_ASYNC_SAMPLE_RATE_2_STS_SHIFT 0 /* ASYNC_SAMPLE_RATE_2_STS - [4:0] */ 1690 + #define ARIZONA_ASYNC_SAMPLE_RATE_2_STS_WIDTH 5 /* ASYNC_SAMPLE_RATE_2_STS - [4:0] */ 1680 1691 1681 1692 /* 1682 1693 * R329 (0x149) - Output system clock
+3
include/linux/mfd/core.h
··· 44 44 */ 45 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 51 * These resources can be specified relative to the parent device. 49 52 * For accessing hardware you should use resources from the platform dev
+18 -6
include/linux/mfd/cros_ec.h
··· 62 62 * @dev: Device pointer 63 63 * @was_wake_device: true if this device was set to wake the system from 64 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 66 * @priv: Private data 71 67 * @irq: Interrupt to use ··· 78 82 * @dout_size: size of dout buffer to allocate (zero to use static dout) 79 83 * @parent: pointer to parent device (e.g. i2c or spi device) 80 84 * @wake_enabled: true if this device can wake the system from sleep 85 + * @cmd_xfer: send command to EC and get response 86 + * Returns the number of bytes received if the communication succeeded, but 87 + * that doesn't mean the EC was happy with the command. The caller 88 + * should check msg.result for the EC's result code. 81 89 * @lock: one transaction at a time 82 90 */ 83 91 struct cros_ec_device { ··· 92 92 struct device *dev; 93 93 bool was_wake_device; 94 94 struct class *cros_class; 95 - int (*cmd_xfer)(struct cros_ec_device *ec, 96 - struct cros_ec_command *msg); 97 95 98 96 /* These are used to implement the platform-specific interface */ 99 97 void *priv; ··· 102 104 int dout_size; 103 105 struct device *parent; 104 106 bool wake_enabled; 107 + int (*cmd_xfer)(struct cros_ec_device *ec, 108 + struct cros_ec_command *msg); 105 109 struct mutex lock; 106 110 }; 107 111 ··· 151 151 */ 152 152 int cros_ec_check_result(struct cros_ec_device *ec_dev, 153 153 struct cros_ec_command *msg); 154 + 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); 154 166 155 167 /** 156 168 * cros_ec_remove - Remove a ChromeOS EC
+1 -1
include/linux/mfd/da9052/da9052.h
··· 211 211 int da9052_device_init(struct da9052 *da9052, u8 chip_id); 212 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 216 int da9052_irq_init(struct da9052 *da9052); 217 217 int da9052_irq_exit(struct da9052 *da9052);
+1 -1
include/linux/mfd/davinci_voicecodec.h
··· 21 21 */ 22 22 23 23 #ifndef __LINUX_MFD_DAVINCI_VOICECODEC_H_ 24 - #define __LINUX_MFD_DAVINIC_VOICECODEC_H_ 24 + #define __LINUX_MFD_DAVINCI_VOICECODEC_H_ 25 25 26 26 #include <linux/kernel.h> 27 27 #include <linux/platform_device.h>
+41
include/linux/mfd/hi6421-pmic.h
··· 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 */
+60 -1
include/linux/mfd/max77693-private.h
··· 46 46 MAX77693_LED_REG_VOUT_FLASH2 = 0x0C, 47 47 MAX77693_LED_REG_FLASH_INT = 0x0E, 48 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 51 MAX77693_PMIC_REG_PMIC_ID1 = 0x20, 52 52 MAX77693_PMIC_REG_PMIC_ID2 = 0x21, ··· 84 84 85 85 MAX77693_PMIC_REG_END, 86 86 }; 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) 87 146 88 147 /* MAX77693 CHG_CNFG_00 register */ 89 148 #define CHG_CNFG_00_CHG_MASK 0x1
+40
include/linux/mfd/max77693.h
··· 63 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 105 struct max77693_platform_data { 67 106 /* regulator data */ 68 107 struct max77693_regulator_data *regulators; ··· 109 70 110 71 /* muic data */ 111 72 struct max77693_muic_platform_data *muic_data; 73 + struct max77693_led_platform_data *led_data; 112 74 }; 113 75 #endif /* __LINUX_MFD_MAX77693_H */
+196
include/linux/mfd/rk808.h
··· 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 */
+228
include/linux/mfd/rn5t618.h
··· 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 */
+1
include/linux/mfd/ti_am335x_tscadc.h
··· 155 155 void __iomem *tscadc_base; 156 156 int irq; 157 157 int used_cells; /* 1-2 */ 158 + int tsc_wires; 158 159 int tsc_cell; /* -1 if not used */ 159 160 int adc_cell; /* -1 if not used */ 160 161 struct mfd_cell cells[TSCADC_CELLS];
-93
include/linux/mfd/ti_ssp.h
··· 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__ */
+2
include/linux/mfd/tps65217.h
··· 60 60 #define TPS65217_REG_SEQ5 0X1D 61 61 #define TPS65217_REG_SEQ6 0X1E 62 62 63 + #define TPS65217_REG_MAX TPS65217_REG_SEQ6 64 + 63 65 /* Register field definitions */ 64 66 #define TPS65217_CHIPID_CHIP_MASK 0xF0 65 67 #define TPS65217_CHIPID_REV_MASK 0x0F
+1
include/linux/pci_ids.h
··· 2560 2560 #define PCI_DEVICE_ID_INTEL_MFD_EMMC0 0x0823 2561 2561 #define PCI_DEVICE_ID_INTEL_MFD_EMMC1 0x0824 2562 2562 #define PCI_DEVICE_ID_INTEL_MRST_SD2 0x084F 2563 + #define PCI_DEVICE_ID_INTEL_QUARK_X1000_ILB 0x095E 2563 2564 #define PCI_DEVICE_ID_INTEL_I960 0x0960 2564 2565 #define PCI_DEVICE_ID_INTEL_I960RM 0x0962 2565 2566 #define PCI_DEVICE_ID_INTEL_CENTERTON_ILB 0x0c60
+1 -1
sound/soc/codecs/arizona.c
··· 1220 1220 break; 1221 1221 case ARIZONA_CLK_ASYNCCLK: 1222 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 1224 if (base) 1225 1225 snd_soc_update_bits(codec, base + ARIZONA_AIF_RATE_CTRL, 1226 1226 ARIZONA_AIF1_RATE_MASK,