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 regulators. 22 23 allOf: 24 - - $ref: ../input/input.yaml 25 26 properties: 27 compatible: ··· 57 58 switchldo1: 59 type: object 60 - $ref: ../regulator/regulator.yaml 61 62 properties: 63 regulator-name: true ··· 76 77 "^(dcdc[0-4]|ldo[0-9]|ldo1[1-2])$": 78 type: object 79 - $ref: ../regulator/regulator.yaml 80 81 properties: 82 regulator-name: true
··· 21 regulators. 22 23 allOf: 24 + - $ref: /schemas/input/input.yaml 25 26 properties: 27 compatible: ··· 57 58 switchldo1: 59 type: object 60 + $ref: /schemas/regulator/regulator.yaml 61 62 properties: 63 regulator-name: true ··· 76 77 "^(dcdc[0-4]|ldo[0-9]|ldo1[1-2])$": 78 type: object 79 + $ref: /schemas/regulator/regulator.yaml 80 81 properties: 82 regulator-name: true
+7 -7
Documentation/devicetree/bindings/mfd/allwinner,sun6i-a31-prcm.yaml
··· 20 maxItems: 1 21 22 patternProperties: 23 - "^.*_(clk|rst)$": 24 type: object 25 unevaluatedProperties: false 26 ··· 171 compatible = "allwinner,sun6i-a31-prcm"; 172 reg = <0x01f01400 0x200>; 173 174 - ar100: ar100_clk { 175 compatible = "allwinner,sun6i-a31-ar100-clk"; 176 #clock-cells = <0>; 177 clocks = <&rtc 0>, <&osc24M>, ··· 180 clock-output-names = "ar100"; 181 }; 182 183 - ahb0: ahb0_clk { 184 compatible = "fixed-factor-clock"; 185 #clock-cells = <0>; 186 clock-div = <1>; ··· 189 clock-output-names = "ahb0"; 190 }; 191 192 - apb0: apb0_clk { 193 compatible = "allwinner,sun6i-a31-apb0-clk"; 194 #clock-cells = <0>; 195 clocks = <&ahb0>; 196 clock-output-names = "apb0"; 197 }; 198 199 - apb0_gates: apb0_gates_clk { 200 compatible = "allwinner,sun6i-a31-apb0-gates-clk"; 201 #clock-cells = <1>; 202 clocks = <&apb0>; ··· 206 "apb0_i2c"; 207 }; 208 209 - ir_clk: ir_clk { 210 #clock-cells = <0>; 211 compatible = "allwinner,sun4i-a10-mod0-clk"; 212 clocks = <&rtc 0>, <&osc24M>; 213 clock-output-names = "ir"; 214 }; 215 216 - apb0_rst: apb0_rst { 217 compatible = "allwinner,sun6i-a31-clock-reset"; 218 #reset-cells = <1>; 219 };
··· 20 maxItems: 1 21 22 patternProperties: 23 + "^.*-(clk|rst)$": 24 type: object 25 unevaluatedProperties: false 26 ··· 171 compatible = "allwinner,sun6i-a31-prcm"; 172 reg = <0x01f01400 0x200>; 173 174 + ar100: ar100-clk { 175 compatible = "allwinner,sun6i-a31-ar100-clk"; 176 #clock-cells = <0>; 177 clocks = <&rtc 0>, <&osc24M>, ··· 180 clock-output-names = "ar100"; 181 }; 182 183 + ahb0: ahb0-clk { 184 compatible = "fixed-factor-clock"; 185 #clock-cells = <0>; 186 clock-div = <1>; ··· 189 clock-output-names = "ahb0"; 190 }; 191 192 + apb0: apb0-clk { 193 compatible = "allwinner,sun6i-a31-apb0-clk"; 194 #clock-cells = <0>; 195 clocks = <&ahb0>; 196 clock-output-names = "apb0"; 197 }; 198 199 + apb0_gates: apb0-gates-clk { 200 compatible = "allwinner,sun6i-a31-apb0-gates-clk"; 201 #clock-cells = <1>; 202 clocks = <&apb0>; ··· 206 "apb0_i2c"; 207 }; 208 209 + ir_clk: ir-clk { 210 #clock-cells = <0>; 211 compatible = "allwinner,sun4i-a10-mod0-clk"; 212 clocks = <&rtc 0>, <&osc24M>; 213 clock-output-names = "ir"; 214 }; 215 216 + apb0_rst: apb0-rst { 217 compatible = "allwinner,sun6i-a31-clock-reset"; 218 #reset-cells = <1>; 219 };
+12 -4
Documentation/devicetree/bindings/mfd/aspeed,ast2x00-scu.yaml
··· 47 type: object 48 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 54 55 '^interrupt-controller@[0-9a-f]+$': 56 description: See Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2xxx-scu-ic.txt
··· 47 type: object 48 49 '^pinctrl(@[0-9a-f]+)?$': 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 62 63 '^interrupt-controller@[0-9a-f]+$': 64 description: See Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2xxx-scu-ic.txt
+4 -4
Documentation/devicetree/bindings/mfd/brcm,cru.yaml
··· 34 35 patternProperties: 36 '^clock-controller@[a-f0-9]+$': 37 - $ref: ../clock/brcm,iproc-clocks.yaml 38 39 '^phy@[a-f0-9]+$': 40 - $ref: ../phy/bcm-ns-usb2-phy.yaml 41 42 '^pinctrl@[a-f0-9]+$': 43 - $ref: ../pinctrl/brcm,ns-pinmux.yaml 44 45 '^syscon@[a-f0-9]+$': 46 $ref: syscon.yaml 47 48 '^thermal@[a-f0-9]+$': 49 - $ref: ../thermal/brcm,ns-thermal.yaml 50 51 additionalProperties: false 52
··· 34 35 patternProperties: 36 '^clock-controller@[a-f0-9]+$': 37 + $ref: /schemas/clock/brcm,iproc-clocks.yaml 38 39 '^phy@[a-f0-9]+$': 40 + $ref: /schemas/phy/bcm-ns-usb2-phy.yaml 41 42 '^pinctrl@[a-f0-9]+$': 43 + $ref: /schemas/pinctrl/brcm,ns-pinmux.yaml 44 45 '^syscon@[a-f0-9]+$': 46 $ref: syscon.yaml 47 48 '^thermal@[a-f0-9]+$': 49 + $ref: /schemas/thermal/brcm,ns-thermal.yaml 50 51 additionalProperties: false 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 34 patternProperties: 35 '^reset-controller@[a-f0-9]+$': 36 - $ref: ../reset/brcm,bcm4908-misc-pcie-reset.yaml 37 38 additionalProperties: false 39
··· 33 34 patternProperties: 35 '^reset-controller@[a-f0-9]+$': 36 + $ref: /schemas/reset/brcm,bcm4908-misc-pcie-reset.yaml 37 38 additionalProperties: false 39
+3 -3
Documentation/devicetree/bindings/mfd/canaan,k210-sysctl.yaml
··· 36 clock-controller: 37 # Child node 38 type: object 39 - $ref: ../clock/canaan,k210-clk.yaml 40 description: 41 Clock controller for the SoC clocks. This child node definition 42 should follow the bindings specified in ··· 45 reset-controller: 46 # Child node 47 type: object 48 - $ref: ../reset/canaan,k210-rst.yaml 49 description: 50 Reset controller for the SoC. This child node definition 51 should follow the bindings specified in ··· 54 syscon-reboot: 55 # Child node 56 type: object 57 - $ref: ../power/reset/syscon-reboot.yaml 58 description: 59 Reboot method for the SoC. This child node definition 60 should follow the bindings specified in
··· 36 clock-controller: 37 # Child node 38 type: object 39 + $ref: /schemas/clock/canaan,k210-clk.yaml 40 description: 41 Clock controller for the SoC clocks. This child node definition 42 should follow the bindings specified in ··· 45 reset-controller: 46 # Child node 47 type: object 48 + $ref: /schemas/reset/canaan,k210-rst.yaml 49 description: 50 Reset controller for the SoC. This child node definition 51 should follow the bindings specified in ··· 54 syscon-reboot: 55 # Child node 56 type: object 57 + $ref: /schemas/power/reset/syscon-reboot.yaml 58 description: 59 Reboot method for the SoC. This child node definition 60 should follow the bindings specified in
+2 -2
Documentation/devicetree/bindings/mfd/delta,tn48m-cpld.yaml
··· 42 43 patternProperties: 44 "^gpio(@[0-9a-f]+)?$": 45 - $ref: ../gpio/delta,tn48m-gpio.yaml 46 47 "^reset-controller?$": 48 - $ref: ../reset/delta,tn48m-reset.yaml 49 50 additionalProperties: false 51
··· 42 43 patternProperties: 44 "^gpio(@[0-9a-f]+)?$": 45 + $ref: /schemas/gpio/delta,tn48m-gpio.yaml 46 47 "^reset-controller?$": 48 + $ref: /schemas/reset/delta,tn48m-reset.yaml 49 50 additionalProperties: false 51
+2 -2
Documentation/devicetree/bindings/mfd/iqs62x.yaml
··· 38 device name with ".bin" as the extension (e.g. iqs620a.bin for IQS620A). 39 40 keys: 41 - $ref: ../input/iqs62x-keys.yaml 42 43 pwm: 44 - $ref: ../pwm/iqs620a-pwm.yaml 45 46 required: 47 - compatible
··· 38 device name with ".bin" as the extension (e.g. iqs620a.bin for IQS620A). 39 40 keys: 41 + $ref: /schemas/input/iqs62x-keys.yaml 42 43 pwm: 44 + $ref: /schemas/pwm/iqs620a-pwm.yaml 45 46 required: 47 - compatible
+5 -5
Documentation/devicetree/bindings/mfd/kontron,sl28cpld.yaml
··· 39 40 patternProperties: 41 "^gpio(@[0-9a-f]+)?$": 42 - $ref: ../gpio/kontron,sl28cpld-gpio.yaml 43 44 "^hwmon(@[0-9a-f]+)?$": 45 - $ref: ../hwmon/kontron,sl28cpld-hwmon.yaml 46 47 "^interrupt-controller(@[0-9a-f]+)?$": 48 - $ref: ../interrupt-controller/kontron,sl28cpld-intc.yaml 49 50 "^pwm(@[0-9a-f]+)?$": 51 - $ref: ../pwm/kontron,sl28cpld-pwm.yaml 52 53 "^watchdog(@[0-9a-f]+)?$": 54 - $ref: ../watchdog/kontron,sl28cpld-wdt.yaml 55 56 required: 57 - "#address-cells"
··· 39 40 patternProperties: 41 "^gpio(@[0-9a-f]+)?$": 42 + $ref: /schemas/gpio/kontron,sl28cpld-gpio.yaml 43 44 "^hwmon(@[0-9a-f]+)?$": 45 + $ref: /schemas/hwmon/kontron,sl28cpld-hwmon.yaml 46 47 "^interrupt-controller(@[0-9a-f]+)?$": 48 + $ref: /schemas/interrupt-controller/kontron,sl28cpld-intc.yaml 49 50 "^pwm(@[0-9a-f]+)?$": 51 + $ref: /schemas/pwm/kontron,sl28cpld-pwm.yaml 52 53 "^watchdog(@[0-9a-f]+)?$": 54 + $ref: /schemas/watchdog/kontron,sl28cpld-wdt.yaml 55 56 required: 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 Single string containing the name of the GPIO line. 54 55 regulators: 56 - $ref: ../regulator/max77650-regulator.yaml 57 58 charger: 59 - $ref: ../power/supply/max77650-charger.yaml 60 61 leds: 62 - $ref: ../leds/leds-max77650.yaml 63 64 onkey: 65 - $ref: ../input/max77650-onkey.yaml 66 67 required: 68 - compatible
··· 53 Single string containing the name of the GPIO line. 54 55 regulators: 56 + $ref: /schemas/regulator/max77650-regulator.yaml 57 58 charger: 59 + $ref: /schemas/power/supply/max77650-charger.yaml 60 61 leds: 62 + $ref: /schemas/leds/leds-max77650.yaml 63 64 onkey: 65 + $ref: /schemas/input/max77650-onkey.yaml 66 67 required: 68 - compatible
+1 -1
Documentation/devicetree/bindings/mfd/maxim,max77686.yaml
··· 35 maxItems: 1 36 37 voltage-regulators: 38 - $ref: ../regulator/maxim,max77686.yaml 39 description: 40 List of child nodes that specify the regulators. 41
··· 35 maxItems: 1 36 37 voltage-regulators: 38 + $ref: /schemas/regulator/maxim,max77686.yaml 39 description: 40 List of child nodes that specify the regulators. 41
+1 -1
Documentation/devicetree/bindings/mfd/maxim,max77693.yaml
··· 81 - pwms 82 83 regulators: 84 - $ref: ../regulator/maxim,max77693.yaml 85 description: 86 List of child nodes that specify the regulators. 87
··· 81 - pwms 82 83 regulators: 84 + $ref: /schemas/regulator/maxim,max77693.yaml 85 description: 86 List of child nodes that specify the regulators. 87
+4
Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
··· 160 type: object 161 $ref: /schemas/nvmem/qcom,spmi-sdam.yaml# 162 163 "phy@[0-9a-f]+$": 164 type: object 165 $ref: /schemas/phy/qcom,snps-eusb2-repeater.yaml#
··· 160 type: object 161 $ref: /schemas/nvmem/qcom,spmi-sdam.yaml# 162 163 + "^pbs@[0-9a-f]+$": 164 + type: object 165 + $ref: /schemas/soc/qcom/qcom,pbs.yaml# 166 + 167 "phy@[0-9a-f]+$": 168 type: object 169 $ref: /schemas/phy/qcom,snps-eusb2-repeater.yaml#
+1
Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml
··· 28 - qcom,sdm845-tcsr 29 - qcom,sdx55-tcsr 30 - qcom,sdx65-tcsr 31 - qcom,sm4450-tcsr 32 - qcom,sm6115-tcsr 33 - qcom,sm8150-tcsr
··· 28 - qcom,sdm845-tcsr 29 - qcom,sdx55-tcsr 30 - qcom,sdx65-tcsr 31 + - qcom,sdx75-tcsr 32 - qcom,sm4450-tcsr 33 - qcom,sm6115-tcsr 34 - qcom,sm8150-tcsr
+1
Documentation/devicetree/bindings/mfd/qcom-pm8xxx.yaml
··· 19 - enum: 20 - qcom,pm8058 21 - qcom,pm8821 22 - qcom,pm8921 23 - items: 24 - enum:
··· 19 - enum: 20 - qcom,pm8058 21 - qcom,pm8821 22 + - qcom,pm8901 23 - qcom,pm8921 24 - items: 25 - enum:
+2 -2
Documentation/devicetree/bindings/mfd/richtek,rt4831.yaml
··· 37 maxItems: 1 38 39 regulators: 40 - $ref: ../regulator/richtek,rt4831-regulator.yaml 41 42 backlight: 43 - $ref: ../leds/backlight/richtek,rt4831-backlight.yaml 44 45 required: 46 - compatible
··· 37 maxItems: 1 38 39 regulators: 40 + $ref: /schemas/regulator/richtek,rt4831-regulator.yaml 41 42 backlight: 43 + $ref: /schemas/leds/backlight/richtek,rt4831-backlight.yaml 44 45 required: 46 - compatible
+3 -3
Documentation/devicetree/bindings/mfd/ricoh,rn5t618.yaml
··· 28 regulators: 29 patternProperties: 30 "^(DCDC[1-4]|LDO[1-5]|LDORTC[12])$": 31 - $ref: ../regulator/regulator.yaml 32 additionalProperties: false 33 - if: 34 properties: ··· 40 regulators: 41 patternProperties: 42 "^(DCDC[1-3]|LDO[1-5]|LDORTC[12])$": 43 - $ref: ../regulator/regulator.yaml 44 additionalProperties: false 45 - if: 46 properties: ··· 52 regulators: 53 patternProperties: 54 "^(DCDC[1-5]|LDO[1-9]|LDO10|LDORTC[12])$": 55 - $ref: ../regulator/regulator.yaml 56 additionalProperties: false 57 58 properties:
··· 28 regulators: 29 patternProperties: 30 "^(DCDC[1-4]|LDO[1-5]|LDORTC[12])$": 31 + $ref: /schemas/regulator/regulator.yaml 32 additionalProperties: false 33 - if: 34 properties: ··· 40 regulators: 41 patternProperties: 42 "^(DCDC[1-3]|LDO[1-5]|LDORTC[12])$": 43 + $ref: /schemas/regulator/regulator.yaml 44 additionalProperties: false 45 - if: 46 properties: ··· 52 regulators: 53 patternProperties: 54 "^(DCDC[1-5]|LDO[1-9]|LDO10|LDORTC[12])$": 55 + $ref: /schemas/regulator/regulator.yaml 56 additionalProperties: false 57 58 properties:
+1 -1
Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml
··· 82 patternProperties: 83 "^(DCDC_REG[1-4]|LDO_REG[1-3])$": 84 type: object 85 - $ref: ../regulator/regulator.yaml# 86 unevaluatedProperties: false 87 unevaluatedProperties: false 88
··· 82 patternProperties: 83 "^(DCDC_REG[1-4]|LDO_REG[1-3])$": 84 type: object 85 + $ref: /schemas/regulator/regulator.yaml# 86 unevaluatedProperties: false 87 unevaluatedProperties: false 88
+1 -1
Documentation/devicetree/bindings/mfd/rockchip,rk808.yaml
··· 109 patternProperties: 110 "^(DCDC_REG[1-4]|LDO_REG[1-8]|SWITCH_REG[1-2])$": 111 type: object 112 - $ref: ../regulator/regulator.yaml# 113 unevaluatedProperties: false 114 unevaluatedProperties: false 115
··· 109 patternProperties: 110 "^(DCDC_REG[1-4]|LDO_REG[1-8]|SWITCH_REG[1-2])$": 111 type: object 112 + $ref: /schemas/regulator/regulator.yaml# 113 unevaluatedProperties: false 114 unevaluatedProperties: false 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 "^(LDO_REG[1-9]|DCDC_REG[1-4]|BOOST|OTG_SWITCH)$": 92 type: object 93 unevaluatedProperties: false 94 - $ref: ../regulator/regulator.yaml# 95 unevaluatedProperties: false 96 97 clocks:
··· 91 "^(LDO_REG[1-9]|DCDC_REG[1-4]|BOOST|OTG_SWITCH)$": 92 type: object 93 unevaluatedProperties: false 94 + $ref: /schemas/regulator/regulator.yaml# 95 unevaluatedProperties: false 96 97 clocks:
+1 -1
Documentation/devicetree/bindings/mfd/rockchip,rk818.yaml
··· 101 patternProperties: 102 "^(DCDC_REG[1-4]|DCDC_BOOST|LDO_REG[1-9]|SWITCH_REG|HDMI_SWITCH|OTG_SWITCH)$": 103 type: object 104 - $ref: ../regulator/regulator.yaml# 105 unevaluatedProperties: false 106 unevaluatedProperties: false 107
··· 101 patternProperties: 102 "^(DCDC_REG[1-4]|DCDC_BOOST|LDO_REG[1-9]|SWITCH_REG|HDMI_SWITCH|OTG_SWITCH)$": 103 type: object 104 + $ref: /schemas/regulator/regulator.yaml# 105 unevaluatedProperties: false 106 unevaluatedProperties: false 107
+1 -1
Documentation/devicetree/bindings/mfd/rohm,bd71815-pmic.yaml
··· 61 default: 30000000 62 63 regulators: 64 - $ref: ../regulator/rohm,bd71815-regulator.yaml 65 description: 66 List of child nodes that specify the regulators. 67
··· 61 default: 30000000 62 63 regulators: 64 + $ref: /schemas/regulator/rohm,bd71815-regulator.yaml 65 description: 66 List of child nodes that specify the regulators. 67
+10 -3
Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml
··· 17 18 properties: 19 compatible: 20 - const: rohm,bd71828 21 22 reg: 23 description: ··· 65 here in Ohms. 66 67 regulators: 68 - $ref: ../regulator/rohm,bd71828-regulator.yaml 69 description: 70 List of child nodes that specify the regulators. 71 72 leds: 73 - $ref: ../leds/rohm,bd71828-leds.yaml 74 75 gpio-reserved-ranges: 76 description: | 77 Usage of BD71828 GPIO pins can be changed via OTP. This property can be 78 used to mark the pins which should not be configured for GPIO. Please see 79 the ../gpio/gpio.txt for more information. 80 81 required: 82 - compatible
··· 17 18 properties: 19 compatible: 20 + oneOf: 21 + - const: rohm,bd71828 22 + 23 + - items: 24 + - const: rohm,bd71879 25 + - const: rohm,bd71828 26 27 reg: 28 description: ··· 60 here in Ohms. 61 62 regulators: 63 + $ref: /schemas/regulator/rohm,bd71828-regulator.yaml 64 description: 65 List of child nodes that specify the regulators. 66 67 leds: 68 + $ref: /schemas/leds/rohm,bd71828-leds.yaml 69 70 gpio-reserved-ranges: 71 description: | 72 Usage of BD71828 GPIO pins can be changed via OTP. This property can be 73 used to mark the pins which should not be configured for GPIO. Please see 74 the ../gpio/gpio.txt for more information. 75 + 76 + system-power-controller: true 77 78 required: 79 - compatible
+1 -1
Documentation/devicetree/bindings/mfd/rohm,bd71837-pmic.yaml
··· 109 - 14000 110 111 regulators: 112 - $ref: ../regulator/rohm,bd71837-regulator.yaml 113 description: 114 List of child nodes that specify the regulators. 115
··· 109 - 14000 110 111 regulators: 112 + $ref: /schemas/regulator/rohm,bd71837-regulator.yaml 113 description: 114 List of child nodes that specify the regulators. 115
+1 -1
Documentation/devicetree/bindings/mfd/rohm,bd9571mwv.yaml
··· 67 patternProperties: 68 "^(vd09|vd18|vd25|vd33|dvfs)$": 69 type: object 70 - $ref: ../regulator/regulator.yaml# 71 72 properties: 73 regulator-name:
··· 67 patternProperties: 68 "^(vd09|vd18|vd25|vd33|dvfs)$": 69 type: object 70 + $ref: /schemas/regulator/regulator.yaml# 71 72 properties: 73 regulator-name:
+1 -1
Documentation/devicetree/bindings/mfd/rohm,bd9576-pmic.yaml
··· 71 # (HW) minimum for max timeout is 4ms, maximum 4416 ms. 72 73 regulators: 74 - $ref: ../regulator/rohm,bd9576-regulator.yaml 75 description: 76 List of child nodes that specify the regulators. 77
··· 71 # (HW) minimum for max timeout is 4ms, maximum 4416 ms. 72 73 regulators: 74 + $ref: /schemas/regulator/rohm,bd9576-regulator.yaml 75 description: 76 List of child nodes that specify the regulators. 77
+1 -1
Documentation/devicetree/bindings/mfd/samsung,s2mpa01.yaml
··· 27 maxItems: 1 28 29 regulators: 30 - $ref: ../regulator/samsung,s2mpa01.yaml 31 description: 32 List of child nodes that specify the regulators. 33
··· 27 maxItems: 1 28 29 regulators: 30 + $ref: /schemas/regulator/samsung,s2mpa01.yaml 31 description: 32 List of child nodes that specify the regulators. 33
+6 -6
Documentation/devicetree/bindings/mfd/samsung,s2mps11.yaml
··· 27 - samsung,s2mpu02-pmic 28 29 clocks: 30 - $ref: ../clock/samsung,s2mps11.yaml 31 description: 32 Child node describing clock provider. 33 ··· 75 then: 76 properties: 77 regulators: 78 - $ref: ../regulator/samsung,s2mps11.yaml 79 samsung,s2mps11-wrstbi-ground: false 80 81 - if: ··· 86 then: 87 properties: 88 regulators: 89 - $ref: ../regulator/samsung,s2mps13.yaml 90 samsung,s2mps11-acokb-ground: false 91 92 - if: ··· 97 then: 98 properties: 99 regulators: 100 - $ref: ../regulator/samsung,s2mps14.yaml 101 samsung,s2mps11-acokb-ground: false 102 samsung,s2mps11-wrstbi-ground: false 103 ··· 109 then: 110 properties: 111 regulators: 112 - $ref: ../regulator/samsung,s2mps15.yaml 113 samsung,s2mps11-acokb-ground: false 114 samsung,s2mps11-wrstbi-ground: false 115 ··· 121 then: 122 properties: 123 regulators: 124 - $ref: ../regulator/samsung,s2mpu02.yaml 125 samsung,s2mps11-acokb-ground: false 126 samsung,s2mps11-wrstbi-ground: false 127
··· 27 - samsung,s2mpu02-pmic 28 29 clocks: 30 + $ref: /schemas/clock/samsung,s2mps11.yaml 31 description: 32 Child node describing clock provider. 33 ··· 75 then: 76 properties: 77 regulators: 78 + $ref: /schemas/regulator/samsung,s2mps11.yaml 79 samsung,s2mps11-wrstbi-ground: false 80 81 - if: ··· 86 then: 87 properties: 88 regulators: 89 + $ref: /schemas/regulator/samsung,s2mps13.yaml 90 samsung,s2mps11-acokb-ground: false 91 92 - if: ··· 97 then: 98 properties: 99 regulators: 100 + $ref: /schemas/regulator/samsung,s2mps14.yaml 101 samsung,s2mps11-acokb-ground: false 102 samsung,s2mps11-wrstbi-ground: false 103 ··· 109 then: 110 properties: 111 regulators: 112 + $ref: /schemas/regulator/samsung,s2mps15.yaml 113 samsung,s2mps11-acokb-ground: false 114 samsung,s2mps11-wrstbi-ground: false 115 ··· 121 then: 122 properties: 123 regulators: 124 + $ref: /schemas/regulator/samsung,s2mpu02.yaml 125 samsung,s2mps11-acokb-ground: false 126 samsung,s2mps11-wrstbi-ground: false 127
+2 -2
Documentation/devicetree/bindings/mfd/samsung,s5m8767.yaml
··· 21 const: samsung,s5m8767-pmic 22 23 clocks: 24 - $ref: ../clock/samsung,s2mps11.yaml 25 description: 26 Child node describing clock provider. 27 ··· 32 maxItems: 1 33 34 regulators: 35 - $ref: ../regulator/samsung,s5m8767.yaml 36 description: 37 List of child nodes that specify the regulators. 38
··· 21 const: samsung,s5m8767-pmic 22 23 clocks: 24 + $ref: /schemas/clock/samsung,s2mps11.yaml 25 description: 26 Child node describing clock provider. 27 ··· 32 maxItems: 1 33 34 regulators: 35 + $ref: /schemas/regulator/samsung,s5m8767.yaml 36 description: 37 List of child nodes that specify the regulators. 38
+1 -1
Documentation/devicetree/bindings/mfd/st,stmfx.yaml
··· 60 additionalProperties: false 61 62 allOf: 63 - - $ref: ../pinctrl/pinmux-node.yaml 64 65 properties: 66 pins: true
··· 60 additionalProperties: false 61 62 allOf: 63 + - $ref: /schemas/pinctrl/pinmux-node.yaml 64 65 properties: 66 pins: true
+2 -2
Documentation/devicetree/bindings/mfd/st,stpmic1.yaml
··· 29 onkey: 30 type: object 31 32 - $ref: ../input/input.yaml 33 34 properties: 35 compatible: ··· 67 watchdog: 68 type: object 69 70 - $ref: ../watchdog/watchdog.yaml 71 72 properties: 73 compatible:
··· 29 onkey: 30 type: object 31 32 + $ref: /schemas/input/input.yaml 33 34 properties: 35 compatible: ··· 67 watchdog: 68 type: object 69 70 + $ref: /schemas/watchdog/watchdog.yaml 71 72 properties: 73 compatible:
+24 -24
Documentation/devicetree/bindings/mfd/stericsson,ab8500.yaml
··· 126 patternProperties: 127 "^channel@[0-9a-f]+$": 128 type: object 129 - $ref: ../iio/adc/adc.yaml# 130 description: Represents each of the external channels which are 131 connected to the ADC. 132 ··· 180 ab8500_fg: 181 description: Node describing the AB8500 fuel gauge control block. 182 type: object 183 - $ref: ../power/supply/stericsson,ab8500-fg.yaml 184 185 ab8500_btemp: 186 description: Node describing the AB8500 battery temperature control block. 187 type: object 188 - $ref: ../power/supply/stericsson,ab8500-btemp.yaml 189 190 ab8500_charger: 191 description: Node describing the AB8500 battery charger control block. 192 type: object 193 - $ref: ../power/supply/stericsson,ab8500-charger.yaml 194 195 ab8500_chargalg: 196 description: Node describing the AB8500 battery charger algorithm. 197 type: object 198 - $ref: ../power/supply/stericsson,ab8500-chargalg.yaml 199 200 phy: 201 description: Node describing the AB8500 USB PHY control block. ··· 339 ab8500_ldo_aux1: 340 description: The voltage for the auxiliary LDO regulator 1 341 type: object 342 - $ref: ../regulator/regulator.yaml# 343 unevaluatedProperties: false 344 345 ab8500_ldo_aux2: 346 description: The voltage for the auxiliary LDO regulator 2 347 type: object 348 - $ref: ../regulator/regulator.yaml# 349 unevaluatedProperties: false 350 351 ab8500_ldo_aux3: 352 description: The voltage for the auxiliary LDO regulator 3 353 type: object 354 - $ref: ../regulator/regulator.yaml# 355 unevaluatedProperties: false 356 357 ab8500_ldo_aux4: 358 description: The voltage for the auxiliary LDO regulator 4 359 only present on AB8505 360 type: object 361 - $ref: ../regulator/regulator.yaml# 362 unevaluatedProperties: false 363 364 ab8500_ldo_aux5: 365 description: The voltage for the auxiliary LDO regulator 5 366 only present on AB8505 367 type: object 368 - $ref: ../regulator/regulator.yaml# 369 unevaluatedProperties: false 370 371 ab8500_ldo_aux6: 372 description: The voltage for the auxiliary LDO regulator 6 373 only present on AB8505 374 type: object 375 - $ref: ../regulator/regulator.yaml# 376 unevaluatedProperties: false 377 378 # There is never any AUX7 regulator which is confusing ··· 381 description: The voltage for the auxiliary LDO regulator 8 382 only present on AB8505 383 type: object 384 - $ref: ../regulator/regulator.yaml# 385 unevaluatedProperties: false 386 387 ab8500_ldo_intcore: 388 description: The LDO regulator for the internal core voltage 389 of the AB8500 390 type: object 391 - $ref: ../regulator/regulator.yaml# 392 unevaluatedProperties: false 393 394 ab8500_ldo_adc: 395 description: Analog power regulator for the analog to digital converter 396 ADC, only present on AB8505 397 type: object 398 - $ref: ../regulator/regulator.yaml# 399 unevaluatedProperties: false 400 401 ab8500_ldo_tvout: ··· 404 the temperature of the NTC thermistor on the battery. 405 Only present on AB8500. 406 type: object 407 - $ref: ../regulator/regulator.yaml# 408 unevaluatedProperties: false 409 410 ab8500_ldo_audio: 411 description: The LDO regulator for the audio codec output 412 type: object 413 - $ref: ../regulator/regulator.yaml# 414 unevaluatedProperties: false 415 416 ab8500_ldo_anamic1: 417 description: The LDO regulator for the analog microphone 1 418 type: object 419 - $ref: ../regulator/regulator.yaml# 420 unevaluatedProperties: false 421 422 ab8500_ldo_anamic2: 423 description: The LDO regulator for the analog microphone 2 424 type: object 425 - $ref: ../regulator/regulator.yaml# 426 unevaluatedProperties: false 427 428 ab8500_ldo_dmic: 429 description: The LDO regulator for the digital microphone 430 only present on AB8500 431 type: object 432 - $ref: ../regulator/regulator.yaml# 433 unevaluatedProperties: false 434 435 ab8500_ldo_ana: 436 description: Analog power regulator for CSI and DSI interfaces, 437 Camera Serial Interface CSI and Display Serial Interface DSI. 438 type: object 439 - $ref: ../regulator/regulator.yaml# 440 unevaluatedProperties: false 441 442 required: ··· 459 ab8500_ext1: 460 description: The voltage for the VSMPS1 external regulator 461 type: object 462 - $ref: ../regulator/regulator.yaml# 463 unevaluatedProperties: false 464 465 ab8500_ext2: 466 description: The voltage for the VSMPS2 external regulator 467 type: object 468 - $ref: ../regulator/regulator.yaml# 469 unevaluatedProperties: false 470 471 ab8500_ext3: 472 description: The voltage for the VSMPS3 external regulator 473 type: object 474 - $ref: ../regulator/regulator.yaml# 475 unevaluatedProperties: false 476 477 required: ··· 482 patternProperties: 483 "^pwm@[1-9]+?$": 484 type: object 485 - $ref: ../pwm/pwm.yaml# 486 unevaluatedProperties: false 487 description: Represents each of the PWM blocks in the AB8500 488
··· 126 patternProperties: 127 "^channel@[0-9a-f]+$": 128 type: object 129 + $ref: /schemas/iio/adc/adc.yaml# 130 description: Represents each of the external channels which are 131 connected to the ADC. 132 ··· 180 ab8500_fg: 181 description: Node describing the AB8500 fuel gauge control block. 182 type: object 183 + $ref: /schemas/power/supply/stericsson,ab8500-fg.yaml 184 185 ab8500_btemp: 186 description: Node describing the AB8500 battery temperature control block. 187 type: object 188 + $ref: /schemas/power/supply/stericsson,ab8500-btemp.yaml 189 190 ab8500_charger: 191 description: Node describing the AB8500 battery charger control block. 192 type: object 193 + $ref: /schemas/power/supply/stericsson,ab8500-charger.yaml 194 195 ab8500_chargalg: 196 description: Node describing the AB8500 battery charger algorithm. 197 type: object 198 + $ref: /schemas/power/supply/stericsson,ab8500-chargalg.yaml 199 200 phy: 201 description: Node describing the AB8500 USB PHY control block. ··· 339 ab8500_ldo_aux1: 340 description: The voltage for the auxiliary LDO regulator 1 341 type: object 342 + $ref: /schemas/regulator/regulator.yaml# 343 unevaluatedProperties: false 344 345 ab8500_ldo_aux2: 346 description: The voltage for the auxiliary LDO regulator 2 347 type: object 348 + $ref: /schemas/regulator/regulator.yaml# 349 unevaluatedProperties: false 350 351 ab8500_ldo_aux3: 352 description: The voltage for the auxiliary LDO regulator 3 353 type: object 354 + $ref: /schemas/regulator/regulator.yaml# 355 unevaluatedProperties: false 356 357 ab8500_ldo_aux4: 358 description: The voltage for the auxiliary LDO regulator 4 359 only present on AB8505 360 type: object 361 + $ref: /schemas/regulator/regulator.yaml# 362 unevaluatedProperties: false 363 364 ab8500_ldo_aux5: 365 description: The voltage for the auxiliary LDO regulator 5 366 only present on AB8505 367 type: object 368 + $ref: /schemas/regulator/regulator.yaml# 369 unevaluatedProperties: false 370 371 ab8500_ldo_aux6: 372 description: The voltage for the auxiliary LDO regulator 6 373 only present on AB8505 374 type: object 375 + $ref: /schemas/regulator/regulator.yaml# 376 unevaluatedProperties: false 377 378 # There is never any AUX7 regulator which is confusing ··· 381 description: The voltage for the auxiliary LDO regulator 8 382 only present on AB8505 383 type: object 384 + $ref: /schemas/regulator/regulator.yaml# 385 unevaluatedProperties: false 386 387 ab8500_ldo_intcore: 388 description: The LDO regulator for the internal core voltage 389 of the AB8500 390 type: object 391 + $ref: /schemas/regulator/regulator.yaml# 392 unevaluatedProperties: false 393 394 ab8500_ldo_adc: 395 description: Analog power regulator for the analog to digital converter 396 ADC, only present on AB8505 397 type: object 398 + $ref: /schemas/regulator/regulator.yaml# 399 unevaluatedProperties: false 400 401 ab8500_ldo_tvout: ··· 404 the temperature of the NTC thermistor on the battery. 405 Only present on AB8500. 406 type: object 407 + $ref: /schemas/regulator/regulator.yaml# 408 unevaluatedProperties: false 409 410 ab8500_ldo_audio: 411 description: The LDO regulator for the audio codec output 412 type: object 413 + $ref: /schemas/regulator/regulator.yaml# 414 unevaluatedProperties: false 415 416 ab8500_ldo_anamic1: 417 description: The LDO regulator for the analog microphone 1 418 type: object 419 + $ref: /schemas/regulator/regulator.yaml# 420 unevaluatedProperties: false 421 422 ab8500_ldo_anamic2: 423 description: The LDO regulator for the analog microphone 2 424 type: object 425 + $ref: /schemas/regulator/regulator.yaml# 426 unevaluatedProperties: false 427 428 ab8500_ldo_dmic: 429 description: The LDO regulator for the digital microphone 430 only present on AB8500 431 type: object 432 + $ref: /schemas/regulator/regulator.yaml# 433 unevaluatedProperties: false 434 435 ab8500_ldo_ana: 436 description: Analog power regulator for CSI and DSI interfaces, 437 Camera Serial Interface CSI and Display Serial Interface DSI. 438 type: object 439 + $ref: /schemas/regulator/regulator.yaml# 440 unevaluatedProperties: false 441 442 required: ··· 459 ab8500_ext1: 460 description: The voltage for the VSMPS1 external regulator 461 type: object 462 + $ref: /schemas/regulator/regulator.yaml# 463 unevaluatedProperties: false 464 465 ab8500_ext2: 466 description: The voltage for the VSMPS2 external regulator 467 type: object 468 + $ref: /schemas/regulator/regulator.yaml# 469 unevaluatedProperties: false 470 471 ab8500_ext3: 472 description: The voltage for the VSMPS3 external regulator 473 type: object 474 + $ref: /schemas/regulator/regulator.yaml# 475 unevaluatedProperties: false 476 477 required: ··· 482 patternProperties: 483 "^pwm@[1-9]+?$": 484 type: object 485 + $ref: /schemas/pwm/pwm.yaml# 486 unevaluatedProperties: false 487 description: Represents each of the PWM blocks in the AB8500 488
+20 -20
Documentation/devicetree/bindings/mfd/stericsson,db8500-prcmu.yaml
··· 71 description: The voltage for the application processor, the 72 main voltage domain for the chip. 73 type: object 74 - $ref: ../regulator/regulator.yaml# 75 unevaluatedProperties: false 76 77 db8500_varm: 78 description: The voltage for the ARM Cortex-A9 CPU. 79 type: object 80 - $ref: ../regulator/regulator.yaml# 81 unevaluatedProperties: false 82 83 db8500_vmodem: 84 description: The voltage for the modem subsystem. 85 type: object 86 - $ref: ../regulator/regulator.yaml# 87 unevaluatedProperties: false 88 89 db8500_vpll: 90 description: The voltage for the phase locked loop clocks. 91 type: object 92 - $ref: ../regulator/regulator.yaml# 93 unevaluatedProperties: false 94 95 db8500_vsmps1: 96 description: Also known as VIO12, is a step-down voltage regulator 97 for 1.2V I/O. SMPS means System Management Power Source. 98 type: object 99 - $ref: ../regulator/regulator.yaml# 100 unevaluatedProperties: false 101 102 db8500_vsmps2: 103 description: Also known as VIO18, is a step-down voltage regulator 104 for 1.8V I/O. SMPS means System Management Power Source. 105 type: object 106 - $ref: ../regulator/regulator.yaml# 107 unevaluatedProperties: false 108 109 db8500_vsmps3: 110 description: This is a step-down voltage regulator 111 for 0.87 thru 1.875V I/O. SMPS means System Management Power Source. 112 type: object 113 - $ref: ../regulator/regulator.yaml# 114 unevaluatedProperties: false 115 116 db8500_vrf1: 117 description: RF transceiver voltage regulator. 118 type: object 119 - $ref: ../regulator/regulator.yaml# 120 unevaluatedProperties: false 121 122 db8500_sva_mmdsp: ··· 124 voltage regulator. This is the voltage for the accelerator DSP 125 for video encoding and decoding. 126 type: object 127 - $ref: ../regulator/regulator.yaml# 128 unevaluatedProperties: false 129 130 db8500_sva_mmdsp_ret: 131 description: Smart Video Accelerator (SVA) multimedia DSP (MMDSP) 132 voltage regulator for retention mode. 133 type: object 134 - $ref: ../regulator/regulator.yaml# 135 unevaluatedProperties: false 136 137 db8500_sva_pipe: 138 description: Smart Video Accelerator (SVA) multimedia DSP (MMDSP) 139 voltage regulator for the data pipe. 140 type: object 141 - $ref: ../regulator/regulator.yaml# 142 unevaluatedProperties: false 143 144 db8500_sia_mmdsp: ··· 146 voltage regulator. This is the voltage for the accelerator DSP 147 for image encoding and decoding. 148 type: object 149 - $ref: ../regulator/regulator.yaml# 150 unevaluatedProperties: false 151 152 db8500_sia_mmdsp_ret: 153 description: Smart Image Accelerator (SIA) multimedia DSP (MMDSP) 154 voltage regulator for retention mode. 155 type: object 156 - $ref: ../regulator/regulator.yaml# 157 unevaluatedProperties: false 158 159 db8500_sia_pipe: 160 description: Smart Image Accelerator (SIA) multimedia DSP (MMDSP) 161 voltage regulator for the data pipe. 162 type: object 163 - $ref: ../regulator/regulator.yaml# 164 unevaluatedProperties: false 165 166 db8500_sga: ··· 168 This is in effect controlling the power to the MALI400 3D 169 accelerator block. 170 type: object 171 - $ref: ../regulator/regulator.yaml# 172 unevaluatedProperties: false 173 174 db8500_b2r2_mcde: ··· 176 Display Engine (MCDE) voltage regulator. These are two graphics 177 blocks. 178 type: object 179 - $ref: ../regulator/regulator.yaml# 180 unevaluatedProperties: false 181 182 db8500_esram12: 183 description: Embedded Static RAM (ESRAM) 1 and 2 voltage regulator. 184 type: object 185 - $ref: ../regulator/regulator.yaml# 186 unevaluatedProperties: false 187 188 db8500_esram12_ret: 189 description: Embedded Static RAM (ESRAM) 1 and 2 voltage regulator for 190 retention mode. 191 type: object 192 - $ref: ../regulator/regulator.yaml# 193 unevaluatedProperties: false 194 195 db8500_esram34: 196 description: Embedded Static RAM (ESRAM) 3 and 4 voltage regulator. 197 type: object 198 - $ref: ../regulator/regulator.yaml# 199 unevaluatedProperties: false 200 201 db8500_esram34_ret: 202 description: Embedded Static RAM (ESRAM) 3 and 4 voltage regulator for 203 retention mode. 204 type: object 205 - $ref: ../regulator/regulator.yaml# 206 unevaluatedProperties: false 207 208 required:
··· 71 description: The voltage for the application processor, the 72 main voltage domain for the chip. 73 type: object 74 + $ref: /schemas/regulator/regulator.yaml# 75 unevaluatedProperties: false 76 77 db8500_varm: 78 description: The voltage for the ARM Cortex-A9 CPU. 79 type: object 80 + $ref: /schemas/regulator/regulator.yaml# 81 unevaluatedProperties: false 82 83 db8500_vmodem: 84 description: The voltage for the modem subsystem. 85 type: object 86 + $ref: /schemas/regulator/regulator.yaml# 87 unevaluatedProperties: false 88 89 db8500_vpll: 90 description: The voltage for the phase locked loop clocks. 91 type: object 92 + $ref: /schemas/regulator/regulator.yaml# 93 unevaluatedProperties: false 94 95 db8500_vsmps1: 96 description: Also known as VIO12, is a step-down voltage regulator 97 for 1.2V I/O. SMPS means System Management Power Source. 98 type: object 99 + $ref: /schemas/regulator/regulator.yaml# 100 unevaluatedProperties: false 101 102 db8500_vsmps2: 103 description: Also known as VIO18, is a step-down voltage regulator 104 for 1.8V I/O. SMPS means System Management Power Source. 105 type: object 106 + $ref: /schemas/regulator/regulator.yaml# 107 unevaluatedProperties: false 108 109 db8500_vsmps3: 110 description: This is a step-down voltage regulator 111 for 0.87 thru 1.875V I/O. SMPS means System Management Power Source. 112 type: object 113 + $ref: /schemas/regulator/regulator.yaml# 114 unevaluatedProperties: false 115 116 db8500_vrf1: 117 description: RF transceiver voltage regulator. 118 type: object 119 + $ref: /schemas/regulator/regulator.yaml# 120 unevaluatedProperties: false 121 122 db8500_sva_mmdsp: ··· 124 voltage regulator. This is the voltage for the accelerator DSP 125 for video encoding and decoding. 126 type: object 127 + $ref: /schemas/regulator/regulator.yaml# 128 unevaluatedProperties: false 129 130 db8500_sva_mmdsp_ret: 131 description: Smart Video Accelerator (SVA) multimedia DSP (MMDSP) 132 voltage regulator for retention mode. 133 type: object 134 + $ref: /schemas/regulator/regulator.yaml# 135 unevaluatedProperties: false 136 137 db8500_sva_pipe: 138 description: Smart Video Accelerator (SVA) multimedia DSP (MMDSP) 139 voltage regulator for the data pipe. 140 type: object 141 + $ref: /schemas/regulator/regulator.yaml# 142 unevaluatedProperties: false 143 144 db8500_sia_mmdsp: ··· 146 voltage regulator. This is the voltage for the accelerator DSP 147 for image encoding and decoding. 148 type: object 149 + $ref: /schemas/regulator/regulator.yaml# 150 unevaluatedProperties: false 151 152 db8500_sia_mmdsp_ret: 153 description: Smart Image Accelerator (SIA) multimedia DSP (MMDSP) 154 voltage regulator for retention mode. 155 type: object 156 + $ref: /schemas/regulator/regulator.yaml# 157 unevaluatedProperties: false 158 159 db8500_sia_pipe: 160 description: Smart Image Accelerator (SIA) multimedia DSP (MMDSP) 161 voltage regulator for the data pipe. 162 type: object 163 + $ref: /schemas/regulator/regulator.yaml# 164 unevaluatedProperties: false 165 166 db8500_sga: ··· 168 This is in effect controlling the power to the MALI400 3D 169 accelerator block. 170 type: object 171 + $ref: /schemas/regulator/regulator.yaml# 172 unevaluatedProperties: false 173 174 db8500_b2r2_mcde: ··· 176 Display Engine (MCDE) voltage regulator. These are two graphics 177 blocks. 178 type: object 179 + $ref: /schemas/regulator/regulator.yaml# 180 unevaluatedProperties: false 181 182 db8500_esram12: 183 description: Embedded Static RAM (ESRAM) 1 and 2 voltage regulator. 184 type: object 185 + $ref: /schemas/regulator/regulator.yaml# 186 unevaluatedProperties: false 187 188 db8500_esram12_ret: 189 description: Embedded Static RAM (ESRAM) 1 and 2 voltage regulator for 190 retention mode. 191 type: object 192 + $ref: /schemas/regulator/regulator.yaml# 193 unevaluatedProperties: false 194 195 db8500_esram34: 196 description: Embedded Static RAM (ESRAM) 3 and 4 voltage regulator. 197 type: object 198 + $ref: /schemas/regulator/regulator.yaml# 199 unevaluatedProperties: false 200 201 db8500_esram34_ret: 202 description: Embedded Static RAM (ESRAM) 3 and 4 voltage regulator for 203 retention mode. 204 type: object 205 + $ref: /schemas/regulator/regulator.yaml# 206 unevaluatedProperties: false 207 208 required:
+16
Documentation/devicetree/bindings/mfd/syscon.yaml
··· 38 - allwinner,sun8i-h3-system-controller 39 - allwinner,sun8i-v3s-system-controller 40 - allwinner,sun50i-a64-system-controller 41 - amd,pensando-elba-syscon 42 - brcm,cru-clkset 43 - freecom,fsg-cs2-system-controller 44 - fsl,imx93-aonmix-ns-syscfg 45 - fsl,imx93-wakeupmix-syscfg 46 - hisilicon,dsa-subctrl 47 - hisilicon,hi6220-sramctrl 48 - hisilicon,pcie-sas-subctrl ··· 60 - intel,lgm-syscon 61 - loongson,ls1b-syscon 62 - loongson,ls1c-syscon 63 - marvell,armada-3700-usb2-host-misc 64 - mediatek,mt8135-pctl-a-syscfg 65 - mediatek,mt8135-pctl-b-syscfg 66 - mediatek,mt8365-syscfg 67 - microchip,lan966x-cpu-syscon 68 - microchip,sparx5-cpu-syscon ··· 88 - rockchip,rv1126-qos 89 - starfive,jh7100-sysmain 90 - ti,am62-usb-phy-ctrl 91 - ti,am654-dss-oldi-io-ctrl 92 - ti,am654-serdes-ctrl 93 - ti,j784s4-pcie-ctrl
··· 38 - allwinner,sun8i-h3-system-controller 39 - allwinner,sun8i-v3s-system-controller 40 - allwinner,sun50i-a64-system-controller 41 + - altr,sdr-ctl 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 48 - brcm,cru-clkset 49 + - brcm,sr-cdru 50 + - brcm,sr-mhb 51 - freecom,fsg-cs2-system-controller 52 - fsl,imx93-aonmix-ns-syscfg 53 - fsl,imx93-wakeupmix-syscfg 54 + - fsl,ls1088a-reset 55 - hisilicon,dsa-subctrl 56 - hisilicon,hi6220-sramctrl 57 - hisilicon,pcie-sas-subctrl ··· 51 - intel,lgm-syscon 52 - loongson,ls1b-syscon 53 - loongson,ls1c-syscon 54 + - marvell,armada-3700-cpu-misc 55 + - marvell,armada-3700-nb-pm 56 + - marvell,armada-3700-avs 57 - marvell,armada-3700-usb2-host-misc 58 + - mediatek,mt2712-pctl-a-syscfg 59 + - mediatek,mt6397-pctl-pmic-syscfg 60 - mediatek,mt8135-pctl-a-syscfg 61 - mediatek,mt8135-pctl-b-syscfg 62 + - mediatek,mt8173-pctl-a-syscfg 63 - mediatek,mt8365-syscfg 64 - microchip,lan966x-cpu-syscon 65 - microchip,sparx5-cpu-syscon ··· 73 - rockchip,rv1126-qos 74 - starfive,jh7100-sysmain 75 - ti,am62-usb-phy-ctrl 76 + - ti,am62p-cpsw-mac-efuse 77 - ti,am654-dss-oldi-io-ctrl 78 - ti,am654-serdes-ctrl 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 patternProperties: 50 "^buck[1-6]$": 51 type: object 52 - $ref: ../regulator/regulator.yaml 53 54 properties: 55 regulator-name: true ··· 72 73 "^(ldoa[1-3]|swa1|swb[1-2]|vtt)$": 74 type: object 75 - $ref: ../regulator/regulator.yaml 76 77 properties: 78 regulator-name: true
··· 49 patternProperties: 50 "^buck[1-6]$": 51 type: object 52 + $ref: /schemas/regulator/regulator.yaml 53 54 properties: 55 regulator-name: true ··· 72 73 "^(ldoa[1-3]|swa1|swb[1-2]|vtt)$": 74 type: object 75 + $ref: /schemas/regulator/regulator.yaml 76 77 properties: 78 regulator-name: true
+1
Documentation/devicetree/bindings/mfd/ti,tps6594.yaml
··· 21 - ti,lp8764-q1 22 - ti,tps6593-q1 23 - ti,tps6594-q1 24 25 reg: 26 description: I2C slave address or SPI chip select number.
··· 21 - ti,lp8764-q1 22 - ti,tps6593-q1 23 - ti,tps6594-q1 24 + - ti,tps65224-q1 25 26 reg: 27 description: I2C slave address or SPI chip select number.
+71 -1
Documentation/devicetree/bindings/mfd/ti,twl.yaml
··· 15 USB transceiver or Audio amplifier. 16 These chips are connected to an i2c bus. 17 18 properties: 19 compatible: 20 description: ··· 103 "#clock-cells": 104 const: 1 105 106 - additionalProperties: false 107 108 required: 109 - compatible
··· 15 USB transceiver or Audio amplifier. 16 These chips are connected to an i2c bus. 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 + 79 properties: 80 compatible: 81 description: ··· 42 "#clock-cells": 43 const: 1 44 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 55 56 required: 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 const u8 *data, u32 size) 530 { 531 struct m10bmc_sec *sec = fwl->dd_handle; 532 u32 ret; 533 534 sec->cancel_request = false; 535 536 - if (!size || size > M10BMC_STAGING_SIZE) 537 return FW_UPLOAD_ERR_INVALID_SIZE; 538 539 if (sec->m10bmc->flash_bulk_ops)
··· 529 const u8 *data, u32 size) 530 { 531 struct m10bmc_sec *sec = fwl->dd_handle; 532 + const struct m10bmc_csr_map *csr_map = sec->m10bmc->info->csr_map; 533 u32 ret; 534 535 sec->cancel_request = false; 536 537 + if (!size || size > csr_map->staging_size) 538 return FW_UPLOAD_ERR_INVALID_SIZE; 539 540 if (sec->m10bmc->flash_bulk_ops)
+8 -8
drivers/mfd/Kconfig
··· 292 293 config MFD_MAX5970 294 tristate "Maxim 5970/5978 power switch and monitor" 295 - depends on (I2C && OF) 296 select MFD_SIMPLE_MFD_I2C 297 help 298 This driver controls a Maxim 5970/5978 switch via I2C bus. ··· 458 459 config MFD_GATEWORKS_GSC 460 tristate "Gateworks System Controller" 461 - depends on (I2C && OF) 462 select MFD_CORE 463 select REGMAP_I2C 464 select REGMAP_IRQ ··· 473 474 config MFD_MC13XXX 475 tristate 476 - depends on (SPI_MASTER || I2C) 477 select MFD_CORE 478 select REGMAP_IRQ 479 help ··· 1109 1110 config MFD_PM8XXX 1111 tristate "Qualcomm PM8xxx PMIC chips driver" 1112 - depends on (ARM || HEXAGON || COMPILE_TEST) 1113 select IRQ_DOMAIN_HIERARCHY 1114 select MFD_CORE 1115 select REGMAP ··· 1225 select MFD_CORE 1226 1227 config MFD_RK8XX_I2C 1228 - tristate "Rockchip RK805/RK808/RK809/RK817/RK818 Power Management Chip" 1229 depends on I2C && OF 1230 select MFD_CORE 1231 select REGMAP_I2C ··· 1233 select MFD_RK8XX 1234 help 1235 If you say yes here you get support for the RK805, RK808, RK809, 1236 - RK817 and RK818 Power Management chips. 1237 This driver provides common support for accessing the device 1238 through I2C interface. The device supports multiple sub-devices 1239 including interrupts, RTC, LDO & DCDC regulators, and onkey. ··· 1418 1419 config MFD_STMPE 1420 bool "STMicroelectronics STMPE" 1421 - depends on (I2C=y || SPI_MASTER=y) 1422 depends on OF 1423 select MFD_CORE 1424 help ··· 2116 2117 config MFD_STPMIC1 2118 tristate "Support for STPMIC1 PMIC" 2119 - depends on (I2C=y && OF) 2120 select REGMAP_I2C 2121 select REGMAP_IRQ 2122 select MFD_CORE
··· 292 293 config MFD_MAX5970 294 tristate "Maxim 5970/5978 power switch and monitor" 295 + depends on I2C && OF 296 select MFD_SIMPLE_MFD_I2C 297 help 298 This driver controls a Maxim 5970/5978 switch via I2C bus. ··· 458 459 config MFD_GATEWORKS_GSC 460 tristate "Gateworks System Controller" 461 + depends on I2C && OF 462 select MFD_CORE 463 select REGMAP_I2C 464 select REGMAP_IRQ ··· 473 474 config MFD_MC13XXX 475 tristate 476 + depends on SPI_MASTER || I2C 477 select MFD_CORE 478 select REGMAP_IRQ 479 help ··· 1109 1110 config MFD_PM8XXX 1111 tristate "Qualcomm PM8xxx PMIC chips driver" 1112 + depends on ARM || HEXAGON || COMPILE_TEST 1113 select IRQ_DOMAIN_HIERARCHY 1114 select MFD_CORE 1115 select REGMAP ··· 1225 select MFD_CORE 1226 1227 config MFD_RK8XX_I2C 1228 + tristate "Rockchip RK805/RK808/RK809/RK816/RK817/RK818 Power Management Chip" 1229 depends on I2C && OF 1230 select MFD_CORE 1231 select REGMAP_I2C ··· 1233 select MFD_RK8XX 1234 help 1235 If you say yes here you get support for the RK805, RK808, RK809, 1236 + RK816, RK817 and RK818 Power Management chips. 1237 This driver provides common support for accessing the device 1238 through I2C interface. The device supports multiple sub-devices 1239 including interrupts, RTC, LDO & DCDC regulators, and onkey. ··· 1418 1419 config MFD_STMPE 1420 bool "STMicroelectronics STMPE" 1421 + depends on I2C=y || SPI_MASTER=y 1422 depends on OF 1423 select MFD_CORE 1424 help ··· 2116 2117 config MFD_STPMIC1 2118 tristate "Support for STPMIC1 PMIC" 2119 + depends on I2C=y && OF 2120 select REGMAP_I2C 2121 select REGMAP_IRQ 2122 select MFD_CORE
+1 -1
drivers/mfd/axp20x.c
··· 422 .wr_table = &axp717_writeable_table, 423 .volatile_table = &axp717_volatile_table, 424 .max_register = AXP717_CPUSLDO_CONTROL, 425 - .cache_type = REGCACHE_RBTREE, 426 }; 427 428 static const struct regmap_config axp806_regmap_config = {
··· 422 .wr_table = &axp717_writeable_table, 423 .volatile_table = &axp717_volatile_table, 424 .max_register = AXP717_CPUSLDO_CONTROL, 425 + .cache_type = REGCACHE_MAPLE, 426 }; 427 428 static const struct regmap_config axp806_regmap_config = {
+30 -6
drivers/mfd/cs42l43.c
··· 43 #define CS42L43_MCU_UPDATE_TIMEOUT_US 500000 44 #define CS42L43_MCU_UPDATE_RETRIES 5 45 46 #define CS42L43_MCU_SUPPORTED_REV 0x2105 47 #define CS42L43_MCU_SHADOW_REGS_REQUIRED_REV 0x2200 48 #define CS42L43_MCU_SUPPORTED_BIOS_REV 0x0001 ··· 712 complete(&cs42l43->firmware_download); 713 } 714 715 /* 716 * The process of updating the firmware is split into a series of steps, at the 717 * end of each step a soft reset of the device might be required which will ··· 765 ((mcu_rev & CS42L43_FW_SUBMINOR_REV_MASK) >> 8); 766 767 /* 768 - * The firmware has two revision numbers bringing either of them up to a 769 - * supported version will provide the features the driver requires. 770 */ 771 - patched = mcu_rev >= CS42L43_MCU_SUPPORTED_REV || 772 - bios_rev >= CS42L43_MCU_SUPPORTED_BIOS_REV; 773 /* 774 * Later versions of the firmwware require the driver to access some 775 * features through a set of shadow registers. ··· 813 return cs42l43_mcu_stage_2_3(cs42l43, shadow); 814 } 815 case CS42L43_MCU_BOOT_STAGE3: 816 - if (patched) 817 return cs42l43_mcu_disable(cs42l43); 818 - else 819 return cs42l43_mcu_stage_3_2(cs42l43); 820 case CS42L43_MCU_BOOT_STAGE4: 821 return 0; 822 default:
··· 43 #define CS42L43_MCU_UPDATE_TIMEOUT_US 500000 44 #define CS42L43_MCU_UPDATE_RETRIES 5 45 46 + #define CS42L43_MCU_ROM_REV 0x2001 47 + #define CS42L43_MCU_ROM_BIOS_REV 0x0000 48 + 49 #define CS42L43_MCU_SUPPORTED_REV 0x2105 50 #define CS42L43_MCU_SHADOW_REGS_REQUIRED_REV 0x2200 51 #define CS42L43_MCU_SUPPORTED_BIOS_REV 0x0001 ··· 709 complete(&cs42l43->firmware_download); 710 } 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 + 729 /* 730 * The process of updating the firmware is split into a series of steps, at the 731 * end of each step a soft reset of the device might be required which will ··· 745 ((mcu_rev & CS42L43_FW_SUBMINOR_REV_MASK) >> 8); 746 747 /* 748 + * The firmware has two revision numbers both of them being at the ROM 749 + * revision indicates no patch has been applied. 750 */ 751 + patched = mcu_rev != CS42L43_MCU_ROM_REV || bios_rev != CS42L43_MCU_ROM_BIOS_REV; 752 /* 753 * Later versions of the firmwware require the driver to access some 754 * features through a set of shadow registers. ··· 794 return cs42l43_mcu_stage_2_3(cs42l43, shadow); 795 } 796 case CS42L43_MCU_BOOT_STAGE3: 797 + if (patched) { 798 + ret = cs42l43_mcu_is_hw_compatible(cs42l43, mcu_rev, bios_rev); 799 + if (ret) 800 + return ret; 801 + 802 return cs42l43_mcu_disable(cs42l43); 803 + } else { 804 return cs42l43_mcu_stage_3_2(cs42l43); 805 + } 806 case CS42L43_MCU_BOOT_STAGE4: 807 return 0; 808 default:
+1 -1
drivers/mfd/intel-lpss-pci.c
··· 54 if (ret) 55 return ret; 56 57 - ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_INTX); 58 if (ret < 0) 59 return ret; 60
··· 54 if (ret) 55 return ret; 56 57 + ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES); 58 if (ret < 0) 59 return ret; 60
+1
drivers/mfd/intel-m10-bmc-pmci.c
··· 370 .pr_reh_addr = M10BMC_N6000_PR_REH_ADDR, 371 .pr_magic = M10BMC_N6000_PR_PROG_MAGIC, 372 .rsu_update_counter = M10BMC_N6000_STAGING_FLASH_COUNT, 373 }; 374 375 static const struct intel_m10bmc_platform_info m10bmc_pmci_n6000 = {
··· 370 .pr_reh_addr = M10BMC_N6000_PR_REH_ADDR, 371 .pr_magic = M10BMC_N6000_PR_PROG_MAGIC, 372 .rsu_update_counter = M10BMC_N6000_STAGING_FLASH_COUNT, 373 + .staging_size = M10BMC_STAGING_SIZE, 374 }; 375 376 static const struct intel_m10bmc_platform_info m10bmc_pmci_n6000 = {
+1
drivers/mfd/intel-m10-bmc-spi.c
··· 109 .pr_reh_addr = M10BMC_N3000_PR_REH_ADDR, 110 .pr_magic = M10BMC_N3000_PR_PROG_MAGIC, 111 .rsu_update_counter = M10BMC_N3000_STAGING_FLASH_COUNT, 112 }; 113 114 static struct mfd_cell m10bmc_d5005_subdevs[] = {
··· 109 .pr_reh_addr = M10BMC_N3000_PR_REH_ADDR, 110 .pr_magic = M10BMC_N3000_PR_PROG_MAGIC, 111 .rsu_update_counter = M10BMC_N3000_STAGING_FLASH_COUNT, 112 + .staging_size = M10BMC_STAGING_SIZE, 113 }; 114 115 static struct mfd_cell m10bmc_d5005_subdevs[] = {
+47 -178
drivers/mfd/kempld-core.c
··· 6 * Author: Michael Brunner <michael.brunner@kontron.com> 7 */ 8 9 #include <linux/platform_device.h> 10 #include <linux/mfd/core.h> 11 #include <linux/mfd/kempld.h> 12 #include <linux/module.h> 13 #include <linux/dmi.h> 14 #include <linux/io.h> 15 #include <linux/delay.h> 16 - #include <linux/acpi.h> 17 18 #define MAX_ID_LEN 4 19 static char force_device_id[MAX_ID_LEN + 1] = ""; ··· 109 if (pld->feature_mask & KEMPLD_FEATURE_MASK_UART) 110 devs[i++].name = kempld_dev_names[KEMPLD_UART]; 111 112 - return mfd_add_devices(pld->dev, -1, devs, i, NULL, 0, NULL); 113 } 114 115 static struct resource kempld_ioresource = { ··· 129 130 static struct platform_device *kempld_pdev; 131 132 - static int kempld_create_platform_device(const struct dmi_system_id *id) 133 { 134 - const struct kempld_platform_data *pdata = id->driver_data; 135 - int ret; 136 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; 152 153 return 0; 154 - err: 155 - platform_device_put(kempld_pdev); 156 - return ret; 157 } 158 159 /** ··· 293 else 294 minor = (pld->info.minor - 10) + 'A'; 295 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; 301 302 return 0; 303 } ··· 363 static DEVICE_ATTR_RO(pld_specification); 364 static DEVICE_ATTR_RO(pld_type); 365 366 - static struct attribute *pld_attributes[] = { 367 &dev_attr_pld_version.attr, 368 &dev_attr_pld_specification.attr, 369 &dev_attr_pld_type.attr, 370 NULL 371 }; 372 - 373 - static const struct attribute_group pld_attr_group = { 374 - .attrs = pld_attributes, 375 - }; 376 377 static int kempld_detect_device(struct kempld_device_data *pld) 378 { ··· 402 pld->info.version, kempld_get_type_string(pld), 403 pld->info.spec_major, pld->info.spec_minor); 404 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; 414 } 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 436 static int kempld_probe(struct platform_device *pdev) 437 { ··· 413 struct resource *ioport; 414 int ret; 415 416 - if (kempld_pdev == NULL) { 417 /* 418 * No kempld_pdev device has been registered in kempld_init, 419 * so we seem to be probing an ACPI platform device. 420 */ 421 - ret = kempld_get_acpi_data(pdev); 422 if (ret) 423 return ret; 424 - } else if (kempld_pdev != pdev) { 425 /* 426 * The platform device we are probing is not the one we 427 * registered in kempld_init using the DMI table, so this one ··· 438 dev_notice(dev, "platform device exists - not using ACPI\n"); 439 return -ENODEV; 440 } 441 - pdata = dev_get_platdata(dev); 442 443 pld = devm_kzalloc(dev, sizeof(*pld), GFP_KERNEL); 444 if (!pld) ··· 468 struct kempld_device_data *pld = platform_get_drvdata(pdev); 469 const struct kempld_platform_data *pdata = dev_get_platdata(pld->dev); 470 471 - sysfs_remove_group(&pld->dev->kobj, &pld_attr_group); 472 - 473 mfd_remove_devices(&pdev->dev); 474 pdata->release_hardware_mutex(pld); 475 } 476 477 - #ifdef CONFIG_ACPI 478 static const struct acpi_device_id kempld_acpi_table[] = { 479 { "KEM0000", (kernel_ulong_t)&kempld_platform_data_generic }, 480 { "KEM0001", (kernel_ulong_t)&kempld_platform_data_generic }, 481 {} 482 }; 483 MODULE_DEVICE_TABLE(acpi, kempld_acpi_table); 484 - #endif 485 486 static struct platform_driver kempld_driver = { 487 .driver = { 488 .name = "kempld", 489 - .acpi_match_table = ACPI_PTR(kempld_acpi_table), 490 }, 491 .probe = kempld_probe, 492 .remove_new = kempld_remove, ··· 496 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 497 DMI_MATCH(DMI_BOARD_NAME, "COMe-bBD"), 498 }, 499 - .driver_data = (void *)&kempld_platform_data_generic, 500 - .callback = kempld_create_platform_device, 501 }, { 502 .ident = "BBL6", 503 .matches = { 504 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 505 DMI_MATCH(DMI_BOARD_NAME, "COMe-bBL6"), 506 }, 507 - .driver_data = (void *)&kempld_platform_data_generic, 508 - .callback = kempld_create_platform_device, 509 }, { 510 .ident = "BDV7", 511 .matches = { 512 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 513 DMI_MATCH(DMI_BOARD_NAME, "COMe-bDV7"), 514 }, 515 - .driver_data = (void *)&kempld_platform_data_generic, 516 - .callback = kempld_create_platform_device, 517 }, { 518 .ident = "BHL6", 519 .matches = { 520 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 521 DMI_MATCH(DMI_BOARD_NAME, "COMe-bHL6"), 522 }, 523 - .driver_data = (void *)&kempld_platform_data_generic, 524 - .callback = kempld_create_platform_device, 525 }, { 526 .ident = "BKL6", 527 .matches = { 528 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 529 DMI_MATCH(DMI_BOARD_NAME, "COMe-bKL6"), 530 }, 531 - .driver_data = (void *)&kempld_platform_data_generic, 532 - .callback = kempld_create_platform_device, 533 }, { 534 .ident = "BSL6", 535 .matches = { 536 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 537 DMI_MATCH(DMI_BOARD_NAME, "COMe-bSL6"), 538 }, 539 - .driver_data = (void *)&kempld_platform_data_generic, 540 - .callback = kempld_create_platform_device, 541 }, { 542 .ident = "CAL6", 543 .matches = { 544 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 545 DMI_MATCH(DMI_BOARD_NAME, "COMe-cAL"), 546 }, 547 - .driver_data = (void *)&kempld_platform_data_generic, 548 - .callback = kempld_create_platform_device, 549 }, { 550 .ident = "CBL6", 551 .matches = { 552 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 553 DMI_MATCH(DMI_BOARD_NAME, "COMe-cBL6"), 554 }, 555 - .driver_data = (void *)&kempld_platform_data_generic, 556 - .callback = kempld_create_platform_device, 557 }, { 558 .ident = "CBW6", 559 .matches = { 560 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 561 DMI_MATCH(DMI_BOARD_NAME, "COMe-cBW6"), 562 }, 563 - .driver_data = (void *)&kempld_platform_data_generic, 564 - .callback = kempld_create_platform_device, 565 }, { 566 .ident = "CCR2", 567 .matches = { 568 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 569 DMI_MATCH(DMI_BOARD_NAME, "COMe-bIP2"), 570 }, 571 - .driver_data = (void *)&kempld_platform_data_generic, 572 - .callback = kempld_create_platform_device, 573 }, { 574 .ident = "CCR6", 575 .matches = { 576 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 577 DMI_MATCH(DMI_BOARD_NAME, "COMe-bIP6"), 578 }, 579 - .driver_data = (void *)&kempld_platform_data_generic, 580 - .callback = kempld_create_platform_device, 581 }, { 582 .ident = "CDV7", 583 .matches = { 584 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 585 DMI_MATCH(DMI_BOARD_NAME, "COMe-cDV7"), 586 }, 587 - .driver_data = (void *)&kempld_platform_data_generic, 588 - .callback = kempld_create_platform_device, 589 }, { 590 .ident = "CHL6", 591 .matches = { 592 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 593 DMI_MATCH(DMI_BOARD_NAME, "COMe-cHL6"), 594 }, 595 - .driver_data = (void *)&kempld_platform_data_generic, 596 - .callback = kempld_create_platform_device, 597 }, { 598 .ident = "CHR2", 599 .matches = { 600 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 601 DMI_MATCH(DMI_BOARD_NAME, "ETXexpress-SC T2"), 602 }, 603 - .driver_data = (void *)&kempld_platform_data_generic, 604 - .callback = kempld_create_platform_device, 605 }, { 606 .ident = "CHR2", 607 .matches = { 608 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 609 DMI_MATCH(DMI_BOARD_NAME, "ETXe-SC T2"), 610 }, 611 - .driver_data = (void *)&kempld_platform_data_generic, 612 - .callback = kempld_create_platform_device, 613 }, { 614 .ident = "CHR2", 615 .matches = { 616 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 617 DMI_MATCH(DMI_BOARD_NAME, "COMe-bSC2"), 618 }, 619 - .driver_data = (void *)&kempld_platform_data_generic, 620 - .callback = kempld_create_platform_device, 621 }, { 622 .ident = "CHR6", 623 .matches = { 624 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 625 DMI_MATCH(DMI_BOARD_NAME, "ETXexpress-SC T6"), 626 }, 627 - .driver_data = (void *)&kempld_platform_data_generic, 628 - .callback = kempld_create_platform_device, 629 }, { 630 .ident = "CHR6", 631 .matches = { 632 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 633 DMI_MATCH(DMI_BOARD_NAME, "ETXe-SC T6"), 634 }, 635 - .driver_data = (void *)&kempld_platform_data_generic, 636 - .callback = kempld_create_platform_device, 637 }, { 638 .ident = "CHR6", 639 .matches = { 640 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 641 DMI_MATCH(DMI_BOARD_NAME, "COMe-bSC6"), 642 }, 643 - .driver_data = (void *)&kempld_platform_data_generic, 644 - .callback = kempld_create_platform_device, 645 }, { 646 .ident = "CKL6", 647 .matches = { 648 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 649 DMI_MATCH(DMI_BOARD_NAME, "COMe-cKL6"), 650 }, 651 - .driver_data = (void *)&kempld_platform_data_generic, 652 - .callback = kempld_create_platform_device, 653 }, { 654 .ident = "CNTG", 655 .matches = { 656 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 657 DMI_MATCH(DMI_BOARD_NAME, "ETXexpress-PC"), 658 }, 659 - .driver_data = (void *)&kempld_platform_data_generic, 660 - .callback = kempld_create_platform_device, 661 }, { 662 .ident = "CNTG", 663 .matches = { 664 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 665 DMI_MATCH(DMI_BOARD_NAME, "COMe-bPC2"), 666 }, 667 - .driver_data = (void *)&kempld_platform_data_generic, 668 - .callback = kempld_create_platform_device, 669 }, { 670 .ident = "CNTX", 671 .matches = { 672 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 673 DMI_MATCH(DMI_BOARD_NAME, "PXT"), 674 }, 675 - .driver_data = (void *)&kempld_platform_data_generic, 676 - .callback = kempld_create_platform_device, 677 }, { 678 .ident = "CSL6", 679 .matches = { 680 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 681 DMI_MATCH(DMI_BOARD_NAME, "COMe-cSL6"), 682 }, 683 - .driver_data = (void *)&kempld_platform_data_generic, 684 - .callback = kempld_create_platform_device, 685 }, { 686 .ident = "CVV6", 687 .matches = { 688 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 689 DMI_MATCH(DMI_BOARD_NAME, "COMe-cBT"), 690 }, 691 - .driver_data = (void *)&kempld_platform_data_generic, 692 - .callback = kempld_create_platform_device, 693 }, { 694 .ident = "FRI2", 695 .matches = { 696 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 697 DMI_MATCH(DMI_BIOS_VERSION, "FRI2"), 698 }, 699 - .driver_data = (void *)&kempld_platform_data_generic, 700 - .callback = kempld_create_platform_device, 701 }, { 702 .ident = "FRI2", 703 .matches = { 704 DMI_MATCH(DMI_PRODUCT_NAME, "Fish River Island II"), 705 }, 706 - .driver_data = (void *)&kempld_platform_data_generic, 707 - .callback = kempld_create_platform_device, 708 }, { 709 .ident = "A203", 710 .matches = { 711 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 712 DMI_MATCH(DMI_BOARD_NAME, "KBox A-203"), 713 }, 714 - .driver_data = (void *)&kempld_platform_data_generic, 715 - .callback = kempld_create_platform_device, 716 }, { 717 .ident = "M4A1", 718 .matches = { 719 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 720 DMI_MATCH(DMI_BOARD_NAME, "COMe-m4AL"), 721 }, 722 - .driver_data = (void *)&kempld_platform_data_generic, 723 - .callback = kempld_create_platform_device, 724 }, { 725 .ident = "MAL1", 726 .matches = { 727 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 728 DMI_MATCH(DMI_BOARD_NAME, "COMe-mAL10"), 729 }, 730 - .driver_data = (void *)&kempld_platform_data_generic, 731 - .callback = kempld_create_platform_device, 732 }, { 733 .ident = "MAPL", 734 .matches = { 735 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 736 DMI_MATCH(DMI_BOARD_NAME, "mITX-APL"), 737 }, 738 - .driver_data = (void *)&kempld_platform_data_generic, 739 - .callback = kempld_create_platform_device, 740 }, { 741 .ident = "MBR1", 742 .matches = { 743 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 744 DMI_MATCH(DMI_BOARD_NAME, "ETX-OH"), 745 }, 746 - .driver_data = (void *)&kempld_platform_data_generic, 747 - .callback = kempld_create_platform_device, 748 }, { 749 .ident = "MVV1", 750 .matches = { 751 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 752 DMI_MATCH(DMI_BOARD_NAME, "COMe-mBT"), 753 }, 754 - .driver_data = (void *)&kempld_platform_data_generic, 755 - .callback = kempld_create_platform_device, 756 }, { 757 .ident = "NTC1", 758 .matches = { 759 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 760 DMI_MATCH(DMI_BOARD_NAME, "nanoETXexpress-TT"), 761 }, 762 - .driver_data = (void *)&kempld_platform_data_generic, 763 - .callback = kempld_create_platform_device, 764 }, { 765 .ident = "NTC1", 766 .matches = { 767 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 768 DMI_MATCH(DMI_BOARD_NAME, "nETXe-TT"), 769 }, 770 - .driver_data = (void *)&kempld_platform_data_generic, 771 - .callback = kempld_create_platform_device, 772 }, { 773 .ident = "NTC1", 774 .matches = { 775 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 776 DMI_MATCH(DMI_BOARD_NAME, "COMe-mTT"), 777 }, 778 - .driver_data = (void *)&kempld_platform_data_generic, 779 - .callback = kempld_create_platform_device, 780 }, { 781 .ident = "NUP1", 782 .matches = { 783 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 784 DMI_MATCH(DMI_BOARD_NAME, "COMe-mCT"), 785 }, 786 - .driver_data = (void *)&kempld_platform_data_generic, 787 - .callback = kempld_create_platform_device, 788 }, { 789 .ident = "PAPL", 790 .matches = { 791 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 792 DMI_MATCH(DMI_BOARD_NAME, "pITX-APL"), 793 }, 794 - .driver_data = (void *)&kempld_platform_data_generic, 795 - .callback = kempld_create_platform_device, 796 }, { 797 .ident = "SXAL", 798 .matches = { 799 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 800 DMI_MATCH(DMI_BOARD_NAME, "SMARC-sXAL"), 801 }, 802 - .driver_data = (void *)&kempld_platform_data_generic, 803 - .callback = kempld_create_platform_device, 804 }, { 805 .ident = "SXAL4", 806 .matches = { 807 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 808 DMI_MATCH(DMI_BOARD_NAME, "SMARC-sXA4"), 809 }, 810 - .driver_data = (void *)&kempld_platform_data_generic, 811 - .callback = kempld_create_platform_device, 812 }, { 813 .ident = "UNP1", 814 .matches = { 815 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 816 DMI_MATCH(DMI_BOARD_NAME, "microETXexpress-DC"), 817 }, 818 - .driver_data = (void *)&kempld_platform_data_generic, 819 - .callback = kempld_create_platform_device, 820 }, { 821 .ident = "UNP1", 822 .matches = { 823 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 824 DMI_MATCH(DMI_BOARD_NAME, "COMe-cDC2"), 825 }, 826 - .driver_data = (void *)&kempld_platform_data_generic, 827 - .callback = kempld_create_platform_device, 828 }, { 829 .ident = "UNTG", 830 .matches = { 831 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 832 DMI_MATCH(DMI_BOARD_NAME, "microETXexpress-PC"), 833 }, 834 - .driver_data = (void *)&kempld_platform_data_generic, 835 - .callback = kempld_create_platform_device, 836 }, { 837 .ident = "UNTG", 838 .matches = { 839 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 840 DMI_MATCH(DMI_BOARD_NAME, "COMe-cPC2"), 841 }, 842 - .driver_data = (void *)&kempld_platform_data_generic, 843 - .callback = kempld_create_platform_device, 844 }, { 845 .ident = "UUP6", 846 .matches = { 847 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 848 DMI_MATCH(DMI_BOARD_NAME, "COMe-cCT6"), 849 }, 850 - .driver_data = (void *)&kempld_platform_data_generic, 851 - .callback = kempld_create_platform_device, 852 }, { 853 .ident = "UTH6", 854 .matches = { 855 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 856 DMI_MATCH(DMI_BOARD_NAME, "COMe-cTH6"), 857 }, 858 - .driver_data = (void *)&kempld_platform_data_generic, 859 - .callback = kempld_create_platform_device, 860 }, { 861 .ident = "Q7AL", 862 .matches = { 863 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 864 DMI_MATCH(DMI_BOARD_NAME, "Qseven-Q7AL"), 865 }, 866 - .driver_data = (void *)&kempld_platform_data_generic, 867 - .callback = kempld_create_platform_device, 868 }, 869 {} 870 }; ··· 779 static int __init kempld_init(void) 780 { 781 const struct dmi_system_id *id; 782 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); 793 } 794 795 return platform_driver_register(&kempld_driver); 796 } 797 798 static void __exit kempld_exit(void) 799 { 800 - if (kempld_pdev) 801 - platform_device_unregister(kempld_pdev); 802 - 803 platform_driver_unregister(&kempld_driver); 804 } 805
··· 6 * Author: Michael Brunner <michael.brunner@kontron.com> 7 */ 8 9 + #include <linux/err.h> 10 #include <linux/platform_device.h> 11 #include <linux/mfd/core.h> 12 #include <linux/mfd/kempld.h> 13 + #include <linux/mod_devicetable.h> 14 #include <linux/module.h> 15 + #include <linux/property.h> 16 #include <linux/dmi.h> 17 #include <linux/io.h> 18 #include <linux/delay.h> 19 + #include <linux/sysfs.h> 20 21 #define MAX_ID_LEN 4 22 static char force_device_id[MAX_ID_LEN + 1] = ""; ··· 106 if (pld->feature_mask & KEMPLD_FEATURE_MASK_UART) 107 devs[i++].name = kempld_dev_names[KEMPLD_UART]; 108 109 + return mfd_add_devices(pld->dev, PLATFORM_DEVID_NONE, devs, i, NULL, 0, NULL); 110 } 111 112 static struct resource kempld_ioresource = { ··· 126 127 static struct platform_device *kempld_pdev; 128 129 + static int kempld_create_platform_device(const struct kempld_platform_data *pdata) 130 { 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 + }; 139 140 + kempld_pdev = platform_device_register_full(&pdevinfo); 141 + if (IS_ERR(kempld_pdev)) 142 + return PTR_ERR(kempld_pdev); 143 144 return 0; 145 } 146 147 /** ··· 299 else 300 minor = (pld->info.minor - 10) + 'A'; 301 302 + scnprintf(pld->info.version, sizeof(pld->info.version), "P%X%c%c.%04X", 303 + pld->info.number, major, minor, pld->info.buildnr); 304 305 return 0; 306 } ··· 372 static DEVICE_ATTR_RO(pld_specification); 373 static DEVICE_ATTR_RO(pld_type); 374 375 + static struct attribute *pld_attrs[] = { 376 &dev_attr_pld_version.attr, 377 &dev_attr_pld_specification.attr, 378 &dev_attr_pld_type.attr, 379 NULL 380 }; 381 + ATTRIBUTE_GROUPS(pld); 382 383 static int kempld_detect_device(struct kempld_device_data *pld) 384 { ··· 414 pld->info.version, kempld_get_type_string(pld), 415 pld->info.spec_major, pld->info.spec_minor); 416 417 + return kempld_register_cells(pld); 418 } 419 420 static int kempld_probe(struct platform_device *pdev) 421 { ··· 453 struct resource *ioport; 454 int ret; 455 456 + if (IS_ERR_OR_NULL(kempld_pdev)) { 457 /* 458 * No kempld_pdev device has been registered in kempld_init, 459 * so we seem to be probing an ACPI platform device. 460 */ 461 + pdata = device_get_match_data(dev); 462 + if (!pdata) 463 + return -ENODEV; 464 + 465 + ret = platform_device_add_data(pdev, pdata, sizeof(*pdata)); 466 if (ret) 467 return ret; 468 + } else if (kempld_pdev == pdev) { 469 + pdata = dev_get_platdata(dev); 470 + } else { 471 /* 472 * The platform device we are probing is not the one we 473 * registered in kempld_init using the DMI table, so this one ··· 472 dev_notice(dev, "platform device exists - not using ACPI\n"); 473 return -ENODEV; 474 } 475 476 pld = devm_kzalloc(dev, sizeof(*pld), GFP_KERNEL); 477 if (!pld) ··· 503 struct kempld_device_data *pld = platform_get_drvdata(pdev); 504 const struct kempld_platform_data *pdata = dev_get_platdata(pld->dev); 505 506 mfd_remove_devices(&pdev->dev); 507 pdata->release_hardware_mutex(pld); 508 } 509 510 static const struct acpi_device_id kempld_acpi_table[] = { 511 { "KEM0000", (kernel_ulong_t)&kempld_platform_data_generic }, 512 { "KEM0001", (kernel_ulong_t)&kempld_platform_data_generic }, 513 {} 514 }; 515 MODULE_DEVICE_TABLE(acpi, kempld_acpi_table); 516 517 static struct platform_driver kempld_driver = { 518 .driver = { 519 .name = "kempld", 520 + .acpi_match_table = kempld_acpi_table, 521 + .dev_groups = pld_groups, 522 }, 523 .probe = kempld_probe, 524 .remove_new = kempld_remove, ··· 534 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 535 DMI_MATCH(DMI_BOARD_NAME, "COMe-bBD"), 536 }, 537 }, { 538 .ident = "BBL6", 539 .matches = { 540 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 541 DMI_MATCH(DMI_BOARD_NAME, "COMe-bBL6"), 542 }, 543 }, { 544 .ident = "BDV7", 545 .matches = { 546 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 547 DMI_MATCH(DMI_BOARD_NAME, "COMe-bDV7"), 548 }, 549 }, { 550 .ident = "BHL6", 551 .matches = { 552 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 553 DMI_MATCH(DMI_BOARD_NAME, "COMe-bHL6"), 554 }, 555 }, { 556 .ident = "BKL6", 557 .matches = { 558 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 559 DMI_MATCH(DMI_BOARD_NAME, "COMe-bKL6"), 560 }, 561 }, { 562 .ident = "BSL6", 563 .matches = { 564 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 565 DMI_MATCH(DMI_BOARD_NAME, "COMe-bSL6"), 566 }, 567 }, { 568 .ident = "CAL6", 569 .matches = { 570 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 571 DMI_MATCH(DMI_BOARD_NAME, "COMe-cAL"), 572 }, 573 }, { 574 .ident = "CBL6", 575 .matches = { 576 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 577 DMI_MATCH(DMI_BOARD_NAME, "COMe-cBL6"), 578 }, 579 }, { 580 .ident = "CBW6", 581 .matches = { 582 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 583 DMI_MATCH(DMI_BOARD_NAME, "COMe-cBW6"), 584 }, 585 }, { 586 .ident = "CCR2", 587 .matches = { 588 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 589 DMI_MATCH(DMI_BOARD_NAME, "COMe-bIP2"), 590 }, 591 }, { 592 .ident = "CCR6", 593 .matches = { 594 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 595 DMI_MATCH(DMI_BOARD_NAME, "COMe-bIP6"), 596 }, 597 }, { 598 .ident = "CDV7", 599 .matches = { 600 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 601 DMI_MATCH(DMI_BOARD_NAME, "COMe-cDV7"), 602 }, 603 }, { 604 .ident = "CHL6", 605 .matches = { 606 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 607 DMI_MATCH(DMI_BOARD_NAME, "COMe-cHL6"), 608 }, 609 }, { 610 .ident = "CHR2", 611 .matches = { 612 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 613 DMI_MATCH(DMI_BOARD_NAME, "ETXexpress-SC T2"), 614 }, 615 }, { 616 .ident = "CHR2", 617 .matches = { 618 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 619 DMI_MATCH(DMI_BOARD_NAME, "ETXe-SC T2"), 620 }, 621 }, { 622 .ident = "CHR2", 623 .matches = { 624 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 625 DMI_MATCH(DMI_BOARD_NAME, "COMe-bSC2"), 626 }, 627 }, { 628 .ident = "CHR6", 629 .matches = { 630 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 631 DMI_MATCH(DMI_BOARD_NAME, "ETXexpress-SC T6"), 632 }, 633 }, { 634 .ident = "CHR6", 635 .matches = { 636 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 637 DMI_MATCH(DMI_BOARD_NAME, "ETXe-SC T6"), 638 }, 639 }, { 640 .ident = "CHR6", 641 .matches = { 642 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 643 DMI_MATCH(DMI_BOARD_NAME, "COMe-bSC6"), 644 }, 645 }, { 646 .ident = "CKL6", 647 .matches = { 648 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 649 DMI_MATCH(DMI_BOARD_NAME, "COMe-cKL6"), 650 }, 651 }, { 652 .ident = "CNTG", 653 .matches = { 654 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 655 DMI_MATCH(DMI_BOARD_NAME, "ETXexpress-PC"), 656 }, 657 }, { 658 .ident = "CNTG", 659 .matches = { 660 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 661 DMI_MATCH(DMI_BOARD_NAME, "COMe-bPC2"), 662 }, 663 }, { 664 .ident = "CNTX", 665 .matches = { 666 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 667 DMI_MATCH(DMI_BOARD_NAME, "PXT"), 668 }, 669 }, { 670 .ident = "CSL6", 671 .matches = { 672 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 673 DMI_MATCH(DMI_BOARD_NAME, "COMe-cSL6"), 674 }, 675 }, { 676 .ident = "CVV6", 677 .matches = { 678 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 679 DMI_MATCH(DMI_BOARD_NAME, "COMe-cBT"), 680 }, 681 }, { 682 .ident = "FRI2", 683 .matches = { 684 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 685 DMI_MATCH(DMI_BIOS_VERSION, "FRI2"), 686 }, 687 }, { 688 .ident = "FRI2", 689 .matches = { 690 DMI_MATCH(DMI_PRODUCT_NAME, "Fish River Island II"), 691 }, 692 }, { 693 .ident = "A203", 694 .matches = { 695 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 696 DMI_MATCH(DMI_BOARD_NAME, "KBox A-203"), 697 }, 698 }, { 699 .ident = "M4A1", 700 .matches = { 701 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 702 DMI_MATCH(DMI_BOARD_NAME, "COMe-m4AL"), 703 }, 704 }, { 705 .ident = "MAL1", 706 .matches = { 707 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 708 DMI_MATCH(DMI_BOARD_NAME, "COMe-mAL10"), 709 }, 710 }, { 711 .ident = "MAPL", 712 .matches = { 713 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 714 DMI_MATCH(DMI_BOARD_NAME, "mITX-APL"), 715 }, 716 }, { 717 .ident = "MBR1", 718 .matches = { 719 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 720 DMI_MATCH(DMI_BOARD_NAME, "ETX-OH"), 721 }, 722 }, { 723 .ident = "MVV1", 724 .matches = { 725 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 726 DMI_MATCH(DMI_BOARD_NAME, "COMe-mBT"), 727 }, 728 }, { 729 .ident = "NTC1", 730 .matches = { 731 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 732 DMI_MATCH(DMI_BOARD_NAME, "nanoETXexpress-TT"), 733 }, 734 }, { 735 .ident = "NTC1", 736 .matches = { 737 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 738 DMI_MATCH(DMI_BOARD_NAME, "nETXe-TT"), 739 }, 740 }, { 741 .ident = "NTC1", 742 .matches = { 743 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 744 DMI_MATCH(DMI_BOARD_NAME, "COMe-mTT"), 745 }, 746 }, { 747 .ident = "NUP1", 748 .matches = { 749 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 750 DMI_MATCH(DMI_BOARD_NAME, "COMe-mCT"), 751 }, 752 }, { 753 .ident = "PAPL", 754 .matches = { 755 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 756 DMI_MATCH(DMI_BOARD_NAME, "pITX-APL"), 757 }, 758 }, { 759 .ident = "SXAL", 760 .matches = { 761 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 762 DMI_MATCH(DMI_BOARD_NAME, "SMARC-sXAL"), 763 }, 764 }, { 765 .ident = "SXAL4", 766 .matches = { 767 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 768 DMI_MATCH(DMI_BOARD_NAME, "SMARC-sXA4"), 769 }, 770 }, { 771 .ident = "UNP1", 772 .matches = { 773 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 774 DMI_MATCH(DMI_BOARD_NAME, "microETXexpress-DC"), 775 }, 776 }, { 777 .ident = "UNP1", 778 .matches = { 779 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 780 DMI_MATCH(DMI_BOARD_NAME, "COMe-cDC2"), 781 }, 782 }, { 783 .ident = "UNTG", 784 .matches = { 785 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 786 DMI_MATCH(DMI_BOARD_NAME, "microETXexpress-PC"), 787 }, 788 }, { 789 .ident = "UNTG", 790 .matches = { 791 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 792 DMI_MATCH(DMI_BOARD_NAME, "COMe-cPC2"), 793 }, 794 }, { 795 .ident = "UUP6", 796 .matches = { 797 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 798 DMI_MATCH(DMI_BOARD_NAME, "COMe-cCT6"), 799 }, 800 }, { 801 .ident = "UTH6", 802 .matches = { 803 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 804 DMI_MATCH(DMI_BOARD_NAME, "COMe-cTH6"), 805 }, 806 }, { 807 .ident = "Q7AL", 808 .matches = { 809 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 810 DMI_MATCH(DMI_BOARD_NAME, "Qseven-Q7AL"), 811 }, 812 }, 813 {} 814 }; ··· 911 static int __init kempld_init(void) 912 { 913 const struct dmi_system_id *id; 914 + int ret = -ENODEV; 915 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; 926 } 927 + if (ret) 928 + return ret; 929 930 return platform_driver_register(&kempld_driver); 931 } 932 933 static void __exit kempld_exit(void) 934 { 935 + platform_device_unregister(kempld_pdev); 936 platform_driver_unregister(&kempld_driver); 937 } 938
+1 -4
drivers/mfd/ocelot-spi.c
··· 145 struct device *dev = context; 146 struct ocelot_ddata *ddata; 147 struct spi_device *spi; 148 - struct spi_message msg; 149 unsigned int index = 0; 150 151 ddata = dev_get_drvdata(dev); ··· 165 xfers[index].len = val_size; 166 index++; 167 168 - spi_message_init_with_transfers(&msg, xfers, index); 169 - 170 - return spi_sync(spi, &msg); 171 } 172 173 static int ocelot_spi_regmap_bus_write(void *context, const void *data, size_t count)
··· 145 struct device *dev = context; 146 struct ocelot_ddata *ddata; 147 struct spi_device *spi; 148 unsigned int index = 0; 149 150 ddata = dev_get_drvdata(dev); ··· 166 xfers[index].len = val_size; 167 index++; 168 169 + return spi_sync_transfer(spi, xfers, index); 170 } 171 172 static int ocelot_spi_regmap_bus_write(void *context, const void *data, size_t count)
+104
drivers/mfd/rk8xx-core.c
··· 28 DEFINE_RES_IRQ(RK808_IRQ_RTC_ALARM), 29 }; 30 31 static const struct resource rk817_rtc_resources[] = { 32 DEFINE_RES_IRQ(RK817_IRQ_RTC_ALARM), 33 }; ··· 88 .name = "rk808-rtc", 89 .num_resources = ARRAY_SIZE(rtc_resources), 90 .resources = rtc_resources, 91 }, 92 }; 93 ··· 166 { RK808_DCDC_UV_ACT_REG, BUCK_UV_ACT_MASK, BUCK_UV_ACT_DISABLE}, 167 { RK808_VB_MON_REG, MASK_ALL, VB_LO_ACT | 168 VB_LO_SEL_3500MV }, 169 }; 170 171 static const struct rk808_reg_data rk817_pre_init_reg[] = { ··· 381 }, 382 }; 383 384 static const struct regmap_irq rk818_irqs[] = { 385 /* INT_STS */ 386 [RK818_IRQ_VOUT_LO] = { ··· 566 .init_ack_masked = true, 567 }; 568 569 static struct regmap_irq_chip rk817_irq_chip = { 570 .name = "rk817", 571 .irqs = rk817_irqs, ··· 626 reg = RK817_SYS_CFG(3); 627 bit = DEV_OFF; 628 break; 629 case RK818_ID: 630 reg = RK818_DEVCTRL_REG; 631 bit = DEV_OFF; ··· 733 nr_pre_init_regs = ARRAY_SIZE(rk808_pre_init_reg); 734 cells = rk808s; 735 nr_cells = ARRAY_SIZE(rk808s); 736 break; 737 case RK818_ID: 738 rk808->regmap_irq_chip = &rk818_irq_chip;
··· 28 DEFINE_RES_IRQ(RK808_IRQ_RTC_ALARM), 29 }; 30 31 + static const struct resource rk816_rtc_resources[] = { 32 + DEFINE_RES_IRQ(RK816_IRQ_RTC_ALARM), 33 + }; 34 + 35 static const struct resource rk817_rtc_resources[] = { 36 DEFINE_RES_IRQ(RK817_IRQ_RTC_ALARM), 37 }; ··· 84 .name = "rk808-rtc", 85 .num_resources = ARRAY_SIZE(rtc_resources), 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, 103 }, 104 }; 105 ··· 146 { RK808_DCDC_UV_ACT_REG, BUCK_UV_ACT_MASK, BUCK_UV_ACT_DISABLE}, 147 { RK808_VB_MON_REG, MASK_ALL, VB_LO_ACT | 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 }, 160 }; 161 162 static const struct rk808_reg_data rk817_pre_init_reg[] = { ··· 350 }, 351 }; 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 + 406 static const struct regmap_irq rk818_irqs[] = { 407 /* INT_STS */ 408 [RK818_IRQ_VOUT_LO] = { ··· 482 .init_ack_masked = true, 483 }; 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 + 497 static struct regmap_irq_chip rk817_irq_chip = { 498 .name = "rk817", 499 .irqs = rk817_irqs, ··· 530 reg = RK817_SYS_CFG(3); 531 bit = DEV_OFF; 532 break; 533 + case RK816_ID: 534 case RK818_ID: 535 reg = RK818_DEVCTRL_REG; 536 bit = DEV_OFF; ··· 636 nr_pre_init_regs = ARRAY_SIZE(rk808_pre_init_reg); 637 cells = rk808s; 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); 646 break; 647 case RK818_ID: 648 rk808->regmap_irq_chip = &rk818_irq_chip;
+44 -1
drivers/mfd/rk8xx-i2c.c
··· 1 // SPDX-License-Identifier: GPL-2.0-only 2 /* 3 - * Rockchip RK808/RK818 Core (I2C) driver 4 * 5 * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd 6 * Copyright (C) 2016 PHYTEC Messtechnik GmbH ··· 43 case RK808_DEVCTRL_REG: 44 case RK808_INT_STS_REG1: 45 case RK808_INT_STS_REG2: 46 return true; 47 } 48 ··· 129 .volatile_reg = rk808_is_volatile_reg, 130 }; 131 132 static const struct regmap_config rk817_regmap_config = { 133 .reg_bits = 8, 134 .val_bits = 8, ··· 158 static const struct rk8xx_i2c_platform_data rk809_data = { 159 .regmap_cfg = &rk817_regmap_config, 160 .variant = RK809_ID, 161 }; 162 163 static const struct rk8xx_i2c_platform_data rk817_data = { ··· 203 { .compatible = "rockchip,rk805", .data = &rk805_data }, 204 { .compatible = "rockchip,rk808", .data = &rk808_data }, 205 { .compatible = "rockchip,rk809", .data = &rk809_data }, 206 { .compatible = "rockchip,rk817", .data = &rk817_data }, 207 { .compatible = "rockchip,rk818", .data = &rk818_data }, 208 { },
··· 1 // SPDX-License-Identifier: GPL-2.0-only 2 /* 3 + * Rockchip RK805/RK808/RK816/RK817/RK818 Core (I2C) driver 4 * 5 * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd 6 * Copyright (C) 2016 PHYTEC Messtechnik GmbH ··· 43 case RK808_DEVCTRL_REG: 44 case RK808_INT_STS_REG1: 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: 75 return true; 76 } 77 ··· 100 .volatile_reg = rk808_is_volatile_reg, 101 }; 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 + 111 static const struct regmap_config rk817_regmap_config = { 112 .reg_bits = 8, 113 .val_bits = 8, ··· 121 static const struct rk8xx_i2c_platform_data rk809_data = { 122 .regmap_cfg = &rk817_regmap_config, 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, 129 }; 130 131 static const struct rk8xx_i2c_platform_data rk817_data = { ··· 161 { .compatible = "rockchip,rk805", .data = &rk805_data }, 162 { .compatible = "rockchip,rk808", .data = &rk808_data }, 163 { .compatible = "rockchip,rk809", .data = &rk809_data }, 164 + { .compatible = "rockchip,rk816", .data = &rk816_data }, 165 { .compatible = "rockchip,rk817", .data = &rk817_data }, 166 { .compatible = "rockchip,rk818", .data = &rk818_data }, 167 { },
+35 -1
drivers/mfd/rohm-bd71828.c
··· 464 OUT32K_MODE_CMOS); 465 } 466 467 static int bd71828_i2c_probe(struct i2c_client *i2c) 468 { 469 struct regmap_irq_chip_data *irq_data; ··· 563 ret = devm_mfd_add_devices(&i2c->dev, PLATFORM_DEVID_AUTO, mfd, cells, 564 NULL, 0, regmap_irq_get_domain(irq_data)); 565 if (ret) 566 - dev_err_probe(&i2c->dev, ret, "Failed to create subdevices\n"); 567 568 return ret; 569 }
··· 464 OUT32K_MODE_CMOS); 465 } 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 + 488 static int bd71828_i2c_probe(struct i2c_client *i2c) 489 { 490 struct regmap_irq_chip_data *irq_data; ··· 542 ret = devm_mfd_add_devices(&i2c->dev, PLATFORM_DEVID_AUTO, mfd, cells, 543 NULL, 0, regmap_irq_get_domain(irq_data)); 544 if (ret) 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 + } 559 560 return ret; 561 }
+93 -14
drivers/mfd/rsmu_i2c.c
··· 32 #define RSMU_SABRE_PAGE_ADDR 0x7F 33 #define RSMU_SABRE_PAGE_WINDOW 128 34 35 static const struct regmap_range_cfg rsmu_sabre_range_cfg[] = { 36 { 37 .range_min = 0, ··· 56 } 57 } 58 59 - static int rsmu_read_device(struct rsmu_ddata *rsmu, u8 reg, u8 *buf, u16 bytes) 60 { 61 struct i2c_client *client = to_i2c_client(rsmu->dev); 62 struct i2c_msg msg[2]; ··· 107 return 0; 108 } 109 110 - static int rsmu_write_device(struct rsmu_ddata *rsmu, u8 reg, u8 *buf, u16 bytes) 111 { 112 struct i2c_client *client = to_i2c_client(rsmu->dev); 113 - u8 msg[RSMU_MAX_WRITE_COUNT + 1]; /* 1 Byte added for the device register */ 114 int cnt; 115 116 if (bytes > RSMU_MAX_WRITE_COUNT) ··· 131 return 0; 132 } 133 134 - static int rsmu_write_page_register(struct rsmu_ddata *rsmu, u32 reg) 135 { 136 u32 page = reg & RSMU_CM_PAGE_MASK; 137 u8 buf[4]; ··· 161 return err; 162 } 163 164 - static int rsmu_reg_read(void *context, unsigned int reg, unsigned int *val) 165 { 166 struct rsmu_ddata *rsmu = i2c_get_clientdata((struct i2c_client *)context); 167 u8 addr = (u8)(reg & RSMU_CM_ADDRESS_MASK); 168 int err; 169 170 - err = rsmu_write_page_register(rsmu, reg); 171 if (err) 172 return err; 173 174 - err = rsmu_read_device(rsmu, addr, (u8 *)val, 1); 175 if (err) 176 dev_err(rsmu->dev, "Failed to read offset address 0x%x\n", addr); 177 178 return err; 179 } 180 181 - static int rsmu_reg_write(void *context, unsigned int reg, unsigned int val) 182 { 183 struct rsmu_ddata *rsmu = i2c_get_clientdata((struct i2c_client *)context); 184 u8 addr = (u8)(reg & RSMU_CM_ADDRESS_MASK); 185 u8 data = (u8)val; 186 int err; 187 188 - err = rsmu_write_page_register(rsmu, reg); 189 if (err) 190 return err; 191 192 - err = rsmu_write_device(rsmu, addr, &data, 1); 193 if (err) 194 dev_err(rsmu->dev, 195 "Failed to write offset address 0x%x\n", addr); ··· 197 return err; 198 } 199 200 - static const struct regmap_config rsmu_cm_regmap_config = { 201 .reg_bits = 32, 202 .val_bits = 8, 203 .max_register = 0x20120000, 204 - .reg_read = rsmu_reg_read, 205 - .reg_write = rsmu_reg_write, 206 .cache_type = REGCACHE_NONE, 207 }; 208 ··· 289 290 switch (rsmu->type) { 291 case RSMU_CM: 292 - cfg = &rsmu_cm_regmap_config; 293 break; 294 case RSMU_SABRE: 295 cfg = &rsmu_sabre_regmap_config; ··· 314 rsmu->regmap = devm_regmap_init(&client->dev, NULL, client, cfg); 315 else 316 rsmu->regmap = devm_regmap_init_i2c(client, cfg); 317 if (IS_ERR(rsmu->regmap)) { 318 ret = PTR_ERR(rsmu->regmap); 319 dev_err(rsmu->dev, "Failed to allocate register map: %d\n", ret);
··· 32 #define RSMU_SABRE_PAGE_ADDR 0x7F 33 #define RSMU_SABRE_PAGE_WINDOW 128 34 35 + typedef int (*rsmu_rw_device)(struct rsmu_ddata *rsmu, u8 reg, u8 *buf, u8 bytes); 36 + 37 static const struct regmap_range_cfg rsmu_sabre_range_cfg[] = { 38 { 39 .range_min = 0, ··· 54 } 55 } 56 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) 79 { 80 struct i2c_client *client = to_i2c_client(rsmu->dev); 81 struct i2c_msg msg[2]; ··· 84 return 0; 85 } 86 87 + static int rsmu_i2c_write_device(struct rsmu_ddata *rsmu, u8 reg, u8 *buf, u8 bytes) 88 { 89 struct i2c_client *client = to_i2c_client(rsmu->dev); 90 + /* we add 1 byte for device register */ 91 + u8 msg[RSMU_MAX_WRITE_COUNT + 1]; 92 int cnt; 93 94 if (bytes > RSMU_MAX_WRITE_COUNT) ··· 107 return 0; 108 } 109 110 + static int rsmu_write_page_register(struct rsmu_ddata *rsmu, u32 reg, 111 + rsmu_rw_device rsmu_write_device) 112 { 113 u32 page = reg & RSMU_CM_PAGE_MASK; 114 u8 buf[4]; ··· 136 return err; 137 } 138 139 + static int rsmu_i2c_reg_read(void *context, unsigned int reg, unsigned int *val) 140 { 141 struct rsmu_ddata *rsmu = i2c_get_clientdata((struct i2c_client *)context); 142 u8 addr = (u8)(reg & RSMU_CM_ADDRESS_MASK); 143 int err; 144 145 + err = rsmu_write_page_register(rsmu, reg, rsmu_i2c_write_device); 146 if (err) 147 return err; 148 149 + err = rsmu_i2c_read_device(rsmu, addr, (u8 *)val, 1); 150 if (err) 151 dev_err(rsmu->dev, "Failed to read offset address 0x%x\n", addr); 152 153 return err; 154 } 155 156 + static int rsmu_i2c_reg_write(void *context, unsigned int reg, unsigned int val) 157 { 158 struct rsmu_ddata *rsmu = i2c_get_clientdata((struct i2c_client *)context); 159 u8 addr = (u8)(reg & RSMU_CM_ADDRESS_MASK); 160 u8 data = (u8)val; 161 int err; 162 163 + err = rsmu_write_page_register(rsmu, reg, rsmu_i2c_write_device); 164 if (err) 165 return err; 166 167 + err = rsmu_i2c_write_device(rsmu, addr, &data, 1); 168 if (err) 169 dev_err(rsmu->dev, 170 "Failed to write offset address 0x%x\n", addr); ··· 172 return err; 173 } 174 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 = { 212 .reg_bits = 32, 213 .val_bits = 8, 214 .max_register = 0x20120000, 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, 226 .cache_type = REGCACHE_NONE, 227 }; 228 ··· 219 220 switch (rsmu->type) { 221 case RSMU_CM: 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 + } 231 break; 232 case RSMU_SABRE: 233 cfg = &rsmu_sabre_regmap_config; ··· 236 rsmu->regmap = devm_regmap_init(&client->dev, NULL, client, cfg); 237 else 238 rsmu->regmap = devm_regmap_init_i2c(client, cfg); 239 + 240 if (IS_ERR(rsmu->regmap)) { 241 ret = PTR_ERR(rsmu->regmap); 242 dev_err(rsmu->dev, "Failed to allocate register map: %d\n", ret);
+4 -4
drivers/mfd/rsmu_spi.c
··· 106 return 0; 107 page_reg = RSMU_CM_PAGE_ADDR; 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); 113 bytes = 4; 114 break; 115 case RSMU_SABRE:
··· 106 return 0; 107 page_reg = RSMU_CM_PAGE_ADDR; 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); 113 bytes = 4; 114 break; 115 case RSMU_SABRE:
-1
drivers/mfd/ssbi.c
··· 64 }; 65 66 struct ssbi { 67 - struct device *slave; 68 void __iomem *base; 69 spinlock_t lock; 70 enum ssbi_controller_type controller_type;
··· 64 }; 65 66 struct ssbi { 67 void __iomem *base; 68 spinlock_t lock; 69 enum ssbi_controller_type controller_type;
-1
drivers/mfd/timberdale.c
··· 765 default: 766 dev_err(&dev->dev, "Unknown IP setup: %d.%d.%d\n", 767 priv->fw.major, priv->fw.minor, ip_setup); 768 - err = -ENODEV; 769 goto err_mfd; 770 } 771
··· 765 default: 766 dev_err(&dev->dev, "Unknown IP setup: %d.%d.%d\n", 767 priv->fw.major, priv->fw.minor, ip_setup); 768 goto err_mfd; 769 } 770
+229 -24
drivers/mfd/tps6594-core.c
··· 1 // SPDX-License-Identifier: GPL-2.0 2 /* 3 - * Core functions for TI TPS6594/TPS6593/LP8764 PMICs 4 * 5 * Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/ 6 */ ··· 278 TPS6594_REG_RTC_STATUS, 279 }; 280 281 static inline unsigned int tps6594_get_irq_reg(struct regmap_irq_chip_data *data, 282 unsigned int base, int index) 283 { 284 return tps6594_irq_reg[index]; 285 }; 286 287 static int tps6594_handle_post_irq(void *irq_drv_data) 288 { 289 struct tps6594 *tps = irq_drv_data; 290 int ret = 0; 291 292 /* 293 * When CRC is enabled, writing to a read-only bit triggers an error, ··· 442 * COMM_ADR_ERR_INT bit set. Clear immediately this bit to avoid raising 443 * a new interrupt. 444 */ 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); 449 450 return ret; 451 }; ··· 469 .handle_post_irq = tps6594_handle_post_irq, 470 }; 471 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); 478 479 static int tps6594_check_crc_mode(struct tps6594 *tps, bool primary_pmic) 480 { 481 int ret; 482 483 /* 484 * Check if CRC is enabled. 485 * Once CRC is enabled, it can't be disabled until next power cycle. 486 */ 487 tps->use_crc = true; 488 - ret = regmap_test_bits(tps->regmap, TPS6594_REG_SERIAL_IF_CONFIG, 489 - TPS6594_BIT_I2C1_SPI_CRC_EN); 490 if (ret == 0) { 491 ret = -EIO; 492 } else if (ret > 0) { ··· 535 static int tps6594_set_crc_feature(struct tps6594 *tps) 536 { 537 int ret; 538 539 ret = tps6594_check_crc_mode(tps, true); 540 if (ret) { ··· 552 * on primary PMIC. 553 */ 554 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)); 557 if (ret) 558 return ret; 559 ··· 608 { 609 struct device *dev = tps->dev; 610 int ret; 611 612 if (enable_crc) { 613 ret = tps6594_enable_crc(tps); ··· 624 if (ret) 625 return dev_err_probe(dev, ret, "Failed to set PMIC state\n"); 626 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); 630 631 - if (!tps6594_irq_chip.name) 632 return -ENOMEM; 633 634 ret = devm_regmap_add_irq_chip(dev, tps->regmap, tps->irq, IRQF_SHARED | IRQF_ONESHOT, 635 - 0, &tps6594_irq_chip, &tps->irq_data); 636 if (ret) 637 return dev_err_probe(dev, ret, "Failed to add regmap IRQ\n"); 638 639 - ret = devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO, tps6594_common_cells, 640 - ARRAY_SIZE(tps6594_common_cells), NULL, 0, 641 regmap_irq_get_domain(tps->irq_data)); 642 if (ret) 643 return dev_err_probe(dev, ret, "Failed to add common child devices\n"); 644 645 - /* No RTC for LP8764 */ 646 - if (tps->chip_id != LP8764) { 647 ret = devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO, tps6594_rtc_cells, 648 ARRAY_SIZE(tps6594_rtc_cells), NULL, 0, 649 regmap_irq_get_domain(tps->irq_data)); ··· 665 EXPORT_SYMBOL_GPL(tps6594_device_init); 666 667 MODULE_AUTHOR("Julien Panis <jpanis@baylibre.com>"); 668 MODULE_DESCRIPTION("TPS6594 Driver"); 669 MODULE_LICENSE("GPL");
··· 1 // SPDX-License-Identifier: GPL-2.0 2 /* 3 + * Core functions for TI TPS65224/TPS6594/TPS6593/LP8764 PMICs 4 * 5 * Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/ 6 */ ··· 278 TPS6594_REG_RTC_STATUS, 279 }; 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 + 417 static inline unsigned int tps6594_get_irq_reg(struct regmap_irq_chip_data *data, 418 unsigned int base, int index) 419 { 420 return tps6594_irq_reg[index]; 421 }; 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 + 429 static int tps6594_handle_post_irq(void *irq_drv_data) 430 { 431 struct tps6594 *tps = irq_drv_data; 432 int ret = 0; 433 + unsigned int regmap_reg, mask_val; 434 435 /* 436 * When CRC is enabled, writing to a read-only bit triggers an error, ··· 299 * COMM_ADR_ERR_INT bit set. Clear immediately this bit to avoid raising 300 * a new interrupt. 301 */ 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 + } 313 314 return ret; 315 }; ··· 319 .handle_post_irq = tps6594_handle_post_irq, 320 }; 321 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); 354 355 static int tps6594_check_crc_mode(struct tps6594 *tps, bool primary_pmic) 356 { 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 + }; 367 368 /* 369 * Check if CRC is enabled. 370 * Once CRC is enabled, it can't be disabled until next power cycle. 371 */ 372 tps->use_crc = true; 373 + ret = regmap_test_bits(tps->regmap, regmap_reg, mask_val); 374 if (ret == 0) { 375 ret = -EIO; 376 } else if (ret > 0) { ··· 351 static int tps6594_set_crc_feature(struct tps6594 *tps) 352 { 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 + } 363 364 ret = tps6594_check_crc_mode(tps, true); 365 if (ret) { ··· 359 * on primary PMIC. 360 */ 361 tps->use_crc = false; 362 + ret = regmap_write_bits(tps->regmap, regmap_reg, mask_val, mask_val); 363 if (ret) 364 return ret; 365 ··· 416 { 417 struct device *dev = tps->dev; 418 int ret; 419 + struct regmap_irq_chip *irq_chip; 420 + const struct mfd_cell *cells; 421 + int n_cells; 422 423 if (enable_crc) { 424 ret = tps6594_enable_crc(tps); ··· 429 if (ret) 430 return dev_err_probe(dev, ret, "Failed to set PMIC state\n"); 431 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 + } 441 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) 447 return -ENOMEM; 448 449 ret = devm_regmap_add_irq_chip(dev, tps->regmap, tps->irq, IRQF_SHARED | IRQF_ONESHOT, 450 + 0, irq_chip, &tps->irq_data); 451 if (ret) 452 return dev_err_probe(dev, ret, "Failed to add regmap IRQ\n"); 453 454 + ret = devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO, cells, n_cells, NULL, 0, 455 regmap_irq_get_domain(tps->irq_data)); 456 if (ret) 457 return dev_err_probe(dev, ret, "Failed to add common child devices\n"); 458 459 + /* No RTC for LP8764 and TPS65224 */ 460 + if (tps->chip_id != LP8764 && tps->chip_id != TPS65224) { 461 ret = devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO, tps6594_rtc_cells, 462 ARRAY_SIZE(tps6594_rtc_cells), NULL, 0, 463 regmap_irq_get_domain(tps->irq_data)); ··· 461 EXPORT_SYMBOL_GPL(tps6594_device_init); 462 463 MODULE_AUTHOR("Julien Panis <jpanis@baylibre.com>"); 464 + MODULE_AUTHOR("Bhargav Raviprakash <bhargav.r@ltts.com"); 465 MODULE_DESCRIPTION("TPS6594 Driver"); 466 MODULE_LICENSE("GPL");
+12 -8
drivers/mfd/tps6594-i2c.c
··· 1 // SPDX-License-Identifier: GPL-2.0 2 /* 3 - * I2C access driver for TI TPS6594/TPS6593/LP8764 PMICs 4 * 5 * Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/ 6 */ ··· 183 return ret; 184 } 185 186 - static const struct regmap_config tps6594_i2c_regmap_config = { 187 .reg_bits = 16, 188 .val_bits = 8, 189 .max_register = TPS6594_REG_DWD_FAIL_CNT_REG, 190 - .volatile_reg = tps6594_is_volatile_reg, 191 .read = tps6594_i2c_read, 192 .write = tps6594_i2c_write, 193 }; ··· 196 { .compatible = "ti,tps6594-q1", .data = (void *)TPS6594, }, 197 { .compatible = "ti,tps6593-q1", .data = (void *)TPS6593, }, 198 { .compatible = "ti,lp8764-q1", .data = (void *)LP8764, }, 199 {} 200 }; 201 MODULE_DEVICE_TABLE(of, tps6594_i2c_of_match_table); ··· 217 tps->reg = client->addr; 218 tps->irq = client->irq; 219 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 match = of_match_device(tps6594_i2c_of_match_table, dev); 225 if (!match) 226 return dev_err_probe(dev, -EINVAL, "Failed to find matching chip ID\n"); 227 tps->chip_id = (unsigned long)match->data; 228 229 crc8_populate_msb(tps6594_i2c_crc_table, TPS6594_CRC8_POLYNOMIAL); 230 ··· 244 module_i2c_driver(tps6594_i2c_driver); 245 246 MODULE_AUTHOR("Julien Panis <jpanis@baylibre.com>"); 247 - MODULE_DESCRIPTION("TPS6594 I2C Interface Driver"); 248 MODULE_LICENSE("GPL");
··· 1 // SPDX-License-Identifier: GPL-2.0 2 /* 3 + * I2C access driver for TI TPS65224/TPS6594/TPS6593/LP8764 PMICs 4 * 5 * Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/ 6 */ ··· 183 return ret; 184 } 185 186 + static struct regmap_config tps6594_i2c_regmap_config = { 187 .reg_bits = 16, 188 .val_bits = 8, 189 .max_register = TPS6594_REG_DWD_FAIL_CNT_REG, 190 + .volatile_table = &tps6594_volatile_table, 191 .read = tps6594_i2c_read, 192 .write = tps6594_i2c_write, 193 }; ··· 196 { .compatible = "ti,tps6594-q1", .data = (void *)TPS6594, }, 197 { .compatible = "ti,tps6593-q1", .data = (void *)TPS6593, }, 198 { .compatible = "ti,lp8764-q1", .data = (void *)LP8764, }, 199 + { .compatible = "ti,tps65224-q1", .data = (void *)TPS65224, }, 200 {} 201 }; 202 MODULE_DEVICE_TABLE(of, tps6594_i2c_of_match_table); ··· 216 tps->reg = client->addr; 217 tps->irq = client->irq; 218 219 match = of_match_device(tps6594_i2c_of_match_table, dev); 220 if (!match) 221 return dev_err_probe(dev, -EINVAL, "Failed to find matching chip ID\n"); 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"); 230 231 crc8_populate_msb(tps6594_i2c_crc_table, TPS6594_CRC8_POLYNOMIAL); 232 ··· 240 module_i2c_driver(tps6594_i2c_driver); 241 242 MODULE_AUTHOR("Julien Panis <jpanis@baylibre.com>"); 243 + MODULE_DESCRIPTION("I2C Interface Driver for TPS65224, TPS6594/3, and LP8764"); 244 MODULE_LICENSE("GPL");
+12 -8
drivers/mfd/tps6594-spi.c
··· 1 // SPDX-License-Identifier: GPL-2.0 2 /* 3 - * SPI access driver for TI TPS6594/TPS6593/LP8764 PMICs 4 * 5 * Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/ 6 */ ··· 66 return spi_write(spi, buf, count); 67 } 68 69 - static const struct regmap_config tps6594_spi_regmap_config = { 70 .reg_bits = 16, 71 .val_bits = 8, 72 .max_register = TPS6594_REG_DWD_FAIL_CNT_REG, 73 - .volatile_reg = tps6594_is_volatile_reg, 74 .reg_read = tps6594_spi_reg_read, 75 .reg_write = tps6594_spi_reg_write, 76 .use_single_read = true, ··· 81 { .compatible = "ti,tps6594-q1", .data = (void *)TPS6594, }, 82 { .compatible = "ti,tps6593-q1", .data = (void *)TPS6593, }, 83 { .compatible = "ti,lp8764-q1", .data = (void *)LP8764, }, 84 {} 85 }; 86 MODULE_DEVICE_TABLE(of, tps6594_spi_of_match_table); ··· 102 tps->reg = spi_get_chipselect(spi, 0); 103 tps->irq = spi->irq; 104 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 match = of_match_device(tps6594_spi_of_match_table, dev); 110 if (!match) 111 return dev_err_probe(dev, -EINVAL, "Failed to find matching chip ID\n"); 112 tps->chip_id = (unsigned long)match->data; 113 114 crc8_populate_msb(tps6594_spi_crc_table, TPS6594_CRC8_POLYNOMIAL); 115 ··· 129 module_spi_driver(tps6594_spi_driver); 130 131 MODULE_AUTHOR("Julien Panis <jpanis@baylibre.com>"); 132 - MODULE_DESCRIPTION("TPS6594 SPI Interface Driver"); 133 MODULE_LICENSE("GPL");
··· 1 // SPDX-License-Identifier: GPL-2.0 2 /* 3 + * SPI access driver for TI TPS65224/TPS6594/TPS6593/LP8764 PMICs 4 * 5 * Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/ 6 */ ··· 66 return spi_write(spi, buf, count); 67 } 68 69 + static struct regmap_config tps6594_spi_regmap_config = { 70 .reg_bits = 16, 71 .val_bits = 8, 72 .max_register = TPS6594_REG_DWD_FAIL_CNT_REG, 73 + .volatile_table = &tps6594_volatile_table, 74 .reg_read = tps6594_spi_reg_read, 75 .reg_write = tps6594_spi_reg_write, 76 .use_single_read = true, ··· 81 { .compatible = "ti,tps6594-q1", .data = (void *)TPS6594, }, 82 { .compatible = "ti,tps6593-q1", .data = (void *)TPS6593, }, 83 { .compatible = "ti,lp8764-q1", .data = (void *)LP8764, }, 84 + { .compatible = "ti,tps65224-q1", .data = (void *)TPS65224, }, 85 {} 86 }; 87 MODULE_DEVICE_TABLE(of, tps6594_spi_of_match_table); ··· 101 tps->reg = spi_get_chipselect(spi, 0); 102 tps->irq = spi->irq; 103 104 match = of_match_device(tps6594_spi_of_match_table, dev); 105 if (!match) 106 return dev_err_probe(dev, -EINVAL, "Failed to find matching chip ID\n"); 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"); 115 116 crc8_populate_msb(tps6594_spi_crc_table, TPS6594_CRC8_POLYNOMIAL); 117 ··· 125 module_spi_driver(tps6594_spi_driver); 126 127 MODULE_AUTHOR("Julien Panis <jpanis@baylibre.com>"); 128 + MODULE_DESCRIPTION("SPI Interface Driver for TPS65224, TPS6594/3, and LP8764"); 129 MODULE_LICENSE("GPL");
+35 -13
drivers/misc/tps6594-pfsm.c
··· 1 // SPDX-License-Identifier: GPL-2.0 2 /* 3 - * PFSM (Pre-configurable Finite State Machine) driver for TI TPS6594/TPS6593/LP8764 PMICs 4 * 5 * Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/ 6 */ ··· 39 * 40 * @miscdev: misc device infos 41 * @regmap: regmap for accessing the device registers 42 */ 43 struct tps6594_pfsm { 44 struct miscdevice miscdev; 45 struct regmap *regmap; 46 }; 47 48 static ssize_t tps6594_pfsm_read(struct file *f, char __user *buf, ··· 135 struct tps6594_pfsm *pfsm = TPS6594_FILE_TO_PFSM(f); 136 struct pmic_state_opt state_opt; 137 void __user *argp = (void __user *)arg; 138 int ret = -ENOIOCTLCMD; 139 140 switch (cmd) { 141 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; 147 148 /* Force trigger */ 149 ret = regmap_write_bits(pfsm->regmap, TPS6594_REG_FSM_I2C_TRIGGERS, 150 TPS6594_BIT_TRIGGER_I2C(0), TPS6594_BIT_TRIGGER_I2C(0)); 151 break; 152 case PMIC_GOTO_LP_STANDBY: 153 /* Enable LP mode */ 154 ret = regmap_set_bits(pfsm->regmap, TPS6594_REG_RTC_CTRL_2, 155 TPS6594_BIT_LP_STANDBY_SEL); ··· 179 TPS6594_BIT_NSLEEP1B | TPS6594_BIT_NSLEEP2B); 180 break; 181 case PMIC_SET_MCU_ONLY_STATE: 182 if (copy_from_user(&state_opt, argp, sizeof(state_opt))) 183 return -EFAULT; 184 ··· 206 return -EFAULT; 207 208 /* Configure wake-up destination */ 209 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); 213 else 214 - ret = regmap_write_bits(pfsm->regmap, TPS6594_REG_RTC_CTRL_2, 215 - TPS6594_MASK_STARTUP_DEST, 216 - TPS6594_STARTUP_DEST_ACTIVE); 217 if (ret) 218 return ret; 219 ··· 231 232 /* Modify NSLEEP1-2 bits */ 233 ret = regmap_clear_bits(pfsm->regmap, TPS6594_REG_FSM_NSLEEP_TRIGGERS, 234 - TPS6594_BIT_NSLEEP2B); 235 break; 236 } 237 ··· 283 tps->chip_id, tps->reg); 284 pfsm->miscdev.fops = &tps6594_pfsm_fops; 285 pfsm->miscdev.parent = dev->parent; 286 287 for (i = 0 ; i < pdev->num_resources ; i++) { 288 irq = platform_get_irq_byname(pdev, pdev->resource[i].name);
··· 1 // SPDX-License-Identifier: GPL-2.0 2 /* 3 + * PFSM (Pre-configurable Finite State Machine) driver for TI TPS65224/TPS6594/TPS6593/LP8764 PMICs 4 * 5 * Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/ 6 */ ··· 39 * 40 * @miscdev: misc device infos 41 * @regmap: regmap for accessing the device registers 42 + * @chip_id: chip identifier of the device 43 */ 44 struct tps6594_pfsm { 45 struct miscdevice miscdev; 46 struct regmap *regmap; 47 + unsigned long chip_id; 48 }; 49 50 static ssize_t tps6594_pfsm_read(struct file *f, char __user *buf, ··· 133 struct tps6594_pfsm *pfsm = TPS6594_FILE_TO_PFSM(f); 134 struct pmic_state_opt state_opt; 135 void __user *argp = (void __user *)arg; 136 + unsigned int regmap_reg, mask; 137 int ret = -ENOIOCTLCMD; 138 139 switch (cmd) { 140 case PMIC_GOTO_STANDBY: 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 + } 149 150 /* Force trigger */ 151 ret = regmap_write_bits(pfsm->regmap, TPS6594_REG_FSM_I2C_TRIGGERS, 152 TPS6594_BIT_TRIGGER_I2C(0), TPS6594_BIT_TRIGGER_I2C(0)); 153 break; 154 case PMIC_GOTO_LP_STANDBY: 155 + /* TPS65224 does not support LP STANDBY */ 156 + if (pfsm->chip_id == TPS65224) 157 + return ret; 158 + 159 /* Enable LP mode */ 160 ret = regmap_set_bits(pfsm->regmap, TPS6594_REG_RTC_CTRL_2, 161 TPS6594_BIT_LP_STANDBY_SEL); ··· 169 TPS6594_BIT_NSLEEP1B | TPS6594_BIT_NSLEEP2B); 170 break; 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 + 176 if (copy_from_user(&state_opt, argp, sizeof(state_opt))) 177 return -EFAULT; 178 ··· 192 return -EFAULT; 193 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 + 203 if (state_opt.mcu_only_startup_dest) 204 + ret = regmap_write_bits(pfsm->regmap, regmap_reg, 205 + mask, TPS6594_STARTUP_DEST_MCU_ONLY); 206 else 207 + ret = regmap_write_bits(pfsm->regmap, regmap_reg, 208 + mask, TPS6594_STARTUP_DEST_ACTIVE); 209 if (ret) 210 return ret; 211 ··· 211 212 /* Modify NSLEEP1-2 bits */ 213 ret = regmap_clear_bits(pfsm->regmap, TPS6594_REG_FSM_NSLEEP_TRIGGERS, 214 + pfsm->chip_id == TPS65224 ? 215 + TPS6594_BIT_NSLEEP1B : TPS6594_BIT_NSLEEP2B); 216 break; 217 } 218 ··· 262 tps->chip_id, tps->reg); 263 pfsm->miscdev.fops = &tps6594_pfsm_fops; 264 pfsm->miscdev.parent = dev->parent; 265 + pfsm->chip_id = tps->chip_id; 266 267 for (i = 0 ; i < pdev->num_resources ; i++) { 268 irq = platform_get_irq_byname(pdev, pdev->resource[i].name);
+69
drivers/pinctrl/pinctrl-rk805.c
··· 93 RK806_PINMUX_FUN5, 94 }; 95 96 enum { 97 RK805_GPIO0, 98 RK805_GPIO1, ··· 107 RK806_GPIO_DVS1, 108 RK806_GPIO_DVS2, 109 RK806_GPIO_DVS3 110 }; 111 112 static const char *const rk805_gpio_groups[] = { ··· 124 "gpio_pwrctrl3", 125 }; 126 127 /* RK805: 2 output only GPIOs */ 128 static const struct pinctrl_pin_desc rk805_pins_desc[] = { 129 PINCTRL_PIN(RK805_GPIO0, "gpio0"), ··· 139 PINCTRL_PIN(RK806_GPIO_DVS1, "gpio_pwrctrl1"), 140 PINCTRL_PIN(RK806_GPIO_DVS2, "gpio_pwrctrl2"), 141 PINCTRL_PIN(RK806_GPIO_DVS3, "gpio_pwrctrl3"), 142 }; 143 144 static const struct rk805_pin_function rk805_pin_functions[] = { ··· 194 }, 195 }; 196 197 static const struct rk805_pin_group rk805_pin_groups[] = { 198 { 199 .name = "gpio0", ··· 238 .pins = { RK806_GPIO_DVS3 }, 239 .npins = 1, 240 } 241 }; 242 243 #define RK805_GPIO0_VAL_MSK BIT(0) ··· 294 .val_msk = RK806_PWRCTRL3_DATA, 295 .dir_msk = RK806_PWRCTRL3_DR, 296 } 297 }; 298 299 /* generic gpio chip */ ··· 494 return _rk805_pinctrl_set_mux(pctldev, offset, RK805_PINMUX_GPIO); 495 case RK806_ID: 496 return _rk805_pinctrl_set_mux(pctldev, offset, RK806_PINMUX_FUN5); 497 } 498 499 return -ENOTSUPP; ··· 644 pci->pinctrl_desc.npins = ARRAY_SIZE(rk806_pins_desc); 645 pci->pin_cfg = rk806_gpio_cfgs; 646 pci->gpio_chip.ngpio = ARRAY_SIZE(rk806_gpio_cfgs); 647 break; 648 default: 649 dev_err(&pdev->dev, "unsupported RK805 ID %lu\n",
··· 93 RK806_PINMUX_FUN5, 94 }; 95 96 + enum rk816_pinmux_option { 97 + RK816_PINMUX_THERMISTOR, 98 + RK816_PINMUX_GPIO, 99 + }; 100 + 101 enum { 102 RK805_GPIO0, 103 RK805_GPIO1, ··· 102 RK806_GPIO_DVS1, 103 RK806_GPIO_DVS2, 104 RK806_GPIO_DVS3 105 + }; 106 + 107 + enum { 108 + RK816_GPIO0, 109 }; 110 111 static const char *const rk805_gpio_groups[] = { ··· 115 "gpio_pwrctrl3", 116 }; 117 118 + static const char *const rk816_gpio_groups[] = { 119 + "gpio0", 120 + }; 121 + 122 /* RK805: 2 output only GPIOs */ 123 static const struct pinctrl_pin_desc rk805_pins_desc[] = { 124 PINCTRL_PIN(RK805_GPIO0, "gpio0"), ··· 126 PINCTRL_PIN(RK806_GPIO_DVS1, "gpio_pwrctrl1"), 127 PINCTRL_PIN(RK806_GPIO_DVS2, "gpio_pwrctrl2"), 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"), 134 }; 135 136 static const struct rk805_pin_function rk805_pin_functions[] = { ··· 176 }, 177 }; 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 + 194 static const struct rk805_pin_group rk805_pin_groups[] = { 195 { 196 .name = "gpio0", ··· 205 .pins = { RK806_GPIO_DVS3 }, 206 .npins = 1, 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 + }, 216 }; 217 218 #define RK805_GPIO0_VAL_MSK BIT(0) ··· 253 .val_msk = RK806_PWRCTRL3_DATA, 254 .dir_msk = RK806_PWRCTRL3_DR, 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 + }, 270 }; 271 272 /* generic gpio chip */ ··· 439 return _rk805_pinctrl_set_mux(pctldev, offset, RK805_PINMUX_GPIO); 440 case RK806_ID: 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); 444 } 445 446 return -ENOTSUPP; ··· 587 pci->pinctrl_desc.npins = ARRAY_SIZE(rk806_pins_desc); 588 pci->pin_cfg = rk806_gpio_cfgs; 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); 602 break; 603 default: 604 dev_err(&pdev->dev, "unsupported RK805 ID %lu\n",
+224 -51
drivers/pinctrl/pinctrl-tps6594.c
··· 14 15 #include <linux/mfd/tps6594.h> 16 17 - #define TPS6594_PINCTRL_PINS_NB 11 18 - 19 #define TPS6594_PINCTRL_GPIO_FUNCTION 0 20 #define TPS6594_PINCTRL_SCL_I2C2_CS_SPI_FUNCTION 1 21 #define TPS6594_PINCTRL_TRIG_WDOG_FUNCTION 1 ··· 38 #define TPS6594_PINCTRL_SYNCCLKOUT_FUNCTION_GPIO8 3 39 #define TPS6594_PINCTRL_CLK32KOUT_FUNCTION_GPIO9 3 40 41 #define TPS6594_OFFSET_GPIO_SEL 5 42 43 - #define FUNCTION(fname, v) \ 44 { \ 45 .pinfunction = PINCTRL_PINFUNCTION(#fname, \ 46 - tps6594_##fname##_func_group_names, \ 47 - ARRAY_SIZE(tps6594_##fname##_func_group_names)),\ 48 .muxval = v, \ 49 } 50 51 - static const struct pinctrl_pin_desc tps6594_pins[TPS6594_PINCTRL_PINS_NB] = { 52 PINCTRL_PIN(0, "GPIO0"), PINCTRL_PIN(1, "GPIO1"), 53 PINCTRL_PIN(2, "GPIO2"), PINCTRL_PIN(3, "GPIO3"), 54 PINCTRL_PIN(4, "GPIO4"), PINCTRL_PIN(5, "GPIO5"), ··· 164 "GPIO9", 165 }; 166 167 struct tps6594_pinctrl_function { 168 struct pinfunction pinfunction; 169 u8 muxval; 170 }; 171 172 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), 191 }; 192 193 struct tps6594_pinctrl { ··· 293 struct pinctrl_dev *pctl_dev; 294 const struct tps6594_pinctrl_function *funcs; 295 const struct pinctrl_pin_desc *pins; 296 }; 297 298 static int tps6594_gpio_regmap_xlate(struct gpio_regmap *gpio, ··· 344 345 static int tps6594_pmx_func_cnt(struct pinctrl_dev *pctldev) 346 { 347 - return ARRAY_SIZE(pinctrl_functions); 348 } 349 350 static const char *tps6594_pmx_func_name(struct pinctrl_dev *pctldev, ··· 374 u8 muxval) 375 { 376 u8 mux_sel_val = muxval << TPS6594_OFFSET_GPIO_SEL; 377 378 return regmap_update_bits(pinctrl->tps->regmap, 379 TPS6594_REG_GPIOX_CONF(pin), 380 - TPS6594_MASK_GPIO_SEL, mux_sel_val); 381 } 382 383 static int tps6594_pmx_set_mux(struct pinctrl_dev *pctldev, ··· 391 { 392 struct tps6594_pinctrl *pinctrl = pinctrl_dev_get_drvdata(pctldev); 393 u8 muxval = pinctrl->funcs[function].muxval; 394 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; 404 } 405 406 return tps6594_pmx_set(pinctrl, group, muxval); ··· 425 426 static int tps6594_groups_cnt(struct pinctrl_dev *pctldev) 427 { 428 - return ARRAY_SIZE(tps6594_pins); 429 } 430 431 static int tps6594_group_pins(struct pinctrl_dev *pctldev, ··· 469 pctrl_desc = devm_kzalloc(dev, sizeof(*pctrl_desc), GFP_KERNEL); 470 if (!pctrl_desc) 471 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 479 pinctrl = devm_kzalloc(dev, sizeof(*pinctrl), GFP_KERNEL); 480 if (!pinctrl) 481 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"); 489 490 config.parent = tps->dev; 491 config.regmap = tps->regmap; 492 - config.ngpio = TPS6594_PINCTRL_PINS_NB; 493 - config.ngpio_per_reg = 8; 494 config.reg_dat_base = TPS6594_REG_GPIO_IN_1; 495 config.reg_set_base = TPS6594_REG_GPIO_OUT_1; 496 config.reg_dir_out_base = TPS6594_REG_GPIOX_CONF(0); 497 config.reg_mask_xlate = tps6594_gpio_regmap_xlate; 498 499 pinctrl->gpio_regmap = devm_gpio_regmap_register(dev, &config); 500 if (IS_ERR(pinctrl->gpio_regmap)) ··· 541 module_platform_driver(tps6594_pinctrl_driver); 542 543 MODULE_AUTHOR("Esteban Blanc <eblanc@baylibre.com>"); 544 MODULE_DESCRIPTION("TPS6594 pinctrl and GPIO driver"); 545 MODULE_LICENSE("GPL");
··· 14 15 #include <linux/mfd/tps6594.h> 16 17 #define TPS6594_PINCTRL_GPIO_FUNCTION 0 18 #define TPS6594_PINCTRL_SCL_I2C2_CS_SPI_FUNCTION 1 19 #define TPS6594_PINCTRL_TRIG_WDOG_FUNCTION 1 ··· 40 #define TPS6594_PINCTRL_SYNCCLKOUT_FUNCTION_GPIO8 3 41 #define TPS6594_PINCTRL_CLK32KOUT_FUNCTION_GPIO9 3 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 + 63 #define TPS6594_OFFSET_GPIO_SEL 5 64 65 + #define TPS65224_NGPIO_PER_REG 6 66 + #define TPS6594_NGPIO_PER_REG 8 67 + 68 + #define FUNCTION(dev_name, fname, v) \ 69 { \ 70 .pinfunction = PINCTRL_PINFUNCTION(#fname, \ 71 + dev_name##_##fname##_func_group_names, \ 72 + ARRAY_SIZE(dev_name##_##fname##_func_group_names)),\ 73 .muxval = v, \ 74 } 75 76 + static const struct pinctrl_pin_desc tps6594_pins[] = { 77 PINCTRL_PIN(0, "GPIO0"), PINCTRL_PIN(1, "GPIO1"), 78 PINCTRL_PIN(2, "GPIO2"), PINCTRL_PIN(3, "GPIO3"), 79 PINCTRL_PIN(4, "GPIO4"), PINCTRL_PIN(5, "GPIO5"), ··· 143 "GPIO9", 144 }; 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 + 208 struct tps6594_pinctrl_function { 209 struct pinfunction pinfunction; 210 u8 muxval; 211 }; 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 + 231 static const struct tps6594_pinctrl_function pinctrl_functions[] = { 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), 267 }; 268 269 struct tps6594_pinctrl { ··· 175 struct pinctrl_dev *pctl_dev; 176 const struct tps6594_pinctrl_function *funcs; 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), 203 }; 204 205 static int tps6594_gpio_regmap_xlate(struct gpio_regmap *gpio, ··· 201 202 static int tps6594_pmx_func_cnt(struct pinctrl_dev *pctldev) 203 { 204 + struct tps6594_pinctrl *pinctrl = pinctrl_dev_get_drvdata(pctldev); 205 + 206 + return pinctrl->func_cnt; 207 } 208 209 static const char *tps6594_pmx_func_name(struct pinctrl_dev *pctldev, ··· 229 u8 muxval) 230 { 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 + } 238 239 return regmap_update_bits(pinctrl->tps->regmap, 240 TPS6594_REG_GPIOX_CONF(pin), 241 + mux_sel_mask, mux_sel_val); 242 } 243 244 static int tps6594_pmx_set_mux(struct pinctrl_dev *pctldev, ··· 240 { 241 struct tps6594_pinctrl *pinctrl = pinctrl_dev_get_drvdata(pctldev); 242 u8 muxval = pinctrl->funcs[function].muxval; 243 + unsigned int remap_cnt = pinctrl->remap_cnt; 244 + struct muxval_remap *remap = pinctrl->remap; 245 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 + } 251 } 252 253 return tps6594_pmx_set(pinctrl, group, muxval); ··· 276 277 static int tps6594_groups_cnt(struct pinctrl_dev *pctldev) 278 { 279 + struct tps6594_pinctrl *pinctrl = pinctrl_dev_get_drvdata(pctldev); 280 + 281 + return pinctrl->num_pins; 282 } 283 284 static int tps6594_group_pins(struct pinctrl_dev *pctldev, ··· 318 pctrl_desc = devm_kzalloc(dev, sizeof(*pctrl_desc), GFP_KERNEL); 319 if (!pctrl_desc) 320 return -ENOMEM; 321 322 pinctrl = devm_kzalloc(dev, sizeof(*pinctrl), GFP_KERNEL); 323 if (!pinctrl) 324 return -ENOMEM; 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; 356 357 config.parent = tps->dev; 358 config.regmap = tps->regmap; 359 config.reg_dat_base = TPS6594_REG_GPIO_IN_1; 360 config.reg_set_base = TPS6594_REG_GPIO_OUT_1; 361 config.reg_dir_out_base = TPS6594_REG_GPIOX_CONF(0); 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"); 368 369 pinctrl->gpio_regmap = devm_gpio_regmap_register(dev, &config); 370 if (IS_ERR(pinctrl->gpio_regmap)) ··· 369 module_platform_driver(tps6594_pinctrl_driver); 370 371 MODULE_AUTHOR("Esteban Blanc <eblanc@baylibre.com>"); 372 + MODULE_AUTHOR("Nirmala Devi Mal Nadar <m.nirmaladevi@ltts.com>"); 373 MODULE_DESCRIPTION("TPS6594 pinctrl and GPIO driver"); 374 MODULE_LICENSE("GPL");
+3 -1
drivers/regulator/Kconfig
··· 1571 depends on MFD_TPS6594 && OF 1572 default MFD_TPS6594 1573 help 1574 - This driver supports TPS6594 voltage regulator chips. 1575 TPS6594 series of PMICs have 5 BUCKs and 4 LDOs 1576 voltage regulators. 1577 BUCKs 1,2,3,4 can be used in single phase or multiphase mode. 1578 Part number defines which single or multiphase mode is i used. 1579 It supports software based voltage control 1580 for different voltage domains. 1581 1582 config REGULATOR_TPS6524X 1583 tristate "TI TPS6524X Power regulators"
··· 1571 depends on MFD_TPS6594 && OF 1572 default MFD_TPS6594 1573 help 1574 + This driver supports TPS6594 series and TPS65224 voltage regulator chips. 1575 TPS6594 series of PMICs have 5 BUCKs and 4 LDOs 1576 voltage regulators. 1577 BUCKs 1,2,3,4 can be used in single phase or multiphase mode. 1578 Part number defines which single or multiphase mode is i used. 1579 It supports software based voltage control 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. 1583 1584 config REGULATOR_TPS6524X 1585 tristate "TI TPS6524X Power regulators"
+214 -4
drivers/regulator/rk808-regulator.c
··· 158 RK8XX_DESC_COM(_id, _match, _supply, _min, _max, _step, _vreg, \ 159 _vmask, _ereg, _emask, 0, 0, _etime, &rk808_reg_ops) 160 161 #define RK817_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, \ ··· 263 2000, 4000, 6000, 10000 264 }; 265 266 - /* RK817 RK809 */ 267 static const unsigned int rk817_buck1_4_ramp_table[] = { 268 3000, 6300, 12500, 25000 269 }; ··· 539 { 540 unsigned int reg; 541 int sel = regulator_map_voltage_linear_range(rdev, uv, uv); 542 543 if (sel < 0) 544 return -EINVAL; 545 546 reg = rdev->desc->vsel_reg + RK808_SLP_REG_OFFSET; 547 548 - return regmap_update_bits(rdev->regmap, reg, 549 - rdev->desc->vsel_mask, 550 - sel); 551 } 552 553 static int rk805_set_suspend_enable(struct regulator_dev *rdev) ··· 643 return regmap_update_bits(rdev->regmap, reg, 644 rdev->desc->enable_mask, 645 rdev->desc->enable_mask); 646 } 647 648 static int rk817_set_suspend_enable_ctrl(struct regulator_dev *rdev, ··· 948 .set_suspend_voltage = rk808_set_suspend_voltage_range, 949 .set_suspend_enable = rk817_set_suspend_enable, 950 .set_suspend_disable = rk817_set_suspend_disable, 951 }; 952 953 static const struct regulator_ops rk817_reg_ops = { ··· 1477 DISABLE_VAL(3)), 1478 }; 1479 1480 static const struct regulator_desc rk817_reg[] = { 1481 { 1482 .name = "DCDC_REG1", ··· 1909 case RK809_ID: 1910 regulators = rk809_reg; 1911 nregulators = RK809_NUM_REGULATORS; 1912 break; 1913 case RK817_ID: 1914 regulators = rk817_reg;
··· 158 RK8XX_DESC_COM(_id, _match, _supply, _min, _max, _step, _vreg, \ 159 _vmask, _ereg, _emask, 0, 0, _etime, &rk808_reg_ops) 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 + 166 #define RK817_DESC(_id, _match, _supply, _min, _max, _step, _vreg, \ 167 _vmask, _ereg, _emask, _disval, _etime) \ 168 RK8XX_DESC_COM(_id, _match, _supply, _min, _max, _step, _vreg, \ ··· 258 2000, 4000, 6000, 10000 259 }; 260 261 + /* RK817/RK809/RK816 (buck 1/2 only) */ 262 static const unsigned int rk817_buck1_4_ramp_table[] = { 263 3000, 6300, 12500, 25000 264 }; ··· 534 { 535 unsigned int reg; 536 int sel = regulator_map_voltage_linear_range(rdev, uv, uv); 537 + int ret; 538 539 if (sel < 0) 540 return -EINVAL; 541 542 reg = rdev->desc->vsel_reg + RK808_SLP_REG_OFFSET; 543 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; 556 } 557 558 static int rk805_set_suspend_enable(struct regulator_dev *rdev) ··· 628 return regmap_update_bits(rdev->regmap, reg, 629 rdev->desc->enable_mask, 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); 663 } 664 665 static int rk817_set_suspend_enable_ctrl(struct regulator_dev *rdev, ··· 901 .set_suspend_voltage = rk808_set_suspend_voltage_range, 902 .set_suspend_enable = rk817_set_suspend_enable, 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, 952 }; 953 954 static const struct regulator_ops rk817_reg_ops = { ··· 1382 DISABLE_VAL(3)), 1383 }; 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 + 1496 static const struct regulator_desc rk817_reg[] = { 1497 { 1498 .name = "DCDC_REG1", ··· 1703 case RK809_ID: 1704 regulators = rk809_reg; 1705 nregulators = RK809_NUM_REGULATORS; 1706 + break; 1707 + case RK816_ID: 1708 + regulators = rk816_reg; 1709 + nregulators = ARRAY_SIZE(rk816_reg); 1710 break; 1711 case RK817_ID: 1712 regulators = rk817_reg;
+268 -72
drivers/regulator/tps6594-regulator.c
··· 18 19 #include <linux/mfd/tps6594.h> 20 21 - #define BUCK_NB 5 22 - #define LDO_NB 4 23 - #define MULTI_PHASE_NB 4 24 - #define REGS_INT_NB 4 25 26 enum tps6594_regulator_id { 27 /* DCDC's */ ··· 67 { TPS6594_IRQ_NAME_VMON2_UV, "VMON2", "undervoltage", REGULATOR_EVENT_UNDER_VOLTAGE }, 68 { TPS6594_IRQ_NAME_VMON2_RV, "VMON2", "residual voltage", 69 REGULATOR_EVENT_OVER_VOLTAGE_WARN }, 70 }; 71 72 struct tps6594_regulator_irq_data { ··· 132 133 static const struct linear_range ldos_4_ranges[] = { 134 REGULATOR_LINEAR_RANGE(1200000, 0x20, 0x74, 25000), 135 }; 136 137 /* Operations permitted on BUCK1/2/3/4/5 */ ··· 230 4, 0, 0, NULL, 0, 0), 231 }; 232 233 static struct tps6594_regulator_irq_type tps6594_buck1_irq_types[] = { 234 { TPS6594_IRQ_NAME_BUCK1_OV, "BUCK1", "overvoltage", REGULATOR_EVENT_OVER_VOLTAGE_WARN }, 235 { TPS6594_IRQ_NAME_BUCK1_UV, "BUCK1", "undervoltage", REGULATOR_EVENT_UNDER_VOLTAGE }, ··· 334 REGULATOR_EVENT_OVER_CURRENT }, 335 }; 336 337 static struct tps6594_regulator_irq_type *tps6594_bucks_irq_types[] = { 338 tps6594_buck1_irq_types, 339 tps6594_buck2_irq_types, ··· 384 tps6594_ldo4_irq_types, 385 }; 386 387 - static const struct regulator_desc multi_regs[] = { 388 TPS6594_REGULATOR("BUCK12", "buck12", TPS6594_BUCK_1, 389 REGULATOR_VOLTAGE, tps6594_bucks_ops, TPS6594_MASK_BUCKS_VSET, 390 TPS6594_REG_BUCKX_VOUT_1(1), ··· 428 4, 4000, 0, NULL, 0, 0), 429 }; 430 431 - static const struct regulator_desc ldo_regs[] = { 432 TPS6594_REGULATOR("LDO1", "ldo1", TPS6594_LDO_1, 433 REGULATOR_VOLTAGE, tps6594_ldos_1_2_3_ops, TPS6594_MASK_LDO123_VSET, 434 TPS6594_REG_LDOX_VOUT(0), ··· 469 1, 0, 0, NULL, 0, 0), 470 }; 471 472 static irqreturn_t tps6594_regulator_irq_handler(int irq, void *data) 473 { 474 struct tps6594_regulator_irq_data *irq_data = data; ··· 516 static int tps6594_request_reg_irqs(struct platform_device *pdev, 517 struct regulator_dev *rdev, 518 struct tps6594_regulator_irq_data *irq_data, 519 - struct tps6594_regulator_irq_type *tps6594_regs_irq_types, 520 int *irq_idx) 521 { 522 struct tps6594_regulator_irq_type *irq_type; 523 struct tps6594 *tps = dev_get_drvdata(pdev->dev.parent); 524 - int j; 525 int irq; 526 int error; 527 528 - for (j = 0; j < REGS_INT_NB; j++) { 529 - irq_type = &tps6594_regs_irq_types[j]; 530 irq = platform_get_irq_byname(pdev, irq_type->irq_name); 531 if (irq < 0) 532 return -EINVAL; ··· 559 struct tps6594_regulator_irq_data *irq_data; 560 struct tps6594_ext_regulator_irq_data *irq_ext_reg_data; 561 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"}; 565 static const char *npname; 566 - int error, i, irq, multi, delta; 567 int irq_idx = 0; 568 int buck_idx = 0; 569 - size_t ext_reg_irq_nb = 2; 570 size_t reg_irq_nb; 571 enum { 572 MULTI_BUCK12, 573 MULTI_BUCK123, 574 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 }; 580 581 config.dev = tps->dev; ··· 614 * In case of Multiphase configuration, value should be defined for 615 * buck_configured to avoid creating bucks for every buck in multiphase 616 */ 617 - for (multi = MULTI_FIRST; multi < MULTI_NUM; multi++) { 618 - np = of_find_node_by_name(tps->dev->of_node, multiphases[multi]); 619 npname = of_node_full_name(np); 620 np_pmic_parent = of_get_parent(of_get_parent(np)); 621 if (of_node_cmp(of_node_full_name(np_pmic_parent), tps->dev->of_node->full_name)) 622 continue; 623 - delta = strcmp(npname, multiphases[multi]); 624 - if (!delta) { 625 switch (multi) { 626 case MULTI_BUCK12: 627 - buck_multi[0] = 1; 628 - buck_configured[0] = 1; 629 - buck_configured[1] = 1; 630 break; 631 /* multiphase buck34 is supported only with buck12 */ 632 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; 639 break; 640 case MULTI_BUCK123: 641 - buck_multi[2] = 1; 642 - buck_configured[0] = 1; 643 - buck_configured[1] = 1; 644 - buck_configured[2] = 1; 645 break; 646 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; 652 break; 653 } 654 } 655 } 656 657 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)); 661 } else { 662 - reg_irq_nb = size_mul(REGS_INT_NB, (size_add(BUCK_NB, LDO_NB))); 663 } 664 665 irq_data = devm_kmalloc_array(tps->dev, reg_irq_nb, 666 sizeof(struct tps6594_regulator_irq_data), GFP_KERNEL); 667 if (!irq_data) 668 return -ENOMEM; 669 670 - for (i = 0; i < MULTI_PHASE_NB; i++) { 671 - if (buck_multi[i] == 0) 672 continue; 673 674 rdev = devm_regulator_register(&pdev->dev, &multi_regs[i], &config); ··· 685 pdev->name); 686 687 /* config multiphase buck12+buck34 */ 688 - if (i == 1) 689 buck_idx = 2; 690 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); 696 if (error) 697 return error; 698 699 - if (i == 2 || i == 3) { 700 error = tps6594_request_reg_irqs(pdev, rdev, irq_data, 701 tps6594_bucks_irq_types[buck_idx + 2], 702 &irq_idx); 703 if (error) 704 return error; 705 } 706 - if (i == 3) { 707 error = tps6594_request_reg_irqs(pdev, rdev, irq_data, 708 tps6594_bucks_irq_types[buck_idx + 3], 709 &irq_idx); 710 if (error) 711 return error; 712 } 713 } 714 715 - for (i = 0; i < BUCK_NB; i++) { 716 - if (buck_configured[i] == 1) 717 continue; 718 719 - rdev = devm_regulator_register(&pdev->dev, &buck_regs[i], &config); 720 if (IS_ERR(rdev)) 721 return dev_err_probe(tps->dev, PTR_ERR(rdev), 722 - "failed to register %s regulator\n", 723 - pdev->name); 724 725 error = tps6594_request_reg_irqs(pdev, rdev, irq_data, 726 - tps6594_bucks_irq_types[i], &irq_idx); 727 if (error) 728 return error; 729 } 730 731 - /* LP8764 dosen't have LDO */ 732 if (tps->chip_id != LP8764) { 733 - for (i = 0; i < ARRAY_SIZE(ldo_regs); i++) { 734 rdev = devm_regulator_register(&pdev->dev, &ldo_regs[i], &config); 735 if (IS_ERR(rdev)) 736 return dev_err_probe(tps->dev, PTR_ERR(rdev), ··· 746 pdev->name); 747 748 error = tps6594_request_reg_irqs(pdev, rdev, irq_data, 749 - tps6594_ldos_irq_types[i], 750 &irq_idx); 751 if (error) 752 return error; 753 } 754 } 755 756 - if (tps->chip_id == LP8764) 757 - ext_reg_irq_nb = ARRAY_SIZE(tps6594_ext_regulator_irq_types); 758 759 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); 763 if (!irq_ext_reg_data) 764 return -ENOMEM; 765 766 - for (i = 0; i < ext_reg_irq_nb; ++i) { 767 - irq_type = &tps6594_ext_regulator_irq_types[i]; 768 - 769 irq = platform_get_irq_byname(pdev, irq_type->irq_name); 770 if (irq < 0) 771 return -EINVAL; ··· 805 806 MODULE_ALIAS("platform:tps6594-regulator"); 807 MODULE_AUTHOR("Jerome Neanne <jneanne@baylibre.com>"); 808 MODULE_DESCRIPTION("TPS6594 voltage regulator driver"); 809 MODULE_LICENSE("GPL");
··· 18 19 #include <linux/mfd/tps6594.h> 20 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 28 29 enum tps6594_regulator_id { 30 /* DCDC's */ ··· 64 { TPS6594_IRQ_NAME_VMON2_UV, "VMON2", "undervoltage", REGULATOR_EVENT_UNDER_VOLTAGE }, 65 { TPS6594_IRQ_NAME_VMON2_RV, "VMON2", "residual voltage", 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 }, 76 }; 77 78 struct tps6594_regulator_irq_data { ··· 120 121 static const struct linear_range ldos_4_ranges[] = { 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), 144 }; 145 146 /* Operations permitted on BUCK1/2/3/4/5 */ ··· 197 4, 0, 0, NULL, 0, 0), 198 }; 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 + 232 static struct tps6594_regulator_irq_type tps6594_buck1_irq_types[] = { 233 { TPS6594_IRQ_NAME_BUCK1_OV, "BUCK1", "overvoltage", REGULATOR_EVENT_OVER_VOLTAGE_WARN }, 234 { TPS6594_IRQ_NAME_BUCK1_UV, "BUCK1", "undervoltage", REGULATOR_EVENT_UNDER_VOLTAGE }, ··· 269 REGULATOR_EVENT_OVER_CURRENT }, 270 }; 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 + 307 static struct tps6594_regulator_irq_type *tps6594_bucks_irq_types[] = { 308 tps6594_buck1_irq_types, 309 tps6594_buck2_irq_types, ··· 284 tps6594_ldo4_irq_types, 285 }; 286 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[] = { 301 TPS6594_REGULATOR("BUCK12", "buck12", TPS6594_BUCK_1, 302 REGULATOR_VOLTAGE, tps6594_bucks_ops, TPS6594_MASK_BUCKS_VSET, 303 TPS6594_REG_BUCKX_VOUT_1(1), ··· 315 4, 4000, 0, NULL, 0, 0), 316 }; 317 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[] = { 329 TPS6594_REGULATOR("LDO1", "ldo1", TPS6594_LDO_1, 330 REGULATOR_VOLTAGE, tps6594_ldos_1_2_3_ops, TPS6594_MASK_LDO123_VSET, 331 TPS6594_REG_LDOX_VOUT(0), ··· 346 1, 0, 0, NULL, 0, 0), 347 }; 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 + 373 static irqreturn_t tps6594_regulator_irq_handler(int irq, void *data) 374 { 375 struct tps6594_regulator_irq_data *irq_data = data; ··· 369 static int tps6594_request_reg_irqs(struct platform_device *pdev, 370 struct regulator_dev *rdev, 371 struct tps6594_regulator_irq_data *irq_data, 372 + struct tps6594_regulator_irq_type *regs_irq_types, 373 + size_t interrupt_cnt, 374 int *irq_idx) 375 { 376 struct tps6594_regulator_irq_type *irq_type; 377 struct tps6594 *tps = dev_get_drvdata(pdev->dev.parent); 378 + size_t j; 379 int irq; 380 int error; 381 382 + for (j = 0; j < interrupt_cnt; j++) { 383 + irq_type = &regs_irq_types[j]; 384 irq = platform_get_irq_byname(pdev, irq_type->irq_name); 385 if (irq < 0) 386 return -EINVAL; ··· 411 struct tps6594_regulator_irq_data *irq_data; 412 struct tps6594_ext_regulator_irq_data *irq_ext_reg_data; 413 struct tps6594_regulator_irq_type *irq_type; 414 + struct tps6594_regulator_irq_type *irq_types; 415 + bool buck_configured[BUCK_NB] = { false }; 416 + bool buck_multi[MULTI_PHASE_NB] = { false }; 417 + 418 static const char *npname; 419 + int error, i, irq, multi; 420 int irq_idx = 0; 421 int buck_idx = 0; 422 + int nr_ldo; 423 + int nr_buck; 424 + int nr_types; 425 + unsigned int irq_count; 426 + unsigned int multi_phase_cnt; 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 + 450 enum { 451 MULTI_BUCK12, 452 + MULTI_BUCK12_34, 453 MULTI_BUCK123, 454 MULTI_BUCK1234, 455 }; 456 457 config.dev = tps->dev; ··· 442 * In case of Multiphase configuration, value should be defined for 443 * buck_configured to avoid creating bucks for every buck in multiphase 444 */ 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); 447 npname = of_node_full_name(np); 448 np_pmic_parent = of_get_parent(of_get_parent(np)); 449 if (of_node_cmp(of_node_full_name(np_pmic_parent), tps->dev->of_node->full_name)) 450 continue; 451 + if (strcmp(npname, multi_regs[multi].supply_name) == 0) { 452 switch (multi) { 453 case MULTI_BUCK12: 454 + buck_multi[0] = true; 455 + buck_configured[0] = true; 456 + buck_configured[1] = true; 457 break; 458 /* multiphase buck34 is supported only with buck12 */ 459 case MULTI_BUCK12_34: 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; 466 break; 467 case MULTI_BUCK123: 468 + buck_multi[2] = true; 469 + buck_configured[0] = true; 470 + buck_configured[1] = true; 471 + buck_configured[2] = true; 472 break; 473 case MULTI_BUCK1234: 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; 479 break; 480 } 481 } 482 } 483 484 if (tps->chip_id == LP8764) { 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; 492 } else { 493 + nr_buck = ARRAY_SIZE(buck_regs); 494 + nr_ldo = ARRAY_SIZE(tps6594_ldo_regs); 495 + nr_types = TPS65224_REGS_INT_NB; 496 } 497 + 498 + reg_irq_nb = nr_types * (nr_buck + nr_ldo); 499 500 irq_data = devm_kmalloc_array(tps->dev, reg_irq_nb, 501 sizeof(struct tps6594_regulator_irq_data), GFP_KERNEL); 502 if (!irq_data) 503 return -ENOMEM; 504 505 + for (i = 0; i < multi_phase_cnt; i++) { 506 + if (!buck_multi[i]) 507 continue; 508 509 rdev = devm_regulator_register(&pdev->dev, &multi_regs[i], &config); ··· 506 pdev->name); 507 508 /* config multiphase buck12+buck34 */ 509 + if (i == MULTI_BUCK12_34) 510 buck_idx = 2; 511 + 512 error = tps6594_request_reg_irqs(pdev, rdev, irq_data, 513 + bucks_irq_types[buck_idx], 514 + interrupt_count, &irq_idx); 515 if (error) 516 return error; 517 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) { 525 error = tps6594_request_reg_irqs(pdev, rdev, irq_data, 526 tps6594_bucks_irq_types[buck_idx + 2], 527 + interrupt_count, 528 &irq_idx); 529 if (error) 530 return error; 531 } 532 + if (i == MULTI_BUCK1234) { 533 error = tps6594_request_reg_irqs(pdev, rdev, irq_data, 534 tps6594_bucks_irq_types[buck_idx + 3], 535 + interrupt_count, 536 &irq_idx); 537 if (error) 538 return error; 539 } 540 } 541 542 + for (i = 0; i < nr_buck; i++) { 543 + if (buck_configured[i]) 544 continue; 545 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); 550 if (IS_ERR(rdev)) 551 return dev_err_probe(tps->dev, PTR_ERR(rdev), 552 + "failed to register %s regulator\n", pdev->name); 553 554 error = tps6594_request_reg_irqs(pdev, rdev, irq_data, 555 + bucks_irq_types[i], interrupt_count, &irq_idx); 556 if (error) 557 return error; 558 } 559 560 + /* LP8764 doesn't have LDO */ 561 if (tps->chip_id != LP8764) { 562 + for (i = 0; i < nr_ldo; i++) { 563 rdev = devm_regulator_register(&pdev->dev, &ldo_regs[i], &config); 564 if (IS_ERR(rdev)) 565 return dev_err_probe(tps->dev, PTR_ERR(rdev), ··· 559 pdev->name); 560 561 error = tps6594_request_reg_irqs(pdev, rdev, irq_data, 562 + ldos_irq_types[i], interrupt_count, 563 &irq_idx); 564 if (error) 565 return error; 566 } 567 } 568 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 + } 580 581 irq_ext_reg_data = devm_kmalloc_array(tps->dev, 582 + irq_count, 583 + sizeof(struct tps6594_ext_regulator_irq_data), 584 + GFP_KERNEL); 585 if (!irq_ext_reg_data) 586 return -ENOMEM; 587 588 + for (i = 0; i < irq_count; ++i) { 589 + irq_type = &irq_types[i]; 590 irq = platform_get_irq_byname(pdev, irq_type->irq_name); 591 if (irq < 0) 592 return -EINVAL; ··· 610 611 MODULE_ALIAS("platform:tps6594-regulator"); 612 MODULE_AUTHOR("Jerome Neanne <jneanne@baylibre.com>"); 613 + MODULE_AUTHOR("Nirmala Devi Mal Nadar <m.nirmaladevi@ltts.com>"); 614 MODULE_DESCRIPTION("TPS6594 voltage regulator driver"); 615 MODULE_LICENSE("GPL");
+1
include/linux/mfd/intel-m10-bmc.h
··· 205 unsigned int pr_reh_addr; 206 unsigned int pr_magic; 207 unsigned int rsu_update_counter; 208 }; 209 210 /**
··· 205 unsigned int pr_reh_addr; 206 unsigned int pr_magic; 207 unsigned int rsu_update_counter; 208 + unsigned int staging_size; 209 }; 210 211 /**
+144
include/linux/mfd/rk808.h
··· 113 #define RK808_INT_STS_MSK_REG2 0x4f 114 #define RK808_IO_POL_REG 0x50 115 116 /* RK818 */ 117 #define RK818_DCDC1 0 118 #define RK818_LDO1 4 ··· 933 #define VOUT_LO_INT BIT(0) 934 #define CLK32KOUT2_EN BIT(0) 935 936 #define TEMP115C 0x0c 937 #define TEMP_HOTDIE_MSK 0x0c 938 #define SLP_SD_MSK (0x3 << 2) ··· 1334 RK806_ID = 0x8060, 1335 RK808_ID = 0x0000, 1336 RK809_ID = 0x8090, 1337 RK817_ID = 0x8170, 1338 RK818_ID = 0x8180, 1339 };
··· 113 #define RK808_INT_STS_MSK_REG2 0x4f 114 #define RK808_IO_POL_REG 0x50 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 + 258 /* RK818 */ 259 #define RK818_DCDC1 0 260 #define RK818_LDO1 4 ··· 791 #define VOUT_LO_INT BIT(0) 792 #define CLK32KOUT2_EN BIT(0) 793 794 + #define TEMP105C 0x08 795 #define TEMP115C 0x0c 796 #define TEMP_HOTDIE_MSK 0x0c 797 #define SLP_SD_MSK (0x3 << 2) ··· 1191 RK806_ID = 0x8060, 1192 RK808_ID = 0x0000, 1193 RK809_ID = 0x8090, 1194 + RK816_ID = 0x8160, 1195 RK817_ID = 0x8170, 1196 RK818_ID = 0x8180, 1197 };
+3 -2
include/linux/mfd/rohm-bd71828.h
··· 4 #ifndef __LINUX_MFD_BD71828_H__ 5 #define __LINUX_MFD_BD71828_H__ 6 7 #include <linux/mfd/rohm-generic.h> 8 #include <linux/mfd/rohm-shared.h> 9 ··· 42 #define BD71828_REG_PS_CTRL_2 0x05 43 #define BD71828_REG_PS_CTRL_3 0x06 44 45 - //#define BD71828_REG_SWRESET 0x06 46 #define BD71828_MASK_RUN_LVL_CTRL 0x30 47 48 /* Regulator control masks */ ··· 135 #define BD71828_REG_LDO5_VOLT 0x43 136 #define BD71828_REG_LDO5_VOLT_OPT 0x42 137 #define BD71828_REG_LDO6_EN 0x44 138 - //#define BD71828_REG_LDO6_VOLT 0x4 139 #define BD71828_REG_LDO7_EN 0x45 140 #define BD71828_REG_LDO7_VOLT 0x46 141
··· 4 #ifndef __LINUX_MFD_BD71828_H__ 5 #define __LINUX_MFD_BD71828_H__ 6 7 + #include <linux/bits.h> 8 #include <linux/mfd/rohm-generic.h> 9 #include <linux/mfd/rohm-shared.h> 10 ··· 41 #define BD71828_REG_PS_CTRL_2 0x05 42 #define BD71828_REG_PS_CTRL_3 0x06 43 44 + #define BD71828_MASK_STATE_HBNT BIT(1) 45 + 46 #define BD71828_MASK_RUN_LVL_CTRL 0x30 47 48 /* Regulator control masks */ ··· 133 #define BD71828_REG_LDO5_VOLT 0x43 134 #define BD71828_REG_LDO5_VOLT_OPT 0x42 135 #define BD71828_REG_LDO6_EN 0x44 136 #define BD71828_REG_LDO7_EN 0x45 137 #define BD71828_REG_LDO7_VOLT 0x46 138
+338 -13
include/linux/mfd/tps6594.h
··· 18 TPS6594, 19 TPS6593, 20 LP8764, 21 }; 22 23 /* Macro to get page index from register address */ 24 #define TPS6594_REG_TO_PAGE(reg) ((reg) >> 8) 25 26 - /* Registers for page 0 of TPS6594 */ 27 #define TPS6594_REG_DEV_REV 0x01 28 29 #define TPS6594_REG_NVM_CODE_1 0x02 ··· 57 #define TPS6594_REG_GPIOX_OUT(gpio_inst) (TPS6594_REG_GPIO_OUT_1 + (gpio_inst) / 8) 58 #define TPS6594_REG_GPIOX_IN(gpio_inst) (TPS6594_REG_GPIO_IN_1 + (gpio_inst) / 8) 59 60 - #define TPS6594_REG_GPIO_IN_1 0x3f 61 - #define TPS6594_REG_GPIO_IN_2 0x40 62 - 63 #define TPS6594_REG_RAIL_SEL_1 0x41 64 #define TPS6594_REG_RAIL_SEL_2 0x42 65 #define TPS6594_REG_RAIL_SEL_3 0x43 ··· 68 #define TPS6594_REG_FSM_TRIG_MASK_3 0x48 69 70 #define TPS6594_REG_MASK_BUCK1_2 0x49 71 #define TPS6594_REG_MASK_BUCK3_4 0x4a 72 #define TPS6594_REG_MASK_BUCK5 0x4b 73 #define TPS6594_REG_MASK_LDO1_2 0x4c 74 #define TPS6594_REG_MASK_LDO3_4 0x4d 75 #define TPS6594_REG_MASK_VMON 0x4e 76 - #define TPS6594_REG_MASK_GPIO1_8_FALL 0x4f 77 - #define TPS6594_REG_MASK_GPIO1_8_RISE 0x50 78 #define TPS6594_REG_MASK_GPIO9_11 0x51 79 #define TPS6594_REG_MASK_STARTUP 0x52 80 #define TPS6594_REG_MASK_MISC 0x53 ··· 174 175 #define TPS6594_REG_REGISTER_LOCK 0xa1 176 177 #define TPS6594_REG_MANUFACTURING_VER 0xa6 178 179 #define TPS6594_REG_CUSTOMER_NVM_ID_REG 0xa7 ··· 186 187 #define TPS6594_REG_SOFT_REBOOT_REG 0xab 188 189 #define TPS6594_REG_RTC_SECONDS 0xb5 190 #define TPS6594_REG_RTC_MINUTES 0xb6 191 #define TPS6594_REG_RTC_HOURS 0xb7 ··· 206 207 #define TPS6594_REG_RTC_CTRL_1 0xc2 208 #define TPS6594_REG_RTC_CTRL_2 0xc3 209 #define TPS6594_REG_RTC_STATUS 0xc4 210 #define TPS6594_REG_RTC_INTERRUPTS 0xc5 211 #define TPS6594_REG_RTC_COMP_LSB 0xc6 ··· 222 #define TPS6594_REG_PFSM_DELAY_REG_2 0xce 223 #define TPS6594_REG_PFSM_DELAY_REG_3 0xcf 224 #define TPS6594_REG_PFSM_DELAY_REG_4 0xd0 225 226 - /* Registers for page 1 of TPS6594 */ 227 #define TPS6594_REG_SERIAL_IF_CONFIG 0x11a 228 #define TPS6594_REG_I2C1_ID 0x122 229 #define TPS6594_REG_I2C2_ID 0x123 230 231 - /* Registers for page 4 of TPS6594 */ 232 #define TPS6594_REG_WD_ANSWER_REG 0x401 233 #define TPS6594_REG_WD_QUESTION_ANSW_CNT 0x402 234 #define TPS6594_REG_WD_WIN1_CFG 0x403 ··· 253 #define TPS6594_BIT_BUCK_PLDN BIT(5) 254 #define TPS6594_BIT_BUCK_RV_SEL BIT(7) 255 256 - /* BUCKX_CONF register field definition */ 257 #define TPS6594_MASK_BUCK_SLEW_RATE GENMASK(2, 0) 258 #define TPS6594_MASK_BUCK_ILIM GENMASK(5, 3) 259 260 - /* BUCKX_PG_WINDOW register field definition */ 261 #define TPS6594_MASK_BUCK_OV_THR GENMASK(2, 0) 262 #define TPS6594_MASK_BUCK_UV_THR GENMASK(5, 3) 263 264 - /* BUCKX VSET */ 265 - #define TPS6594_MASK_BUCKS_VSET GENMASK(7, 0) 266 267 /* LDOX_CTRL register field definition */ 268 #define TPS6594_BIT_LDO_EN BIT(0) ··· 280 #define TPS6594_BIT_LDO_VMON_EN BIT(4) 281 #define TPS6594_MASK_LDO_PLDN GENMASK(6, 5) 282 #define TPS6594_BIT_LDO_RV_SEL BIT(7) 283 284 /* LDORTC_CTRL register field definition */ 285 #define TPS6594_BIT_LDORTC_DIS BIT(0) ··· 294 #define TPS6594_MASK_LDO_OV_THR GENMASK(2, 0) 295 #define TPS6594_MASK_LDO_UV_THR GENMASK(5, 3) 296 297 /* VCCA_VMON_CTRL register field definition */ 298 #define TPS6594_BIT_VMON_EN BIT(0) 299 #define TPS6594_BIT_VMON1_EN BIT(1) ··· 304 #define TPS6594_BIT_VMON2_EN BIT(3) 305 #define TPS6594_BIT_VMON2_RV_SEL BIT(4) 306 #define TPS6594_BIT_VMON_DEGLITCH_SEL BIT(5) 307 308 /* VCCA_PG_WINDOW register field definition */ 309 #define TPS6594_MASK_VCCA_OV_THR GENMASK(2, 0) 310 #define TPS6594_MASK_VCCA_UV_THR GENMASK(5, 3) 311 #define TPS6594_BIT_VCCA_PG_SET BIT(6) 312 313 /* VMONX_PG_WINDOW register field definition */ 314 #define TPS6594_MASK_VMONX_OV_THR GENMASK(2, 0) 315 #define TPS6594_MASK_VMONX_UV_THR GENMASK(5, 3) 316 #define TPS6594_BIT_VMONX_RANGE BIT(6) 317 318 /* GPIOX_CONF register field definition */ 319 #define TPS6594_BIT_GPIO_DIR BIT(0) ··· 327 #define TPS6594_BIT_GPIO_PU_PD_EN BIT(3) 328 #define TPS6594_BIT_GPIO_DEGLITCH_EN BIT(4) 329 #define TPS6594_MASK_GPIO_SEL GENMASK(7, 5) 330 331 /* NPWRON_CONF register field definition */ 332 #define TPS6594_BIT_NRSTOUT_OD BIT(0) ··· 338 #define TPS6594_BIT_ENABLE_POL BIT(5) 339 #define TPS6594_MASK_NPWRON_SEL GENMASK(7, 6) 340 341 /* GPIO_OUT_X register field definition */ 342 #define TPS6594_BIT_GPIOX_OUT(gpio_inst) BIT((gpio_inst) % 8) 343 344 /* GPIO_IN_X register field definition */ 345 #define TPS6594_BIT_GPIOX_IN(gpio_inst) BIT((gpio_inst) % 8) 346 #define TPS6594_BIT_NPWRON_IN BIT(3) 347 348 /* RAIL_SEL_1 register field definition */ 349 #define TPS6594_MASK_BUCK1_GRP_SEL GENMASK(1, 0) ··· 388 #define TPS6594_BIT_GPIOX_FSM_MASK(gpio_inst) BIT(((gpio_inst) << 1) % 8) 389 #define TPS6594_BIT_GPIOX_FSM_MASK_POL(gpio_inst) BIT(((gpio_inst) << 1) % 8 + 1) 390 391 /* MASK_BUCKX register field definition */ 392 #define TPS6594_BIT_BUCKX_OV_MASK(buck_inst) BIT(((buck_inst) << 2) % 8) 393 #define TPS6594_BIT_BUCKX_UV_MASK(buck_inst) BIT(((buck_inst) << 2) % 8 + 1) ··· 409 #define TPS6594_BIT_VMON2_OV_MASK BIT(5) 410 #define TPS6594_BIT_VMON2_UV_MASK BIT(6) 411 412 /* MASK_GPIOX register field definition */ 413 #define TPS6594_BIT_GPIOX_FALL_MASK(gpio_inst) BIT((gpio_inst) < 8 ? \ 414 (gpio_inst) : (gpio_inst) % 8) 415 #define TPS6594_BIT_GPIOX_RISE_MASK(gpio_inst) BIT((gpio_inst) < 8 ? \ 416 (gpio_inst) : (gpio_inst) % 8 + 3) 417 418 /* MASK_STARTUP register field definition */ 419 #define TPS6594_BIT_NPWRON_START_MASK BIT(0) 420 #define TPS6594_BIT_ENABLE_MASK BIT(1) 421 #define TPS6594_BIT_FSD_MASK BIT(4) 422 #define TPS6594_BIT_SOFT_REBOOT_MASK BIT(5) 423 424 /* MASK_MISC register field definition */ 425 #define TPS6594_BIT_BIST_PASS_MASK BIT(0) 426 #define TPS6594_BIT_EXT_CLK_MASK BIT(1) 427 #define TPS6594_BIT_TWARN_MASK BIT(3) 428 429 /* MASK_MODERATE_ERR register field definition */ 430 #define TPS6594_BIT_BIST_FAIL_MASK BIT(1) ··· 463 #define TPS6594_BIT_ORD_SHUTDOWN_MASK BIT(1) 464 #define TPS6594_BIT_MCU_PWR_ERR_MASK BIT(2) 465 #define TPS6594_BIT_SOC_PWR_ERR_MASK BIT(3) 466 467 /* MASK_COMM_ERR register field definition */ 468 #define TPS6594_BIT_COMM_FRM_ERR_MASK BIT(0) ··· 500 #define TPS6594_BIT_BUCK3_4_INT BIT(1) 501 #define TPS6594_BIT_BUCK5_INT BIT(2) 502 503 /* INT_BUCKX register field definition */ 504 #define TPS6594_BIT_BUCKX_OV_INT(buck_inst) BIT(((buck_inst) << 2) % 8) 505 #define TPS6594_BIT_BUCKX_UV_INT(buck_inst) BIT(((buck_inst) << 2) % 8 + 1) ··· 516 #define TPS6594_BIT_LDO1_2_INT BIT(0) 517 #define TPS6594_BIT_LDO3_4_INT BIT(1) 518 #define TPS6594_BIT_VCCA_INT BIT(4) 519 520 /* INT_LDOX register field definition */ 521 #define TPS6594_BIT_LDOX_OV_INT(ldo_inst) BIT(((ldo_inst) << 2) % 8) ··· 550 /* INT_GPIOX register field definition */ 551 #define TPS6594_BIT_GPIOX_INT(gpio_inst) BIT(gpio_inst) 552 553 /* INT_STARTUP register field definition */ 554 #define TPS6594_BIT_NPWRON_START_INT BIT(0) 555 #define TPS6594_BIT_ENABLE_INT BIT(1) 556 #define TPS6594_BIT_RTC_INT BIT(2) 557 #define TPS6594_BIT_FSD_INT BIT(4) 558 #define TPS6594_BIT_SOFT_REBOOT_INT BIT(5) 559 560 /* INT_MISC register field definition */ 561 #define TPS6594_BIT_BIST_PASS_INT BIT(0) 562 #define TPS6594_BIT_EXT_CLK_INT BIT(1) 563 #define TPS6594_BIT_TWARN_INT BIT(3) 564 565 /* INT_MODERATE_ERR register field definition */ 566 #define TPS6594_BIT_TSD_ORD_INT BIT(0) ··· 591 #define TPS6594_BIT_TSD_IMM_INT BIT(0) 592 #define TPS6594_BIT_VCCA_OVP_INT BIT(1) 593 #define TPS6594_BIT_PFSM_ERR_INT BIT(2) 594 595 /* INT_FSM_ERR register field definition */ 596 #define TPS6594_BIT_IMM_SHUTDOWN_INT BIT(0) ··· 600 #define TPS6594_BIT_SOC_PWR_ERR_INT BIT(3) 601 #define TPS6594_BIT_COMM_ERR_INT BIT(4) 602 #define TPS6594_BIT_READBACK_ERR_INT BIT(5) 603 #define TPS6594_BIT_ESM_INT BIT(6) 604 #define TPS6594_BIT_WD_INT BIT(7) 605 ··· 641 #define TPS6594_BIT_VMON2_OV_STAT BIT(5) 642 #define TPS6594_BIT_VMON2_UV_STAT BIT(6) 643 644 /* STAT_STARTUP register field definition */ 645 #define TPS6594_BIT_ENABLE_STAT BIT(1) 646 647 /* STAT_MISC register field definition */ 648 #define TPS6594_BIT_EXT_CLK_STAT BIT(1) ··· 664 /* STAT_SEVERE_ERR register field definition */ 665 #define TPS6594_BIT_TSD_IMM_STAT BIT(0) 666 #define TPS6594_BIT_VCCA_OVP_STAT BIT(1) 667 668 /* STAT_READBACK_ERR register field definition */ 669 #define TPS6594_BIT_EN_DRV_READBACK_STAT BIT(0) ··· 713 #define TPS6594_BIT_BB_CHARGER_EN BIT(0) 714 #define TPS6594_BIT_BB_ICHR BIT(1) 715 #define TPS6594_MASK_BB_VEOC GENMASK(3, 2) 716 #define TPS6594_BB_EOC_RDY BIT(7) 717 718 /* ENABLE_DRV_REG register field definition */ ··· 735 #define TPS6594_BIT_NRSTOUT_SOC_IN BIT(2) 736 #define TPS6594_BIT_FORCE_EN_DRV_LOW BIT(3) 737 #define TPS6594_BIT_SPMI_LPM_EN BIT(4) 738 739 /* RECOV_CNT_REG_1 register field definition */ 740 #define TPS6594_MASK_RECOV_CNT GENMASK(3, 0) ··· 790 /* ESM_SOC_START_REG register field definition */ 791 #define TPS6594_BIT_ESM_SOC_START BIT(0) 792 793 /* ESM_SOC_MODE_CFG register field definition */ 794 #define TPS6594_MASK_ESM_SOC_ERR_CNT_TH GENMASK(3, 0) 795 #define TPS6594_BIT_ESM_SOC_ENDRV BIT(5) 796 #define TPS6594_BIT_ESM_SOC_EN BIT(6) 797 #define TPS6594_BIT_ESM_SOC_MODE BIT(7) 798 799 /* ESM_SOC_ERR_CNT_REG register field definition */ 800 #define TPS6594_MASK_ESM_SOC_ERR_CNT GENMASK(4, 0) 801 802 /* REGISTER_LOCK register field definition */ 803 #define TPS6594_BIT_REGISTER_LOCK_STATUS BIT(0) ··· 817 /* VMON_CONF register field definition */ 818 #define TPS6594_MASK_VMON1_SLEW_RATE GENMASK(2, 0) 819 #define TPS6594_MASK_VMON2_SLEW_RATE GENMASK(5, 3) 820 821 /* SOFT_REBOOT_REG register field definition */ 822 #define TPS6594_BIT_SOFT_REBOOT BIT(0) ··· 909 #define TPS6594_BIT_I2C2_CRC_EN BIT(2) 910 #define TPS6594_MASK_T_CRC GENMASK(7, 3) 911 912 /* WD_QUESTION_ANSW_CNT register field definition */ 913 #define TPS6594_MASK_WD_QUESTION GENMASK(3, 0) 914 #define TPS6594_MASK_WD_ANSW_CNT GENMASK(5, 4) 915 916 /* WD_MODE_REG register field definition */ 917 #define TPS6594_BIT_WD_RETURN_LONGWIN BIT(0) 918 #define TPS6594_BIT_WD_MODE_SELECT BIT(1) 919 #define TPS6594_BIT_WD_PWRHOLD BIT(2) 920 921 /* WD_QA_CFG register field definition */ 922 #define TPS6594_MASK_WD_QUESTION_SEED GENMASK(3, 0) ··· 1216 #define TPS6594_IRQ_NAME_ALARM "alarm" 1217 #define TPS6594_IRQ_NAME_POWERUP "powerup" 1218 1219 /** 1220 * struct tps6594 - device private data structure 1221 * ··· 1337 struct regmap_irq_chip_data *irq_data; 1338 }; 1339 1340 - bool tps6594_is_volatile_reg(struct device *dev, unsigned int reg); 1341 int tps6594_device_init(struct tps6594 *tps, bool enable_crc); 1342 1343 #endif /* __LINUX_MFD_TPS6594_H */
··· 18 TPS6594, 19 TPS6593, 20 LP8764, 21 + TPS65224, 22 }; 23 24 /* Macro to get page index from register address */ 25 #define TPS6594_REG_TO_PAGE(reg) ((reg) >> 8) 26 27 + /* Registers for page 0 */ 28 #define TPS6594_REG_DEV_REV 0x01 29 30 #define TPS6594_REG_NVM_CODE_1 0x02 ··· 56 #define TPS6594_REG_GPIOX_OUT(gpio_inst) (TPS6594_REG_GPIO_OUT_1 + (gpio_inst) / 8) 57 #define TPS6594_REG_GPIOX_IN(gpio_inst) (TPS6594_REG_GPIO_IN_1 + (gpio_inst) / 8) 58 59 #define TPS6594_REG_RAIL_SEL_1 0x41 60 #define TPS6594_REG_RAIL_SEL_2 0x42 61 #define TPS6594_REG_RAIL_SEL_3 0x43 ··· 70 #define TPS6594_REG_FSM_TRIG_MASK_3 0x48 71 72 #define TPS6594_REG_MASK_BUCK1_2 0x49 73 + #define TPS65224_REG_MASK_BUCKS 0x49 74 #define TPS6594_REG_MASK_BUCK3_4 0x4a 75 #define TPS6594_REG_MASK_BUCK5 0x4b 76 #define TPS6594_REG_MASK_LDO1_2 0x4c 77 + #define TPS65224_REG_MASK_LDOS 0x4c 78 #define TPS6594_REG_MASK_LDO3_4 0x4d 79 #define TPS6594_REG_MASK_VMON 0x4e 80 + #define TPS6594_REG_MASK_GPIO_FALL 0x4f 81 + #define TPS6594_REG_MASK_GPIO_RISE 0x50 82 #define TPS6594_REG_MASK_GPIO9_11 0x51 83 #define TPS6594_REG_MASK_STARTUP 0x52 84 #define TPS6594_REG_MASK_MISC 0x53 ··· 174 175 #define TPS6594_REG_REGISTER_LOCK 0xa1 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 181 #define TPS6594_REG_MANUFACTURING_VER 0xa6 182 183 #define TPS6594_REG_CUSTOMER_NVM_ID_REG 0xa7 ··· 182 183 #define TPS6594_REG_SOFT_REBOOT_REG 0xab 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 188 #define TPS6594_REG_RTC_SECONDS 0xb5 189 #define TPS6594_REG_RTC_MINUTES 0xb6 190 #define TPS6594_REG_RTC_HOURS 0xb7 ··· 199 200 #define TPS6594_REG_RTC_CTRL_1 0xc2 201 #define TPS6594_REG_RTC_CTRL_2 0xc3 202 + #define TPS65224_REG_STARTUP_CTRL 0xc3 203 #define TPS6594_REG_RTC_STATUS 0xc4 204 #define TPS6594_REG_RTC_INTERRUPTS 0xc5 205 #define TPS6594_REG_RTC_COMP_LSB 0xc6 ··· 214 #define TPS6594_REG_PFSM_DELAY_REG_2 0xce 215 #define TPS6594_REG_PFSM_DELAY_REG_3 0xcf 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 221 222 + /* Registers for page 1 */ 223 #define TPS6594_REG_SERIAL_IF_CONFIG 0x11a 224 #define TPS6594_REG_I2C1_ID 0x122 225 #define TPS6594_REG_I2C2_ID 0x123 226 227 + /* Registers for page 4 */ 228 #define TPS6594_REG_WD_ANSWER_REG 0x401 229 #define TPS6594_REG_WD_QUESTION_ANSW_CNT 0x402 230 #define TPS6594_REG_WD_WIN1_CFG 0x403 ··· 241 #define TPS6594_BIT_BUCK_PLDN BIT(5) 242 #define TPS6594_BIT_BUCK_RV_SEL BIT(7) 243 244 + /* TPS6594 BUCKX_CONF register field definition */ 245 #define TPS6594_MASK_BUCK_SLEW_RATE GENMASK(2, 0) 246 #define TPS6594_MASK_BUCK_ILIM GENMASK(5, 3) 247 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 */ 252 #define TPS6594_MASK_BUCK_OV_THR GENMASK(2, 0) 253 #define TPS6594_MASK_BUCK_UV_THR GENMASK(5, 3) 254 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) 264 265 /* LDOX_CTRL register field definition */ 266 #define TPS6594_BIT_LDO_EN BIT(0) ··· 258 #define TPS6594_BIT_LDO_VMON_EN BIT(4) 259 #define TPS6594_MASK_LDO_PLDN GENMASK(6, 5) 260 #define TPS6594_BIT_LDO_RV_SEL BIT(7) 261 + #define TPS65224_BIT_LDO_DISCHARGE_EN BIT(5) 262 263 /* LDORTC_CTRL register field definition */ 264 #define TPS6594_BIT_LDORTC_DIS BIT(0) ··· 271 #define TPS6594_MASK_LDO_OV_THR GENMASK(2, 0) 272 #define TPS6594_MASK_LDO_UV_THR GENMASK(5, 3) 273 274 + /* LDOX_PG_WINDOW register field definition */ 275 + #define TPS65224_MASK_LDO_VMON_THR GENMASK(1, 0) 276 + 277 /* VCCA_VMON_CTRL register field definition */ 278 #define TPS6594_BIT_VMON_EN BIT(0) 279 #define TPS6594_BIT_VMON1_EN BIT(1) ··· 278 #define TPS6594_BIT_VMON2_EN BIT(3) 279 #define TPS6594_BIT_VMON2_RV_SEL BIT(4) 280 #define TPS6594_BIT_VMON_DEGLITCH_SEL BIT(5) 281 + #define TPS65224_BIT_VMON_DEGLITCH_SEL GENMASK(7, 5) 282 283 /* VCCA_PG_WINDOW register field definition */ 284 #define TPS6594_MASK_VCCA_OV_THR GENMASK(2, 0) 285 #define TPS6594_MASK_VCCA_UV_THR GENMASK(5, 3) 286 + #define TPS65224_MASK_VCCA_VMON_THR GENMASK(1, 0) 287 #define TPS6594_BIT_VCCA_PG_SET BIT(6) 288 289 /* VMONX_PG_WINDOW register field definition */ 290 #define TPS6594_MASK_VMONX_OV_THR GENMASK(2, 0) 291 #define TPS6594_MASK_VMONX_UV_THR GENMASK(5, 3) 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) 296 297 /* GPIOX_CONF register field definition */ 298 #define TPS6594_BIT_GPIO_DIR BIT(0) ··· 296 #define TPS6594_BIT_GPIO_PU_PD_EN BIT(3) 297 #define TPS6594_BIT_GPIO_DEGLITCH_EN BIT(4) 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) 301 302 /* NPWRON_CONF register field definition */ 303 #define TPS6594_BIT_NRSTOUT_OD BIT(0) ··· 305 #define TPS6594_BIT_ENABLE_POL BIT(5) 306 #define TPS6594_MASK_NPWRON_SEL GENMASK(7, 6) 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 + 314 /* GPIO_OUT_X register field definition */ 315 #define TPS6594_BIT_GPIOX_OUT(gpio_inst) BIT((gpio_inst) % 8) 316 317 /* GPIO_IN_X register field definition */ 318 #define TPS6594_BIT_GPIOX_IN(gpio_inst) BIT((gpio_inst) % 8) 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)) 326 327 /* RAIL_SEL_1 register field definition */ 328 #define TPS6594_MASK_BUCK1_GRP_SEL GENMASK(1, 0) ··· 343 #define TPS6594_BIT_GPIOX_FSM_MASK(gpio_inst) BIT(((gpio_inst) << 1) % 8) 344 #define TPS6594_BIT_GPIOX_FSM_MASK_POL(gpio_inst) BIT(((gpio_inst) << 1) % 8 + 1) 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 + 349 /* MASK_BUCKX register field definition */ 350 #define TPS6594_BIT_BUCKX_OV_MASK(buck_inst) BIT(((buck_inst) << 2) % 8) 351 #define TPS6594_BIT_BUCKX_UV_MASK(buck_inst) BIT(((buck_inst) << 2) % 8 + 1) ··· 361 #define TPS6594_BIT_VMON2_OV_MASK BIT(5) 362 #define TPS6594_BIT_VMON2_UV_MASK BIT(6) 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 + 378 /* MASK_GPIOX register field definition */ 379 #define TPS6594_BIT_GPIOX_FALL_MASK(gpio_inst) BIT((gpio_inst) < 8 ? \ 380 (gpio_inst) : (gpio_inst) % 8) 381 #define TPS6594_BIT_GPIOX_RISE_MASK(gpio_inst) BIT((gpio_inst) < 8 ? \ 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)) 386 387 /* MASK_STARTUP register field definition */ 388 #define TPS6594_BIT_NPWRON_START_MASK BIT(0) 389 #define TPS6594_BIT_ENABLE_MASK BIT(1) 390 #define TPS6594_BIT_FSD_MASK BIT(4) 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) 394 395 /* MASK_MISC register field definition */ 396 #define TPS6594_BIT_BIST_PASS_MASK BIT(0) 397 #define TPS6594_BIT_EXT_CLK_MASK BIT(1) 398 + #define TPS65224_BIT_REG_UNLOCK_MASK BIT(2) 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) 404 405 /* MASK_MODERATE_ERR register field definition */ 406 #define TPS6594_BIT_BIST_FAIL_MASK BIT(1) ··· 391 #define TPS6594_BIT_ORD_SHUTDOWN_MASK BIT(1) 392 #define TPS6594_BIT_MCU_PWR_ERR_MASK BIT(2) 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) 396 397 /* MASK_COMM_ERR register field definition */ 398 #define TPS6594_BIT_COMM_FRM_ERR_MASK BIT(0) ··· 426 #define TPS6594_BIT_BUCK3_4_INT BIT(1) 427 #define TPS6594_BIT_BUCK5_INT BIT(2) 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 + 435 /* INT_BUCKX register field definition */ 436 #define TPS6594_BIT_BUCKX_OV_INT(buck_inst) BIT(((buck_inst) << 2) % 8) 437 #define TPS6594_BIT_BUCKX_UV_INT(buck_inst) BIT(((buck_inst) << 2) % 8 + 1) ··· 436 #define TPS6594_BIT_LDO1_2_INT BIT(0) 437 #define TPS6594_BIT_LDO3_4_INT BIT(1) 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) 447 448 /* INT_LDOX register field definition */ 449 #define TPS6594_BIT_LDOX_OV_INT(ldo_inst) BIT(((ldo_inst) << 2) % 8) ··· 462 /* INT_GPIOX register field definition */ 463 #define TPS6594_BIT_GPIOX_INT(gpio_inst) BIT(gpio_inst) 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 + 473 /* INT_STARTUP register field definition */ 474 #define TPS6594_BIT_NPWRON_START_INT BIT(0) 475 + #define TPS65224_BIT_VSENSE_INT BIT(0) 476 #define TPS6594_BIT_ENABLE_INT BIT(1) 477 #define TPS6594_BIT_RTC_INT BIT(2) 478 + #define TPS65224_BIT_PB_SHORT_INT BIT(2) 479 #define TPS6594_BIT_FSD_INT BIT(4) 480 #define TPS6594_BIT_SOFT_REBOOT_INT BIT(5) 481 482 /* INT_MISC register field definition */ 483 #define TPS6594_BIT_BIST_PASS_INT BIT(0) 484 #define TPS6594_BIT_EXT_CLK_INT BIT(1) 485 + #define TPS65224_BIT_REG_UNLOCK_INT BIT(2) 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) 491 492 /* INT_MODERATE_ERR register field definition */ 493 #define TPS6594_BIT_TSD_ORD_INT BIT(0) ··· 488 #define TPS6594_BIT_TSD_IMM_INT BIT(0) 489 #define TPS6594_BIT_VCCA_OVP_INT BIT(1) 490 #define TPS6594_BIT_PFSM_ERR_INT BIT(2) 491 + #define TPS65224_BIT_BG_XMON_INT BIT(3) 492 493 /* INT_FSM_ERR register field definition */ 494 #define TPS6594_BIT_IMM_SHUTDOWN_INT BIT(0) ··· 496 #define TPS6594_BIT_SOC_PWR_ERR_INT BIT(3) 497 #define TPS6594_BIT_COMM_ERR_INT BIT(4) 498 #define TPS6594_BIT_READBACK_ERR_INT BIT(5) 499 + #define TPS65224_BIT_I2C2_ERR_INT BIT(5) 500 #define TPS6594_BIT_ESM_INT BIT(6) 501 #define TPS6594_BIT_WD_INT BIT(7) 502 ··· 536 #define TPS6594_BIT_VMON2_OV_STAT BIT(5) 537 #define TPS6594_BIT_VMON2_UV_STAT BIT(6) 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 + 547 /* STAT_STARTUP register field definition */ 548 + #define TPS65224_BIT_VSENSE_STAT BIT(0) 549 #define TPS6594_BIT_ENABLE_STAT BIT(1) 550 + #define TPS65224_BIT_PB_LEVEL_STAT BIT(2) 551 552 /* STAT_MISC register field definition */ 553 #define TPS6594_BIT_EXT_CLK_STAT BIT(1) ··· 549 /* STAT_SEVERE_ERR register field definition */ 550 #define TPS6594_BIT_TSD_IMM_STAT BIT(0) 551 #define TPS6594_BIT_VCCA_OVP_STAT BIT(1) 552 + #define TPS65224_BIT_BG_XMON_STAT BIT(3) 553 554 /* STAT_READBACK_ERR register field definition */ 555 #define TPS6594_BIT_EN_DRV_READBACK_STAT BIT(0) ··· 597 #define TPS6594_BIT_BB_CHARGER_EN BIT(0) 598 #define TPS6594_BIT_BB_ICHR BIT(1) 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) 602 #define TPS6594_BB_EOC_RDY BIT(7) 603 604 /* ENABLE_DRV_REG register field definition */ ··· 617 #define TPS6594_BIT_NRSTOUT_SOC_IN BIT(2) 618 #define TPS6594_BIT_FORCE_EN_DRV_LOW BIT(3) 619 #define TPS6594_BIT_SPMI_LPM_EN BIT(4) 620 + #define TPS65224_BIT_TSD_DISABLE BIT(5) 621 622 /* RECOV_CNT_REG_1 register field definition */ 623 #define TPS6594_MASK_RECOV_CNT GENMASK(3, 0) ··· 671 /* ESM_SOC_START_REG register field definition */ 672 #define TPS6594_BIT_ESM_SOC_START BIT(0) 673 674 + /* ESM_MCU_START_REG register field definition */ 675 + #define TPS65224_BIT_ESM_MCU_START BIT(0) 676 + 677 /* ESM_SOC_MODE_CFG register field definition */ 678 #define TPS6594_MASK_ESM_SOC_ERR_CNT_TH GENMASK(3, 0) 679 #define TPS6594_BIT_ESM_SOC_ENDRV BIT(5) 680 #define TPS6594_BIT_ESM_SOC_EN BIT(6) 681 #define TPS6594_BIT_ESM_SOC_MODE BIT(7) 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 + 689 /* ESM_SOC_ERR_CNT_REG register field definition */ 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) 694 695 /* REGISTER_LOCK register field definition */ 696 #define TPS6594_BIT_REGISTER_LOCK_STATUS BIT(0) ··· 686 /* VMON_CONF register field definition */ 687 #define TPS6594_MASK_VMON1_SLEW_RATE GENMASK(2, 0) 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) 712 713 /* SOFT_REBOOT_REG register field definition */ 714 #define TPS6594_BIT_SOFT_REBOOT BIT(0) ··· 755 #define TPS6594_BIT_I2C2_CRC_EN BIT(2) 756 #define TPS6594_MASK_T_CRC GENMASK(7, 3) 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 + 815 /* WD_QUESTION_ANSW_CNT register field definition */ 816 #define TPS6594_MASK_WD_QUESTION GENMASK(3, 0) 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) 828 829 /* WD_MODE_REG register field definition */ 830 #define TPS6594_BIT_WD_RETURN_LONGWIN BIT(0) 831 #define TPS6594_BIT_WD_MODE_SELECT BIT(1) 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) 835 836 /* WD_QA_CFG register field definition */ 837 #define TPS6594_MASK_WD_QUESTION_SEED GENMASK(3, 0) ··· 993 #define TPS6594_IRQ_NAME_ALARM "alarm" 994 #define TPS6594_IRQ_NAME_POWERUP "powerup" 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 + 1096 /** 1097 * struct tps6594 - device private data structure 1098 * ··· 1014 struct regmap_irq_chip_data *irq_data; 1015 }; 1016 1017 + extern const struct regmap_access_table tps6594_volatile_table; 1018 + extern const struct regmap_access_table tps65224_volatile_table; 1019 + 1020 int tps6594_device_init(struct tps6594 *tps, bool enable_crc); 1021 1022 #endif /* __LINUX_MFD_TPS6594_H */