Commit a85629f4 authored by Linus Torvalds's avatar Linus Torvalds

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
  ...
parents 0bfbc914 1482489b
Altera SOCFPGA SDRAM Controller
Required properties:
- compatible : Should contain "altr,sdr-ctl" and "syscon".
syscon is required by the Altera SOCFPGA SDRAM EDAC.
- reg : Should contain 1 register range (address and length)
Example:
sdr: sdr@ffc25000 {
compatible = "altr,sdr-ctl", "syscon";
reg = <0xffc25000 0x1000>;
};
APM X-GENE SoC series SCU Registers
This system clock unit contain various register that control block resets,
clock enable/disables, clock divisors and other deepsleep registers.
Properties:
- compatible : should contain two values. First value must be:
- "apm,xgene-scu"
second value must be always "syscon".
- reg : offset and length of the register set.
Example :
scu: system-clk-controller@17000000 {
compatible = "apm,xgene-scu","syscon";
reg = <0x0 0x17000000 0x0 0x400>;
};
Power management
----------------
For power management (particularly DVFS and AVS), the North Bridge
Power Management component is needed:
Required properties:
- compatible : should contain "marvell,armada-3700-nb-pm", "syscon";
- reg : the register start and length for the North Bridge
Power Management
Example:
nb_pm: syscon@14000 {
compatible = "marvell,armada-3700-nb-pm", "syscon";
reg = <0x14000 0x60>;
}
AVS
---
For AVS an other component is needed:
Required properties:
- compatible : should contain "marvell,armada-3700-avs", "syscon";
- reg : the register start and length for the AVS
Example:
avs: avs@11500 {
compatible = "marvell,armada-3700-avs", "syscon";
reg = <0x11500 0x40>;
}
Texas Instruments TWL family (twl4030) pwrbutton module
This module is part of the TWL4030. For more details about the whole
chip see Documentation/devicetree/bindings/mfd/ti,twl.yaml.
This module provides a simple power button event via an Interrupt.
Required properties:
- compatible: should be one of the following
- "ti,twl4030-pwrbutton": For controllers compatible with twl4030
- interrupts: should be one of the following
- <8>: For controllers compatible with twl4030
Example:
&twl {
twl_pwrbutton: pwrbutton {
compatible = "ti,twl4030-pwrbutton";
interrupts = <8>;
};
};
...@@ -21,7 +21,7 @@ description: | ...@@ -21,7 +21,7 @@ description: |
regulators. regulators.
allOf: allOf:
- $ref: ../input/input.yaml - $ref: /schemas/input/input.yaml
properties: properties:
compatible: compatible:
...@@ -57,7 +57,7 @@ properties: ...@@ -57,7 +57,7 @@ properties:
switchldo1: switchldo1:
type: object type: object
$ref: ../regulator/regulator.yaml $ref: /schemas/regulator/regulator.yaml
properties: properties:
regulator-name: true regulator-name: true
...@@ -76,7 +76,7 @@ properties: ...@@ -76,7 +76,7 @@ properties:
"^(dcdc[0-4]|ldo[0-9]|ldo1[1-2])$": "^(dcdc[0-4]|ldo[0-9]|ldo1[1-2])$":
type: object type: object
$ref: ../regulator/regulator.yaml $ref: /schemas/regulator/regulator.yaml
properties: properties:
regulator-name: true regulator-name: true
......
...@@ -20,7 +20,7 @@ properties: ...@@ -20,7 +20,7 @@ properties:
maxItems: 1 maxItems: 1
patternProperties: patternProperties:
"^.*_(clk|rst)$": "^.*-(clk|rst)$":
type: object type: object
unevaluatedProperties: false unevaluatedProperties: false
...@@ -171,7 +171,7 @@ examples: ...@@ -171,7 +171,7 @@ examples:
compatible = "allwinner,sun6i-a31-prcm"; compatible = "allwinner,sun6i-a31-prcm";
reg = <0x01f01400 0x200>; reg = <0x01f01400 0x200>;
ar100: ar100_clk { ar100: ar100-clk {
compatible = "allwinner,sun6i-a31-ar100-clk"; compatible = "allwinner,sun6i-a31-ar100-clk";
#clock-cells = <0>; #clock-cells = <0>;
clocks = <&rtc 0>, <&osc24M>, clocks = <&rtc 0>, <&osc24M>,
...@@ -180,7 +180,7 @@ examples: ...@@ -180,7 +180,7 @@ examples:
clock-output-names = "ar100"; clock-output-names = "ar100";
}; };
ahb0: ahb0_clk { ahb0: ahb0-clk {
compatible = "fixed-factor-clock"; compatible = "fixed-factor-clock";
#clock-cells = <0>; #clock-cells = <0>;
clock-div = <1>; clock-div = <1>;
...@@ -189,14 +189,14 @@ examples: ...@@ -189,14 +189,14 @@ examples:
clock-output-names = "ahb0"; clock-output-names = "ahb0";
}; };
apb0: apb0_clk { apb0: apb0-clk {
compatible = "allwinner,sun6i-a31-apb0-clk"; compatible = "allwinner,sun6i-a31-apb0-clk";
#clock-cells = <0>; #clock-cells = <0>;
clocks = <&ahb0>; clocks = <&ahb0>;
clock-output-names = "apb0"; clock-output-names = "apb0";
}; };
apb0_gates: apb0_gates_clk { apb0_gates: apb0-gates-clk {
compatible = "allwinner,sun6i-a31-apb0-gates-clk"; compatible = "allwinner,sun6i-a31-apb0-gates-clk";
#clock-cells = <1>; #clock-cells = <1>;
clocks = <&apb0>; clocks = <&apb0>;
...@@ -206,14 +206,14 @@ examples: ...@@ -206,14 +206,14 @@ examples:
"apb0_i2c"; "apb0_i2c";
}; };
ir_clk: ir_clk { ir_clk: ir-clk {
#clock-cells = <0>; #clock-cells = <0>;
compatible = "allwinner,sun4i-a10-mod0-clk"; compatible = "allwinner,sun4i-a10-mod0-clk";
clocks = <&rtc 0>, <&osc24M>; clocks = <&rtc 0>, <&osc24M>;
clock-output-names = "ir"; clock-output-names = "ir";
}; };
apb0_rst: apb0_rst { apb0_rst: apb0-rst {
compatible = "allwinner,sun6i-a31-clock-reset"; compatible = "allwinner,sun6i-a31-clock-reset";
#reset-cells = <1>; #reset-cells = <1>;
}; };
......
...@@ -47,10 +47,18 @@ patternProperties: ...@@ -47,10 +47,18 @@ patternProperties:
type: object type: object
'^pinctrl(@[0-9a-f]+)?$': '^pinctrl(@[0-9a-f]+)?$':
oneOf: type: object
- $ref: /schemas/pinctrl/aspeed,ast2400-pinctrl.yaml additionalProperties: true
- $ref: /schemas/pinctrl/aspeed,ast2500-pinctrl.yaml properties:
- $ref: /schemas/pinctrl/aspeed,ast2600-pinctrl.yaml compatible:
contains:
enum:
- aspeed,ast2400-pinctrl
- aspeed,ast2500-pinctrl
- aspeed,ast2600-pinctrl
required:
- compatible
'^interrupt-controller@[0-9a-f]+$': '^interrupt-controller@[0-9a-f]+$':
description: See Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2xxx-scu-ic.txt description: See Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2xxx-scu-ic.txt
......
...@@ -34,19 +34,19 @@ properties: ...@@ -34,19 +34,19 @@ properties:
patternProperties: patternProperties:
'^clock-controller@[a-f0-9]+$': '^clock-controller@[a-f0-9]+$':
$ref: ../clock/brcm,iproc-clocks.yaml $ref: /schemas/clock/brcm,iproc-clocks.yaml
'^phy@[a-f0-9]+$': '^phy@[a-f0-9]+$':
$ref: ../phy/bcm-ns-usb2-phy.yaml $ref: /schemas/phy/bcm-ns-usb2-phy.yaml
'^pinctrl@[a-f0-9]+$': '^pinctrl@[a-f0-9]+$':
$ref: ../pinctrl/brcm,ns-pinmux.yaml $ref: /schemas/pinctrl/brcm,ns-pinmux.yaml
'^syscon@[a-f0-9]+$': '^syscon@[a-f0-9]+$':
$ref: syscon.yaml $ref: syscon.yaml
'^thermal@[a-f0-9]+$': '^thermal@[a-f0-9]+$':
$ref: ../thermal/brcm,ns-thermal.yaml $ref: /schemas/thermal/brcm,ns-thermal.yaml
additionalProperties: false additionalProperties: false
......
Broadcom iProc Chip Device Resource Unit (CDRU)
Various Broadcom iProc SoCs have a set of registers that provide various
chip specific device and resource configurations. This node allows access to
these CDRU registers via syscon.
Required properties:
- compatible: should contain:
"brcm,sr-cdru", "syscon" for Stingray
- reg: base address and range of the CDRU registers
Example:
cdru: syscon@6641d000 {
compatible = "brcm,sr-cdru", "syscon";
reg = <0 0x6641d000 0 0x400>;
};
Broadcom iProc Multi Host Bridge (MHB)
Certain Broadcom iProc SoCs have a multi host bridge (MHB) block that controls
the connection and configuration of 1) internal PCIe serdes; 2) PCIe endpoint
interface; 3) access to the Nitro (network processing) engine
This node allows access to these MHB registers via syscon.
Required properties:
- compatible: should contain:
"brcm,sr-mhb", "syscon" for Stingray
- reg: base address and range of the MHB registers
Example:
mhb: syscon@60401000 {
compatible = "brcm,sr-mhb", "syscon";
reg = <0 0x60401000 0 0x38c>;
};
...@@ -33,7 +33,7 @@ properties: ...@@ -33,7 +33,7 @@ properties:
patternProperties: patternProperties:
'^reset-controller@[a-f0-9]+$': '^reset-controller@[a-f0-9]+$':
$ref: ../reset/brcm,bcm4908-misc-pcie-reset.yaml $ref: /schemas/reset/brcm,bcm4908-misc-pcie-reset.yaml
additionalProperties: false additionalProperties: false
......
...@@ -36,7 +36,7 @@ properties: ...@@ -36,7 +36,7 @@ properties:
clock-controller: clock-controller:
# Child node # Child node
type: object type: object
$ref: ../clock/canaan,k210-clk.yaml $ref: /schemas/clock/canaan,k210-clk.yaml
description: description:
Clock controller for the SoC clocks. This child node definition Clock controller for the SoC clocks. This child node definition
should follow the bindings specified in should follow the bindings specified in
...@@ -45,7 +45,7 @@ properties: ...@@ -45,7 +45,7 @@ properties:
reset-controller: reset-controller:
# Child node # Child node
type: object type: object
$ref: ../reset/canaan,k210-rst.yaml $ref: /schemas/reset/canaan,k210-rst.yaml
description: description:
Reset controller for the SoC. This child node definition Reset controller for the SoC. This child node definition
should follow the bindings specified in should follow the bindings specified in
...@@ -54,7 +54,7 @@ properties: ...@@ -54,7 +54,7 @@ properties:
syscon-reboot: syscon-reboot:
# Child node # Child node
type: object type: object
$ref: ../power/reset/syscon-reboot.yaml $ref: /schemas/power/reset/syscon-reboot.yaml
description: description:
Reboot method for the SoC. This child node definition Reboot method for the SoC. This child node definition
should follow the bindings specified in should follow the bindings specified in
......
...@@ -42,10 +42,10 @@ required: ...@@ -42,10 +42,10 @@ required:
patternProperties: patternProperties:
"^gpio(@[0-9a-f]+)?$": "^gpio(@[0-9a-f]+)?$":
$ref: ../gpio/delta,tn48m-gpio.yaml $ref: /schemas/gpio/delta,tn48m-gpio.yaml
"^reset-controller?$": "^reset-controller?$":
$ref: ../reset/delta,tn48m-reset.yaml $ref: /schemas/reset/delta,tn48m-reset.yaml
additionalProperties: false additionalProperties: false
......
...@@ -38,10 +38,10 @@ properties: ...@@ -38,10 +38,10 @@ properties:
device name with ".bin" as the extension (e.g. iqs620a.bin for IQS620A). device name with ".bin" as the extension (e.g. iqs620a.bin for IQS620A).
keys: keys:
$ref: ../input/iqs62x-keys.yaml $ref: /schemas/input/iqs62x-keys.yaml
pwm: pwm:
$ref: ../pwm/iqs620a-pwm.yaml $ref: /schemas/pwm/iqs620a-pwm.yaml
required: required:
- compatible - compatible
......
...@@ -39,19 +39,19 @@ properties: ...@@ -39,19 +39,19 @@ properties:
patternProperties: patternProperties:
"^gpio(@[0-9a-f]+)?$": "^gpio(@[0-9a-f]+)?$":
$ref: ../gpio/kontron,sl28cpld-gpio.yaml $ref: /schemas/gpio/kontron,sl28cpld-gpio.yaml
"^hwmon(@[0-9a-f]+)?$": "^hwmon(@[0-9a-f]+)?$":
$ref: ../hwmon/kontron,sl28cpld-hwmon.yaml $ref: /schemas/hwmon/kontron,sl28cpld-hwmon.yaml
"^interrupt-controller(@[0-9a-f]+)?$": "^interrupt-controller(@[0-9a-f]+)?$":
$ref: ../interrupt-controller/kontron,sl28cpld-intc.yaml $ref: /schemas/interrupt-controller/kontron,sl28cpld-intc.yaml
"^pwm(@[0-9a-f]+)?$": "^pwm(@[0-9a-f]+)?$":
$ref: ../pwm/kontron,sl28cpld-pwm.yaml $ref: /schemas/pwm/kontron,sl28cpld-pwm.yaml
"^watchdog(@[0-9a-f]+)?$": "^watchdog(@[0-9a-f]+)?$":
$ref: ../watchdog/kontron,sl28cpld-wdt.yaml $ref: /schemas/watchdog/kontron,sl28cpld-wdt.yaml
required: required:
- "#address-cells" - "#address-cells"
......
TI LP873X PMIC MFD driver
Required properties:
- compatible: "ti,lp8732", "ti,lp8733"
- reg: I2C slave address.
- gpio-controller: Marks the device node as a GPIO Controller.
- #gpio-cells: Should be two. The first cell is the pin number and
the second cell is used to specify flags.
See ../gpio/gpio.txt for more information.
- xxx-in-supply: Phandle to parent supply node of each regulator
populated under regulators node. xxx can be
buck0, buck1, ldo0 or ldo1.
- regulators: List of child nodes that specify the regulator
initialization data.
Example:
pmic: lp8733@60 {
compatible = "ti,lp8733";
reg = <0x60>;
gpio-controller;
#gpio-cells = <2>;
buck0-in-supply = <&vsys_3v3>;
buck1-in-supply = <&vsys_3v3>;
ldo0-in-supply = <&vsys_3v3>;
ldo1-in-supply = <&vsys_3v3>;
regulators {
lp8733_buck0: buck0 {
regulator-name = "lp8733-buck0";
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <1400000>;
regulator-min-microamp = <1500000>;
regulator-max-microamp = <4000000>;
regulator-ramp-delay = <10000>;
regulator-always-on;
regulator-boot-on;
};
lp8733_buck1: buck1 {
regulator-name = "lp8733-buck1";
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <1400000>;
regulator-min-microamp = <1500000>;
regulator-max-microamp = <4000000>;
regulator-ramp-delay = <10000>;
regulator-boot-on;
regulator-always-on;
};
lp8733_ldo0: ldo0 {
regulator-name = "lp8733-ldo0";
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <3000000>;
regulator-boot-on;
regulator-always-on;
};
lp8733_ldo1: ldo1 {
regulator-name = "lp8733-ldo1";
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <3000000>;
regulator-always-on;
regulator-boot-on;
};
};
};
...@@ -53,16 +53,16 @@ properties: ...@@ -53,16 +53,16 @@ properties:
Single string containing the name of the GPIO line. Single string containing the name of the GPIO line.
regulators: regulators:
$ref: ../regulator/max77650-regulator.yaml $ref: /schemas/regulator/max77650-regulator.yaml
charger: charger:
$ref: ../power/supply/max77650-charger.yaml $ref: /schemas/power/supply/max77650-charger.yaml
leds: leds:
$ref: ../leds/leds-max77650.yaml $ref: /schemas/leds/leds-max77650.yaml
onkey: onkey:
$ref: ../input/max77650-onkey.yaml $ref: /schemas/input/max77650-onkey.yaml
required: required:
- compatible - compatible
......
...@@ -35,7 +35,7 @@ properties: ...@@ -35,7 +35,7 @@ properties:
maxItems: 1 maxItems: 1
voltage-regulators: voltage-regulators:
$ref: ../regulator/maxim,max77686.yaml $ref: /schemas/regulator/maxim,max77686.yaml
description: description:
List of child nodes that specify the regulators. List of child nodes that specify the regulators.
......
...@@ -81,7 +81,7 @@ properties: ...@@ -81,7 +81,7 @@ properties:
- pwms - pwms
regulators: regulators:
$ref: ../regulator/maxim,max77693.yaml $ref: /schemas/regulator/maxim,max77693.yaml
description: description:
List of child nodes that specify the regulators. List of child nodes that specify the regulators.
......
...@@ -160,6 +160,10 @@ patternProperties: ...@@ -160,6 +160,10 @@ patternProperties:
type: object type: object
$ref: /schemas/nvmem/qcom,spmi-sdam.yaml# $ref: /schemas/nvmem/qcom,spmi-sdam.yaml#
"^pbs@[0-9a-f]+$":
type: object
$ref: /schemas/soc/qcom/qcom,pbs.yaml#
"phy@[0-9a-f]+$": "phy@[0-9a-f]+$":
type: object type: object
$ref: /schemas/phy/qcom,snps-eusb2-repeater.yaml# $ref: /schemas/phy/qcom,snps-eusb2-repeater.yaml#
......
...@@ -28,6 +28,7 @@ properties: ...@@ -28,6 +28,7 @@ properties:
- qcom,sdm845-tcsr - qcom,sdm845-tcsr
- qcom,sdx55-tcsr - qcom,sdx55-tcsr
- qcom,sdx65-tcsr - qcom,sdx65-tcsr
- qcom,sdx75-tcsr
- qcom,sm4450-tcsr - qcom,sm4450-tcsr
- qcom,sm6115-tcsr - qcom,sm6115-tcsr
- qcom,sm8150-tcsr - qcom,sm8150-tcsr
......
...@@ -19,6 +19,7 @@ properties: ...@@ -19,6 +19,7 @@ properties:
- enum: - enum:
- qcom,pm8058 - qcom,pm8058
- qcom,pm8821 - qcom,pm8821
- qcom,pm8901
- qcom,pm8921 - qcom,pm8921
- items: - items:
- enum: - enum:
......
...@@ -37,10 +37,10 @@ properties: ...@@ -37,10 +37,10 @@ properties:
maxItems: 1 maxItems: 1
regulators: regulators:
$ref: ../regulator/richtek,rt4831-regulator.yaml $ref: /schemas/regulator/richtek,rt4831-regulator.yaml
backlight: backlight:
$ref: ../leds/backlight/richtek,rt4831-backlight.yaml $ref: /schemas/leds/backlight/richtek,rt4831-backlight.yaml
required: required:
- compatible - compatible
......
...@@ -28,7 +28,7 @@ allOf: ...@@ -28,7 +28,7 @@ allOf:
regulators: regulators:
patternProperties: patternProperties:
"^(DCDC[1-4]|LDO[1-5]|LDORTC[12])$": "^(DCDC[1-4]|LDO[1-5]|LDORTC[12])$":
$ref: ../regulator/regulator.yaml $ref: /schemas/regulator/regulator.yaml
additionalProperties: false additionalProperties: false
- if: - if:
properties: properties:
...@@ -40,7 +40,7 @@ allOf: ...@@ -40,7 +40,7 @@ allOf:
regulators: regulators:
patternProperties: patternProperties:
"^(DCDC[1-3]|LDO[1-5]|LDORTC[12])$": "^(DCDC[1-3]|LDO[1-5]|LDORTC[12])$":
$ref: ../regulator/regulator.yaml $ref: /schemas/regulator/regulator.yaml
additionalProperties: false additionalProperties: false
- if: - if:
properties: properties:
...@@ -52,7 +52,7 @@ allOf: ...@@ -52,7 +52,7 @@ allOf:
regulators: regulators:
patternProperties: patternProperties:
"^(DCDC[1-5]|LDO[1-9]|LDO10|LDORTC[12])$": "^(DCDC[1-5]|LDO[1-9]|LDO10|LDORTC[12])$":
$ref: ../regulator/regulator.yaml $ref: /schemas/regulator/regulator.yaml
additionalProperties: false additionalProperties: false
properties: properties:
......
...@@ -82,7 +82,7 @@ properties: ...@@ -82,7 +82,7 @@ properties:
patternProperties: patternProperties:
"^(DCDC_REG[1-4]|LDO_REG[1-3])$": "^(DCDC_REG[1-4]|LDO_REG[1-3])$":
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
unevaluatedProperties: false unevaluatedProperties: false
......
...@@ -109,7 +109,7 @@ properties: ...@@ -109,7 +109,7 @@ properties:
patternProperties: patternProperties:
"^(DCDC_REG[1-4]|LDO_REG[1-8]|SWITCH_REG[1-2])$": "^(DCDC_REG[1-4]|LDO_REG[1-8]|SWITCH_REG[1-2])$":
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
unevaluatedProperties: false unevaluatedProperties: false
......
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/rockchip,rk816.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: RK816 Power Management Integrated Circuit
maintainers:
- Chris Zhong <zyw@rock-chips.com>
- Zhang Qing <zhangqing@rock-chips.com>
description:
Rockchip RK816 series PMIC. This device consists of an i2c controlled MFD
that includes regulators, a RTC, a GPIO controller, a power button, and a
battery charger manager with fuel gauge.
properties:
compatible:
enum:
- rockchip,rk816
reg:
maxItems: 1
interrupts:
maxItems: 1
'#clock-cells':
description:
See <dt-bindings/clock/rockchip,rk808.h> for clock IDs.
const: 1
clock-output-names:
maxItems: 2
gpio-controller: true
'#gpio-cells':
const: 2
system-power-controller:
type: boolean
description:
Telling whether or not this PMIC is controlling the system power.
wakeup-source:
type: boolean
vcc1-supply:
description:
The input supply for dcdc1.
vcc2-supply:
description:
The input supply for dcdc2.
vcc3-supply:
description:
The input supply for dcdc3.
vcc4-supply:
description:
The input supply for dcdc4.
vcc5-supply:
description:
The input supply for ldo1, ldo2, and ldo3.
vcc6-supply:
description:
The input supply for ldo4, ldo5, and ldo6.
vcc7-supply:
description:
The input supply for boost.
vcc8-supply:
description:
The input supply for otg-switch.
regulators:
type: object
patternProperties:
'^(boost|dcdc[1-4]|ldo[1-6]|otg-switch)$':
type: object
$ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false
additionalProperties: false
patternProperties:
'-pins$':
type: object
additionalProperties: false
$ref: /schemas/pinctrl/pinmux-node.yaml
properties:
function:
enum: [gpio, thermistor]
pins:
$ref: /schemas/types.yaml#/definitions/string
const: gpio0
required:
- compatible
- reg
- interrupts
- '#clock-cells'
additionalProperties: false
examples:
- |
#include <dt-bindings/pinctrl/rockchip.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
rk816: pmic@1a {
compatible = "rockchip,rk816";
reg = <0x1a>;
interrupt-parent = <&gpio0>;
interrupts = <RK_PA2 IRQ_TYPE_LEVEL_LOW>;
clock-output-names = "xin32k", "rk816-clkout2";
pinctrl-names = "default";
pinctrl-0 = <&pmic_int_l>;
gpio-controller;
system-power-controller;
wakeup-source;
#clock-cells = <1>;
#gpio-cells = <2>;
vcc1-supply = <&vcc_sys>;
vcc2-supply = <&vcc_sys>;
vcc3-supply = <&vcc_sys>;
vcc4-supply = <&vcc_sys>;
vcc5-supply = <&vcc33_io>;
vcc6-supply = <&vcc_sys>;
regulators {
vdd_cpu: dcdc1 {
regulator-name = "vdd_cpu";
regulator-min-microvolt = <750000>;
regulator-max-microvolt = <1450000>;
regulator-ramp-delay = <6001>;
regulator-initial-mode = <1>;
regulator-always-on;
regulator-boot-on;
regulator-state-mem {
regulator-off-in-suspend;
};
};
vdd_logic: dcdc2 {
regulator-name = "vdd_logic";
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <1250000>;
regulator-ramp-delay = <6001>;
regulator-initial-mode = <1>;
regulator-always-on;
regulator-boot-on;
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <1000000>;
};
};
vcc_ddr: dcdc3 {
regulator-name = "vcc_ddr";
regulator-initial-mode = <1>;
regulator-always-on;
regulator-boot-on;
regulator-state-mem {
regulator-on-in-suspend;
};
};
vcc33_io: dcdc4 {
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-name = "vcc33_io";
regulator-initial-mode = <1>;
regulator-always-on;
regulator-boot-on;
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <3300000>;
};
};
vccio_pmu: ldo1 {
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-name = "vccio_pmu";
regulator-always-on;
regulator-boot-on;
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <3300000>;
};
};
vcc_tp: ldo2 {
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-name = "vcc_tp";
regulator-state-mem {
regulator-off-in-suspend;
};
};
vdd_10: ldo3 {
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <1000000>;
regulator-name = "vdd_10";
regulator-always-on;
regulator-boot-on;
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <1000000>;
};
};
vcc18_lcd: ldo4 {
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-name = "vcc18_lcd";
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <1800000>;
};
};
vccio_sd: ldo5 {
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
regulator-name = "vccio_sd";
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <3300000>;
};
};
vdd10_lcd: ldo6 {
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <1000000>;
regulator-name = "vdd10_lcd";
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <1000000>;
};
};
};
rk816_gpio_pins: gpio-pins {
function = "gpio";
pins = "gpio0";
};
};
};
...@@ -91,7 +91,7 @@ properties: ...@@ -91,7 +91,7 @@ properties:
"^(LDO_REG[1-9]|DCDC_REG[1-4]|BOOST|OTG_SWITCH)$": "^(LDO_REG[1-9]|DCDC_REG[1-4]|BOOST|OTG_SWITCH)$":
type: object type: object
unevaluatedProperties: false unevaluatedProperties: false
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
clocks: clocks:
......
...@@ -101,7 +101,7 @@ properties: ...@@ -101,7 +101,7 @@ properties:
patternProperties: patternProperties:
"^(DCDC_REG[1-4]|DCDC_BOOST|LDO_REG[1-9]|SWITCH_REG|HDMI_SWITCH|OTG_SWITCH)$": "^(DCDC_REG[1-4]|DCDC_BOOST|LDO_REG[1-9]|SWITCH_REG|HDMI_SWITCH|OTG_SWITCH)$":
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
unevaluatedProperties: false unevaluatedProperties: false
......
...@@ -61,7 +61,7 @@ properties: ...@@ -61,7 +61,7 @@ properties:
default: 30000000 default: 30000000
regulators: regulators:
$ref: ../regulator/rohm,bd71815-regulator.yaml $ref: /schemas/regulator/rohm,bd71815-regulator.yaml
description: description:
List of child nodes that specify the regulators. List of child nodes that specify the regulators.
......
...@@ -17,7 +17,12 @@ description: | ...@@ -17,7 +17,12 @@ description: |
properties: properties:
compatible: compatible:
const: rohm,bd71828 oneOf:
- const: rohm,bd71828
- items:
- const: rohm,bd71879
- const: rohm,bd71828
reg: reg:
description: description:
...@@ -60,12 +65,12 @@ properties: ...@@ -60,12 +65,12 @@ properties:
here in Ohms. here in Ohms.
regulators: regulators:
$ref: ../regulator/rohm,bd71828-regulator.yaml $ref: /schemas/regulator/rohm,bd71828-regulator.yaml
description: description:
List of child nodes that specify the regulators. List of child nodes that specify the regulators.
leds: leds:
$ref: ../leds/rohm,bd71828-leds.yaml $ref: /schemas/leds/rohm,bd71828-leds.yaml
gpio-reserved-ranges: gpio-reserved-ranges:
description: | description: |
...@@ -73,6 +78,8 @@ properties: ...@@ -73,6 +78,8 @@ properties:
used to mark the pins which should not be configured for GPIO. Please see used to mark the pins which should not be configured for GPIO. Please see
the ../gpio/gpio.txt for more information. the ../gpio/gpio.txt for more information.
system-power-controller: true
required: required:
- compatible - compatible
- reg - reg
......
...@@ -109,7 +109,7 @@ properties: ...@@ -109,7 +109,7 @@ properties:
- 14000 - 14000
regulators: regulators:
$ref: ../regulator/rohm,bd71837-regulator.yaml $ref: /schemas/regulator/rohm,bd71837-regulator.yaml
description: description:
List of child nodes that specify the regulators. List of child nodes that specify the regulators.
......
...@@ -67,7 +67,7 @@ properties: ...@@ -67,7 +67,7 @@ properties:
patternProperties: patternProperties:
"^(vd09|vd18|vd25|vd33|dvfs)$": "^(vd09|vd18|vd25|vd33|dvfs)$":
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
properties: properties:
regulator-name: regulator-name:
......
...@@ -71,7 +71,7 @@ properties: ...@@ -71,7 +71,7 @@ properties:
# (HW) minimum for max timeout is 4ms, maximum 4416 ms. # (HW) minimum for max timeout is 4ms, maximum 4416 ms.
regulators: regulators:
$ref: ../regulator/rohm,bd9576-regulator.yaml $ref: /schemas/regulator/rohm,bd9576-regulator.yaml
description: description:
List of child nodes that specify the regulators. List of child nodes that specify the regulators.
......
...@@ -27,7 +27,7 @@ properties: ...@@ -27,7 +27,7 @@ properties:
maxItems: 1 maxItems: 1
regulators: regulators:
$ref: ../regulator/samsung,s2mpa01.yaml $ref: /schemas/regulator/samsung,s2mpa01.yaml
description: description:
List of child nodes that specify the regulators. List of child nodes that specify the regulators.
......
...@@ -27,7 +27,7 @@ properties: ...@@ -27,7 +27,7 @@ properties:
- samsung,s2mpu02-pmic - samsung,s2mpu02-pmic
clocks: clocks:
$ref: ../clock/samsung,s2mps11.yaml $ref: /schemas/clock/samsung,s2mps11.yaml
description: description:
Child node describing clock provider. Child node describing clock provider.
...@@ -75,7 +75,7 @@ allOf: ...@@ -75,7 +75,7 @@ allOf:
then: then:
properties: properties:
regulators: regulators:
$ref: ../regulator/samsung,s2mps11.yaml $ref: /schemas/regulator/samsung,s2mps11.yaml
samsung,s2mps11-wrstbi-ground: false samsung,s2mps11-wrstbi-ground: false
- if: - if:
...@@ -86,7 +86,7 @@ allOf: ...@@ -86,7 +86,7 @@ allOf:
then: then:
properties: properties:
regulators: regulators:
$ref: ../regulator/samsung,s2mps13.yaml $ref: /schemas/regulator/samsung,s2mps13.yaml
samsung,s2mps11-acokb-ground: false samsung,s2mps11-acokb-ground: false
- if: - if:
...@@ -97,7 +97,7 @@ allOf: ...@@ -97,7 +97,7 @@ allOf:
then: then:
properties: properties:
regulators: regulators:
$ref: ../regulator/samsung,s2mps14.yaml $ref: /schemas/regulator/samsung,s2mps14.yaml
samsung,s2mps11-acokb-ground: false samsung,s2mps11-acokb-ground: false
samsung,s2mps11-wrstbi-ground: false samsung,s2mps11-wrstbi-ground: false
...@@ -109,7 +109,7 @@ allOf: ...@@ -109,7 +109,7 @@ allOf:
then: then:
properties: properties:
regulators: regulators:
$ref: ../regulator/samsung,s2mps15.yaml $ref: /schemas/regulator/samsung,s2mps15.yaml
samsung,s2mps11-acokb-ground: false samsung,s2mps11-acokb-ground: false
samsung,s2mps11-wrstbi-ground: false samsung,s2mps11-wrstbi-ground: false
...@@ -121,7 +121,7 @@ allOf: ...@@ -121,7 +121,7 @@ allOf:
then: then:
properties: properties:
regulators: regulators:
$ref: ../regulator/samsung,s2mpu02.yaml $ref: /schemas/regulator/samsung,s2mpu02.yaml
samsung,s2mps11-acokb-ground: false samsung,s2mps11-acokb-ground: false
samsung,s2mps11-wrstbi-ground: false samsung,s2mps11-wrstbi-ground: false
......
...@@ -21,7 +21,7 @@ properties: ...@@ -21,7 +21,7 @@ properties:
const: samsung,s5m8767-pmic const: samsung,s5m8767-pmic
clocks: clocks:
$ref: ../clock/samsung,s2mps11.yaml $ref: /schemas/clock/samsung,s2mps11.yaml
description: description:
Child node describing clock provider. Child node describing clock provider.
...@@ -32,7 +32,7 @@ properties: ...@@ -32,7 +32,7 @@ properties:
maxItems: 1 maxItems: 1
regulators: regulators:
$ref: ../regulator/samsung,s5m8767.yaml $ref: /schemas/regulator/samsung,s5m8767.yaml
description: description:
List of child nodes that specify the regulators. List of child nodes that specify the regulators.
......
...@@ -60,7 +60,7 @@ properties: ...@@ -60,7 +60,7 @@ properties:
additionalProperties: false additionalProperties: false
allOf: allOf:
- $ref: ../pinctrl/pinmux-node.yaml - $ref: /schemas/pinctrl/pinmux-node.yaml
properties: properties:
pins: true pins: true
......
...@@ -29,7 +29,7 @@ properties: ...@@ -29,7 +29,7 @@ properties:
onkey: onkey:
type: object type: object
$ref: ../input/input.yaml $ref: /schemas/input/input.yaml
properties: properties:
compatible: compatible:
...@@ -67,7 +67,7 @@ properties: ...@@ -67,7 +67,7 @@ properties:
watchdog: watchdog:
type: object type: object
$ref: ../watchdog/watchdog.yaml $ref: /schemas/watchdog/watchdog.yaml
properties: properties:
compatible: compatible:
......
...@@ -126,7 +126,7 @@ properties: ...@@ -126,7 +126,7 @@ properties:
patternProperties: patternProperties:
"^channel@[0-9a-f]+$": "^channel@[0-9a-f]+$":
type: object type: object
$ref: ../iio/adc/adc.yaml# $ref: /schemas/iio/adc/adc.yaml#
description: Represents each of the external channels which are description: Represents each of the external channels which are
connected to the ADC. connected to the ADC.
...@@ -180,22 +180,22 @@ properties: ...@@ -180,22 +180,22 @@ properties:
ab8500_fg: ab8500_fg:
description: Node describing the AB8500 fuel gauge control block. description: Node describing the AB8500 fuel gauge control block.
type: object type: object
$ref: ../power/supply/stericsson,ab8500-fg.yaml $ref: /schemas/power/supply/stericsson,ab8500-fg.yaml
ab8500_btemp: ab8500_btemp:
description: Node describing the AB8500 battery temperature control block. description: Node describing the AB8500 battery temperature control block.
type: object type: object
$ref: ../power/supply/stericsson,ab8500-btemp.yaml $ref: /schemas/power/supply/stericsson,ab8500-btemp.yaml
ab8500_charger: ab8500_charger:
description: Node describing the AB8500 battery charger control block. description: Node describing the AB8500 battery charger control block.
type: object type: object
$ref: ../power/supply/stericsson,ab8500-charger.yaml $ref: /schemas/power/supply/stericsson,ab8500-charger.yaml
ab8500_chargalg: ab8500_chargalg:
description: Node describing the AB8500 battery charger algorithm. description: Node describing the AB8500 battery charger algorithm.
type: object type: object
$ref: ../power/supply/stericsson,ab8500-chargalg.yaml $ref: /schemas/power/supply/stericsson,ab8500-chargalg.yaml
phy: phy:
description: Node describing the AB8500 USB PHY control block. description: Node describing the AB8500 USB PHY control block.
...@@ -339,40 +339,40 @@ properties: ...@@ -339,40 +339,40 @@ properties:
ab8500_ldo_aux1: ab8500_ldo_aux1:
description: The voltage for the auxiliary LDO regulator 1 description: The voltage for the auxiliary LDO regulator 1
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
ab8500_ldo_aux2: ab8500_ldo_aux2:
description: The voltage for the auxiliary LDO regulator 2 description: The voltage for the auxiliary LDO regulator 2
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
ab8500_ldo_aux3: ab8500_ldo_aux3:
description: The voltage for the auxiliary LDO regulator 3 description: The voltage for the auxiliary LDO regulator 3
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
ab8500_ldo_aux4: ab8500_ldo_aux4:
description: The voltage for the auxiliary LDO regulator 4 description: The voltage for the auxiliary LDO regulator 4
only present on AB8505 only present on AB8505
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
ab8500_ldo_aux5: ab8500_ldo_aux5:
description: The voltage for the auxiliary LDO regulator 5 description: The voltage for the auxiliary LDO regulator 5
only present on AB8505 only present on AB8505
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
ab8500_ldo_aux6: ab8500_ldo_aux6:
description: The voltage for the auxiliary LDO regulator 6 description: The voltage for the auxiliary LDO regulator 6
only present on AB8505 only present on AB8505
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
# There is never any AUX7 regulator which is confusing # There is never any AUX7 regulator which is confusing
...@@ -381,21 +381,21 @@ properties: ...@@ -381,21 +381,21 @@ properties:
description: The voltage for the auxiliary LDO regulator 8 description: The voltage for the auxiliary LDO regulator 8
only present on AB8505 only present on AB8505
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
ab8500_ldo_intcore: ab8500_ldo_intcore:
description: The LDO regulator for the internal core voltage description: The LDO regulator for the internal core voltage
of the AB8500 of the AB8500
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
ab8500_ldo_adc: ab8500_ldo_adc:
description: Analog power regulator for the analog to digital converter description: Analog power regulator for the analog to digital converter
ADC, only present on AB8505 ADC, only present on AB8505
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
ab8500_ldo_tvout: ab8500_ldo_tvout:
...@@ -404,39 +404,39 @@ properties: ...@@ -404,39 +404,39 @@ properties:
the temperature of the NTC thermistor on the battery. the temperature of the NTC thermistor on the battery.
Only present on AB8500. Only present on AB8500.
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
ab8500_ldo_audio: ab8500_ldo_audio:
description: The LDO regulator for the audio codec output description: The LDO regulator for the audio codec output
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
ab8500_ldo_anamic1: ab8500_ldo_anamic1:
description: The LDO regulator for the analog microphone 1 description: The LDO regulator for the analog microphone 1
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
ab8500_ldo_anamic2: ab8500_ldo_anamic2:
description: The LDO regulator for the analog microphone 2 description: The LDO regulator for the analog microphone 2
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
ab8500_ldo_dmic: ab8500_ldo_dmic:
description: The LDO regulator for the digital microphone description: The LDO regulator for the digital microphone
only present on AB8500 only present on AB8500
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
ab8500_ldo_ana: ab8500_ldo_ana:
description: Analog power regulator for CSI and DSI interfaces, description: Analog power regulator for CSI and DSI interfaces,
Camera Serial Interface CSI and Display Serial Interface DSI. Camera Serial Interface CSI and Display Serial Interface DSI.
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
required: required:
...@@ -459,19 +459,19 @@ properties: ...@@ -459,19 +459,19 @@ properties:
ab8500_ext1: ab8500_ext1:
description: The voltage for the VSMPS1 external regulator description: The voltage for the VSMPS1 external regulator
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
ab8500_ext2: ab8500_ext2:
description: The voltage for the VSMPS2 external regulator description: The voltage for the VSMPS2 external regulator
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
ab8500_ext3: ab8500_ext3:
description: The voltage for the VSMPS3 external regulator description: The voltage for the VSMPS3 external regulator
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
required: required:
...@@ -482,7 +482,7 @@ properties: ...@@ -482,7 +482,7 @@ properties:
patternProperties: patternProperties:
"^pwm@[1-9]+?$": "^pwm@[1-9]+?$":
type: object type: object
$ref: ../pwm/pwm.yaml# $ref: /schemas/pwm/pwm.yaml#
unevaluatedProperties: false unevaluatedProperties: false
description: Represents each of the PWM blocks in the AB8500 description: Represents each of the PWM blocks in the AB8500
......
...@@ -71,52 +71,52 @@ properties: ...@@ -71,52 +71,52 @@ properties:
description: The voltage for the application processor, the description: The voltage for the application processor, the
main voltage domain for the chip. main voltage domain for the chip.
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
db8500_varm: db8500_varm:
description: The voltage for the ARM Cortex-A9 CPU. description: The voltage for the ARM Cortex-A9 CPU.
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
db8500_vmodem: db8500_vmodem:
description: The voltage for the modem subsystem. description: The voltage for the modem subsystem.
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
db8500_vpll: db8500_vpll:
description: The voltage for the phase locked loop clocks. description: The voltage for the phase locked loop clocks.
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
db8500_vsmps1: db8500_vsmps1:
description: Also known as VIO12, is a step-down voltage regulator description: Also known as VIO12, is a step-down voltage regulator
for 1.2V I/O. SMPS means System Management Power Source. for 1.2V I/O. SMPS means System Management Power Source.
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
db8500_vsmps2: db8500_vsmps2:
description: Also known as VIO18, is a step-down voltage regulator description: Also known as VIO18, is a step-down voltage regulator
for 1.8V I/O. SMPS means System Management Power Source. for 1.8V I/O. SMPS means System Management Power Source.
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
db8500_vsmps3: db8500_vsmps3:
description: This is a step-down voltage regulator description: This is a step-down voltage regulator
for 0.87 thru 1.875V I/O. SMPS means System Management Power Source. for 0.87 thru 1.875V I/O. SMPS means System Management Power Source.
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
db8500_vrf1: db8500_vrf1:
description: RF transceiver voltage regulator. description: RF transceiver voltage regulator.
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
db8500_sva_mmdsp: db8500_sva_mmdsp:
...@@ -124,21 +124,21 @@ properties: ...@@ -124,21 +124,21 @@ properties:
voltage regulator. This is the voltage for the accelerator DSP voltage regulator. This is the voltage for the accelerator DSP
for video encoding and decoding. for video encoding and decoding.
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
db8500_sva_mmdsp_ret: db8500_sva_mmdsp_ret:
description: Smart Video Accelerator (SVA) multimedia DSP (MMDSP) description: Smart Video Accelerator (SVA) multimedia DSP (MMDSP)
voltage regulator for retention mode. voltage regulator for retention mode.
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
db8500_sva_pipe: db8500_sva_pipe:
description: Smart Video Accelerator (SVA) multimedia DSP (MMDSP) description: Smart Video Accelerator (SVA) multimedia DSP (MMDSP)
voltage regulator for the data pipe. voltage regulator for the data pipe.
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
db8500_sia_mmdsp: db8500_sia_mmdsp:
...@@ -146,21 +146,21 @@ properties: ...@@ -146,21 +146,21 @@ properties:
voltage regulator. This is the voltage for the accelerator DSP voltage regulator. This is the voltage for the accelerator DSP
for image encoding and decoding. for image encoding and decoding.
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
db8500_sia_mmdsp_ret: db8500_sia_mmdsp_ret:
description: Smart Image Accelerator (SIA) multimedia DSP (MMDSP) description: Smart Image Accelerator (SIA) multimedia DSP (MMDSP)
voltage regulator for retention mode. voltage regulator for retention mode.
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
db8500_sia_pipe: db8500_sia_pipe:
description: Smart Image Accelerator (SIA) multimedia DSP (MMDSP) description: Smart Image Accelerator (SIA) multimedia DSP (MMDSP)
voltage regulator for the data pipe. voltage regulator for the data pipe.
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
db8500_sga: db8500_sga:
...@@ -168,7 +168,7 @@ properties: ...@@ -168,7 +168,7 @@ properties:
This is in effect controlling the power to the MALI400 3D This is in effect controlling the power to the MALI400 3D
accelerator block. accelerator block.
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
db8500_b2r2_mcde: db8500_b2r2_mcde:
...@@ -176,33 +176,33 @@ properties: ...@@ -176,33 +176,33 @@ properties:
Display Engine (MCDE) voltage regulator. These are two graphics Display Engine (MCDE) voltage regulator. These are two graphics
blocks. blocks.
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
db8500_esram12: db8500_esram12:
description: Embedded Static RAM (ESRAM) 1 and 2 voltage regulator. description: Embedded Static RAM (ESRAM) 1 and 2 voltage regulator.
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
db8500_esram12_ret: db8500_esram12_ret:
description: Embedded Static RAM (ESRAM) 1 and 2 voltage regulator for description: Embedded Static RAM (ESRAM) 1 and 2 voltage regulator for
retention mode. retention mode.
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
db8500_esram34: db8500_esram34:
description: Embedded Static RAM (ESRAM) 3 and 4 voltage regulator. description: Embedded Static RAM (ESRAM) 3 and 4 voltage regulator.
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
db8500_esram34_ret: db8500_esram34_ret:
description: Embedded Static RAM (ESRAM) 3 and 4 voltage regulator for description: Embedded Static RAM (ESRAM) 3 and 4 voltage regulator for
retention mode. retention mode.
type: object type: object
$ref: ../regulator/regulator.yaml# $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false unevaluatedProperties: false
required: required:
......
...@@ -38,11 +38,20 @@ properties: ...@@ -38,11 +38,20 @@ properties:
- allwinner,sun8i-h3-system-controller - allwinner,sun8i-h3-system-controller
- allwinner,sun8i-v3s-system-controller - allwinner,sun8i-v3s-system-controller
- allwinner,sun50i-a64-system-controller - allwinner,sun50i-a64-system-controller
- altr,sdr-ctl
- amd,pensando-elba-syscon - amd,pensando-elba-syscon
- apm,xgene-csw
- apm,xgene-efuse
- apm,xgene-mcb
- apm,xgene-rb
- apm,xgene-scu
- brcm,cru-clkset - brcm,cru-clkset
- brcm,sr-cdru
- brcm,sr-mhb
- freecom,fsg-cs2-system-controller - freecom,fsg-cs2-system-controller
- fsl,imx93-aonmix-ns-syscfg - fsl,imx93-aonmix-ns-syscfg
- fsl,imx93-wakeupmix-syscfg - fsl,imx93-wakeupmix-syscfg
- fsl,ls1088a-reset
- hisilicon,dsa-subctrl - hisilicon,dsa-subctrl
- hisilicon,hi6220-sramctrl - hisilicon,hi6220-sramctrl
- hisilicon,pcie-sas-subctrl - hisilicon,pcie-sas-subctrl
...@@ -51,9 +60,15 @@ properties: ...@@ -51,9 +60,15 @@ properties:
- intel,lgm-syscon - intel,lgm-syscon
- loongson,ls1b-syscon - loongson,ls1b-syscon
- loongson,ls1c-syscon - loongson,ls1c-syscon
- marvell,armada-3700-cpu-misc
- marvell,armada-3700-nb-pm
- marvell,armada-3700-avs
- marvell,armada-3700-usb2-host-misc - marvell,armada-3700-usb2-host-misc
- mediatek,mt2712-pctl-a-syscfg
- mediatek,mt6397-pctl-pmic-syscfg
- mediatek,mt8135-pctl-a-syscfg - mediatek,mt8135-pctl-a-syscfg
- mediatek,mt8135-pctl-b-syscfg - mediatek,mt8135-pctl-b-syscfg
- mediatek,mt8173-pctl-a-syscfg
- mediatek,mt8365-syscfg - mediatek,mt8365-syscfg
- microchip,lan966x-cpu-syscon - microchip,lan966x-cpu-syscon
- microchip,sparx5-cpu-syscon - microchip,sparx5-cpu-syscon
...@@ -73,6 +88,7 @@ properties: ...@@ -73,6 +88,7 @@ properties:
- rockchip,rv1126-qos - rockchip,rv1126-qos
- starfive,jh7100-sysmain - starfive,jh7100-sysmain
- ti,am62-usb-phy-ctrl - ti,am62-usb-phy-ctrl
- ti,am62p-cpsw-mac-efuse
- ti,am654-dss-oldi-io-ctrl - ti,am654-dss-oldi-io-ctrl
- ti,am654-serdes-ctrl - ti,am654-serdes-ctrl
- ti,j784s4-pcie-ctrl - ti,j784s4-pcie-ctrl
......
# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/ti,lp8732.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: TI LP873X Power Management Integrated Circuit
maintainers:
- J Keerthy <j-keerthy@ti.com>
description:
PMIC with two high-current buck converters and two linear regulators.
properties:
compatible:
enum:
- ti,lp8732
- ti,lp8733
reg:
maxItems: 1
gpio-controller: true
'#gpio-cells':
const: 2
regulators:
description:
List of child nodes that specify the regulator initialization data.
type: object
patternProperties:
"^buck[01]|ldo[01]$":
type: object
$ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false
additionalProperties: false
patternProperties:
'^(buck[01]|ldo[01])-in-supply$':
description: Phandle to parent supply of each regulator populated under regulators node.
required:
- compatible
- reg
- regulators
- buck0-in-supply
- buck1-in-supply
- ldo0-in-supply
- ldo1-in-supply
additionalProperties: false
examples:
- |
i2c {
#address-cells = <1>;
#size-cells = <0>;
pmic: pmic@60 {
compatible = "ti,lp8733";
reg = <0x60>;
gpio-controller;
#gpio-cells = <2>;
buck0-in-supply = <&vsys_3v3>;
buck1-in-supply = <&vsys_3v3>;
ldo0-in-supply = <&vsys_3v3>;
ldo1-in-supply = <&vsys_3v3>;
regulators {
buck0: buck0 {
regulator-name = "buck0";
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <1400000>;
regulator-min-microamp = <1500000>;
regulator-max-microamp = <4000000>;
regulator-ramp-delay = <10000>;
regulator-always-on;
regulator-boot-on;
};
buck1: buck1 {
regulator-name = "buck1";
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <1400000>;
regulator-min-microamp = <1500000>;
regulator-max-microamp = <4000000>;
regulator-ramp-delay = <10000>;
regulator-boot-on;
regulator-always-on;
};
ldo0: ldo0 {
regulator-name = "ldo0";
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <3000000>;
regulator-boot-on;
regulator-always-on;
};
ldo1: ldo1 {
regulator-name = "ldo1";
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <3000000>;
regulator-always-on;
regulator-boot-on;
};
};
};
};
...@@ -49,7 +49,7 @@ properties: ...@@ -49,7 +49,7 @@ properties:
patternProperties: patternProperties:
"^buck[1-6]$": "^buck[1-6]$":
type: object type: object
$ref: ../regulator/regulator.yaml $ref: /schemas/regulator/regulator.yaml
properties: properties:
regulator-name: true regulator-name: true
...@@ -72,7 +72,7 @@ properties: ...@@ -72,7 +72,7 @@ properties:
"^(ldoa[1-3]|swa1|swb[1-2]|vtt)$": "^(ldoa[1-3]|swa1|swb[1-2]|vtt)$":
type: object type: object
$ref: ../regulator/regulator.yaml $ref: /schemas/regulator/regulator.yaml
properties: properties:
regulator-name: true regulator-name: true
......
...@@ -21,6 +21,7 @@ properties: ...@@ -21,6 +21,7 @@ properties:
- ti,lp8764-q1 - ti,lp8764-q1
- ti,tps6593-q1 - ti,tps6593-q1
- ti,tps6594-q1 - ti,tps6594-q1
- ti,tps65224-q1
reg: reg:
description: I2C slave address or SPI chip select number. description: I2C slave address or SPI chip select number.
......
...@@ -15,6 +15,67 @@ description: | ...@@ -15,6 +15,67 @@ description: |
USB transceiver or Audio amplifier. USB transceiver or Audio amplifier.
These chips are connected to an i2c bus. These chips are connected to an i2c bus.
allOf:
- if:
properties:
compatible:
contains:
const: ti,twl4030
then:
properties:
madc:
type: object
$ref: /schemas/iio/adc/ti,twl4030-madc.yaml
unevaluatedProperties: false
bci:
type: object
$ref: /schemas/power/supply/twl4030-charger.yaml
unevaluatedProperties: false
pwrbutton:
type: object
additionalProperties: false
properties:
compatible:
const: ti,twl4030-pwrbutton
interrupts:
items:
- items:
const: 8
watchdog:
type: object
additionalProperties: false
properties:
compatible:
const: ti,twl4030-wdt
- if:
properties:
compatible:
contains:
const: ti,twl6030
then:
properties:
gpadc:
type: object
properties:
compatible:
const: ti,twl6030-gpadc
- if:
properties:
compatible:
contains:
const: ti,twl6032
then:
properties:
gpadc:
type: object
properties:
compatible:
const: ti,twl6032-gpadc
properties: properties:
compatible: compatible:
description: description:
...@@ -42,7 +103,16 @@ properties: ...@@ -42,7 +103,16 @@ properties:
"#clock-cells": "#clock-cells":
const: 1 const: 1
additionalProperties: false rtc:
type: object
additionalProperties: false
properties:
compatible:
const: ti,twl4030-rtc
interrupts:
maxItems: 1
unevaluatedProperties: false
required: required:
- compatible - compatible
......
* Texas Instruments TWL4030/6030 RTC
Required properties:
- compatible : Should be "ti,twl4030-rtc"
- interrupts : Should be the interrupt number.
Example:
rtc {
compatible = "ti,twl4030-rtc";
interrupts = <11>;
};
Device tree bindings for twl4030-wdt driver (TWL4030 watchdog)
Required properties:
compatible = "ti,twl4030-wdt";
Example:
watchdog {
compatible = "ti,twl4030-wdt";
};
...@@ -529,11 +529,12 @@ static enum fw_upload_err m10bmc_sec_prepare(struct fw_upload *fwl, ...@@ -529,11 +529,12 @@ static enum fw_upload_err m10bmc_sec_prepare(struct fw_upload *fwl,
const u8 *data, u32 size) const u8 *data, u32 size)
{ {
struct m10bmc_sec *sec = fwl->dd_handle; struct m10bmc_sec *sec = fwl->dd_handle;
const struct m10bmc_csr_map *csr_map = sec->m10bmc->info->csr_map;
u32 ret; u32 ret;
sec->cancel_request = false; sec->cancel_request = false;
if (!size || size > M10BMC_STAGING_SIZE) if (!size || size > csr_map->staging_size)
return FW_UPLOAD_ERR_INVALID_SIZE; return FW_UPLOAD_ERR_INVALID_SIZE;
if (sec->m10bmc->flash_bulk_ops) if (sec->m10bmc->flash_bulk_ops)
......
...@@ -292,7 +292,7 @@ config MFD_MADERA_SPI ...@@ -292,7 +292,7 @@ config MFD_MADERA_SPI
config MFD_MAX5970 config MFD_MAX5970
tristate "Maxim 5970/5978 power switch and monitor" tristate "Maxim 5970/5978 power switch and monitor"
depends on (I2C && OF) depends on I2C && OF
select MFD_SIMPLE_MFD_I2C select MFD_SIMPLE_MFD_I2C
help help
This driver controls a Maxim 5970/5978 switch via I2C bus. This driver controls a Maxim 5970/5978 switch via I2C bus.
...@@ -458,7 +458,7 @@ config MFD_EXYNOS_LPASS ...@@ -458,7 +458,7 @@ config MFD_EXYNOS_LPASS
config MFD_GATEWORKS_GSC config MFD_GATEWORKS_GSC
tristate "Gateworks System Controller" tristate "Gateworks System Controller"
depends on (I2C && OF) depends on I2C && OF
select MFD_CORE select MFD_CORE
select REGMAP_I2C select REGMAP_I2C
select REGMAP_IRQ select REGMAP_IRQ
...@@ -473,7 +473,7 @@ config MFD_GATEWORKS_GSC ...@@ -473,7 +473,7 @@ config MFD_GATEWORKS_GSC
config MFD_MC13XXX config MFD_MC13XXX
tristate tristate
depends on (SPI_MASTER || I2C) depends on SPI_MASTER || I2C
select MFD_CORE select MFD_CORE
select REGMAP_IRQ select REGMAP_IRQ
help help
...@@ -1109,7 +1109,7 @@ config PCF50633_GPIO ...@@ -1109,7 +1109,7 @@ config PCF50633_GPIO
config MFD_PM8XXX config MFD_PM8XXX
tristate "Qualcomm PM8xxx PMIC chips driver" tristate "Qualcomm PM8xxx PMIC chips driver"
depends on (ARM || HEXAGON || COMPILE_TEST) depends on ARM || HEXAGON || COMPILE_TEST
select IRQ_DOMAIN_HIERARCHY select IRQ_DOMAIN_HIERARCHY
select MFD_CORE select MFD_CORE
select REGMAP select REGMAP
...@@ -1225,7 +1225,7 @@ config MFD_RK8XX ...@@ -1225,7 +1225,7 @@ config MFD_RK8XX
select MFD_CORE select MFD_CORE
config MFD_RK8XX_I2C config MFD_RK8XX_I2C
tristate "Rockchip RK805/RK808/RK809/RK817/RK818 Power Management Chip" tristate "Rockchip RK805/RK808/RK809/RK816/RK817/RK818 Power Management Chip"
depends on I2C && OF depends on I2C && OF
select MFD_CORE select MFD_CORE
select REGMAP_I2C select REGMAP_I2C
...@@ -1233,7 +1233,7 @@ config MFD_RK8XX_I2C ...@@ -1233,7 +1233,7 @@ config MFD_RK8XX_I2C
select MFD_RK8XX select MFD_RK8XX
help help
If you say yes here you get support for the RK805, RK808, RK809, If you say yes here you get support for the RK805, RK808, RK809,
RK817 and RK818 Power Management chips. RK816, RK817 and RK818 Power Management chips.
This driver provides common support for accessing the device This driver provides common support for accessing the device
through I2C interface. The device supports multiple sub-devices through I2C interface. The device supports multiple sub-devices
including interrupts, RTC, LDO & DCDC regulators, and onkey. including interrupts, RTC, LDO & DCDC regulators, and onkey.
...@@ -1418,7 +1418,7 @@ config MFD_DB8500_PRCMU ...@@ -1418,7 +1418,7 @@ config MFD_DB8500_PRCMU
config MFD_STMPE config MFD_STMPE
bool "STMicroelectronics STMPE" bool "STMicroelectronics STMPE"
depends on (I2C=y || SPI_MASTER=y) depends on I2C=y || SPI_MASTER=y
depends on OF depends on OF
select MFD_CORE select MFD_CORE
help help
...@@ -2116,7 +2116,7 @@ config MFD_STM32_TIMERS ...@@ -2116,7 +2116,7 @@ config MFD_STM32_TIMERS
config MFD_STPMIC1 config MFD_STPMIC1
tristate "Support for STPMIC1 PMIC" tristate "Support for STPMIC1 PMIC"
depends on (I2C=y && OF) depends on I2C=y && OF
select REGMAP_I2C select REGMAP_I2C
select REGMAP_IRQ select REGMAP_IRQ
select MFD_CORE select MFD_CORE
......
...@@ -422,7 +422,7 @@ static const struct regmap_config axp717_regmap_config = { ...@@ -422,7 +422,7 @@ static const struct regmap_config axp717_regmap_config = {
.wr_table = &axp717_writeable_table, .wr_table = &axp717_writeable_table,
.volatile_table = &axp717_volatile_table, .volatile_table = &axp717_volatile_table,
.max_register = AXP717_CPUSLDO_CONTROL, .max_register = AXP717_CPUSLDO_CONTROL,
.cache_type = REGCACHE_RBTREE, .cache_type = REGCACHE_MAPLE,
}; };
static const struct regmap_config axp806_regmap_config = { static const struct regmap_config axp806_regmap_config = {
......
...@@ -43,6 +43,9 @@ ...@@ -43,6 +43,9 @@
#define CS42L43_MCU_UPDATE_TIMEOUT_US 500000 #define CS42L43_MCU_UPDATE_TIMEOUT_US 500000
#define CS42L43_MCU_UPDATE_RETRIES 5 #define CS42L43_MCU_UPDATE_RETRIES 5
#define CS42L43_MCU_ROM_REV 0x2001
#define CS42L43_MCU_ROM_BIOS_REV 0x0000
#define CS42L43_MCU_SUPPORTED_REV 0x2105 #define CS42L43_MCU_SUPPORTED_REV 0x2105
#define CS42L43_MCU_SHADOW_REGS_REQUIRED_REV 0x2200 #define CS42L43_MCU_SHADOW_REGS_REQUIRED_REV 0x2200
#define CS42L43_MCU_SUPPORTED_BIOS_REV 0x0001 #define CS42L43_MCU_SUPPORTED_BIOS_REV 0x0001
...@@ -709,6 +712,23 @@ static void cs42l43_mcu_load_firmware(const struct firmware *firmware, void *con ...@@ -709,6 +712,23 @@ static void cs42l43_mcu_load_firmware(const struct firmware *firmware, void *con
complete(&cs42l43->firmware_download); complete(&cs42l43->firmware_download);
} }
static int cs42l43_mcu_is_hw_compatible(struct cs42l43 *cs42l43,
unsigned int mcu_rev,
unsigned int bios_rev)
{
/*
* The firmware has two revision numbers bringing either of them up to a
* supported version will provide the disable the driver requires.
*/
if (mcu_rev < CS42L43_MCU_SUPPORTED_REV &&
bios_rev < CS42L43_MCU_SUPPORTED_BIOS_REV) {
dev_err(cs42l43->dev, "Firmware too old to support disable\n");
return -EINVAL;
}
return 0;
}
/* /*
* The process of updating the firmware is split into a series of steps, at the * The process of updating the firmware is split into a series of steps, at the
* end of each step a soft reset of the device might be required which will * end of each step a soft reset of the device might be required which will
...@@ -745,11 +765,10 @@ static int cs42l43_mcu_update_step(struct cs42l43 *cs42l43) ...@@ -745,11 +765,10 @@ static int cs42l43_mcu_update_step(struct cs42l43 *cs42l43)
((mcu_rev & CS42L43_FW_SUBMINOR_REV_MASK) >> 8); ((mcu_rev & CS42L43_FW_SUBMINOR_REV_MASK) >> 8);
/* /*
* The firmware has two revision numbers bringing either of them up to a * The firmware has two revision numbers both of them being at the ROM
* supported version will provide the features the driver requires. * revision indicates no patch has been applied.
*/ */
patched = mcu_rev >= CS42L43_MCU_SUPPORTED_REV || patched = mcu_rev != CS42L43_MCU_ROM_REV || bios_rev != CS42L43_MCU_ROM_BIOS_REV;
bios_rev >= CS42L43_MCU_SUPPORTED_BIOS_REV;
/* /*
* Later versions of the firmwware require the driver to access some * Later versions of the firmwware require the driver to access some
* features through a set of shadow registers. * features through a set of shadow registers.
...@@ -794,10 +813,15 @@ static int cs42l43_mcu_update_step(struct cs42l43 *cs42l43) ...@@ -794,10 +813,15 @@ static int cs42l43_mcu_update_step(struct cs42l43 *cs42l43)
return cs42l43_mcu_stage_2_3(cs42l43, shadow); return cs42l43_mcu_stage_2_3(cs42l43, shadow);
} }
case CS42L43_MCU_BOOT_STAGE3: case CS42L43_MCU_BOOT_STAGE3:
if (patched) if (patched) {
ret = cs42l43_mcu_is_hw_compatible(cs42l43, mcu_rev, bios_rev);
if (ret)
return ret;
return cs42l43_mcu_disable(cs42l43); return cs42l43_mcu_disable(cs42l43);
else } else {
return cs42l43_mcu_stage_3_2(cs42l43); return cs42l43_mcu_stage_3_2(cs42l43);
}
case CS42L43_MCU_BOOT_STAGE4: case CS42L43_MCU_BOOT_STAGE4:
return 0; return 0;
default: default:
......
...@@ -54,7 +54,7 @@ static int intel_lpss_pci_probe(struct pci_dev *pdev, ...@@ -54,7 +54,7 @@ static int intel_lpss_pci_probe(struct pci_dev *pdev,
if (ret) if (ret)
return ret; return ret;
ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_INTX); ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -370,6 +370,7 @@ static const struct m10bmc_csr_map m10bmc_n6000_csr_map = { ...@@ -370,6 +370,7 @@ static const struct m10bmc_csr_map m10bmc_n6000_csr_map = {
.pr_reh_addr = M10BMC_N6000_PR_REH_ADDR, .pr_reh_addr = M10BMC_N6000_PR_REH_ADDR,
.pr_magic = M10BMC_N6000_PR_PROG_MAGIC, .pr_magic = M10BMC_N6000_PR_PROG_MAGIC,
.rsu_update_counter = M10BMC_N6000_STAGING_FLASH_COUNT, .rsu_update_counter = M10BMC_N6000_STAGING_FLASH_COUNT,
.staging_size = M10BMC_STAGING_SIZE,
}; };
static const struct intel_m10bmc_platform_info m10bmc_pmci_n6000 = { static const struct intel_m10bmc_platform_info m10bmc_pmci_n6000 = {
......
...@@ -109,6 +109,7 @@ static const struct m10bmc_csr_map m10bmc_n3000_csr_map = { ...@@ -109,6 +109,7 @@ static const struct m10bmc_csr_map m10bmc_n3000_csr_map = {
.pr_reh_addr = M10BMC_N3000_PR_REH_ADDR, .pr_reh_addr = M10BMC_N3000_PR_REH_ADDR,
.pr_magic = M10BMC_N3000_PR_PROG_MAGIC, .pr_magic = M10BMC_N3000_PR_PROG_MAGIC,
.rsu_update_counter = M10BMC_N3000_STAGING_FLASH_COUNT, .rsu_update_counter = M10BMC_N3000_STAGING_FLASH_COUNT,
.staging_size = M10BMC_STAGING_SIZE,
}; };
static struct mfd_cell m10bmc_d5005_subdevs[] = { static struct mfd_cell m10bmc_d5005_subdevs[] = {
......
This diff is collapsed.
...@@ -145,7 +145,6 @@ static int ocelot_spi_regmap_bus_read(void *context, const void *reg, size_t reg ...@@ -145,7 +145,6 @@ static int ocelot_spi_regmap_bus_read(void *context, const void *reg, size_t reg
struct device *dev = context; struct device *dev = context;
struct ocelot_ddata *ddata; struct ocelot_ddata *ddata;
struct spi_device *spi; struct spi_device *spi;
struct spi_message msg;
unsigned int index = 0; unsigned int index = 0;
ddata = dev_get_drvdata(dev); ddata = dev_get_drvdata(dev);
...@@ -166,9 +165,7 @@ static int ocelot_spi_regmap_bus_read(void *context, const void *reg, size_t reg ...@@ -166,9 +165,7 @@ static int ocelot_spi_regmap_bus_read(void *context, const void *reg, size_t reg
xfers[index].len = val_size; xfers[index].len = val_size;
index++; index++;
spi_message_init_with_transfers(&msg, xfers, index); return spi_sync_transfer(spi, xfers, index);
return spi_sync(spi, &msg);
} }
static int ocelot_spi_regmap_bus_write(void *context, const void *data, size_t count) static int ocelot_spi_regmap_bus_write(void *context, const void *data, size_t count)
......
...@@ -28,6 +28,10 @@ static const struct resource rtc_resources[] = { ...@@ -28,6 +28,10 @@ static const struct resource rtc_resources[] = {
DEFINE_RES_IRQ(RK808_IRQ_RTC_ALARM), DEFINE_RES_IRQ(RK808_IRQ_RTC_ALARM),
}; };
static const struct resource rk816_rtc_resources[] = {
DEFINE_RES_IRQ(RK816_IRQ_RTC_ALARM),
};
static const struct resource rk817_rtc_resources[] = { static const struct resource rk817_rtc_resources[] = {
DEFINE_RES_IRQ(RK817_IRQ_RTC_ALARM), DEFINE_RES_IRQ(RK817_IRQ_RTC_ALARM),
}; };
...@@ -87,6 +91,22 @@ static const struct mfd_cell rk808s[] = { ...@@ -87,6 +91,22 @@ static const struct mfd_cell rk808s[] = {
}, },
}; };
static const struct mfd_cell rk816s[] = {
{ .name = "rk805-pinctrl", },
{ .name = "rk808-clkout", },
{ .name = "rk808-regulator", },
{
.name = "rk805-pwrkey",
.num_resources = ARRAY_SIZE(rk805_key_resources),
.resources = rk805_key_resources,
},
{
.name = "rk808-rtc",
.num_resources = ARRAY_SIZE(rk816_rtc_resources),
.resources = rk816_rtc_resources,
},
};
static const struct mfd_cell rk817s[] = { static const struct mfd_cell rk817s[] = {
{ .name = "rk808-clkout", }, { .name = "rk808-clkout", },
{ .name = "rk808-regulator", }, { .name = "rk808-regulator", },
...@@ -148,6 +168,17 @@ static const struct rk808_reg_data rk808_pre_init_reg[] = { ...@@ -148,6 +168,17 @@ static const struct rk808_reg_data rk808_pre_init_reg[] = {
VB_LO_SEL_3500MV }, VB_LO_SEL_3500MV },
}; };
static const struct rk808_reg_data rk816_pre_init_reg[] = {
{ RK818_BUCK1_CONFIG_REG, RK817_RAMP_RATE_MASK,
RK817_RAMP_RATE_12_5MV_PER_US },
{ RK818_BUCK2_CONFIG_REG, RK817_RAMP_RATE_MASK,
RK817_RAMP_RATE_12_5MV_PER_US },
{ RK818_BUCK4_CONFIG_REG, BUCK_ILMIN_MASK, BUCK_ILMIN_250MA },
{ RK808_THERMAL_REG, TEMP_HOTDIE_MSK, TEMP105C},
{ RK808_VB_MON_REG, VBAT_LOW_VOL_MASK | VBAT_LOW_ACT_MASK,
RK808_VBAT_LOW_3V0 | EN_VABT_LOW_SHUT_DOWN },
};
static const struct rk808_reg_data rk817_pre_init_reg[] = { static const struct rk808_reg_data rk817_pre_init_reg[] = {
{RK817_RTC_CTRL_REG, RTC_STOP, RTC_STOP}, {RK817_RTC_CTRL_REG, RTC_STOP, RTC_STOP},
/* Codec specific registers */ /* Codec specific registers */
...@@ -350,6 +381,59 @@ static const struct regmap_irq rk808_irqs[] = { ...@@ -350,6 +381,59 @@ static const struct regmap_irq rk808_irqs[] = {
}, },
}; };
static const unsigned int rk816_irq_status_offsets[] = {
RK816_IRQ_STS_OFFSET(RK816_INT_STS_REG1),
RK816_IRQ_STS_OFFSET(RK816_INT_STS_REG2),
RK816_IRQ_STS_OFFSET(RK816_INT_STS_REG3),
};
static const unsigned int rk816_irq_mask_offsets[] = {
RK816_IRQ_MSK_OFFSET(RK816_INT_STS_MSK_REG1),
RK816_IRQ_MSK_OFFSET(RK816_INT_STS_MSK_REG2),
RK816_IRQ_MSK_OFFSET(RK816_INT_STS_MSK_REG3),
};
static unsigned int rk816_get_irq_reg(struct regmap_irq_chip_data *data,
unsigned int base, int index)
{
unsigned int irq_reg = base;
switch (base) {
case RK816_INT_STS_REG1:
irq_reg += rk816_irq_status_offsets[index];
break;
case RK816_INT_STS_MSK_REG1:
irq_reg += rk816_irq_mask_offsets[index];
break;
}
return irq_reg;
};
static const struct regmap_irq rk816_irqs[] = {
/* INT_STS_REG1 IRQs */
REGMAP_IRQ_REG(RK816_IRQ_PWRON_FALL, 0, RK816_INT_STS_PWRON_FALL),
REGMAP_IRQ_REG(RK816_IRQ_PWRON_RISE, 0, RK816_INT_STS_PWRON_RISE),
/* INT_STS_REG2 IRQs */
REGMAP_IRQ_REG(RK816_IRQ_VB_LOW, 1, RK816_INT_STS_VB_LOW),
REGMAP_IRQ_REG(RK816_IRQ_PWRON, 1, RK816_INT_STS_PWRON),
REGMAP_IRQ_REG(RK816_IRQ_PWRON_LP, 1, RK816_INT_STS_PWRON_LP),
REGMAP_IRQ_REG(RK816_IRQ_HOTDIE, 1, RK816_INT_STS_HOTDIE),
REGMAP_IRQ_REG(RK816_IRQ_RTC_ALARM, 1, RK816_INT_STS_RTC_ALARM),
REGMAP_IRQ_REG(RK816_IRQ_RTC_PERIOD, 1, RK816_INT_STS_RTC_PERIOD),
REGMAP_IRQ_REG(RK816_IRQ_USB_OV, 1, RK816_INT_STS_USB_OV),
/* INT_STS3 IRQs */
REGMAP_IRQ_REG(RK816_IRQ_PLUG_IN, 2, RK816_INT_STS_PLUG_IN),
REGMAP_IRQ_REG(RK816_IRQ_PLUG_OUT, 2, RK816_INT_STS_PLUG_OUT),
REGMAP_IRQ_REG(RK816_IRQ_CHG_OK, 2, RK816_INT_STS_CHG_OK),
REGMAP_IRQ_REG(RK816_IRQ_CHG_TE, 2, RK816_INT_STS_CHG_TE),
REGMAP_IRQ_REG(RK816_IRQ_CHG_TS, 2, RK816_INT_STS_CHG_TS),
REGMAP_IRQ_REG(RK816_IRQ_CHG_CVTLIM, 2, RK816_INT_STS_CHG_CVTLIM),
REGMAP_IRQ_REG(RK816_IRQ_DISCHG_ILIM, 2, RK816_INT_STS_DISCHG_ILIM),
};
static const struct regmap_irq rk818_irqs[] = { static const struct regmap_irq rk818_irqs[] = {
/* INT_STS */ /* INT_STS */
[RK818_IRQ_VOUT_LO] = { [RK818_IRQ_VOUT_LO] = {
...@@ -482,6 +566,18 @@ static const struct regmap_irq_chip rk808_irq_chip = { ...@@ -482,6 +566,18 @@ static const struct regmap_irq_chip rk808_irq_chip = {
.init_ack_masked = true, .init_ack_masked = true,
}; };
static const struct regmap_irq_chip rk816_irq_chip = {
.name = "rk816",
.irqs = rk816_irqs,
.num_irqs = ARRAY_SIZE(rk816_irqs),
.num_regs = 3,
.get_irq_reg = rk816_get_irq_reg,
.status_base = RK816_INT_STS_REG1,
.mask_base = RK816_INT_STS_MSK_REG1,
.ack_base = RK816_INT_STS_REG1,
.init_ack_masked = true,
};
static struct regmap_irq_chip rk817_irq_chip = { static struct regmap_irq_chip rk817_irq_chip = {
.name = "rk817", .name = "rk817",
.irqs = rk817_irqs, .irqs = rk817_irqs,
...@@ -530,6 +626,7 @@ static int rk808_power_off(struct sys_off_data *data) ...@@ -530,6 +626,7 @@ static int rk808_power_off(struct sys_off_data *data)
reg = RK817_SYS_CFG(3); reg = RK817_SYS_CFG(3);
bit = DEV_OFF; bit = DEV_OFF;
break; break;
case RK816_ID:
case RK818_ID: case RK818_ID:
reg = RK818_DEVCTRL_REG; reg = RK818_DEVCTRL_REG;
bit = DEV_OFF; bit = DEV_OFF;
...@@ -637,6 +734,13 @@ int rk8xx_probe(struct device *dev, int variant, unsigned int irq, struct regmap ...@@ -637,6 +734,13 @@ int rk8xx_probe(struct device *dev, int variant, unsigned int irq, struct regmap
cells = rk808s; cells = rk808s;
nr_cells = ARRAY_SIZE(rk808s); nr_cells = ARRAY_SIZE(rk808s);
break; break;
case RK816_ID:
rk808->regmap_irq_chip = &rk816_irq_chip;
pre_init_reg = rk816_pre_init_reg;
nr_pre_init_regs = ARRAY_SIZE(rk816_pre_init_reg);
cells = rk816s;
nr_cells = ARRAY_SIZE(rk816s);
break;
case RK818_ID: case RK818_ID:
rk808->regmap_irq_chip = &rk818_irq_chip; rk808->regmap_irq_chip = &rk818_irq_chip;
pre_init_reg = rk818_pre_init_reg; pre_init_reg = rk818_pre_init_reg;
......
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
/* /*
* Rockchip RK808/RK818 Core (I2C) driver * Rockchip RK805/RK808/RK816/RK817/RK818 Core (I2C) driver
* *
* Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd
* Copyright (C) 2016 PHYTEC Messtechnik GmbH * Copyright (C) 2016 PHYTEC Messtechnik GmbH
...@@ -49,6 +49,35 @@ static bool rk808_is_volatile_reg(struct device *dev, unsigned int reg) ...@@ -49,6 +49,35 @@ static bool rk808_is_volatile_reg(struct device *dev, unsigned int reg)
return false; return false;
} }
static bool rk816_is_volatile_reg(struct device *dev, unsigned int reg)
{
/*
* Technically the ROUND_30s bit makes RTC_CTRL_REG volatile, but
* we don't use that feature. It's better to cache.
*/
switch (reg) {
case RK808_SECONDS_REG ... RK808_WEEKS_REG:
case RK808_RTC_STATUS_REG:
case RK808_VB_MON_REG:
case RK808_THERMAL_REG:
case RK816_DCDC_EN_REG1:
case RK816_DCDC_EN_REG2:
case RK816_INT_STS_REG1:
case RK816_INT_STS_REG2:
case RK816_INT_STS_REG3:
case RK808_DEVCTRL_REG:
case RK816_SUP_STS_REG:
case RK816_GGSTS_REG:
case RK816_ZERO_CUR_ADC_REGH:
case RK816_ZERO_CUR_ADC_REGL:
case RK816_GASCNT_REG(0) ... RK816_BAT_VOL_REGL:
return true;
}
return false;
}
static bool rk817_is_volatile_reg(struct device *dev, unsigned int reg) static bool rk817_is_volatile_reg(struct device *dev, unsigned int reg)
{ {
/* /*
...@@ -100,6 +129,14 @@ static const struct regmap_config rk808_regmap_config = { ...@@ -100,6 +129,14 @@ static const struct regmap_config rk808_regmap_config = {
.volatile_reg = rk808_is_volatile_reg, .volatile_reg = rk808_is_volatile_reg,
}; };
static const struct regmap_config rk816_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.max_register = RK816_DATA_REG(18),
.cache_type = REGCACHE_MAPLE,
.volatile_reg = rk816_is_volatile_reg,
};
static const struct regmap_config rk817_regmap_config = { static const struct regmap_config rk817_regmap_config = {
.reg_bits = 8, .reg_bits = 8,
.val_bits = 8, .val_bits = 8,
...@@ -123,6 +160,11 @@ static const struct rk8xx_i2c_platform_data rk809_data = { ...@@ -123,6 +160,11 @@ static const struct rk8xx_i2c_platform_data rk809_data = {
.variant = RK809_ID, .variant = RK809_ID,
}; };
static const struct rk8xx_i2c_platform_data rk816_data = {
.regmap_cfg = &rk816_regmap_config,
.variant = RK816_ID,
};
static const struct rk8xx_i2c_platform_data rk817_data = { static const struct rk8xx_i2c_platform_data rk817_data = {
.regmap_cfg = &rk817_regmap_config, .regmap_cfg = &rk817_regmap_config,
.variant = RK817_ID, .variant = RK817_ID,
...@@ -161,6 +203,7 @@ static const struct of_device_id rk8xx_i2c_of_match[] = { ...@@ -161,6 +203,7 @@ static const struct of_device_id rk8xx_i2c_of_match[] = {
{ .compatible = "rockchip,rk805", .data = &rk805_data }, { .compatible = "rockchip,rk805", .data = &rk805_data },
{ .compatible = "rockchip,rk808", .data = &rk808_data }, { .compatible = "rockchip,rk808", .data = &rk808_data },
{ .compatible = "rockchip,rk809", .data = &rk809_data }, { .compatible = "rockchip,rk809", .data = &rk809_data },
{ .compatible = "rockchip,rk816", .data = &rk816_data },
{ .compatible = "rockchip,rk817", .data = &rk817_data }, { .compatible = "rockchip,rk817", .data = &rk817_data },
{ .compatible = "rockchip,rk818", .data = &rk818_data }, { .compatible = "rockchip,rk818", .data = &rk818_data },
{ }, { },
......
...@@ -464,6 +464,27 @@ static int set_clk_mode(struct device *dev, struct regmap *regmap, ...@@ -464,6 +464,27 @@ static int set_clk_mode(struct device *dev, struct regmap *regmap,
OUT32K_MODE_CMOS); OUT32K_MODE_CMOS);
} }
static struct i2c_client *bd71828_dev;
static void bd71828_power_off(void)
{
while (true) {
s32 val;
/* We are not allowed to sleep, so do not use regmap involving mutexes here. */
val = i2c_smbus_read_byte_data(bd71828_dev, BD71828_REG_PS_CTRL_1);
if (val >= 0)
i2c_smbus_write_byte_data(bd71828_dev,
BD71828_REG_PS_CTRL_1,
BD71828_MASK_STATE_HBNT | (u8)val);
mdelay(500);
}
}
static void bd71828_remove_poweroff(void *data)
{
pm_power_off = NULL;
}
static int bd71828_i2c_probe(struct i2c_client *i2c) static int bd71828_i2c_probe(struct i2c_client *i2c)
{ {
struct regmap_irq_chip_data *irq_data; struct regmap_irq_chip_data *irq_data;
...@@ -542,7 +563,20 @@ static int bd71828_i2c_probe(struct i2c_client *i2c) ...@@ -542,7 +563,20 @@ static int bd71828_i2c_probe(struct i2c_client *i2c)
ret = devm_mfd_add_devices(&i2c->dev, PLATFORM_DEVID_AUTO, mfd, cells, ret = devm_mfd_add_devices(&i2c->dev, PLATFORM_DEVID_AUTO, mfd, cells,
NULL, 0, regmap_irq_get_domain(irq_data)); NULL, 0, regmap_irq_get_domain(irq_data));
if (ret) if (ret)
dev_err_probe(&i2c->dev, ret, "Failed to create subdevices\n"); return dev_err_probe(&i2c->dev, ret, "Failed to create subdevices\n");
if (of_device_is_system_power_controller(i2c->dev.of_node) &&
chip_type == ROHM_CHIP_TYPE_BD71828) {
if (!pm_power_off) {
bd71828_dev = i2c;
pm_power_off = bd71828_power_off;
ret = devm_add_action_or_reset(&i2c->dev,
bd71828_remove_poweroff,
NULL);
} else {
dev_warn(&i2c->dev, "Poweroff callback already assigned\n");
}
}
return ret; return ret;
} }
......
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
#define RSMU_SABRE_PAGE_ADDR 0x7F #define RSMU_SABRE_PAGE_ADDR 0x7F
#define RSMU_SABRE_PAGE_WINDOW 128 #define RSMU_SABRE_PAGE_WINDOW 128
typedef int (*rsmu_rw_device)(struct rsmu_ddata *rsmu, u8 reg, u8 *buf, u8 bytes);
static const struct regmap_range_cfg rsmu_sabre_range_cfg[] = { static const struct regmap_range_cfg rsmu_sabre_range_cfg[] = {
{ {
.range_min = 0, .range_min = 0,
...@@ -54,7 +56,28 @@ static bool rsmu_sabre_volatile_reg(struct device *dev, unsigned int reg) ...@@ -54,7 +56,28 @@ static bool rsmu_sabre_volatile_reg(struct device *dev, unsigned int reg)
} }
} }
static int rsmu_read_device(struct rsmu_ddata *rsmu, u8 reg, u8 *buf, u16 bytes) static int rsmu_smbus_i2c_write_device(struct rsmu_ddata *rsmu, u8 reg, u8 *buf, u8 bytes)
{
struct i2c_client *client = to_i2c_client(rsmu->dev);
return i2c_smbus_write_i2c_block_data(client, reg, bytes, buf);
}
static int rsmu_smbus_i2c_read_device(struct rsmu_ddata *rsmu, u8 reg, u8 *buf, u8 bytes)
{
struct i2c_client *client = to_i2c_client(rsmu->dev);
int ret;
ret = i2c_smbus_read_i2c_block_data(client, reg, bytes, buf);
if (ret == bytes)
return 0;
else if (ret < 0)
return ret;
else
return -EIO;
}
static int rsmu_i2c_read_device(struct rsmu_ddata *rsmu, u8 reg, u8 *buf, u8 bytes)
{ {
struct i2c_client *client = to_i2c_client(rsmu->dev); struct i2c_client *client = to_i2c_client(rsmu->dev);
struct i2c_msg msg[2]; struct i2c_msg msg[2];
...@@ -84,10 +107,11 @@ static int rsmu_read_device(struct rsmu_ddata *rsmu, u8 reg, u8 *buf, u16 bytes) ...@@ -84,10 +107,11 @@ static int rsmu_read_device(struct rsmu_ddata *rsmu, u8 reg, u8 *buf, u16 bytes)
return 0; return 0;
} }
static int rsmu_write_device(struct rsmu_ddata *rsmu, u8 reg, u8 *buf, u16 bytes) static int rsmu_i2c_write_device(struct rsmu_ddata *rsmu, u8 reg, u8 *buf, u8 bytes)
{ {
struct i2c_client *client = to_i2c_client(rsmu->dev); struct i2c_client *client = to_i2c_client(rsmu->dev);
u8 msg[RSMU_MAX_WRITE_COUNT + 1]; /* 1 Byte added for the device register */ /* we add 1 byte for device register */
u8 msg[RSMU_MAX_WRITE_COUNT + 1];
int cnt; int cnt;
if (bytes > RSMU_MAX_WRITE_COUNT) if (bytes > RSMU_MAX_WRITE_COUNT)
...@@ -107,7 +131,8 @@ static int rsmu_write_device(struct rsmu_ddata *rsmu, u8 reg, u8 *buf, u16 bytes ...@@ -107,7 +131,8 @@ static int rsmu_write_device(struct rsmu_ddata *rsmu, u8 reg, u8 *buf, u16 bytes
return 0; return 0;
} }
static int rsmu_write_page_register(struct rsmu_ddata *rsmu, u32 reg) static int rsmu_write_page_register(struct rsmu_ddata *rsmu, u32 reg,
rsmu_rw_device rsmu_write_device)
{ {
u32 page = reg & RSMU_CM_PAGE_MASK; u32 page = reg & RSMU_CM_PAGE_MASK;
u8 buf[4]; u8 buf[4];
...@@ -136,35 +161,71 @@ static int rsmu_write_page_register(struct rsmu_ddata *rsmu, u32 reg) ...@@ -136,35 +161,71 @@ static int rsmu_write_page_register(struct rsmu_ddata *rsmu, u32 reg)
return err; return err;
} }
static int rsmu_reg_read(void *context, unsigned int reg, unsigned int *val) static int rsmu_i2c_reg_read(void *context, unsigned int reg, unsigned int *val)
{
struct rsmu_ddata *rsmu = i2c_get_clientdata((struct i2c_client *)context);
u8 addr = (u8)(reg & RSMU_CM_ADDRESS_MASK);
int err;
err = rsmu_write_page_register(rsmu, reg, rsmu_i2c_write_device);
if (err)
return err;
err = rsmu_i2c_read_device(rsmu, addr, (u8 *)val, 1);
if (err)
dev_err(rsmu->dev, "Failed to read offset address 0x%x\n", addr);
return err;
}
static int rsmu_i2c_reg_write(void *context, unsigned int reg, unsigned int val)
{ {
struct rsmu_ddata *rsmu = i2c_get_clientdata((struct i2c_client *)context); struct rsmu_ddata *rsmu = i2c_get_clientdata((struct i2c_client *)context);
u8 addr = (u8)(reg & RSMU_CM_ADDRESS_MASK); u8 addr = (u8)(reg & RSMU_CM_ADDRESS_MASK);
u8 data = (u8)val;
int err; int err;
err = rsmu_write_page_register(rsmu, reg); err = rsmu_write_page_register(rsmu, reg, rsmu_i2c_write_device);
if (err) if (err)
return err; return err;
err = rsmu_read_device(rsmu, addr, (u8 *)val, 1); err = rsmu_i2c_write_device(rsmu, addr, &data, 1);
if (err)
dev_err(rsmu->dev,
"Failed to write offset address 0x%x\n", addr);
return err;
}
static int rsmu_smbus_i2c_reg_read(void *context, unsigned int reg, unsigned int *val)
{
struct rsmu_ddata *rsmu = i2c_get_clientdata((struct i2c_client *)context);
u8 addr = (u8)(reg & RSMU_CM_ADDRESS_MASK);
int err;
err = rsmu_write_page_register(rsmu, reg, rsmu_smbus_i2c_write_device);
if (err)
return err;
err = rsmu_smbus_i2c_read_device(rsmu, addr, (u8 *)val, 1);
if (err) if (err)
dev_err(rsmu->dev, "Failed to read offset address 0x%x\n", addr); dev_err(rsmu->dev, "Failed to read offset address 0x%x\n", addr);
return err; return err;
} }
static int rsmu_reg_write(void *context, unsigned int reg, unsigned int val) static int rsmu_smbus_i2c_reg_write(void *context, unsigned int reg, unsigned int val)
{ {
struct rsmu_ddata *rsmu = i2c_get_clientdata((struct i2c_client *)context); struct rsmu_ddata *rsmu = i2c_get_clientdata((struct i2c_client *)context);
u8 addr = (u8)(reg & RSMU_CM_ADDRESS_MASK); u8 addr = (u8)(reg & RSMU_CM_ADDRESS_MASK);
u8 data = (u8)val; u8 data = (u8)val;
int err; int err;
err = rsmu_write_page_register(rsmu, reg); err = rsmu_write_page_register(rsmu, reg, rsmu_smbus_i2c_write_device);
if (err) if (err)
return err; return err;
err = rsmu_write_device(rsmu, addr, &data, 1); err = rsmu_smbus_i2c_write_device(rsmu, addr, &data, 1);
if (err) if (err)
dev_err(rsmu->dev, dev_err(rsmu->dev,
"Failed to write offset address 0x%x\n", addr); "Failed to write offset address 0x%x\n", addr);
...@@ -172,12 +233,21 @@ static int rsmu_reg_write(void *context, unsigned int reg, unsigned int val) ...@@ -172,12 +233,21 @@ static int rsmu_reg_write(void *context, unsigned int reg, unsigned int val)
return err; return err;
} }
static const struct regmap_config rsmu_cm_regmap_config = { static const struct regmap_config rsmu_i2c_cm_regmap_config = {
.reg_bits = 32, .reg_bits = 32,
.val_bits = 8, .val_bits = 8,
.max_register = 0x20120000, .max_register = 0x20120000,
.reg_read = rsmu_reg_read, .reg_read = rsmu_i2c_reg_read,
.reg_write = rsmu_reg_write, .reg_write = rsmu_i2c_reg_write,
.cache_type = REGCACHE_NONE,
};
static const struct regmap_config rsmu_smbus_i2c_cm_regmap_config = {
.reg_bits = 32,
.val_bits = 8,
.max_register = 0x20120000,
.reg_read = rsmu_smbus_i2c_reg_read,
.reg_write = rsmu_smbus_i2c_reg_write,
.cache_type = REGCACHE_NONE, .cache_type = REGCACHE_NONE,
}; };
...@@ -219,7 +289,15 @@ static int rsmu_i2c_probe(struct i2c_client *client) ...@@ -219,7 +289,15 @@ static int rsmu_i2c_probe(struct i2c_client *client)
switch (rsmu->type) { switch (rsmu->type) {
case RSMU_CM: case RSMU_CM:
cfg = &rsmu_cm_regmap_config; if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
cfg = &rsmu_i2c_cm_regmap_config;
} else if (i2c_check_functionality(client->adapter,
I2C_FUNC_SMBUS_I2C_BLOCK)) {
cfg = &rsmu_smbus_i2c_cm_regmap_config;
} else {
dev_err(rsmu->dev, "Unsupported i2c adapter\n");
return -ENOTSUPP;
}
break; break;
case RSMU_SABRE: case RSMU_SABRE:
cfg = &rsmu_sabre_regmap_config; cfg = &rsmu_sabre_regmap_config;
...@@ -236,6 +314,7 @@ static int rsmu_i2c_probe(struct i2c_client *client) ...@@ -236,6 +314,7 @@ static int rsmu_i2c_probe(struct i2c_client *client)
rsmu->regmap = devm_regmap_init(&client->dev, NULL, client, cfg); rsmu->regmap = devm_regmap_init(&client->dev, NULL, client, cfg);
else else
rsmu->regmap = devm_regmap_init_i2c(client, cfg); rsmu->regmap = devm_regmap_init_i2c(client, cfg);
if (IS_ERR(rsmu->regmap)) { if (IS_ERR(rsmu->regmap)) {
ret = PTR_ERR(rsmu->regmap); ret = PTR_ERR(rsmu->regmap);
dev_err(rsmu->dev, "Failed to allocate register map: %d\n", ret); dev_err(rsmu->dev, "Failed to allocate register map: %d\n", ret);
......
...@@ -106,10 +106,10 @@ static int rsmu_write_page_register(struct rsmu_ddata *rsmu, u32 reg) ...@@ -106,10 +106,10 @@ static int rsmu_write_page_register(struct rsmu_ddata *rsmu, u32 reg)
return 0; return 0;
page_reg = RSMU_CM_PAGE_ADDR; page_reg = RSMU_CM_PAGE_ADDR;
page = reg & RSMU_PAGE_MASK; page = reg & RSMU_PAGE_MASK;
buf[0] = (u8)(page & 0xff); buf[0] = (u8)(page & 0xFF);
buf[1] = (u8)((page >> 8) & 0xff); buf[1] = (u8)((page >> 8) & 0xFF);
buf[2] = (u8)((page >> 16) & 0xff); buf[2] = (u8)((page >> 16) & 0xFF);
buf[3] = (u8)((page >> 24) & 0xff); buf[3] = (u8)((page >> 24) & 0xFF);
bytes = 4; bytes = 4;
break; break;
case RSMU_SABRE: case RSMU_SABRE:
......
...@@ -64,7 +64,6 @@ enum ssbi_controller_type { ...@@ -64,7 +64,6 @@ enum ssbi_controller_type {
}; };
struct ssbi { struct ssbi {
struct device *slave;
void __iomem *base; void __iomem *base;
spinlock_t lock; spinlock_t lock;
enum ssbi_controller_type controller_type; enum ssbi_controller_type controller_type;
......
...@@ -765,7 +765,6 @@ static int timb_probe(struct pci_dev *dev, ...@@ -765,7 +765,6 @@ static int timb_probe(struct pci_dev *dev,
default: default:
dev_err(&dev->dev, "Unknown IP setup: %d.%d.%d\n", dev_err(&dev->dev, "Unknown IP setup: %d.%d.%d\n",
priv->fw.major, priv->fw.minor, ip_setup); priv->fw.major, priv->fw.minor, ip_setup);
err = -ENODEV;
goto err_mfd; goto err_mfd;
} }
......
This diff is collapsed.
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
/* /*
* I2C access driver for TI TPS6594/TPS6593/LP8764 PMICs * I2C access driver for TI TPS65224/TPS6594/TPS6593/LP8764 PMICs
* *
* Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/ * Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/
*/ */
...@@ -183,11 +183,11 @@ static int tps6594_i2c_write(void *context, const void *data, size_t count) ...@@ -183,11 +183,11 @@ static int tps6594_i2c_write(void *context, const void *data, size_t count)
return ret; return ret;
} }
static const struct regmap_config tps6594_i2c_regmap_config = { static struct regmap_config tps6594_i2c_regmap_config = {
.reg_bits = 16, .reg_bits = 16,
.val_bits = 8, .val_bits = 8,
.max_register = TPS6594_REG_DWD_FAIL_CNT_REG, .max_register = TPS6594_REG_DWD_FAIL_CNT_REG,
.volatile_reg = tps6594_is_volatile_reg, .volatile_table = &tps6594_volatile_table,
.read = tps6594_i2c_read, .read = tps6594_i2c_read,
.write = tps6594_i2c_write, .write = tps6594_i2c_write,
}; };
...@@ -196,6 +196,7 @@ static const struct of_device_id tps6594_i2c_of_match_table[] = { ...@@ -196,6 +196,7 @@ static const struct of_device_id tps6594_i2c_of_match_table[] = {
{ .compatible = "ti,tps6594-q1", .data = (void *)TPS6594, }, { .compatible = "ti,tps6594-q1", .data = (void *)TPS6594, },
{ .compatible = "ti,tps6593-q1", .data = (void *)TPS6593, }, { .compatible = "ti,tps6593-q1", .data = (void *)TPS6593, },
{ .compatible = "ti,lp8764-q1", .data = (void *)LP8764, }, { .compatible = "ti,lp8764-q1", .data = (void *)LP8764, },
{ .compatible = "ti,tps65224-q1", .data = (void *)TPS65224, },
{} {}
}; };
MODULE_DEVICE_TABLE(of, tps6594_i2c_of_match_table); MODULE_DEVICE_TABLE(of, tps6594_i2c_of_match_table);
...@@ -216,15 +217,18 @@ static int tps6594_i2c_probe(struct i2c_client *client) ...@@ -216,15 +217,18 @@ static int tps6594_i2c_probe(struct i2c_client *client)
tps->reg = client->addr; tps->reg = client->addr;
tps->irq = client->irq; tps->irq = client->irq;
tps->regmap = devm_regmap_init(dev, NULL, client, &tps6594_i2c_regmap_config);
if (IS_ERR(tps->regmap))
return dev_err_probe(dev, PTR_ERR(tps->regmap), "Failed to init regmap\n");
match = of_match_device(tps6594_i2c_of_match_table, dev); match = of_match_device(tps6594_i2c_of_match_table, dev);
if (!match) if (!match)
return dev_err_probe(dev, -EINVAL, "Failed to find matching chip ID\n"); return dev_err_probe(dev, -EINVAL, "Failed to find matching chip ID\n");
tps->chip_id = (unsigned long)match->data; tps->chip_id = (unsigned long)match->data;
if (tps->chip_id == TPS65224)
tps6594_i2c_regmap_config.volatile_table = &tps65224_volatile_table;
tps->regmap = devm_regmap_init(dev, NULL, client, &tps6594_i2c_regmap_config);
if (IS_ERR(tps->regmap))
return dev_err_probe(dev, PTR_ERR(tps->regmap), "Failed to init regmap\n");
crc8_populate_msb(tps6594_i2c_crc_table, TPS6594_CRC8_POLYNOMIAL); crc8_populate_msb(tps6594_i2c_crc_table, TPS6594_CRC8_POLYNOMIAL);
return tps6594_device_init(tps, enable_crc); return tps6594_device_init(tps, enable_crc);
...@@ -240,5 +244,5 @@ static struct i2c_driver tps6594_i2c_driver = { ...@@ -240,5 +244,5 @@ static struct i2c_driver tps6594_i2c_driver = {
module_i2c_driver(tps6594_i2c_driver); module_i2c_driver(tps6594_i2c_driver);
MODULE_AUTHOR("Julien Panis <jpanis@baylibre.com>"); MODULE_AUTHOR("Julien Panis <jpanis@baylibre.com>");
MODULE_DESCRIPTION("TPS6594 I2C Interface Driver"); MODULE_DESCRIPTION("I2C Interface Driver for TPS65224, TPS6594/3, and LP8764");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
/* /*
* SPI access driver for TI TPS6594/TPS6593/LP8764 PMICs * SPI access driver for TI TPS65224/TPS6594/TPS6593/LP8764 PMICs
* *
* Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/ * Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/
*/ */
...@@ -66,11 +66,11 @@ static int tps6594_spi_reg_write(void *context, unsigned int reg, unsigned int v ...@@ -66,11 +66,11 @@ static int tps6594_spi_reg_write(void *context, unsigned int reg, unsigned int v
return spi_write(spi, buf, count); return spi_write(spi, buf, count);
} }
static const struct regmap_config tps6594_spi_regmap_config = { static struct regmap_config tps6594_spi_regmap_config = {
.reg_bits = 16, .reg_bits = 16,
.val_bits = 8, .val_bits = 8,
.max_register = TPS6594_REG_DWD_FAIL_CNT_REG, .max_register = TPS6594_REG_DWD_FAIL_CNT_REG,
.volatile_reg = tps6594_is_volatile_reg, .volatile_table = &tps6594_volatile_table,
.reg_read = tps6594_spi_reg_read, .reg_read = tps6594_spi_reg_read,
.reg_write = tps6594_spi_reg_write, .reg_write = tps6594_spi_reg_write,
.use_single_read = true, .use_single_read = true,
...@@ -81,6 +81,7 @@ static const struct of_device_id tps6594_spi_of_match_table[] = { ...@@ -81,6 +81,7 @@ static const struct of_device_id tps6594_spi_of_match_table[] = {
{ .compatible = "ti,tps6594-q1", .data = (void *)TPS6594, }, { .compatible = "ti,tps6594-q1", .data = (void *)TPS6594, },
{ .compatible = "ti,tps6593-q1", .data = (void *)TPS6593, }, { .compatible = "ti,tps6593-q1", .data = (void *)TPS6593, },
{ .compatible = "ti,lp8764-q1", .data = (void *)LP8764, }, { .compatible = "ti,lp8764-q1", .data = (void *)LP8764, },
{ .compatible = "ti,tps65224-q1", .data = (void *)TPS65224, },
{} {}
}; };
MODULE_DEVICE_TABLE(of, tps6594_spi_of_match_table); MODULE_DEVICE_TABLE(of, tps6594_spi_of_match_table);
...@@ -101,15 +102,18 @@ static int tps6594_spi_probe(struct spi_device *spi) ...@@ -101,15 +102,18 @@ static int tps6594_spi_probe(struct spi_device *spi)
tps->reg = spi_get_chipselect(spi, 0); tps->reg = spi_get_chipselect(spi, 0);
tps->irq = spi->irq; tps->irq = spi->irq;
tps->regmap = devm_regmap_init(dev, NULL, spi, &tps6594_spi_regmap_config);
if (IS_ERR(tps->regmap))
return dev_err_probe(dev, PTR_ERR(tps->regmap), "Failed to init regmap\n");
match = of_match_device(tps6594_spi_of_match_table, dev); match = of_match_device(tps6594_spi_of_match_table, dev);
if (!match) if (!match)
return dev_err_probe(dev, -EINVAL, "Failed to find matching chip ID\n"); return dev_err_probe(dev, -EINVAL, "Failed to find matching chip ID\n");
tps->chip_id = (unsigned long)match->data; tps->chip_id = (unsigned long)match->data;
if (tps->chip_id == TPS65224)
tps6594_spi_regmap_config.volatile_table = &tps65224_volatile_table;
tps->regmap = devm_regmap_init(dev, NULL, spi, &tps6594_spi_regmap_config);
if (IS_ERR(tps->regmap))
return dev_err_probe(dev, PTR_ERR(tps->regmap), "Failed to init regmap\n");
crc8_populate_msb(tps6594_spi_crc_table, TPS6594_CRC8_POLYNOMIAL); crc8_populate_msb(tps6594_spi_crc_table, TPS6594_CRC8_POLYNOMIAL);
return tps6594_device_init(tps, enable_crc); return tps6594_device_init(tps, enable_crc);
...@@ -125,5 +129,5 @@ static struct spi_driver tps6594_spi_driver = { ...@@ -125,5 +129,5 @@ static struct spi_driver tps6594_spi_driver = {
module_spi_driver(tps6594_spi_driver); module_spi_driver(tps6594_spi_driver);
MODULE_AUTHOR("Julien Panis <jpanis@baylibre.com>"); MODULE_AUTHOR("Julien Panis <jpanis@baylibre.com>");
MODULE_DESCRIPTION("TPS6594 SPI Interface Driver"); MODULE_DESCRIPTION("SPI Interface Driver for TPS65224, TPS6594/3, and LP8764");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
/* /*
* PFSM (Pre-configurable Finite State Machine) driver for TI TPS6594/TPS6593/LP8764 PMICs * PFSM (Pre-configurable Finite State Machine) driver for TI TPS65224/TPS6594/TPS6593/LP8764 PMICs
* *
* Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/ * Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/
*/ */
...@@ -39,10 +39,12 @@ ...@@ -39,10 +39,12 @@
* *
* @miscdev: misc device infos * @miscdev: misc device infos
* @regmap: regmap for accessing the device registers * @regmap: regmap for accessing the device registers
* @chip_id: chip identifier of the device
*/ */
struct tps6594_pfsm { struct tps6594_pfsm {
struct miscdevice miscdev; struct miscdevice miscdev;
struct regmap *regmap; struct regmap *regmap;
unsigned long chip_id;
}; };
static ssize_t tps6594_pfsm_read(struct file *f, char __user *buf, static ssize_t tps6594_pfsm_read(struct file *f, char __user *buf,
...@@ -133,21 +135,29 @@ static long tps6594_pfsm_ioctl(struct file *f, unsigned int cmd, unsigned long a ...@@ -133,21 +135,29 @@ static long tps6594_pfsm_ioctl(struct file *f, unsigned int cmd, unsigned long a
struct tps6594_pfsm *pfsm = TPS6594_FILE_TO_PFSM(f); struct tps6594_pfsm *pfsm = TPS6594_FILE_TO_PFSM(f);
struct pmic_state_opt state_opt; struct pmic_state_opt state_opt;
void __user *argp = (void __user *)arg; void __user *argp = (void __user *)arg;
unsigned int regmap_reg, mask;
int ret = -ENOIOCTLCMD; int ret = -ENOIOCTLCMD;
switch (cmd) { switch (cmd) {
case PMIC_GOTO_STANDBY: case PMIC_GOTO_STANDBY:
/* Disable LP mode */ /* Disable LP mode on TPS6594 Family PMIC */
if (pfsm->chip_id != TPS65224) {
ret = regmap_clear_bits(pfsm->regmap, TPS6594_REG_RTC_CTRL_2, ret = regmap_clear_bits(pfsm->regmap, TPS6594_REG_RTC_CTRL_2,
TPS6594_BIT_LP_STANDBY_SEL); TPS6594_BIT_LP_STANDBY_SEL);
if (ret) if (ret)
return ret; return ret;
}
/* Force trigger */ /* Force trigger */
ret = regmap_write_bits(pfsm->regmap, TPS6594_REG_FSM_I2C_TRIGGERS, ret = regmap_write_bits(pfsm->regmap, TPS6594_REG_FSM_I2C_TRIGGERS,
TPS6594_BIT_TRIGGER_I2C(0), TPS6594_BIT_TRIGGER_I2C(0)); TPS6594_BIT_TRIGGER_I2C(0), TPS6594_BIT_TRIGGER_I2C(0));
break; break;
case PMIC_GOTO_LP_STANDBY: case PMIC_GOTO_LP_STANDBY:
/* TPS65224 does not support LP STANDBY */
if (pfsm->chip_id == TPS65224)
return ret;
/* Enable LP mode */ /* Enable LP mode */
ret = regmap_set_bits(pfsm->regmap, TPS6594_REG_RTC_CTRL_2, ret = regmap_set_bits(pfsm->regmap, TPS6594_REG_RTC_CTRL_2,
TPS6594_BIT_LP_STANDBY_SEL); TPS6594_BIT_LP_STANDBY_SEL);
...@@ -169,6 +179,10 @@ static long tps6594_pfsm_ioctl(struct file *f, unsigned int cmd, unsigned long a ...@@ -169,6 +179,10 @@ static long tps6594_pfsm_ioctl(struct file *f, unsigned int cmd, unsigned long a
TPS6594_BIT_NSLEEP1B | TPS6594_BIT_NSLEEP2B); TPS6594_BIT_NSLEEP1B | TPS6594_BIT_NSLEEP2B);
break; break;
case PMIC_SET_MCU_ONLY_STATE: case PMIC_SET_MCU_ONLY_STATE:
/* TPS65224 does not support MCU_ONLY_STATE */
if (pfsm->chip_id == TPS65224)
return ret;
if (copy_from_user(&state_opt, argp, sizeof(state_opt))) if (copy_from_user(&state_opt, argp, sizeof(state_opt)))
return -EFAULT; return -EFAULT;
...@@ -192,14 +206,20 @@ static long tps6594_pfsm_ioctl(struct file *f, unsigned int cmd, unsigned long a ...@@ -192,14 +206,20 @@ static long tps6594_pfsm_ioctl(struct file *f, unsigned int cmd, unsigned long a
return -EFAULT; return -EFAULT;
/* Configure wake-up destination */ /* Configure wake-up destination */
if (pfsm->chip_id == TPS65224) {
regmap_reg = TPS65224_REG_STARTUP_CTRL;
mask = TPS65224_MASK_STARTUP_DEST;
} else {
regmap_reg = TPS6594_REG_RTC_CTRL_2;
mask = TPS6594_MASK_STARTUP_DEST;
}
if (state_opt.mcu_only_startup_dest) if (state_opt.mcu_only_startup_dest)
ret = regmap_write_bits(pfsm->regmap, TPS6594_REG_RTC_CTRL_2, ret = regmap_write_bits(pfsm->regmap, regmap_reg,
TPS6594_MASK_STARTUP_DEST, mask, TPS6594_STARTUP_DEST_MCU_ONLY);
TPS6594_STARTUP_DEST_MCU_ONLY);
else else
ret = regmap_write_bits(pfsm->regmap, TPS6594_REG_RTC_CTRL_2, ret = regmap_write_bits(pfsm->regmap, regmap_reg,
TPS6594_MASK_STARTUP_DEST, mask, TPS6594_STARTUP_DEST_ACTIVE);
TPS6594_STARTUP_DEST_ACTIVE);
if (ret) if (ret)
return ret; return ret;
...@@ -211,7 +231,8 @@ static long tps6594_pfsm_ioctl(struct file *f, unsigned int cmd, unsigned long a ...@@ -211,7 +231,8 @@ static long tps6594_pfsm_ioctl(struct file *f, unsigned int cmd, unsigned long a
/* Modify NSLEEP1-2 bits */ /* Modify NSLEEP1-2 bits */
ret = regmap_clear_bits(pfsm->regmap, TPS6594_REG_FSM_NSLEEP_TRIGGERS, ret = regmap_clear_bits(pfsm->regmap, TPS6594_REG_FSM_NSLEEP_TRIGGERS,
TPS6594_BIT_NSLEEP2B); pfsm->chip_id == TPS65224 ?
TPS6594_BIT_NSLEEP1B : TPS6594_BIT_NSLEEP2B);
break; break;
} }
...@@ -262,6 +283,7 @@ static int tps6594_pfsm_probe(struct platform_device *pdev) ...@@ -262,6 +283,7 @@ static int tps6594_pfsm_probe(struct platform_device *pdev)
tps->chip_id, tps->reg); tps->chip_id, tps->reg);
pfsm->miscdev.fops = &tps6594_pfsm_fops; pfsm->miscdev.fops = &tps6594_pfsm_fops;
pfsm->miscdev.parent = dev->parent; pfsm->miscdev.parent = dev->parent;
pfsm->chip_id = tps->chip_id;
for (i = 0 ; i < pdev->num_resources ; i++) { for (i = 0 ; i < pdev->num_resources ; i++) {
irq = platform_get_irq_byname(pdev, pdev->resource[i].name); irq = platform_get_irq_byname(pdev, pdev->resource[i].name);
......
...@@ -93,6 +93,11 @@ enum rk806_pinmux_option { ...@@ -93,6 +93,11 @@ enum rk806_pinmux_option {
RK806_PINMUX_FUN5, RK806_PINMUX_FUN5,
}; };
enum rk816_pinmux_option {
RK816_PINMUX_THERMISTOR,
RK816_PINMUX_GPIO,
};
enum { enum {
RK805_GPIO0, RK805_GPIO0,
RK805_GPIO1, RK805_GPIO1,
...@@ -104,6 +109,10 @@ enum { ...@@ -104,6 +109,10 @@ enum {
RK806_GPIO_DVS3 RK806_GPIO_DVS3
}; };
enum {
RK816_GPIO0,
};
static const char *const rk805_gpio_groups[] = { static const char *const rk805_gpio_groups[] = {
"gpio0", "gpio0",
"gpio1", "gpio1",
...@@ -115,6 +124,10 @@ static const char *const rk806_gpio_groups[] = { ...@@ -115,6 +124,10 @@ static const char *const rk806_gpio_groups[] = {
"gpio_pwrctrl3", "gpio_pwrctrl3",
}; };
static const char *const rk816_gpio_groups[] = {
"gpio0",
};
/* RK805: 2 output only GPIOs */ /* RK805: 2 output only GPIOs */
static const struct pinctrl_pin_desc rk805_pins_desc[] = { static const struct pinctrl_pin_desc rk805_pins_desc[] = {
PINCTRL_PIN(RK805_GPIO0, "gpio0"), PINCTRL_PIN(RK805_GPIO0, "gpio0"),
...@@ -128,6 +141,11 @@ static const struct pinctrl_pin_desc rk806_pins_desc[] = { ...@@ -128,6 +141,11 @@ static const struct pinctrl_pin_desc rk806_pins_desc[] = {
PINCTRL_PIN(RK806_GPIO_DVS3, "gpio_pwrctrl3"), PINCTRL_PIN(RK806_GPIO_DVS3, "gpio_pwrctrl3"),
}; };
/* RK816 */
static const struct pinctrl_pin_desc rk816_pins_desc[] = {
PINCTRL_PIN(RK816_GPIO0, "gpio0"),
};
static const struct rk805_pin_function rk805_pin_functions[] = { static const struct rk805_pin_function rk805_pin_functions[] = {
{ {
.name = "gpio", .name = "gpio",
...@@ -176,6 +194,21 @@ static const struct rk805_pin_function rk806_pin_functions[] = { ...@@ -176,6 +194,21 @@ static const struct rk805_pin_function rk806_pin_functions[] = {
}, },
}; };
static const struct rk805_pin_function rk816_pin_functions[] = {
{
.name = "gpio",
.groups = rk816_gpio_groups,
.ngroups = ARRAY_SIZE(rk816_gpio_groups),
.mux_option = RK816_PINMUX_GPIO,
},
{
.name = "thermistor",
.groups = rk816_gpio_groups,
.ngroups = ARRAY_SIZE(rk816_gpio_groups),
.mux_option = RK816_PINMUX_THERMISTOR,
},
};
static const struct rk805_pin_group rk805_pin_groups[] = { static const struct rk805_pin_group rk805_pin_groups[] = {
{ {
.name = "gpio0", .name = "gpio0",
...@@ -207,6 +240,14 @@ static const struct rk805_pin_group rk806_pin_groups[] = { ...@@ -207,6 +240,14 @@ static const struct rk805_pin_group rk806_pin_groups[] = {
} }
}; };
static const struct rk805_pin_group rk816_pin_groups[] = {
{
.name = "gpio0",
.pins = { RK816_GPIO0 },
.npins = 1,
},
};
#define RK805_GPIO0_VAL_MSK BIT(0) #define RK805_GPIO0_VAL_MSK BIT(0)
#define RK805_GPIO1_VAL_MSK BIT(1) #define RK805_GPIO1_VAL_MSK BIT(1)
...@@ -255,6 +296,20 @@ static struct rk805_pin_config rk806_gpio_cfgs[] = { ...@@ -255,6 +296,20 @@ static struct rk805_pin_config rk806_gpio_cfgs[] = {
} }
}; };
#define RK816_FUN_MASK BIT(2)
#define RK816_VAL_MASK BIT(3)
#define RK816_DIR_MASK BIT(4)
static struct rk805_pin_config rk816_gpio_cfgs[] = {
{
.fun_reg = RK818_IO_POL_REG,
.fun_msk = RK816_FUN_MASK,
.reg = RK818_IO_POL_REG,
.val_msk = RK816_VAL_MASK,
.dir_msk = RK816_DIR_MASK,
},
};
/* generic gpio chip */ /* generic gpio chip */
static int rk805_gpio_get(struct gpio_chip *chip, unsigned int offset) static int rk805_gpio_get(struct gpio_chip *chip, unsigned int offset)
{ {
...@@ -439,6 +494,8 @@ static int rk805_pinctrl_gpio_request_enable(struct pinctrl_dev *pctldev, ...@@ -439,6 +494,8 @@ static int rk805_pinctrl_gpio_request_enable(struct pinctrl_dev *pctldev,
return _rk805_pinctrl_set_mux(pctldev, offset, RK805_PINMUX_GPIO); return _rk805_pinctrl_set_mux(pctldev, offset, RK805_PINMUX_GPIO);
case RK806_ID: case RK806_ID:
return _rk805_pinctrl_set_mux(pctldev, offset, RK806_PINMUX_FUN5); return _rk805_pinctrl_set_mux(pctldev, offset, RK806_PINMUX_FUN5);
case RK816_ID:
return _rk805_pinctrl_set_mux(pctldev, offset, RK816_PINMUX_GPIO);
} }
return -ENOTSUPP; return -ENOTSUPP;
...@@ -588,6 +645,18 @@ static int rk805_pinctrl_probe(struct platform_device *pdev) ...@@ -588,6 +645,18 @@ static int rk805_pinctrl_probe(struct platform_device *pdev)
pci->pin_cfg = rk806_gpio_cfgs; pci->pin_cfg = rk806_gpio_cfgs;
pci->gpio_chip.ngpio = ARRAY_SIZE(rk806_gpio_cfgs); pci->gpio_chip.ngpio = ARRAY_SIZE(rk806_gpio_cfgs);
break; break;
case RK816_ID:
pci->pins = rk816_pins_desc;
pci->num_pins = ARRAY_SIZE(rk816_pins_desc);
pci->functions = rk816_pin_functions;
pci->num_functions = ARRAY_SIZE(rk816_pin_functions);
pci->groups = rk816_pin_groups;
pci->num_pin_groups = ARRAY_SIZE(rk816_pin_groups);
pci->pinctrl_desc.pins = rk816_pins_desc;
pci->pinctrl_desc.npins = ARRAY_SIZE(rk816_pins_desc);
pci->pin_cfg = rk816_gpio_cfgs;
pci->gpio_chip.ngpio = ARRAY_SIZE(rk816_gpio_cfgs);
break;
default: default:
dev_err(&pdev->dev, "unsupported RK805 ID %lu\n", dev_err(&pdev->dev, "unsupported RK805 ID %lu\n",
pci->rk808->variant); pci->rk808->variant);
......
This diff is collapsed.
...@@ -1571,13 +1571,15 @@ config REGULATOR_TPS6594 ...@@ -1571,13 +1571,15 @@ config REGULATOR_TPS6594
depends on MFD_TPS6594 && OF depends on MFD_TPS6594 && OF
default MFD_TPS6594 default MFD_TPS6594
help help
This driver supports TPS6594 voltage regulator chips. This driver supports TPS6594 series and TPS65224 voltage regulator chips.
TPS6594 series of PMICs have 5 BUCKs and 4 LDOs TPS6594 series of PMICs have 5 BUCKs and 4 LDOs
voltage regulators. voltage regulators.
BUCKs 1,2,3,4 can be used in single phase or multiphase mode. BUCKs 1,2,3,4 can be used in single phase or multiphase mode.
Part number defines which single or multiphase mode is i used. Part number defines which single or multiphase mode is i used.
It supports software based voltage control It supports software based voltage control
for different voltage domains. for different voltage domains.
TPS65224 PMIC has 4 BUCKs and 3 LDOs. BUCK12 can be used in dual phase.
All BUCKs and LDOs volatge can be controlled through software.
config REGULATOR_TPS6524X config REGULATOR_TPS6524X
tristate "TI TPS6524X Power regulators" tristate "TI TPS6524X Power regulators"
......
...@@ -158,6 +158,11 @@ ...@@ -158,6 +158,11 @@
RK8XX_DESC_COM(_id, _match, _supply, _min, _max, _step, _vreg, \ RK8XX_DESC_COM(_id, _match, _supply, _min, _max, _step, _vreg, \
_vmask, _ereg, _emask, 0, 0, _etime, &rk808_reg_ops) _vmask, _ereg, _emask, 0, 0, _etime, &rk808_reg_ops)
#define RK816_DESC(_id, _match, _supply, _min, _max, _step, _vreg, \
_vmask, _ereg, _emask, _disval, _etime) \
RK8XX_DESC_COM(_id, _match, _supply, _min, _max, _step, _vreg, \
_vmask, _ereg, _emask, _emask, _disval, _etime, &rk816_reg_ops)
#define RK817_DESC(_id, _match, _supply, _min, _max, _step, _vreg, \ #define RK817_DESC(_id, _match, _supply, _min, _max, _step, _vreg, \
_vmask, _ereg, _emask, _disval, _etime) \ _vmask, _ereg, _emask, _disval, _etime) \
RK8XX_DESC_COM(_id, _match, _supply, _min, _max, _step, _vreg, \ RK8XX_DESC_COM(_id, _match, _supply, _min, _max, _step, _vreg, \
...@@ -258,7 +263,7 @@ static const unsigned int rk808_buck1_2_ramp_table[] = { ...@@ -258,7 +263,7 @@ static const unsigned int rk808_buck1_2_ramp_table[] = {
2000, 4000, 6000, 10000 2000, 4000, 6000, 10000
}; };
/* RK817 RK809 */ /* RK817/RK809/RK816 (buck 1/2 only) */
static const unsigned int rk817_buck1_4_ramp_table[] = { static const unsigned int rk817_buck1_4_ramp_table[] = {
3000, 6300, 12500, 25000 3000, 6300, 12500, 25000
}; };
...@@ -534,15 +539,25 @@ static int rk808_set_suspend_voltage_range(struct regulator_dev *rdev, int uv) ...@@ -534,15 +539,25 @@ static int rk808_set_suspend_voltage_range(struct regulator_dev *rdev, int uv)
{ {
unsigned int reg; unsigned int reg;
int sel = regulator_map_voltage_linear_range(rdev, uv, uv); int sel = regulator_map_voltage_linear_range(rdev, uv, uv);
int ret;
if (sel < 0) if (sel < 0)
return -EINVAL; return -EINVAL;
reg = rdev->desc->vsel_reg + RK808_SLP_REG_OFFSET; reg = rdev->desc->vsel_reg + RK808_SLP_REG_OFFSET;
return regmap_update_bits(rdev->regmap, reg, ret = regmap_update_bits(rdev->regmap, reg,
rdev->desc->vsel_mask, rdev->desc->vsel_mask,
sel); sel);
if (ret)
return ret;
if (rdev->desc->apply_bit)
ret = regmap_update_bits(rdev->regmap, rdev->desc->apply_reg,
rdev->desc->apply_bit,
rdev->desc->apply_bit);
return ret;
} }
static int rk805_set_suspend_enable(struct regulator_dev *rdev) static int rk805_set_suspend_enable(struct regulator_dev *rdev)
...@@ -630,6 +645,38 @@ static int rk808_set_suspend_disable(struct regulator_dev *rdev) ...@@ -630,6 +645,38 @@ static int rk808_set_suspend_disable(struct regulator_dev *rdev)
rdev->desc->enable_mask); rdev->desc->enable_mask);
} }
static const struct rk8xx_register_bit rk816_suspend_bits[] = {
RK8XX_REG_BIT(RK818_SLEEP_SET_OFF_REG1, 0),
RK8XX_REG_BIT(RK818_SLEEP_SET_OFF_REG1, 1),
RK8XX_REG_BIT(RK818_SLEEP_SET_OFF_REG1, 2),
RK8XX_REG_BIT(RK818_SLEEP_SET_OFF_REG1, 3),
RK8XX_REG_BIT(RK818_SLEEP_SET_OFF_REG2, 0),
RK8XX_REG_BIT(RK818_SLEEP_SET_OFF_REG2, 1),
RK8XX_REG_BIT(RK818_SLEEP_SET_OFF_REG2, 2),
RK8XX_REG_BIT(RK818_SLEEP_SET_OFF_REG2, 3),
RK8XX_REG_BIT(RK818_SLEEP_SET_OFF_REG2, 4),
RK8XX_REG_BIT(RK818_SLEEP_SET_OFF_REG2, 5),
RK8XX_REG_BIT(RK818_SLEEP_SET_OFF_REG1, 5),
RK8XX_REG_BIT(RK818_SLEEP_SET_OFF_REG1, 6),
};
static int rk816_set_suspend_enable(struct regulator_dev *rdev)
{
int rid = rdev_get_id(rdev);
return regmap_update_bits(rdev->regmap, rk816_suspend_bits[rid].reg,
rk816_suspend_bits[rid].bit,
rk816_suspend_bits[rid].bit);
}
static int rk816_set_suspend_disable(struct regulator_dev *rdev)
{
int rid = rdev_get_id(rdev);
return regmap_update_bits(rdev->regmap, rk816_suspend_bits[rid].reg,
rk816_suspend_bits[rid].bit, 0);
}
static int rk817_set_suspend_enable_ctrl(struct regulator_dev *rdev, static int rk817_set_suspend_enable_ctrl(struct regulator_dev *rdev,
unsigned int en) unsigned int en)
{ {
...@@ -903,6 +950,54 @@ static const struct regulator_ops rk809_buck5_ops_range = { ...@@ -903,6 +950,54 @@ static const struct regulator_ops rk809_buck5_ops_range = {
.set_suspend_disable = rk817_set_suspend_disable, .set_suspend_disable = rk817_set_suspend_disable,
}; };
static const struct regulator_ops rk816_buck1_2_ops_ranges = {
.list_voltage = regulator_list_voltage_linear_range,
.map_voltage = regulator_map_voltage_linear_range,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
.set_voltage_sel = regulator_set_voltage_sel_regmap,
.set_voltage_time_sel = regulator_set_voltage_time_sel,
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap,
.set_mode = rk8xx_set_mode,
.get_mode = rk8xx_get_mode,
.set_suspend_mode = rk8xx_set_suspend_mode,
.set_ramp_delay = regulator_set_ramp_delay_regmap,
.set_suspend_voltage = rk808_set_suspend_voltage_range,
.set_suspend_enable = rk816_set_suspend_enable,
.set_suspend_disable = rk816_set_suspend_disable,
};
static const struct regulator_ops rk816_buck4_ops_ranges = {
.list_voltage = regulator_list_voltage_linear_range,
.map_voltage = regulator_map_voltage_linear_range,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
.set_voltage_sel = regulator_set_voltage_sel_regmap,
.set_voltage_time_sel = regulator_set_voltage_time_sel,
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap,
.set_mode = rk8xx_set_mode,
.get_mode = rk8xx_get_mode,
.set_suspend_mode = rk8xx_set_suspend_mode,
.set_suspend_voltage = rk808_set_suspend_voltage_range,
.set_suspend_enable = rk816_set_suspend_enable,
.set_suspend_disable = rk816_set_suspend_disable,
};
static const struct regulator_ops rk816_reg_ops = {
.list_voltage = regulator_list_voltage_linear,
.map_voltage = regulator_map_voltage_linear,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
.set_voltage_sel = regulator_set_voltage_sel_regmap,
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.is_enabled = rk8xx_is_enabled_wmsk_regmap,
.set_suspend_voltage = rk808_set_suspend_voltage,
.set_suspend_enable = rk816_set_suspend_enable,
.set_suspend_disable = rk816_set_suspend_disable,
};
static const struct regulator_ops rk817_reg_ops = { static const struct regulator_ops rk817_reg_ops = {
.list_voltage = regulator_list_voltage_linear, .list_voltage = regulator_list_voltage_linear,
.map_voltage = regulator_map_voltage_linear, .map_voltage = regulator_map_voltage_linear,
...@@ -1382,6 +1477,117 @@ static const struct regulator_desc rk809_reg[] = { ...@@ -1382,6 +1477,117 @@ static const struct regulator_desc rk809_reg[] = {
DISABLE_VAL(3)), DISABLE_VAL(3)),
}; };
static const struct linear_range rk816_buck_4_voltage_ranges[] = {
REGULATOR_LINEAR_RANGE(800000, 0, 26, 100000),
REGULATOR_LINEAR_RANGE(3500000, 27, 31, 0),
};
static const struct regulator_desc rk816_reg[] = {
{
.name = "dcdc1",
.supply_name = "vcc1",
.of_match = of_match_ptr("dcdc1"),
.regulators_node = of_match_ptr("regulators"),
.id = RK816_ID_DCDC1,
.ops = &rk816_buck1_2_ops_ranges,
.type = REGULATOR_VOLTAGE,
.n_voltages = 64,
.linear_ranges = rk805_buck_1_2_voltage_ranges,
.n_linear_ranges = ARRAY_SIZE(rk805_buck_1_2_voltage_ranges),
.vsel_reg = RK818_BUCK1_ON_VSEL_REG,
.vsel_mask = RK818_BUCK_VSEL_MASK,
.apply_reg = RK816_DCDC_EN_REG2,
.apply_bit = RK816_BUCK_DVS_CONFIRM,
.enable_reg = RK816_DCDC_EN_REG1,
.enable_mask = BIT(4) | BIT(0),
.enable_val = BIT(4) | BIT(0),
.disable_val = BIT(4),
.ramp_reg = RK818_BUCK1_CONFIG_REG,
.ramp_mask = RK808_RAMP_RATE_MASK,
.ramp_delay_table = rk817_buck1_4_ramp_table,
.n_ramp_values = ARRAY_SIZE(rk817_buck1_4_ramp_table),
.of_map_mode = rk8xx_regulator_of_map_mode,
.owner = THIS_MODULE,
}, {
.name = "dcdc2",
.supply_name = "vcc2",
.of_match = of_match_ptr("dcdc2"),
.regulators_node = of_match_ptr("regulators"),
.id = RK816_ID_DCDC2,
.ops = &rk816_buck1_2_ops_ranges,
.type = REGULATOR_VOLTAGE,
.n_voltages = 64,
.linear_ranges = rk805_buck_1_2_voltage_ranges,
.n_linear_ranges = ARRAY_SIZE(rk805_buck_1_2_voltage_ranges),
.vsel_reg = RK818_BUCK2_ON_VSEL_REG,
.vsel_mask = RK818_BUCK_VSEL_MASK,
.apply_reg = RK816_DCDC_EN_REG2,
.apply_bit = RK816_BUCK_DVS_CONFIRM,
.enable_reg = RK816_DCDC_EN_REG1,
.enable_mask = BIT(5) | BIT(1),
.enable_val = BIT(5) | BIT(1),
.disable_val = BIT(5),
.ramp_reg = RK818_BUCK2_CONFIG_REG,
.ramp_mask = RK808_RAMP_RATE_MASK,
.ramp_delay_table = rk817_buck1_4_ramp_table,
.n_ramp_values = ARRAY_SIZE(rk817_buck1_4_ramp_table),
.of_map_mode = rk8xx_regulator_of_map_mode,
.owner = THIS_MODULE,
}, {
.name = "dcdc3",
.supply_name = "vcc3",
.of_match = of_match_ptr("dcdc3"),
.regulators_node = of_match_ptr("regulators"),
.id = RK816_ID_DCDC3,
.ops = &rk808_switch_ops,
.type = REGULATOR_VOLTAGE,
.n_voltages = 1,
.enable_reg = RK816_DCDC_EN_REG1,
.enable_mask = BIT(6) | BIT(2),
.enable_val = BIT(6) | BIT(2),
.disable_val = BIT(6),
.of_map_mode = rk8xx_regulator_of_map_mode,
.owner = THIS_MODULE,
}, {
.name = "dcdc4",
.supply_name = "vcc4",
.of_match = of_match_ptr("dcdc4"),
.regulators_node = of_match_ptr("regulators"),
.id = RK816_ID_DCDC4,
.ops = &rk816_buck4_ops_ranges,
.type = REGULATOR_VOLTAGE,
.n_voltages = 32,
.linear_ranges = rk816_buck_4_voltage_ranges,
.n_linear_ranges = ARRAY_SIZE(rk816_buck_4_voltage_ranges),
.vsel_reg = RK818_BUCK4_ON_VSEL_REG,
.vsel_mask = RK818_BUCK4_VSEL_MASK,
.enable_reg = RK816_DCDC_EN_REG1,
.enable_mask = BIT(7) | BIT(3),
.enable_val = BIT(7) | BIT(3),
.disable_val = BIT(7),
.of_map_mode = rk8xx_regulator_of_map_mode,
.owner = THIS_MODULE,
},
RK816_DESC(RK816_ID_LDO1, "ldo1", "vcc5", 800, 3400, 100,
RK818_LDO1_ON_VSEL_REG, RK818_LDO_VSEL_MASK,
RK816_LDO_EN_REG1, ENABLE_MASK(0), DISABLE_VAL(0), 400),
RK816_DESC(RK816_ID_LDO2, "ldo2", "vcc5", 800, 3400, 100,
RK818_LDO2_ON_VSEL_REG, RK818_LDO_VSEL_MASK,
RK816_LDO_EN_REG1, ENABLE_MASK(1), DISABLE_VAL(1), 400),
RK816_DESC(RK816_ID_LDO3, "ldo3", "vcc5", 800, 3400, 100,
RK818_LDO3_ON_VSEL_REG, RK818_LDO_VSEL_MASK,
RK816_LDO_EN_REG1, ENABLE_MASK(2), DISABLE_VAL(2), 400),
RK816_DESC(RK816_ID_LDO4, "ldo4", "vcc6", 800, 3400, 100,
RK818_LDO4_ON_VSEL_REG, RK818_LDO_VSEL_MASK,
RK816_LDO_EN_REG1, ENABLE_MASK(3), DISABLE_VAL(3), 400),
RK816_DESC(RK816_ID_LDO5, "ldo5", "vcc6", 800, 3400, 100,
RK818_LDO5_ON_VSEL_REG, RK818_LDO_VSEL_MASK,
RK816_LDO_EN_REG2, ENABLE_MASK(0), DISABLE_VAL(0), 400),
RK816_DESC(RK816_ID_LDO6, "ldo6", "vcc6", 800, 3400, 100,
RK818_LDO6_ON_VSEL_REG, RK818_LDO_VSEL_MASK,
RK816_LDO_EN_REG2, ENABLE_MASK(1), DISABLE_VAL(1), 400),
};
static const struct regulator_desc rk817_reg[] = { static const struct regulator_desc rk817_reg[] = {
{ {
.name = "DCDC_REG1", .name = "DCDC_REG1",
...@@ -1704,6 +1910,10 @@ static int rk808_regulator_probe(struct platform_device *pdev) ...@@ -1704,6 +1910,10 @@ static int rk808_regulator_probe(struct platform_device *pdev)
regulators = rk809_reg; regulators = rk809_reg;
nregulators = RK809_NUM_REGULATORS; nregulators = RK809_NUM_REGULATORS;
break; break;
case RK816_ID:
regulators = rk816_reg;
nregulators = ARRAY_SIZE(rk816_reg);
break;
case RK817_ID: case RK817_ID:
regulators = rk817_reg; regulators = rk817_reg;
nregulators = RK817_NUM_REGULATORS; nregulators = RK817_NUM_REGULATORS;
......
This diff is collapsed.
...@@ -205,6 +205,7 @@ struct m10bmc_csr_map { ...@@ -205,6 +205,7 @@ struct m10bmc_csr_map {
unsigned int pr_reh_addr; unsigned int pr_reh_addr;
unsigned int pr_magic; unsigned int pr_magic;
unsigned int rsu_update_counter; unsigned int rsu_update_counter;
unsigned int staging_size;
}; };
/** /**
......
...@@ -113,6 +113,148 @@ enum rk808_reg { ...@@ -113,6 +113,148 @@ enum rk808_reg {
#define RK808_INT_STS_MSK_REG2 0x4f #define RK808_INT_STS_MSK_REG2 0x4f
#define RK808_IO_POL_REG 0x50 #define RK808_IO_POL_REG 0x50
/* RK816 */
enum rk816_reg {
RK816_ID_DCDC1,
RK816_ID_DCDC2,
RK816_ID_DCDC3,
RK816_ID_DCDC4,
RK816_ID_LDO1,
RK816_ID_LDO2,
RK816_ID_LDO3,
RK816_ID_LDO4,
RK816_ID_LDO5,
RK816_ID_LDO6,
RK816_ID_BOOST,
RK816_ID_OTG_SW,
};
enum rk816_irqs {
/* INT_STS_REG1 */
RK816_IRQ_PWRON_FALL,
RK816_IRQ_PWRON_RISE,
/* INT_STS_REG2 */
RK816_IRQ_VB_LOW,
RK816_IRQ_PWRON,
RK816_IRQ_PWRON_LP,
RK816_IRQ_HOTDIE,
RK816_IRQ_RTC_ALARM,
RK816_IRQ_RTC_PERIOD,
RK816_IRQ_USB_OV,
/* INT_STS_REG3 */
RK816_IRQ_PLUG_IN,
RK816_IRQ_PLUG_OUT,
RK816_IRQ_CHG_OK,
RK816_IRQ_CHG_TE,
RK816_IRQ_CHG_TS,
RK816_IRQ_CHG_CVTLIM,
RK816_IRQ_DISCHG_ILIM,
};
/* power channel registers */
#define RK816_DCDC_EN_REG1 0x23
#define RK816_DCDC_EN_REG2 0x24
#define RK816_BOOST_EN BIT(1)
#define RK816_OTG_EN BIT(2)
#define RK816_BOOST_EN_MSK BIT(5)
#define RK816_OTG_EN_MSK BIT(6)
#define RK816_BUCK_DVS_CONFIRM BIT(7)
#define RK816_LDO_EN_REG1 0x27
#define RK816_LDO_EN_REG2 0x28
/* interrupt registers and irq definitions */
#define RK816_INT_STS_REG1 0x49
#define RK816_INT_STS_MSK_REG1 0x4a
#define RK816_INT_STS_PWRON_FALL BIT(5)
#define RK816_INT_STS_PWRON_RISE BIT(6)
#define RK816_INT_STS_REG2 0x4c
#define RK816_INT_STS_MSK_REG2 0x4d
#define RK816_INT_STS_VB_LOW BIT(1)
#define RK816_INT_STS_PWRON BIT(2)
#define RK816_INT_STS_PWRON_LP BIT(3)
#define RK816_INT_STS_HOTDIE BIT(4)
#define RK816_INT_STS_RTC_ALARM BIT(5)
#define RK816_INT_STS_RTC_PERIOD BIT(6)
#define RK816_INT_STS_USB_OV BIT(7)
#define RK816_INT_STS_REG3 0x4e
#define RK816_INT_STS_MSK_REG3 0x4f
#define RK816_INT_STS_PLUG_IN BIT(0)
#define RK816_INT_STS_PLUG_OUT BIT(1)
#define RK816_INT_STS_CHG_OK BIT(2)
#define RK816_INT_STS_CHG_TE BIT(3)
#define RK816_INT_STS_CHG_TS BIT(4)
#define RK816_INT_STS_CHG_CVTLIM BIT(6)
#define RK816_INT_STS_DISCHG_ILIM BIT(7)
#define RK816_IRQ_STS_OFFSET(x) ((x) - RK816_INT_STS_REG1)
#define RK816_IRQ_MSK_OFFSET(x) ((x) - RK816_INT_STS_MSK_REG1)
/* charger, boost and OTG registers */
#define RK816_OTG_BUCK_LDO_CONFIG_REG 0x2a
#define RK816_CHRG_CONFIG_REG 0x2b
#define RK816_BOOST_ON_VESL_REG 0x54
#define RK816_BOOST_SLP_VSEL_REG 0x55
#define RK816_CHRG_BOOST_CONFIG_REG 0x9a
#define RK816_SUP_STS_REG 0xa0
#define RK816_USB_CTRL_REG 0xa1
#define RK816_CHRG_CTRL(x) (0xa3 + (x))
#define RK816_BAT_CTRL_REG 0xa6
#define RK816_BAT_HTS_TS_REG 0xa8
#define RK816_BAT_LTS_TS_REG 0xa9
/* adc and fuel gauge registers */
#define RK816_TS_CTRL_REG 0xac
#define RK816_ADC_CTRL_REG 0xad
#define RK816_GGCON_REG 0xb0
#define RK816_GGSTS_REG 0xb1
#define RK816_ZERO_CUR_ADC_REGH 0xb2
#define RK816_ZERO_CUR_ADC_REGL 0xb3
#define RK816_GASCNT_CAL_REG(x) (0xb7 - (x))
#define RK816_GASCNT_REG(x) (0xbb - (x))
#define RK816_BAT_CUR_AVG_REGH 0xbc
#define RK816_BAT_CUR_AVG_REGL 0xbd
#define RK816_TS_ADC_REGH 0xbe
#define RK816_TS_ADC_REGL 0xbf
#define RK816_USB_ADC_REGH 0xc0
#define RK816_USB_ADC_REGL 0xc1
#define RK816_BAT_OCV_REGH 0xc2
#define RK816_BAT_OCV_REGL 0xc3
#define RK816_BAT_VOL_REGH 0xc4
#define RK816_BAT_VOL_REGL 0xc5
#define RK816_RELAX_ENTRY_THRES_REGH 0xc6
#define RK816_RELAX_ENTRY_THRES_REGL 0xc7
#define RK816_RELAX_EXIT_THRES_REGH 0xc8
#define RK816_RELAX_EXIT_THRES_REGL 0xc9
#define RK816_RELAX_VOL1_REGH 0xca
#define RK816_RELAX_VOL1_REGL 0xcb
#define RK816_RELAX_VOL2_REGH 0xcc
#define RK816_RELAX_VOL2_REGL 0xcd
#define RK816_RELAX_CUR1_REGH 0xce
#define RK816_RELAX_CUR1_REGL 0xcf
#define RK816_RELAX_CUR2_REGH 0xd0
#define RK816_RELAX_CUR2_REGL 0xd1
#define RK816_CAL_OFFSET_REGH 0xd2
#define RK816_CAL_OFFSET_REGL 0xd3
#define RK816_NON_ACT_TIMER_CNT_REG 0xd4
#define RK816_VCALIB0_REGH 0xd5
#define RK816_VCALIB0_REGL 0xd6
#define RK816_VCALIB1_REGH 0xd7
#define RK816_VCALIB1_REGL 0xd8
#define RK816_FCC_GASCNT_REG(x) (0xdc - (x))
#define RK816_IOFFSET_REGH 0xdd
#define RK816_IOFFSET_REGL 0xde
#define RK816_SLEEP_CON_SAMP_CUR_REG 0xdf
/* general purpose data registers 0xe0 ~ 0xf2 */
#define RK816_DATA_REG(x) (0xe0 + (x))
/* RK818 */ /* RK818 */
#define RK818_DCDC1 0 #define RK818_DCDC1 0
#define RK818_LDO1 4 #define RK818_LDO1 4
...@@ -791,6 +933,7 @@ enum rk806_dvs_mode { ...@@ -791,6 +933,7 @@ enum rk806_dvs_mode {
#define VOUT_LO_INT BIT(0) #define VOUT_LO_INT BIT(0)
#define CLK32KOUT2_EN BIT(0) #define CLK32KOUT2_EN BIT(0)
#define TEMP105C 0x08
#define TEMP115C 0x0c #define TEMP115C 0x0c
#define TEMP_HOTDIE_MSK 0x0c #define TEMP_HOTDIE_MSK 0x0c
#define SLP_SD_MSK (0x3 << 2) #define SLP_SD_MSK (0x3 << 2)
...@@ -1191,6 +1334,7 @@ enum { ...@@ -1191,6 +1334,7 @@ enum {
RK806_ID = 0x8060, RK806_ID = 0x8060,
RK808_ID = 0x0000, RK808_ID = 0x0000,
RK809_ID = 0x8090, RK809_ID = 0x8090,
RK816_ID = 0x8160,
RK817_ID = 0x8170, RK817_ID = 0x8170,
RK818_ID = 0x8180, RK818_ID = 0x8180,
}; };
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#ifndef __LINUX_MFD_BD71828_H__ #ifndef __LINUX_MFD_BD71828_H__
#define __LINUX_MFD_BD71828_H__ #define __LINUX_MFD_BD71828_H__
#include <linux/bits.h>
#include <linux/mfd/rohm-generic.h> #include <linux/mfd/rohm-generic.h>
#include <linux/mfd/rohm-shared.h> #include <linux/mfd/rohm-shared.h>
...@@ -41,7 +42,8 @@ enum { ...@@ -41,7 +42,8 @@ enum {
#define BD71828_REG_PS_CTRL_2 0x05 #define BD71828_REG_PS_CTRL_2 0x05
#define BD71828_REG_PS_CTRL_3 0x06 #define BD71828_REG_PS_CTRL_3 0x06
//#define BD71828_REG_SWRESET 0x06 #define BD71828_MASK_STATE_HBNT BIT(1)
#define BD71828_MASK_RUN_LVL_CTRL 0x30 #define BD71828_MASK_RUN_LVL_CTRL 0x30
/* Regulator control masks */ /* Regulator control masks */
...@@ -133,7 +135,6 @@ enum { ...@@ -133,7 +135,6 @@ enum {
#define BD71828_REG_LDO5_VOLT 0x43 #define BD71828_REG_LDO5_VOLT 0x43
#define BD71828_REG_LDO5_VOLT_OPT 0x42 #define BD71828_REG_LDO5_VOLT_OPT 0x42
#define BD71828_REG_LDO6_EN 0x44 #define BD71828_REG_LDO6_EN 0x44
//#define BD71828_REG_LDO6_VOLT 0x4
#define BD71828_REG_LDO7_EN 0x45 #define BD71828_REG_LDO7_EN 0x45
#define BD71828_REG_LDO7_VOLT 0x46 #define BD71828_REG_LDO7_VOLT 0x46
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment