Add RK801 PMIC support
Subsystems (4)
cover Add RK801 PMIC support
This patch series adds support for the Rockchip RK801 Power Management Integrated Circuit (PMIC) to the Linux kernel.
The RK801 is a PMIC designed for multimedia and handheld devices. It includes:
- 4 BUCK regulators (DCDC)
- 2 LDO regulators
- 1 SWITCH regulator
- Interrupt support for power key events
The implementation follows the existing rk808 MFD driver architecture and integrates RK801 as a new variant in the RK8XX family.
Patch 1 adds the device tree binding documentation for RK801, describing the compatible string, regulators configuration, and example usage.
Patch 2 adds the rk801 driver support.
Joseph Chen (2):
dt-bindings: mfd: Add rk801 binding
mfd: rk808: Add RK801 support
.../bindings/mfd/rockchip,rk801.yaml | 199 ++++++++++++++ drivers/mfd/Kconfig | 6 +- drivers/mfd/rk8xx-core.c | 81 ++++++ drivers/mfd/rk8xx-i2c.c | 33 ++- drivers/regulator/rk808-regulator.c | 243 ++++++++++++++++++ include/linux/mfd/rk808.h | 118 +++++++++ 6 files changed, 676 insertions(+), 4 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/rockchip,rk801.yaml
Signature · 1 line
2.25.1
PATCH 1/2 dt-bindings: mfd: Add rk801 binding
Add DT binding document for Rockchip's RK801 PMIC
--- .../bindings/mfd/rockchip,rk801.yaml | 199 ++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/rockchip,rk801.yaml
Documentation/devicetree/bindings/mfd/rockchip,rk801.yaml new file +199 -0
@@ -0,0 +1,199 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/rockchip,rk801.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: RK801 Power Management Integrated Circuit + +maintainers: + - Joseph Chen <[email protected]> + +description: | + Rockchip RK801 series PMIC. This device consists of an i2c controlled MFD + that includes multiple switchable regulators. + +properties: + compatible: + enum: + - rockchip,rk801 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + rockchip,system-power-controller: + type: boolean + description: + Telling whether or not this PMIC is controlling the system power. + + system-power-controller: true + + wakeup-source: + type: boolean + description: + Device can be used as a wakeup source. + + vcc1-supply: + description: + The input supply for DCDC_REG1. + + vcc2-supply: + description: + The input supply for DCDC_REG2. + + vcc3-supply: + description: + The input supply for DCDC_REG3. + + vcc4-supply: + description: + The input supply for DCDC_REG4. + + vcc5-supply: + description: + The input supply for LDO_REG1. + + vcc6-supply: + description: + The input supply for LDO_REG2. + + vcc7-supply: + description: + The input supply for SWITCH_REG. + + regulators: + type: object + patternProperties: + "^(DCDC_REG[1-4]|LDO_REG[1-2]|SWITCH_REG)$": + type: object + $ref: /schemas/regulator/regulator.yaml# + unevaluatedProperties: false + unevaluatedProperties: false + +required: + - compatible + - reg + - interrupts + +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>; + + rk801: rk801@27 { + compatible = "rockchip,rk801"; + reg = <0x27>; + interrupt-parent = <&gpio0>; + interrupts = <RK_PC0 IRQ_TYPE_LEVEL_LOW>; + pwrctrl-gpios = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&pmic_int_l>; + rockchip,system-power-controller; + wakeup-source; + + vcc1-supply = <&vcc12v_dcin>; + vcc2-supply = <&vcc12v_dcin>; + vcc3-supply = <&vcc5v0_sys>; + vcc4-supply = <&vcc5v0_sys>; + vcc5-supply = <&vcc3v3_sys>; + vcc6-supply = <&vcc3v3_sys>; + vcc7-supply = <&vcc3v3_sys>; + + regulators { + vdd_cpu: DCDC_REG1 { + regulator-name = "vdd_cpu"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <1500000>; + regulator-initial-mode = <0x1>; + regulator-boot-on; + regulator-always-on; + regulator-state-mem { + regulator-mode = <0x2>; + regulator-off-in-suspend; + regulator-suspend-microvolt = <950000>; + }; + }; + + vcc3v3_sys: DCDC_REG2 { + regulator-name = "vcc3v3_sys"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-initial-mode = <0x1>; + regulator-boot-on; + regulator-always-on; + regulator-state-mem { + regulator-mode = <0x2>; + regulator-on-in-suspend; + regulator-suspend-microvolt = <3300000>; + }; + }; + + vcc_ddr: DCDC_REG3 { + regulator-name = "vcc_ddr"; + regulator-boot-on; + regulator-always-on; + regulator-state-mem { + regulator-mode = <0x2>; + regulator-on-in-suspend; + }; + }; + + vdd_logic: DCDC_REG4 { + regulator-name = "vdd_logic"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <1500000>; + regulator-initial-mode = <0x1>; + regulator-boot-on; + regulator-always-on; + regulator-state-mem { + regulator-mode = <0x2>; + regulator-off-in-suspend; + regulator-suspend-microvolt = <900000>; + }; + }; + + vdd0v9_sys: LDO_REG1 { + regulator-name = "vdd0v9_sys"; + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <900000>; + regulator-boot-on; + regulator-always-on; + regulator-state-mem { + regulator-off-in-suspend; + regulator-suspend-microvolt = <900000>; + }; + }; + + vcc_1v8: LDO_REG2 { + regulator-name = "vcc_1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + regulator-always-on; + regulator-state-mem { + regulator-off-in-suspend; + regulator-suspend-microvolt = <1800000>; + }; + }; + + vcc_3v3: SWITCH_REG { + regulator-name = "vcc_3v3"; + regulator-boot-on; + regulator-always-on; + regulator-state-mem { + regulator-off-in-suspend; + regulator-suspend-microvolt = <3300000>; + }; + }; + }; + }; + };
Signature · 7 lines
2.25.1 _______________________________________________ Linux-rockchip mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-rockchip
Re: [PATCH v1 1/2] dt-bindings: mfd: Add rk801 binding
Quoted 4 lines · Joseph Chen
Add DT binding document for Rockchip's RK801 PMIC
Signed-off-by Joseph Chen <[email protected]>---
1. Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC. It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.
Tools like b4 or scripts/get_maintainer.pl provide you proper list of people, so fix your workflow. Tools might also fail if you work on some ancient tree (don't, instead use mainline) or work on fork of kernel (don't, instead use mainline). Just use b4 and everything should be fine, although remember about b4 prep --auto-to-cc if you added new patches to the patchset.
You missed at least devicetree list (maybe more), so this won't be tested by automated tooling. Performing review on untested code might be a waste of time.
Please kindly resend and include all necessary To/Cc entries.
2. Node names should be generic. See also an explanation and list of examples (not exhaustive) in DT specification:
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
If you cannot find a name matching your device, please check in kernel sources for similar cases or you can grow the spec (via pull request to DT spec repo).
3. Underscore is not allowed in node names. Neither capital letters. Please read DTS coding style.
Best regards,
Krzysztof
Re: [PATCH v1 1/2] dt-bindings: mfd: Add rk801 binding
Quoted 32 lines · Krzysztof Kozlowski
Quoted 4 lines · Joseph Chen
Add DT binding document for Rockchip's RK801 PMIC
Signed-off-by Joseph Chen <[email protected]>---
1. Please use
scripts/get_maintainers.plto get a list of necessary people and lists to CC. It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.Tools like b4 or
scripts/get_maintainer.plprovide you proper list of people, so fix your workflow. Tools might also fail if you work on some ancient tree (don't, instead use mainline) or work on fork of kernel (don't, instead use mainline). Just use b4 and everything should be fine, although remember aboutb4 prep --auto-to-ccif you added new patches to the patchset.You missed at least devicetree list (maybe more), so this won't be tested by automated tooling. Performing review on untested code might be a waste of time.
Please kindly resend and include all necessary To/Cc entries.
2. Node names should be generic. See also an explanation and list of examples (not exhaustive) in DT specification:
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
If you cannot find a name matching your device, please check in kernel sources for similar cases or you can grow the spec (via pull request to DT spec repo).
Quoted 6 lines
3. Underscore is not allowed in node names. Neither capital letters. Please read DTS coding style.
Best regards,
Krzysztof
Thanks for the review and advice . I will fix all these problems in v2.
Signature · 2 lines
Best regards, Joseph Chen
Re: [PATCH v1 1/2] dt-bindings: mfd: Add rk801 binding
In reply to Joseph ChenQuoted 36 lines · Joseph Chen
Add DT binding document for Rockchip's RK801 PMIC
Signed-off-by Joseph Chen <[email protected]>--- .../bindings/mfd/rockchip,rk801.yaml | 199 ++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/rockchip,rk801.yamlDocumentation/devicetree/bindings/mfd/rockchip,rk801.yaml new file +22
-0@@ -0,0 +1,199 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/rockchip,rk801.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: RK801 Power Management Integrated Circuit + +maintainers: + - Joseph Chen <[email protected]> + +description: | + Rockchip RK801 series PMIC. This device consists of an i2c controlled MFD + that includes multiple switchable regulators. + +properties: + compatible: + enum: + - rockchip,rk801 + + reg: + maxItems: 1
Documentation/devicetree/bindings/mfd/rockchip,rk801.yaml line 32
Quoted 10 lines
Documentation/devicetree/bindings/mfd/rockchip,rk801.yaml new file +10
-0+ + interrupts: + maxItems: 1 + + rockchip,system-power-controller: + type: boolean + description: + Telling whether or not this PMIC is controlling the system power. + + system-power-controller: true
Why add 'rockchip,system-power-controller' while also adding 'system-power-controller'?
Property 'rockchip,system-power-controller' was deprecated in commit 961748bb1555 ("dt-bindings: mfd: rk8xx: Deprecate rockchip,system-power-controller")
And because of that I submitted this patch/commit:b99ac7e2a1cc ("arm64: dts: rockchip: Drop rockchip prefix of s-p-c PMIC prop from rk356x") to replace the deprecated variant with the non-deprecated one.
Cheers,
Diederik
Quoted 167 lines
Documentation/devicetree/bindings/mfd/rockchip,rk801.yaml new file +167
-0+ + wakeup-source: + type: boolean + description: + Device can be used as a wakeup source. + + vcc1-supply: + description: + The input supply for DCDC_REG1. + + vcc2-supply: + description: + The input supply for DCDC_REG2. + + vcc3-supply: + description: + The input supply for DCDC_REG3. + + vcc4-supply: + description: + The input supply for DCDC_REG4. + + vcc5-supply: + description: + The input supply for LDO_REG1. + + vcc6-supply: + description: + The input supply for LDO_REG2. + + vcc7-supply: + description: + The input supply for SWITCH_REG. + + regulators: + type: object + patternProperties: + "^(DCDC_REG[1-4]|LDO_REG[1-2]|SWITCH_REG)$": + type: object + $ref: /schemas/regulator/regulator.yaml# + unevaluatedProperties: false + unevaluatedProperties: false + +required: + - compatible + - reg + - interrupts + +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>; + + rk801: rk801@27 { + compatible = "rockchip,rk801"; + reg = <0x27>; + interrupt-parent = <&gpio0>; + interrupts = <RK_PC0 IRQ_TYPE_LEVEL_LOW>; + pwrctrl-gpios = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&pmic_int_l>; + rockchip,system-power-controller; + wakeup-source; + + vcc1-supply = <&vcc12v_dcin>; + vcc2-supply = <&vcc12v_dcin>; + vcc3-supply = <&vcc5v0_sys>; + vcc4-supply = <&vcc5v0_sys>; + vcc5-supply = <&vcc3v3_sys>; + vcc6-supply = <&vcc3v3_sys>; + vcc7-supply = <&vcc3v3_sys>; + + regulators { + vdd_cpu: DCDC_REG1 { + regulator-name = "vdd_cpu"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <1500000>; + regulator-initial-mode = <0x1>; + regulator-boot-on; + regulator-always-on; + regulator-state-mem { + regulator-mode = <0x2>; + regulator-off-in-suspend; + regulator-suspend-microvolt = <950000>; + }; + }; + + vcc3v3_sys: DCDC_REG2 { + regulator-name = "vcc3v3_sys"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-initial-mode = <0x1>; + regulator-boot-on; + regulator-always-on; + regulator-state-mem { + regulator-mode = <0x2>; + regulator-on-in-suspend; + regulator-suspend-microvolt = <3300000>; + }; + }; + + vcc_ddr: DCDC_REG3 { + regulator-name = "vcc_ddr"; + regulator-boot-on; + regulator-always-on; + regulator-state-mem { + regulator-mode = <0x2>; + regulator-on-in-suspend; + }; + }; + + vdd_logic: DCDC_REG4 { + regulator-name = "vdd_logic"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <1500000>; + regulator-initial-mode = <0x1>; + regulator-boot-on; + regulator-always-on; + regulator-state-mem { + regulator-mode = <0x2>; + regulator-off-in-suspend; + regulator-suspend-microvolt = <900000>; + }; + }; + + vdd0v9_sys: LDO_REG1 { + regulator-name = "vdd0v9_sys"; + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <900000>; + regulator-boot-on; + regulator-always-on; + regulator-state-mem { + regulator-off-in-suspend; + regulator-suspend-microvolt = <900000>; + }; + }; + + vcc_1v8: LDO_REG2 { + regulator-name = "vcc_1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + regulator-always-on; + regulator-state-mem { + regulator-off-in-suspend; + regulator-suspend-microvolt = <1800000>; + }; + }; + + vcc_3v3: SWITCH_REG { + regulator-name = "vcc_3v3"; + regulator-boot-on; + regulator-always-on; + regulator-state-mem { + regulator-off-in-suspend; + regulator-suspend-microvolt = <3300000>; + }; + }; + }; + }; + };
Re: [PATCH v1 1/2] dt-bindings: mfd: Add rk801 binding
Quoted 53 lines · Diederik de Haas
Quoted 36 lines · Joseph Chen
Add DT binding document for Rockchip's RK801 PMIC
Signed-off-by Joseph Chen <[email protected]>--- .../bindings/mfd/rockchip,rk801.yaml | 199 ++++++++++++++++++ 1 file changed, 199 insertions(+)create mode 100644
Documentation/devicetree/bindings/mfd/rockchip,rk801.yamlDocumentation/devicetree/bindings/mfd/rockchip,rk801.yaml new file +22
-0@@ -0,0 +1,199 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/rockchip,rk801.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: RK801 Power Management Integrated Circuit + +maintainers: + - Joseph Chen <[email protected]> + +description: | + Rockchip RK801 series PMIC. This device consists of an i2c controlled MFD + that includes multiple switchable regulators. + +properties: + compatible: + enum: + - rockchip,rk801 + + reg: + maxItems: 1Documentation/devicetree/bindings/mfd/rockchip,rk801.yaml line 32
Quoted 10 lines
Documentation/devicetree/bindings/mfd/rockchip,rk801.yaml new file +10
-0+ + interrupts: + maxItems: 1 + + rockchip,system-power-controller: + type: boolean + description: + Telling whether or not this PMIC is controlling the system power. + + system-power-controller: trueWhy add 'rockchip,system-power-controller' while also adding 'system-power-controller'?
Property 'rockchip,system-power-controller' was deprecated in commit
961748bb1555("dt-bindings: mfd: rk8xx: Deprecate rockchip,system-power-controller")
Quoted 6 lines
And because of that I submitted this patch/commit:
b99ac7e2a1cc("arm64: dts: rockchip: Drop rockchip prefix of s-p-c PMIC prop from rk356x") to replace the deprecated variant with the non-deprecated one.Cheers,
Diederik
Thanks for the review. I will drop this property in v2.
Quoted 169 lines
Quoted 167 lines
Documentation/devicetree/bindings/mfd/rockchip,rk801.yaml new file +167
-0+ + wakeup-source: + type: boolean + description: + Device can be used as a wakeup source. + + vcc1-supply: + description: + The input supply for DCDC_REG1. + + vcc2-supply: + description: + The input supply for DCDC_REG2. + + vcc3-supply: + description: + The input supply for DCDC_REG3. + + vcc4-supply: + description: + The input supply for DCDC_REG4. + + vcc5-supply: + description: + The input supply for LDO_REG1. + + vcc6-supply: + description: + The input supply for LDO_REG2. + + vcc7-supply: + description: + The input supply for SWITCH_REG. + + regulators: + type: object + patternProperties: + "^(DCDC_REG[1-4]|LDO_REG[1-2]|SWITCH_REG)$": + type: object + $ref: /schemas/regulator/regulator.yaml# + unevaluatedProperties: false + unevaluatedProperties: false + +required: + - compatible + - reg + - interrupts + +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>; + + rk801: rk801@27 { + compatible = "rockchip,rk801"; + reg = <0x27>; + interrupt-parent = <&gpio0>; + interrupts = <RK_PC0 IRQ_TYPE_LEVEL_LOW>; + pwrctrl-gpios = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&pmic_int_l>; + rockchip,system-power-controller; + wakeup-source; + + vcc1-supply = <&vcc12v_dcin>; + vcc2-supply = <&vcc12v_dcin>; + vcc3-supply = <&vcc5v0_sys>; + vcc4-supply = <&vcc5v0_sys>; + vcc5-supply = <&vcc3v3_sys>; + vcc6-supply = <&vcc3v3_sys>; + vcc7-supply = <&vcc3v3_sys>; + + regulators { + vdd_cpu: DCDC_REG1 { + regulator-name = "vdd_cpu"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <1500000>; + regulator-initial-mode = <0x1>; + regulator-boot-on; + regulator-always-on; + regulator-state-mem { + regulator-mode = <0x2>; + regulator-off-in-suspend; + regulator-suspend-microvolt = <950000>; + }; + }; + + vcc3v3_sys: DCDC_REG2 { + regulator-name = "vcc3v3_sys"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-initial-mode = <0x1>; + regulator-boot-on; + regulator-always-on; + regulator-state-mem { + regulator-mode = <0x2>; + regulator-on-in-suspend; + regulator-suspend-microvolt = <3300000>; + }; + }; + + vcc_ddr: DCDC_REG3 { + regulator-name = "vcc_ddr"; + regulator-boot-on; + regulator-always-on; + regulator-state-mem { + regulator-mode = <0x2>; + regulator-on-in-suspend; + }; + }; + + vdd_logic: DCDC_REG4 { + regulator-name = "vdd_logic"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <1500000>; + regulator-initial-mode = <0x1>; + regulator-boot-on; + regulator-always-on; + regulator-state-mem { + regulator-mode = <0x2>; + regulator-off-in-suspend; + regulator-suspend-microvolt = <900000>; + }; + }; + + vdd0v9_sys: LDO_REG1 { + regulator-name = "vdd0v9_sys"; + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <900000>; + regulator-boot-on; + regulator-always-on; + regulator-state-mem { + regulator-off-in-suspend; + regulator-suspend-microvolt = <900000>; + }; + }; + + vcc_1v8: LDO_REG2 { + regulator-name = "vcc_1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + regulator-always-on; + regulator-state-mem { + regulator-off-in-suspend; + regulator-suspend-microvolt = <1800000>; + }; + }; + + vcc_3v3: SWITCH_REG { + regulator-name = "vcc_3v3"; + regulator-boot-on; + regulator-always-on; + regulator-state-mem { + regulator-off-in-suspend; + regulator-suspend-microvolt = <3300000>; + }; + }; + }; + }; + };
Signature · 2 lines
Best regards, Joseph Chen
PATCH 2/2 mfd: rk808: Add RK801 support
In reply to Joseph ChenThe RK801 are a Power Management IC (PMIC) for multimedia and handheld devices. They contains the following components:
- 4 BUCK
- 2 LDO
- 1 SWITCH
--- drivers/mfd/Kconfig | 6 +- drivers/mfd/rk8xx-core.c | 81 ++++++++++ drivers/mfd/rk8xx-i2c.c | 33 +++- drivers/regulator/rk808-regulator.c | 243 ++++++++++++++++++++++++++++ include/linux/mfd/rk808.h | 118 ++++++++++++++ 5 files changed, 477 insertions(+), 4 deletions(-)
drivers/mfd/Kconfig +3 -3
@@ -1355,15 +1355,15 @@ config MFD_RK8XX select MFD_CORE config MFD_RK8XX_I2C - tristate "Rockchip RK805/RK808/RK809/RK816/RK817/RK818 Power Management Chip" + tristate "Rockchip RK801/RK805/RK808/RK809/RK816/RK817/RK818 Power Management Chip" depends on I2C && OF select MFD_CORE select REGMAP_I2C select REGMAP_IRQ select MFD_RK8XX help - If you say yes here you get support for the RK805, RK808, RK809, - RK816, RK817 and RK818 Power Management chips. + If you say yes here you get support for the RK801, RK805, RK808, + RK809, RK816, RK817 and RK818 Power Management chips. This driver provides common support for accessing the device through I2C interface. The device supports multiple sub-devices including interrupts, RTC, LDO & DCDC regulators, and onkey.
drivers/mfd/rk8xx-core.c +81 -0
129 lines not on this page · raw message
drivers/mfd/rk8xx-i2c.c +32 -1
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0-only /* -* Rockchip RK805/RK808/RK816/RK817/RK818 Core (I2C) driver +* Rockchip RK801/RK805/RK808/RK816/RK817/RK818 Core (I2C) driver * * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd * Copyright (C) 2016 PHYTEC Messtechnik GmbH
@@ -21,6 +21,23 @@ struct rk8xx_i2c_platform_data {int variant; }; +static bool rk801_is_volatile_reg (struct device *dev,unsigned int reg) +{ +switch (reg) { +case RK801_SYS_STS_REG : +case RK801_INT_STS0_REG : +case RK801_SYS_CFG0_REG : +case RK801_SYS_CFG1_REG : +case RK801_SYS_CFG2_REG : +case RK801_SYS_CFG3_REG : +case RK801_SYS_CFG4_REG : +case RK801_SLEEP_CFG_REG : +return true; + } + +return false; +} +static bool rk806_is_volatile_reg (struct device *dev,unsigned int reg) {switch (reg) {
@@ -124,6 +141,14 @@ static const struct regmap_config rk818_regmap_config = { .volatile_reg = rk808_is_volatile_reg, }; +static const struct regmap_config rk801_regmap_config = { + .reg_bits =8 , + .val_bits =8 , + .max_register =RK801_SYS_CFG3_OTP_REG , + .cache_type =REGCACHE_RBTREE , + .volatile_reg = rk801_is_volatile_reg, +}; +static const struct regmap_config rk805_regmap_config = { .reg_bits =8 , .val_bits =8 ,
@@ -164,6 +189,11 @@ static const struct regmap_config rk817_regmap_config = { .volatile_reg = rk817_is_volatile_reg, }; +static const struct rk8xx_i2c_platform_data rk801_data = { + .regmap_cfg = &rk801_regmap_config, + .variant =RK801_ID , +}; +static const struct rk8xx_i2c_platform_data rk805_data = { .regmap_cfg = &rk805_regmap_config, .variant =RK805_ID ,
@@ -224,6 +254,7 @@ static void rk8xx_i2c_shutdown(struct i2c_client *client) static SIMPLE_DEV_PM_OPS(rk8xx_i2c_pm_ops, rk8xx_suspend, rk8xx_resume);static const struct of_device_id rk8xx_i2c_of_match[] = { + { .compatible ="rockchip,rk801" , .data = &rk801_data }, { .compatible ="rockchip,rk805" , .data = &rk805_data }, { .compatible ="rockchip,rk806" , .data = &rk806_data }, { .compatible ="rockchip,rk808" , .data = &rk808_data },
drivers/regulator/rk808-regulator.c +243 -0
279 lines not on this page · raw message
include/linux/mfd/rk808.h +118 -0
130 lines not on this page · raw message
Signature · 7 lines
2.25.1 _______________________________________________ Linux-rockchip mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-rockchip
Lee Jones
maintainerRe: [PATCH v1 2/2] mfd: rk808: Add RK801 support
Quoted 7 lines · Joseph Chen
The RK801 are a Power Management IC (PMIC) for multimedia and handheld devices. They contains the following components:
- 4 BUCK
- 2 LDO
- 1 SWITCH
Quoted 8 lines
Signed-off-by Joseph Chen <[email protected]>--- drivers/mfd/Kconfig | 6 +- drivers/mfd/rk8xx-core.c | 81 ++++++++++ drivers/mfd/rk8xx-i2c.c | 33 +++- drivers/regulator/rk808-regulator.c | 243 ++++++++++++++++++++++++++++ include/linux/mfd/rk808.h | 118 ++++++++++++++ 5 files changed, 477 insertions(+), 4 deletions(-)
Please separate out the MFD and Regulator parts into their own patches.
Signature · 1 line
Lee Jones [李琼斯]