Merge tag 'mfd-next-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD updates from Lee Jones:
"New Device Support:
- Add support for X-Powers AXP717 PMIC to AXP22X
- Add support for Rockchip RK816 PMIC to RK8XX
- Add support for TI TPS65224 PMIC to TPS6594

New Functionality:
- Add Power Off functionality to Rohm BD71828
- Allow I2C SMBus access in Renesas RSMU

Fix-ups:
- Device Tree binding adaptions/conversions/creation
- Shift Intel support over to MSI interrupts
- Generify adding platform data away from being ACPI specific
- Use device core supplied attribute to register sysfs entries
- Replace hand-rolled functionality with generic APIs
- Utilise centrally provided helpers and macros
- Clean-up error handling
- Remove superfluous/duplicated/unused sections
- Trivial; spelling, whitespace, coding-style adaptions
- More Maple Tree conversions"

* tag 'mfd-next-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (44 commits)
dt-bindings: mfd: Use full path to other schemas
mfd: rsmu: support I2C SMBus access
dt-bindings: mfd: Convert lp873x.txt to json-schema
dt-bindings: mfd: aspeed: Drop 'oneOf' for pinctrl node
dt-bindings: mfd: allwinner,sun6i-a31-prcm: Use hyphens in node names
mfd: ssbi: Remove unused field 'slave' from 'struct ssbi'
mfd: kempld: Remove custom DMI matching code
mfd: cs42l43: Update patching revision check
dt-bindings: mfd: qcom: pm8xxx: Add pm8901 compatible
mfd: timberdale: Remove redundant assignment to variable err
dt-bindings: mfd: qcom,spmi-pmic: Add pbs to SPMI device types
dt-bindings: mfd: syscon: Add ti,am62p-cpsw-mac-efuse compatible
dt-bindings: mfd: qcom,tcsr: Add compatible for SDX75
mfd: axp20x: Convert to use Maple Tree register cache
mfd: bd71828: Remove commented code lines
mfd: intel-m10-bmc: Change staging size to a variable
dt-bindings: mfd: Add ROHM BD71879
mfd: Tidy Kconfig dependency's parentheses
mfd: ocelot-spi: Use spi_sync_transfer()
dt-bindings: mfd: syscon: Add missing simple syscon compatibles
...

