Add RK801 PMIC support
Subsystems (4)
v3 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 MFD core support for RK801, including device detection and register definitions.
Patch 3 adds the regulator driver support for RK801, implementing the 4 BUCK regulators, 2 LDO regulators, and 1 SWITCH regulator.
Changes in v3:
- Fix patch split issue: MFD patch incorrectly removed the entire drivers/regulator/rk808-regulator.c file in v2
- Kconfig description: use "Rockchip RK8xx Power Management Chips" instead of listing all individual chips (suggested by Heiko)
Changes in v2:
- Include all necessary To/Cc entries
- Rename pmic/regulator names from uppercase to lowercase(dcdc[1-4]|ldo[1-2]|switch) to align with DT coding style
- Drop 'rockchip,system-power-controller'
- Remove unused 'pwrctrl-gpios' from DT binding example
- Split regulator support into a separate patch (was part of mfd patch in v1)
Joseph Chen (3):
dt-bindings: mfd: Add rk801 binding
mfd: rk8xx: Add RK801 support
regulator: rk808: Add RK801 support
.../bindings/mfd/rockchip,rk801.yaml | 197 ++++++++++++++ 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, 674 insertions(+), 4 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/rockchip,rk801.yaml
--
2.25.1
PATCH v3 1/3 dt-bindings: mfd: Add rk801 binding
Add DT binding document for Rockchip's RK801 PMIC
--- .../bindings/mfd/rockchip,rk801.yaml | 197 ++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/rockchip,rk801.yaml
Documentation/devicetree/bindings/mfd/rockchip,rk801.yaml new file +197 -0
@@ -0,0 +1,197 @@ +# 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 + + system-power-controller: + type: boolean + description: + Telling whether or not this PMIC is controlling the system power. + + wakeup-source: + type: boolean + description: + Device can be used as a wakeup source. + + 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. + + vcc6-supply: + description: + The input supply for ldo2. + + vcc7-supply: + description: + The input supply for switch. + + regulators: + type: object + patternProperties: + "^(dcdc[1-4]|ldo[1-2]|switch)$": + type: object + $ref: /schemas/regulator/regulator.yaml# + unevaluatedProperties: false + additionalProperties: 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: pmic@27 { + compatible = "rockchip,rk801"; + reg = <0x27>; + interrupt-parent = <&gpio0>; + interrupts = <RK_PC0 IRQ_TYPE_LEVEL_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&pmic_int_l>; + system-power-controller; + wakeup-source; + + vcc1-supply = <&vcc_sys>; + vcc2-supply = <&vcc_sys>; + vcc3-supply = <&vcc_sys>; + vcc4-supply = <&vcc_sys>; + vcc5-supply = <&vcc3v3_sys>; + vcc6-supply = <&vcc3v3_sys>; + vcc7-supply = <&vcc3v3_sys>; + + regulators { + vdd_cpu: dcdc1 { + 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: dcdc2 { + 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: dcdc3 { + regulator-name = "vcc_ddr"; + regulator-boot-on; + regulator-always-on; + regulator-state-mem { + regulator-mode = <0x2>; + regulator-on-in-suspend; + }; + }; + + vdd_logic: dcdc4 { + 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: ldo1 { + 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: ldo2 { + 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 { + regulator-name = "vcc_3v3"; + regulator-boot-on; + regulator-always-on; + regulator-state-mem { + regulator-off-in-suspend; + regulator-suspend-microvolt = <3300000>; + }; + }; + }; + }; + };
Signature · 1 line
2.25.1
Re: [PATCH v3 1/3] dt-bindings: mfd: Add rk801 binding
Quoted 7 lines · Joseph Chen
Add DT binding document for Rockchip's RK801 PMIC
Signed-off-by Joseph Chen <[email protected]>--- .../bindings/mfd/rockchip,rk801.yaml | 197 ++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/rockchip,rk801.yaml
Best regards,
Krzysztof
PATCH v3 2/3 mfd: rk8xx: Add RK801 support
In reply to Joseph ChenThe RK801 is a Power Management IC (PMIC) for multimedia and handheld devices. It 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 ++++++++++- include/linux/mfd/rk808.h | 118 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 234 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 RK8xx Power Management Chips" 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 },
include/linux/mfd/rk808.h +118 -0
130 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v3 3/3 regulator: rk808: Add RK801 support
In reply to Joseph ChenAdd support for rk801 to the existing rk808 regulator driver. It provides 4 BUCK, 2 LDO and 1 SWITCH.
--- drivers/regulator/rk808-regulator.c | 243 ++++++++++++++++++++++++++++ 1 file changed, 243 insertions(+)
drivers/regulator/rk808-regulator.c +243 -0
@@ -24,6 +24,9 @@#include <linux/gpio/consumer.h> /* Field definitions */ +#define RK801_BUCK_VSEL_MASK 0x7f +#define RK801_LDO_VSEL_MASK 0x3f +#define RK808_BUCK_VSEL_MASK 0x3f#define RK808_BUCK4_VSEL_MASK 0xf#define RK808_LDO_VSEL_MASK 0x1f
@@ -158,6 +161,11 @@RK8XX_DESC_COM (_id, _match, _supply, _min, _max, _step, _vreg, \ _vmask, _ereg, _emask, 0, 0, _etime, &rk808_reg_ops) +#define RK801_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, &rk801_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, \
@@ -185,6 +193,11 @@ .ops = _ops \ } +#define RK801_DESC_SWITCH (_id, _match, _supply, _ereg, _emask, \ + _disval) \ + RKXX_DESC_SWITCH_COM(_id, _match, _supply, _ereg, _emask, \ + _emask, _disval, &rk801_switch_ops) +#define RK817_DESC_SWITCH (_id, _match, _supply, _ereg, _emask, \ _disval) \ RKXX_DESC_SWITCH_COM(_id, _match, _supply, _ereg, _emask, \
@@ -802,6 +815,115 @@ static unsigned int rk8xx_regulator_of_map_mode(unsigned int mode) } } +static unsigned int rk801_get_mode (struct regulator_dev *rdev) +{ +unsigned int val; +int err; + + err =regmap_read (rdev->regmap,RK801_POWER_FPWM_EN_REG , &val); +if (err) +return err; + +if (val &BIT (rdev->desc->id)) +return REGULATOR_MODE_FAST ; +else +return REGULATOR_MODE_NORMAL ; +} + +static int rk801_set_mode (struct regulator_dev *rdev,unsigned int mode) +{ +unsigned int offset = rdev->desc->id; + +switch (mode) { +case REGULATOR_MODE_FAST : +return regmap_update_bits (rdev->regmap,RK801_POWER_FPWM_EN_REG , +BIT (offset),RK801_FPWM_MODE << offset); +case REGULATOR_MODE_NORMAL : +return regmap_update_bits (rdev->regmap,RK801_POWER_FPWM_EN_REG , +BIT (offset),RK801_AUTO_PWM_MODE << offset); +default : +dev_err (&rdev->dev,"do not support this mode\n" ); +return -EINVAL ; + } + +return 0 ; +} + +static int rk801_set_suspend_voltage (struct regulator_dev *rdev,int uv) +{ +unsigned int reg; +int sel; + +if (rdev->desc->id <RK801_ID_LDO1 ) + sel =regulator_map_voltage_linear_range (rdev, uv, uv); +else + sel =regulator_map_voltage_linear (rdev, uv, uv); +if (sel <0 ) +return -EINVAL ; + + reg = rdev->desc->vsel_reg +RK801_SLP_REG_OFFSET ; + +return regmap_update_bits (rdev->regmap, reg, + rdev->desc->vsel_mask, sel); +} + +static int rk801_set_suspend_enable (struct regulator_dev *rdev) +{ +return regmap_update_bits (rdev->regmap,RK801_POWER_SLP_EN_REG , +BIT (rdev->desc->id),BIT (rdev->desc->id)); +} + +static int rk801_set_suspend_disable (struct regulator_dev *rdev) +{ +return regmap_update_bits (rdev->regmap,RK801_POWER_SLP_EN_REG , +BIT (rdev->desc->id),0 ); +} + +static int rk801_set_voltage_time_sel (struct regulator_dev *rdev, +unsigned int old_selector, +unsigned int new_selector) +{ +return regulator_set_voltage_time_sel (rdev, old_selector, + new_selector) +RK801_HW_SYNC_US ; +} + +static const struct regulator_ops rk801_buck_ops = { + .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 = rk801_set_voltage_time_sel, + .enable = regulator_enable_regmap, + .disable = regulator_disable_regmap, + .is_enabled = regulator_is_enabled_regmap, + .set_mode = rk801_set_mode, + .get_mode = rk801_get_mode, + .set_suspend_voltage = rk801_set_suspend_voltage, + .set_suspend_enable = rk801_set_suspend_enable, + .set_suspend_disable = rk801_set_suspend_disable, +}; + +static const struct regulator_ops rk801_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 = regulator_is_enabled_regmap, + .set_suspend_voltage = rk801_set_suspend_voltage, + .set_suspend_enable = rk801_set_suspend_enable, + .set_suspend_disable = rk801_set_suspend_disable, +}; + +static const struct regulator_ops rk801_switch_ops = { + .enable = regulator_enable_regmap, + .disable = regulator_disable_regmap, + .is_enabled = regulator_is_enabled_regmap, + .set_suspend_enable = rk801_set_suspend_enable, + .set_suspend_disable = rk801_set_suspend_disable, +}; +static const struct regulator_ops rk805_reg_ops = { .list_voltage = regulator_list_voltage_linear, .map_voltage = regulator_map_voltage_linear,
@@ -1049,6 +1171,123 @@ static const struct regulator_ops rk817_switch_ops = { .set_suspend_disable = rk817_set_suspend_disable, }; +static const struct linear_range rk801_buck1_voltage_ranges[] = { +REGULATOR_LINEAR_RANGE (500000 ,0 ,80 ,12500 ),/* 0.5v - 1.5v */ +REGULATOR_LINEAR_RANGE (1800000 ,81 ,82 ,400000 ),/* 1.8v - 2.2v */ +REGULATOR_LINEAR_RANGE (3300000 ,83 ,83 ,0 ),/* 3.3v */ +REGULATOR_LINEAR_RANGE (5000000 ,84 ,84 ,0 ),/* 5.0v */ +REGULATOR_LINEAR_RANGE (5250000 ,85 ,85 ,0 ),/* 5.25v */ +}; + +static const struct linear_range rk801_buck2_voltage_ranges[] = { +REGULATOR_LINEAR_RANGE (800000 ,0 ,2 ,50000 ),/* 0.8v - 0.9v */ +REGULATOR_LINEAR_RANGE (1800000 ,3 ,4 ,400000 ),/* 1.8v - 2.2v */ +REGULATOR_LINEAR_RANGE (3300000 ,5 ,5 ,0 ),/* 3.3v */ +REGULATOR_LINEAR_RANGE (5000000 ,6 ,6 ,0 ),/* 5.0v */ +REGULATOR_LINEAR_RANGE (5250000 ,7 ,7 ,0 ),/* 5.25v */ +}; + +static const struct linear_range rk801_buck4_voltage_ranges[] = { +REGULATOR_LINEAR_RANGE (500000 ,0 ,80 ,12500 ),/* 0.5v - 1.5v */ +REGULATOR_LINEAR_RANGE (1800000 ,81 ,82 ,400000 ),/* 1.8v - 2.2v */ +REGULATOR_LINEAR_RANGE (2500000 ,83 ,83 ,0 ),/* 2.5v */ +REGULATOR_LINEAR_RANGE (2800000 ,84 ,84 ,0 ),/* 2.8v */ +REGULATOR_LINEAR_RANGE (3000000 ,85 ,85 ,0 ),/* 3.0v */ +REGULATOR_LINEAR_RANGE (3300000 ,86 ,86 ,0 ),/* 3.3v */ +}; + +static const struct regulator_desc rk801_reg[] = { + { + .name ="dcdc1" , + .supply_name ="vcc1" , + .of_match =of_match_ptr ("dcdc1" ), + .regulators_node =of_match_ptr ("regulators" ), + .id =RK801_ID_DCDC1 , + .ops = &rk801_buck_ops, + .type =REGULATOR_VOLTAGE , + .n_voltages =86 , + .linear_ranges = rk801_buck1_voltage_ranges, + .n_linear_ranges =ARRAY_SIZE (rk801_buck1_voltage_ranges), + .vsel_reg =RK801_BUCK1_ON_VSEL_REG , + .vsel_mask =RK801_BUCK_VSEL_MASK , + .enable_reg =RK801_POWER_EN0_REG , + .enable_mask =ENABLE_MASK (RK801_ID_DCDC1 ), + .enable_val =ENABLE_MASK (RK801_ID_DCDC1 ), + .disable_val =DISABLE_VAL (RK801_ID_DCDC1 ), + .ramp_delay =1000 , + .of_map_mode = rk8xx_regulator_of_map_mode, + .enable_time =400 , + .owner =THIS_MODULE , + }, { + .name ="dcdc2" , + .supply_name ="vcc2" , + .of_match =of_match_ptr ("dcdc2" ), + .regulators_node =of_match_ptr ("regulators" ), + .id =RK801_ID_DCDC2 , + .ops = &rk801_buck_ops, + .type =REGULATOR_VOLTAGE , + .n_voltages =8 , + .linear_ranges = rk801_buck2_voltage_ranges, + .n_linear_ranges =ARRAY_SIZE (rk801_buck2_voltage_ranges), + .vsel_reg =RK801_BUCK2_ON_VSEL_REG , + .vsel_mask =RK801_BUCK_VSEL_MASK , + .enable_reg =RK801_POWER_EN0_REG , + .enable_mask =ENABLE_MASK (RK801_ID_DCDC2 ), + .enable_val =ENABLE_MASK (RK801_ID_DCDC2 ), + .disable_val =DISABLE_VAL (RK801_ID_DCDC2 ), + .ramp_delay =1000 , + .of_map_mode = rk8xx_regulator_of_map_mode, + .enable_time =400 , + .owner =THIS_MODULE , + }, { + .name ="dcdc3" , + .supply_name ="vcc3" , + .of_match =of_match_ptr ("dcdc3" ), + .regulators_node =of_match_ptr ("regulators" ), + .id =RK801_ID_DCDC3 , + .ops = &rk801_switch_ops, + .type =REGULATOR_VOLTAGE , + .n_voltages =1 , + .enable_reg =RK801_POWER_EN0_REG , + .enable_mask =ENABLE_MASK (RK801_ID_DCDC3 ), + .enable_val =ENABLE_MASK (RK801_ID_DCDC3 ), + .disable_val =DISABLE_VAL (RK801_ID_DCDC3 ), + .of_map_mode = rk8xx_regulator_of_map_mode, + .enable_time =400 , + .owner =THIS_MODULE , + }, { + .name ="dcdc4" , + .supply_name ="vcc4" , + .of_match =of_match_ptr ("dcdc4" ), + .regulators_node =of_match_ptr ("regulators" ), + .id =RK801_ID_DCDC4 , + .ops = &rk801_buck_ops, + .type =REGULATOR_VOLTAGE , + .n_voltages =87 , + .linear_ranges = rk801_buck4_voltage_ranges, + .n_linear_ranges =ARRAY_SIZE (rk801_buck4_voltage_ranges), + .vsel_reg =RK801_BUCK4_ON_VSEL_REG , + .vsel_mask =RK801_BUCK_VSEL_MASK , + .enable_reg =RK801_POWER_EN0_REG , + .enable_mask =ENABLE_MASK (RK801_ID_DCDC4 ), + .enable_val =ENABLE_MASK (RK801_ID_DCDC4 ), + .disable_val =DISABLE_VAL (RK801_ID_DCDC4 ), + .ramp_delay =1000 , + .of_map_mode = rk8xx_regulator_of_map_mode, + .enable_time =400 , + .owner =THIS_MODULE , + }, + +RK801_DESC (RK801_ID_LDO1 ,"ldo1" ,"vcc5" ,500 ,3400 ,50 , +RK801_LDO1_ON_VSEL_REG ,RK801_LDO_VSEL_MASK ,RK801_POWER_EN1_REG , +ENABLE_MASK (0 ),DISABLE_VAL (0 ),400 ), +RK801_DESC (RK801_ID_LDO2 ,"ldo2" ,"vcc6" ,500 ,3400 ,50 , +RK801_LDO2_ON_VSEL_REG ,RK801_LDO_VSEL_MASK ,RK801_POWER_EN1_REG , +ENABLE_MASK (1 ),DISABLE_VAL (1 ),400 ), +RK801_DESC_SWITCH (RK801_ID_SWITCH ,"switch" ,"vcc7" ,RK801_POWER_EN1_REG , +ENABLE_MASK (2 ),DISABLE_VAL (2 )), +}; +static const struct regulator_desc rk805_reg[] = { { .name ="DCDC_REG1" ,
@@ -1887,6 +2126,10 @@ static int rk808_regulator_probe(struct platform_device *pdev)return -ENOMEM ;switch (rk808->variant) { +case RK801_ID : + regulators = rk801_reg; + nregulators =RK801_NUM_REGULATORS ; +break ;case RK805_ID : regulators = rk805_reg; nregulators =RK805_NUM_REGULATORS ;
Signature · 1 line
2.25.1
Re: [PATCH v3 3/3] regulator: rk808: Add RK801 support
Quoted 2 lines · Joseph Chen
Add support for rk801 to the existing rk808 regulator driver. It provides 4 BUCK, 2 LDO and 1 SWITCH.
Quoted 11 lines · Joseph Chen
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[...]
Applied, thanks!
[1/3] dt-bindings: mfd: Add rk801 binding
commit: a8a2add7b1889f00bc5d2b1f25fad34e89ef85fb
[2/3] mfd: rk8xx: Add RK801 support
commit: 156442eb6e44d545f09559bd70c5b31fba39eb01
[3/3] regulator: rk808: Add RK801 support
commit: 3e10bbd9c8a6d5d016b8e52c5d4ceba93a2304a0--
Lee Jones [李琼斯]
Lee Jones
maintainerQuoted 13 lines · Lee Jones
Quoted 11 lines · Joseph Chen
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[...]
Quoted 8 lines
Applied, thanks!
[1/3] dt-bindings: mfd: Add rk801 binding
commit: a8a2add7b1889f00bc5d2b1f25fad34e89ef85fb [2/3] mfd: rk8xx: Add RK801 support commit: 156442eb6e44d545f09559bd70c5b31fba39eb01 [3/3] regulator: rk808: Add RK801 support commit: 3e10bbd9c8a6d5d016b8e52c5d4ceba93a2304a0
Note to self: ib-mfd-regulator-6.20
Signature · 1 line
Lee Jones [李琼斯]
Lee Jones
maintainerQuoted 17 lines · Lee Jones
Quoted 15 lines · Lee Jones
Quoted 11 lines · Joseph Chen
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[...]
Applied, thanks!
Quoted 8 lines
Quoted 6 lines
[1/3] dt-bindings: mfd: Add rk801 binding
commit: a8a2add7b1889f00bc5d2b1f25fad34e89ef85fb [2/3] mfd: rk8xx: Add RK801 support commit: 156442eb6e44d545f09559bd70c5b31fba39eb01 [3/3] regulator: rk808: Add RK801 support commit: 3e10bbd9c8a6d5d016b8e52c5d4ceba93a2304a0Note to self: ib-mfd-regulator-6.20
Note to everyone else: Pull-request to follow after build testing.
Signature · 1 line
Lee Jones [李琼斯]
Lee Jones
maintainer[GIT PULL] Immutable branch between MFD and Regulator due for the v6.20 merge window
In reply to Joseph ChenEnjoy!
The following changes since commit 8f0b4cce4481fb22653697cced8d0d04027cb1e8:
Linux 6.19-rc1 (2025-12-14 16:05:07 +1200)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-regulator-v6.20
for you to fetch changes up to 3e10bbd9c8a6d5d016b8e52c5d4ceba93a2304a0:
regulator: rk808: Add RK801 support (2026-01-20 14:58:12 +0000)
----------------------------------------------------------------
Immutable branch between MFD and Regulator due for the v6.20 merge window
----------------------------------------------------------------
Joseph Chen (3):
dt-bindings: mfd: Add rk801 binding
mfd: rk8xx: Add RK801 support
regulator: rk808: Add RK801 support
.../devicetree/bindings/mfd/rockchip,rk801.yaml | 197 +++++++++++++++++ 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, 674 insertions(+), 4 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/rockchip,rk801.yaml
Signature · 1 line
Lee Jones [李琼斯]