+2530 -733
-12
Documentation/devicetree/bindings/arm/altera/socfpga-sdram-controller.txt
··· 1 - Altera SOCFPGA SDRAM Controller 2 - 3 - Required properties: 4 - - compatible : Should contain "altr,sdr-ctl" and "syscon". 5 - syscon is required by the Altera SOCFPGA SDRAM EDAC. 6 - - reg : Should contain 1 register range (address and length) 7 - 8 - Example: 9 - sdr: sdr@ffc25000 { 10 - compatible = "altr,sdr-ctl", "syscon"; 11 - reg = <0xffc25000 0x1000>; 12 - };
-17
Documentation/devicetree/bindings/arm/apm/scu.txt
··· 1 - APM X-GENE SoC series SCU Registers 2 - 3 - This system clock unit contain various register that control block resets, 4 - clock enable/disables, clock divisors and other deepsleep registers. 5 - 6 - Properties: 7 - - compatible : should contain two values. First value must be: 8 - - "apm,xgene-scu" 9 - second value must be always "syscon". 10 - 11 - - reg : offset and length of the register set. 12 - 13 - Example : 14 - scu: system-clk-controller@17000000 { 15 - compatible = "apm,xgene-scu","syscon"; 16 - reg = <0x0 0x17000000 0x0 0x400>; 17 - };
-32
Documentation/devicetree/bindings/arm/marvell/armada-37xx.txt
··· 1 - Power management 2 - ---------------- 3 - 4 - For power management (particularly DVFS and AVS), the North Bridge 5 - Power Management component is needed: 6 - 7 - Required properties: 8 - - compatible : should contain "marvell,armada-3700-nb-pm", "syscon"; 9 - - reg : the register start and length for the North Bridge 10 - Power Management 11 - 12 - Example: 13 - 14 - nb_pm: syscon@14000 { 15 - compatible = "marvell,armada-3700-nb-pm", "syscon"; 16 - reg = <0x14000 0x60>; 17 - } 18 - 19 - AVS 20 - --- 21 - 22 - For AVS an other component is needed: 23 - 24 - Required properties: 25 - - compatible : should contain "marvell,armada-3700-avs", "syscon"; 26 - - reg : the register start and length for the AVS 27 - 28 - Example: 29 - avs: avs@11500 { 30 - compatible = "marvell,armada-3700-avs", "syscon"; 31 - reg = <0x11500 0x40>; 32 - }
-21
Documentation/devicetree/bindings/input/twl4030-pwrbutton.txt
··· 1 - Texas Instruments TWL family (twl4030) pwrbutton module 2 - 3 - This module is part of the TWL4030. For more details about the whole 4 - chip see Documentation/devicetree/bindings/mfd/ti,twl.yaml. 5 - 6 - This module provides a simple power button event via an Interrupt. 7 - 8 - Required properties: 9 - - compatible: should be one of the following 10 - - "ti,twl4030-pwrbutton": For controllers compatible with twl4030 11 - - interrupts: should be one of the following 12 - - <8>: For controllers compatible with twl4030 13 - 14 - Example: 15 - 16 - &twl { 17 - twl_pwrbutton: pwrbutton { 18 - compatible = "ti,twl4030-pwrbutton"; 19 - interrupts = <8>; 20 - }; 21 - };
+3 -3
Documentation/devicetree/bindings/mfd/actions,atc260x.yaml
··· 21 21 regulators. 22 22 23 23 allOf: 24 - - $ref: ../input/input.yaml 24 + - $ref: /schemas/input/input.yaml 25 25 26 26 properties: 27 27 compatible: ··· 57 57 58 58 switchldo1: 59 59 type: object 60 - $ref: ../regulator/regulator.yaml 60 + $ref: /schemas/regulator/regulator.yaml 61 61 62 62 properties: 63 63 regulator-name: true ··· 76 76 77 77 "^(dcdc[0-4]|ldo[0-9]|ldo1[1-2])$": 78 78 type: object 79 - $ref: ../regulator/regulator.yaml 79 + $ref: /schemas/regulator/regulator.yaml 80 80 81 81 properties: 82 82 regulator-name: true
+7 -7
Documentation/devicetree/bindings/mfd/allwinner,sun6i-a31-prcm.yaml
··· 20 20 maxItems: 1 21 21 22 22 patternProperties: 23 - "^.*_(clk|rst)$": 23 + "^.*-(clk|rst)$": 24 24 type: object 25 25 unevaluatedProperties: false 26 26 ··· 171 171 compatible = "allwinner,sun6i-a31-prcm"; 172 172 reg = <0x01f01400 0x200>; 173 173 174 - ar100: ar100_clk { 174 + ar100: ar100-clk { 175 175 compatible = "allwinner,sun6i-a31-ar100-clk"; 176 176 #clock-cells = <0>; 177 177 clocks = <&rtc 0>, <&osc24M>, ··· 180 180 clock-output-names = "ar100"; 181 181 }; 182 182 183 - ahb0: ahb0_clk { 183 + ahb0: ahb0-clk { 184 184 compatible = "fixed-factor-clock"; 185 185 #clock-cells = <0>; 186 186 clock-div = <1>; ··· 189 189 clock-output-names = "ahb0"; 190 190 }; 191 191 192 - apb0: apb0_clk { 192 + apb0: apb0-clk { 193 193 compatible = "allwinner,sun6i-a31-apb0-clk"; 194 194 #clock-cells = <0>; 195 195 clocks = <&ahb0>; 196 196 clock-output-names = "apb0"; 197 197 }; 198 198 199 - apb0_gates: apb0_gates_clk { 199 + apb0_gates: apb0-gates-clk { 200 200 compatible = "allwinner,sun6i-a31-apb0-gates-clk"; 201 201 #clock-cells = <1>; 202 202 clocks = <&apb0>; ··· 206 206 "apb0_i2c"; 207 207 }; 208 208 209 - ir_clk: ir_clk { 209 + ir_clk: ir-clk { 210 210 #clock-cells = <0>; 211 211 compatible = "allwinner,sun4i-a10-mod0-clk"; 212 212 clocks = <&rtc 0>, <&osc24M>; 213 213 clock-output-names = "ir"; 214 214 }; 215 215 216 - apb0_rst: apb0_rst { 216 + apb0_rst: apb0-rst { 217 217 compatible = "allwinner,sun6i-a31-clock-reset"; 218 218 #reset-cells = <1>; 219 219 };
+12 -4
Documentation/devicetree/bindings/mfd/aspeed,ast2x00-scu.yaml
··· 47 47 type: object 48 48 49 49 '^pinctrl(@[0-9a-f]+)?$': 50 - oneOf: 51 - - $ref: /schemas/pinctrl/aspeed,ast2400-pinctrl.yaml 52 - - $ref: /schemas/pinctrl/aspeed,ast2500-pinctrl.yaml 53 - - $ref: /schemas/pinctrl/aspeed,ast2600-pinctrl.yaml 50 + type: object 51 + additionalProperties: true 52 + properties: 53 + compatible: 54 + contains: 55 + enum: 56 + - aspeed,ast2400-pinctrl 57 + - aspeed,ast2500-pinctrl 58 + - aspeed,ast2600-pinctrl 59 + 60 + required: 61 + - compatible 54 62 55 63 '^interrupt-controller@[0-9a-f]+$': 56 64 description: See Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2xxx-scu-ic.txt
+4 -4
Documentation/devicetree/bindings/mfd/brcm,cru.yaml
··· 34 34 35 35 patternProperties: 36 36 '^clock-controller@[a-f0-9]+$': 37 - $ref: ../clock/brcm,iproc-clocks.yaml 37 + $ref: /schemas/clock/brcm,iproc-clocks.yaml 38 38 39 39 '^phy@[a-f0-9]+$': 40 - $ref: ../phy/bcm-ns-usb2-phy.yaml 40 + $ref: /schemas/phy/bcm-ns-usb2-phy.yaml 41 41 42 42 '^pinctrl@[a-f0-9]+$': 43 - $ref: ../pinctrl/brcm,ns-pinmux.yaml 43 + $ref: /schemas/pinctrl/brcm,ns-pinmux.yaml 44 44 45 45 '^syscon@[a-f0-9]+$': 46 46 $ref: syscon.yaml 47 47 48 48 '^thermal@[a-f0-9]+$': 49 - $ref: ../thermal/brcm,ns-thermal.yaml 49 + $ref: /schemas/thermal/brcm,ns-thermal.yaml 50 50 51 51 additionalProperties: false 52 52
-16
Documentation/devicetree/bindings/mfd/brcm,iproc-cdru.txt
··· 1 - Broadcom iProc Chip Device Resource Unit (CDRU) 2 - 3 - Various Broadcom iProc SoCs have a set of registers that provide various 4 - chip specific device and resource configurations. This node allows access to 5 - these CDRU registers via syscon. 6 - 7 - Required properties: 8 - - compatible: should contain: 9 - "brcm,sr-cdru", "syscon" for Stingray 10 - - reg: base address and range of the CDRU registers 11 - 12 - Example: 13 - cdru: syscon@6641d000 { 14 - compatible = "brcm,sr-cdru", "syscon"; 15 - reg = <0 0x6641d000 0 0x400>; 16 - };
-18
Documentation/devicetree/bindings/mfd/brcm,iproc-mhb.txt
··· 1 - Broadcom iProc Multi Host Bridge (MHB) 2 - 3 - Certain Broadcom iProc SoCs have a multi host bridge (MHB) block that controls 4 - the connection and configuration of 1) internal PCIe serdes; 2) PCIe endpoint 5 - interface; 3) access to the Nitro (network processing) engine 6 - 7 - This node allows access to these MHB registers via syscon. 8 - 9 - Required properties: 10 - - compatible: should contain: 11 - "brcm,sr-mhb", "syscon" for Stingray 12 - - reg: base address and range of the MHB registers 13 - 14 - Example: 15 - mhb: syscon@60401000 { 16 - compatible = "brcm,sr-mhb", "syscon"; 17 - reg = <0 0x60401000 0 0x38c>; 18 - };
+1 -1
Documentation/devicetree/bindings/mfd/brcm,misc.yaml
··· 33 33 34 34 patternProperties: 35 35 '^reset-controller@[a-f0-9]+$': 36 - $ref: ../reset/brcm,bcm4908-misc-pcie-reset.yaml 36 + $ref: /schemas/reset/brcm,bcm4908-misc-pcie-reset.yaml 37 37 38 38 additionalProperties: false 39 39
+3 -3
Documentation/devicetree/bindings/mfd/canaan,k210-sysctl.yaml
··· 36 36 clock-controller: 37 37 # Child node 38 38 type: object 39 - $ref: ../clock/canaan,k210-clk.yaml 39 + $ref: /schemas/clock/canaan,k210-clk.yaml 40 40 description: 41 41 Clock controller for the SoC clocks. This child node definition 42 42 should follow the bindings specified in ··· 45 45 reset-controller: 46 46 # Child node 47 47 type: object 48 - $ref: ../reset/canaan,k210-rst.yaml 48 + $ref: /schemas/reset/canaan,k210-rst.yaml 49 49 description: 50 50 Reset controller for the SoC. This child node definition 51 51 should follow the bindings specified in ··· 54 54 syscon-reboot: 55 55 # Child node 56 56 type: object 57 - $ref: ../power/reset/syscon-reboot.yaml 57 + $ref: /schemas/power/reset/syscon-reboot.yaml 58 58 description: 59 59 Reboot method for the SoC. This child node definition 60 60 should follow the bindings specified in
+2 -2
Documentation/devicetree/bindings/mfd/delta,tn48m-cpld.yaml
··· 42 42 43 43 patternProperties: 44 44 "^gpio(@[0-9a-f]+)?$": 45 - $ref: ../gpio/delta,tn48m-gpio.yaml 45 + $ref: /schemas/gpio/delta,tn48m-gpio.yaml 46 46 47 47 "^reset-controller?$": 48 - $ref: ../reset/delta,tn48m-reset.yaml 48 + $ref: /schemas/reset/delta,tn48m-reset.yaml 49 49 50 50 additionalProperties: false 51 51
+2 -2
Documentation/devicetree/bindings/mfd/iqs62x.yaml
··· 38 38 device name with ".bin" as the extension (e.g. iqs620a.bin for IQS620A). 39 39 40 40 keys: 41 - $ref: ../input/iqs62x-keys.yaml 41 + $ref: /schemas/input/iqs62x-keys.yaml 42 42 43 43 pwm: 44 - $ref: ../pwm/iqs620a-pwm.yaml 44 + $ref: /schemas/pwm/iqs620a-pwm.yaml 45 45 46 46 required: 47 47 - compatible
+5 -5
Documentation/devicetree/bindings/mfd/kontron,sl28cpld.yaml
··· 39 39 40 40 patternProperties: 41 41 "^gpio(@[0-9a-f]+)?$": 42 - $ref: ../gpio/kontron,sl28cpld-gpio.yaml 42 + $ref: /schemas/gpio/kontron,sl28cpld-gpio.yaml 43 43 44 44 "^hwmon(@[0-9a-f]+)?$": 45 - $ref: ../hwmon/kontron,sl28cpld-hwmon.yaml 45 + $ref: /schemas/hwmon/kontron,sl28cpld-hwmon.yaml 46 46 47 47 "^interrupt-controller(@[0-9a-f]+)?$": 48 - $ref: ../interrupt-controller/kontron,sl28cpld-intc.yaml 48 + $ref: /schemas/interrupt-controller/kontron,sl28cpld-intc.yaml 49 49 50 50 "^pwm(@[0-9a-f]+)?$": 51 - $ref: ../pwm/kontron,sl28cpld-pwm.yaml 51 + $ref: /schemas/pwm/kontron,sl28cpld-pwm.yaml 52 52 53 53 "^watchdog(@[0-9a-f]+)?$": 54 - $ref: ../watchdog/kontron,sl28cpld-wdt.yaml 54 + $ref: /schemas/watchdog/kontron,sl28cpld-wdt.yaml 55 55 56 56 required: 57 57 - "#address-cells"
-67
Documentation/devicetree/bindings/mfd/lp873x.txt
··· 1 - TI LP873X PMIC MFD driver 2 - 3 - Required properties: 4 - - compatible: "ti,lp8732", "ti,lp8733" 5 - - reg: I2C slave address. 6 - - gpio-controller: Marks the device node as a GPIO Controller. 7 - - #gpio-cells: Should be two. The first cell is the pin number and 8 - the second cell is used to specify flags. 9 - See ../gpio/gpio.txt for more information. 10 - - xxx-in-supply: Phandle to parent supply node of each regulator 11 - populated under regulators node. xxx can be 12 - buck0, buck1, ldo0 or ldo1. 13 - - regulators: List of child nodes that specify the regulator 14 - initialization data. 15 - Example: 16 - 17 - pmic: lp8733@60 { 18 - compatible = "ti,lp8733"; 19 - reg = <0x60>; 20 - gpio-controller; 21 - #gpio-cells = <2>; 22 - 23 - buck0-in-supply = <&vsys_3v3>; 24 - buck1-in-supply = <&vsys_3v3>; 25 - ldo0-in-supply = <&vsys_3v3>; 26 - ldo1-in-supply = <&vsys_3v3>; 27 - 28 - regulators { 29 - lp8733_buck0: buck0 { 30 - regulator-name = "lp8733-buck0"; 31 - regulator-min-microvolt = <800000>; 32 - regulator-max-microvolt = <1400000>; 33 - regulator-min-microamp = <1500000>; 34 - regulator-max-microamp = <4000000>; 35 - regulator-ramp-delay = <10000>; 36 - regulator-always-on; 37 - regulator-boot-on; 38 - }; 39 - 40 - lp8733_buck1: buck1 { 41 - regulator-name = "lp8733-buck1"; 42 - regulator-min-microvolt = <800000>; 43 - regulator-max-microvolt = <1400000>; 44 - regulator-min-microamp = <1500000>; 45 - regulator-max-microamp = <4000000>; 46 - regulator-ramp-delay = <10000>; 47 - regulator-boot-on; 48 - regulator-always-on; 49 - }; 50 - 51 - lp8733_ldo0: ldo0 { 52 - regulator-name = "lp8733-ldo0"; 53 - regulator-min-microvolt = <800000>; 54 - regulator-max-microvolt = <3000000>; 55 - regulator-boot-on; 56 - regulator-always-on; 57 - }; 58 - 59 - lp8733_ldo1: ldo1 { 60 - regulator-name = "lp8733-ldo1"; 61 - regulator-min-microvolt = <800000>; 62 - regulator-max-microvolt = <3000000>; 63 - regulator-always-on; 64 - regulator-boot-on; 65 - }; 66 - }; 67 - };
+4 -4
Documentation/devicetree/bindings/mfd/max77650.yaml
··· 53 53 Single string containing the name of the GPIO line. 54 54 55 55 regulators: 56 - $ref: ../regulator/max77650-regulator.yaml 56 + $ref: /schemas/regulator/max77650-regulator.yaml 57 57 58 58 charger: 59 - $ref: ../power/supply/max77650-charger.yaml 59 + $ref: /schemas/power/supply/max77650-charger.yaml 60 60 61 61 leds: 62 - $ref: ../leds/leds-max77650.yaml 62 + $ref: /schemas/leds/leds-max77650.yaml 63 63 64 64 onkey: 65 - $ref: ../input/max77650-onkey.yaml 65 + $ref: /schemas/input/max77650-onkey.yaml 66 66 67 67 required: 68 68 - compatible
+1 -1
Documentation/devicetree/bindings/mfd/maxim,max77686.yaml
··· 35 35 maxItems: 1 36 36 37 37 voltage-regulators: 38 - $ref: ../regulator/maxim,max77686.yaml 38 + $ref: /schemas/regulator/maxim,max77686.yaml 39 39 description: 40 40 List of child nodes that specify the regulators. 41 41
+1 -1
Documentation/devicetree/bindings/mfd/maxim,max77693.yaml
··· 81 81 - pwms 82 82 83 83 regulators: 84 - $ref: ../regulator/maxim,max77693.yaml 84 + $ref: /schemas/regulator/maxim,max77693.yaml 85 85 description: 86 86 List of child nodes that specify the regulators. 87 87
+4
Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
··· 160 160 type: object 161 161 $ref: /schemas/nvmem/qcom,spmi-sdam.yaml# 162 162 163 + "^pbs@[0-9a-f]+$": 164 + type: object 165 + $ref: /schemas/soc/qcom/qcom,pbs.yaml# 166 + 163 167 "phy@[0-9a-f]+$": 164 168 type: object 165 169 $ref: /schemas/phy/qcom,snps-eusb2-repeater.yaml#
+1
Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml
··· 28 28 - qcom,sdm845-tcsr 29 29 - qcom,sdx55-tcsr 30 30 - qcom,sdx65-tcsr 31 + - qcom,sdx75-tcsr 31 32 - qcom,sm4450-tcsr 32 33 - qcom,sm6115-tcsr 33 34 - qcom,sm8150-tcsr
+1
Documentation/devicetree/bindings/mfd/qcom-pm8xxx.yaml
··· 19 19 - enum: 20 20 - qcom,pm8058 21 21 - qcom,pm8821 22 + - qcom,pm8901 22 23 - qcom,pm8921 23 24 - items: 24 25 - enum:
+2 -2
Documentation/devicetree/bindings/mfd/richtek,rt4831.yaml
··· 37 37 maxItems: 1 38 38 39 39 regulators: 40 - $ref: ../regulator/richtek,rt4831-regulator.yaml 40 + $ref: /schemas/regulator/richtek,rt4831-regulator.yaml 41 41 42 42 backlight: 43 - $ref: ../leds/backlight/richtek,rt4831-backlight.yaml 43 + $ref: /schemas/leds/backlight/richtek,rt4831-backlight.yaml 44 44 45 45 required: 46 46 - compatible
+3 -3
Documentation/devicetree/bindings/mfd/ricoh,rn5t618.yaml
··· 28 28 regulators: 29 29 patternProperties: 30 30 "^(DCDC[1-4]|LDO[1-5]|LDORTC[12])$": 31 - $ref: ../regulator/regulator.yaml 31 + $ref: /schemas/regulator/regulator.yaml 32 32 additionalProperties: false 33 33 - if: 34 34 properties: ··· 40 40 regulators: 41 41 patternProperties: 42 42 "^(DCDC[1-3]|LDO[1-5]|LDORTC[12])$": 43 - $ref: ../regulator/regulator.yaml 43 + $ref: /schemas/regulator/regulator.yaml 44 44 additionalProperties: false 45 45 - if: 46 46 properties: ··· 52 52 regulators: 53 53 patternProperties: 54 54 "^(DCDC[1-5]|LDO[1-9]|LDO10|LDORTC[12])$": 55 - $ref: ../regulator/regulator.yaml 55 + $ref: /schemas/regulator/regulator.yaml 56 56 additionalProperties: false 57 57 58 58 properties:
+1 -1
Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml
··· 82 82 patternProperties: 83 83 "^(DCDC_REG[1-4]|LDO_REG[1-3])$": 84 84 type: object 85 - $ref: ../regulator/regulator.yaml# 85 + $ref: /schemas/regulator/regulator.yaml# 86 86 unevaluatedProperties: false 87 87 unevaluatedProperties: false 88 88
+1 -1
Documentation/devicetree/bindings/mfd/rockchip,rk808.yaml
··· 109 109 patternProperties: 110 110 "^(DCDC_REG[1-4]|LDO_REG[1-8]|SWITCH_REG[1-2])$": 111 111 type: object 112 - $ref: ../regulator/regulator.yaml# 112 + $ref: /schemas/regulator/regulator.yaml# 113 113 unevaluatedProperties: false 114 114 unevaluatedProperties: false 115 115
+274
Documentation/devicetree/bindings/mfd/rockchip,rk816.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mfd/rockchip,rk816.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: RK816 Power Management Integrated Circuit 8 + 9 + maintainers: 10 + - Chris Zhong <zyw@rock-chips.com> 11 + - Zhang Qing <zhangqing@rock-chips.com> 12 + 13 + description: 14 + Rockchip RK816 series PMIC. This device consists of an i2c controlled MFD 15 + that includes regulators, a RTC, a GPIO controller, a power button, and a 16 + battery charger manager with fuel gauge. 17 + 18 + properties: 19 + compatible: 20 + enum: 21 + - rockchip,rk816 22 + 23 + reg: 24 + maxItems: 1 25 + 26 + interrupts: 27 + maxItems: 1 28 + 29 + '#clock-cells': 30 + description: 31 + See <dt-bindings/clock/rockchip,rk808.h> for clock IDs. 32 + const: 1 33 + 34 + clock-output-names: 35 + maxItems: 2 36 + 37 + gpio-controller: true 38 + 39 + '#gpio-cells': 40 + const: 2 41 + 42 + system-power-controller: 43 + type: boolean 44 + description: 45 + Telling whether or not this PMIC is controlling the system power. 46 + 47 + wakeup-source: 48 + type: boolean 49 + 50 + vcc1-supply: 51 + description: 52 + The input supply for dcdc1. 53 + 54 + vcc2-supply: 55 + description: 56 + The input supply for dcdc2. 57 + 58 + vcc3-supply: 59 + description: 60 + The input supply for dcdc3. 61 + 62 + vcc4-supply: 63 + description: 64 + The input supply for dcdc4. 65 + 66 + vcc5-supply: 67 + description: 68 + The input supply for ldo1, ldo2, and ldo3. 69 + 70 + vcc6-supply: 71 + description: 72 + The input supply for ldo4, ldo5, and ldo6. 73 + 74 + vcc7-supply: 75 + description: 76 + The input supply for boost. 77 + 78 + vcc8-supply: 79 + description: 80 + The input supply for otg-switch. 81 + 82 + regulators: 83 + type: object 84 + patternProperties: 85 + '^(boost|dcdc[1-4]|ldo[1-6]|otg-switch)$': 86 + type: object 87 + $ref: /schemas/regulator/regulator.yaml# 88 + unevaluatedProperties: false 89 + additionalProperties: false 90 + 91 + patternProperties: 92 + '-pins$': 93 + type: object 94 + additionalProperties: false 95 + $ref: /schemas/pinctrl/pinmux-node.yaml 96 + 97 + properties: 98 + function: 99 + enum: [gpio, thermistor] 100 + 101 + pins: 102 + $ref: /schemas/types.yaml#/definitions/string 103 + const: gpio0 104 + 105 + required: 106 + - compatible 107 + - reg 108 + - interrupts 109 + - '#clock-cells' 110 + 111 + additionalProperties: false 112 + 113 + examples: 114 + - | 115 + #include <dt-bindings/pinctrl/rockchip.h> 116 + #include <dt-bindings/interrupt-controller/irq.h> 117 + #include <dt-bindings/gpio/gpio.h> 118 + 119 + i2c { 120 + #address-cells = <1>; 121 + #size-cells = <0>; 122 + 123 + rk816: pmic@1a { 124 + compatible = "rockchip,rk816"; 125 + reg = <0x1a>; 126 + interrupt-parent = <&gpio0>; 127 + interrupts = <RK_PA2 IRQ_TYPE_LEVEL_LOW>; 128 + clock-output-names = "xin32k", "rk816-clkout2"; 129 + pinctrl-names = "default"; 130 + pinctrl-0 = <&pmic_int_l>; 131 + gpio-controller; 132 + system-power-controller; 133 + wakeup-source; 134 + #clock-cells = <1>; 135 + #gpio-cells = <2>; 136 + 137 + vcc1-supply = <&vcc_sys>; 138 + vcc2-supply = <&vcc_sys>; 139 + vcc3-supply = <&vcc_sys>; 140 + vcc4-supply = <&vcc_sys>; 141 + vcc5-supply = <&vcc33_io>; 142 + vcc6-supply = <&vcc_sys>; 143 + 144 + regulators { 145 + vdd_cpu: dcdc1 { 146 + regulator-name = "vdd_cpu"; 147 + regulator-min-microvolt = <750000>; 148 + regulator-max-microvolt = <1450000>; 149 + regulator-ramp-delay = <6001>; 150 + regulator-initial-mode = <1>; 151 + regulator-always-on; 152 + regulator-boot-on; 153 + 154 + regulator-state-mem { 155 + regulator-off-in-suspend; 156 + }; 157 + }; 158 + 159 + vdd_logic: dcdc2 { 160 + regulator-name = "vdd_logic"; 161 + regulator-min-microvolt = <800000>; 162 + regulator-max-microvolt = <1250000>; 163 + regulator-ramp-delay = <6001>; 164 + regulator-initial-mode = <1>; 165 + regulator-always-on; 166 + regulator-boot-on; 167 + 168 + regulator-state-mem { 169 + regulator-on-in-suspend; 170 + regulator-suspend-microvolt = <1000000>; 171 + }; 172 + }; 173 + 174 + vcc_ddr: dcdc3 { 175 + regulator-name = "vcc_ddr"; 176 + regulator-initial-mode = <1>; 177 + regulator-always-on; 178 + regulator-boot-on; 179 + 180 + regulator-state-mem { 181 + regulator-on-in-suspend; 182 + }; 183 + }; 184 + 185 + vcc33_io: dcdc4 { 186 + regulator-min-microvolt = <3300000>; 187 + regulator-max-microvolt = <3300000>; 188 + regulator-name = "vcc33_io"; 189 + regulator-initial-mode = <1>; 190 + regulator-always-on; 191 + regulator-boot-on; 192 + 193 + regulator-state-mem { 194 + regulator-on-in-suspend; 195 + regulator-suspend-microvolt = <3300000>; 196 + }; 197 + }; 198 + 199 + vccio_pmu: ldo1 { 200 + regulator-min-microvolt = <3300000>; 201 + regulator-max-microvolt = <3300000>; 202 + regulator-name = "vccio_pmu"; 203 + regulator-always-on; 204 + regulator-boot-on; 205 + 206 + regulator-state-mem { 207 + regulator-on-in-suspend; 208 + regulator-suspend-microvolt = <3300000>; 209 + }; 210 + }; 211 + 212 + vcc_tp: ldo2 { 213 + regulator-min-microvolt = <3300000>; 214 + regulator-max-microvolt = <3300000>; 215 + regulator-name = "vcc_tp"; 216 + 217 + regulator-state-mem { 218 + regulator-off-in-suspend; 219 + }; 220 + }; 221 + 222 + vdd_10: ldo3 { 223 + regulator-min-microvolt = <1000000>; 224 + regulator-max-microvolt = <1000000>; 225 + regulator-name = "vdd_10"; 226 + regulator-always-on; 227 + regulator-boot-on; 228 + 229 + regulator-state-mem { 230 + regulator-on-in-suspend; 231 + regulator-suspend-microvolt = <1000000>; 232 + }; 233 + }; 234 + 235 + vcc18_lcd: ldo4 { 236 + regulator-min-microvolt = <1800000>; 237 + regulator-max-microvolt = <1800000>; 238 + regulator-name = "vcc18_lcd"; 239 + 240 + regulator-state-mem { 241 + regulator-on-in-suspend; 242 + regulator-suspend-microvolt = <1800000>; 243 + }; 244 + }; 245 + 246 + vccio_sd: ldo5 { 247 + regulator-min-microvolt = <1800000>; 248 + regulator-max-microvolt = <3300000>; 249 + regulator-name = "vccio_sd"; 250 + 251 + regulator-state-mem { 252 + regulator-on-in-suspend; 253 + regulator-suspend-microvolt = <3300000>; 254 + }; 255 + }; 256 + 257 + vdd10_lcd: ldo6 { 258 + regulator-min-microvolt = <1000000>; 259 + regulator-max-microvolt = <1000000>; 260 + regulator-name = "vdd10_lcd"; 261 + 262 + regulator-state-mem { 263 + regulator-on-in-suspend; 264 + regulator-suspend-microvolt = <1000000>; 265 + }; 266 + }; 267 + }; 268 + 269 + rk816_gpio_pins: gpio-pins { 270 + function = "gpio"; 271 + pins = "gpio0"; 272 + }; 273 + }; 274 + };
+1 -1
Documentation/devicetree/bindings/mfd/rockchip,rk817.yaml
··· 91 91 "^(LDO_REG[1-9]|DCDC_REG[1-4]|BOOST|OTG_SWITCH)$": 92 92 type: object 93 93 unevaluatedProperties: false 94 - $ref: ../regulator/regulator.yaml# 94 + $ref: /schemas/regulator/regulator.yaml# 95 95 unevaluatedProperties: false 96 96 97 97 clocks:
+1 -1
Documentation/devicetree/bindings/mfd/rockchip,rk818.yaml
··· 101 101 patternProperties: 102 102 "^(DCDC_REG[1-4]|DCDC_BOOST|LDO_REG[1-9]|SWITCH_REG|HDMI_SWITCH|OTG_SWITCH)$": 103 103 type: object 104 - $ref: ../regulator/regulator.yaml# 104 + $ref: /schemas/regulator/regulator.yaml# 105 105 unevaluatedProperties: false 106 106 unevaluatedProperties: false 107 107
+1 -1
Documentation/devicetree/bindings/mfd/rohm,bd71815-pmic.yaml
··· 61 61 default: 30000000 62 62 63 63 regulators: 64 - $ref: ../regulator/rohm,bd71815-regulator.yaml 64 + $ref: /schemas/regulator/rohm,bd71815-regulator.yaml 65 65 description: 66 66 List of child nodes that specify the regulators. 67 67
+10 -3
Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml
··· 17 17 18 18 properties: 19 19 compatible: 20 - const: rohm,bd71828 20 + oneOf: 21 + - const: rohm,bd71828 22 + 23 + - items: 24 + - const: rohm,bd71879 25 + - const: rohm,bd71828 21 26 22 27 reg: 23 28 description: ··· 65 60 here in Ohms. 66 61 67 62 regulators: 68 - $ref: ../regulator/rohm,bd71828-regulator.yaml 63 + $ref: /schemas/regulator/rohm,bd71828-regulator.yaml 69 64 description: 70 65 List of child nodes that specify the regulators. 71 66 72 67 leds: 73 - $ref: ../leds/rohm,bd71828-leds.yaml 68 + $ref: /schemas/leds/rohm,bd71828-leds.yaml 74 69 75 70 gpio-reserved-ranges: 76 71 description: | 77 72 Usage of BD71828 GPIO pins can be changed via OTP. This property can be 78 73 used to mark the pins which should not be configured for GPIO. Please see 79 74 the ../gpio/gpio.txt for more information. 75 + 76 + system-power-controller: true 80 77 81 78 required: 82 79 - compatible
+1 -1
Documentation/devicetree/bindings/mfd/rohm,bd71837-pmic.yaml
··· 109 109 - 14000 110 110 111 111 regulators: 112 - $ref: ../regulator/rohm,bd71837-regulator.yaml 112 + $ref: /schemas/regulator/rohm,bd71837-regulator.yaml 113 113 description: 114 114 List of child nodes that specify the regulators. 115 115
+1 -1
Documentation/devicetree/bindings/mfd/rohm,bd9571mwv.yaml
··· 67 67 patternProperties: 68 68 "^(vd09|vd18|vd25|vd33|dvfs)$": 69 69 type: object 70 - $ref: ../regulator/regulator.yaml# 70 + $ref: /schemas/regulator/regulator.yaml# 71 71 72 72 properties: 73 73 regulator-name:
+1 -1
Documentation/devicetree/bindings/mfd/rohm,bd9576-pmic.yaml
··· 71 71 # (HW) minimum for max timeout is 4ms, maximum 4416 ms. 72 72 73 73 regulators: 74 - $ref: ../regulator/rohm,bd9576-regulator.yaml 74 + $ref: /schemas/regulator/rohm,bd9576-regulator.yaml 75 75 description: 76 76 List of child nodes that specify the regulators. 77 77
+1 -1
Documentation/devicetree/bindings/mfd/samsung,s2mpa01.yaml
··· 27 27 maxItems: 1 28 28 29 29 regulators: 30 - $ref: ../regulator/samsung,s2mpa01.yaml 30 + $ref: /schemas/regulator/samsung,s2mpa01.yaml 31 31 description: 32 32 List of child nodes that specify the regulators. 33 33
+6 -6
Documentation/devicetree/bindings/mfd/samsung,s2mps11.yaml
··· 27 27 - samsung,s2mpu02-pmic 28 28 29 29 clocks: 30 - $ref: ../clock/samsung,s2mps11.yaml 30 + $ref: /schemas/clock/samsung,s2mps11.yaml 31 31 description: 32 32 Child node describing clock provider. 33 33 ··· 75 75 then: 76 76 properties: 77 77 regulators: 78 - $ref: ../regulator/samsung,s2mps11.yaml 78 + $ref: /schemas/regulator/samsung,s2mps11.yaml 79 79 samsung,s2mps11-wrstbi-ground: false 80 80 81 81 - if: ··· 86 86 then: 87 87 properties: 88 88 regulators: 89 - $ref: ../regulator/samsung,s2mps13.yaml 89 + $ref: /schemas/regulator/samsung,s2mps13.yaml 90 90 samsung,s2mps11-acokb-ground: false 91 91 92 92 - if: ··· 97 97 then: 98 98 properties: 99 99 regulators: 100 - $ref: ../regulator/samsung,s2mps14.yaml 100 + $ref: /schemas/regulator/samsung,s2mps14.yaml 101 101 samsung,s2mps11-acokb-ground: false 102 102 samsung,s2mps11-wrstbi-ground: false 103 103 ··· 109 109 then: 110 110 properties: 111 111 regulators: 112 - $ref: ../regulator/samsung,s2mps15.yaml 112 + $ref: /schemas/regulator/samsung,s2mps15.yaml 113 113 samsung,s2mps11-acokb-ground: false 114 114 samsung,s2mps11-wrstbi-ground: false 115 115 ··· 121 121 then: 122 122 properties: 123 123 regulators: 124 - $ref: ../regulator/samsung,s2mpu02.yaml 124 + $ref: /schemas/regulator/samsung,s2mpu02.yaml 125 125 samsung,s2mps11-acokb-ground: false 126 126 samsung,s2mps11-wrstbi-ground: false 127 127
+2 -2
Documentation/devicetree/bindings/mfd/samsung,s5m8767.yaml
··· 21 21 const: samsung,s5m8767-pmic 22 22 23 23 clocks: 24 - $ref: ../clock/samsung,s2mps11.yaml 24 + $ref: /schemas/clock/samsung,s2mps11.yaml 25 25 description: 26 26 Child node describing clock provider. 27 27 ··· 32 32 maxItems: 1 33 33 34 34 regulators: 35 - $ref: ../regulator/samsung,s5m8767.yaml 35 + $ref: /schemas/regulator/samsung,s5m8767.yaml 36 36 description: 37 37 List of child nodes that specify the regulators. 38 38
+1 -1
Documentation/devicetree/bindings/mfd/st,stmfx.yaml
··· 60 60 additionalProperties: false 61 61 62 62 allOf: 63 - - $ref: ../pinctrl/pinmux-node.yaml 63 + - $ref: /schemas/pinctrl/pinmux-node.yaml 64 64 65 65 properties: 66 66 pins: true
+2 -2
Documentation/devicetree/bindings/mfd/st,stpmic1.yaml
··· 29 29 onkey: 30 30 type: object 31 31 32 - $ref: ../input/input.yaml 32 + $ref: /schemas/input/input.yaml 33 33 34 34 properties: 35 35 compatible: ··· 67 67 watchdog: 68 68 type: object 69 69 70 - $ref: ../watchdog/watchdog.yaml 70 + $ref: /schemas/watchdog/watchdog.yaml 71 71 72 72 properties: 73 73 compatible:
+24 -24
Documentation/devicetree/bindings/mfd/stericsson,ab8500.yaml
··· 126 126 patternProperties: 127 127 "^channel@[0-9a-f]+$": 128 128 type: object 129 - $ref: ../iio/adc/adc.yaml# 129 + $ref: /schemas/iio/adc/adc.yaml# 130 130 description: Represents each of the external channels which are 131 131 connected to the ADC. 132 132 ··· 180 180 ab8500_fg: 181 181 description: Node describing the AB8500 fuel gauge control block. 182 182 type: object 183 - $ref: ../power/supply/stericsson,ab8500-fg.yaml 183 + $ref: /schemas/power/supply/stericsson,ab8500-fg.yaml 184 184 185 185 ab8500_btemp: 186 186 description: Node describing the AB8500 battery temperature control block. 187 187 type: object 188 - $ref: ../power/supply/stericsson,ab8500-btemp.yaml 188 + $ref: /schemas/power/supply/stericsson,ab8500-btemp.yaml 189 189 190 190 ab8500_charger: 191 191 description: Node describing the AB8500 battery charger control block. 192 192 type: object 193 - $ref: ../power/supply/stericsson,ab8500-charger.yaml 193 + $ref: /schemas/power/supply/stericsson,ab8500-charger.yaml 194 194 195 195 ab8500_chargalg: 196 196 description: Node describing the AB8500 battery charger algorithm. 197 197 type: object 198 - $ref: ../power/supply/stericsson,ab8500-chargalg.yaml 198 + $ref: /schemas/power/supply/stericsson,ab8500-chargalg.yaml 199 199 200 200 phy: 201 201 description: Node describing the AB8500 USB PHY control block. ··· 339 339 ab8500_ldo_aux1: 340 340 description: The voltage for the auxiliary LDO regulator 1 341 341 type: object 342 - $ref: ../regulator/regulator.yaml# 342 + $ref: /schemas/regulator/regulator.yaml# 343 343 unevaluatedProperties: false 344 344 345 345 ab8500_ldo_aux2: 346 346 description: The voltage for the auxiliary LDO regulator 2 347 347 type: object 348 - $ref: ../regulator/regulator.yaml# 348 + $ref: /schemas/regulator/regulator.yaml# 349 349 unevaluatedProperties: false 350 350 351 351 ab8500_ldo_aux3: 352 352 description: The voltage for the auxiliary LDO regulator 3 353 353 type: object 354 - $ref: ../regulator/regulator.yaml# 354 + $ref: /schemas/regulator/regulator.yaml# 355 355 unevaluatedProperties: false 356 356 357 357 ab8500_ldo_aux4: 358 358 description: The voltage for the auxiliary LDO regulator 4 359 359 only present on AB8505 360 360 type: object 361 - $ref: ../regulator/regulator.yaml# 361 + $ref: /schemas/regulator/regulator.yaml# 362 362 unevaluatedProperties: false 363 363 364 364 ab8500_ldo_aux5: 365 365 description: The voltage for the auxiliary LDO regulator 5 366 366 only present on AB8505 367 367 type: object 368 - $ref: ../regulator/regulator.yaml# 368 + $ref: /schemas/regulator/regulator.yaml# 369 369 unevaluatedProperties: false 370 370 371 371 ab8500_ldo_aux6: 372 372 description: The voltage for the auxiliary LDO regulator 6 373 373 only present on AB8505 374 374 type: object 375 - $ref: ../regulator/regulator.yaml# 375 + $ref: /schemas/regulator/regulator.yaml# 376 376 unevaluatedProperties: false 377 377 378 378 # There is never any AUX7 regulator which is confusing ··· 381 381 description: The voltage for the auxiliary LDO regulator 8 382 382 only present on AB8505 383 383 type: object 384 - $ref: ../regulator/regulator.yaml# 384 + $ref: /schemas/regulator/regulator.yaml# 385 385 unevaluatedProperties: false 386 386 387 387 ab8500_ldo_intcore: 388 388 description: The LDO regulator for the internal core voltage 389 389 of the AB8500 390 390 type: object 391 - $ref: ../regulator/regulator.yaml# 391 + $ref: /schemas/regulator/regulator.yaml# 392 392 unevaluatedProperties: false 393 393 394 394 ab8500_ldo_adc: 395 395 description: Analog power regulator for the analog to digital converter 396 396 ADC, only present on AB8505 397 397 type: object 398 - $ref: ../regulator/regulator.yaml# 398 + $ref: /schemas/regulator/regulator.yaml# 399 399 unevaluatedProperties: false 400 400 401 401 ab8500_ldo_tvout: ··· 404 404 the temperature of the NTC thermistor on the battery. 405 405 Only present on AB8500. 406 406 type: object 407 - $ref: ../regulator/regulator.yaml# 407 + $ref: /schemas/regulator/regulator.yaml# 408 408 unevaluatedProperties: false 409 409 410 410 ab8500_ldo_audio: 411 411 description: The LDO regulator for the audio codec output 412 412 type: object 413 - $ref: ../regulator/regulator.yaml# 413 + $ref: /schemas/regulator/regulator.yaml# 414 414 unevaluatedProperties: false 415 415 416 416 ab8500_ldo_anamic1: 417 417 description: The LDO regulator for the analog microphone 1 418 418 type: object 419 - $ref: ../regulator/regulator.yaml# 419 + $ref: /schemas/regulator/regulator.yaml# 420 420 unevaluatedProperties: false 421 421 422 422 ab8500_ldo_anamic2: 423 423 description: The LDO regulator for the analog microphone 2 424 424 type: object 425 - $ref: ../regulator/regulator.yaml# 425 + $ref: /schemas/regulator/regulator.yaml# 426 426 unevaluatedProperties: false 427 427 428 428 ab8500_ldo_dmic: 429 429 description: The LDO regulator for the digital microphone 430 430 only present on AB8500 431 431 type: object 432 - $ref: ../regulator/regulator.yaml# 432 + $ref: /schemas/regulator/regulator.yaml# 433 433 unevaluatedProperties: false 434 434 435 435 ab8500_ldo_ana: 436 436 description: Analog power regulator for CSI and DSI interfaces, 437 437 Camera Serial Interface CSI and Display Serial Interface DSI. 438 438 type: object 439 - $ref: ../regulator/regulator.yaml# 439 + $ref: /schemas/regulator/regulator.yaml# 440 440 unevaluatedProperties: false 441 441 442 442 required: ··· 459 459 ab8500_ext1: 460 460 description: The voltage for the VSMPS1 external regulator 461 461 type: object 462 - $ref: ../regulator/regulator.yaml# 462 + $ref: /schemas/regulator/regulator.yaml# 463 463 unevaluatedProperties: false 464 464 465 465 ab8500_ext2: 466 466 description: The voltage for the VSMPS2 external regulator 467 467 type: object 468 - $ref: ../regulator/regulator.yaml# 468 + $ref: /schemas/regulator/regulator.yaml# 469 469 unevaluatedProperties: false 470 470 471 471 ab8500_ext3: 472 472 description: The voltage for the VSMPS3 external regulator 473 473 type: object 474 - $ref: ../regulator/regulator.yaml# 474 + $ref: /schemas/regulator/regulator.yaml# 475 475 unevaluatedProperties: false 476 476 477 477 required: ··· 482 482 patternProperties: 483 483 "^pwm@[1-9]+?$": 484 484 type: object 485 - $ref: ../pwm/pwm.yaml# 485 + $ref: /schemas/pwm/pwm.yaml# 486 486 unevaluatedProperties: false 487 487 description: Represents each of the PWM blocks in the AB8500 488 488
+20 -20
Documentation/devicetree/bindings/mfd/stericsson,db8500-prcmu.yaml
··· 71 71 description: The voltage for the application processor, the 72 72 main voltage domain for the chip. 73 73 type: object 74 - $ref: ../regulator/regulator.yaml# 74 + $ref: /schemas/regulator/regulator.yaml# 75 75 unevaluatedProperties: false 76 76 77 77 db8500_varm: 78 78 description: The voltage for the ARM Cortex-A9 CPU. 79 79 type: object 80 - $ref: ../regulator/regulator.yaml# 80 + $ref: /schemas/regulator/regulator.yaml# 81 81 unevaluatedProperties: false 82 82 83 83 db8500_vmodem: 84 84 description: The voltage for the modem subsystem. 85 85 type: object 86 - $ref: ../regulator/regulator.yaml# 86 + $ref: /schemas/regulator/regulator.yaml# 87 87 unevaluatedProperties: false 88 88 89 89 db8500_vpll: 90 90 description: The voltage for the phase locked loop clocks. 91 91 type: object 92 - $ref: ../regulator/regulator.yaml# 92 + $ref: /schemas/regulator/regulator.yaml# 93 93 unevaluatedProperties: false 94 94 95 95 db8500_vsmps1: 96 96 description: Also known as VIO12, is a step-down voltage regulator 97 97 for 1.2V I/O. SMPS means System Management Power Source. 98 98 type: object 99 - $ref: ../regulator/regulator.yaml# 99 + $ref: /schemas/regulator/regulator.yaml# 100 100 unevaluatedProperties: false 101 101 102 102 db8500_vsmps2: 103 103 description: Also known as VIO18, is a step-down voltage regulator 104 104 for 1.8V I/O. SMPS means System Management Power Source. 105 105 type: object 106 - $ref: ../regulator/regulator.yaml# 106 + $ref: /schemas/regulator/regulator.yaml# 107 107 unevaluatedProperties: false 108 108 109 109 db8500_vsmps3: 110 110 description: This is a step-down voltage regulator 111 111 for 0.87 thru 1.875V I/O. SMPS means System Management Power Source. 112 112 type: object 113 - $ref: ../regulator/regulator.yaml# 113 + $ref: /schemas/regulator/regulator.yaml# 114 114 unevaluatedProperties: false 115 115 116 116 db8500_vrf1: 117 117 description: RF transceiver voltage regulator. 118 118 type: object 119 - $ref: ../regulator/regulator.yaml# 119 + $ref: /schemas/regulator/regulator.yaml# 120 120 unevaluatedProperties: false 121 121 122 122 db8500_sva_mmdsp: ··· 124 124 voltage regulator. This is the voltage for the accelerator DSP 125 125 for video encoding and decoding. 126 126 type: object 127 - $ref: ../regulator/regulator.yaml# 127 + $ref: /schemas/regulator/regulator.yaml# 128 128 unevaluatedProperties: false 129 129 130 130 db8500_sva_mmdsp_ret: 131 131 description: Smart Video Accelerator (SVA) multimedia DSP (MMDSP) 132 132 voltage regulator for retention mode. 133 133 type: object 134 - $ref: ../regulator/regulator.yaml# 134 + $ref: /schemas/regulator/regulator.yaml# 135 135 unevaluatedProperties: false 136 136 137 137 db8500_sva_pipe: 138 138 description: Smart Video Accelerator (SVA) multimedia DSP (MMDSP) 139 139 voltage regulator for the data pipe. 140 140 type: object 141 - $ref: ../regulator/regulator.yaml# 141 + $ref: /schemas/regulator/regulator.yaml# 142 142 unevaluatedProperties: false 143 143 144 144 db8500_sia_mmdsp: ··· 146 146 voltage regulator. This is the voltage for the accelerator DSP 147 147 for image encoding and decoding. 148 148 type: object 149 - $ref: ../regulator/regulator.yaml# 149 + $ref: /schemas/regulator/regulator.yaml# 150 150 unevaluatedProperties: false 151 151 152 152 db8500_sia_mmdsp_ret: 153 153 description: Smart Image Accelerator (SIA) multimedia DSP (MMDSP) 154 154 voltage regulator for retention mode. 155 155 type: object 156 - $ref: ../regulator/regulator.yaml# 156 + $ref: /schemas/regulator/regulator.yaml# 157 157 unevaluatedProperties: false 158 158 159 159 db8500_sia_pipe: 160 160 description: Smart Image Accelerator (SIA) multimedia DSP (MMDSP) 161 161 voltage regulator for the data pipe. 162 162 type: object 163 - $ref: ../regulator/regulator.yaml# 163 + $ref: /schemas/regulator/regulator.yaml# 164 164 unevaluatedProperties: false 165 165 166 166 db8500_sga: ··· 168 168 This is in effect controlling the power to the MALI400 3D 169 169 accelerator block. 170 170 type: object 171 - $ref: ../regulator/regulator.yaml# 171 + $ref: /schemas/regulator/regulator.yaml# 172 172 unevaluatedProperties: false 173 173 174 174 db8500_b2r2_mcde: ··· 176 176 Display Engine (MCDE) voltage regulator. These are two graphics 177 177 blocks. 178 178 type: object 179 - $ref: ../regulator/regulator.yaml# 179 + $ref: /schemas/regulator/regulator.yaml# 180 180 unevaluatedProperties: false 181 181 182 182 db8500_esram12: 183 183 description: Embedded Static RAM (ESRAM) 1 and 2 voltage regulator. 184 184 type: object 185 - $ref: ../regulator/regulator.yaml# 185 + $ref: /schemas/regulator/regulator.yaml# 186 186 unevaluatedProperties: false 187 187 188 188 db8500_esram12_ret: 189 189 description: Embedded Static RAM (ESRAM) 1 and 2 voltage regulator for 190 190 retention mode. 191 191 type: object 192 - $ref: ../regulator/regulator.yaml# 192 + $ref: /schemas/regulator/regulator.yaml# 193 193 unevaluatedProperties: false 194 194 195 195 db8500_esram34: 196 196 description: Embedded Static RAM (ESRAM) 3 and 4 voltage regulator. 197 197 type: object 198 - $ref: ../regulator/regulator.yaml# 198 + $ref: /schemas/regulator/regulator.yaml# 199 199 unevaluatedProperties: false 200 200 201 201 db8500_esram34_ret: 202 202 description: Embedded Static RAM (ESRAM) 3 and 4 voltage regulator for 203 203 retention mode. 204 204 type: object 205 - $ref: ../regulator/regulator.yaml# 205 + $ref: /schemas/regulator/regulator.yaml# 206 206 unevaluatedProperties: false 207 207 208 208 required:
+16
Documentation/devicetree/bindings/mfd/syscon.yaml
··· 38 38 - allwinner,sun8i-h3-system-controller 39 39 - allwinner,sun8i-v3s-system-controller 40 40 - allwinner,sun50i-a64-system-controller 41 + - altr,sdr-ctl 41 42 - amd,pensando-elba-syscon 43 + - apm,xgene-csw 44 + - apm,xgene-efuse 45 + - apm,xgene-mcb 46 + - apm,xgene-rb 47 + - apm,xgene-scu 42 48 - brcm,cru-clkset 49 + - brcm,sr-cdru 50 + - brcm,sr-mhb 43 51 - freecom,fsg-cs2-system-controller 44 52 - fsl,imx93-aonmix-ns-syscfg 45 53 - fsl,imx93-wakeupmix-syscfg 54 + - fsl,ls1088a-reset 46 55 - hisilicon,dsa-subctrl 47 56 - hisilicon,hi6220-sramctrl 48 57 - hisilicon,pcie-sas-subctrl ··· 60 51 - intel,lgm-syscon 61 52 - loongson,ls1b-syscon 62 53 - loongson,ls1c-syscon 54 + - marvell,armada-3700-cpu-misc 55 + - marvell,armada-3700-nb-pm 56 + - marvell,armada-3700-avs 63 57 - marvell,armada-3700-usb2-host-misc 58 + - mediatek,mt2712-pctl-a-syscfg 59 + - mediatek,mt6397-pctl-pmic-syscfg 64 60 - mediatek,mt8135-pctl-a-syscfg 65 61 - mediatek,mt8135-pctl-b-syscfg 62 + - mediatek,mt8173-pctl-a-syscfg 66 63 - mediatek,mt8365-syscfg 67 64 - microchip,lan966x-cpu-syscon 68 65 - microchip,sparx5-cpu-syscon ··· 88 73 - rockchip,rv1126-qos 89 74 - starfive,jh7100-sysmain 90 75 - ti,am62-usb-phy-ctrl 76 + - ti,am62p-cpsw-mac-efuse 91 77 - ti,am654-dss-oldi-io-ctrl 92 78 - ti,am654-serdes-ctrl 93 79 - ti,j784s4-pcie-ctrl
+112
Documentation/devicetree/bindings/mfd/ti,lp8732.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mfd/ti,lp8732.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: TI LP873X Power Management Integrated Circuit 8 + 9 + maintainers: 10 + - J Keerthy <j-keerthy@ti.com> 11 + 12 + description: 13 + PMIC with two high-current buck converters and two linear regulators. 14 + 15 + properties: 16 + compatible: 17 + enum: 18 + - ti,lp8732 19 + - ti,lp8733 20 + 21 + reg: 22 + maxItems: 1 23 + 24 + gpio-controller: true 25 + 26 + '#gpio-cells': 27 + const: 2 28 + 29 + regulators: 30 + description: 31 + List of child nodes that specify the regulator initialization data. 32 + type: object 33 + patternProperties: 34 + "^buck[01]|ldo[01]$": 35 + type: object 36 + $ref: /schemas/regulator/regulator.yaml# 37 + unevaluatedProperties: false 38 + additionalProperties: false 39 + 40 + patternProperties: 41 + '^(buck[01]|ldo[01])-in-supply$': 42 + description: Phandle to parent supply of each regulator populated under regulators node. 43 + 44 + required: 45 + - compatible 46 + - reg 47 + - regulators 48 + - buck0-in-supply 49 + - buck1-in-supply 50 + - ldo0-in-supply 51 + - ldo1-in-supply 52 + 53 + additionalProperties: false 54 + 55 + examples: 56 + - | 57 + i2c { 58 + #address-cells = <1>; 59 + #size-cells = <0>; 60 + 61 + pmic: pmic@60 { 62 + compatible = "ti,lp8733"; 63 + reg = <0x60>; 64 + gpio-controller; 65 + #gpio-cells = <2>; 66 + 67 + buck0-in-supply = <&vsys_3v3>; 68 + buck1-in-supply = <&vsys_3v3>; 69 + ldo0-in-supply = <&vsys_3v3>; 70 + ldo1-in-supply = <&vsys_3v3>; 71 + 72 + regulators { 73 + buck0: buck0 { 74 + regulator-name = "buck0"; 75 + regulator-min-microvolt = <800000>; 76 + regulator-max-microvolt = <1400000>; 77 + regulator-min-microamp = <1500000>; 78 + regulator-max-microamp = <4000000>; 79 + regulator-ramp-delay = <10000>; 80 + regulator-always-on; 81 + regulator-boot-on; 82 + }; 83 + 84 + buck1: buck1 { 85 + regulator-name = "buck1"; 86 + regulator-min-microvolt = <800000>; 87 + regulator-max-microvolt = <1400000>; 88 + regulator-min-microamp = <1500000>; 89 + regulator-max-microamp = <4000000>; 90 + regulator-ramp-delay = <10000>; 91 + regulator-boot-on; 92 + regulator-always-on; 93 + }; 94 + 95 + ldo0: ldo0 { 96 + regulator-name = "ldo0"; 97 + regulator-min-microvolt = <800000>; 98 + regulator-max-microvolt = <3000000>; 99 + regulator-boot-on; 100 + regulator-always-on; 101 + }; 102 + 103 + ldo1: ldo1 { 104 + regulator-name = "ldo1"; 105 + regulator-min-microvolt = <800000>; 106 + regulator-max-microvolt = <3000000>; 107 + regulator-always-on; 108 + regulator-boot-on; 109 + }; 110 + }; 111 + }; 112 + };
+2 -2
Documentation/devicetree/bindings/mfd/ti,tps65086.yaml
··· 49 49 patternProperties: 50 50 "^buck[1-6]$": 51 51 type: object 52 - $ref: ../regulator/regulator.yaml 52 + $ref: /schemas/regulator/regulator.yaml 53 53 54 54 properties: 55 55 regulator-name: true ··· 72 72 73 73 "^(ldoa[1-3]|swa1|swb[1-2]|vtt)$": 74 74 type: object 75 - $ref: ../regulator/regulator.yaml 75 + $ref: /schemas/regulator/regulator.yaml 76 76 77 77 properties: 78 78 regulator-name: true
+1
Documentation/devicetree/bindings/mfd/ti,tps6594.yaml
··· 21 21 - ti,lp8764-q1 22 22 - ti,tps6593-q1 23 23 - ti,tps6594-q1 24 + - ti,tps65224-q1 24 25 25 26 reg: 26 27 description: I2C slave address or SPI chip select number.
+71 -1
Documentation/devicetree/bindings/mfd/ti,twl.yaml
··· 15 15 USB transceiver or Audio amplifier. 16 16 These chips are connected to an i2c bus. 17 17 18 + allOf: 19 + - if: 20 + properties: 21 + compatible: 22 + contains: 23 + const: ti,twl4030 24 + then: 25 + properties: 26 + madc: 27 + type: object 28 + $ref: /schemas/iio/adc/ti,twl4030-madc.yaml 29 + unevaluatedProperties: false 30 + 31 + bci: 32 + type: object 33 + $ref: /schemas/power/supply/twl4030-charger.yaml 34 + unevaluatedProperties: false 35 + 36 + pwrbutton: 37 + type: object 38 + additionalProperties: false 39 + properties: 40 + compatible: 41 + const: ti,twl4030-pwrbutton 42 + interrupts: 43 + items: 44 + - items: 45 + const: 8 46 + 47 + watchdog: 48 + type: object 49 + additionalProperties: false 50 + properties: 51 + compatible: 52 + const: ti,twl4030-wdt 53 + 54 + - if: 55 + properties: 56 + compatible: 57 + contains: 58 + const: ti,twl6030 59 + then: 60 + properties: 61 + gpadc: 62 + type: object 63 + properties: 64 + compatible: 65 + const: ti,twl6030-gpadc 66 + - if: 67 + properties: 68 + compatible: 69 + contains: 70 + const: ti,twl6032 71 + then: 72 + properties: 73 + gpadc: 74 + type: object 75 + properties: 76 + compatible: 77 + const: ti,twl6032-gpadc 78 + 18 79 properties: 19 80 compatible: 20 81 description: ··· 103 42 "#clock-cells": 104 43 const: 1 105 44 106 - additionalProperties: false 45 + rtc: 46 + type: object 47 + additionalProperties: false 48 + properties: 49 + compatible: 50 + const: ti,twl4030-rtc 51 + interrupts: 52 + maxItems: 1 53 + 54 + unevaluatedProperties: false 107 55 108 56 required: 109 57 - compatible
-11
Documentation/devicetree/bindings/rtc/twl-rtc.txt
··· 1 - * Texas Instruments TWL4030/6030 RTC 2 - 3 - Required properties: 4 - - compatible : Should be "ti,twl4030-rtc" 5 - - interrupts : Should be the interrupt number. 6 - 7 - Example: 8 - rtc { 9 - compatible = "ti,twl4030-rtc"; 10 - interrupts = <11>; 11 - };
-10
Documentation/devicetree/bindings/watchdog/twl4030-wdt.txt
··· 1 - Device tree bindings for twl4030-wdt driver (TWL4030 watchdog) 2 - 3 - Required properties: 4 - compatible = "ti,twl4030-wdt"; 5 - 6 - Example: 7 - 8 - watchdog { 9 - compatible = "ti,twl4030-wdt"; 10 - };
+2 -1
drivers/fpga/intel-m10-bmc-sec-update.c
··· 529 529 const u8 *data, u32 size) 530 530 { 531 531 struct m10bmc_sec *sec = fwl->dd_handle; 532 + const struct m10bmc_csr_map *csr_map = sec->m10bmc->info->csr_map; 532 533 u32 ret; 533 534 534 535 sec->cancel_request = false; 535 536 536 - if (!size || size > M10BMC_STAGING_SIZE) 537 + if (!size || size > csr_map->staging_size) 537 538 return FW_UPLOAD_ERR_INVALID_SIZE; 538 539 539 540 if (sec->m10bmc->flash_bulk_ops)
+8 -8
drivers/mfd/Kconfig
··· 292 292 293 293 config MFD_MAX5970 294 294 tristate "Maxim 5970/5978 power switch and monitor" 295 - depends on (I2C && OF) 295 + depends on I2C && OF 296 296 select MFD_SIMPLE_MFD_I2C 297 297 help 298 298 This driver controls a Maxim 5970/5978 switch via I2C bus. ··· 458 458 459 459 config MFD_GATEWORKS_GSC 460 460 tristate "Gateworks System Controller" 461 - depends on (I2C && OF) 461 + depends on I2C && OF 462 462 select MFD_CORE 463 463 select REGMAP_I2C 464 464 select REGMAP_IRQ ··· 473 473 474 474 config MFD_MC13XXX 475 475 tristate 476 - depends on (SPI_MASTER || I2C) 476 + depends on SPI_MASTER || I2C 477 477 select MFD_CORE 478 478 select REGMAP_IRQ 479 479 help ··· 1109 1109 1110 1110 config MFD_PM8XXX 1111 1111 tristate "Qualcomm PM8xxx PMIC chips driver" 1112 - depends on (ARM || HEXAGON || COMPILE_TEST) 1112 + depends on ARM || HEXAGON || COMPILE_TEST 1113 1113 select IRQ_DOMAIN_HIERARCHY 1114 1114 select MFD_CORE 1115 1115 select REGMAP ··· 1225 1225 select MFD_CORE 1226 1226 1227 1227 config MFD_RK8XX_I2C 1228 - tristate "Rockchip RK805/RK808/RK809/RK817/RK818 Power Management Chip" 1228 + tristate "Rockchip RK805/RK808/RK809/RK816/RK817/RK818 Power Management Chip" 1229 1229 depends on I2C && OF 1230 1230 select MFD_CORE 1231 1231 select REGMAP_I2C ··· 1233 1233 select MFD_RK8XX 1234 1234 help 1235 1235 If you say yes here you get support for the RK805, RK808, RK809, 1236 - RK817 and RK818 Power Management chips. 1236 + RK816, RK817 and RK818 Power Management chips. 1237 1237 This driver provides common support for accessing the device 1238 1238 through I2C interface. The device supports multiple sub-devices 1239 1239 including interrupts, RTC, LDO & DCDC regulators, and onkey. ··· 1418 1418 1419 1419 config MFD_STMPE 1420 1420 bool "STMicroelectronics STMPE" 1421 - depends on (I2C=y || SPI_MASTER=y) 1421 + depends on I2C=y || SPI_MASTER=y 1422 1422 depends on OF 1423 1423 select MFD_CORE 1424 1424 help ··· 2116 2116 2117 2117 config MFD_STPMIC1 2118 2118 tristate "Support for STPMIC1 PMIC" 2119 - depends on (I2C=y && OF) 2119 + depends on I2C=y && OF 2120 2120 select REGMAP_I2C 2121 2121 select REGMAP_IRQ 2122 2122 select MFD_CORE
+1 -1
drivers/mfd/axp20x.c
··· 422 422 .wr_table = &axp717_writeable_table, 423 423 .volatile_table = &axp717_volatile_table, 424 424 .max_register = AXP717_CPUSLDO_CONTROL, 425 - .cache_type = REGCACHE_RBTREE, 425 + .cache_type = REGCACHE_MAPLE, 426 426 }; 427 427 428 428 static const struct regmap_config axp806_regmap_config = {
+30 -6
drivers/mfd/cs42l43.c
··· 43 43 #define CS42L43_MCU_UPDATE_TIMEOUT_US 500000 44 44 #define CS42L43_MCU_UPDATE_RETRIES 5 45 45 46 + #define CS42L43_MCU_ROM_REV 0x2001 47 + #define CS42L43_MCU_ROM_BIOS_REV 0x0000 48 + 46 49 #define CS42L43_MCU_SUPPORTED_REV 0x2105 47 50 #define CS42L43_MCU_SHADOW_REGS_REQUIRED_REV 0x2200 48 51 #define CS42L43_MCU_SUPPORTED_BIOS_REV 0x0001 ··· 712 709 complete(&cs42l43->firmware_download); 713 710 } 714 711 712 + static int cs42l43_mcu_is_hw_compatible(struct cs42l43 *cs42l43, 713 + unsigned int mcu_rev, 714 + unsigned int bios_rev) 715 + { 716 + /* 717 + * The firmware has two revision numbers bringing either of them up to a 718 + * supported version will provide the disable the driver requires. 719 + */ 720 + if (mcu_rev < CS42L43_MCU_SUPPORTED_REV && 721 + bios_rev < CS42L43_MCU_SUPPORTED_BIOS_REV) { 722 + dev_err(cs42l43->dev, "Firmware too old to support disable\n"); 723 + return -EINVAL; 724 + } 725 + 726 + return 0; 727 + } 728 + 715 729 /* 716 730 * The process of updating the firmware is split into a series of steps, at the 717 731 * end of each step a soft reset of the device might be required which will ··· 765 745 ((mcu_rev & CS42L43_FW_SUBMINOR_REV_MASK) >> 8); 766 746 767 747 /* 768 - * The firmware has two revision numbers bringing either of them up to a 769 - * supported version will provide the features the driver requires. 748 + * The firmware has two revision numbers both of them being at the ROM 749 + * revision indicates no patch has been applied. 770 750 */ 771 - patched = mcu_rev >= CS42L43_MCU_SUPPORTED_REV || 772 - bios_rev >= CS42L43_MCU_SUPPORTED_BIOS_REV; 751 + patched = mcu_rev != CS42L43_MCU_ROM_REV || bios_rev != CS42L43_MCU_ROM_BIOS_REV; 773 752 /* 774 753 * Later versions of the firmwware require the driver to access some 775 754 * features through a set of shadow registers. ··· 813 794 return cs42l43_mcu_stage_2_3(cs42l43, shadow); 814 795 } 815 796 case CS42L43_MCU_BOOT_STAGE3: 816 - if (patched) 797 + if (patched) { 798 + ret = cs42l43_mcu_is_hw_compatible(cs42l43, mcu_rev, bios_rev); 799 + if (ret) 800 + return ret; 801 + 817 802 return cs42l43_mcu_disable(cs42l43); 818 - else 803 + } else { 819 804 return cs42l43_mcu_stage_3_2(cs42l43); 805 + } 820 806 case CS42L43_MCU_BOOT_STAGE4: 821 807 return 0; 822 808 default:
+1 -1
drivers/mfd/intel-lpss-pci.c
··· 54 54 if (ret) 55 55 return ret; 56 56 57 - ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_INTX); 57 + ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES); 58 58 if (ret < 0) 59 59 return ret; 60 60
+1
drivers/mfd/intel-m10-bmc-pmci.c
··· 370 370 .pr_reh_addr = M10BMC_N6000_PR_REH_ADDR, 371 371 .pr_magic = M10BMC_N6000_PR_PROG_MAGIC, 372 372 .rsu_update_counter = M10BMC_N6000_STAGING_FLASH_COUNT, 373 + .staging_size = M10BMC_STAGING_SIZE, 373 374 }; 374 375 375 376 static const struct intel_m10bmc_platform_info m10bmc_pmci_n6000 = {
+1
drivers/mfd/intel-m10-bmc-spi.c
··· 109 109 .pr_reh_addr = M10BMC_N3000_PR_REH_ADDR, 110 110 .pr_magic = M10BMC_N3000_PR_PROG_MAGIC, 111 111 .rsu_update_counter = M10BMC_N3000_STAGING_FLASH_COUNT, 112 + .staging_size = M10BMC_STAGING_SIZE, 112 113 }; 113 114 114 115 static struct mfd_cell m10bmc_d5005_subdevs[] = {
+47 -178
drivers/mfd/kempld-core.c
··· 6 6 * Author: Michael Brunner <michael.brunner@kontron.com> 7 7 */ 8 8 9 + #include <linux/err.h> 9 10 #include <linux/platform_device.h> 10 11 #include <linux/mfd/core.h> 11 12 #include <linux/mfd/kempld.h> 13 + #include <linux/mod_devicetable.h> 12 14 #include <linux/module.h> 15 + #include <linux/property.h> 13 16 #include <linux/dmi.h> 14 17 #include <linux/io.h> 15 18 #include <linux/delay.h> 16 - #include <linux/acpi.h> 19 + #include <linux/sysfs.h> 17 20 18 21 #define MAX_ID_LEN 4 19 22 static char force_device_id[MAX_ID_LEN + 1] = ""; ··· 109 106 if (pld->feature_mask & KEMPLD_FEATURE_MASK_UART) 110 107 devs[i++].name = kempld_dev_names[KEMPLD_UART]; 111 108 112 - return mfd_add_devices(pld->dev, -1, devs, i, NULL, 0, NULL); 109 + return mfd_add_devices(pld->dev, PLATFORM_DEVID_NONE, devs, i, NULL, 0, NULL); 113 110 } 114 111 115 112 static struct resource kempld_ioresource = { ··· 129 126 130 127 static struct platform_device *kempld_pdev; 131 128 132 - static int kempld_create_platform_device(const struct dmi_system_id *id) 129 + static int kempld_create_platform_device(const struct kempld_platform_data *pdata) 133 130 { 134 - const struct kempld_platform_data *pdata = id->driver_data; 135 - int ret; 131 + const struct platform_device_info pdevinfo = { 132 + .name = "kempld", 133 + .id = PLATFORM_DEVID_NONE, 134 + .res = pdata->ioresource, 135 + .num_res = 1, 136 + .data = pdata, 137 + .size_data = sizeof(*pdata), 138 + }; 136 139 137 - kempld_pdev = platform_device_alloc("kempld", -1); 138 - if (!kempld_pdev) 139 - return -ENOMEM; 140 - 141 - ret = platform_device_add_data(kempld_pdev, pdata, sizeof(*pdata)); 142 - if (ret) 143 - goto err; 144 - 145 - ret = platform_device_add_resources(kempld_pdev, pdata->ioresource, 1); 146 - if (ret) 147 - goto err; 148 - 149 - ret = platform_device_add(kempld_pdev); 150 - if (ret) 151 - goto err; 140 + kempld_pdev = platform_device_register_full(&pdevinfo); 141 + if (IS_ERR(kempld_pdev)) 142 + return PTR_ERR(kempld_pdev); 152 143 153 144 return 0; 154 - err: 155 - platform_device_put(kempld_pdev); 156 - return ret; 157 145 } 158 146 159 147 /** ··· 293 299 else 294 300 minor = (pld->info.minor - 10) + 'A'; 295 301 296 - ret = scnprintf(pld->info.version, sizeof(pld->info.version), 297 - "P%X%c%c.%04X", pld->info.number, major, minor, 298 - pld->info.buildnr); 299 - if (ret < 0) 300 - return ret; 302 + scnprintf(pld->info.version, sizeof(pld->info.version), "P%X%c%c.%04X", 303 + pld->info.number, major, minor, pld->info.buildnr); 301 304 302 305 return 0; 303 306 } ··· 363 372 static DEVICE_ATTR_RO(pld_specification); 364 373 static DEVICE_ATTR_RO(pld_type); 365 374 366 - static struct attribute *pld_attributes[] = { 375 + static struct attribute *pld_attrs[] = { 367 376 &dev_attr_pld_version.attr, 368 377 &dev_attr_pld_specification.attr, 369 378 &dev_attr_pld_type.attr, 370 379 NULL 371 380 }; 372 - 373 - static const struct attribute_group pld_attr_group = { 374 - .attrs = pld_attributes, 375 - }; 381 + ATTRIBUTE_GROUPS(pld); 376 382 377 383 static int kempld_detect_device(struct kempld_device_data *pld) 378 384 { ··· 402 414 pld->info.version, kempld_get_type_string(pld), 403 415 pld->info.spec_major, pld->info.spec_minor); 404 416 405 - ret = sysfs_create_group(&pld->dev->kobj, &pld_attr_group); 406 - if (ret) 407 - return ret; 408 - 409 - ret = kempld_register_cells(pld); 410 - if (ret) 411 - sysfs_remove_group(&pld->dev->kobj, &pld_attr_group); 412 - 413 - return ret; 417 + return kempld_register_cells(pld); 414 418 } 415 - 416 - #ifdef CONFIG_ACPI 417 - static int kempld_get_acpi_data(struct platform_device *pdev) 418 - { 419 - struct device *dev = &pdev->dev; 420 - const struct kempld_platform_data *pdata; 421 - int ret; 422 - 423 - pdata = acpi_device_get_match_data(dev); 424 - ret = platform_device_add_data(pdev, pdata, 425 - sizeof(struct kempld_platform_data)); 426 - 427 - return ret; 428 - } 429 - #else 430 - static int kempld_get_acpi_data(struct platform_device *pdev) 431 - { 432 - return -ENODEV; 433 - } 434 - #endif /* CONFIG_ACPI */ 435 419 436 420 static int kempld_probe(struct platform_device *pdev) 437 421 { ··· 413 453 struct resource *ioport; 414 454 int ret; 415 455 416 - if (kempld_pdev == NULL) { 456 + if (IS_ERR_OR_NULL(kempld_pdev)) { 417 457 /* 418 458 * No kempld_pdev device has been registered in kempld_init, 419 459 * so we seem to be probing an ACPI platform device. 420 460 */ 421 - ret = kempld_get_acpi_data(pdev); 461 + pdata = device_get_match_data(dev); 462 + if (!pdata) 463 + return -ENODEV; 464 + 465 + ret = platform_device_add_data(pdev, pdata, sizeof(*pdata)); 422 466 if (ret) 423 467 return ret; 424 - } else if (kempld_pdev != pdev) { 468 + } else if (kempld_pdev == pdev) { 469 + pdata = dev_get_platdata(dev); 470 + } else { 425 471 /* 426 472 * The platform device we are probing is not the one we 427 473 * registered in kempld_init using the DMI table, so this one ··· 438 472 dev_notice(dev, "platform device exists - not using ACPI\n"); 439 473 return -ENODEV; 440 474 } 441 - pdata = dev_get_platdata(dev); 442 475 443 476 pld = devm_kzalloc(dev, sizeof(*pld), GFP_KERNEL); 444 477 if (!pld) ··· 468 503 struct kempld_device_data *pld = platform_get_drvdata(pdev); 469 504 const struct kempld_platform_data *pdata = dev_get_platdata(pld->dev); 470 505 471 - sysfs_remove_group(&pld->dev->kobj, &pld_attr_group); 472 - 473 506 mfd_remove_devices(&pdev->dev); 474 507 pdata->release_hardware_mutex(pld); 475 508 } 476 509 477 - #ifdef CONFIG_ACPI 478 510 static const struct acpi_device_id kempld_acpi_table[] = { 479 511 { "KEM0000", (kernel_ulong_t)&kempld_platform_data_generic }, 480 512 { "KEM0001", (kernel_ulong_t)&kempld_platform_data_generic }, 481 513 {} 482 514 }; 483 515 MODULE_DEVICE_TABLE(acpi, kempld_acpi_table); 484 - #endif 485 516 486 517 static struct platform_driver kempld_driver = { 487 518 .driver = { 488 519 .name = "kempld", 489 - .acpi_match_table = ACPI_PTR(kempld_acpi_table), 520 + .acpi_match_table = kempld_acpi_table, 521 + .dev_groups = pld_groups, 490 522 }, 491 523 .probe = kempld_probe, 492 524 .remove_new = kempld_remove, ··· 496 534 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 497 535 DMI_MATCH(DMI_BOARD_NAME, "COMe-bBD"), 498 536 }, 499 - .driver_data = (void *)&kempld_platform_data_generic, 500 - .callback = kempld_create_platform_device, 501 537 }, { 502 538 .ident = "BBL6", 503 539 .matches = { 504 540 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 505 541 DMI_MATCH(DMI_BOARD_NAME, "COMe-bBL6"), 506 542 }, 507 - .driver_data = (void *)&kempld_platform_data_generic, 508 - .callback = kempld_create_platform_device, 509 543 }, { 510 544 .ident = "BDV7", 511 545 .matches = { 512 546 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 513 547 DMI_MATCH(DMI_BOARD_NAME, "COMe-bDV7"), 514 548 }, 515 - .driver_data = (void *)&kempld_platform_data_generic, 516 - .callback = kempld_create_platform_device, 517 549 }, { 518 550 .ident = "BHL6", 519 551 .matches = { 520 552 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 521 553 DMI_MATCH(DMI_BOARD_NAME, "COMe-bHL6"), 522 554 }, 523 - .driver_data = (void *)&kempld_platform_data_generic, 524 - .callback = kempld_create_platform_device, 525 555 }, { 526 556 .ident = "BKL6", 527 557 .matches = { 528 558 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 529 559 DMI_MATCH(DMI_BOARD_NAME, "COMe-bKL6"), 530 560 }, 531 - .driver_data = (void *)&kempld_platform_data_generic, 532 - .callback = kempld_create_platform_device, 533 561 }, { 534 562 .ident = "BSL6", 535 563 .matches = { 536 564 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 537 565 DMI_MATCH(DMI_BOARD_NAME, "COMe-bSL6"), 538 566 }, 539 - .driver_data = (void *)&kempld_platform_data_generic, 540 - .callback = kempld_create_platform_device, 541 567 }, { 542 568 .ident = "CAL6", 543 569 .matches = { 544 570 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 545 571 DMI_MATCH(DMI_BOARD_NAME, "COMe-cAL"), 546 572 }, 547 - .driver_data = (void *)&kempld_platform_data_generic, 548 - .callback = kempld_create_platform_device, 549 573 }, { 550 574 .ident = "CBL6", 551 575 .matches = { 552 576 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 553 577 DMI_MATCH(DMI_BOARD_NAME, "COMe-cBL6"), 554 578 }, 555 - .driver_data = (void *)&kempld_platform_data_generic, 556 - .callback = kempld_create_platform_device, 557 579 }, { 558 580 .ident = "CBW6", 559 581 .matches = { 560 582 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 561 583 DMI_MATCH(DMI_BOARD_NAME, "COMe-cBW6"), 562 584 }, 563 - .driver_data = (void *)&kempld_platform_data_generic, 564 - .callback = kempld_create_platform_device, 565 585 }, { 566 586 .ident = "CCR2", 567 587 .matches = { 568 588 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 569 589 DMI_MATCH(DMI_BOARD_NAME, "COMe-bIP2"), 570 590 }, 571 - .driver_data = (void *)&kempld_platform_data_generic, 572 - .callback = kempld_create_platform_device, 573 591 }, { 574 592 .ident = "CCR6", 575 593 .matches = { 576 594 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 577 595 DMI_MATCH(DMI_BOARD_NAME, "COMe-bIP6"), 578 596 }, 579 - .driver_data = (void *)&kempld_platform_data_generic, 580 - .callback = kempld_create_platform_device, 581 597 }, { 582 598 .ident = "CDV7", 583 599 .matches = { 584 600 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 585 601 DMI_MATCH(DMI_BOARD_NAME, "COMe-cDV7"), 586 602 }, 587 - .driver_data = (void *)&kempld_platform_data_generic, 588 - .callback = kempld_create_platform_device, 589 603 }, { 590 604 .ident = "CHL6", 591 605 .matches = { 592 606 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 593 607 DMI_MATCH(DMI_BOARD_NAME, "COMe-cHL6"), 594 608 }, 595 - .driver_data = (void *)&kempld_platform_data_generic, 596 - .callback = kempld_create_platform_device, 597 609 }, { 598 610 .ident = "CHR2", 599 611 .matches = { 600 612 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 601 613 DMI_MATCH(DMI_BOARD_NAME, "ETXexpress-SC T2"), 602 614 }, 603 - .driver_data = (void *)&kempld_platform_data_generic, 604 - .callback = kempld_create_platform_device, 605 615 }, { 606 616 .ident = "CHR2", 607 617 .matches = { 608 618 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 609 619 DMI_MATCH(DMI_BOARD_NAME, "ETXe-SC T2"), 610 620 }, 611 - .driver_data = (void *)&kempld_platform_data_generic, 612 - .callback = kempld_create_platform_device, 613 621 }, { 614 622 .ident = "CHR2", 615 623 .matches = { 616 624 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 617 625 DMI_MATCH(DMI_BOARD_NAME, "COMe-bSC2"), 618 626 }, 619 - .driver_data = (void *)&kempld_platform_data_generic, 620 - .callback = kempld_create_platform_device, 621 627 }, { 622 628 .ident = "CHR6", 623 629 .matches = { 624 630 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 625 631 DMI_MATCH(DMI_BOARD_NAME, "ETXexpress-SC T6"), 626 632 }, 627 - .driver_data = (void *)&kempld_platform_data_generic, 628 - .callback = kempld_create_platform_device, 629 633 }, { 630 634 .ident = "CHR6", 631 635 .matches = { 632 636 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 633 637 DMI_MATCH(DMI_BOARD_NAME, "ETXe-SC T6"), 634 638 }, 635 - .driver_data = (void *)&kempld_platform_data_generic, 636 - .callback = kempld_create_platform_device, 637 639 }, { 638 640 .ident = "CHR6", 639 641 .matches = { 640 642 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 641 643 DMI_MATCH(DMI_BOARD_NAME, "COMe-bSC6"), 642 644 }, 643 - .driver_data = (void *)&kempld_platform_data_generic, 644 - .callback = kempld_create_platform_device, 645 645 }, { 646 646 .ident = "CKL6", 647 647 .matches = { 648 648 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 649 649 DMI_MATCH(DMI_BOARD_NAME, "COMe-cKL6"), 650 650 }, 651 - .driver_data = (void *)&kempld_platform_data_generic, 652 - .callback = kempld_create_platform_device, 653 651 }, { 654 652 .ident = "CNTG", 655 653 .matches = { 656 654 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 657 655 DMI_MATCH(DMI_BOARD_NAME, "ETXexpress-PC"), 658 656 }, 659 - .driver_data = (void *)&kempld_platform_data_generic, 660 - .callback = kempld_create_platform_device, 661 657 }, { 662 658 .ident = "CNTG", 663 659 .matches = { 664 660 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 665 661 DMI_MATCH(DMI_BOARD_NAME, "COMe-bPC2"), 666 662 }, 667 - .driver_data = (void *)&kempld_platform_data_generic, 668 - .callback = kempld_create_platform_device, 669 663 }, { 670 664 .ident = "CNTX", 671 665 .matches = { 672 666 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 673 667 DMI_MATCH(DMI_BOARD_NAME, "PXT"), 674 668 }, 675 - .driver_data = (void *)&kempld_platform_data_generic, 676 - .callback = kempld_create_platform_device, 677 669 }, { 678 670 .ident = "CSL6", 679 671 .matches = { 680 672 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 681 673 DMI_MATCH(DMI_BOARD_NAME, "COMe-cSL6"), 682 674 }, 683 - .driver_data = (void *)&kempld_platform_data_generic, 684 - .callback = kempld_create_platform_device, 685 675 }, { 686 676 .ident = "CVV6", 687 677 .matches = { 688 678 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 689 679 DMI_MATCH(DMI_BOARD_NAME, "COMe-cBT"), 690 680 }, 691 - .driver_data = (void *)&kempld_platform_data_generic, 692 - .callback = kempld_create_platform_device, 693 681 }, { 694 682 .ident = "FRI2", 695 683 .matches = { 696 684 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 697 685 DMI_MATCH(DMI_BIOS_VERSION, "FRI2"), 698 686 }, 699 - .driver_data = (void *)&kempld_platform_data_generic, 700 - .callback = kempld_create_platform_device, 701 687 }, { 702 688 .ident = "FRI2", 703 689 .matches = { 704 690 DMI_MATCH(DMI_PRODUCT_NAME, "Fish River Island II"), 705 691 }, 706 - .driver_data = (void *)&kempld_platform_data_generic, 707 - .callback = kempld_create_platform_device, 708 692 }, { 709 693 .ident = "A203", 710 694 .matches = { 711 695 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 712 696 DMI_MATCH(DMI_BOARD_NAME, "KBox A-203"), 713 697 }, 714 - .driver_data = (void *)&kempld_platform_data_generic, 715 - .callback = kempld_create_platform_device, 716 698 }, { 717 699 .ident = "M4A1", 718 700 .matches = { 719 701 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 720 702 DMI_MATCH(DMI_BOARD_NAME, "COMe-m4AL"), 721 703 }, 722 - .driver_data = (void *)&kempld_platform_data_generic, 723 - .callback = kempld_create_platform_device, 724 704 }, { 725 705 .ident = "MAL1", 726 706 .matches = { 727 707 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 728 708 DMI_MATCH(DMI_BOARD_NAME, "COMe-mAL10"), 729 709 }, 730 - .driver_data = (void *)&kempld_platform_data_generic, 731 - .callback = kempld_create_platform_device, 732 710 }, { 733 711 .ident = "MAPL", 734 712 .matches = { 735 713 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 736 714 DMI_MATCH(DMI_BOARD_NAME, "mITX-APL"), 737 715 }, 738 - .driver_data = (void *)&kempld_platform_data_generic, 739 - .callback = kempld_create_platform_device, 740 716 }, { 741 717 .ident = "MBR1", 742 718 .matches = { 743 719 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 744 720 DMI_MATCH(DMI_BOARD_NAME, "ETX-OH"), 745 721 }, 746 - .driver_data = (void *)&kempld_platform_data_generic, 747 - .callback = kempld_create_platform_device, 748 722 }, { 749 723 .ident = "MVV1", 750 724 .matches = { 751 725 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 752 726 DMI_MATCH(DMI_BOARD_NAME, "COMe-mBT"), 753 727 }, 754 - .driver_data = (void *)&kempld_platform_data_generic, 755 - .callback = kempld_create_platform_device, 756 728 }, { 757 729 .ident = "NTC1", 758 730 .matches = { 759 731 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 760 732 DMI_MATCH(DMI_BOARD_NAME, "nanoETXexpress-TT"), 761 733 }, 762 - .driver_data = (void *)&kempld_platform_data_generic, 763 - .callback = kempld_create_platform_device, 764 734 }, { 765 735 .ident = "NTC1", 766 736 .matches = { 767 737 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 768 738 DMI_MATCH(DMI_BOARD_NAME, "nETXe-TT"), 769 739 }, 770 - .driver_data = (void *)&kempld_platform_data_generic, 771 - .callback = kempld_create_platform_device, 772 740 }, { 773 741 .ident = "NTC1", 774 742 .matches = { 775 743 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 776 744 DMI_MATCH(DMI_BOARD_NAME, "COMe-mTT"), 777 745 }, 778 - .driver_data = (void *)&kempld_platform_data_generic, 779 - .callback = kempld_create_platform_device, 780 746 }, { 781 747 .ident = "NUP1", 782 748 .matches = { 783 749 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 784 750 DMI_MATCH(DMI_BOARD_NAME, "COMe-mCT"), 785 751 }, 786 - .driver_data = (void *)&kempld_platform_data_generic, 787 - .callback = kempld_create_platform_device, 788 752 }, { 789 753 .ident = "PAPL", 790 754 .matches = { 791 755 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 792 756 DMI_MATCH(DMI_BOARD_NAME, "pITX-APL"), 793 757 }, 794 - .driver_data = (void *)&kempld_platform_data_generic, 795 - .callback = kempld_create_platform_device, 796 758 }, { 797 759 .ident = "SXAL", 798 760 .matches = { 799 761 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 800 762 DMI_MATCH(DMI_BOARD_NAME, "SMARC-sXAL"), 801 763 }, 802 - .driver_data = (void *)&kempld_platform_data_generic, 803 - .callback = kempld_create_platform_device, 804 764 }, { 805 765 .ident = "SXAL4", 806 766 .matches = { 807 767 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 808 768 DMI_MATCH(DMI_BOARD_NAME, "SMARC-sXA4"), 809 769 }, 810 - .driver_data = (void *)&kempld_platform_data_generic, 811 - .callback = kempld_create_platform_device, 812 770 }, { 813 771 .ident = "UNP1", 814 772 .matches = { 815 773 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 816 774 DMI_MATCH(DMI_BOARD_NAME, "microETXexpress-DC"), 817 775 }, 818 - .driver_data = (void *)&kempld_platform_data_generic, 819 - .callback = kempld_create_platform_device, 820 776 }, { 821 777 .ident = "UNP1", 822 778 .matches = { 823 779 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 824 780 DMI_MATCH(DMI_BOARD_NAME, "COMe-cDC2"), 825 781 }, 826 - .driver_data = (void *)&kempld_platform_data_generic, 827 - .callback = kempld_create_platform_device, 828 782 }, { 829 783 .ident = "UNTG", 830 784 .matches = { 831 785 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 832 786 DMI_MATCH(DMI_BOARD_NAME, "microETXexpress-PC"), 833 787 }, 834 - .driver_data = (void *)&kempld_platform_data_generic, 835 - .callback = kempld_create_platform_device, 836 788 }, { 837 789 .ident = "UNTG", 838 790 .matches = { 839 791 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 840 792 DMI_MATCH(DMI_BOARD_NAME, "COMe-cPC2"), 841 793 }, 842 - .driver_data = (void *)&kempld_platform_data_generic, 843 - .callback = kempld_create_platform_device, 844 794 }, { 845 795 .ident = "UUP6", 846 796 .matches = { 847 797 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 848 798 DMI_MATCH(DMI_BOARD_NAME, "COMe-cCT6"), 849 799 }, 850 - .driver_data = (void *)&kempld_platform_data_generic, 851 - .callback = kempld_create_platform_device, 852 800 }, { 853 801 .ident = "UTH6", 854 802 .matches = { 855 803 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 856 804 DMI_MATCH(DMI_BOARD_NAME, "COMe-cTH6"), 857 805 }, 858 - .driver_data = (void *)&kempld_platform_data_generic, 859 - .callback = kempld_create_platform_device, 860 806 }, { 861 807 .ident = "Q7AL", 862 808 .matches = { 863 809 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 864 810 DMI_MATCH(DMI_BOARD_NAME, "Qseven-Q7AL"), 865 811 }, 866 - .driver_data = (void *)&kempld_platform_data_generic, 867 - .callback = kempld_create_platform_device, 868 812 }, 869 813 {} 870 814 }; ··· 779 911 static int __init kempld_init(void) 780 912 { 781 913 const struct dmi_system_id *id; 914 + int ret = -ENODEV; 782 915 783 - if (force_device_id[0]) { 784 - for (id = kempld_dmi_table; 785 - id->matches[0].slot != DMI_NONE; id++) 786 - if (strstr(id->ident, force_device_id)) 787 - if (id->callback && !id->callback(id)) 788 - break; 789 - if (id->matches[0].slot == DMI_NONE) 790 - return -ENODEV; 791 - } else { 792 - dmi_check_system(kempld_dmi_table); 916 + for (id = dmi_first_match(kempld_dmi_table); id; id = dmi_first_match(id + 1)) { 917 + /* Check, if user asked for the exact device ID match */ 918 + if (force_device_id[0] && !strstr(id->ident, force_device_id)) 919 + continue; 920 + 921 + ret = kempld_create_platform_device(&kempld_platform_data_generic); 922 + if (ret) 923 + continue; 924 + 925 + break; 793 926 } 927 + if (ret) 928 + return ret; 794 929 795 930 return platform_driver_register(&kempld_driver); 796 931 } 797 932 798 933 static void __exit kempld_exit(void) 799 934 { 800 - if (kempld_pdev) 801 - platform_device_unregister(kempld_pdev); 802 - 935 + platform_device_unregister(kempld_pdev); 803 936 platform_driver_unregister(&kempld_driver); 804 937 } 805 938
+1 -4
drivers/mfd/ocelot-spi.c
··· 145 145 struct device *dev = context; 146 146 struct ocelot_ddata *ddata; 147 147 struct spi_device *spi; 148 - struct spi_message msg; 149 148 unsigned int index = 0; 150 149 151 150 ddata = dev_get_drvdata(dev); ··· 165 166 xfers[index].len = val_size; 166 167 index++; 167 168 168 - spi_message_init_with_transfers(&msg, xfers, index); 169 - 170 - return spi_sync(spi, &msg); 169 + return spi_sync_transfer(spi, xfers, index); 171 170 } 172 171 173 172 static int ocelot_spi_regmap_bus_write(void *context, const void *data, size_t count)
+104
drivers/mfd/rk8xx-core.c
··· 28 28 DEFINE_RES_IRQ(RK808_IRQ_RTC_ALARM), 29 29 }; 30 30 31 + static const struct resource rk816_rtc_resources[] = { 32 + DEFINE_RES_IRQ(RK816_IRQ_RTC_ALARM), 33 + }; 34 + 31 35 static const struct resource rk817_rtc_resources[] = { 32 36 DEFINE_RES_IRQ(RK817_IRQ_RTC_ALARM), 33 37 }; ··· 88 84 .name = "rk808-rtc", 89 85 .num_resources = ARRAY_SIZE(rtc_resources), 90 86 .resources = rtc_resources, 87 + }, 88 + }; 89 + 90 + static const struct mfd_cell rk816s[] = { 91 + { .name = "rk805-pinctrl", }, 92 + { .name = "rk808-clkout", }, 93 + { .name = "rk808-regulator", }, 94 + { 95 + .name = "rk805-pwrkey", 96 + .num_resources = ARRAY_SIZE(rk805_key_resources), 97 + .resources = rk805_key_resources, 98 + }, 99 + { 100 + .name = "rk808-rtc", 101 + .num_resources = ARRAY_SIZE(rk816_rtc_resources), 102 + .resources = rk816_rtc_resources, 91 103 }, 92 104 }; 93 105 ··· 166 146 { RK808_DCDC_UV_ACT_REG, BUCK_UV_ACT_MASK, BUCK_UV_ACT_DISABLE}, 167 147 { RK808_VB_MON_REG, MASK_ALL, VB_LO_ACT | 168 148 VB_LO_SEL_3500MV }, 149 + }; 150 + 151 + static const struct rk808_reg_data rk816_pre_init_reg[] = { 152 + { RK818_BUCK1_CONFIG_REG, RK817_RAMP_RATE_MASK, 153 + RK817_RAMP_RATE_12_5MV_PER_US }, 154 + { RK818_BUCK2_CONFIG_REG, RK817_RAMP_RATE_MASK, 155 + RK817_RAMP_RATE_12_5MV_PER_US }, 156 + { RK818_BUCK4_CONFIG_REG, BUCK_ILMIN_MASK, BUCK_ILMIN_250MA }, 157 + { RK808_THERMAL_REG, TEMP_HOTDIE_MSK, TEMP105C}, 158 + { RK808_VB_MON_REG, VBAT_LOW_VOL_MASK | VBAT_LOW_ACT_MASK, 159 + RK808_VBAT_LOW_3V0 | EN_VABT_LOW_SHUT_DOWN }, 169 160 }; 170 161 171 162 static const struct rk808_reg_data rk817_pre_init_reg[] = { ··· 381 350 }, 382 351 }; 383 352 353 + static const unsigned int rk816_irq_status_offsets[] = { 354 + RK816_IRQ_STS_OFFSET(RK816_INT_STS_REG1), 355 + RK816_IRQ_STS_OFFSET(RK816_INT_STS_REG2), 356 + RK816_IRQ_STS_OFFSET(RK816_INT_STS_REG3), 357 + }; 358 + 359 + static const unsigned int rk816_irq_mask_offsets[] = { 360 + RK816_IRQ_MSK_OFFSET(RK816_INT_STS_MSK_REG1), 361 + RK816_IRQ_MSK_OFFSET(RK816_INT_STS_MSK_REG2), 362 + RK816_IRQ_MSK_OFFSET(RK816_INT_STS_MSK_REG3), 363 + }; 364 + 365 + static unsigned int rk816_get_irq_reg(struct regmap_irq_chip_data *data, 366 + unsigned int base, int index) 367 + { 368 + unsigned int irq_reg = base; 369 + 370 + switch (base) { 371 + case RK816_INT_STS_REG1: 372 + irq_reg += rk816_irq_status_offsets[index]; 373 + break; 374 + case RK816_INT_STS_MSK_REG1: 375 + irq_reg += rk816_irq_mask_offsets[index]; 376 + break; 377 + } 378 + 379 + return irq_reg; 380 + }; 381 + 382 + static const struct regmap_irq rk816_irqs[] = { 383 + /* INT_STS_REG1 IRQs */ 384 + REGMAP_IRQ_REG(RK816_IRQ_PWRON_FALL, 0, RK816_INT_STS_PWRON_FALL), 385 + REGMAP_IRQ_REG(RK816_IRQ_PWRON_RISE, 0, RK816_INT_STS_PWRON_RISE), 386 + 387 + /* INT_STS_REG2 IRQs */ 388 + REGMAP_IRQ_REG(RK816_IRQ_VB_LOW, 1, RK816_INT_STS_VB_LOW), 389 + REGMAP_IRQ_REG(RK816_IRQ_PWRON, 1, RK816_INT_STS_PWRON), 390 + REGMAP_IRQ_REG(RK816_IRQ_PWRON_LP, 1, RK816_INT_STS_PWRON_LP), 391 + REGMAP_IRQ_REG(RK816_IRQ_HOTDIE, 1, RK816_INT_STS_HOTDIE), 392 + REGMAP_IRQ_REG(RK816_IRQ_RTC_ALARM, 1, RK816_INT_STS_RTC_ALARM), 393 + REGMAP_IRQ_REG(RK816_IRQ_RTC_PERIOD, 1, RK816_INT_STS_RTC_PERIOD), 394 + REGMAP_IRQ_REG(RK816_IRQ_USB_OV, 1, RK816_INT_STS_USB_OV), 395 + 396 + /* INT_STS3 IRQs */ 397 + REGMAP_IRQ_REG(RK816_IRQ_PLUG_IN, 2, RK816_INT_STS_PLUG_IN), 398 + REGMAP_IRQ_REG(RK816_IRQ_PLUG_OUT, 2, RK816_INT_STS_PLUG_OUT), 399 + REGMAP_IRQ_REG(RK816_IRQ_CHG_OK, 2, RK816_INT_STS_CHG_OK), 400 + REGMAP_IRQ_REG(RK816_IRQ_CHG_TE, 2, RK816_INT_STS_CHG_TE), 401 + REGMAP_IRQ_REG(RK816_IRQ_CHG_TS, 2, RK816_INT_STS_CHG_TS), 402 + REGMAP_IRQ_REG(RK816_IRQ_CHG_CVTLIM, 2, RK816_INT_STS_CHG_CVTLIM), 403 + REGMAP_IRQ_REG(RK816_IRQ_DISCHG_ILIM, 2, RK816_INT_STS_DISCHG_ILIM), 404 + }; 405 + 384 406 static const struct regmap_irq rk818_irqs[] = { 385 407 /* INT_STS */ 386 408 [RK818_IRQ_VOUT_LO] = { ··· 566 482 .init_ack_masked = true, 567 483 }; 568 484 485 + static const struct regmap_irq_chip rk816_irq_chip = { 486 + .name = "rk816", 487 + .irqs = rk816_irqs, 488 + .num_irqs = ARRAY_SIZE(rk816_irqs), 489 + .num_regs = 3, 490 + .get_irq_reg = rk816_get_irq_reg, 491 + .status_base = RK816_INT_STS_REG1, 492 + .mask_base = RK816_INT_STS_MSK_REG1, 493 + .ack_base = RK816_INT_STS_REG1, 494 + .init_ack_masked = true, 495 + }; 496 + 569 497 static struct regmap_irq_chip rk817_irq_chip = { 570 498 .name = "rk817", 571 499 .irqs = rk817_irqs, ··· 626 530 reg = RK817_SYS_CFG(3); 627 531 bit = DEV_OFF; 628 532 break; 533 + case RK816_ID: 629 534 case RK818_ID: 630 535 reg = RK818_DEVCTRL_REG; 631 536 bit = DEV_OFF; ··· 733 636 nr_pre_init_regs = ARRAY_SIZE(rk808_pre_init_reg); 734 637 cells = rk808s; 735 638 nr_cells = ARRAY_SIZE(rk808s); 639 + break; 640 + case RK816_ID: 641 + rk808->regmap_irq_chip = &rk816_irq_chip; 642 + pre_init_reg = rk816_pre_init_reg; 643 + nr_pre_init_regs = ARRAY_SIZE(rk816_pre_init_reg); 644 + cells = rk816s; 645 + nr_cells = ARRAY_SIZE(rk816s); 736 646 break; 737 647 case RK818_ID: 738 648 rk808->regmap_irq_chip = &rk818_irq_chip;
+44 -1
drivers/mfd/rk8xx-i2c.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 /* 3 - * Rockchip RK808/RK818 Core (I2C) driver 3 + * Rockchip RK805/RK808/RK816/RK817/RK818 Core (I2C) driver 4 4 * 5 5 * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd 6 6 * Copyright (C) 2016 PHYTEC Messtechnik GmbH ··· 43 43 case RK808_DEVCTRL_REG: 44 44 case RK808_INT_STS_REG1: 45 45 case RK808_INT_STS_REG2: 46 + return true; 47 + } 48 + 49 + return false; 50 + } 51 + 52 + static bool rk816_is_volatile_reg(struct device *dev, unsigned int reg) 53 + { 54 + /* 55 + * Technically the ROUND_30s bit makes RTC_CTRL_REG volatile, but 56 + * we don't use that feature. It's better to cache. 57 + */ 58 + 59 + switch (reg) { 60 + case RK808_SECONDS_REG ... RK808_WEEKS_REG: 61 + case RK808_RTC_STATUS_REG: 62 + case RK808_VB_MON_REG: 63 + case RK808_THERMAL_REG: 64 + case RK816_DCDC_EN_REG1: 65 + case RK816_DCDC_EN_REG2: 66 + case RK816_INT_STS_REG1: 67 + case RK816_INT_STS_REG2: 68 + case RK816_INT_STS_REG3: 69 + case RK808_DEVCTRL_REG: 70 + case RK816_SUP_STS_REG: 71 + case RK816_GGSTS_REG: 72 + case RK816_ZERO_CUR_ADC_REGH: 73 + case RK816_ZERO_CUR_ADC_REGL: 74 + case RK816_GASCNT_REG(0) ... RK816_BAT_VOL_REGL: 46 75 return true; 47 76 } 48 77 ··· 129 100 .volatile_reg = rk808_is_volatile_reg, 130 101 }; 131 102 103 + static const struct regmap_config rk816_regmap_config = { 104 + .reg_bits = 8, 105 + .val_bits = 8, 106 + .max_register = RK816_DATA_REG(18), 107 + .cache_type = REGCACHE_MAPLE, 108 + .volatile_reg = rk816_is_volatile_reg, 109 + }; 110 + 132 111 static const struct regmap_config rk817_regmap_config = { 133 112 .reg_bits = 8, 134 113 .val_bits = 8, ··· 158 121 static const struct rk8xx_i2c_platform_data rk809_data = { 159 122 .regmap_cfg = &rk817_regmap_config, 160 123 .variant = RK809_ID, 124 + }; 125 + 126 + static const struct rk8xx_i2c_platform_data rk816_data = { 127 + .regmap_cfg = &rk816_regmap_config, 128 + .variant = RK816_ID, 161 129 }; 162 130 163 131 static const struct rk8xx_i2c_platform_data rk817_data = { ··· 203 161 { .compatible = "rockchip,rk805", .data = &rk805_data }, 204 162 { .compatible = "rockchip,rk808", .data = &rk808_data }, 205 163 { .compatible = "rockchip,rk809", .data = &rk809_data }, 164 + { .compatible = "rockchip,rk816", .data = &rk816_data }, 206 165 { .compatible = "rockchip,rk817", .data = &rk817_data }, 207 166 { .compatible = "rockchip,rk818", .data = &rk818_data }, 208 167 { },
+35 -1
drivers/mfd/rohm-bd71828.c
··· 464 464 OUT32K_MODE_CMOS); 465 465 } 466 466 467 + static struct i2c_client *bd71828_dev; 468 + static void bd71828_power_off(void) 469 + { 470 + while (true) { 471 + s32 val; 472 + 473 + /* We are not allowed to sleep, so do not use regmap involving mutexes here. */ 474 + val = i2c_smbus_read_byte_data(bd71828_dev, BD71828_REG_PS_CTRL_1); 475 + if (val >= 0) 476 + i2c_smbus_write_byte_data(bd71828_dev, 477 + BD71828_REG_PS_CTRL_1, 478 + BD71828_MASK_STATE_HBNT | (u8)val); 479 + mdelay(500); 480 + } 481 + } 482 + 483 + static void bd71828_remove_poweroff(void *data) 484 + { 485 + pm_power_off = NULL; 486 + } 487 + 467 488 static int bd71828_i2c_probe(struct i2c_client *i2c) 468 489 { 469 490 struct regmap_irq_chip_data *irq_data; ··· 563 542 ret = devm_mfd_add_devices(&i2c->dev, PLATFORM_DEVID_AUTO, mfd, cells, 564 543 NULL, 0, regmap_irq_get_domain(irq_data)); 565 544 if (ret) 566 - dev_err_probe(&i2c->dev, ret, "Failed to create subdevices\n"); 545 + return dev_err_probe(&i2c->dev, ret, "Failed to create subdevices\n"); 546 + 547 + if (of_device_is_system_power_controller(i2c->dev.of_node) && 548 + chip_type == ROHM_CHIP_TYPE_BD71828) { 549 + if (!pm_power_off) { 550 + bd71828_dev = i2c; 551 + pm_power_off = bd71828_power_off; 552 + ret = devm_add_action_or_reset(&i2c->dev, 553 + bd71828_remove_poweroff, 554 + NULL); 555 + } else { 556 + dev_warn(&i2c->dev, "Poweroff callback already assigned\n"); 557 + } 558 + } 567 559 568 560 return ret; 569 561 }
+93 -14
drivers/mfd/rsmu_i2c.c
··· 32 32 #define RSMU_SABRE_PAGE_ADDR 0x7F 33 33 #define RSMU_SABRE_PAGE_WINDOW 128 34 34 35 + typedef int (*rsmu_rw_device)(struct rsmu_ddata *rsmu, u8 reg, u8 *buf, u8 bytes); 36 + 35 37 static const struct regmap_range_cfg rsmu_sabre_range_cfg[] = { 36 38 { 37 39 .range_min = 0, ··· 56 54 } 57 55 } 58 56 59 - static int rsmu_read_device(struct rsmu_ddata *rsmu, u8 reg, u8 *buf, u16 bytes) 57 + static int rsmu_smbus_i2c_write_device(struct rsmu_ddata *rsmu, u8 reg, u8 *buf, u8 bytes) 58 + { 59 + struct i2c_client *client = to_i2c_client(rsmu->dev); 60 + 61 + return i2c_smbus_write_i2c_block_data(client, reg, bytes, buf); 62 + } 63 + 64 + static int rsmu_smbus_i2c_read_device(struct rsmu_ddata *rsmu, u8 reg, u8 *buf, u8 bytes) 65 + { 66 + struct i2c_client *client = to_i2c_client(rsmu->dev); 67 + int ret; 68 + 69 + ret = i2c_smbus_read_i2c_block_data(client, reg, bytes, buf); 70 + if (ret == bytes) 71 + return 0; 72 + else if (ret < 0) 73 + return ret; 74 + else 75 + return -EIO; 76 + } 77 + 78 + static int rsmu_i2c_read_device(struct rsmu_ddata *rsmu, u8 reg, u8 *buf, u8 bytes) 60 79 { 61 80 struct i2c_client *client = to_i2c_client(rsmu->dev); 62 81 struct i2c_msg msg[2]; ··· 107 84 return 0; 108 85 } 109 86 110 - static int rsmu_write_device(struct rsmu_ddata *rsmu, u8 reg, u8 *buf, u16 bytes) 87 + static int rsmu_i2c_write_device(struct rsmu_ddata *rsmu, u8 reg, u8 *buf, u8 bytes) 111 88 { 112 89 struct i2c_client *client = to_i2c_client(rsmu->dev); 113 - u8 msg[RSMU_MAX_WRITE_COUNT + 1]; /* 1 Byte added for the device register */ 90 + /* we add 1 byte for device register */ 91 + u8 msg[RSMU_MAX_WRITE_COUNT + 1]; 114 92 int cnt; 115 93 116 94 if (bytes > RSMU_MAX_WRITE_COUNT) ··· 131 107 return 0; 132 108 } 133 109 134 - static int rsmu_write_page_register(struct rsmu_ddata *rsmu, u32 reg) 110 + static int rsmu_write_page_register(struct rsmu_ddata *rsmu, u32 reg, 111 + rsmu_rw_device rsmu_write_device) 135 112 { 136 113 u32 page = reg & RSMU_CM_PAGE_MASK; 137 114 u8 buf[4]; ··· 161 136 return err; 162 137 } 163 138 164 - static int rsmu_reg_read(void *context, unsigned int reg, unsigned int *val) 139 + static int rsmu_i2c_reg_read(void *context, unsigned int reg, unsigned int *val) 165 140 { 166 141 struct rsmu_ddata *rsmu = i2c_get_clientdata((struct i2c_client *)context); 167 142 u8 addr = (u8)(reg & RSMU_CM_ADDRESS_MASK); 168 143 int err; 169 144 170 - err = rsmu_write_page_register(rsmu, reg); 145 + err = rsmu_write_page_register(rsmu, reg, rsmu_i2c_write_device); 171 146 if (err) 172 147 return err; 173 148 174 - err = rsmu_read_device(rsmu, addr, (u8 *)val, 1); 149 + err = rsmu_i2c_read_device(rsmu, addr, (u8 *)val, 1); 175 150 if (err) 176 151 dev_err(rsmu->dev, "Failed to read offset address 0x%x\n", addr); 177 152 178 153 return err; 179 154 } 180 155 181 - static int rsmu_reg_write(void *context, unsigned int reg, unsigned int val) 156 + static int rsmu_i2c_reg_write(void *context, unsigned int reg, unsigned int val) 182 157 { 183 158 struct rsmu_ddata *rsmu = i2c_get_clientdata((struct i2c_client *)context); 184 159 u8 addr = (u8)(reg & RSMU_CM_ADDRESS_MASK); 185 160 u8 data = (u8)val; 186 161 int err; 187 162 188 - err = rsmu_write_page_register(rsmu, reg); 163 + err = rsmu_write_page_register(rsmu, reg, rsmu_i2c_write_device); 189 164 if (err) 190 165 return err; 191 166 192 - err = rsmu_write_device(rsmu, addr, &data, 1); 167 + err = rsmu_i2c_write_device(rsmu, addr, &data, 1); 193 168 if (err) 194 169 dev_err(rsmu->dev, 195 170 "Failed to write offset address 0x%x\n", addr); ··· 197 172 return err; 198 173 } 199 174 200 - static const struct regmap_config rsmu_cm_regmap_config = { 175 + static int rsmu_smbus_i2c_reg_read(void *context, unsigned int reg, unsigned int *val) 176 + { 177 + struct rsmu_ddata *rsmu = i2c_get_clientdata((struct i2c_client *)context); 178 + u8 addr = (u8)(reg & RSMU_CM_ADDRESS_MASK); 179 + int err; 180 + 181 + err = rsmu_write_page_register(rsmu, reg, rsmu_smbus_i2c_write_device); 182 + if (err) 183 + return err; 184 + 185 + err = rsmu_smbus_i2c_read_device(rsmu, addr, (u8 *)val, 1); 186 + if (err) 187 + dev_err(rsmu->dev, "Failed to read offset address 0x%x\n", addr); 188 + 189 + return err; 190 + } 191 + 192 + static int rsmu_smbus_i2c_reg_write(void *context, unsigned int reg, unsigned int val) 193 + { 194 + struct rsmu_ddata *rsmu = i2c_get_clientdata((struct i2c_client *)context); 195 + u8 addr = (u8)(reg & RSMU_CM_ADDRESS_MASK); 196 + u8 data = (u8)val; 197 + int err; 198 + 199 + err = rsmu_write_page_register(rsmu, reg, rsmu_smbus_i2c_write_device); 200 + if (err) 201 + return err; 202 + 203 + err = rsmu_smbus_i2c_write_device(rsmu, addr, &data, 1); 204 + if (err) 205 + dev_err(rsmu->dev, 206 + "Failed to write offset address 0x%x\n", addr); 207 + 208 + return err; 209 + } 210 + 211 + static const struct regmap_config rsmu_i2c_cm_regmap_config = { 201 212 .reg_bits = 32, 202 213 .val_bits = 8, 203 214 .max_register = 0x20120000, 204 - .reg_read = rsmu_reg_read, 205 - .reg_write = rsmu_reg_write, 215 + .reg_read = rsmu_i2c_reg_read, 216 + .reg_write = rsmu_i2c_reg_write, 217 + .cache_type = REGCACHE_NONE, 218 + }; 219 + 220 + static const struct regmap_config rsmu_smbus_i2c_cm_regmap_config = { 221 + .reg_bits = 32, 222 + .val_bits = 8, 223 + .max_register = 0x20120000, 224 + .reg_read = rsmu_smbus_i2c_reg_read, 225 + .reg_write = rsmu_smbus_i2c_reg_write, 206 226 .cache_type = REGCACHE_NONE, 207 227 }; 208 228 ··· 289 219 290 220 switch (rsmu->type) { 291 221 case RSMU_CM: 292 - cfg = &rsmu_cm_regmap_config; 222 + if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { 223 + cfg = &rsmu_i2c_cm_regmap_config; 224 + } else if (i2c_check_functionality(client->adapter, 225 + I2C_FUNC_SMBUS_I2C_BLOCK)) { 226 + cfg = &rsmu_smbus_i2c_cm_regmap_config; 227 + } else { 228 + dev_err(rsmu->dev, "Unsupported i2c adapter\n"); 229 + return -ENOTSUPP; 230 + } 293 231 break; 294 232 case RSMU_SABRE: 295 233 cfg = &rsmu_sabre_regmap_config; ··· 314 236 rsmu->regmap = devm_regmap_init(&client->dev, NULL, client, cfg); 315 237 else 316 238 rsmu->regmap = devm_regmap_init_i2c(client, cfg); 239 + 317 240 if (IS_ERR(rsmu->regmap)) { 318 241 ret = PTR_ERR(rsmu->regmap); 319 242 dev_err(rsmu->dev, "Failed to allocate register map: %d\n", ret);
+4 -4
drivers/mfd/rsmu_spi.c
··· 106 106 return 0; 107 107 page_reg = RSMU_CM_PAGE_ADDR; 108 108 page = reg & RSMU_PAGE_MASK; 109 - buf[0] = (u8)(page & 0xff); 110 - buf[1] = (u8)((page >> 8) & 0xff); 111 - buf[2] = (u8)((page >> 16) & 0xff); 112 - buf[3] = (u8)((page >> 24) & 0xff); 109 + buf[0] = (u8)(page & 0xFF); 110 + buf[1] = (u8)((page >> 8) & 0xFF); 111 + buf[2] = (u8)((page >> 16) & 0xFF); 112 + buf[3] = (u8)((page >> 24) & 0xFF); 113 113 bytes = 4; 114 114 break; 115 115 case RSMU_SABRE:
-1
drivers/mfd/ssbi.c
··· 64 64 }; 65 65 66 66 struct ssbi { 67 - struct device *slave; 68 67 void __iomem *base; 69 68 spinlock_t lock; 70 69 enum ssbi_controller_type controller_type;
-1
drivers/mfd/timberdale.c
··· 765 765 default: 766 766 dev_err(&dev->dev, "Unknown IP setup: %d.%d.%d\n", 767 767 priv->fw.major, priv->fw.minor, ip_setup); 768 - err = -ENODEV; 769 768 goto err_mfd; 770 769 } 771 770
+229 -24
drivers/mfd/tps6594-core.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 /* 3 - * Core functions for TI TPS6594/TPS6593/LP8764 PMICs 3 + * Core functions for TI TPS65224/TPS6594/TPS6593/LP8764 PMICs 4 4 * 5 5 * Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/ 6 6 */ ··· 278 278 TPS6594_REG_RTC_STATUS, 279 279 }; 280 280 281 + /* TPS65224 Resources */ 282 + 283 + static const struct resource tps65224_regulator_resources[] = { 284 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_BUCK1_UVOV, TPS65224_IRQ_NAME_BUCK1_UVOV), 285 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_BUCK2_UVOV, TPS65224_IRQ_NAME_BUCK2_UVOV), 286 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_BUCK3_UVOV, TPS65224_IRQ_NAME_BUCK3_UVOV), 287 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_BUCK4_UVOV, TPS65224_IRQ_NAME_BUCK4_UVOV), 288 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_LDO1_UVOV, TPS65224_IRQ_NAME_LDO1_UVOV), 289 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_LDO2_UVOV, TPS65224_IRQ_NAME_LDO2_UVOV), 290 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_LDO3_UVOV, TPS65224_IRQ_NAME_LDO3_UVOV), 291 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_VCCA_UVOV, TPS65224_IRQ_NAME_VCCA_UVOV), 292 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_VMON1_UVOV, TPS65224_IRQ_NAME_VMON1_UVOV), 293 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_VMON2_UVOV, TPS65224_IRQ_NAME_VMON2_UVOV), 294 + }; 295 + 296 + static const struct resource tps65224_pinctrl_resources[] = { 297 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_GPIO1, TPS65224_IRQ_NAME_GPIO1), 298 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_GPIO2, TPS65224_IRQ_NAME_GPIO2), 299 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_GPIO3, TPS65224_IRQ_NAME_GPIO3), 300 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_GPIO4, TPS65224_IRQ_NAME_GPIO4), 301 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_GPIO5, TPS65224_IRQ_NAME_GPIO5), 302 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_GPIO6, TPS65224_IRQ_NAME_GPIO6), 303 + }; 304 + 305 + static const struct resource tps65224_pfsm_resources[] = { 306 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_VSENSE, TPS65224_IRQ_NAME_VSENSE), 307 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_ENABLE, TPS65224_IRQ_NAME_ENABLE), 308 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_PB_SHORT, TPS65224_IRQ_NAME_PB_SHORT), 309 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_FSD, TPS65224_IRQ_NAME_FSD), 310 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_SOFT_REBOOT, TPS65224_IRQ_NAME_SOFT_REBOOT), 311 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_BIST_PASS, TPS65224_IRQ_NAME_BIST_PASS), 312 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_EXT_CLK, TPS65224_IRQ_NAME_EXT_CLK), 313 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_REG_UNLOCK, TPS65224_IRQ_NAME_REG_UNLOCK), 314 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_TWARN, TPS65224_IRQ_NAME_TWARN), 315 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_PB_LONG, TPS65224_IRQ_NAME_PB_LONG), 316 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_PB_FALL, TPS65224_IRQ_NAME_PB_FALL), 317 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_PB_RISE, TPS65224_IRQ_NAME_PB_RISE), 318 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_TSD_ORD, TPS65224_IRQ_NAME_TSD_ORD), 319 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_BIST_FAIL, TPS65224_IRQ_NAME_BIST_FAIL), 320 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_REG_CRC_ERR, TPS65224_IRQ_NAME_REG_CRC_ERR), 321 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_RECOV_CNT, TPS65224_IRQ_NAME_RECOV_CNT), 322 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_TSD_IMM, TPS65224_IRQ_NAME_TSD_IMM), 323 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_VCCA_OVP, TPS65224_IRQ_NAME_VCCA_OVP), 324 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_PFSM_ERR, TPS65224_IRQ_NAME_PFSM_ERR), 325 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_BG_XMON, TPS65224_IRQ_NAME_BG_XMON), 326 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_IMM_SHUTDOWN, TPS65224_IRQ_NAME_IMM_SHUTDOWN), 327 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_ORD_SHUTDOWN, TPS65224_IRQ_NAME_ORD_SHUTDOWN), 328 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_MCU_PWR_ERR, TPS65224_IRQ_NAME_MCU_PWR_ERR), 329 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_SOC_PWR_ERR, TPS65224_IRQ_NAME_SOC_PWR_ERR), 330 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_COMM_ERR, TPS65224_IRQ_NAME_COMM_ERR), 331 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_I2C2_ERR, TPS65224_IRQ_NAME_I2C2_ERR), 332 + }; 333 + 334 + static const struct resource tps65224_adc_resources[] = { 335 + DEFINE_RES_IRQ_NAMED(TPS65224_IRQ_ADC_CONV_READY, TPS65224_IRQ_NAME_ADC_CONV_READY), 336 + }; 337 + 338 + static const struct mfd_cell tps65224_common_cells[] = { 339 + MFD_CELL_RES("tps65224-adc", tps65224_adc_resources), 340 + MFD_CELL_RES("tps6594-pfsm", tps65224_pfsm_resources), 341 + MFD_CELL_RES("tps6594-pinctrl", tps65224_pinctrl_resources), 342 + MFD_CELL_RES("tps6594-regulator", tps65224_regulator_resources), 343 + }; 344 + 345 + static const struct regmap_irq tps65224_irqs[] = { 346 + /* INT_BUCK register */ 347 + REGMAP_IRQ_REG(TPS65224_IRQ_BUCK1_UVOV, 0, TPS65224_BIT_BUCK1_UVOV_INT), 348 + REGMAP_IRQ_REG(TPS65224_IRQ_BUCK2_UVOV, 0, TPS65224_BIT_BUCK2_UVOV_INT), 349 + REGMAP_IRQ_REG(TPS65224_IRQ_BUCK3_UVOV, 0, TPS65224_BIT_BUCK3_UVOV_INT), 350 + REGMAP_IRQ_REG(TPS65224_IRQ_BUCK4_UVOV, 0, TPS65224_BIT_BUCK4_UVOV_INT), 351 + 352 + /* INT_VMON_LDO register */ 353 + REGMAP_IRQ_REG(TPS65224_IRQ_LDO1_UVOV, 1, TPS65224_BIT_LDO1_UVOV_INT), 354 + REGMAP_IRQ_REG(TPS65224_IRQ_LDO2_UVOV, 1, TPS65224_BIT_LDO2_UVOV_INT), 355 + REGMAP_IRQ_REG(TPS65224_IRQ_LDO3_UVOV, 1, TPS65224_BIT_LDO3_UVOV_INT), 356 + REGMAP_IRQ_REG(TPS65224_IRQ_VCCA_UVOV, 1, TPS65224_BIT_VCCA_UVOV_INT), 357 + REGMAP_IRQ_REG(TPS65224_IRQ_VMON1_UVOV, 1, TPS65224_BIT_VMON1_UVOV_INT), 358 + REGMAP_IRQ_REG(TPS65224_IRQ_VMON2_UVOV, 1, TPS65224_BIT_VMON2_UVOV_INT), 359 + 360 + /* INT_GPIO register */ 361 + REGMAP_IRQ_REG(TPS65224_IRQ_GPIO1, 2, TPS65224_BIT_GPIO1_INT), 362 + REGMAP_IRQ_REG(TPS65224_IRQ_GPIO2, 2, TPS65224_BIT_GPIO2_INT), 363 + REGMAP_IRQ_REG(TPS65224_IRQ_GPIO3, 2, TPS65224_BIT_GPIO3_INT), 364 + REGMAP_IRQ_REG(TPS65224_IRQ_GPIO4, 2, TPS65224_BIT_GPIO4_INT), 365 + REGMAP_IRQ_REG(TPS65224_IRQ_GPIO5, 2, TPS65224_BIT_GPIO5_INT), 366 + REGMAP_IRQ_REG(TPS65224_IRQ_GPIO6, 2, TPS65224_BIT_GPIO6_INT), 367 + 368 + /* INT_STARTUP register */ 369 + REGMAP_IRQ_REG(TPS65224_IRQ_VSENSE, 3, TPS65224_BIT_VSENSE_INT), 370 + REGMAP_IRQ_REG(TPS65224_IRQ_ENABLE, 3, TPS6594_BIT_ENABLE_INT), 371 + REGMAP_IRQ_REG(TPS65224_IRQ_PB_SHORT, 3, TPS65224_BIT_PB_SHORT_INT), 372 + REGMAP_IRQ_REG(TPS65224_IRQ_FSD, 3, TPS6594_BIT_FSD_INT), 373 + REGMAP_IRQ_REG(TPS65224_IRQ_SOFT_REBOOT, 3, TPS6594_BIT_SOFT_REBOOT_INT), 374 + 375 + /* INT_MISC register */ 376 + REGMAP_IRQ_REG(TPS65224_IRQ_BIST_PASS, 4, TPS6594_BIT_BIST_PASS_INT), 377 + REGMAP_IRQ_REG(TPS65224_IRQ_EXT_CLK, 4, TPS6594_BIT_EXT_CLK_INT), 378 + REGMAP_IRQ_REG(TPS65224_IRQ_REG_UNLOCK, 4, TPS65224_BIT_REG_UNLOCK_INT), 379 + REGMAP_IRQ_REG(TPS65224_IRQ_TWARN, 4, TPS6594_BIT_TWARN_INT), 380 + REGMAP_IRQ_REG(TPS65224_IRQ_PB_LONG, 4, TPS65224_BIT_PB_LONG_INT), 381 + REGMAP_IRQ_REG(TPS65224_IRQ_PB_FALL, 4, TPS65224_BIT_PB_FALL_INT), 382 + REGMAP_IRQ_REG(TPS65224_IRQ_PB_RISE, 4, TPS65224_BIT_PB_RISE_INT), 383 + REGMAP_IRQ_REG(TPS65224_IRQ_ADC_CONV_READY, 4, TPS65224_BIT_ADC_CONV_READY_INT), 384 + 385 + /* INT_MODERATE_ERR register */ 386 + REGMAP_IRQ_REG(TPS65224_IRQ_TSD_ORD, 5, TPS6594_BIT_TSD_ORD_INT), 387 + REGMAP_IRQ_REG(TPS65224_IRQ_BIST_FAIL, 5, TPS6594_BIT_BIST_FAIL_INT), 388 + REGMAP_IRQ_REG(TPS65224_IRQ_REG_CRC_ERR, 5, TPS6594_BIT_REG_CRC_ERR_INT), 389 + REGMAP_IRQ_REG(TPS65224_IRQ_RECOV_CNT, 5, TPS6594_BIT_RECOV_CNT_INT), 390 + 391 + /* INT_SEVERE_ERR register */ 392 + REGMAP_IRQ_REG(TPS65224_IRQ_TSD_IMM, 6, TPS6594_BIT_TSD_IMM_INT), 393 + REGMAP_IRQ_REG(TPS65224_IRQ_VCCA_OVP, 6, TPS6594_BIT_VCCA_OVP_INT), 394 + REGMAP_IRQ_REG(TPS65224_IRQ_PFSM_ERR, 6, TPS6594_BIT_PFSM_ERR_INT), 395 + REGMAP_IRQ_REG(TPS65224_IRQ_BG_XMON, 6, TPS65224_BIT_BG_XMON_INT), 396 + 397 + /* INT_FSM_ERR register */ 398 + REGMAP_IRQ_REG(TPS65224_IRQ_IMM_SHUTDOWN, 7, TPS6594_BIT_IMM_SHUTDOWN_INT), 399 + REGMAP_IRQ_REG(TPS65224_IRQ_ORD_SHUTDOWN, 7, TPS6594_BIT_ORD_SHUTDOWN_INT), 400 + REGMAP_IRQ_REG(TPS65224_IRQ_MCU_PWR_ERR, 7, TPS6594_BIT_MCU_PWR_ERR_INT), 401 + REGMAP_IRQ_REG(TPS65224_IRQ_SOC_PWR_ERR, 7, TPS6594_BIT_SOC_PWR_ERR_INT), 402 + REGMAP_IRQ_REG(TPS65224_IRQ_COMM_ERR, 7, TPS6594_BIT_COMM_ERR_INT), 403 + REGMAP_IRQ_REG(TPS65224_IRQ_I2C2_ERR, 7, TPS65224_BIT_I2C2_ERR_INT), 404 + }; 405 + 406 + static const unsigned int tps65224_irq_reg[] = { 407 + TPS6594_REG_INT_BUCK, 408 + TPS6594_REG_INT_LDO_VMON, 409 + TPS6594_REG_INT_GPIO, 410 + TPS6594_REG_INT_STARTUP, 411 + TPS6594_REG_INT_MISC, 412 + TPS6594_REG_INT_MODERATE_ERR, 413 + TPS6594_REG_INT_SEVERE_ERR, 414 + TPS6594_REG_INT_FSM_ERR, 415 + }; 416 + 281 417 static inline unsigned int tps6594_get_irq_reg(struct regmap_irq_chip_data *data, 282 418 unsigned int base, int index) 283 419 { 284 420 return tps6594_irq_reg[index]; 285 421 }; 286 422 423 + static inline unsigned int tps65224_get_irq_reg(struct regmap_irq_chip_data *data, 424 + unsigned int base, int index) 425 + { 426 + return tps65224_irq_reg[index]; 427 + }; 428 + 287 429 static int tps6594_handle_post_irq(void *irq_drv_data) 288 430 { 289 431 struct tps6594 *tps = irq_drv_data; 290 432 int ret = 0; 433 + unsigned int regmap_reg, mask_val; 291 434 292 435 /* 293 436 * When CRC is enabled, writing to a read-only bit triggers an error, ··· 442 299 * COMM_ADR_ERR_INT bit set. Clear immediately this bit to avoid raising 443 300 * a new interrupt. 444 301 */ 445 - if (tps->use_crc) 446 - ret = regmap_write_bits(tps->regmap, TPS6594_REG_INT_COMM_ERR, 447 - TPS6594_BIT_COMM_ADR_ERR_INT, 448 - TPS6594_BIT_COMM_ADR_ERR_INT); 302 + if (tps->use_crc) { 303 + if (tps->chip_id == TPS65224) { 304 + regmap_reg = TPS6594_REG_INT_FSM_ERR; 305 + mask_val = TPS6594_BIT_COMM_ERR_INT; 306 + } else { 307 + regmap_reg = TPS6594_REG_INT_COMM_ERR; 308 + mask_val = TPS6594_BIT_COMM_ADR_ERR_INT; 309 + } 310 + 311 + ret = regmap_write_bits(tps->regmap, regmap_reg, mask_val, mask_val); 312 + } 449 313 450 314 return ret; 451 315 }; ··· 469 319 .handle_post_irq = tps6594_handle_post_irq, 470 320 }; 471 321 472 - bool tps6594_is_volatile_reg(struct device *dev, unsigned int reg) 473 - { 474 - return (reg >= TPS6594_REG_INT_TOP && reg <= TPS6594_REG_STAT_READBACK_ERR) || 475 - reg == TPS6594_REG_RTC_STATUS; 476 - } 477 - EXPORT_SYMBOL_GPL(tps6594_is_volatile_reg); 322 + static struct regmap_irq_chip tps65224_irq_chip = { 323 + .ack_base = TPS6594_REG_INT_BUCK, 324 + .ack_invert = 1, 325 + .clear_ack = 1, 326 + .init_ack_masked = 1, 327 + .num_regs = ARRAY_SIZE(tps65224_irq_reg), 328 + .irqs = tps65224_irqs, 329 + .num_irqs = ARRAY_SIZE(tps65224_irqs), 330 + .get_irq_reg = tps65224_get_irq_reg, 331 + .handle_post_irq = tps6594_handle_post_irq, 332 + }; 333 + 334 + static const struct regmap_range tps6594_volatile_ranges[] = { 335 + regmap_reg_range(TPS6594_REG_INT_TOP, TPS6594_REG_STAT_READBACK_ERR), 336 + regmap_reg_range(TPS6594_REG_RTC_STATUS, TPS6594_REG_RTC_STATUS), 337 + }; 338 + 339 + const struct regmap_access_table tps6594_volatile_table = { 340 + .yes_ranges = tps6594_volatile_ranges, 341 + .n_yes_ranges = ARRAY_SIZE(tps6594_volatile_ranges), 342 + }; 343 + EXPORT_SYMBOL_GPL(tps6594_volatile_table); 344 + 345 + static const struct regmap_range tps65224_volatile_ranges[] = { 346 + regmap_reg_range(TPS6594_REG_INT_TOP, TPS6594_REG_STAT_SEVERE_ERR), 347 + }; 348 + 349 + const struct regmap_access_table tps65224_volatile_table = { 350 + .yes_ranges = tps65224_volatile_ranges, 351 + .n_yes_ranges = ARRAY_SIZE(tps65224_volatile_ranges), 352 + }; 353 + EXPORT_SYMBOL_GPL(tps65224_volatile_table); 478 354 479 355 static int tps6594_check_crc_mode(struct tps6594 *tps, bool primary_pmic) 480 356 { 481 357 int ret; 358 + unsigned int regmap_reg, mask_val; 359 + 360 + if (tps->chip_id == TPS65224) { 361 + regmap_reg = TPS6594_REG_CONFIG_2; 362 + mask_val = TPS65224_BIT_I2C1_SPI_CRC_EN; 363 + } else { 364 + regmap_reg = TPS6594_REG_SERIAL_IF_CONFIG; 365 + mask_val = TPS6594_BIT_I2C1_SPI_CRC_EN; 366 + }; 482 367 483 368 /* 484 369 * Check if CRC is enabled. 485 370 * Once CRC is enabled, it can't be disabled until next power cycle. 486 371 */ 487 372 tps->use_crc = true; 488 - ret = regmap_test_bits(tps->regmap, TPS6594_REG_SERIAL_IF_CONFIG, 489 - TPS6594_BIT_I2C1_SPI_CRC_EN); 373 + ret = regmap_test_bits(tps->regmap, regmap_reg, mask_val); 490 374 if (ret == 0) { 491 375 ret = -EIO; 492 376 } else if (ret > 0) { ··· 535 351 static int tps6594_set_crc_feature(struct tps6594 *tps) 536 352 { 537 353 int ret; 354 + unsigned int regmap_reg, mask_val; 355 + 356 + if (tps->chip_id == TPS65224) { 357 + regmap_reg = TPS6594_REG_CONFIG_2; 358 + mask_val = TPS65224_BIT_I2C1_SPI_CRC_EN; 359 + } else { 360 + regmap_reg = TPS6594_REG_FSM_I2C_TRIGGERS; 361 + mask_val = TPS6594_BIT_TRIGGER_I2C(2); 362 + } 538 363 539 364 ret = tps6594_check_crc_mode(tps, true); 540 365 if (ret) { ··· 552 359 * on primary PMIC. 553 360 */ 554 361 tps->use_crc = false; 555 - ret = regmap_write_bits(tps->regmap, TPS6594_REG_FSM_I2C_TRIGGERS, 556 - TPS6594_BIT_TRIGGER_I2C(2), TPS6594_BIT_TRIGGER_I2C(2)); 362 + ret = regmap_write_bits(tps->regmap, regmap_reg, mask_val, mask_val); 557 363 if (ret) 558 364 return ret; 559 365 ··· 608 416 { 609 417 struct device *dev = tps->dev; 610 418 int ret; 419 + struct regmap_irq_chip *irq_chip; 420 + const struct mfd_cell *cells; 421 + int n_cells; 611 422 612 423 if (enable_crc) { 613 424 ret = tps6594_enable_crc(tps); ··· 624 429 if (ret) 625 430 return dev_err_probe(dev, ret, "Failed to set PMIC state\n"); 626 431 627 - tps6594_irq_chip.irq_drv_data = tps; 628 - tps6594_irq_chip.name = devm_kasprintf(dev, GFP_KERNEL, "%s-%ld-0x%02x", 629 - dev->driver->name, tps->chip_id, tps->reg); 432 + if (tps->chip_id == TPS65224) { 433 + irq_chip = &tps65224_irq_chip; 434 + n_cells = ARRAY_SIZE(tps65224_common_cells); 435 + cells = tps65224_common_cells; 436 + } else { 437 + irq_chip = &tps6594_irq_chip; 438 + n_cells = ARRAY_SIZE(tps6594_common_cells); 439 + cells = tps6594_common_cells; 440 + } 630 441 631 - if (!tps6594_irq_chip.name) 442 + irq_chip->irq_drv_data = tps; 443 + irq_chip->name = devm_kasprintf(dev, GFP_KERNEL, "%s-%ld-0x%02x", 444 + dev->driver->name, tps->chip_id, tps->reg); 445 + 446 + if (!irq_chip->name) 632 447 return -ENOMEM; 633 448 634 449 ret = devm_regmap_add_irq_chip(dev, tps->regmap, tps->irq, IRQF_SHARED | IRQF_ONESHOT, 635 - 0, &tps6594_irq_chip, &tps->irq_data); 450 + 0, irq_chip, &tps->irq_data); 636 451 if (ret) 637 452 return dev_err_probe(dev, ret, "Failed to add regmap IRQ\n"); 638 453 639 - ret = devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO, tps6594_common_cells, 640 - ARRAY_SIZE(tps6594_common_cells), NULL, 0, 454 + ret = devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO, cells, n_cells, NULL, 0, 641 455 regmap_irq_get_domain(tps->irq_data)); 642 456 if (ret) 643 457 return dev_err_probe(dev, ret, "Failed to add common child devices\n"); 644 458 645 - /* No RTC for LP8764 */ 646 - if (tps->chip_id != LP8764) { 459 + /* No RTC for LP8764 and TPS65224 */ 460 + if (tps->chip_id != LP8764 && tps->chip_id != TPS65224) { 647 461 ret = devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO, tps6594_rtc_cells, 648 462 ARRAY_SIZE(tps6594_rtc_cells), NULL, 0, 649 463 regmap_irq_get_domain(tps->irq_data)); ··· 665 461 EXPORT_SYMBOL_GPL(tps6594_device_init); 666 462 667 463 MODULE_AUTHOR("Julien Panis <jpanis@baylibre.com>"); 464 + MODULE_AUTHOR("Bhargav Raviprakash <bhargav.r@ltts.com"); 668 465 MODULE_DESCRIPTION("TPS6594 Driver"); 669 466 MODULE_LICENSE("GPL");
+12 -8
drivers/mfd/tps6594-i2c.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 /* 3 - * I2C access driver for TI TPS6594/TPS6593/LP8764 PMICs 3 + * I2C access driver for TI TPS65224/TPS6594/TPS6593/LP8764 PMICs 4 4 * 5 5 * Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/ 6 6 */ ··· 183 183 return ret; 184 184 } 185 185 186 - static const struct regmap_config tps6594_i2c_regmap_config = { 186 + static struct regmap_config tps6594_i2c_regmap_config = { 187 187 .reg_bits = 16, 188 188 .val_bits = 8, 189 189 .max_register = TPS6594_REG_DWD_FAIL_CNT_REG, 190 - .volatile_reg = tps6594_is_volatile_reg, 190 + .volatile_table = &tps6594_volatile_table, 191 191 .read = tps6594_i2c_read, 192 192 .write = tps6594_i2c_write, 193 193 }; ··· 196 196 { .compatible = "ti,tps6594-q1", .data = (void *)TPS6594, }, 197 197 { .compatible = "ti,tps6593-q1", .data = (void *)TPS6593, }, 198 198 { .compatible = "ti,lp8764-q1", .data = (void *)LP8764, }, 199 + { .compatible = "ti,tps65224-q1", .data = (void *)TPS65224, }, 199 200 {} 200 201 }; 201 202 MODULE_DEVICE_TABLE(of, tps6594_i2c_of_match_table); ··· 217 216 tps->reg = client->addr; 218 217 tps->irq = client->irq; 219 218 220 - tps->regmap = devm_regmap_init(dev, NULL, client, &tps6594_i2c_regmap_config); 221 - if (IS_ERR(tps->regmap)) 222 - return dev_err_probe(dev, PTR_ERR(tps->regmap), "Failed to init regmap\n"); 223 - 224 219 match = of_match_device(tps6594_i2c_of_match_table, dev); 225 220 if (!match) 226 221 return dev_err_probe(dev, -EINVAL, "Failed to find matching chip ID\n"); 227 222 tps->chip_id = (unsigned long)match->data; 223 + 224 + if (tps->chip_id == TPS65224) 225 + tps6594_i2c_regmap_config.volatile_table = &tps65224_volatile_table; 226 + 227 + tps->regmap = devm_regmap_init(dev, NULL, client, &tps6594_i2c_regmap_config); 228 + if (IS_ERR(tps->regmap)) 229 + return dev_err_probe(dev, PTR_ERR(tps->regmap), "Failed to init regmap\n"); 228 230 229 231 crc8_populate_msb(tps6594_i2c_crc_table, TPS6594_CRC8_POLYNOMIAL); 230 232 ··· 244 240 module_i2c_driver(tps6594_i2c_driver); 245 241 246 242 MODULE_AUTHOR("Julien Panis <jpanis@baylibre.com>"); 247 - MODULE_DESCRIPTION("TPS6594 I2C Interface Driver"); 243 + MODULE_DESCRIPTION("I2C Interface Driver for TPS65224, TPS6594/3, and LP8764"); 248 244 MODULE_LICENSE("GPL");
+12 -8
drivers/mfd/tps6594-spi.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 /* 3 - * SPI access driver for TI TPS6594/TPS6593/LP8764 PMICs 3 + * SPI access driver for TI TPS65224/TPS6594/TPS6593/LP8764 PMICs 4 4 * 5 5 * Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/ 6 6 */ ··· 66 66 return spi_write(spi, buf, count); 67 67 } 68 68 69 - static const struct regmap_config tps6594_spi_regmap_config = { 69 + static struct regmap_config tps6594_spi_regmap_config = { 70 70 .reg_bits = 16, 71 71 .val_bits = 8, 72 72 .max_register = TPS6594_REG_DWD_FAIL_CNT_REG, 73 - .volatile_reg = tps6594_is_volatile_reg, 73 + .volatile_table = &tps6594_volatile_table, 74 74 .reg_read = tps6594_spi_reg_read, 75 75 .reg_write = tps6594_spi_reg_write, 76 76 .use_single_read = true, ··· 81 81 { .compatible = "ti,tps6594-q1", .data = (void *)TPS6594, }, 82 82 { .compatible = "ti,tps6593-q1", .data = (void *)TPS6593, }, 83 83 { .compatible = "ti,lp8764-q1", .data = (void *)LP8764, }, 84 + { .compatible = "ti,tps65224-q1", .data = (void *)TPS65224, }, 84 85 {} 85 86 }; 86 87 MODULE_DEVICE_TABLE(of, tps6594_spi_of_match_table); ··· 102 101 tps->reg = spi_get_chipselect(spi, 0); 103 102 tps->irq = spi->irq; 104 103 105 - tps->regmap = devm_regmap_init(dev, NULL, spi, &tps6594_spi_regmap_config); 106 - if (IS_ERR(tps->regmap)) 107 - return dev_err_probe(dev, PTR_ERR(tps->regmap), "Failed to init regmap\n"); 108 - 109 104 match = of_match_device(tps6594_spi_of_match_table, dev); 110 105 if (!match) 111 106 return dev_err_probe(dev, -EINVAL, "Failed to find matching chip ID\n"); 112 107 tps->chip_id = (unsigned long)match->data; 108 + 109 + if (tps->chip_id == TPS65224) 110 + tps6594_spi_regmap_config.volatile_table = &tps65224_volatile_table; 111 + 112 + tps->regmap = devm_regmap_init(dev, NULL, spi, &tps6594_spi_regmap_config); 113 + if (IS_ERR(tps->regmap)) 114 + return dev_err_probe(dev, PTR_ERR(tps->regmap), "Failed to init regmap\n"); 113 115 114 116 crc8_populate_msb(tps6594_spi_crc_table, TPS6594_CRC8_POLYNOMIAL); 115 117 ··· 129 125 module_spi_driver(tps6594_spi_driver); 130 126 131 127 MODULE_AUTHOR("Julien Panis <jpanis@baylibre.com>"); 132 - MODULE_DESCRIPTION("TPS6594 SPI Interface Driver"); 128 + MODULE_DESCRIPTION("SPI Interface Driver for TPS65224, TPS6594/3, and LP8764"); 133 129 MODULE_LICENSE("GPL");
+35 -13
drivers/misc/tps6594-pfsm.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 /* 3 - * PFSM (Pre-configurable Finite State Machine) driver for TI TPS6594/TPS6593/LP8764 PMICs 3 + * PFSM (Pre-configurable Finite State Machine) driver for TI TPS65224/TPS6594/TPS6593/LP8764 PMICs 4 4 * 5 5 * Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/ 6 6 */ ··· 39 39 * 40 40 * @miscdev: misc device infos 41 41 * @regmap: regmap for accessing the device registers 42 + * @chip_id: chip identifier of the device 42 43 */ 43 44 struct tps6594_pfsm { 44 45 struct miscdevice miscdev; 45 46 struct regmap *regmap; 47 + unsigned long chip_id; 46 48 }; 47 49 48 50 static ssize_t tps6594_pfsm_read(struct file *f, char __user *buf, ··· 135 133 struct tps6594_pfsm *pfsm = TPS6594_FILE_TO_PFSM(f); 136 134 struct pmic_state_opt state_opt; 137 135 void __user *argp = (void __user *)arg; 136 + unsigned int regmap_reg, mask; 138 137 int ret = -ENOIOCTLCMD; 139 138 140 139 switch (cmd) { 141 140 case PMIC_GOTO_STANDBY: 142 - /* Disable LP mode */ 143 - ret = regmap_clear_bits(pfsm->regmap, TPS6594_REG_RTC_CTRL_2, 144 - TPS6594_BIT_LP_STANDBY_SEL); 145 - if (ret) 146 - return ret; 141 + /* Disable LP mode on TPS6594 Family PMIC */ 142 + if (pfsm->chip_id != TPS65224) { 143 + ret = regmap_clear_bits(pfsm->regmap, TPS6594_REG_RTC_CTRL_2, 144 + TPS6594_BIT_LP_STANDBY_SEL); 145 + 146 + if (ret) 147 + return ret; 148 + } 147 149 148 150 /* Force trigger */ 149 151 ret = regmap_write_bits(pfsm->regmap, TPS6594_REG_FSM_I2C_TRIGGERS, 150 152 TPS6594_BIT_TRIGGER_I2C(0), TPS6594_BIT_TRIGGER_I2C(0)); 151 153 break; 152 154 case PMIC_GOTO_LP_STANDBY: 155 + /* TPS65224 does not support LP STANDBY */ 156 + if (pfsm->chip_id == TPS65224) 157 + return ret; 158 + 153 159 /* Enable LP mode */ 154 160 ret = regmap_set_bits(pfsm->regmap, TPS6594_REG_RTC_CTRL_2, 155 161 TPS6594_BIT_LP_STANDBY_SEL); ··· 179 169 TPS6594_BIT_NSLEEP1B | TPS6594_BIT_NSLEEP2B); 180 170 break; 181 171 case PMIC_SET_MCU_ONLY_STATE: 172 + /* TPS65224 does not support MCU_ONLY_STATE */ 173 + if (pfsm->chip_id == TPS65224) 174 + return ret; 175 + 182 176 if (copy_from_user(&state_opt, argp, sizeof(state_opt))) 183 177 return -EFAULT; 184 178 ··· 206 192 return -EFAULT; 207 193 208 194 /* Configure wake-up destination */ 195 + if (pfsm->chip_id == TPS65224) { 196 + regmap_reg = TPS65224_REG_STARTUP_CTRL; 197 + mask = TPS65224_MASK_STARTUP_DEST; 198 + } else { 199 + regmap_reg = TPS6594_REG_RTC_CTRL_2; 200 + mask = TPS6594_MASK_STARTUP_DEST; 201 + } 202 + 209 203 if (state_opt.mcu_only_startup_dest) 210 - ret = regmap_write_bits(pfsm->regmap, TPS6594_REG_RTC_CTRL_2, 211 - TPS6594_MASK_STARTUP_DEST, 212 - TPS6594_STARTUP_DEST_MCU_ONLY); 204 + ret = regmap_write_bits(pfsm->regmap, regmap_reg, 205 + mask, TPS6594_STARTUP_DEST_MCU_ONLY); 213 206 else 214 - ret = regmap_write_bits(pfsm->regmap, TPS6594_REG_RTC_CTRL_2, 215 - TPS6594_MASK_STARTUP_DEST, 216 - TPS6594_STARTUP_DEST_ACTIVE); 207 + ret = regmap_write_bits(pfsm->regmap, regmap_reg, 208 + mask, TPS6594_STARTUP_DEST_ACTIVE); 217 209 if (ret) 218 210 return ret; 219 211 ··· 231 211 232 212 /* Modify NSLEEP1-2 bits */ 233 213 ret = regmap_clear_bits(pfsm->regmap, TPS6594_REG_FSM_NSLEEP_TRIGGERS, 234 - TPS6594_BIT_NSLEEP2B); 214 + pfsm->chip_id == TPS65224 ? 215 + TPS6594_BIT_NSLEEP1B : TPS6594_BIT_NSLEEP2B); 235 216 break; 236 217 } 237 218 ··· 283 262 tps->chip_id, tps->reg); 284 263 pfsm->miscdev.fops = &tps6594_pfsm_fops; 285 264 pfsm->miscdev.parent = dev->parent; 265 + pfsm->chip_id = tps->chip_id; 286 266 287 267 for (i = 0 ; i < pdev->num_resources ; i++) { 288 268 irq = platform_get_irq_byname(pdev, pdev->resource[i].name);
+69
drivers/pinctrl/pinctrl-rk805.c
··· 93 93 RK806_PINMUX_FUN5, 94 94 }; 95 95 96 + enum rk816_pinmux_option { 97 + RK816_PINMUX_THERMISTOR, 98 + RK816_PINMUX_GPIO, 99 + }; 100 + 96 101 enum { 97 102 RK805_GPIO0, 98 103 RK805_GPIO1, ··· 107 102 RK806_GPIO_DVS1, 108 103 RK806_GPIO_DVS2, 109 104 RK806_GPIO_DVS3 105 + }; 106 + 107 + enum { 108 + RK816_GPIO0, 110 109 }; 111 110 112 111 static const char *const rk805_gpio_groups[] = { ··· 124 115 "gpio_pwrctrl3", 125 116 }; 126 117 118 + static const char *const rk816_gpio_groups[] = { 119 + "gpio0", 120 + }; 121 + 127 122 /* RK805: 2 output only GPIOs */ 128 123 static const struct pinctrl_pin_desc rk805_pins_desc[] = { 129 124 PINCTRL_PIN(RK805_GPIO0, "gpio0"), ··· 139 126 PINCTRL_PIN(RK806_GPIO_DVS1, "gpio_pwrctrl1"), 140 127 PINCTRL_PIN(RK806_GPIO_DVS2, "gpio_pwrctrl2"), 141 128 PINCTRL_PIN(RK806_GPIO_DVS3, "gpio_pwrctrl3"), 129 + }; 130 + 131 + /* RK816 */ 132 + static const struct pinctrl_pin_desc rk816_pins_desc[] = { 133 + PINCTRL_PIN(RK816_GPIO0, "gpio0"), 142 134 }; 143 135 144 136 static const struct rk805_pin_function rk805_pin_functions[] = { ··· 194 176 }, 195 177 }; 196 178 179 + static const struct rk805_pin_function rk816_pin_functions[] = { 180 + { 181 + .name = "gpio", 182 + .groups = rk816_gpio_groups, 183 + .ngroups = ARRAY_SIZE(rk816_gpio_groups), 184 + .mux_option = RK816_PINMUX_GPIO, 185 + }, 186 + { 187 + .name = "thermistor", 188 + .groups = rk816_gpio_groups, 189 + .ngroups = ARRAY_SIZE(rk816_gpio_groups), 190 + .mux_option = RK816_PINMUX_THERMISTOR, 191 + }, 192 + }; 193 + 197 194 static const struct rk805_pin_group rk805_pin_groups[] = { 198 195 { 199 196 .name = "gpio0", ··· 238 205 .pins = { RK806_GPIO_DVS3 }, 239 206 .npins = 1, 240 207 } 208 + }; 209 + 210 + static const struct rk805_pin_group rk816_pin_groups[] = { 211 + { 212 + .name = "gpio0", 213 + .pins = { RK816_GPIO0 }, 214 + .npins = 1, 215 + }, 241 216 }; 242 217 243 218 #define RK805_GPIO0_VAL_MSK BIT(0) ··· 294 253 .val_msk = RK806_PWRCTRL3_DATA, 295 254 .dir_msk = RK806_PWRCTRL3_DR, 296 255 } 256 + }; 257 + 258 + #define RK816_FUN_MASK BIT(2) 259 + #define RK816_VAL_MASK BIT(3) 260 + #define RK816_DIR_MASK BIT(4) 261 + 262 + static struct rk805_pin_config rk816_gpio_cfgs[] = { 263 + { 264 + .fun_reg = RK818_IO_POL_REG, 265 + .fun_msk = RK816_FUN_MASK, 266 + .reg = RK818_IO_POL_REG, 267 + .val_msk = RK816_VAL_MASK, 268 + .dir_msk = RK816_DIR_MASK, 269 + }, 297 270 }; 298 271 299 272 /* generic gpio chip */ ··· 494 439 return _rk805_pinctrl_set_mux(pctldev, offset, RK805_PINMUX_GPIO); 495 440 case RK806_ID: 496 441 return _rk805_pinctrl_set_mux(pctldev, offset, RK806_PINMUX_FUN5); 442 + case RK816_ID: 443 + return _rk805_pinctrl_set_mux(pctldev, offset, RK816_PINMUX_GPIO); 497 444 } 498 445 499 446 return -ENOTSUPP; ··· 644 587 pci->pinctrl_desc.npins = ARRAY_SIZE(rk806_pins_desc); 645 588 pci->pin_cfg = rk806_gpio_cfgs; 646 589 pci->gpio_chip.ngpio = ARRAY_SIZE(rk806_gpio_cfgs); 590 + break; 591 + case RK816_ID: 592 + pci->pins = rk816_pins_desc; 593 + pci->num_pins = ARRAY_SIZE(rk816_pins_desc); 594 + pci->functions = rk816_pin_functions; 595 + pci->num_functions = ARRAY_SIZE(rk816_pin_functions); 596 + pci->groups = rk816_pin_groups; 597 + pci->num_pin_groups = ARRAY_SIZE(rk816_pin_groups); 598 + pci->pinctrl_desc.pins = rk816_pins_desc; 599 + pci->pinctrl_desc.npins = ARRAY_SIZE(rk816_pins_desc); 600 + pci->pin_cfg = rk816_gpio_cfgs; 601 + pci->gpio_chip.ngpio = ARRAY_SIZE(rk816_gpio_cfgs); 647 602 break; 648 603 default: 649 604 dev_err(&pdev->dev, "unsupported RK805 ID %lu\n",
+224 -51
drivers/pinctrl/pinctrl-tps6594.c
··· 14 14 15 15 #include <linux/mfd/tps6594.h> 16 16 17 - #define TPS6594_PINCTRL_PINS_NB 11 18 - 19 17 #define TPS6594_PINCTRL_GPIO_FUNCTION 0 20 18 #define TPS6594_PINCTRL_SCL_I2C2_CS_SPI_FUNCTION 1 21 19 #define TPS6594_PINCTRL_TRIG_WDOG_FUNCTION 1 ··· 38 40 #define TPS6594_PINCTRL_SYNCCLKOUT_FUNCTION_GPIO8 3 39 41 #define TPS6594_PINCTRL_CLK32KOUT_FUNCTION_GPIO9 3 40 42 43 + /* TPS65224 pin muxval */ 44 + #define TPS65224_PINCTRL_SDA_I2C2_SDO_SPI_FUNCTION 1 45 + #define TPS65224_PINCTRL_SCL_I2C2_CS_SPI_FUNCTION 1 46 + #define TPS65224_PINCTRL_VMON1_FUNCTION 1 47 + #define TPS65224_PINCTRL_VMON2_FUNCTION 1 48 + #define TPS65224_PINCTRL_WKUP_FUNCTION 1 49 + #define TPS65224_PINCTRL_NSLEEP2_FUNCTION 2 50 + #define TPS65224_PINCTRL_NSLEEP1_FUNCTION 2 51 + #define TPS65224_PINCTRL_SYNCCLKIN_FUNCTION 2 52 + #define TPS65224_PINCTRL_NERR_MCU_FUNCTION 2 53 + #define TPS65224_PINCTRL_NINT_FUNCTION 3 54 + #define TPS65224_PINCTRL_TRIG_WDOG_FUNCTION 3 55 + #define TPS65224_PINCTRL_PB_FUNCTION 3 56 + #define TPS65224_PINCTRL_ADC_IN_FUNCTION 3 57 + 58 + /* TPS65224 Special muxval for recalcitrant pins */ 59 + #define TPS65224_PINCTRL_NSLEEP2_FUNCTION_GPIO5 1 60 + #define TPS65224_PINCTRL_WKUP_FUNCTION_GPIO5 4 61 + #define TPS65224_PINCTRL_SYNCCLKIN_FUNCTION_GPIO5 3 62 + 41 63 #define TPS6594_OFFSET_GPIO_SEL 5 42 64 43 - #define FUNCTION(fname, v) \ 65 + #define TPS65224_NGPIO_PER_REG 6 66 + #define TPS6594_NGPIO_PER_REG 8 67 + 68 + #define FUNCTION(dev_name, fname, v) \ 44 69 { \ 45 70 .pinfunction = PINCTRL_PINFUNCTION(#fname, \ 46 - tps6594_##fname##_func_group_names, \ 47 - ARRAY_SIZE(tps6594_##fname##_func_group_names)),\ 71 + dev_name##_##fname##_func_group_names, \ 72 + ARRAY_SIZE(dev_name##_##fname##_func_group_names)),\ 48 73 .muxval = v, \ 49 74 } 50 75 51 - static const struct pinctrl_pin_desc tps6594_pins[TPS6594_PINCTRL_PINS_NB] = { 76 + static const struct pinctrl_pin_desc tps6594_pins[] = { 52 77 PINCTRL_PIN(0, "GPIO0"), PINCTRL_PIN(1, "GPIO1"), 53 78 PINCTRL_PIN(2, "GPIO2"), PINCTRL_PIN(3, "GPIO3"), 54 79 PINCTRL_PIN(4, "GPIO4"), PINCTRL_PIN(5, "GPIO5"), ··· 164 143 "GPIO9", 165 144 }; 166 145 146 + static const struct pinctrl_pin_desc tps65224_pins[] = { 147 + PINCTRL_PIN(0, "GPIO0"), PINCTRL_PIN(1, "GPIO1"), 148 + PINCTRL_PIN(2, "GPIO2"), PINCTRL_PIN(3, "GPIO3"), 149 + PINCTRL_PIN(4, "GPIO4"), PINCTRL_PIN(5, "GPIO5"), 150 + }; 151 + 152 + static const char *const tps65224_gpio_func_group_names[] = { 153 + "GPIO0", "GPIO1", "GPIO2", "GPIO3", "GPIO4", "GPIO5", 154 + }; 155 + 156 + static const char *const tps65224_sda_i2c2_sdo_spi_func_group_names[] = { 157 + "GPIO0", 158 + }; 159 + 160 + static const char *const tps65224_nsleep2_func_group_names[] = { 161 + "GPIO0", "GPIO5", 162 + }; 163 + 164 + static const char *const tps65224_nint_func_group_names[] = { 165 + "GPIO0", 166 + }; 167 + 168 + static const char *const tps65224_scl_i2c2_cs_spi_func_group_names[] = { 169 + "GPIO1", 170 + }; 171 + 172 + static const char *const tps65224_nsleep1_func_group_names[] = { 173 + "GPIO1", "GPIO2", "GPIO3", 174 + }; 175 + 176 + static const char *const tps65224_trig_wdog_func_group_names[] = { 177 + "GPIO1", 178 + }; 179 + 180 + static const char *const tps65224_vmon1_func_group_names[] = { 181 + "GPIO2", 182 + }; 183 + 184 + static const char *const tps65224_pb_func_group_names[] = { 185 + "GPIO2", 186 + }; 187 + 188 + static const char *const tps65224_vmon2_func_group_names[] = { 189 + "GPIO3", 190 + }; 191 + 192 + static const char *const tps65224_adc_in_func_group_names[] = { 193 + "GPIO3", "GPIO4", 194 + }; 195 + 196 + static const char *const tps65224_wkup_func_group_names[] = { 197 + "GPIO4", "GPIO5", 198 + }; 199 + 200 + static const char *const tps65224_syncclkin_func_group_names[] = { 201 + "GPIO4", "GPIO5", 202 + }; 203 + 204 + static const char *const tps65224_nerr_mcu_func_group_names[] = { 205 + "GPIO5", 206 + }; 207 + 167 208 struct tps6594_pinctrl_function { 168 209 struct pinfunction pinfunction; 169 210 u8 muxval; 170 211 }; 171 212 213 + struct muxval_remap { 214 + unsigned int group; 215 + u8 muxval; 216 + u8 remap; 217 + }; 218 + 219 + struct muxval_remap tps65224_muxval_remap[] = { 220 + {5, TPS6594_PINCTRL_DISABLE_WDOG_FUNCTION, TPS65224_PINCTRL_WKUP_FUNCTION_GPIO5}, 221 + {5, TPS65224_PINCTRL_SYNCCLKIN_FUNCTION, TPS65224_PINCTRL_SYNCCLKIN_FUNCTION_GPIO5}, 222 + {5, TPS65224_PINCTRL_NSLEEP2_FUNCTION, TPS65224_PINCTRL_NSLEEP2_FUNCTION_GPIO5}, 223 + }; 224 + 225 + struct muxval_remap tps6594_muxval_remap[] = { 226 + {8, TPS6594_PINCTRL_DISABLE_WDOG_FUNCTION, TPS6594_PINCTRL_DISABLE_WDOG_FUNCTION_GPIO8}, 227 + {8, TPS6594_PINCTRL_SYNCCLKOUT_FUNCTION, TPS6594_PINCTRL_SYNCCLKOUT_FUNCTION_GPIO8}, 228 + {9, TPS6594_PINCTRL_CLK32KOUT_FUNCTION, TPS6594_PINCTRL_CLK32KOUT_FUNCTION_GPIO9}, 229 + }; 230 + 172 231 static const struct tps6594_pinctrl_function pinctrl_functions[] = { 173 - FUNCTION(gpio, TPS6594_PINCTRL_GPIO_FUNCTION), 174 - FUNCTION(nsleep1, TPS6594_PINCTRL_NSLEEP1_FUNCTION), 175 - FUNCTION(nsleep2, TPS6594_PINCTRL_NSLEEP2_FUNCTION), 176 - FUNCTION(wkup1, TPS6594_PINCTRL_WKUP1_FUNCTION), 177 - FUNCTION(wkup2, TPS6594_PINCTRL_WKUP2_FUNCTION), 178 - FUNCTION(scl_i2c2_cs_spi, TPS6594_PINCTRL_SCL_I2C2_CS_SPI_FUNCTION), 179 - FUNCTION(nrstout_soc, TPS6594_PINCTRL_NRSTOUT_SOC_FUNCTION), 180 - FUNCTION(trig_wdog, TPS6594_PINCTRL_TRIG_WDOG_FUNCTION), 181 - FUNCTION(sda_i2c2_sdo_spi, TPS6594_PINCTRL_SDA_I2C2_SDO_SPI_FUNCTION), 182 - FUNCTION(clk32kout, TPS6594_PINCTRL_CLK32KOUT_FUNCTION), 183 - FUNCTION(nerr_soc, TPS6594_PINCTRL_NERR_SOC_FUNCTION), 184 - FUNCTION(sclk_spmi, TPS6594_PINCTRL_SCLK_SPMI_FUNCTION), 185 - FUNCTION(sdata_spmi, TPS6594_PINCTRL_SDATA_SPMI_FUNCTION), 186 - FUNCTION(nerr_mcu, TPS6594_PINCTRL_NERR_MCU_FUNCTION), 187 - FUNCTION(syncclkout, TPS6594_PINCTRL_SYNCCLKOUT_FUNCTION), 188 - FUNCTION(disable_wdog, TPS6594_PINCTRL_DISABLE_WDOG_FUNCTION), 189 - FUNCTION(pdog, TPS6594_PINCTRL_PDOG_FUNCTION), 190 - FUNCTION(syncclkin, TPS6594_PINCTRL_SYNCCLKIN_FUNCTION), 232 + FUNCTION(tps6594, gpio, TPS6594_PINCTRL_GPIO_FUNCTION), 233 + FUNCTION(tps6594, nsleep1, TPS6594_PINCTRL_NSLEEP1_FUNCTION), 234 + FUNCTION(tps6594, nsleep2, TPS6594_PINCTRL_NSLEEP2_FUNCTION), 235 + FUNCTION(tps6594, wkup1, TPS6594_PINCTRL_WKUP1_FUNCTION), 236 + FUNCTION(tps6594, wkup2, TPS6594_PINCTRL_WKUP2_FUNCTION), 237 + FUNCTION(tps6594, scl_i2c2_cs_spi, TPS6594_PINCTRL_SCL_I2C2_CS_SPI_FUNCTION), 238 + FUNCTION(tps6594, nrstout_soc, TPS6594_PINCTRL_NRSTOUT_SOC_FUNCTION), 239 + FUNCTION(tps6594, trig_wdog, TPS6594_PINCTRL_TRIG_WDOG_FUNCTION), 240 + FUNCTION(tps6594, sda_i2c2_sdo_spi, TPS6594_PINCTRL_SDA_I2C2_SDO_SPI_FUNCTION), 241 + FUNCTION(tps6594, clk32kout, TPS6594_PINCTRL_CLK32KOUT_FUNCTION), 242 + FUNCTION(tps6594, nerr_soc, TPS6594_PINCTRL_NERR_SOC_FUNCTION), 243 + FUNCTION(tps6594, sclk_spmi, TPS6594_PINCTRL_SCLK_SPMI_FUNCTION), 244 + FUNCTION(tps6594, sdata_spmi, TPS6594_PINCTRL_SDATA_SPMI_FUNCTION), 245 + FUNCTION(tps6594, nerr_mcu, TPS6594_PINCTRL_NERR_MCU_FUNCTION), 246 + FUNCTION(tps6594, syncclkout, TPS6594_PINCTRL_SYNCCLKOUT_FUNCTION), 247 + FUNCTION(tps6594, disable_wdog, TPS6594_PINCTRL_DISABLE_WDOG_FUNCTION), 248 + FUNCTION(tps6594, pdog, TPS6594_PINCTRL_PDOG_FUNCTION), 249 + FUNCTION(tps6594, syncclkin, TPS6594_PINCTRL_SYNCCLKIN_FUNCTION), 250 + }; 251 + 252 + static const struct tps6594_pinctrl_function tps65224_pinctrl_functions[] = { 253 + FUNCTION(tps65224, gpio, TPS6594_PINCTRL_GPIO_FUNCTION), 254 + FUNCTION(tps65224, sda_i2c2_sdo_spi, TPS65224_PINCTRL_SDA_I2C2_SDO_SPI_FUNCTION), 255 + FUNCTION(tps65224, nsleep2, TPS65224_PINCTRL_NSLEEP2_FUNCTION), 256 + FUNCTION(tps65224, nint, TPS65224_PINCTRL_NINT_FUNCTION), 257 + FUNCTION(tps65224, scl_i2c2_cs_spi, TPS65224_PINCTRL_SCL_I2C2_CS_SPI_FUNCTION), 258 + FUNCTION(tps65224, nsleep1, TPS65224_PINCTRL_NSLEEP1_FUNCTION), 259 + FUNCTION(tps65224, trig_wdog, TPS65224_PINCTRL_TRIG_WDOG_FUNCTION), 260 + FUNCTION(tps65224, vmon1, TPS65224_PINCTRL_VMON1_FUNCTION), 261 + FUNCTION(tps65224, pb, TPS65224_PINCTRL_PB_FUNCTION), 262 + FUNCTION(tps65224, vmon2, TPS65224_PINCTRL_VMON2_FUNCTION), 263 + FUNCTION(tps65224, adc_in, TPS65224_PINCTRL_ADC_IN_FUNCTION), 264 + FUNCTION(tps65224, wkup, TPS65224_PINCTRL_WKUP_FUNCTION), 265 + FUNCTION(tps65224, syncclkin, TPS65224_PINCTRL_SYNCCLKIN_FUNCTION), 266 + FUNCTION(tps65224, nerr_mcu, TPS65224_PINCTRL_NERR_MCU_FUNCTION), 191 267 }; 192 268 193 269 struct tps6594_pinctrl { ··· 293 175 struct pinctrl_dev *pctl_dev; 294 176 const struct tps6594_pinctrl_function *funcs; 295 177 const struct pinctrl_pin_desc *pins; 178 + int func_cnt; 179 + int num_pins; 180 + u8 mux_sel_mask; 181 + unsigned int remap_cnt; 182 + struct muxval_remap *remap; 183 + }; 184 + 185 + static struct tps6594_pinctrl tps65224_template_pinctrl = { 186 + .funcs = tps65224_pinctrl_functions, 187 + .func_cnt = ARRAY_SIZE(tps65224_pinctrl_functions), 188 + .pins = tps65224_pins, 189 + .num_pins = ARRAY_SIZE(tps65224_pins), 190 + .mux_sel_mask = TPS65224_MASK_GPIO_SEL, 191 + .remap = tps65224_muxval_remap, 192 + .remap_cnt = ARRAY_SIZE(tps65224_muxval_remap), 193 + }; 194 + 195 + static struct tps6594_pinctrl tps6594_template_pinctrl = { 196 + .funcs = pinctrl_functions, 197 + .func_cnt = ARRAY_SIZE(pinctrl_functions), 198 + .pins = tps6594_pins, 199 + .num_pins = ARRAY_SIZE(tps6594_pins), 200 + .mux_sel_mask = TPS6594_MASK_GPIO_SEL, 201 + .remap = tps6594_muxval_remap, 202 + .remap_cnt = ARRAY_SIZE(tps6594_muxval_remap), 296 203 }; 297 204 298 205 static int tps6594_gpio_regmap_xlate(struct gpio_regmap *gpio, ··· 344 201 345 202 static int tps6594_pmx_func_cnt(struct pinctrl_dev *pctldev) 346 203 { 347 - return ARRAY_SIZE(pinctrl_functions); 204 + struct tps6594_pinctrl *pinctrl = pinctrl_dev_get_drvdata(pctldev); 205 + 206 + return pinctrl->func_cnt; 348 207 } 349 208 350 209 static const char *tps6594_pmx_func_name(struct pinctrl_dev *pctldev, ··· 374 229 u8 muxval) 375 230 { 376 231 u8 mux_sel_val = muxval << TPS6594_OFFSET_GPIO_SEL; 232 + u8 mux_sel_mask = pinctrl->mux_sel_mask; 233 + 234 + if (pinctrl->tps->chip_id == TPS65224 && pin == 5) { 235 + /* GPIO6 has a different mask in TPS65224*/ 236 + mux_sel_mask = TPS65224_MASK_GPIO_SEL_GPIO6; 237 + } 377 238 378 239 return regmap_update_bits(pinctrl->tps->regmap, 379 240 TPS6594_REG_GPIOX_CONF(pin), 380 - TPS6594_MASK_GPIO_SEL, mux_sel_val); 241 + mux_sel_mask, mux_sel_val); 381 242 } 382 243 383 244 static int tps6594_pmx_set_mux(struct pinctrl_dev *pctldev, ··· 391 240 { 392 241 struct tps6594_pinctrl *pinctrl = pinctrl_dev_get_drvdata(pctldev); 393 242 u8 muxval = pinctrl->funcs[function].muxval; 243 + unsigned int remap_cnt = pinctrl->remap_cnt; 244 + struct muxval_remap *remap = pinctrl->remap; 394 245 395 - /* Some pins don't have the same muxval for the same function... */ 396 - if (group == 8) { 397 - if (muxval == TPS6594_PINCTRL_DISABLE_WDOG_FUNCTION) 398 - muxval = TPS6594_PINCTRL_DISABLE_WDOG_FUNCTION_GPIO8; 399 - else if (muxval == TPS6594_PINCTRL_SYNCCLKOUT_FUNCTION) 400 - muxval = TPS6594_PINCTRL_SYNCCLKOUT_FUNCTION_GPIO8; 401 - } else if (group == 9) { 402 - if (muxval == TPS6594_PINCTRL_CLK32KOUT_FUNCTION) 403 - muxval = TPS6594_PINCTRL_CLK32KOUT_FUNCTION_GPIO9; 246 + for (unsigned int i = 0; i < remap_cnt; i++) { 247 + if (group == remap[i].group && muxval == remap[i].muxval) { 248 + muxval = remap[i].remap; 249 + break; 250 + } 404 251 } 405 252 406 253 return tps6594_pmx_set(pinctrl, group, muxval); ··· 425 276 426 277 static int tps6594_groups_cnt(struct pinctrl_dev *pctldev) 427 278 { 428 - return ARRAY_SIZE(tps6594_pins); 279 + struct tps6594_pinctrl *pinctrl = pinctrl_dev_get_drvdata(pctldev); 280 + 281 + return pinctrl->num_pins; 429 282 } 430 283 431 284 static int tps6594_group_pins(struct pinctrl_dev *pctldev, ··· 469 318 pctrl_desc = devm_kzalloc(dev, sizeof(*pctrl_desc), GFP_KERNEL); 470 319 if (!pctrl_desc) 471 320 return -ENOMEM; 472 - pctrl_desc->name = dev_name(dev); 473 - pctrl_desc->owner = THIS_MODULE; 474 - pctrl_desc->pins = tps6594_pins; 475 - pctrl_desc->npins = ARRAY_SIZE(tps6594_pins); 476 - pctrl_desc->pctlops = &tps6594_pctrl_ops; 477 - pctrl_desc->pmxops = &tps6594_pmx_ops; 478 321 479 322 pinctrl = devm_kzalloc(dev, sizeof(*pinctrl), GFP_KERNEL); 480 323 if (!pinctrl) 481 324 return -ENOMEM; 482 - pinctrl->tps = dev_get_drvdata(dev->parent); 483 - pinctrl->funcs = pinctrl_functions; 484 - pinctrl->pins = tps6594_pins; 485 - pinctrl->pctl_dev = devm_pinctrl_register(dev, pctrl_desc, pinctrl); 486 - if (IS_ERR(pinctrl->pctl_dev)) 487 - return dev_err_probe(dev, PTR_ERR(pinctrl->pctl_dev), 488 - "Couldn't register pinctrl driver\n"); 325 + 326 + switch (tps->chip_id) { 327 + case TPS65224: 328 + pctrl_desc->pins = tps65224_pins; 329 + pctrl_desc->npins = ARRAY_SIZE(tps65224_pins); 330 + 331 + *pinctrl = tps65224_template_pinctrl; 332 + 333 + config.ngpio = ARRAY_SIZE(tps65224_gpio_func_group_names); 334 + config.ngpio_per_reg = TPS65224_NGPIO_PER_REG; 335 + break; 336 + case TPS6593: 337 + case TPS6594: 338 + pctrl_desc->pins = tps6594_pins; 339 + pctrl_desc->npins = ARRAY_SIZE(tps6594_pins); 340 + 341 + *pinctrl = tps6594_template_pinctrl; 342 + 343 + config.ngpio = ARRAY_SIZE(tps6594_gpio_func_group_names); 344 + config.ngpio_per_reg = TPS6594_NGPIO_PER_REG; 345 + break; 346 + default: 347 + break; 348 + } 349 + 350 + pinctrl->tps = tps; 351 + 352 + pctrl_desc->name = dev_name(dev); 353 + pctrl_desc->owner = THIS_MODULE; 354 + pctrl_desc->pctlops = &tps6594_pctrl_ops; 355 + pctrl_desc->pmxops = &tps6594_pmx_ops; 489 356 490 357 config.parent = tps->dev; 491 358 config.regmap = tps->regmap; 492 - config.ngpio = TPS6594_PINCTRL_PINS_NB; 493 - config.ngpio_per_reg = 8; 494 359 config.reg_dat_base = TPS6594_REG_GPIO_IN_1; 495 360 config.reg_set_base = TPS6594_REG_GPIO_OUT_1; 496 361 config.reg_dir_out_base = TPS6594_REG_GPIOX_CONF(0); 497 362 config.reg_mask_xlate = tps6594_gpio_regmap_xlate; 363 + 364 + pinctrl->pctl_dev = devm_pinctrl_register(dev, pctrl_desc, pinctrl); 365 + if (IS_ERR(pinctrl->pctl_dev)) 366 + return dev_err_probe(dev, PTR_ERR(pinctrl->pctl_dev), 367 + "Couldn't register pinctrl driver\n"); 498 368 499 369 pinctrl->gpio_regmap = devm_gpio_regmap_register(dev, &config); 500 370 if (IS_ERR(pinctrl->gpio_regmap)) ··· 541 369 module_platform_driver(tps6594_pinctrl_driver); 542 370 543 371 MODULE_AUTHOR("Esteban Blanc <eblanc@baylibre.com>"); 372 + MODULE_AUTHOR("Nirmala Devi Mal Nadar <m.nirmaladevi@ltts.com>"); 544 373 MODULE_DESCRIPTION("TPS6594 pinctrl and GPIO driver"); 545 374 MODULE_LICENSE("GPL");
+3 -1
drivers/regulator/Kconfig
··· 1571 1571 depends on MFD_TPS6594 && OF 1572 1572 default MFD_TPS6594 1573 1573 help 1574 - This driver supports TPS6594 voltage regulator chips. 1574 + This driver supports TPS6594 series and TPS65224 voltage regulator chips. 1575 1575 TPS6594 series of PMICs have 5 BUCKs and 4 LDOs 1576 1576 voltage regulators. 1577 1577 BUCKs 1,2,3,4 can be used in single phase or multiphase mode. 1578 1578 Part number defines which single or multiphase mode is i used. 1579 1579 It supports software based voltage control 1580 1580 for different voltage domains. 1581 + TPS65224 PMIC has 4 BUCKs and 3 LDOs. BUCK12 can be used in dual phase. 1582 + All BUCKs and LDOs volatge can be controlled through software. 1581 1583 1582 1584 config REGULATOR_TPS6524X 1583 1585 tristate "TI TPS6524X Power regulators"
+214 -4
drivers/regulator/rk808-regulator.c
··· 158 158 RK8XX_DESC_COM(_id, _match, _supply, _min, _max, _step, _vreg, \ 159 159 _vmask, _ereg, _emask, 0, 0, _etime, &rk808_reg_ops) 160 160 161 + #define RK816_DESC(_id, _match, _supply, _min, _max, _step, _vreg, \ 162 + _vmask, _ereg, _emask, _disval, _etime) \ 163 + RK8XX_DESC_COM(_id, _match, _supply, _min, _max, _step, _vreg, \ 164 + _vmask, _ereg, _emask, _emask, _disval, _etime, &rk816_reg_ops) 165 + 161 166 #define RK817_DESC(_id, _match, _supply, _min, _max, _step, _vreg, \ 162 167 _vmask, _ereg, _emask, _disval, _etime) \ 163 168 RK8XX_DESC_COM(_id, _match, _supply, _min, _max, _step, _vreg, \ ··· 263 258 2000, 4000, 6000, 10000 264 259 }; 265 260 266 - /* RK817 RK809 */ 261 + /* RK817/RK809/RK816 (buck 1/2 only) */ 267 262 static const unsigned int rk817_buck1_4_ramp_table[] = { 268 263 3000, 6300, 12500, 25000 269 264 }; ··· 539 534 { 540 535 unsigned int reg; 541 536 int sel = regulator_map_voltage_linear_range(rdev, uv, uv); 537 + int ret; 542 538 543 539 if (sel < 0) 544 540 return -EINVAL; 545 541 546 542 reg = rdev->desc->vsel_reg + RK808_SLP_REG_OFFSET; 547 543 548 - return regmap_update_bits(rdev->regmap, reg, 549 - rdev->desc->vsel_mask, 550 - sel); 544 + ret = regmap_update_bits(rdev->regmap, reg, 545 + rdev->desc->vsel_mask, 546 + sel); 547 + if (ret) 548 + return ret; 549 + 550 + if (rdev->desc->apply_bit) 551 + ret = regmap_update_bits(rdev->regmap, rdev->desc->apply_reg, 552 + rdev->desc->apply_bit, 553 + rdev->desc->apply_bit); 554 + 555 + return ret; 551 556 } 552 557 553 558 static int rk805_set_suspend_enable(struct regulator_dev *rdev) ··· 643 628 return regmap_update_bits(rdev->regmap, reg, 644 629 rdev->desc->enable_mask, 645 630 rdev->desc->enable_mask); 631 + } 632 + 633 + static const struct rk8xx_register_bit rk816_suspend_bits[] = { 634 + RK8XX_REG_BIT(RK818_SLEEP_SET_OFF_REG1, 0), 635 + RK8XX_REG_BIT(RK818_SLEEP_SET_OFF_REG1, 1), 636 + RK8XX_REG_BIT(RK818_SLEEP_SET_OFF_REG1, 2), 637 + RK8XX_REG_BIT(RK818_SLEEP_SET_OFF_REG1, 3), 638 + RK8XX_REG_BIT(RK818_SLEEP_SET_OFF_REG2, 0), 639 + RK8XX_REG_BIT(RK818_SLEEP_SET_OFF_REG2, 1), 640 + RK8XX_REG_BIT(RK818_SLEEP_SET_OFF_REG2, 2), 641 + RK8XX_REG_BIT(RK818_SLEEP_SET_OFF_REG2, 3), 642 + RK8XX_REG_BIT(RK818_SLEEP_SET_OFF_REG2, 4), 643 + RK8XX_REG_BIT(RK818_SLEEP_SET_OFF_REG2, 5), 644 + RK8XX_REG_BIT(RK818_SLEEP_SET_OFF_REG1, 5), 645 + RK8XX_REG_BIT(RK818_SLEEP_SET_OFF_REG1, 6), 646 + }; 647 + 648 + static int rk816_set_suspend_enable(struct regulator_dev *rdev) 649 + { 650 + int rid = rdev_get_id(rdev); 651 + 652 + return regmap_update_bits(rdev->regmap, rk816_suspend_bits[rid].reg, 653 + rk816_suspend_bits[rid].bit, 654 + rk816_suspend_bits[rid].bit); 655 + } 656 + 657 + static int rk816_set_suspend_disable(struct regulator_dev *rdev) 658 + { 659 + int rid = rdev_get_id(rdev); 660 + 661 + return regmap_update_bits(rdev->regmap, rk816_suspend_bits[rid].reg, 662 + rk816_suspend_bits[rid].bit, 0); 646 663 } 647 664 648 665 static int rk817_set_suspend_enable_ctrl(struct regulator_dev *rdev, ··· 948 901 .set_suspend_voltage = rk808_set_suspend_voltage_range, 949 902 .set_suspend_enable = rk817_set_suspend_enable, 950 903 .set_suspend_disable = rk817_set_suspend_disable, 904 + }; 905 + 906 + static const struct regulator_ops rk816_buck1_2_ops_ranges = { 907 + .list_voltage = regulator_list_voltage_linear_range, 908 + .map_voltage = regulator_map_voltage_linear_range, 909 + .get_voltage_sel = regulator_get_voltage_sel_regmap, 910 + .set_voltage_sel = regulator_set_voltage_sel_regmap, 911 + .set_voltage_time_sel = regulator_set_voltage_time_sel, 912 + .enable = regulator_enable_regmap, 913 + .disable = regulator_disable_regmap, 914 + .is_enabled = regulator_is_enabled_regmap, 915 + .set_mode = rk8xx_set_mode, 916 + .get_mode = rk8xx_get_mode, 917 + .set_suspend_mode = rk8xx_set_suspend_mode, 918 + .set_ramp_delay = regulator_set_ramp_delay_regmap, 919 + .set_suspend_voltage = rk808_set_suspend_voltage_range, 920 + .set_suspend_enable = rk816_set_suspend_enable, 921 + .set_suspend_disable = rk816_set_suspend_disable, 922 + }; 923 + 924 + static const struct regulator_ops rk816_buck4_ops_ranges = { 925 + .list_voltage = regulator_list_voltage_linear_range, 926 + .map_voltage = regulator_map_voltage_linear_range, 927 + .get_voltage_sel = regulator_get_voltage_sel_regmap, 928 + .set_voltage_sel = regulator_set_voltage_sel_regmap, 929 + .set_voltage_time_sel = regulator_set_voltage_time_sel, 930 + .enable = regulator_enable_regmap, 931 + .disable = regulator_disable_regmap, 932 + .is_enabled = regulator_is_enabled_regmap, 933 + .set_mode = rk8xx_set_mode, 934 + .get_mode = rk8xx_get_mode, 935 + .set_suspend_mode = rk8xx_set_suspend_mode, 936 + .set_suspend_voltage = rk808_set_suspend_voltage_range, 937 + .set_suspend_enable = rk816_set_suspend_enable, 938 + .set_suspend_disable = rk816_set_suspend_disable, 939 + }; 940 + 941 + static const struct regulator_ops rk816_reg_ops = { 942 + .list_voltage = regulator_list_voltage_linear, 943 + .map_voltage = regulator_map_voltage_linear, 944 + .get_voltage_sel = regulator_get_voltage_sel_regmap, 945 + .set_voltage_sel = regulator_set_voltage_sel_regmap, 946 + .enable = regulator_enable_regmap, 947 + .disable = regulator_disable_regmap, 948 + .is_enabled = rk8xx_is_enabled_wmsk_regmap, 949 + .set_suspend_voltage = rk808_set_suspend_voltage, 950 + .set_suspend_enable = rk816_set_suspend_enable, 951 + .set_suspend_disable = rk816_set_suspend_disable, 951 952 }; 952 953 953 954 static const struct regulator_ops rk817_reg_ops = { ··· 1477 1382 DISABLE_VAL(3)), 1478 1383 }; 1479 1384 1385 + static const struct linear_range rk816_buck_4_voltage_ranges[] = { 1386 + REGULATOR_LINEAR_RANGE(800000, 0, 26, 100000), 1387 + REGULATOR_LINEAR_RANGE(3500000, 27, 31, 0), 1388 + }; 1389 + 1390 + static const struct regulator_desc rk816_reg[] = { 1391 + { 1392 + .name = "dcdc1", 1393 + .supply_name = "vcc1", 1394 + .of_match = of_match_ptr("dcdc1"), 1395 + .regulators_node = of_match_ptr("regulators"), 1396 + .id = RK816_ID_DCDC1, 1397 + .ops = &rk816_buck1_2_ops_ranges, 1398 + .type = REGULATOR_VOLTAGE, 1399 + .n_voltages = 64, 1400 + .linear_ranges = rk805_buck_1_2_voltage_ranges, 1401 + .n_linear_ranges = ARRAY_SIZE(rk805_buck_1_2_voltage_ranges), 1402 + .vsel_reg = RK818_BUCK1_ON_VSEL_REG, 1403 + .vsel_mask = RK818_BUCK_VSEL_MASK, 1404 + .apply_reg = RK816_DCDC_EN_REG2, 1405 + .apply_bit = RK816_BUCK_DVS_CONFIRM, 1406 + .enable_reg = RK816_DCDC_EN_REG1, 1407 + .enable_mask = BIT(4) | BIT(0), 1408 + .enable_val = BIT(4) | BIT(0), 1409 + .disable_val = BIT(4), 1410 + .ramp_reg = RK818_BUCK1_CONFIG_REG, 1411 + .ramp_mask = RK808_RAMP_RATE_MASK, 1412 + .ramp_delay_table = rk817_buck1_4_ramp_table, 1413 + .n_ramp_values = ARRAY_SIZE(rk817_buck1_4_ramp_table), 1414 + .of_map_mode = rk8xx_regulator_of_map_mode, 1415 + .owner = THIS_MODULE, 1416 + }, { 1417 + .name = "dcdc2", 1418 + .supply_name = "vcc2", 1419 + .of_match = of_match_ptr("dcdc2"), 1420 + .regulators_node = of_match_ptr("regulators"), 1421 + .id = RK816_ID_DCDC2, 1422 + .ops = &rk816_buck1_2_ops_ranges, 1423 + .type = REGULATOR_VOLTAGE, 1424 + .n_voltages = 64, 1425 + .linear_ranges = rk805_buck_1_2_voltage_ranges, 1426 + .n_linear_ranges = ARRAY_SIZE(rk805_buck_1_2_voltage_ranges), 1427 + .vsel_reg = RK818_BUCK2_ON_VSEL_REG, 1428 + .vsel_mask = RK818_BUCK_VSEL_MASK, 1429 + .apply_reg = RK816_DCDC_EN_REG2, 1430 + .apply_bit = RK816_BUCK_DVS_CONFIRM, 1431 + .enable_reg = RK816_DCDC_EN_REG1, 1432 + .enable_mask = BIT(5) | BIT(1), 1433 + .enable_val = BIT(5) | BIT(1), 1434 + .disable_val = BIT(5), 1435 + .ramp_reg = RK818_BUCK2_CONFIG_REG, 1436 + .ramp_mask = RK808_RAMP_RATE_MASK, 1437 + .ramp_delay_table = rk817_buck1_4_ramp_table, 1438 + .n_ramp_values = ARRAY_SIZE(rk817_buck1_4_ramp_table), 1439 + .of_map_mode = rk8xx_regulator_of_map_mode, 1440 + .owner = THIS_MODULE, 1441 + }, { 1442 + .name = "dcdc3", 1443 + .supply_name = "vcc3", 1444 + .of_match = of_match_ptr("dcdc3"), 1445 + .regulators_node = of_match_ptr("regulators"), 1446 + .id = RK816_ID_DCDC3, 1447 + .ops = &rk808_switch_ops, 1448 + .type = REGULATOR_VOLTAGE, 1449 + .n_voltages = 1, 1450 + .enable_reg = RK816_DCDC_EN_REG1, 1451 + .enable_mask = BIT(6) | BIT(2), 1452 + .enable_val = BIT(6) | BIT(2), 1453 + .disable_val = BIT(6), 1454 + .of_map_mode = rk8xx_regulator_of_map_mode, 1455 + .owner = THIS_MODULE, 1456 + }, { 1457 + .name = "dcdc4", 1458 + .supply_name = "vcc4", 1459 + .of_match = of_match_ptr("dcdc4"), 1460 + .regulators_node = of_match_ptr("regulators"), 1461 + .id = RK816_ID_DCDC4, 1462 + .ops = &rk816_buck4_ops_ranges, 1463 + .type = REGULATOR_VOLTAGE, 1464 + .n_voltages = 32, 1465 + .linear_ranges = rk816_buck_4_voltage_ranges, 1466 + .n_linear_ranges = ARRAY_SIZE(rk816_buck_4_voltage_ranges), 1467 + .vsel_reg = RK818_BUCK4_ON_VSEL_REG, 1468 + .vsel_mask = RK818_BUCK4_VSEL_MASK, 1469 + .enable_reg = RK816_DCDC_EN_REG1, 1470 + .enable_mask = BIT(7) | BIT(3), 1471 + .enable_val = BIT(7) | BIT(3), 1472 + .disable_val = BIT(7), 1473 + .of_map_mode = rk8xx_regulator_of_map_mode, 1474 + .owner = THIS_MODULE, 1475 + }, 1476 + RK816_DESC(RK816_ID_LDO1, "ldo1", "vcc5", 800, 3400, 100, 1477 + RK818_LDO1_ON_VSEL_REG, RK818_LDO_VSEL_MASK, 1478 + RK816_LDO_EN_REG1, ENABLE_MASK(0), DISABLE_VAL(0), 400), 1479 + RK816_DESC(RK816_ID_LDO2, "ldo2", "vcc5", 800, 3400, 100, 1480 + RK818_LDO2_ON_VSEL_REG, RK818_LDO_VSEL_MASK, 1481 + RK816_LDO_EN_REG1, ENABLE_MASK(1), DISABLE_VAL(1), 400), 1482 + RK816_DESC(RK816_ID_LDO3, "ldo3", "vcc5", 800, 3400, 100, 1483 + RK818_LDO3_ON_VSEL_REG, RK818_LDO_VSEL_MASK, 1484 + RK816_LDO_EN_REG1, ENABLE_MASK(2), DISABLE_VAL(2), 400), 1485 + RK816_DESC(RK816_ID_LDO4, "ldo4", "vcc6", 800, 3400, 100, 1486 + RK818_LDO4_ON_VSEL_REG, RK818_LDO_VSEL_MASK, 1487 + RK816_LDO_EN_REG1, ENABLE_MASK(3), DISABLE_VAL(3), 400), 1488 + RK816_DESC(RK816_ID_LDO5, "ldo5", "vcc6", 800, 3400, 100, 1489 + RK818_LDO5_ON_VSEL_REG, RK818_LDO_VSEL_MASK, 1490 + RK816_LDO_EN_REG2, ENABLE_MASK(0), DISABLE_VAL(0), 400), 1491 + RK816_DESC(RK816_ID_LDO6, "ldo6", "vcc6", 800, 3400, 100, 1492 + RK818_LDO6_ON_VSEL_REG, RK818_LDO_VSEL_MASK, 1493 + RK816_LDO_EN_REG2, ENABLE_MASK(1), DISABLE_VAL(1), 400), 1494 + }; 1495 + 1480 1496 static const struct regulator_desc rk817_reg[] = { 1481 1497 { 1482 1498 .name = "DCDC_REG1", ··· 1909 1703 case RK809_ID: 1910 1704 regulators = rk809_reg; 1911 1705 nregulators = RK809_NUM_REGULATORS; 1706 + break; 1707 + case RK816_ID: 1708 + regulators = rk816_reg; 1709 + nregulators = ARRAY_SIZE(rk816_reg); 1912 1710 break; 1913 1711 case RK817_ID: 1914 1712 regulators = rk817_reg;
+268 -72
drivers/regulator/tps6594-regulator.c
··· 18 18 19 19 #include <linux/mfd/tps6594.h> 20 20 21 - #define BUCK_NB 5 22 - #define LDO_NB 4 23 - #define MULTI_PHASE_NB 4 24 - #define REGS_INT_NB 4 21 + #define BUCK_NB 5 22 + #define LDO_NB 4 23 + #define MULTI_PHASE_NB 4 24 + /* TPS6593 and LP8764 supports OV, UV, SC, ILIM */ 25 + #define REGS_INT_NB 4 26 + /* TPS65224 supports OV or UV */ 27 + #define TPS65224_REGS_INT_NB 1 25 28 26 29 enum tps6594_regulator_id { 27 30 /* DCDC's */ ··· 67 64 { TPS6594_IRQ_NAME_VMON2_UV, "VMON2", "undervoltage", REGULATOR_EVENT_UNDER_VOLTAGE }, 68 65 { TPS6594_IRQ_NAME_VMON2_RV, "VMON2", "residual voltage", 69 66 REGULATOR_EVENT_OVER_VOLTAGE_WARN }, 67 + }; 68 + 69 + static struct tps6594_regulator_irq_type tps65224_ext_regulator_irq_types[] = { 70 + { TPS65224_IRQ_NAME_VCCA_UVOV, "VCCA", "voltage out of range", 71 + REGULATOR_EVENT_REGULATION_OUT }, 72 + { TPS65224_IRQ_NAME_VMON1_UVOV, "VMON1", "voltage out of range", 73 + REGULATOR_EVENT_REGULATION_OUT }, 74 + { TPS65224_IRQ_NAME_VMON2_UVOV, "VMON2", "voltage out of range", 75 + REGULATOR_EVENT_REGULATION_OUT }, 70 76 }; 71 77 72 78 struct tps6594_regulator_irq_data { ··· 132 120 133 121 static const struct linear_range ldos_4_ranges[] = { 134 122 REGULATOR_LINEAR_RANGE(1200000, 0x20, 0x74, 25000), 123 + }; 124 + 125 + /* Voltage range for TPS65224 Bucks and LDOs */ 126 + static const struct linear_range tps65224_bucks_1_ranges[] = { 127 + REGULATOR_LINEAR_RANGE(500000, 0x0a, 0x0e, 20000), 128 + REGULATOR_LINEAR_RANGE(600000, 0x0f, 0x72, 5000), 129 + REGULATOR_LINEAR_RANGE(1100000, 0x73, 0xaa, 10000), 130 + REGULATOR_LINEAR_RANGE(1660000, 0xab, 0xfd, 20000), 131 + }; 132 + 133 + static const struct linear_range tps65224_bucks_2_3_4_ranges[] = { 134 + REGULATOR_LINEAR_RANGE(500000, 0x0, 0x1a, 25000), 135 + REGULATOR_LINEAR_RANGE(1200000, 0x1b, 0x45, 50000), 136 + }; 137 + 138 + static const struct linear_range tps65224_ldos_1_ranges[] = { 139 + REGULATOR_LINEAR_RANGE(1200000, 0xC, 0x36, 50000), 140 + }; 141 + 142 + static const struct linear_range tps65224_ldos_2_3_ranges[] = { 143 + REGULATOR_LINEAR_RANGE(600000, 0x0, 0x38, 50000), 135 144 }; 136 145 137 146 /* Operations permitted on BUCK1/2/3/4/5 */ ··· 230 197 4, 0, 0, NULL, 0, 0), 231 198 }; 232 199 200 + /* Buck configuration for TPS65224 */ 201 + static const struct regulator_desc tps65224_buck_regs[] = { 202 + TPS6594_REGULATOR("BUCK1", "buck1", TPS6594_BUCK_1, 203 + REGULATOR_VOLTAGE, tps6594_bucks_ops, TPS65224_MASK_BUCK1_VSET, 204 + TPS6594_REG_BUCKX_VOUT_1(0), 205 + TPS65224_MASK_BUCK1_VSET, 206 + TPS6594_REG_BUCKX_CTRL(0), 207 + TPS6594_BIT_BUCK_EN, 0, 0, tps65224_bucks_1_ranges, 208 + 4, 0, 0, NULL, 0, 0), 209 + TPS6594_REGULATOR("BUCK2", "buck2", TPS6594_BUCK_2, 210 + REGULATOR_VOLTAGE, tps6594_bucks_ops, TPS65224_MASK_BUCKS_VSET, 211 + TPS6594_REG_BUCKX_VOUT_1(1), 212 + TPS65224_MASK_BUCKS_VSET, 213 + TPS6594_REG_BUCKX_CTRL(1), 214 + TPS6594_BIT_BUCK_EN, 0, 0, tps65224_bucks_2_3_4_ranges, 215 + 4, 0, 0, NULL, 0, 0), 216 + TPS6594_REGULATOR("BUCK3", "buck3", TPS6594_BUCK_3, 217 + REGULATOR_VOLTAGE, tps6594_bucks_ops, TPS65224_MASK_BUCKS_VSET, 218 + TPS6594_REG_BUCKX_VOUT_1(2), 219 + TPS65224_MASK_BUCKS_VSET, 220 + TPS6594_REG_BUCKX_CTRL(2), 221 + TPS6594_BIT_BUCK_EN, 0, 0, tps65224_bucks_2_3_4_ranges, 222 + 4, 0, 0, NULL, 0, 0), 223 + TPS6594_REGULATOR("BUCK4", "buck4", TPS6594_BUCK_4, 224 + REGULATOR_VOLTAGE, tps6594_bucks_ops, TPS65224_MASK_BUCKS_VSET, 225 + TPS6594_REG_BUCKX_VOUT_1(3), 226 + TPS65224_MASK_BUCKS_VSET, 227 + TPS6594_REG_BUCKX_CTRL(3), 228 + TPS6594_BIT_BUCK_EN, 0, 0, tps65224_bucks_2_3_4_ranges, 229 + 4, 0, 0, NULL, 0, 0), 230 + }; 231 + 233 232 static struct tps6594_regulator_irq_type tps6594_buck1_irq_types[] = { 234 233 { TPS6594_IRQ_NAME_BUCK1_OV, "BUCK1", "overvoltage", REGULATOR_EVENT_OVER_VOLTAGE_WARN }, 235 234 { TPS6594_IRQ_NAME_BUCK1_UV, "BUCK1", "undervoltage", REGULATOR_EVENT_UNDER_VOLTAGE }, ··· 334 269 REGULATOR_EVENT_OVER_CURRENT }, 335 270 }; 336 271 272 + static struct tps6594_regulator_irq_type tps65224_buck1_irq_types[] = { 273 + { TPS65224_IRQ_NAME_BUCK1_UVOV, "BUCK1", "voltage out of range", 274 + REGULATOR_EVENT_REGULATION_OUT }, 275 + }; 276 + 277 + static struct tps6594_regulator_irq_type tps65224_buck2_irq_types[] = { 278 + { TPS65224_IRQ_NAME_BUCK2_UVOV, "BUCK2", "voltage out of range", 279 + REGULATOR_EVENT_REGULATION_OUT }, 280 + }; 281 + 282 + static struct tps6594_regulator_irq_type tps65224_buck3_irq_types[] = { 283 + { TPS65224_IRQ_NAME_BUCK3_UVOV, "BUCK3", "voltage out of range", 284 + REGULATOR_EVENT_REGULATION_OUT }, 285 + }; 286 + 287 + static struct tps6594_regulator_irq_type tps65224_buck4_irq_types[] = { 288 + { TPS65224_IRQ_NAME_BUCK4_UVOV, "BUCK4", "voltage out of range", 289 + REGULATOR_EVENT_REGULATION_OUT }, 290 + }; 291 + 292 + static struct tps6594_regulator_irq_type tps65224_ldo1_irq_types[] = { 293 + { TPS65224_IRQ_NAME_LDO1_UVOV, "LDO1", "voltage out of range", 294 + REGULATOR_EVENT_REGULATION_OUT }, 295 + }; 296 + 297 + static struct tps6594_regulator_irq_type tps65224_ldo2_irq_types[] = { 298 + { TPS65224_IRQ_NAME_LDO2_UVOV, "LDO2", "voltage out of range", 299 + REGULATOR_EVENT_REGULATION_OUT }, 300 + }; 301 + 302 + static struct tps6594_regulator_irq_type tps65224_ldo3_irq_types[] = { 303 + { TPS65224_IRQ_NAME_LDO3_UVOV, "LDO3", "voltage out of range", 304 + REGULATOR_EVENT_REGULATION_OUT }, 305 + }; 306 + 337 307 static struct tps6594_regulator_irq_type *tps6594_bucks_irq_types[] = { 338 308 tps6594_buck1_irq_types, 339 309 tps6594_buck2_irq_types, ··· 384 284 tps6594_ldo4_irq_types, 385 285 }; 386 286 387 - static const struct regulator_desc multi_regs[] = { 287 + static struct tps6594_regulator_irq_type *tps65224_bucks_irq_types[] = { 288 + tps65224_buck1_irq_types, 289 + tps65224_buck2_irq_types, 290 + tps65224_buck3_irq_types, 291 + tps65224_buck4_irq_types, 292 + }; 293 + 294 + static struct tps6594_regulator_irq_type *tps65224_ldos_irq_types[] = { 295 + tps65224_ldo1_irq_types, 296 + tps65224_ldo2_irq_types, 297 + tps65224_ldo3_irq_types, 298 + }; 299 + 300 + static const struct regulator_desc tps6594_multi_regs[] = { 388 301 TPS6594_REGULATOR("BUCK12", "buck12", TPS6594_BUCK_1, 389 302 REGULATOR_VOLTAGE, tps6594_bucks_ops, TPS6594_MASK_BUCKS_VSET, 390 303 TPS6594_REG_BUCKX_VOUT_1(1), ··· 428 315 4, 4000, 0, NULL, 0, 0), 429 316 }; 430 317 431 - static const struct regulator_desc ldo_regs[] = { 318 + static const struct regulator_desc tps65224_multi_regs[] = { 319 + TPS6594_REGULATOR("BUCK12", "buck12", TPS6594_BUCK_1, 320 + REGULATOR_VOLTAGE, tps6594_bucks_ops, TPS65224_MASK_BUCK1_VSET, 321 + TPS6594_REG_BUCKX_VOUT_1(0), 322 + TPS65224_MASK_BUCK1_VSET, 323 + TPS6594_REG_BUCKX_CTRL(0), 324 + TPS6594_BIT_BUCK_EN, 0, 0, tps65224_bucks_1_ranges, 325 + 4, 4000, 0, NULL, 0, 0), 326 + }; 327 + 328 + static const struct regulator_desc tps6594_ldo_regs[] = { 432 329 TPS6594_REGULATOR("LDO1", "ldo1", TPS6594_LDO_1, 433 330 REGULATOR_VOLTAGE, tps6594_ldos_1_2_3_ops, TPS6594_MASK_LDO123_VSET, 434 331 TPS6594_REG_LDOX_VOUT(0), ··· 469 346 1, 0, 0, NULL, 0, 0), 470 347 }; 471 348 349 + static const struct regulator_desc tps65224_ldo_regs[] = { 350 + TPS6594_REGULATOR("LDO1", "ldo1", TPS6594_LDO_1, 351 + REGULATOR_VOLTAGE, tps6594_ldos_1_2_3_ops, TPS6594_MASK_LDO123_VSET, 352 + TPS6594_REG_LDOX_VOUT(0), 353 + TPS6594_MASK_LDO123_VSET, 354 + TPS6594_REG_LDOX_CTRL(0), 355 + TPS6594_BIT_LDO_EN, 0, 0, tps65224_ldos_1_ranges, 356 + 1, 0, 0, NULL, 0, TPS6594_BIT_LDO_BYPASS), 357 + TPS6594_REGULATOR("LDO2", "ldo2", TPS6594_LDO_2, 358 + REGULATOR_VOLTAGE, tps6594_ldos_1_2_3_ops, TPS6594_MASK_LDO123_VSET, 359 + TPS6594_REG_LDOX_VOUT(1), 360 + TPS6594_MASK_LDO123_VSET, 361 + TPS6594_REG_LDOX_CTRL(1), 362 + TPS6594_BIT_LDO_EN, 0, 0, tps65224_ldos_2_3_ranges, 363 + 1, 0, 0, NULL, 0, TPS6594_BIT_LDO_BYPASS), 364 + TPS6594_REGULATOR("LDO3", "ldo3", TPS6594_LDO_3, 365 + REGULATOR_VOLTAGE, tps6594_ldos_1_2_3_ops, TPS6594_MASK_LDO123_VSET, 366 + TPS6594_REG_LDOX_VOUT(2), 367 + TPS6594_MASK_LDO123_VSET, 368 + TPS6594_REG_LDOX_CTRL(2), 369 + TPS6594_BIT_LDO_EN, 0, 0, tps65224_ldos_2_3_ranges, 370 + 1, 0, 0, NULL, 0, TPS6594_BIT_LDO_BYPASS), 371 + }; 372 + 472 373 static irqreturn_t tps6594_regulator_irq_handler(int irq, void *data) 473 374 { 474 375 struct tps6594_regulator_irq_data *irq_data = data; ··· 516 369 static int tps6594_request_reg_irqs(struct platform_device *pdev, 517 370 struct regulator_dev *rdev, 518 371 struct tps6594_regulator_irq_data *irq_data, 519 - struct tps6594_regulator_irq_type *tps6594_regs_irq_types, 372 + struct tps6594_regulator_irq_type *regs_irq_types, 373 + size_t interrupt_cnt, 520 374 int *irq_idx) 521 375 { 522 376 struct tps6594_regulator_irq_type *irq_type; 523 377 struct tps6594 *tps = dev_get_drvdata(pdev->dev.parent); 524 - int j; 378 + size_t j; 525 379 int irq; 526 380 int error; 527 381 528 - for (j = 0; j < REGS_INT_NB; j++) { 529 - irq_type = &tps6594_regs_irq_types[j]; 382 + for (j = 0; j < interrupt_cnt; j++) { 383 + irq_type = &regs_irq_types[j]; 530 384 irq = platform_get_irq_byname(pdev, irq_type->irq_name); 531 385 if (irq < 0) 532 386 return -EINVAL; ··· 559 411 struct tps6594_regulator_irq_data *irq_data; 560 412 struct tps6594_ext_regulator_irq_data *irq_ext_reg_data; 561 413 struct tps6594_regulator_irq_type *irq_type; 562 - u8 buck_configured[BUCK_NB] = { 0 }; 563 - u8 buck_multi[MULTI_PHASE_NB] = { 0 }; 564 - static const char * const multiphases[] = {"buck12", "buck123", "buck1234", "buck34"}; 414 + struct tps6594_regulator_irq_type *irq_types; 415 + bool buck_configured[BUCK_NB] = { false }; 416 + bool buck_multi[MULTI_PHASE_NB] = { false }; 417 + 565 418 static const char *npname; 566 - int error, i, irq, multi, delta; 419 + int error, i, irq, multi; 567 420 int irq_idx = 0; 568 421 int buck_idx = 0; 569 - size_t ext_reg_irq_nb = 2; 422 + int nr_ldo; 423 + int nr_buck; 424 + int nr_types; 425 + unsigned int irq_count; 426 + unsigned int multi_phase_cnt; 570 427 size_t reg_irq_nb; 428 + struct tps6594_regulator_irq_type **bucks_irq_types; 429 + const struct regulator_desc *multi_regs; 430 + struct tps6594_regulator_irq_type **ldos_irq_types; 431 + const struct regulator_desc *ldo_regs; 432 + size_t interrupt_count; 433 + 434 + if (tps->chip_id == TPS65224) { 435 + bucks_irq_types = tps65224_bucks_irq_types; 436 + interrupt_count = ARRAY_SIZE(tps65224_buck1_irq_types); 437 + multi_regs = tps65224_multi_regs; 438 + ldos_irq_types = tps65224_ldos_irq_types; 439 + ldo_regs = tps65224_ldo_regs; 440 + multi_phase_cnt = ARRAY_SIZE(tps65224_multi_regs); 441 + } else { 442 + bucks_irq_types = tps6594_bucks_irq_types; 443 + interrupt_count = ARRAY_SIZE(tps6594_buck1_irq_types); 444 + multi_regs = tps6594_multi_regs; 445 + ldos_irq_types = tps6594_ldos_irq_types; 446 + ldo_regs = tps6594_ldo_regs; 447 + multi_phase_cnt = ARRAY_SIZE(tps6594_multi_regs); 448 + } 449 + 571 450 enum { 572 451 MULTI_BUCK12, 452 + MULTI_BUCK12_34, 573 453 MULTI_BUCK123, 574 454 MULTI_BUCK1234, 575 - MULTI_BUCK12_34, 576 - MULTI_FIRST = MULTI_BUCK12, 577 - MULTI_LAST = MULTI_BUCK12_34, 578 - MULTI_NUM = MULTI_LAST - MULTI_FIRST + 1 579 455 }; 580 456 581 457 config.dev = tps->dev; ··· 614 442 * In case of Multiphase configuration, value should be defined for 615 443 * buck_configured to avoid creating bucks for every buck in multiphase 616 444 */ 617 - for (multi = MULTI_FIRST; multi < MULTI_NUM; multi++) { 618 - np = of_find_node_by_name(tps->dev->of_node, multiphases[multi]); 445 + for (multi = 0; multi < multi_phase_cnt; multi++) { 446 + np = of_find_node_by_name(tps->dev->of_node, multi_regs[multi].supply_name); 619 447 npname = of_node_full_name(np); 620 448 np_pmic_parent = of_get_parent(of_get_parent(np)); 621 449 if (of_node_cmp(of_node_full_name(np_pmic_parent), tps->dev->of_node->full_name)) 622 450 continue; 623 - delta = strcmp(npname, multiphases[multi]); 624 - if (!delta) { 451 + if (strcmp(npname, multi_regs[multi].supply_name) == 0) { 625 452 switch (multi) { 626 453 case MULTI_BUCK12: 627 - buck_multi[0] = 1; 628 - buck_configured[0] = 1; 629 - buck_configured[1] = 1; 454 + buck_multi[0] = true; 455 + buck_configured[0] = true; 456 + buck_configured[1] = true; 630 457 break; 631 458 /* multiphase buck34 is supported only with buck12 */ 632 459 case MULTI_BUCK12_34: 633 - buck_multi[0] = 1; 634 - buck_multi[1] = 1; 635 - buck_configured[0] = 1; 636 - buck_configured[1] = 1; 637 - buck_configured[2] = 1; 638 - buck_configured[3] = 1; 460 + buck_multi[0] = true; 461 + buck_multi[1] = true; 462 + buck_configured[0] = true; 463 + buck_configured[1] = true; 464 + buck_configured[2] = true; 465 + buck_configured[3] = true; 639 466 break; 640 467 case MULTI_BUCK123: 641 - buck_multi[2] = 1; 642 - buck_configured[0] = 1; 643 - buck_configured[1] = 1; 644 - buck_configured[2] = 1; 468 + buck_multi[2] = true; 469 + buck_configured[0] = true; 470 + buck_configured[1] = true; 471 + buck_configured[2] = true; 645 472 break; 646 473 case MULTI_BUCK1234: 647 - buck_multi[3] = 1; 648 - buck_configured[0] = 1; 649 - buck_configured[1] = 1; 650 - buck_configured[2] = 1; 651 - buck_configured[3] = 1; 474 + buck_multi[3] = true; 475 + buck_configured[0] = true; 476 + buck_configured[1] = true; 477 + buck_configured[2] = true; 478 + buck_configured[3] = true; 652 479 break; 653 480 } 654 481 } 655 482 } 656 483 657 484 if (tps->chip_id == LP8764) { 658 - /* There is only 4 buck on LP8764 */ 659 - buck_configured[4] = 1; 660 - reg_irq_nb = size_mul(REGS_INT_NB, (BUCK_NB - 1)); 485 + nr_buck = ARRAY_SIZE(buck_regs); 486 + nr_ldo = 0; 487 + nr_types = REGS_INT_NB; 488 + } else if (tps->chip_id == TPS65224) { 489 + nr_buck = ARRAY_SIZE(tps65224_buck_regs); 490 + nr_ldo = ARRAY_SIZE(tps65224_ldo_regs); 491 + nr_types = REGS_INT_NB; 661 492 } else { 662 - reg_irq_nb = size_mul(REGS_INT_NB, (size_add(BUCK_NB, LDO_NB))); 493 + nr_buck = ARRAY_SIZE(buck_regs); 494 + nr_ldo = ARRAY_SIZE(tps6594_ldo_regs); 495 + nr_types = TPS65224_REGS_INT_NB; 663 496 } 497 + 498 + reg_irq_nb = nr_types * (nr_buck + nr_ldo); 664 499 665 500 irq_data = devm_kmalloc_array(tps->dev, reg_irq_nb, 666 501 sizeof(struct tps6594_regulator_irq_data), GFP_KERNEL); 667 502 if (!irq_data) 668 503 return -ENOMEM; 669 504 670 - for (i = 0; i < MULTI_PHASE_NB; i++) { 671 - if (buck_multi[i] == 0) 505 + for (i = 0; i < multi_phase_cnt; i++) { 506 + if (!buck_multi[i]) 672 507 continue; 673 508 674 509 rdev = devm_regulator_register(&pdev->dev, &multi_regs[i], &config); ··· 685 506 pdev->name); 686 507 687 508 /* config multiphase buck12+buck34 */ 688 - if (i == 1) 509 + if (i == MULTI_BUCK12_34) 689 510 buck_idx = 2; 511 + 690 512 error = tps6594_request_reg_irqs(pdev, rdev, irq_data, 691 - tps6594_bucks_irq_types[buck_idx], &irq_idx); 692 - if (error) 693 - return error; 694 - error = tps6594_request_reg_irqs(pdev, rdev, irq_data, 695 - tps6594_bucks_irq_types[buck_idx + 1], &irq_idx); 513 + bucks_irq_types[buck_idx], 514 + interrupt_count, &irq_idx); 696 515 if (error) 697 516 return error; 698 517 699 - if (i == 2 || i == 3) { 518 + error = tps6594_request_reg_irqs(pdev, rdev, irq_data, 519 + bucks_irq_types[buck_idx + 1], 520 + interrupt_count, &irq_idx); 521 + if (error) 522 + return error; 523 + 524 + if (i == MULTI_BUCK123 || i == MULTI_BUCK1234) { 700 525 error = tps6594_request_reg_irqs(pdev, rdev, irq_data, 701 526 tps6594_bucks_irq_types[buck_idx + 2], 527 + interrupt_count, 702 528 &irq_idx); 703 529 if (error) 704 530 return error; 705 531 } 706 - if (i == 3) { 532 + if (i == MULTI_BUCK1234) { 707 533 error = tps6594_request_reg_irqs(pdev, rdev, irq_data, 708 534 tps6594_bucks_irq_types[buck_idx + 3], 535 + interrupt_count, 709 536 &irq_idx); 710 537 if (error) 711 538 return error; 712 539 } 713 540 } 714 541 715 - for (i = 0; i < BUCK_NB; i++) { 716 - if (buck_configured[i] == 1) 542 + for (i = 0; i < nr_buck; i++) { 543 + if (buck_configured[i]) 717 544 continue; 718 545 719 - rdev = devm_regulator_register(&pdev->dev, &buck_regs[i], &config); 546 + const struct regulator_desc *buck_cfg = (tps->chip_id == TPS65224) ? 547 + tps65224_buck_regs : buck_regs; 548 + 549 + rdev = devm_regulator_register(&pdev->dev, &buck_cfg[i], &config); 720 550 if (IS_ERR(rdev)) 721 551 return dev_err_probe(tps->dev, PTR_ERR(rdev), 722 - "failed to register %s regulator\n", 723 - pdev->name); 552 + "failed to register %s regulator\n", pdev->name); 724 553 725 554 error = tps6594_request_reg_irqs(pdev, rdev, irq_data, 726 - tps6594_bucks_irq_types[i], &irq_idx); 555 + bucks_irq_types[i], interrupt_count, &irq_idx); 727 556 if (error) 728 557 return error; 729 558 } 730 559 731 - /* LP8764 dosen't have LDO */ 560 + /* LP8764 doesn't have LDO */ 732 561 if (tps->chip_id != LP8764) { 733 - for (i = 0; i < ARRAY_SIZE(ldo_regs); i++) { 562 + for (i = 0; i < nr_ldo; i++) { 734 563 rdev = devm_regulator_register(&pdev->dev, &ldo_regs[i], &config); 735 564 if (IS_ERR(rdev)) 736 565 return dev_err_probe(tps->dev, PTR_ERR(rdev), ··· 746 559 pdev->name); 747 560 748 561 error = tps6594_request_reg_irqs(pdev, rdev, irq_data, 749 - tps6594_ldos_irq_types[i], 562 + ldos_irq_types[i], interrupt_count, 750 563 &irq_idx); 751 564 if (error) 752 565 return error; 753 566 } 754 567 } 755 568 756 - if (tps->chip_id == LP8764) 757 - ext_reg_irq_nb = ARRAY_SIZE(tps6594_ext_regulator_irq_types); 569 + if (tps->chip_id == TPS65224) { 570 + irq_types = tps65224_ext_regulator_irq_types; 571 + irq_count = ARRAY_SIZE(tps65224_ext_regulator_irq_types); 572 + } else { 573 + irq_types = tps6594_ext_regulator_irq_types; 574 + if (tps->chip_id == LP8764) 575 + irq_count = ARRAY_SIZE(tps6594_ext_regulator_irq_types); 576 + else 577 + /* TPS6593 supports only VCCA OV and UV */ 578 + irq_count = 2; 579 + } 758 580 759 581 irq_ext_reg_data = devm_kmalloc_array(tps->dev, 760 - ext_reg_irq_nb, 761 - sizeof(struct tps6594_ext_regulator_irq_data), 762 - GFP_KERNEL); 582 + irq_count, 583 + sizeof(struct tps6594_ext_regulator_irq_data), 584 + GFP_KERNEL); 763 585 if (!irq_ext_reg_data) 764 586 return -ENOMEM; 765 587 766 - for (i = 0; i < ext_reg_irq_nb; ++i) { 767 - irq_type = &tps6594_ext_regulator_irq_types[i]; 768 - 588 + for (i = 0; i < irq_count; ++i) { 589 + irq_type = &irq_types[i]; 769 590 irq = platform_get_irq_byname(pdev, irq_type->irq_name); 770 591 if (irq < 0) 771 592 return -EINVAL; ··· 805 610 806 611 MODULE_ALIAS("platform:tps6594-regulator"); 807 612 MODULE_AUTHOR("Jerome Neanne <jneanne@baylibre.com>"); 613 + MODULE_AUTHOR("Nirmala Devi Mal Nadar <m.nirmaladevi@ltts.com>"); 808 614 MODULE_DESCRIPTION("TPS6594 voltage regulator driver"); 809 615 MODULE_LICENSE("GPL");
+1
include/linux/mfd/intel-m10-bmc.h
··· 205 205 unsigned int pr_reh_addr; 206 206 unsigned int pr_magic; 207 207 unsigned int rsu_update_counter; 208 + unsigned int staging_size; 208 209 }; 209 210 210 211 /**
+144
include/linux/mfd/rk808.h
··· 113 113 #define RK808_INT_STS_MSK_REG2 0x4f 114 114 #define RK808_IO_POL_REG 0x50 115 115 116 + /* RK816 */ 117 + enum rk816_reg { 118 + RK816_ID_DCDC1, 119 + RK816_ID_DCDC2, 120 + RK816_ID_DCDC3, 121 + RK816_ID_DCDC4, 122 + RK816_ID_LDO1, 123 + RK816_ID_LDO2, 124 + RK816_ID_LDO3, 125 + RK816_ID_LDO4, 126 + RK816_ID_LDO5, 127 + RK816_ID_LDO6, 128 + RK816_ID_BOOST, 129 + RK816_ID_OTG_SW, 130 + }; 131 + 132 + enum rk816_irqs { 133 + /* INT_STS_REG1 */ 134 + RK816_IRQ_PWRON_FALL, 135 + RK816_IRQ_PWRON_RISE, 136 + 137 + /* INT_STS_REG2 */ 138 + RK816_IRQ_VB_LOW, 139 + RK816_IRQ_PWRON, 140 + RK816_IRQ_PWRON_LP, 141 + RK816_IRQ_HOTDIE, 142 + RK816_IRQ_RTC_ALARM, 143 + RK816_IRQ_RTC_PERIOD, 144 + RK816_IRQ_USB_OV, 145 + 146 + /* INT_STS_REG3 */ 147 + RK816_IRQ_PLUG_IN, 148 + RK816_IRQ_PLUG_OUT, 149 + RK816_IRQ_CHG_OK, 150 + RK816_IRQ_CHG_TE, 151 + RK816_IRQ_CHG_TS, 152 + RK816_IRQ_CHG_CVTLIM, 153 + RK816_IRQ_DISCHG_ILIM, 154 + }; 155 + 156 + /* power channel registers */ 157 + #define RK816_DCDC_EN_REG1 0x23 158 + 159 + #define RK816_DCDC_EN_REG2 0x24 160 + #define RK816_BOOST_EN BIT(1) 161 + #define RK816_OTG_EN BIT(2) 162 + #define RK816_BOOST_EN_MSK BIT(5) 163 + #define RK816_OTG_EN_MSK BIT(6) 164 + #define RK816_BUCK_DVS_CONFIRM BIT(7) 165 + 166 + #define RK816_LDO_EN_REG1 0x27 167 + 168 + #define RK816_LDO_EN_REG2 0x28 169 + 170 + /* interrupt registers and irq definitions */ 171 + #define RK816_INT_STS_REG1 0x49 172 + #define RK816_INT_STS_MSK_REG1 0x4a 173 + #define RK816_INT_STS_PWRON_FALL BIT(5) 174 + #define RK816_INT_STS_PWRON_RISE BIT(6) 175 + 176 + #define RK816_INT_STS_REG2 0x4c 177 + #define RK816_INT_STS_MSK_REG2 0x4d 178 + #define RK816_INT_STS_VB_LOW BIT(1) 179 + #define RK816_INT_STS_PWRON BIT(2) 180 + #define RK816_INT_STS_PWRON_LP BIT(3) 181 + #define RK816_INT_STS_HOTDIE BIT(4) 182 + #define RK816_INT_STS_RTC_ALARM BIT(5) 183 + #define RK816_INT_STS_RTC_PERIOD BIT(6) 184 + #define RK816_INT_STS_USB_OV BIT(7) 185 + 186 + #define RK816_INT_STS_REG3 0x4e 187 + #define RK816_INT_STS_MSK_REG3 0x4f 188 + #define RK816_INT_STS_PLUG_IN BIT(0) 189 + #define RK816_INT_STS_PLUG_OUT BIT(1) 190 + #define RK816_INT_STS_CHG_OK BIT(2) 191 + #define RK816_INT_STS_CHG_TE BIT(3) 192 + #define RK816_INT_STS_CHG_TS BIT(4) 193 + #define RK816_INT_STS_CHG_CVTLIM BIT(6) 194 + #define RK816_INT_STS_DISCHG_ILIM BIT(7) 195 + 196 + #define RK816_IRQ_STS_OFFSET(x) ((x) - RK816_INT_STS_REG1) 197 + #define RK816_IRQ_MSK_OFFSET(x) ((x) - RK816_INT_STS_MSK_REG1) 198 + 199 + /* charger, boost and OTG registers */ 200 + #define RK816_OTG_BUCK_LDO_CONFIG_REG 0x2a 201 + #define RK816_CHRG_CONFIG_REG 0x2b 202 + #define RK816_BOOST_ON_VESL_REG 0x54 203 + #define RK816_BOOST_SLP_VSEL_REG 0x55 204 + #define RK816_CHRG_BOOST_CONFIG_REG 0x9a 205 + #define RK816_SUP_STS_REG 0xa0 206 + #define RK816_USB_CTRL_REG 0xa1 207 + #define RK816_CHRG_CTRL(x) (0xa3 + (x)) 208 + #define RK816_BAT_CTRL_REG 0xa6 209 + #define RK816_BAT_HTS_TS_REG 0xa8 210 + #define RK816_BAT_LTS_TS_REG 0xa9 211 + 212 + /* adc and fuel gauge registers */ 213 + #define RK816_TS_CTRL_REG 0xac 214 + #define RK816_ADC_CTRL_REG 0xad 215 + #define RK816_GGCON_REG 0xb0 216 + #define RK816_GGSTS_REG 0xb1 217 + #define RK816_ZERO_CUR_ADC_REGH 0xb2 218 + #define RK816_ZERO_CUR_ADC_REGL 0xb3 219 + #define RK816_GASCNT_CAL_REG(x) (0xb7 - (x)) 220 + #define RK816_GASCNT_REG(x) (0xbb - (x)) 221 + #define RK816_BAT_CUR_AVG_REGH 0xbc 222 + #define RK816_BAT_CUR_AVG_REGL 0xbd 223 + #define RK816_TS_ADC_REGH 0xbe 224 + #define RK816_TS_ADC_REGL 0xbf 225 + #define RK816_USB_ADC_REGH 0xc0 226 + #define RK816_USB_ADC_REGL 0xc1 227 + #define RK816_BAT_OCV_REGH 0xc2 228 + #define RK816_BAT_OCV_REGL 0xc3 229 + #define RK816_BAT_VOL_REGH 0xc4 230 + #define RK816_BAT_VOL_REGL 0xc5 231 + #define RK816_RELAX_ENTRY_THRES_REGH 0xc6 232 + #define RK816_RELAX_ENTRY_THRES_REGL 0xc7 233 + #define RK816_RELAX_EXIT_THRES_REGH 0xc8 234 + #define RK816_RELAX_EXIT_THRES_REGL 0xc9 235 + #define RK816_RELAX_VOL1_REGH 0xca 236 + #define RK816_RELAX_VOL1_REGL 0xcb 237 + #define RK816_RELAX_VOL2_REGH 0xcc 238 + #define RK816_RELAX_VOL2_REGL 0xcd 239 + #define RK816_RELAX_CUR1_REGH 0xce 240 + #define RK816_RELAX_CUR1_REGL 0xcf 241 + #define RK816_RELAX_CUR2_REGH 0xd0 242 + #define RK816_RELAX_CUR2_REGL 0xd1 243 + #define RK816_CAL_OFFSET_REGH 0xd2 244 + #define RK816_CAL_OFFSET_REGL 0xd3 245 + #define RK816_NON_ACT_TIMER_CNT_REG 0xd4 246 + #define RK816_VCALIB0_REGH 0xd5 247 + #define RK816_VCALIB0_REGL 0xd6 248 + #define RK816_VCALIB1_REGH 0xd7 249 + #define RK816_VCALIB1_REGL 0xd8 250 + #define RK816_FCC_GASCNT_REG(x) (0xdc - (x)) 251 + #define RK816_IOFFSET_REGH 0xdd 252 + #define RK816_IOFFSET_REGL 0xde 253 + #define RK816_SLEEP_CON_SAMP_CUR_REG 0xdf 254 + 255 + /* general purpose data registers 0xe0 ~ 0xf2 */ 256 + #define RK816_DATA_REG(x) (0xe0 + (x)) 257 + 116 258 /* RK818 */ 117 259 #define RK818_DCDC1 0 118 260 #define RK818_LDO1 4 ··· 933 791 #define VOUT_LO_INT BIT(0) 934 792 #define CLK32KOUT2_EN BIT(0) 935 793 794 + #define TEMP105C 0x08 936 795 #define TEMP115C 0x0c 937 796 #define TEMP_HOTDIE_MSK 0x0c 938 797 #define SLP_SD_MSK (0x3 << 2) ··· 1334 1191 RK806_ID = 0x8060, 1335 1192 RK808_ID = 0x0000, 1336 1193 RK809_ID = 0x8090, 1194 + RK816_ID = 0x8160, 1337 1195 RK817_ID = 0x8170, 1338 1196 RK818_ID = 0x8180, 1339 1197 };
+3 -2
include/linux/mfd/rohm-bd71828.h
··· 4 4 #ifndef __LINUX_MFD_BD71828_H__ 5 5 #define __LINUX_MFD_BD71828_H__ 6 6 7 + #include <linux/bits.h> 7 8 #include <linux/mfd/rohm-generic.h> 8 9 #include <linux/mfd/rohm-shared.h> 9 10 ··· 42 41 #define BD71828_REG_PS_CTRL_2 0x05 43 42 #define BD71828_REG_PS_CTRL_3 0x06 44 43 45 - //#define BD71828_REG_SWRESET 0x06 44 + #define BD71828_MASK_STATE_HBNT BIT(1) 45 + 46 46 #define BD71828_MASK_RUN_LVL_CTRL 0x30 47 47 48 48 /* Regulator control masks */ ··· 135 133 #define BD71828_REG_LDO5_VOLT 0x43 136 134 #define BD71828_REG_LDO5_VOLT_OPT 0x42 137 135 #define BD71828_REG_LDO6_EN 0x44 138 - //#define BD71828_REG_LDO6_VOLT 0x4 139 136 #define BD71828_REG_LDO7_EN 0x45 140 137 #define BD71828_REG_LDO7_VOLT 0x46 141 138
+338 -13
include/linux/mfd/tps6594.h
··· 18 18 TPS6594, 19 19 TPS6593, 20 20 LP8764, 21 + TPS65224, 21 22 }; 22 23 23 24 /* Macro to get page index from register address */ 24 25 #define TPS6594_REG_TO_PAGE(reg) ((reg) >> 8) 25 26 26 - /* Registers for page 0 of TPS6594 */ 27 + /* Registers for page 0 */ 27 28 #define TPS6594_REG_DEV_REV 0x01 28 29 29 30 #define TPS6594_REG_NVM_CODE_1 0x02 ··· 57 56 #define TPS6594_REG_GPIOX_OUT(gpio_inst) (TPS6594_REG_GPIO_OUT_1 + (gpio_inst) / 8) 58 57 #define TPS6594_REG_GPIOX_IN(gpio_inst) (TPS6594_REG_GPIO_IN_1 + (gpio_inst) / 8) 59 58 60 - #define TPS6594_REG_GPIO_IN_1 0x3f 61 - #define TPS6594_REG_GPIO_IN_2 0x40 62 - 63 59 #define TPS6594_REG_RAIL_SEL_1 0x41 64 60 #define TPS6594_REG_RAIL_SEL_2 0x42 65 61 #define TPS6594_REG_RAIL_SEL_3 0x43 ··· 68 70 #define TPS6594_REG_FSM_TRIG_MASK_3 0x48 69 71 70 72 #define TPS6594_REG_MASK_BUCK1_2 0x49 73 + #define TPS65224_REG_MASK_BUCKS 0x49 71 74 #define TPS6594_REG_MASK_BUCK3_4 0x4a 72 75 #define TPS6594_REG_MASK_BUCK5 0x4b 73 76 #define TPS6594_REG_MASK_LDO1_2 0x4c 77 + #define TPS65224_REG_MASK_LDOS 0x4c 74 78 #define TPS6594_REG_MASK_LDO3_4 0x4d 75 79 #define TPS6594_REG_MASK_VMON 0x4e 76 - #define TPS6594_REG_MASK_GPIO1_8_FALL 0x4f 77 - #define TPS6594_REG_MASK_GPIO1_8_RISE 0x50 80 + #define TPS6594_REG_MASK_GPIO_FALL 0x4f 81 + #define TPS6594_REG_MASK_GPIO_RISE 0x50 78 82 #define TPS6594_REG_MASK_GPIO9_11 0x51 79 83 #define TPS6594_REG_MASK_STARTUP 0x52 80 84 #define TPS6594_REG_MASK_MISC 0x53 ··· 174 174 175 175 #define TPS6594_REG_REGISTER_LOCK 0xa1 176 176 177 + #define TPS65224_REG_SRAM_ACCESS_1 0xa2 178 + #define TPS65224_REG_SRAM_ACCESS_2 0xa3 179 + #define TPS65224_REG_SRAM_ADDR_CTRL 0xa4 180 + #define TPS65224_REG_RECOV_CNT_PFSM_INCR 0xa5 177 181 #define TPS6594_REG_MANUFACTURING_VER 0xa6 178 182 179 183 #define TPS6594_REG_CUSTOMER_NVM_ID_REG 0xa7 ··· 186 182 187 183 #define TPS6594_REG_SOFT_REBOOT_REG 0xab 188 184 185 + #define TPS65224_REG_ADC_CTRL 0xac 186 + #define TPS65224_REG_ADC_RESULT_REG_1 0xad 187 + #define TPS65224_REG_ADC_RESULT_REG_2 0xae 189 188 #define TPS6594_REG_RTC_SECONDS 0xb5 190 189 #define TPS6594_REG_RTC_MINUTES 0xb6 191 190 #define TPS6594_REG_RTC_HOURS 0xb7 ··· 206 199 207 200 #define TPS6594_REG_RTC_CTRL_1 0xc2 208 201 #define TPS6594_REG_RTC_CTRL_2 0xc3 202 + #define TPS65224_REG_STARTUP_CTRL 0xc3 209 203 #define TPS6594_REG_RTC_STATUS 0xc4 210 204 #define TPS6594_REG_RTC_INTERRUPTS 0xc5 211 205 #define TPS6594_REG_RTC_COMP_LSB 0xc6 ··· 222 214 #define TPS6594_REG_PFSM_DELAY_REG_2 0xce 223 215 #define TPS6594_REG_PFSM_DELAY_REG_3 0xcf 224 216 #define TPS6594_REG_PFSM_DELAY_REG_4 0xd0 217 + #define TPS65224_REG_ADC_GAIN_COMP_REG 0xd0 218 + #define TPS65224_REG_CRC_CALC_CONTROL 0xef 219 + #define TPS65224_REG_REGMAP_USER_CRC_LOW 0xf0 220 + #define TPS65224_REG_REGMAP_USER_CRC_HIGH 0xf1 225 221 226 - /* Registers for page 1 of TPS6594 */ 222 + /* Registers for page 1 */ 227 223 #define TPS6594_REG_SERIAL_IF_CONFIG 0x11a 228 224 #define TPS6594_REG_I2C1_ID 0x122 229 225 #define TPS6594_REG_I2C2_ID 0x123 230 226 231 - /* Registers for page 4 of TPS6594 */ 227 + /* Registers for page 4 */ 232 228 #define TPS6594_REG_WD_ANSWER_REG 0x401 233 229 #define TPS6594_REG_WD_QUESTION_ANSW_CNT 0x402 234 230 #define TPS6594_REG_WD_WIN1_CFG 0x403 ··· 253 241 #define TPS6594_BIT_BUCK_PLDN BIT(5) 254 242 #define TPS6594_BIT_BUCK_RV_SEL BIT(7) 255 243 256 - /* BUCKX_CONF register field definition */ 244 + /* TPS6594 BUCKX_CONF register field definition */ 257 245 #define TPS6594_MASK_BUCK_SLEW_RATE GENMASK(2, 0) 258 246 #define TPS6594_MASK_BUCK_ILIM GENMASK(5, 3) 259 247 260 - /* BUCKX_PG_WINDOW register field definition */ 248 + /* TPS65224 BUCKX_CONF register field definition */ 249 + #define TPS65224_MASK_BUCK_SLEW_RATE GENMASK(1, 0) 250 + 251 + /* TPS6594 BUCKX_PG_WINDOW register field definition */ 261 252 #define TPS6594_MASK_BUCK_OV_THR GENMASK(2, 0) 262 253 #define TPS6594_MASK_BUCK_UV_THR GENMASK(5, 3) 263 254 264 - /* BUCKX VSET */ 265 - #define TPS6594_MASK_BUCKS_VSET GENMASK(7, 0) 255 + /* TPS65224 BUCKX_PG_WINDOW register field definition */ 256 + #define TPS65224_MASK_BUCK_VMON_THR GENMASK(1, 0) 257 + 258 + /* TPS6594 BUCKX_VOUT register field definition */ 259 + #define TPS6594_MASK_BUCKS_VSET GENMASK(7, 0) 260 + 261 + /* TPS65224 BUCKX_VOUT register field definition */ 262 + #define TPS65224_MASK_BUCK1_VSET GENMASK(7, 0) 263 + #define TPS65224_MASK_BUCKS_VSET GENMASK(6, 0) 266 264 267 265 /* LDOX_CTRL register field definition */ 268 266 #define TPS6594_BIT_LDO_EN BIT(0) ··· 280 258 #define TPS6594_BIT_LDO_VMON_EN BIT(4) 281 259 #define TPS6594_MASK_LDO_PLDN GENMASK(6, 5) 282 260 #define TPS6594_BIT_LDO_RV_SEL BIT(7) 261 + #define TPS65224_BIT_LDO_DISCHARGE_EN BIT(5) 283 262 284 263 /* LDORTC_CTRL register field definition */ 285 264 #define TPS6594_BIT_LDORTC_DIS BIT(0) ··· 294 271 #define TPS6594_MASK_LDO_OV_THR GENMASK(2, 0) 295 272 #define TPS6594_MASK_LDO_UV_THR GENMASK(5, 3) 296 273 274 + /* LDOX_PG_WINDOW register field definition */ 275 + #define TPS65224_MASK_LDO_VMON_THR GENMASK(1, 0) 276 + 297 277 /* VCCA_VMON_CTRL register field definition */ 298 278 #define TPS6594_BIT_VMON_EN BIT(0) 299 279 #define TPS6594_BIT_VMON1_EN BIT(1) ··· 304 278 #define TPS6594_BIT_VMON2_EN BIT(3) 305 279 #define TPS6594_BIT_VMON2_RV_SEL BIT(4) 306 280 #define TPS6594_BIT_VMON_DEGLITCH_SEL BIT(5) 281 + #define TPS65224_BIT_VMON_DEGLITCH_SEL GENMASK(7, 5) 307 282 308 283 /* VCCA_PG_WINDOW register field definition */ 309 284 #define TPS6594_MASK_VCCA_OV_THR GENMASK(2, 0) 310 285 #define TPS6594_MASK_VCCA_UV_THR GENMASK(5, 3) 286 + #define TPS65224_MASK_VCCA_VMON_THR GENMASK(1, 0) 311 287 #define TPS6594_BIT_VCCA_PG_SET BIT(6) 312 288 313 289 /* VMONX_PG_WINDOW register field definition */ 314 290 #define TPS6594_MASK_VMONX_OV_THR GENMASK(2, 0) 315 291 #define TPS6594_MASK_VMONX_UV_THR GENMASK(5, 3) 316 292 #define TPS6594_BIT_VMONX_RANGE BIT(6) 293 + 294 + /* VMONX_PG_WINDOW register field definition */ 295 + #define TPS65224_MASK_VMONX_THR GENMASK(1, 0) 317 296 318 297 /* GPIOX_CONF register field definition */ 319 298 #define TPS6594_BIT_GPIO_DIR BIT(0) ··· 327 296 #define TPS6594_BIT_GPIO_PU_PD_EN BIT(3) 328 297 #define TPS6594_BIT_GPIO_DEGLITCH_EN BIT(4) 329 298 #define TPS6594_MASK_GPIO_SEL GENMASK(7, 5) 299 + #define TPS65224_MASK_GPIO_SEL GENMASK(6, 5) 300 + #define TPS65224_MASK_GPIO_SEL_GPIO6 GENMASK(7, 5) 330 301 331 302 /* NPWRON_CONF register field definition */ 332 303 #define TPS6594_BIT_NRSTOUT_OD BIT(0) ··· 338 305 #define TPS6594_BIT_ENABLE_POL BIT(5) 339 306 #define TPS6594_MASK_NPWRON_SEL GENMASK(7, 6) 340 307 308 + /* POWER_ON_CONFIG register field definition */ 309 + #define TPS65224_BIT_NINT_ENDRV_PU_SEL BIT(0) 310 + #define TPS65224_BIT_NINT_ENDRV_SEL BIT(1) 311 + #define TPS65224_BIT_EN_PB_DEGL BIT(5) 312 + #define TPS65224_MASK_EN_PB_VSENSE_CONFIG GENMASK(7, 6) 313 + 341 314 /* GPIO_OUT_X register field definition */ 342 315 #define TPS6594_BIT_GPIOX_OUT(gpio_inst) BIT((gpio_inst) % 8) 343 316 344 317 /* GPIO_IN_X register field definition */ 345 318 #define TPS6594_BIT_GPIOX_IN(gpio_inst) BIT((gpio_inst) % 8) 346 319 #define TPS6594_BIT_NPWRON_IN BIT(3) 320 + 321 + /* GPIO_OUT_X register field definition */ 322 + #define TPS65224_BIT_GPIOX_OUT(gpio_inst) BIT((gpio_inst)) 323 + 324 + /* GPIO_IN_X register field definition */ 325 + #define TPS65224_BIT_GPIOX_IN(gpio_inst) BIT((gpio_inst)) 347 326 348 327 /* RAIL_SEL_1 register field definition */ 349 328 #define TPS6594_MASK_BUCK1_GRP_SEL GENMASK(1, 0) ··· 388 343 #define TPS6594_BIT_GPIOX_FSM_MASK(gpio_inst) BIT(((gpio_inst) << 1) % 8) 389 344 #define TPS6594_BIT_GPIOX_FSM_MASK_POL(gpio_inst) BIT(((gpio_inst) << 1) % 8 + 1) 390 345 346 + #define TPS65224_BIT_GPIOX_FSM_MASK(gpio_inst) BIT(((gpio_inst) << 1) % 6) 347 + #define TPS65224_BIT_GPIOX_FSM_MASK_POL(gpio_inst) BIT(((gpio_inst) << 1) % 6 + 1) 348 + 391 349 /* MASK_BUCKX register field definition */ 392 350 #define TPS6594_BIT_BUCKX_OV_MASK(buck_inst) BIT(((buck_inst) << 2) % 8) 393 351 #define TPS6594_BIT_BUCKX_UV_MASK(buck_inst) BIT(((buck_inst) << 2) % 8 + 1) ··· 409 361 #define TPS6594_BIT_VMON2_OV_MASK BIT(5) 410 362 #define TPS6594_BIT_VMON2_UV_MASK BIT(6) 411 363 364 + /* MASK_BUCK Register field definition */ 365 + #define TPS65224_BIT_BUCK1_UVOV_MASK BIT(0) 366 + #define TPS65224_BIT_BUCK2_UVOV_MASK BIT(1) 367 + #define TPS65224_BIT_BUCK3_UVOV_MASK BIT(2) 368 + #define TPS65224_BIT_BUCK4_UVOV_MASK BIT(4) 369 + 370 + /* MASK_LDO_VMON register field definition */ 371 + #define TPS65224_BIT_LDO1_UVOV_MASK BIT(0) 372 + #define TPS65224_BIT_LDO2_UVOV_MASK BIT(1) 373 + #define TPS65224_BIT_LDO3_UVOV_MASK BIT(2) 374 + #define TPS65224_BIT_VCCA_UVOV_MASK BIT(4) 375 + #define TPS65224_BIT_VMON1_UVOV_MASK BIT(5) 376 + #define TPS65224_BIT_VMON2_UVOV_MASK BIT(6) 377 + 412 378 /* MASK_GPIOX register field definition */ 413 379 #define TPS6594_BIT_GPIOX_FALL_MASK(gpio_inst) BIT((gpio_inst) < 8 ? \ 414 380 (gpio_inst) : (gpio_inst) % 8) 415 381 #define TPS6594_BIT_GPIOX_RISE_MASK(gpio_inst) BIT((gpio_inst) < 8 ? \ 416 382 (gpio_inst) : (gpio_inst) % 8 + 3) 383 + /* MASK_GPIOX register field definition */ 384 + #define TPS65224_BIT_GPIOX_FALL_MASK(gpio_inst) BIT((gpio_inst)) 385 + #define TPS65224_BIT_GPIOX_RISE_MASK(gpio_inst) BIT((gpio_inst)) 417 386 418 387 /* MASK_STARTUP register field definition */ 419 388 #define TPS6594_BIT_NPWRON_START_MASK BIT(0) 420 389 #define TPS6594_BIT_ENABLE_MASK BIT(1) 421 390 #define TPS6594_BIT_FSD_MASK BIT(4) 422 391 #define TPS6594_BIT_SOFT_REBOOT_MASK BIT(5) 392 + #define TPS65224_BIT_VSENSE_MASK BIT(0) 393 + #define TPS65224_BIT_PB_SHORT_MASK BIT(2) 423 394 424 395 /* MASK_MISC register field definition */ 425 396 #define TPS6594_BIT_BIST_PASS_MASK BIT(0) 426 397 #define TPS6594_BIT_EXT_CLK_MASK BIT(1) 398 + #define TPS65224_BIT_REG_UNLOCK_MASK BIT(2) 427 399 #define TPS6594_BIT_TWARN_MASK BIT(3) 400 + #define TPS65224_BIT_PB_LONG_MASK BIT(4) 401 + #define TPS65224_BIT_PB_FALL_MASK BIT(5) 402 + #define TPS65224_BIT_PB_RISE_MASK BIT(6) 403 + #define TPS65224_BIT_ADC_CONV_READY_MASK BIT(7) 428 404 429 405 /* MASK_MODERATE_ERR register field definition */ 430 406 #define TPS6594_BIT_BIST_FAIL_MASK BIT(1) ··· 463 391 #define TPS6594_BIT_ORD_SHUTDOWN_MASK BIT(1) 464 392 #define TPS6594_BIT_MCU_PWR_ERR_MASK BIT(2) 465 393 #define TPS6594_BIT_SOC_PWR_ERR_MASK BIT(3) 394 + #define TPS65224_BIT_COMM_ERR_MASK BIT(4) 395 + #define TPS65224_BIT_I2C2_ERR_MASK BIT(5) 466 396 467 397 /* MASK_COMM_ERR register field definition */ 468 398 #define TPS6594_BIT_COMM_FRM_ERR_MASK BIT(0) ··· 500 426 #define TPS6594_BIT_BUCK3_4_INT BIT(1) 501 427 #define TPS6594_BIT_BUCK5_INT BIT(2) 502 428 429 + /* INT_BUCK register field definition */ 430 + #define TPS65224_BIT_BUCK1_UVOV_INT BIT(0) 431 + #define TPS65224_BIT_BUCK2_UVOV_INT BIT(1) 432 + #define TPS65224_BIT_BUCK3_UVOV_INT BIT(2) 433 + #define TPS65224_BIT_BUCK4_UVOV_INT BIT(3) 434 + 503 435 /* INT_BUCKX register field definition */ 504 436 #define TPS6594_BIT_BUCKX_OV_INT(buck_inst) BIT(((buck_inst) << 2) % 8) 505 437 #define TPS6594_BIT_BUCKX_UV_INT(buck_inst) BIT(((buck_inst) << 2) % 8 + 1) ··· 516 436 #define TPS6594_BIT_LDO1_2_INT BIT(0) 517 437 #define TPS6594_BIT_LDO3_4_INT BIT(1) 518 438 #define TPS6594_BIT_VCCA_INT BIT(4) 439 + 440 + /* INT_LDO_VMON register field definition */ 441 + #define TPS65224_BIT_LDO1_UVOV_INT BIT(0) 442 + #define TPS65224_BIT_LDO2_UVOV_INT BIT(1) 443 + #define TPS65224_BIT_LDO3_UVOV_INT BIT(2) 444 + #define TPS65224_BIT_VCCA_UVOV_INT BIT(4) 445 + #define TPS65224_BIT_VMON1_UVOV_INT BIT(5) 446 + #define TPS65224_BIT_VMON2_UVOV_INT BIT(6) 519 447 520 448 /* INT_LDOX register field definition */ 521 449 #define TPS6594_BIT_LDOX_OV_INT(ldo_inst) BIT(((ldo_inst) << 2) % 8) ··· 550 462 /* INT_GPIOX register field definition */ 551 463 #define TPS6594_BIT_GPIOX_INT(gpio_inst) BIT(gpio_inst) 552 464 465 + /* INT_GPIO register field definition */ 466 + #define TPS65224_BIT_GPIO1_INT BIT(0) 467 + #define TPS65224_BIT_GPIO2_INT BIT(1) 468 + #define TPS65224_BIT_GPIO3_INT BIT(2) 469 + #define TPS65224_BIT_GPIO4_INT BIT(3) 470 + #define TPS65224_BIT_GPIO5_INT BIT(4) 471 + #define TPS65224_BIT_GPIO6_INT BIT(5) 472 + 553 473 /* INT_STARTUP register field definition */ 554 474 #define TPS6594_BIT_NPWRON_START_INT BIT(0) 475 + #define TPS65224_BIT_VSENSE_INT BIT(0) 555 476 #define TPS6594_BIT_ENABLE_INT BIT(1) 556 477 #define TPS6594_BIT_RTC_INT BIT(2) 478 + #define TPS65224_BIT_PB_SHORT_INT BIT(2) 557 479 #define TPS6594_BIT_FSD_INT BIT(4) 558 480 #define TPS6594_BIT_SOFT_REBOOT_INT BIT(5) 559 481 560 482 /* INT_MISC register field definition */ 561 483 #define TPS6594_BIT_BIST_PASS_INT BIT(0) 562 484 #define TPS6594_BIT_EXT_CLK_INT BIT(1) 485 + #define TPS65224_BIT_REG_UNLOCK_INT BIT(2) 563 486 #define TPS6594_BIT_TWARN_INT BIT(3) 487 + #define TPS65224_BIT_PB_LONG_INT BIT(4) 488 + #define TPS65224_BIT_PB_FALL_INT BIT(5) 489 + #define TPS65224_BIT_PB_RISE_INT BIT(6) 490 + #define TPS65224_BIT_ADC_CONV_READY_INT BIT(7) 564 491 565 492 /* INT_MODERATE_ERR register field definition */ 566 493 #define TPS6594_BIT_TSD_ORD_INT BIT(0) ··· 591 488 #define TPS6594_BIT_TSD_IMM_INT BIT(0) 592 489 #define TPS6594_BIT_VCCA_OVP_INT BIT(1) 593 490 #define TPS6594_BIT_PFSM_ERR_INT BIT(2) 491 + #define TPS65224_BIT_BG_XMON_INT BIT(3) 594 492 595 493 /* INT_FSM_ERR register field definition */ 596 494 #define TPS6594_BIT_IMM_SHUTDOWN_INT BIT(0) ··· 600 496 #define TPS6594_BIT_SOC_PWR_ERR_INT BIT(3) 601 497 #define TPS6594_BIT_COMM_ERR_INT BIT(4) 602 498 #define TPS6594_BIT_READBACK_ERR_INT BIT(5) 499 + #define TPS65224_BIT_I2C2_ERR_INT BIT(5) 603 500 #define TPS6594_BIT_ESM_INT BIT(6) 604 501 #define TPS6594_BIT_WD_INT BIT(7) 605 502 ··· 641 536 #define TPS6594_BIT_VMON2_OV_STAT BIT(5) 642 537 #define TPS6594_BIT_VMON2_UV_STAT BIT(6) 643 538 539 + /* STAT_LDO_VMON register field definition */ 540 + #define TPS65224_BIT_LDO1_UVOV_STAT BIT(0) 541 + #define TPS65224_BIT_LDO2_UVOV_STAT BIT(1) 542 + #define TPS65224_BIT_LDO3_UVOV_STAT BIT(2) 543 + #define TPS65224_BIT_VCCA_UVOV_STAT BIT(4) 544 + #define TPS65224_BIT_VMON1_UVOV_STAT BIT(5) 545 + #define TPS65224_BIT_VMON2_UVOV_STAT BIT(6) 546 + 644 547 /* STAT_STARTUP register field definition */ 548 + #define TPS65224_BIT_VSENSE_STAT BIT(0) 645 549 #define TPS6594_BIT_ENABLE_STAT BIT(1) 550 + #define TPS65224_BIT_PB_LEVEL_STAT BIT(2) 646 551 647 552 /* STAT_MISC register field definition */ 648 553 #define TPS6594_BIT_EXT_CLK_STAT BIT(1) ··· 664 549 /* STAT_SEVERE_ERR register field definition */ 665 550 #define TPS6594_BIT_TSD_IMM_STAT BIT(0) 666 551 #define TPS6594_BIT_VCCA_OVP_STAT BIT(1) 552 + #define TPS65224_BIT_BG_XMON_STAT BIT(3) 667 553 668 554 /* STAT_READBACK_ERR register field definition */ 669 555 #define TPS6594_BIT_EN_DRV_READBACK_STAT BIT(0) ··· 713 597 #define TPS6594_BIT_BB_CHARGER_EN BIT(0) 714 598 #define TPS6594_BIT_BB_ICHR BIT(1) 715 599 #define TPS6594_MASK_BB_VEOC GENMASK(3, 2) 600 + #define TPS65224_BIT_I2C1_SPI_CRC_EN BIT(4) 601 + #define TPS65224_BIT_I2C2_CRC_EN BIT(5) 716 602 #define TPS6594_BB_EOC_RDY BIT(7) 717 603 718 604 /* ENABLE_DRV_REG register field definition */ ··· 735 617 #define TPS6594_BIT_NRSTOUT_SOC_IN BIT(2) 736 618 #define TPS6594_BIT_FORCE_EN_DRV_LOW BIT(3) 737 619 #define TPS6594_BIT_SPMI_LPM_EN BIT(4) 620 + #define TPS65224_BIT_TSD_DISABLE BIT(5) 738 621 739 622 /* RECOV_CNT_REG_1 register field definition */ 740 623 #define TPS6594_MASK_RECOV_CNT GENMASK(3, 0) ··· 790 671 /* ESM_SOC_START_REG register field definition */ 791 672 #define TPS6594_BIT_ESM_SOC_START BIT(0) 792 673 674 + /* ESM_MCU_START_REG register field definition */ 675 + #define TPS65224_BIT_ESM_MCU_START BIT(0) 676 + 793 677 /* ESM_SOC_MODE_CFG register field definition */ 794 678 #define TPS6594_MASK_ESM_SOC_ERR_CNT_TH GENMASK(3, 0) 795 679 #define TPS6594_BIT_ESM_SOC_ENDRV BIT(5) 796 680 #define TPS6594_BIT_ESM_SOC_EN BIT(6) 797 681 #define TPS6594_BIT_ESM_SOC_MODE BIT(7) 798 682 683 + /* ESM_MCU_MODE_CFG register field definition */ 684 + #define TPS65224_MASK_ESM_MCU_ERR_CNT_TH GENMASK(3, 0) 685 + #define TPS65224_BIT_ESM_MCU_ENDRV BIT(5) 686 + #define TPS65224_BIT_ESM_MCU_EN BIT(6) 687 + #define TPS65224_BIT_ESM_MCU_MODE BIT(7) 688 + 799 689 /* ESM_SOC_ERR_CNT_REG register field definition */ 800 690 #define TPS6594_MASK_ESM_SOC_ERR_CNT GENMASK(4, 0) 691 + 692 + /* ESM_MCU_ERR_CNT_REG register field definition */ 693 + #define TPS6594_MASK_ESM_MCU_ERR_CNT GENMASK(4, 0) 801 694 802 695 /* REGISTER_LOCK register field definition */ 803 696 #define TPS6594_BIT_REGISTER_LOCK_STATUS BIT(0) ··· 817 686 /* VMON_CONF register field definition */ 818 687 #define TPS6594_MASK_VMON1_SLEW_RATE GENMASK(2, 0) 819 688 #define TPS6594_MASK_VMON2_SLEW_RATE GENMASK(5, 3) 689 + 690 + /* SRAM_ACCESS_1 Register field definition */ 691 + #define TPS65224_MASk_SRAM_UNLOCK_SEQ GENMASK(7, 0) 692 + 693 + /* SRAM_ACCESS_2 Register field definition */ 694 + #define TPS65224_BIT_SRAM_WRITE_MODE BIT(0) 695 + #define TPS65224_BIT_OTP_PROG_USER BIT(1) 696 + #define TPS65224_BIT_OTP_PROG_PFSM BIT(2) 697 + #define TPS65224_BIT_OTP_PROG_STATUS BIT(3) 698 + #define TPS65224_BIT_SRAM_UNLOCKED BIT(6) 699 + #define TPS65224_USER_PROG_ALLOWED BIT(7) 700 + 701 + /* SRAM_ADDR_CTRL Register field definition */ 702 + #define TPS65224_MASk_SRAM_SEL GENMASK(1, 0) 703 + 704 + /* RECOV_CNT_PFSM_INCR Register field definition */ 705 + #define TPS65224_BIT_INCREMENT_RECOV_CNT BIT(0) 706 + 707 + /* MANUFACTURING_VER Register field definition */ 708 + #define TPS65224_MASK_SILICON_REV GENMASK(7, 0) 709 + 710 + /* CUSTOMER_NVM_ID_REG Register field definition */ 711 + #define TPS65224_MASK_CUSTOMER_NVM_ID GENMASK(7, 0) 820 712 821 713 /* SOFT_REBOOT_REG register field definition */ 822 714 #define TPS6594_BIT_SOFT_REBOOT BIT(0) ··· 909 755 #define TPS6594_BIT_I2C2_CRC_EN BIT(2) 910 756 #define TPS6594_MASK_T_CRC GENMASK(7, 3) 911 757 758 + /* ADC_CTRL Register field definition */ 759 + #define TPS65224_BIT_ADC_START BIT(0) 760 + #define TPS65224_BIT_ADC_CONT_CONV BIT(1) 761 + #define TPS65224_BIT_ADC_THERMAL_SEL BIT(2) 762 + #define TPS65224_BIT_ADC_RDIV_EN BIT(3) 763 + #define TPS65224_BIT_ADC_STATUS BIT(7) 764 + 765 + /* ADC_RESULT_REG_1 Register field definition */ 766 + #define TPS65224_MASK_ADC_RESULT_11_4 GENMASK(7, 0) 767 + 768 + /* ADC_RESULT_REG_2 Register field definition */ 769 + #define TPS65224_MASK_ADC_RESULT_3_0 GENMASK(7, 4) 770 + 771 + /* STARTUP_CTRL Register field definition */ 772 + #define TPS65224_MASK_STARTUP_DEST GENMASK(6, 5) 773 + #define TPS65224_BIT_FIRST_STARTUP_DONE BIT(7) 774 + 775 + /* SCRATCH_PAD_REG_1 Register field definition */ 776 + #define TPS6594_MASK_SCRATCH_PAD_1 GENMASK(7, 0) 777 + 778 + /* SCRATCH_PAD_REG_2 Register field definition */ 779 + #define TPS6594_MASK_SCRATCH_PAD_2 GENMASK(7, 0) 780 + 781 + /* SCRATCH_PAD_REG_3 Register field definition */ 782 + #define TPS6594_MASK_SCRATCH_PAD_3 GENMASK(7, 0) 783 + 784 + /* SCRATCH_PAD_REG_4 Register field definition */ 785 + #define TPS6594_MASK_SCRATCH_PAD_4 GENMASK(7, 0) 786 + 787 + /* PFSM_DELAY_REG_1 Register field definition */ 788 + #define TPS6594_MASK_PFSM_DELAY1 GENMASK(7, 0) 789 + 790 + /* PFSM_DELAY_REG_2 Register field definition */ 791 + #define TPS6594_MASK_PFSM_DELAY2 GENMASK(7, 0) 792 + 793 + /* PFSM_DELAY_REG_3 Register field definition */ 794 + #define TPS6594_MASK_PFSM_DELAY3 GENMASK(7, 0) 795 + 796 + /* PFSM_DELAY_REG_4 Register field definition */ 797 + #define TPS6594_MASK_PFSM_DELAY4 GENMASK(7, 0) 798 + 799 + /* CRC_CALC_CONTROL Register field definition */ 800 + #define TPS65224_BIT_RUN_CRC_BIST BIT(0) 801 + #define TPS65224_BIT_RUN_CRC_UPDATE BIT(1) 802 + 803 + /* ADC_GAIN_COMP_REG Register field definition */ 804 + #define TPS65224_MASK_ADC_GAIN_COMP GENMASK(7, 0) 805 + 806 + /* REGMAP_USER_CRC_LOW Register field definition */ 807 + #define TPS65224_MASK_REGMAP_USER_CRC16_LOW GENMASK(7, 0) 808 + 809 + /* REGMAP_USER_CRC_HIGH Register field definition */ 810 + #define TPS65224_MASK_REGMAP_USER_CRC16_HIGH GENMASK(7, 0) 811 + 812 + /* WD_ANSWER_REG Register field definition */ 813 + #define TPS6594_MASK_WD_ANSWER GENMASK(7, 0) 814 + 912 815 /* WD_QUESTION_ANSW_CNT register field definition */ 913 816 #define TPS6594_MASK_WD_QUESTION GENMASK(3, 0) 914 817 #define TPS6594_MASK_WD_ANSW_CNT GENMASK(5, 4) 818 + #define TPS65224_BIT_INT_TOP_STATUS BIT(7) 819 + 820 + /* WD WIN1_CFG register field definition */ 821 + #define TPS6594_MASK_WD_WIN1_CFG GENMASK(6, 0) 822 + 823 + /* WD WIN2_CFG register field definition */ 824 + #define TPS6594_MASK_WD_WIN2_CFG GENMASK(6, 0) 825 + 826 + /* WD LongWin register field definition */ 827 + #define TPS6594_MASK_WD_LONGWIN_CFG GENMASK(7, 0) 915 828 916 829 /* WD_MODE_REG register field definition */ 917 830 #define TPS6594_BIT_WD_RETURN_LONGWIN BIT(0) 918 831 #define TPS6594_BIT_WD_MODE_SELECT BIT(1) 919 832 #define TPS6594_BIT_WD_PWRHOLD BIT(2) 833 + #define TPS65224_BIT_WD_ENDRV_SEL BIT(6) 834 + #define TPS65224_BIT_WD_CNT_SEL BIT(7) 920 835 921 836 /* WD_QA_CFG register field definition */ 922 837 #define TPS6594_MASK_WD_QUESTION_SEED GENMASK(3, 0) ··· 1216 993 #define TPS6594_IRQ_NAME_ALARM "alarm" 1217 994 #define TPS6594_IRQ_NAME_POWERUP "powerup" 1218 995 996 + /* IRQs */ 997 + enum tps65224_irqs { 998 + /* INT_BUCK register */ 999 + TPS65224_IRQ_BUCK1_UVOV, 1000 + TPS65224_IRQ_BUCK2_UVOV, 1001 + TPS65224_IRQ_BUCK3_UVOV, 1002 + TPS65224_IRQ_BUCK4_UVOV, 1003 + /* INT_LDO_VMON register */ 1004 + TPS65224_IRQ_LDO1_UVOV, 1005 + TPS65224_IRQ_LDO2_UVOV, 1006 + TPS65224_IRQ_LDO3_UVOV, 1007 + TPS65224_IRQ_VCCA_UVOV, 1008 + TPS65224_IRQ_VMON1_UVOV, 1009 + TPS65224_IRQ_VMON2_UVOV, 1010 + /* INT_GPIO register */ 1011 + TPS65224_IRQ_GPIO1, 1012 + TPS65224_IRQ_GPIO2, 1013 + TPS65224_IRQ_GPIO3, 1014 + TPS65224_IRQ_GPIO4, 1015 + TPS65224_IRQ_GPIO5, 1016 + TPS65224_IRQ_GPIO6, 1017 + /* INT_STARTUP register */ 1018 + TPS65224_IRQ_VSENSE, 1019 + TPS65224_IRQ_ENABLE, 1020 + TPS65224_IRQ_PB_SHORT, 1021 + TPS65224_IRQ_FSD, 1022 + TPS65224_IRQ_SOFT_REBOOT, 1023 + /* INT_MISC register */ 1024 + TPS65224_IRQ_BIST_PASS, 1025 + TPS65224_IRQ_EXT_CLK, 1026 + TPS65224_IRQ_REG_UNLOCK, 1027 + TPS65224_IRQ_TWARN, 1028 + TPS65224_IRQ_PB_LONG, 1029 + TPS65224_IRQ_PB_FALL, 1030 + TPS65224_IRQ_PB_RISE, 1031 + TPS65224_IRQ_ADC_CONV_READY, 1032 + /* INT_MODERATE_ERR register */ 1033 + TPS65224_IRQ_TSD_ORD, 1034 + TPS65224_IRQ_BIST_FAIL, 1035 + TPS65224_IRQ_REG_CRC_ERR, 1036 + TPS65224_IRQ_RECOV_CNT, 1037 + /* INT_SEVERE_ERR register */ 1038 + TPS65224_IRQ_TSD_IMM, 1039 + TPS65224_IRQ_VCCA_OVP, 1040 + TPS65224_IRQ_PFSM_ERR, 1041 + TPS65224_IRQ_BG_XMON, 1042 + /* INT_FSM_ERR register */ 1043 + TPS65224_IRQ_IMM_SHUTDOWN, 1044 + TPS65224_IRQ_ORD_SHUTDOWN, 1045 + TPS65224_IRQ_MCU_PWR_ERR, 1046 + TPS65224_IRQ_SOC_PWR_ERR, 1047 + TPS65224_IRQ_COMM_ERR, 1048 + TPS65224_IRQ_I2C2_ERR, 1049 + }; 1050 + 1051 + #define TPS65224_IRQ_NAME_BUCK1_UVOV "buck1_uvov" 1052 + #define TPS65224_IRQ_NAME_BUCK2_UVOV "buck2_uvov" 1053 + #define TPS65224_IRQ_NAME_BUCK3_UVOV "buck3_uvov" 1054 + #define TPS65224_IRQ_NAME_BUCK4_UVOV "buck4_uvov" 1055 + #define TPS65224_IRQ_NAME_LDO1_UVOV "ldo1_uvov" 1056 + #define TPS65224_IRQ_NAME_LDO2_UVOV "ldo2_uvov" 1057 + #define TPS65224_IRQ_NAME_LDO3_UVOV "ldo3_uvov" 1058 + #define TPS65224_IRQ_NAME_VCCA_UVOV "vcca_uvov" 1059 + #define TPS65224_IRQ_NAME_VMON1_UVOV "vmon1_uvov" 1060 + #define TPS65224_IRQ_NAME_VMON2_UVOV "vmon2_uvov" 1061 + #define TPS65224_IRQ_NAME_GPIO1 "gpio1" 1062 + #define TPS65224_IRQ_NAME_GPIO2 "gpio2" 1063 + #define TPS65224_IRQ_NAME_GPIO3 "gpio3" 1064 + #define TPS65224_IRQ_NAME_GPIO4 "gpio4" 1065 + #define TPS65224_IRQ_NAME_GPIO5 "gpio5" 1066 + #define TPS65224_IRQ_NAME_GPIO6 "gpio6" 1067 + #define TPS65224_IRQ_NAME_VSENSE "vsense" 1068 + #define TPS65224_IRQ_NAME_ENABLE "enable" 1069 + #define TPS65224_IRQ_NAME_PB_SHORT "pb_short" 1070 + #define TPS65224_IRQ_NAME_FSD "fsd" 1071 + #define TPS65224_IRQ_NAME_SOFT_REBOOT "soft_reboot" 1072 + #define TPS65224_IRQ_NAME_BIST_PASS "bist_pass" 1073 + #define TPS65224_IRQ_NAME_EXT_CLK "ext_clk" 1074 + #define TPS65224_IRQ_NAME_REG_UNLOCK "reg_unlock" 1075 + #define TPS65224_IRQ_NAME_TWARN "twarn" 1076 + #define TPS65224_IRQ_NAME_PB_LONG "pb_long" 1077 + #define TPS65224_IRQ_NAME_PB_FALL "pb_fall" 1078 + #define TPS65224_IRQ_NAME_PB_RISE "pb_rise" 1079 + #define TPS65224_IRQ_NAME_ADC_CONV_READY "adc_conv_ready" 1080 + #define TPS65224_IRQ_NAME_TSD_ORD "tsd_ord" 1081 + #define TPS65224_IRQ_NAME_BIST_FAIL "bist_fail" 1082 + #define TPS65224_IRQ_NAME_REG_CRC_ERR "reg_crc_err" 1083 + #define TPS65224_IRQ_NAME_RECOV_CNT "recov_cnt" 1084 + #define TPS65224_IRQ_NAME_TSD_IMM "tsd_imm" 1085 + #define TPS65224_IRQ_NAME_VCCA_OVP "vcca_ovp" 1086 + #define TPS65224_IRQ_NAME_PFSM_ERR "pfsm_err" 1087 + #define TPS65224_IRQ_NAME_BG_XMON "bg_xmon" 1088 + #define TPS65224_IRQ_NAME_IMM_SHUTDOWN "imm_shutdown" 1089 + #define TPS65224_IRQ_NAME_ORD_SHUTDOWN "ord_shutdown" 1090 + #define TPS65224_IRQ_NAME_MCU_PWR_ERR "mcu_pwr_err" 1091 + #define TPS65224_IRQ_NAME_SOC_PWR_ERR "soc_pwr_err" 1092 + #define TPS65224_IRQ_NAME_COMM_ERR "comm_err" 1093 + #define TPS65224_IRQ_NAME_I2C2_ERR "i2c2_err" 1094 + #define TPS65224_IRQ_NAME_POWERUP "powerup" 1095 + 1219 1096 /** 1220 1097 * struct tps6594 - device private data structure 1221 1098 * ··· 1337 1014 struct regmap_irq_chip_data *irq_data; 1338 1015 }; 1339 1016 1340 - bool tps6594_is_volatile_reg(struct device *dev, unsigned int reg); 1017 + extern const struct regmap_access_table tps6594_volatile_table; 1018 + extern const struct regmap_access_table tps65224_volatile_table; 1019 + 1341 1020 int tps6594_device_init(struct tps6594 *tps, bool enable_crc); 1342 1021 1343 1022 #endif /* __LINUX_MFD_TPS6594_H */