diff --git a/projects/Rockchip/bootloader/update.sh b/projects/Rockchip/bootloader/update.sh
index 7b4f8f5fd1..bf86df98ee 100644
--- a/projects/Rockchip/bootloader/update.sh
+++ b/projects/Rockchip/bootloader/update.sh
@@ -31,7 +31,7 @@ fi
new_dtb=rk3328-a1.dtb
;;
rk3399-rock-pi-4.dtb)
- new_dtb=rk3399-rock-pi-4a.dtb
+ new_dtb=rk3399-rock-pi-4b.dtb
;;
*)
new_dtb="${dtb}"
diff --git a/projects/Rockchip/devices/RK3288/linux/default/linux.arm.conf b/projects/Rockchip/devices/RK3288/linux/default/linux.arm.conf
index 4aee76f7ee..38c3a92f6c 100644
--- a/projects/Rockchip/devices/RK3288/linux/default/linux.arm.conf
+++ b/projects/Rockchip/devices/RK3288/linux/default/linux.arm.conf
@@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
-# Linux/arm 5.10.35 Kernel Configuration
+# Linux/arm 5.10.41 Kernel Configuration
#
#
@@ -4831,7 +4831,6 @@ CONFIG_IIO_SW_TRIGGER=y
# CONFIG_AD7923 is not set
# CONFIG_AD7949 is not set
# CONFIG_AD799X is not set
-# CONFIG_AD9467 is not set
# CONFIG_ADI_AXI_ADC is not set
# CONFIG_AXP20X_ADC is not set
# CONFIG_AXP288_ADC is not set
diff --git a/projects/Rockchip/devices/RK3328/linux/default/linux.aarch64.conf b/projects/Rockchip/devices/RK3328/linux/default/linux.aarch64.conf
index 792c486fb6..227312daeb 100644
--- a/projects/Rockchip/devices/RK3328/linux/default/linux.aarch64.conf
+++ b/projects/Rockchip/devices/RK3328/linux/default/linux.aarch64.conf
@@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
-# Linux/arm64 5.10.35 Kernel Configuration
+# Linux/arm64 5.10.41 Kernel Configuration
#
#
@@ -4837,7 +4837,6 @@ CONFIG_IIO_CONSUMERS_PER_TRIGGER=2
# CONFIG_AD7923 is not set
# CONFIG_AD7949 is not set
# CONFIG_AD799X is not set
-# CONFIG_AD9467 is not set
# CONFIG_ADI_AXI_ADC is not set
# CONFIG_CC10001_ADC is not set
# CONFIG_ENVELOPE_DETECTOR is not set
diff --git a/projects/Rockchip/devices/RK3399/linux/default/linux.aarch64.conf b/projects/Rockchip/devices/RK3399/linux/default/linux.aarch64.conf
index 384176837b..43df4b3bf4 100644
--- a/projects/Rockchip/devices/RK3399/linux/default/linux.aarch64.conf
+++ b/projects/Rockchip/devices/RK3399/linux/default/linux.aarch64.conf
@@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
-# Linux/arm64 5.10.35 Kernel Configuration
+# Linux/arm64 5.10.41 Kernel Configuration
#
#
@@ -5527,7 +5527,6 @@ CONFIG_IIO_CONSUMERS_PER_TRIGGER=2
# CONFIG_AD7923 is not set
# CONFIG_AD7949 is not set
# CONFIG_AD799X is not set
-# CONFIG_AD9467 is not set
# CONFIG_ADI_AXI_ADC is not set
# CONFIG_CC10001_ADC is not set
# CONFIG_ENVELOPE_DETECTOR is not set
diff --git a/projects/Rockchip/kodi/appliance.xml b/projects/Rockchip/kodi/appliance.xml
index 31f6e9f58e..e07e5708a0 100644
--- a/projects/Rockchip/kodi/appliance.xml
+++ b/projects/Rockchip/kodi/appliance.xml
@@ -24,6 +24,12 @@
ALSA:hdmi:CARD=HDMI,DEV=0
+
+ false
+
+ false
+
+
diff --git a/projects/Rockchip/patches/linux/default/linux-0003-rockchip-from-5.13.patch b/projects/Rockchip/patches/linux/default/linux-0003-rockchip-from-5.13.patch
new file mode 100644
index 0000000000..59ab005aef
--- /dev/null
+++ b/projects/Rockchip/patches/linux/default/linux-0003-rockchip-from-5.13.patch
@@ -0,0 +1,318 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Ezequiel Garcia
+Date: Wed, 21 Apr 2021 18:03:36 -0300
+Subject: [PATCH] dt-bindings: vendor-prefixes: Add Tang Cheng (TCS)
+
+Shenzhen City Tang Cheng Technology (http://www.tctek.cn/)
+is a power management IC manufacturer.
+
+Signed-off-by: Ezequiel Garcia
+---
+ Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
+index 259faf1b382c..0ec33479df3c 100644
+--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
++++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
+@@ -1055,6 +1055,8 @@ patternProperties:
+ description: Trusted Computing Group
+ "^tcl,.*":
+ description: Toby Churchill Ltd.
++ "^tcs,.*":
++ description: Shenzhen City Tang Cheng Technology Co., Ltd.
+ "^technexion,.*":
+ description: TechNexion
+ "^technologic,.*":
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Ezequiel Garcia
+Date: Wed, 21 Apr 2021 18:03:37 -0300
+Subject: [PATCH] dt-bindings: regulator: Add support for TCS4525
+
+Add a compatible string to support TCS4525/TCS4526 devices,
+which are compatible with Fairchild FAN53555 regulators.
+
+Signed-off-by: Ezequiel Garcia
+---
+ Documentation/devicetree/bindings/regulator/fan53555.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Documentation/devicetree/bindings/regulator/fan53555.txt b/Documentation/devicetree/bindings/regulator/fan53555.txt
+index e7fc045281d1..013f096ac0aa 100644
+--- a/Documentation/devicetree/bindings/regulator/fan53555.txt
++++ b/Documentation/devicetree/bindings/regulator/fan53555.txt
+@@ -1,8 +1,8 @@
+ Binding for Fairchild FAN53555 regulators
+
+ Required properties:
+- - compatible: one of "fcs,fan53555", "fcs,fan53526", "silergy,syr827" or
+- "silergy,syr828"
++ - compatible: one of "fcs,fan53555", "fcs,fan53526", "silergy,syr827",
++ "silergy,syr828" or "tcs,tcs4525".
+ - reg: I2C address
+
+ Optional properties:
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Joseph Chen
+Date: Wed, 21 Apr 2021 18:03:38 -0300
+Subject: [PATCH] regulator: fan53555: Add TCS4525 DCDC support
+
+TCS4525 main features:
+
+- 2.7V to 5.5V Input Voltage Range;
+- 3MHz Constant Switching Frequency;
+- 5A Available Load Current;
+- Programmable Output Voltage: 0.6V to 1.4V in 6.25mV Steps;
+- PFM/PWM Operation for Optimum Increased Efficiency;
+
+Signed-off-by: Joseph Chen
+[Ezequiel: Forward port]
+Signed-off-by: Ezequiel Garcia
+---
+ drivers/regulator/fan53555.c | 136 +++++++++++++++++++++++++++++++----
+ 1 file changed, 122 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
+index aa426183b6a1..f3918f03aaf3 100644
+--- a/drivers/regulator/fan53555.c
++++ b/drivers/regulator/fan53555.c
+@@ -24,6 +24,12 @@
+ /* Voltage setting */
+ #define FAN53555_VSEL0 0x00
+ #define FAN53555_VSEL1 0x01
++
++#define TCS4525_VSEL0 0x11
++#define TCS4525_VSEL1 0x10
++#define TCS4525_TIME 0x13
++#define TCS4525_COMMAND 0x14
++
+ /* Control register */
+ #define FAN53555_CONTROL 0x02
+ /* IC Type */
+@@ -49,11 +55,20 @@
+
+ #define FAN53555_NVOLTAGES 64 /* Numbers of voltages */
+ #define FAN53526_NVOLTAGES 128
++#define TCS4525_NVOLTAGES 127 /* Numbers of voltages */
++
++#define TCS_VSEL_NSEL_MASK 0x7f
++#define TCS_VSEL0_MODE (1 << 7)
++#define TCS_VSEL1_MODE (1 << 6)
++
++#define TCS_SLEW_SHIFT 3
++#define TCS_SLEW_MASK (0x3 < 3)
+
+ enum fan53555_vendor {
+ FAN53526_VENDOR_FAIRCHILD = 0,
+ FAN53555_VENDOR_FAIRCHILD,
+ FAN53555_VENDOR_SILERGY,
++ FAN53555_VENDOR_TCS,
+ };
+
+ enum {
+@@ -106,6 +121,11 @@ struct fan53555_device_info {
+ unsigned int mode_mask;
+ /* Sleep voltage cache */
+ unsigned int sleep_vol_cache;
++ /* Slew rate */
++ unsigned int slew_reg;
++ unsigned int slew_mask;
++ unsigned int slew_shift;
++ unsigned int slew_rate;
+ };
+
+ static int fan53555_set_suspend_voltage(struct regulator_dev *rdev, int uV)
+@@ -189,13 +209,37 @@ static const int slew_rates[] = {
+ 500,
+ };
+
++static const int tcs_slew_rates[] = {
++ 18700,
++ 9300,
++ 4600,
++ 2300,
++};
++
+ static int fan53555_set_ramp(struct regulator_dev *rdev, int ramp)
+ {
+ struct fan53555_device_info *di = rdev_get_drvdata(rdev);
+ int regval = -1, i;
++ const int *slew_rate_t;
++ int slew_rate_n;
+
+- for (i = 0; i < ARRAY_SIZE(slew_rates); i++) {
+- if (ramp <= slew_rates[i])
++ switch (di->vendor) {
++ case FAN53526_VENDOR_FAIRCHILD:
++ case FAN53555_VENDOR_FAIRCHILD:
++ case FAN53555_VENDOR_SILERGY:
++ slew_rate_t = slew_rates;
++ slew_rate_n = ARRAY_SIZE(slew_rates);
++ break;
++ case FAN53555_VENDOR_TCS:
++ slew_rate_t = tcs_slew_rates;
++ slew_rate_n = ARRAY_SIZE(tcs_slew_rates);
++ break;
++ default:
++ return -EINVAL;
++ }
++
++ for (i = 0; i < slew_rate_n; i++) {
++ if (ramp <= slew_rate_t[i])
+ regval = i;
+ else
+ break;
+@@ -206,8 +250,8 @@ static int fan53555_set_ramp(struct regulator_dev *rdev, int ramp)
+ return -EINVAL;
+ }
+
+- return regmap_update_bits(rdev->regmap, FAN53555_CONTROL,
+- CTL_SLEW_MASK, regval << CTL_SLEW_SHIFT);
++ return regmap_update_bits(rdev->regmap, di->slew_reg,
++ di->slew_mask, regval << di->slew_shift);
+ }
+
+ static const struct regulator_ops fan53555_regulator_ops = {
+@@ -292,7 +336,9 @@ static int fan53555_voltages_setup_fairchild(struct fan53555_device_info *di)
+ "Chip ID %d not supported!\n", di->chip_id);
+ return -EINVAL;
+ }
+-
++ di->slew_reg = FAN53555_CONTROL;
++ di->slew_mask = CTL_SLEW_MASK;
++ di->slew_shift = CTL_SLEW_SHIFT;
+ di->vsel_count = FAN53555_NVOLTAGES;
+
+ return 0;
+@@ -312,12 +358,29 @@ static int fan53555_voltages_setup_silergy(struct fan53555_device_info *di)
+ "Chip ID %d not supported!\n", di->chip_id);
+ return -EINVAL;
+ }
+-
++ di->slew_reg = FAN53555_CONTROL;
++ di->slew_reg = FAN53555_CONTROL;
++ di->slew_mask = CTL_SLEW_MASK;
++ di->slew_shift = CTL_SLEW_SHIFT;
+ di->vsel_count = FAN53555_NVOLTAGES;
+
+ return 0;
+ }
+
++static int fan53555_voltages_setup_tcs(struct fan53555_device_info *di)
++{
++ di->slew_reg = TCS4525_TIME;
++ di->slew_mask = TCS_SLEW_MASK;
++ di->slew_shift = TCS_SLEW_MASK;
++
++ /* Init voltage range and step */
++ di->vsel_min = 600000;
++ di->vsel_step = 6250;
++ di->vsel_count = TCS4525_NVOLTAGES;
++
++ return 0;
++}
++
+ /* For 00,01,03,05 options:
+ * VOUT = 0.60V + NSELx * 10mV, from 0.60 to 1.23V.
+ * For 04 option:
+@@ -329,17 +392,41 @@ static int fan53555_device_setup(struct fan53555_device_info *di,
+ int ret = 0;
+
+ /* Setup voltage control register */
+- switch (pdata->sleep_vsel_id) {
+- case FAN53555_VSEL_ID_0:
+- di->sleep_reg = FAN53555_VSEL0;
+- di->vol_reg = FAN53555_VSEL1;
++ switch (di->vendor) {
++ case FAN53526_VENDOR_FAIRCHILD:
++ case FAN53555_VENDOR_FAIRCHILD:
++ case FAN53555_VENDOR_SILERGY:
++ switch (pdata->sleep_vsel_id) {
++ case FAN53555_VSEL_ID_0:
++ di->sleep_reg = FAN53555_VSEL0;
++ di->vol_reg = FAN53555_VSEL1;
++ break;
++ case FAN53555_VSEL_ID_1:
++ di->sleep_reg = FAN53555_VSEL1;
++ di->vol_reg = FAN53555_VSEL0;
++ break;
++ default:
++ dev_err(di->dev, "Invalid VSEL ID!\n");
++ return -EINVAL;
++ }
+ break;
+- case FAN53555_VSEL_ID_1:
+- di->sleep_reg = FAN53555_VSEL1;
+- di->vol_reg = FAN53555_VSEL0;
++ case FAN53555_VENDOR_TCS:
++ switch (pdata->sleep_vsel_id) {
++ case FAN53555_VSEL_ID_0:
++ di->sleep_reg = TCS4525_VSEL0;
++ di->vol_reg = TCS4525_VSEL1;
++ break;
++ case FAN53555_VSEL_ID_1:
++ di->sleep_reg = TCS4525_VSEL1;
++ di->vol_reg = TCS4525_VSEL0;
++ break;
++ default:
++ dev_err(di->dev, "Invalid VSEL ID!\n");
++ return -EINVAL;
++ }
+ break;
+ default:
+- dev_err(di->dev, "Invalid VSEL ID!\n");
++ dev_err(di->dev, "vendor %d not supported!\n", di->vendor);
+ return -EINVAL;
+ }
+
+@@ -362,6 +449,18 @@ static int fan53555_device_setup(struct fan53555_device_info *di,
+ di->mode_reg = di->vol_reg;
+ di->mode_mask = VSEL_MODE;
+ break;
++ case FAN53555_VENDOR_TCS:
++ di->mode_reg = TCS4525_COMMAND;
++
++ switch (pdata->sleep_vsel_id) {
++ case FAN53555_VSEL_ID_0:
++ di->mode_mask = TCS_VSEL1_MODE;
++ break;
++ case FAN53555_VSEL_ID_1:
++ di->mode_mask = TCS_VSEL0_MODE;
++ break;
++ }
++ break;
+ default:
+ dev_err(di->dev, "vendor %d not supported!\n", di->vendor);
+ return -EINVAL;
+@@ -378,6 +477,9 @@ static int fan53555_device_setup(struct fan53555_device_info *di,
+ case FAN53555_VENDOR_SILERGY:
+ ret = fan53555_voltages_setup_silergy(di);
+ break;
++ case FAN53555_VENDOR_TCS:
++ ret = fan53555_voltages_setup_tcs(di);
++ break;
+ default:
+ dev_err(di->dev, "vendor %d not supported!\n", di->vendor);
+ return -EINVAL;
+@@ -449,6 +551,9 @@ static const struct of_device_id __maybe_unused fan53555_dt_ids[] = {
+ }, {
+ .compatible = "silergy,syr828",
+ .data = (void *)FAN53555_VENDOR_SILERGY,
++ }, {
++ .compatible = "tcs,tcs4525",
++ .data = (void *)FAN53555_VENDOR_TCS
+ },
+ { }
+ };
+@@ -554,6 +659,9 @@ static const struct i2c_device_id fan53555_id[] = {
+ }, {
+ .name = "syr828",
+ .driver_data = FAN53555_VENDOR_SILERGY
++ }, {
++ .name = "tcs4525",
++ .driver_data = FAN53555_VENDOR_TCS
+ },
+ { },
+ };
diff --git a/projects/Rockchip/patches/linux/default/linux-0003-rockchip-from-next.patch b/projects/Rockchip/patches/linux/default/linux-0003-rockchip-from-next.patch
new file mode 100644
index 0000000000..d505f26bfd
--- /dev/null
+++ b/projects/Rockchip/patches/linux/default/linux-0003-rockchip-from-next.patch
@@ -0,0 +1,261 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Peter Geis
+Date: Tue, 11 May 2021 17:13:33 -0400
+Subject: [PATCH] regulator: fan53555: fix TCS4525 voltage calulation
+
+The TCS4525 has 128 voltage steps. With the calculation set to 127 the
+most significant bit is disregarded which leads to a miscalculation of
+the voltage by about 200mv.
+
+Fix the calculation to end deadlock on the rk3566-quartz64 which uses
+this as the cpu regulator.
+
+Fixes: 914df8faa7d6 ("regulator: fan53555: Add TCS4525 DCDC support")
+Signed-off-by: Peter Geis
+Link: https://lore.kernel.org/r/20210511211335.2935163-2-pgwipeout@gmail.com
+Signed-off-by: Mark Brown
+---
+ drivers/regulator/fan53555.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
+index f3918f03aaf3..26f06f685b1b 100644
+--- a/drivers/regulator/fan53555.c
++++ b/drivers/regulator/fan53555.c
+@@ -55,7 +55,6 @@
+
+ #define FAN53555_NVOLTAGES 64 /* Numbers of voltages */
+ #define FAN53526_NVOLTAGES 128
+-#define TCS4525_NVOLTAGES 127 /* Numbers of voltages */
+
+ #define TCS_VSEL_NSEL_MASK 0x7f
+ #define TCS_VSEL0_MODE (1 << 7)
+@@ -376,7 +375,7 @@ static int fan53555_voltages_setup_tcs(struct fan53555_device_info *di)
+ /* Init voltage range and step */
+ di->vsel_min = 600000;
+ di->vsel_step = 6250;
+- di->vsel_count = TCS4525_NVOLTAGES;
++ di->vsel_count = FAN53526_NVOLTAGES;
+
+ return 0;
+ }
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Peter Geis
+Date: Tue, 11 May 2021 17:13:34 -0400
+Subject: [PATCH] regulator: fan53555: only bind tcs4525 to correct chip id
+
+The tcs4525 regulator has a chip id of <12>.
+Only allow the driver to bind to the correct chip id for safety, in
+accordance with the other supported devices.
+
+Signed-off-by: Peter Geis
+Link: https://lore.kernel.org/r/20210511211335.2935163-3-pgwipeout@gmail.com
+Signed-off-by: Mark Brown
+---
+ drivers/regulator/fan53555.c | 25 ++++++++++++++++++-------
+ 1 file changed, 18 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
+index 26f06f685b1b..16f28f9df6a1 100644
+--- a/drivers/regulator/fan53555.c
++++ b/drivers/regulator/fan53555.c
+@@ -89,6 +89,10 @@ enum {
+ FAN53555_CHIP_ID_08 = 8,
+ };
+
++enum {
++ TCS4525_CHIP_ID_12 = 12,
++};
++
+ /* IC mask revision */
+ enum {
+ FAN53555_CHIP_REV_00 = 0x3,
+@@ -368,14 +372,21 @@ static int fan53555_voltages_setup_silergy(struct fan53555_device_info *di)
+
+ static int fan53555_voltages_setup_tcs(struct fan53555_device_info *di)
+ {
+- di->slew_reg = TCS4525_TIME;
+- di->slew_mask = TCS_SLEW_MASK;
+- di->slew_shift = TCS_SLEW_MASK;
++ switch (di->chip_id) {
++ case TCS4525_CHIP_ID_12:
++ di->slew_reg = TCS4525_TIME;
++ di->slew_mask = TCS_SLEW_MASK;
++ di->slew_shift = TCS_SLEW_MASK;
+
+- /* Init voltage range and step */
+- di->vsel_min = 600000;
+- di->vsel_step = 6250;
+- di->vsel_count = FAN53526_NVOLTAGES;
++ /* Init voltage range and step */
++ di->vsel_min = 600000;
++ di->vsel_step = 6250;
++ di->vsel_count = FAN53526_NVOLTAGES;
++ break;
++ default:
++ dev_err(di->dev, "Chip ID %d not supported!\n", di->chip_id);
++ return -EINVAL;
++ }
+
+ return 0;
+ }
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Peter Geis
+Date: Tue, 11 May 2021 17:13:35 -0400
+Subject: [PATCH] regulator: fan53555: fix tcs4525 function names
+
+The tcs4525 is based off the fan53526.
+Rename the tcs4525 functions to align with this.
+
+Signed-off-by: Peter Geis
+Link: https://lore.kernel.org/r/20210511211335.2935163-4-pgwipeout@gmail.com
+Signed-off-by: Mark Brown
+---
+ drivers/regulator/fan53555.c | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
+index 16f28f9df6a1..2695be617373 100644
+--- a/drivers/regulator/fan53555.c
++++ b/drivers/regulator/fan53555.c
+@@ -67,7 +67,7 @@ enum fan53555_vendor {
+ FAN53526_VENDOR_FAIRCHILD = 0,
+ FAN53555_VENDOR_FAIRCHILD,
+ FAN53555_VENDOR_SILERGY,
+- FAN53555_VENDOR_TCS,
++ FAN53526_VENDOR_TCS,
+ };
+
+ enum {
+@@ -233,7 +233,7 @@ static int fan53555_set_ramp(struct regulator_dev *rdev, int ramp)
+ slew_rate_t = slew_rates;
+ slew_rate_n = ARRAY_SIZE(slew_rates);
+ break;
+- case FAN53555_VENDOR_TCS:
++ case FAN53526_VENDOR_TCS:
+ slew_rate_t = tcs_slew_rates;
+ slew_rate_n = ARRAY_SIZE(tcs_slew_rates);
+ break;
+@@ -370,7 +370,7 @@ static int fan53555_voltages_setup_silergy(struct fan53555_device_info *di)
+ return 0;
+ }
+
+-static int fan53555_voltages_setup_tcs(struct fan53555_device_info *di)
++static int fan53526_voltages_setup_tcs(struct fan53555_device_info *di)
+ {
+ switch (di->chip_id) {
+ case TCS4525_CHIP_ID_12:
+@@ -420,7 +420,7 @@ static int fan53555_device_setup(struct fan53555_device_info *di,
+ return -EINVAL;
+ }
+ break;
+- case FAN53555_VENDOR_TCS:
++ case FAN53526_VENDOR_TCS:
+ switch (pdata->sleep_vsel_id) {
+ case FAN53555_VSEL_ID_0:
+ di->sleep_reg = TCS4525_VSEL0;
+@@ -459,7 +459,7 @@ static int fan53555_device_setup(struct fan53555_device_info *di,
+ di->mode_reg = di->vol_reg;
+ di->mode_mask = VSEL_MODE;
+ break;
+- case FAN53555_VENDOR_TCS:
++ case FAN53526_VENDOR_TCS:
+ di->mode_reg = TCS4525_COMMAND;
+
+ switch (pdata->sleep_vsel_id) {
+@@ -487,8 +487,8 @@ static int fan53555_device_setup(struct fan53555_device_info *di,
+ case FAN53555_VENDOR_SILERGY:
+ ret = fan53555_voltages_setup_silergy(di);
+ break;
+- case FAN53555_VENDOR_TCS:
+- ret = fan53555_voltages_setup_tcs(di);
++ case FAN53526_VENDOR_TCS:
++ ret = fan53526_voltages_setup_tcs(di);
+ break;
+ default:
+ dev_err(di->dev, "vendor %d not supported!\n", di->vendor);
+@@ -563,7 +563,7 @@ static const struct of_device_id __maybe_unused fan53555_dt_ids[] = {
+ .data = (void *)FAN53555_VENDOR_SILERGY,
+ }, {
+ .compatible = "tcs,tcs4525",
+- .data = (void *)FAN53555_VENDOR_TCS
++ .data = (void *)FAN53526_VENDOR_TCS
+ },
+ { }
+ };
+@@ -671,7 +671,7 @@ static const struct i2c_device_id fan53555_id[] = {
+ .driver_data = FAN53555_VENDOR_SILERGY
+ }, {
+ .name = "tcs4525",
+- .driver_data = FAN53555_VENDOR_TCS
++ .driver_data = FAN53526_VENDOR_TCS
+ },
+ { },
+ };
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Axel Lin
+Date: Mon, 17 May 2021 09:03:17 +0800
+Subject: [PATCH] regulator: fan53555: Fix slew_shift setting for tcs4525
+
+Fix trivial copy-paste mistake.
+
+Signed-off-by: Axel Lin
+Link: https://lore.kernel.org/r/20210517010318.1027949-1-axel.lin@ingics.com
+Signed-off-by: Mark Brown
+---
+ drivers/regulator/fan53555.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
+index 2695be617373..d582ef3a3aeb 100644
+--- a/drivers/regulator/fan53555.c
++++ b/drivers/regulator/fan53555.c
+@@ -376,7 +376,7 @@ static int fan53526_voltages_setup_tcs(struct fan53555_device_info *di)
+ case TCS4525_CHIP_ID_12:
+ di->slew_reg = TCS4525_TIME;
+ di->slew_mask = TCS_SLEW_MASK;
+- di->slew_shift = TCS_SLEW_MASK;
++ di->slew_shift = TCS_SLEW_SHIFT;
+
+ /* Init voltage range and step */
+ di->vsel_min = 600000;
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Axel Lin
+Date: Mon, 17 May 2021 09:03:18 +0800
+Subject: [PATCH] regulator: fan53555: Cleanup unused define and redundant
+ assignment
+
+TCS_VSEL_NSEL_MASK is not used so remove it.
+Also remove redundant assignment for di->slew_reg.
+
+Signed-off-by: Axel Lin
+Link: https://lore.kernel.org/r/20210517010318.1027949-2-axel.lin@ingics.com
+Signed-off-by: Mark Brown
+---
+ drivers/regulator/fan53555.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
+index d582ef3a3aeb..f3f49cf3731b 100644
+--- a/drivers/regulator/fan53555.c
++++ b/drivers/regulator/fan53555.c
+@@ -56,7 +56,6 @@
+ #define FAN53555_NVOLTAGES 64 /* Numbers of voltages */
+ #define FAN53526_NVOLTAGES 128
+
+-#define TCS_VSEL_NSEL_MASK 0x7f
+ #define TCS_VSEL0_MODE (1 << 7)
+ #define TCS_VSEL1_MODE (1 << 6)
+
+@@ -362,7 +361,6 @@ static int fan53555_voltages_setup_silergy(struct fan53555_device_info *di)
+ return -EINVAL;
+ }
+ di->slew_reg = FAN53555_CONTROL;
+- di->slew_reg = FAN53555_CONTROL;
+ di->slew_mask = CTL_SLEW_MASK;
+ di->slew_shift = CTL_SLEW_SHIFT;
+ di->vsel_count = FAN53555_NVOLTAGES;
diff --git a/projects/Rockchip/patches/linux/default/linux-0003-rockchip-from-list.patch b/projects/Rockchip/patches/linux/default/linux-0004-rockchip-from-list.patch
similarity index 95%
rename from projects/Rockchip/patches/linux/default/linux-0003-rockchip-from-list.patch
rename to projects/Rockchip/patches/linux/default/linux-0004-rockchip-from-list.patch
index 6b92ea9c1d..9f6ba3f32c 100644
--- a/projects/Rockchip/patches/linux/default/linux-0003-rockchip-from-list.patch
+++ b/projects/Rockchip/patches/linux/default/linux-0004-rockchip-from-list.patch
@@ -1233,7 +1233,7 @@ Signed-off-by: Jonas Karlman
1 file changed, 8 insertions(+)
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
-index d42037f0f10d..019dc355509b 100644
+index eaf4810fe656..6f8ea06b187b 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1349,6 +1349,14 @@ void mmc_power_off(struct mmc_host *host)
@@ -1251,3 +1251,74 @@ index d42037f0f10d..019dc355509b 100644
mmc_pwrseq_power_off(host);
host->ios.clock = 0;
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum
+Date: Fri, 28 May 2021 10:19:50 +0000
+Subject: [PATCH] regulator: fan53555: add tcs4526
+
+For rk3399pro boards the tcs4526 regulator supports the vdd_gpu
+regulator. The tcs4526 regulator has a chip id of <0>.
+Add the compatibile tcs,tcs4526
+
+without this patch, the dmesg output is:
+ fan53555-regulator 0-0010: Chip ID 0 not supported!
+ fan53555-regulator 0-0010: Failed to setup device!
+ fan53555-regulator: probe of 0-0010 failed with error -22
+with this patch, the dmesg output is:
+ vdd_gpu: supplied by vcc5v0_sys
+
+The regulators are described as:
+- Dedicated power management IC TCS4525
+- Lithium battery protection chip TCS4526
+
+This has been tested with a Radxa Rock Pi N10.
+
+Signed-off-by: Rudi Heitbaum
+---
+ drivers/regulator/fan53555.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
+index f3f49cf3731b..bc8242e1dd0f 100644
+--- a/drivers/regulator/fan53555.c
++++ b/drivers/regulator/fan53555.c
+@@ -92,6 +92,10 @@ enum {
+ TCS4525_CHIP_ID_12 = 12,
+ };
+
++enum {
++ TCS4526_CHIP_ID_00 = 0,
++};
++
+ /* IC mask revision */
+ enum {
+ FAN53555_CHIP_REV_00 = 0x3,
+@@ -372,6 +376,7 @@ static int fan53526_voltages_setup_tcs(struct fan53555_device_info *di)
+ {
+ switch (di->chip_id) {
+ case TCS4525_CHIP_ID_12:
++ case TCS4526_CHIP_ID_00:
+ di->slew_reg = TCS4525_TIME;
+ di->slew_mask = TCS_SLEW_MASK;
+ di->slew_shift = TCS_SLEW_SHIFT;
+@@ -562,6 +567,9 @@ static const struct of_device_id __maybe_unused fan53555_dt_ids[] = {
+ }, {
+ .compatible = "tcs,tcs4525",
+ .data = (void *)FAN53526_VENDOR_TCS
++ }, {
++ .compatible = "tcs,tcs4526",
++ .data = (void *)FAN53526_VENDOR_TCS
+ },
+ { }
+ };
+@@ -670,6 +678,9 @@ static const struct i2c_device_id fan53555_id[] = {
+ }, {
+ .name = "tcs4525",
+ .driver_data = FAN53526_VENDOR_TCS
++ }, {
++ .name = "tcs4526",
++ .driver_data = FAN53526_VENDOR_TCS
+ },
+ { },
+ };
diff --git a/projects/Rockchip/patches/linux/default/linux-0010-v4l2-from-list.patch b/projects/Rockchip/patches/linux/default/linux-0010-v4l2-from-list.patch
index 4a2b5474e4..d1d06c89bd 100644
--- a/projects/Rockchip/patches/linux/default/linux-0010-v4l2-from-list.patch
+++ b/projects/Rockchip/patches/linux/default/linux-0010-v4l2-from-list.patch
@@ -47,7 +47,7 @@ Signed-off-by: Jonas Karlman
1 file changed, 2 insertions(+)
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
-index d25c4a37e2af..b3e067031c83 100644
+index 1263991de76f..71a6b7b0b057 100644
--- a/drivers/staging/media/rkvdec/rkvdec.c
+++ b/drivers/staging/media/rkvdec/rkvdec.c
@@ -223,6 +223,8 @@ static int rkvdec_try_capture_fmt(struct file *file, void *priv,
@@ -98,7 +98,7 @@ index 054d2e3eed67..d46424ba88e8 100644
FRAME_MBS_ONLY_FLAG);
WRITE_PPS(!!(sps->flags & V4L2_H264_SPS_FLAG_MB_ADAPTIVE_FRAME_FIELD),
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
-index b3e067031c83..06fc58440cd3 100644
+index 71a6b7b0b057..f405dd72ad93 100644
--- a/drivers/staging/media/rkvdec/rkvdec.c
+++ b/drivers/staging/media/rkvdec/rkvdec.c
@@ -29,8 +29,11 @@
@@ -682,7 +682,7 @@ Signed-off-by: Jonas Karlman
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
-index 06fc58440cd3..dc16bf8d57a9 100644
+index f405dd72ad93..c81ca5c7e979 100644
--- a/drivers/staging/media/rkvdec/rkvdec.c
+++ b/drivers/staging/media/rkvdec/rkvdec.c
@@ -27,6 +27,17 @@
@@ -754,7 +754,7 @@ Signed-off-by: Jonas Karlman
2 files changed, 55 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
-index dc16bf8d57a9..6b2a2f4164b2 100644
+index c81ca5c7e979..a11474214bde 100644
--- a/drivers/staging/media/rkvdec/rkvdec.c
+++ b/drivers/staging/media/rkvdec/rkvdec.c
@@ -38,6 +38,16 @@ static void rkvdec_fill_decoded_pixfmt(struct rkvdec_ctx *ctx,
@@ -947,7 +947,7 @@ index 6f2d41b2e076..c115cd362a7f 100644
.stop = rkvdec_h264_stop,
.run = rkvdec_h264_run,
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
-index 6b2a2f4164b2..bd8ec2915fe9 100644
+index a11474214bde..b57a39ce4f48 100644
--- a/drivers/staging/media/rkvdec/rkvdec.c
+++ b/drivers/staging/media/rkvdec/rkvdec.c
@@ -31,7 +31,7 @@ static void rkvdec_fill_decoded_pixfmt(struct rkvdec_ctx *ctx,
@@ -1014,7 +1014,7 @@ Reviewed-by: Ezequiel Garcia
1 file changed, 13 insertions(+)
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
-index bd8ec2915fe9..87987a782d75 100644
+index b57a39ce4f48..9492822c12ae 100644
--- a/drivers/staging/media/rkvdec/rkvdec.c
+++ b/drivers/staging/media/rkvdec/rkvdec.c
@@ -132,6 +132,19 @@ static const struct rkvdec_ctrl_desc rkvdec_h264_ctrl_descs[] = {
diff --git a/projects/Rockchip/patches/linux/default/linux-0030-regulator-from-list.patch b/projects/Rockchip/patches/linux/default/linux-0030-regulator-from-list.patch
deleted file mode 100644
index 189964b979..0000000000
--- a/projects/Rockchip/patches/linux/default/linux-0030-regulator-from-list.patch
+++ /dev/null
@@ -1,656 +0,0 @@
-From 914df8faa7d6fdff7afa1fbde888a2bed8d72fa7 Mon Sep 17 00:00:00 2001
-From: Joseph Chen
-Date: Wed, 21 Apr 2021 18:03:38 -0300
-Subject: [PATCH] regulator: fan53555: Add TCS4525 DCDC support
-
-TCS4525 main features:
-
-- 2.7V to 5.5V Input Voltage Range;
-- 3MHz Constant Switching Frequency;
-- 5A Available Load Current;
-- Programmable Output Voltage: 0.6V to 1.4V in 6.25mV Steps;
-- PFM/PWM Operation for Optimum Increased Efficiency;
-
-Signed-off-by: Joseph Chen
-[Ezequiel: Forward port]
-Signed-off-by: Ezequiel Garcia
-Link: https://lore.kernel.org/r/20210421210338.43819-3-ezequiel@collabora.com
-Signed-off-by: Mark Brown
----
- drivers/regulator/fan53555.c | 136 +++++++++++++++++++++++++++++++----
- 1 file changed, 122 insertions(+), 14 deletions(-)
-
-diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
-index aa426183b6a118..f3918f03aaf3df 100644
---- a/drivers/regulator/fan53555.c
-+++ b/drivers/regulator/fan53555.c
-@@ -24,6 +24,12 @@
- /* Voltage setting */
- #define FAN53555_VSEL0 0x00
- #define FAN53555_VSEL1 0x01
-+
-+#define TCS4525_VSEL0 0x11
-+#define TCS4525_VSEL1 0x10
-+#define TCS4525_TIME 0x13
-+#define TCS4525_COMMAND 0x14
-+
- /* Control register */
- #define FAN53555_CONTROL 0x02
- /* IC Type */
-@@ -49,11 +55,20 @@
-
- #define FAN53555_NVOLTAGES 64 /* Numbers of voltages */
- #define FAN53526_NVOLTAGES 128
-+#define TCS4525_NVOLTAGES 127 /* Numbers of voltages */
-+
-+#define TCS_VSEL_NSEL_MASK 0x7f
-+#define TCS_VSEL0_MODE (1 << 7)
-+#define TCS_VSEL1_MODE (1 << 6)
-+
-+#define TCS_SLEW_SHIFT 3
-+#define TCS_SLEW_MASK (0x3 < 3)
-
- enum fan53555_vendor {
- FAN53526_VENDOR_FAIRCHILD = 0,
- FAN53555_VENDOR_FAIRCHILD,
- FAN53555_VENDOR_SILERGY,
-+ FAN53555_VENDOR_TCS,
- };
-
- enum {
-@@ -106,6 +121,11 @@ struct fan53555_device_info {
- unsigned int mode_mask;
- /* Sleep voltage cache */
- unsigned int sleep_vol_cache;
-+ /* Slew rate */
-+ unsigned int slew_reg;
-+ unsigned int slew_mask;
-+ unsigned int slew_shift;
-+ unsigned int slew_rate;
- };
-
- static int fan53555_set_suspend_voltage(struct regulator_dev *rdev, int uV)
-@@ -189,13 +209,37 @@ static const int slew_rates[] = {
- 500,
- };
-
-+static const int tcs_slew_rates[] = {
-+ 18700,
-+ 9300,
-+ 4600,
-+ 2300,
-+};
-+
- static int fan53555_set_ramp(struct regulator_dev *rdev, int ramp)
- {
- struct fan53555_device_info *di = rdev_get_drvdata(rdev);
- int regval = -1, i;
-+ const int *slew_rate_t;
-+ int slew_rate_n;
-
-- for (i = 0; i < ARRAY_SIZE(slew_rates); i++) {
-- if (ramp <= slew_rates[i])
-+ switch (di->vendor) {
-+ case FAN53526_VENDOR_FAIRCHILD:
-+ case FAN53555_VENDOR_FAIRCHILD:
-+ case FAN53555_VENDOR_SILERGY:
-+ slew_rate_t = slew_rates;
-+ slew_rate_n = ARRAY_SIZE(slew_rates);
-+ break;
-+ case FAN53555_VENDOR_TCS:
-+ slew_rate_t = tcs_slew_rates;
-+ slew_rate_n = ARRAY_SIZE(tcs_slew_rates);
-+ break;
-+ default:
-+ return -EINVAL;
-+ }
-+
-+ for (i = 0; i < slew_rate_n; i++) {
-+ if (ramp <= slew_rate_t[i])
- regval = i;
- else
- break;
-@@ -206,8 +250,8 @@ static int fan53555_set_ramp(struct regulator_dev *rdev, int ramp)
- return -EINVAL;
- }
-
-- return regmap_update_bits(rdev->regmap, FAN53555_CONTROL,
-- CTL_SLEW_MASK, regval << CTL_SLEW_SHIFT);
-+ return regmap_update_bits(rdev->regmap, di->slew_reg,
-+ di->slew_mask, regval << di->slew_shift);
- }
-
- static const struct regulator_ops fan53555_regulator_ops = {
-@@ -292,7 +336,9 @@ static int fan53555_voltages_setup_fairchild(struct fan53555_device_info *di)
- "Chip ID %d not supported!\n", di->chip_id);
- return -EINVAL;
- }
--
-+ di->slew_reg = FAN53555_CONTROL;
-+ di->slew_mask = CTL_SLEW_MASK;
-+ di->slew_shift = CTL_SLEW_SHIFT;
- di->vsel_count = FAN53555_NVOLTAGES;
-
- return 0;
-@@ -312,12 +358,29 @@ static int fan53555_voltages_setup_silergy(struct fan53555_device_info *di)
- "Chip ID %d not supported!\n", di->chip_id);
- return -EINVAL;
- }
--
-+ di->slew_reg = FAN53555_CONTROL;
-+ di->slew_reg = FAN53555_CONTROL;
-+ di->slew_mask = CTL_SLEW_MASK;
-+ di->slew_shift = CTL_SLEW_SHIFT;
- di->vsel_count = FAN53555_NVOLTAGES;
-
- return 0;
- }
-
-+static int fan53555_voltages_setup_tcs(struct fan53555_device_info *di)
-+{
-+ di->slew_reg = TCS4525_TIME;
-+ di->slew_mask = TCS_SLEW_MASK;
-+ di->slew_shift = TCS_SLEW_MASK;
-+
-+ /* Init voltage range and step */
-+ di->vsel_min = 600000;
-+ di->vsel_step = 6250;
-+ di->vsel_count = TCS4525_NVOLTAGES;
-+
-+ return 0;
-+}
-+
- /* For 00,01,03,05 options:
- * VOUT = 0.60V + NSELx * 10mV, from 0.60 to 1.23V.
- * For 04 option:
-@@ -329,17 +392,41 @@ static int fan53555_device_setup(struct fan53555_device_info *di,
- int ret = 0;
-
- /* Setup voltage control register */
-- switch (pdata->sleep_vsel_id) {
-- case FAN53555_VSEL_ID_0:
-- di->sleep_reg = FAN53555_VSEL0;
-- di->vol_reg = FAN53555_VSEL1;
-+ switch (di->vendor) {
-+ case FAN53526_VENDOR_FAIRCHILD:
-+ case FAN53555_VENDOR_FAIRCHILD:
-+ case FAN53555_VENDOR_SILERGY:
-+ switch (pdata->sleep_vsel_id) {
-+ case FAN53555_VSEL_ID_0:
-+ di->sleep_reg = FAN53555_VSEL0;
-+ di->vol_reg = FAN53555_VSEL1;
-+ break;
-+ case FAN53555_VSEL_ID_1:
-+ di->sleep_reg = FAN53555_VSEL1;
-+ di->vol_reg = FAN53555_VSEL0;
-+ break;
-+ default:
-+ dev_err(di->dev, "Invalid VSEL ID!\n");
-+ return -EINVAL;
-+ }
- break;
-- case FAN53555_VSEL_ID_1:
-- di->sleep_reg = FAN53555_VSEL1;
-- di->vol_reg = FAN53555_VSEL0;
-+ case FAN53555_VENDOR_TCS:
-+ switch (pdata->sleep_vsel_id) {
-+ case FAN53555_VSEL_ID_0:
-+ di->sleep_reg = TCS4525_VSEL0;
-+ di->vol_reg = TCS4525_VSEL1;
-+ break;
-+ case FAN53555_VSEL_ID_1:
-+ di->sleep_reg = TCS4525_VSEL1;
-+ di->vol_reg = TCS4525_VSEL0;
-+ break;
-+ default:
-+ dev_err(di->dev, "Invalid VSEL ID!\n");
-+ return -EINVAL;
-+ }
- break;
- default:
-- dev_err(di->dev, "Invalid VSEL ID!\n");
-+ dev_err(di->dev, "vendor %d not supported!\n", di->vendor);
- return -EINVAL;
- }
-
-@@ -362,6 +449,18 @@ static int fan53555_device_setup(struct fan53555_device_info *di,
- di->mode_reg = di->vol_reg;
- di->mode_mask = VSEL_MODE;
- break;
-+ case FAN53555_VENDOR_TCS:
-+ di->mode_reg = TCS4525_COMMAND;
-+
-+ switch (pdata->sleep_vsel_id) {
-+ case FAN53555_VSEL_ID_0:
-+ di->mode_mask = TCS_VSEL1_MODE;
-+ break;
-+ case FAN53555_VSEL_ID_1:
-+ di->mode_mask = TCS_VSEL0_MODE;
-+ break;
-+ }
-+ break;
- default:
- dev_err(di->dev, "vendor %d not supported!\n", di->vendor);
- return -EINVAL;
-@@ -378,6 +477,9 @@ static int fan53555_device_setup(struct fan53555_device_info *di,
- case FAN53555_VENDOR_SILERGY:
- ret = fan53555_voltages_setup_silergy(di);
- break;
-+ case FAN53555_VENDOR_TCS:
-+ ret = fan53555_voltages_setup_tcs(di);
-+ break;
- default:
- dev_err(di->dev, "vendor %d not supported!\n", di->vendor);
- return -EINVAL;
-@@ -449,6 +551,9 @@ static const struct of_device_id __maybe_unused fan53555_dt_ids[] = {
- }, {
- .compatible = "silergy,syr828",
- .data = (void *)FAN53555_VENDOR_SILERGY,
-+ }, {
-+ .compatible = "tcs,tcs4525",
-+ .data = (void *)FAN53555_VENDOR_TCS
- },
- { }
- };
-@@ -554,6 +659,9 @@ static const struct i2c_device_id fan53555_id[] = {
- }, {
- .name = "syr828",
- .driver_data = FAN53555_VENDOR_SILERGY
-+ }, {
-+ .name = "tcs4525",
-+ .driver_data = FAN53555_VENDOR_TCS
- },
- { },
- };
---
-2.29.1
-
-
-From: Peter Geis
-Subject: [PATCH 0/3] regulator: fan53555: tcs4525 fix and cleanup
-Date: Tue, 11 May 2021 17:13:32 -0400
-
-The tcs4525 voltage calculation is incorrect, which leads to a deadlock
-on the rk3566-quartz64 board when loading cpufreq.
-Fix the voltage calculation to correct the deadlock.
-While we are at it, add a safety check and clean up the function names
-to be more accurate.
-
-Peter Geis (3):
- regulator: fan53555: fix TCS4525 voltage calulation
- regulator: fan53555: only bind tcs4525 to correct chip id
- regulator: fan53555: fix tcs4525 function names
-
- drivers/regulator/fan53555.c | 44 ++++++++++++++++++++++--------------
- 1 file changed, 27 insertions(+), 17 deletions(-)
-
---
-2.25.1
-
-
-From: Peter Geis
-Subject: [PATCH 1/3] regulator: fan53555: fix TCS4525 voltage calulation
-Date: Tue, 11 May 2021 17:13:33 -0400
-
-The TCS4525 has 128 voltage steps. With the calculation set to 127 the
-most significant bit is disregarded which leads to a miscalculation of
-the voltage by about 200mv.
-
-Fix the calculation to end deadlock on the rk3566-quartz64 which uses
-this as the cpu regulator.
-
-Fixes: 914df8faa7d6 ("regulator: fan53555: Add TCS4525 DCDC support")
-Signed-off-by: Peter Geis
----
- drivers/regulator/fan53555.c | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
-index f3918f03aaf3..26f06f685b1b 100644
---- a/drivers/regulator/fan53555.c
-+++ b/drivers/regulator/fan53555.c
-@@ -55,7 +55,6 @@
-
- #define FAN53555_NVOLTAGES 64 /* Numbers of voltages */
- #define FAN53526_NVOLTAGES 128
--#define TCS4525_NVOLTAGES 127 /* Numbers of voltages */
-
- #define TCS_VSEL_NSEL_MASK 0x7f
- #define TCS_VSEL0_MODE (1 << 7)
-@@ -376,7 +375,7 @@ static int fan53555_voltages_setup_tcs(struct fan53555_device_info *di)
- /* Init voltage range and step */
- di->vsel_min = 600000;
- di->vsel_step = 6250;
-- di->vsel_count = TCS4525_NVOLTAGES;
-+ di->vsel_count = FAN53526_NVOLTAGES;
-
- return 0;
- }
---
-2.25.1
-
-
-From: Peter Geis
-Subject: [PATCH 2/3] regulator: fan53555: only bind tcs4525 to correct chip id
-Date: Tue, 11 May 2021 17:13:34 -0400
-
-The tcs4525 regulator has a chip id of <12>.
-Only allow the driver to bind to the correct chip id for safety, in
-accordance with the other supported devices.
-
-Signed-off-by: Peter Geis
----
- drivers/regulator/fan53555.c | 25 ++++++++++++++++++-------
- 1 file changed, 18 insertions(+), 7 deletions(-)
-
-diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
-index 26f06f685b1b..16f28f9df6a1 100644
---- a/drivers/regulator/fan53555.c
-+++ b/drivers/regulator/fan53555.c
-@@ -89,6 +89,10 @@ enum {
- FAN53555_CHIP_ID_08 = 8,
- };
-
-+enum {
-+ TCS4525_CHIP_ID_12 = 12,
-+};
-+
- /* IC mask revision */
- enum {
- FAN53555_CHIP_REV_00 = 0x3,
-@@ -368,14 +372,21 @@ static int fan53555_voltages_setup_silergy(struct fan53555_device_info *di)
-
- static int fan53555_voltages_setup_tcs(struct fan53555_device_info *di)
- {
-- di->slew_reg = TCS4525_TIME;
-- di->slew_mask = TCS_SLEW_MASK;
-- di->slew_shift = TCS_SLEW_MASK;
-+ switch (di->chip_id) {
-+ case TCS4525_CHIP_ID_12:
-+ di->slew_reg = TCS4525_TIME;
-+ di->slew_mask = TCS_SLEW_MASK;
-+ di->slew_shift = TCS_SLEW_MASK;
-
-- /* Init voltage range and step */
-- di->vsel_min = 600000;
-- di->vsel_step = 6250;
-- di->vsel_count = FAN53526_NVOLTAGES;
-+ /* Init voltage range and step */
-+ di->vsel_min = 600000;
-+ di->vsel_step = 6250;
-+ di->vsel_count = FAN53526_NVOLTAGES;
-+ break;
-+ default:
-+ dev_err(di->dev, "Chip ID %d not supported!\n", di->chip_id);
-+ return -EINVAL;
-+ }
-
- return 0;
- }
---
-2.25.1
-
-
-From: Peter Geis
-Subject: [PATCH 3/3] regulator: fan53555: fix tcs4525 function names
-Date: Tue, 11 May 2021 17:13:35 -0400
-
-The tcs4525 is based off the fan53526.
-Rename the tcs4525 functions to align with this.
-
-Signed-off-by: Peter Geis
----
- drivers/regulator/fan53555.c | 18 +++++++++---------
- 1 file changed, 9 insertions(+), 9 deletions(-)
-
-diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
-index 16f28f9df6a1..2695be617373 100644
---- a/drivers/regulator/fan53555.c
-+++ b/drivers/regulator/fan53555.c
-@@ -67,7 +67,7 @@ enum fan53555_vendor {
- FAN53526_VENDOR_FAIRCHILD = 0,
- FAN53555_VENDOR_FAIRCHILD,
- FAN53555_VENDOR_SILERGY,
-- FAN53555_VENDOR_TCS,
-+ FAN53526_VENDOR_TCS,
- };
-
- enum {
-@@ -233,7 +233,7 @@ static int fan53555_set_ramp(struct regulator_dev *rdev, int ramp)
- slew_rate_t = slew_rates;
- slew_rate_n = ARRAY_SIZE(slew_rates);
- break;
-- case FAN53555_VENDOR_TCS:
-+ case FAN53526_VENDOR_TCS:
- slew_rate_t = tcs_slew_rates;
- slew_rate_n = ARRAY_SIZE(tcs_slew_rates);
- break;
-@@ -370,7 +370,7 @@ static int fan53555_voltages_setup_silergy(struct fan53555_device_info *di)
- return 0;
- }
-
--static int fan53555_voltages_setup_tcs(struct fan53555_device_info *di)
-+static int fan53526_voltages_setup_tcs(struct fan53555_device_info *di)
- {
- switch (di->chip_id) {
- case TCS4525_CHIP_ID_12:
-@@ -420,7 +420,7 @@ static int fan53555_device_setup(struct fan53555_device_info *di,
- return -EINVAL;
- }
- break;
-- case FAN53555_VENDOR_TCS:
-+ case FAN53526_VENDOR_TCS:
- switch (pdata->sleep_vsel_id) {
- case FAN53555_VSEL_ID_0:
- di->sleep_reg = TCS4525_VSEL0;
-@@ -459,7 +459,7 @@ static int fan53555_device_setup(struct fan53555_device_info *di,
- di->mode_reg = di->vol_reg;
- di->mode_mask = VSEL_MODE;
- break;
-- case FAN53555_VENDOR_TCS:
-+ case FAN53526_VENDOR_TCS:
- di->mode_reg = TCS4525_COMMAND;
-
- switch (pdata->sleep_vsel_id) {
-@@ -487,8 +487,8 @@ static int fan53555_device_setup(struct fan53555_device_info *di,
- case FAN53555_VENDOR_SILERGY:
- ret = fan53555_voltages_setup_silergy(di);
- break;
-- case FAN53555_VENDOR_TCS:
-- ret = fan53555_voltages_setup_tcs(di);
-+ case FAN53526_VENDOR_TCS:
-+ ret = fan53526_voltages_setup_tcs(di);
- break;
- default:
- dev_err(di->dev, "vendor %d not supported!\n", di->vendor);
-@@ -563,7 +563,7 @@ static const struct of_device_id __maybe_unused fan53555_dt_ids[] = {
- .data = (void *)FAN53555_VENDOR_SILERGY,
- }, {
- .compatible = "tcs,tcs4525",
-- .data = (void *)FAN53555_VENDOR_TCS
-+ .data = (void *)FAN53526_VENDOR_TCS
- },
- { }
- };
-@@ -671,7 +671,7 @@ static const struct i2c_device_id fan53555_id[] = {
- .driver_data = FAN53555_VENDOR_SILERGY
- }, {
- .name = "tcs4525",
-- .driver_data = FAN53555_VENDOR_TCS
-+ .driver_data = FAN53526_VENDOR_TCS
- },
- { },
- };
---
-2.25.1
-
-
-Date: Wed, 26 May 2021 16:23:46 +0000
-From: Rudi Heitbaum
-Subject: [PATCH v2] regulator: fan53555: add tcs4526
-
-
-For rk3399pro boards the tcs4526 regulator supports the vdd_gpu
-regulator. The tcs4526 regulator has a chip id of <0>.
-Add the compatibile tcs,tcs4526
-
-without this patch, the dmesg output is:
- fan53555-regulator 0-0010: Chip ID 0 not supported!
- fan53555-regulator 0-0010: Failed to setup device!
- fan53555-regulator: probe of 0-0010 failed with error -22
-with this patch, the dmesg output is:
- vdd_gpu: supplied by vcc5v0_sys
-
-The regulators are described as:
-- Dedicated power management IC TCS4525
-- Lithium battery protection chip TCS4526
-
-This has been tested with a Radxa Rock Pi N10.
-
-Signed-off-by: Rudi Heitbaum
----
- drivers/regulator/fan53555.c | 11 +++++++++++
- 1 file changed, 11 insertions(+)
-
-diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
-index 2695be617373..ddab9359ea20 100644
---- a/drivers/regulator/fan53555.c
-+++ b/drivers/regulator/fan53555.c
-@@ -93,6 +93,10 @@ enum {
- TCS4525_CHIP_ID_12 = 12,
- };
-
-+enum {
-+ TCS4526_CHIP_ID_00 = 0,
-+};
-+
- /* IC mask revision */
- enum {
- FAN53555_CHIP_REV_00 = 0x3,
-@@ -374,6 +375,7 @@ static int fan53555_voltages_setup_silergy(struct fan53555_device_info *di)
- {
- switch (di->chip_id) {
- case TCS4525_CHIP_ID_12:
-+ case TCS4526_CHIP_ID_00:
- di->slew_reg = TCS4525_TIME;
- di->slew_mask = TCS_SLEW_MASK;
- di->slew_shift = TCS_SLEW_MASK;
-@@ -564,6 +566,9 @@ static const struct of_device_id __maybe_unused fan53555_dt_ids[] = {
- }, {
- .compatible = "tcs,tcs4525",
- .data = (void *)FAN53526_VENDOR_TCS
-+ }, {
-+ .compatible = "tcs,tcs4526",
-+ .data = (void *)FAN53526_VENDOR_TCS
- },
- { }
- };
-@@ -672,6 +677,9 @@ static const struct i2c_device_id fan53555_id[] = {
- }, {
- .name = "tcs4525",
- .driver_data = FAN53526_VENDOR_TCS
-+ }, {
-+ .name = "tcs4526",
-+ .driver_data = FAN53526_VENDOR_TCS
- },
- { },
- };
---
-2.29.2
-
-
-From: Axel Lin
-Subject: [PATCH 1/2] regulator: fan53555: Fix slew_shift setting for tcs4525
-Date: Mon, 17 May 2021 09:03:17 +0800
-
-Fix trivial copy-paste mistake.
-
-Signed-off-by: Axel Lin
----
- drivers/regulator/fan53555.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
-index 2695be617373..d582ef3a3aeb 100644
---- a/drivers/regulator/fan53555.c
-+++ b/drivers/regulator/fan53555.c
-@@ -376,7 +376,7 @@ static int fan53526_voltages_setup_tcs(struct fan53555_device_info *di)
- case TCS4525_CHIP_ID_12:
- di->slew_reg = TCS4525_TIME;
- di->slew_mask = TCS_SLEW_MASK;
-- di->slew_shift = TCS_SLEW_MASK;
-+ di->slew_shift = TCS_SLEW_SHIFT;
-
- /* Init voltage range and step */
- di->vsel_min = 600000;
---
-2.25.1
-
-
-From: Axel Lin
-Subject: [PATCH 2/2] regulator: fan53555: Cleanup unused define and redundant assignment
-Date: Mon, 17 May 2021 09:03:18 +0800
-
-TCS_VSEL_NSEL_MASK is not used so remove it.
-Also remove redundant assignment for di->slew_reg.
-
-Signed-off-by: Axel Lin
----
- drivers/regulator/fan53555.c | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
-index d582ef3a3aeb..f3f49cf3731b 100644
---- a/drivers/regulator/fan53555.c
-+++ b/drivers/regulator/fan53555.c
-@@ -56,7 +56,6 @@
- #define FAN53555_NVOLTAGES 64 /* Numbers of voltages */
- #define FAN53526_NVOLTAGES 128
-
--#define TCS_VSEL_NSEL_MASK 0x7f
- #define TCS_VSEL0_MODE (1 << 7)
- #define TCS_VSEL1_MODE (1 << 6)
-
-@@ -362,7 +361,6 @@ static int fan53555_voltages_setup_silergy(struct fan53555_device_info *di)
- return -EINVAL;
- }
- di->slew_reg = FAN53555_CONTROL;
-- di->slew_reg = FAN53555_CONTROL;
- di->slew_mask = CTL_SLEW_MASK;
- di->slew_shift = CTL_SLEW_SHIFT;
- di->vsel_count = FAN53555_NVOLTAGES;
---
-2.25.1
-
-
-From: Axel Lin
-Subject: [PATCH 1/2] regulator: fan53555: Fix missing slew_reg/mask/shift settings for FAN53526
-Date: Tue, 25 May 2021 20:40:16 +0800
-
-The di->slew_reg/di->slew_mask/di->slew_shift was not set in current code,
-fix it.
-
-Fixes: f2a9eb975ab2 ("regulator: fan53555: Add support for FAN53526")
-Signed-off-by: Axel Lin
----
- drivers/regulator/fan53555.c | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
-index f3f49cf3731b..9770a4df83d4 100644
---- a/drivers/regulator/fan53555.c
-+++ b/drivers/regulator/fan53555.c
-@@ -296,6 +296,9 @@ static int fan53526_voltages_setup_fairchild(struct fan53555_device_info *di)
- return -EINVAL;
- }
-
-+ di->slew_reg = FAN53555_CONTROL;
-+ di->slew_mask = CTL_SLEW_MASK;
-+ di->slew_shift = CTL_SLEW_SHIFT;
- di->vsel_count = FAN53526_NVOLTAGES;
-
- return 0;
---
-2.25.1
-
-
diff --git a/projects/Rockchip/patches/linux/default/linux-0040-rockchip-dts.patch b/projects/Rockchip/patches/linux/default/linux-0040-rockchip-dts.patch
deleted file mode 100644
index 07edfed3c1..0000000000
--- a/projects/Rockchip/patches/linux/default/linux-0040-rockchip-dts.patch
+++ /dev/null
@@ -1,116 +0,0 @@
---- a/arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi 2021-05-08 09:11:59.000000000 +0000
-+++ b/arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi 2021-05-08 09:11:59.000000000 +0000
-@@ -57,6 +57,22 @@
- pinctrl-0 = <&hdmi_cec>;
- };
-
-+&hdmi_sound {
-+ status = "okay";
-+};
-+
-+&gpu {
-+ mali-supply = <&vdd_gpu>;
-+ assigned-clocks = <&cru ACLK_GPU>;
-+ assigned-clock-rates = <200000000>;
-+ status = "okay";
-+ /delete-property/ operating-points-v2;
-+};
-+
-+&vopl {
-+ status = "disabled";
-+};
-+
- &i2c0 {
- clock-frequency = <400000>;
- i2c-scl-falling-time-ns = <30>;
-@@ -289,6 +288,50 @@
- };
- };
- };
-+
-+ vdd_cpu_b: tcs4525@1c {
-+ compatible = "tcs,tcs4525";
-+ reg = <0x1c>;
-+ vin-supply = <&vcc5v0_sys>;
-+ regulator-compatible = "fan53555-reg";
-+ pinctrl-0 = <&vsel1_gpio>;
-+ vsel-gpios = <&gpio1 RK_PC1 GPIO_ACTIVE_HIGH>;
-+ regulator-name = "vdd_cpu_b";
-+ regulator-min-microvolt = <712500>;
-+ regulator-max-microvolt = <1500000>;
-+ regulator-ramp-delay = <2300>;
-+ fcs,suspend-voltage-selector = <1>;
-+ regulator-always-on;
-+ regulator-boot-on;
-+ regulator-initial-state = <3>;
-+ regulator-state-mem {
-+ regulator-off-in-suspend;
-+ };
-+ };
-+
-+ vdd_gpu: tcs4526@10 {
-+ compatible = "tcs,tcs4526";
-+ reg = <0x10>;
-+ vin-supply = <&vcc5v0_sys>;
-+ regulator-compatible = "fan53555-reg";
-+ pinctrl-0 = <&vsel2_gpio>;
-+ vsel-gpios = <&gpio1 RK_PB6 GPIO_ACTIVE_HIGH>;
-+ regulator-name = "vdd_gpu";
-+ regulator-min-microvolt = <735000>;
-+ regulator-max-microvolt = <1400000>;
-+ regulator-ramp-delay = <1000>;
-+ fcs,suspend-voltage-selector = <1>;
-+ regulator-always-on;
-+ regulator-boot-on;
-+ regulator-initial-state = <3>;
-+ regulator-state-mem {
-+ regulator-off-in-suspend;
-+ };
-+ };
- };
-+
-+&i2s2 {
-+ status = "okay";
-+};
-
- &i2c1 {
-@@ -381,6 +380,29 @@
- pmic_int_l: pmic-int-l {
- rockchip,pins = <1 RK_PC2 0 &pcfg_pull_up>;
- };
-+ vsel1_gpio: vsel1-gpio {
-+ rockchip,pins =
-+ <1 RK_PC1 0 &pcfg_pull_down>;
-+ };
-+ vsel2_gpio: vsel2-gpio {
-+ rockchip,pins =
-+ <1 RK_PB6 0 &pcfg_pull_down>;
-+ };
-+
-+ soc_slppin_gpio: soc-slppin-gpio {
-+ rockchip,pins =
-+ <1 RK_PA5 0 &pcfg_output_low>;
-+ };
-+
-+ soc_slppin_slp: soc-slppin-slp {
-+ rockchip,pins =
-+ <1 RK_PA5 1 &pcfg_pull_down>;
-+ };
-+
-+ soc_slppin_rst: soc-slppin-rst {
-+ rockchip,pins =
-+ <1 RK_PA5 2 &pcfg_pull_none>;
-+ };
- };
-
- sdio-pwrseq {
---- a/arch/arm64/boot/dts/rockchip/rk3399pro-rock-pi-n10.dts 2021-04-07 13:00:14.000000000 +0000
-+++ b/arch/arm64/boot/dts/rockchip/rk3399pro-rock-pi-n10.dts 2021-04-07 13:00:14.000000000 +0000
-@@ -20,3 +20,7 @@
- stdout-path = "serial2:1500000n8";
- };
- };
-+
-+&uart2 {
-+ status = "okay";
-+};
diff --git a/projects/Rockchip/patches/linux/default/linux-1001-drm-rockchip.patch b/projects/Rockchip/patches/linux/default/linux-1001-drm-rockchip.patch
index 7b00183069..5c159a9078 100644
--- a/projects/Rockchip/patches/linux/default/linux-1001-drm-rockchip.patch
+++ b/projects/Rockchip/patches/linux/default/linux-1001-drm-rockchip.patch
@@ -3421,6 +3421,7 @@ index 3719309ad0d0..00025dcd3bb9 100644
{ /* sentinel */ }
};
+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Algea Cao
Date: Wed, 6 Jun 2018 15:47:12 +0800
@@ -3456,3 +3457,48 @@ index 3340aef73d8d..d798846579f5 100644
switch (hdmi_bus_fmt_color_depth(hdmi->hdmi_data.enc_out_bus_format)) {
case 8:
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Alex Bee
+Date: Tue, 1 Jun 2021 19:24:37 +0200
+Subject: [PATCH] drm/rockchip: allow 4096px with modes
+
+There is no reason to limit to modes up to 3840.
+Also drop the limitation from dw_hdmi_rockchip_mode_valid, since
+the max dimenstions of the actual vop version is validated in
+vop_crtc_mode_valid anyways.
+
+Signed-off-by: Alex Bee
+---
+ drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 2 +-
+ drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
+index a612bf3da9ee..e4cfa6adbd87 100644
+--- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
++++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
+@@ -329,7 +329,7 @@ dw_hdmi_rockchip_mode_valid(struct dw_hdmi *hdmi, void *data,
+ return MODE_CLOCK_HIGH;
+ }
+
+- return drm_mode_validate_size(mode, 3840, 2160);
++ return MODE_OK;
+ }
+
+ static void
+diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+index 5622ffd1b587..a0d27a9a9675 100644
+--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
++++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+@@ -401,8 +401,8 @@ static void scl_vop_cal_scl_fac(struct vop *vop, const struct vop_win_data *win,
+ if (info->is_yuv)
+ is_yuv = true;
+
+- if (dst_w > 3840) {
+- DRM_DEV_ERROR(vop->dev, "Maximum dst width (3840) exceeded\n");
++ if (dst_w > 4096) {
++ DRM_DEV_ERROR(vop->dev, "Maximum dst width (4096) exceeded\n");
+ return;
+ }
+
diff --git a/projects/Rockchip/patches/linux/default/linux-1002-v4l2-rockchip.patch b/projects/Rockchip/patches/linux/default/linux-1002-v4l2-rockchip.patch
index 5189a283c9..b6e8d01e2c 100644
--- a/projects/Rockchip/patches/linux/default/linux-1002-v4l2-rockchip.patch
+++ b/projects/Rockchip/patches/linux/default/linux-1002-v4l2-rockchip.patch
@@ -10,7 +10,7 @@ Signed-off-by: Jonas Karlman
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
-index 87987a782d75..a1c33905970d 100644
+index 9492822c12ae..b49541f8ecf5 100644
--- a/drivers/staging/media/rkvdec/rkvdec.c
+++ b/drivers/staging/media/rkvdec/rkvdec.c
@@ -1024,7 +1024,8 @@ static irqreturn_t rkvdec_irq_handler(int irq, void *priv)
@@ -46,7 +46,7 @@ Signed-off-by: Jonas Karlman
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
-index a1c33905970d..8c2ff05e01f7 100644
+index b49541f8ecf5..51e257a0233d 100644
--- a/drivers/staging/media/rkvdec/rkvdec.c
+++ b/drivers/staging/media/rkvdec/rkvdec.c
@@ -1145,9 +1145,9 @@ static int rkvdec_remove(struct platform_device *pdev)
@@ -712,7 +712,7 @@ index 15b9bee92016..3acc914888f6 100644
#define RKVDEC_REG_SYSCTRL 0x008
#define RKVDEC_IN_ENDIAN BIT(0)
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
-index 8c2ff05e01f7..bd0297239c6a 100644
+index 51e257a0233d..c05ba31ed656 100644
--- a/drivers/staging/media/rkvdec/rkvdec.c
+++ b/drivers/staging/media/rkvdec/rkvdec.c
@@ -10,12 +10,15 @@
@@ -1008,7 +1008,7 @@ Signed-off-by: Alex Bee
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
-index bd0297239c6a..8aa946f8f7ad 100644
+index c05ba31ed656..4111155d62f4 100644
--- a/drivers/staging/media/rkvdec/rkvdec.c
+++ b/drivers/staging/media/rkvdec/rkvdec.c
@@ -1134,10 +1134,12 @@ static int rkvdec_probe(struct platform_device *pdev)
diff --git a/projects/Rockchip/patches/linux/default/linux-1003-for-libreelec.patch b/projects/Rockchip/patches/linux/default/linux-1003-for-libreelec.patch
index c0cde82679..10702a006c 100644
--- a/projects/Rockchip/patches/linux/default/linux-1003-for-libreelec.patch
+++ b/projects/Rockchip/patches/linux/default/linux-1003-for-libreelec.patch
@@ -828,3 +828,161 @@ index fb7599f07af4..155f22b53103 100644
mmc-hs400-1_8v;
mmc-hs400-enhanced-strobe;
non-removable;
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Alex Bee
+Date: Tue, 1 Jun 2021 19:37:07 +0200
+Subject: [PATCH] arm64: dts: rockchip: re-add regulator-always-on for vdd_vpu
+
+Seems to be required by panfrost.
+
+Fixes: ec7d731d81e7 ("arm64: dts: rockchip: Add node for gpu on rk3399-roc-pc")
+Signed-off-by: Alex Bee
+---
+ arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
+index 20309076dbac..e4345e5bdfb6 100644
+--- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
++++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
+@@ -488,6 +488,8 @@ vdd_gpu: regulator@41 {
+ regulator-min-microvolt = <712500>;
+ regulator-max-microvolt = <1500000>;
+ regulator-ramp-delay = <1000>;
++ regulator-always-on;
++ regulator-boot-on;
+ vin-supply = <&vcc3v3_sys>;
+
+ regulator-state-mem {
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum
+Date: Tue, 1 Jun 2021 19:42:31 +0200
+Subject: [PATCH] arm64: dts: rockchip: dts additions for Rock Pi N10
+
+---
+ .../dts/rockchip/rk3399pro-rock-pi-n10.dts | 4 +
+ .../dts/rockchip/rk3399pro-vmarc-som.dtsi | 83 +++++++++++++++++++
+ 2 files changed, 87 insertions(+)
+
+diff --git a/arch/arm64/boot/dts/rockchip/rk3399pro-rock-pi-n10.dts b/arch/arm64/boot/dts/rockchip/rk3399pro-rock-pi-n10.dts
+index 369de5dc0ebd..48ac0cfa93c0 100644
+--- a/arch/arm64/boot/dts/rockchip/rk3399pro-rock-pi-n10.dts
++++ b/arch/arm64/boot/dts/rockchip/rk3399pro-rock-pi-n10.dts
+@@ -20,3 +20,7 @@ chosen {
+ stdout-path = "serial2:1500000n8";
+ };
+ };
++
++&uart2 {
++ status = "okay";
++};
+diff --git a/arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi b/arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi
+index 7257494d2831..9e2994e27d05 100644
+--- a/arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi
++++ b/arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi
+@@ -57,6 +57,22 @@ &hdmi {
+ pinctrl-0 = <&hdmi_cec>;
+ };
+
++&hdmi_sound {
++ status = "okay";
++};
++
++&gpu {
++ mali-supply = <&vdd_gpu>;
++ assigned-clocks = <&cru ACLK_GPU>;
++ assigned-clock-rates = <200000000>;
++ status = "okay";
++ /delete-property/ operating-points-v2;
++};
++
++&vopl {
++ status = "disabled";
++};
++
+ &i2c0 {
+ clock-frequency = <400000>;
+ i2c-scl-falling-time-ns = <30>;
+@@ -280,6 +296,50 @@ regulator-state-mem {
+ };
+ };
+ };
++
++ vdd_cpu_b: tcs4525@1c {
++ compatible = "tcs,tcs4525";
++ reg = <0x1c>;
++ vin-supply = <&vcc5v0_sys>;
++ regulator-compatible = "fan53555-reg";
++ pinctrl-0 = <&vsel1_gpio>;
++ vsel-gpios = <&gpio1 RK_PC1 GPIO_ACTIVE_HIGH>;
++ regulator-name = "vdd_cpu_b";
++ regulator-min-microvolt = <712500>;
++ regulator-max-microvolt = <1500000>;
++ regulator-ramp-delay = <2300>;
++ fcs,suspend-voltage-selector = <1>;
++ regulator-always-on;
++ regulator-boot-on;
++ regulator-initial-state = <3>;
++ regulator-state-mem {
++ regulator-off-in-suspend;
++ };
++ };
++
++ vdd_gpu: tcs4526@10 {
++ compatible = "tcs,tcs4526";
++ reg = <0x10>;
++ vin-supply = <&vcc5v0_sys>;
++ regulator-compatible = "fan53555-reg";
++ pinctrl-0 = <&vsel2_gpio>;
++ vsel-gpios = <&gpio1 RK_PB6 GPIO_ACTIVE_HIGH>;
++ regulator-name = "vdd_gpu";
++ regulator-min-microvolt = <735000>;
++ regulator-max-microvolt = <1400000>;
++ regulator-ramp-delay = <1000>;
++ fcs,suspend-voltage-selector = <1>;
++ regulator-always-on;
++ regulator-boot-on;
++ regulator-initial-state = <3>;
++ regulator-state-mem {
++ regulator-off-in-suspend;
++ };
++ };
++};
++
++&i2s2 {
++ status = "okay";
+ };
+
+ &i2c1 {
+@@ -351,6 +411,29 @@ pmic {
+ pmic_int_l: pmic-int-l {
+ rockchip,pins = <1 RK_PC2 0 &pcfg_pull_up>;
+ };
++ vsel1_gpio: vsel1-gpio {
++ rockchip,pins =
++ <1 RK_PC1 0 &pcfg_pull_down>;
++ };
++ vsel2_gpio: vsel2-gpio {
++ rockchip,pins =
++ <1 RK_PB6 0 &pcfg_pull_down>;
++ };
++
++ soc_slppin_gpio: soc-slppin-gpio {
++ rockchip,pins =
++ <1 RK_PA5 0 &pcfg_output_low>;
++ };
++
++ soc_slppin_slp: soc-slppin-slp {
++ rockchip,pins =
++ <1 RK_PA5 1 &pcfg_pull_down>;
++ };
++
++ soc_slppin_rst: soc-slppin-rst {
++ rockchip,pins =
++ <1 RK_PA5 2 &pcfg_pull_none>;
++ };
+ };
+
+ sdio-pwrseq {
diff --git a/projects/Rockchip/patches/linux/default/linux-2000-v4l-wip-rkvdec-vp9.patch b/projects/Rockchip/patches/linux/default/linux-2000-v4l-wip-rkvdec-vp9.patch
index e9f0750d73..0cac47555d 100644
--- a/projects/Rockchip/patches/linux/default/linux-2000-v4l-wip-rkvdec-vp9.patch
+++ b/projects/Rockchip/patches/linux/default/linux-2000-v4l-wip-rkvdec-vp9.patch
@@ -15,7 +15,7 @@ Signed-off-by: Adrian Ratiu
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
-index 8aa946f8f7ad..6768fffe4d94 100644
+index 4111155d62f4..c4e0ec16c285 100644
--- a/drivers/staging/media/rkvdec/rkvdec.c
+++ b/drivers/staging/media/rkvdec/rkvdec.c
@@ -546,7 +546,15 @@ static int rkvdec_buf_prepare(struct vb2_buffer *vb)
@@ -637,7 +637,7 @@ index ce728c757eaf..456488f2b5ca 100644
\normalsize
diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
-index cfe422d9f439..1666a7ec873a 100644
+index 41f8410d08d6..7ed11f296008 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -971,6 +971,11 @@ const char *v4l2_ctrl_get_name(u32 id)
@@ -901,7 +901,7 @@ index cfe422d9f439..1666a7ec873a 100644
case V4L2_CTRL_TYPE_HEVC_SPS:
p_hevc_sps = p;
-@@ -2618,6 +2851,12 @@ static struct v4l2_ctrl *v4l2_ctrl_new(struct v4l2_ctrl_handler *hdl,
+@@ -2635,6 +2868,12 @@ static struct v4l2_ctrl *v4l2_ctrl_new(struct v4l2_ctrl_handler *hdl,
case V4L2_CTRL_TYPE_VP8_FRAME_HEADER:
elem_size = sizeof(struct v4l2_ctrl_vp8_frame_header);
break;
@@ -927,7 +927,7 @@ index 1ff68c1bf14a..783733bef2da 100644
case V4L2_PIX_FMT_HEVC_SLICE: descr = "HEVC Parsed Slice Data"; break;
case V4L2_PIX_FMT_FWHT: descr = "FWHT"; break; /* used in vicodec */
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
-index cb25f345e9ad..fb299d83df6b 100644
+index 9ecbb98908f0..ebcb34759ad8 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -21,6 +21,7 @@
@@ -3061,7 +3061,7 @@ index 000000000000..8b443ed511c9
+ .done = rkvdec_vp9_done,
+};
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
-index 6768fffe4d94..f3cb15dc60ca 100644
+index c4e0ec16c285..f3578c5ea902 100644
--- a/drivers/staging/media/rkvdec/rkvdec.c
+++ b/drivers/staging/media/rkvdec/rkvdec.c
@@ -162,6 +162,40 @@ static const u32 rkvdec_h264_decoded_fmts[] = {
diff --git a/projects/Rockchip/patches/linux/default/linux-2001-v4l-wip-rkvdec-hevc.patch b/projects/Rockchip/patches/linux/default/linux-2001-v4l-wip-rkvdec-hevc.patch
index ecb6010e22..7fd256b17d 100644
--- a/projects/Rockchip/patches/linux/default/linux-2001-v4l-wip-rkvdec-hevc.patch
+++ b/projects/Rockchip/patches/linux/default/linux-2001-v4l-wip-rkvdec-hevc.patch
@@ -78,7 +78,7 @@ index d585909bc4e2..f817c643761b 100644
Buffers associated with this pixel format must contain the appropriate
number of macroblocks to decode a full corresponding frame.
diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
-index 1666a7ec873a..92bbfb81610d 100644
+index 7ed11f296008..a2609de88d26 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -1026,6 +1026,7 @@ const char *v4l2_ctrl_get_name(u32 id)
@@ -109,7 +109,7 @@ index 1666a7ec873a..92bbfb81610d 100644
case V4L2_CTRL_TYPE_AREA:
area = p;
if (!area->width || !area->height)
-@@ -2866,6 +2873,9 @@ static struct v4l2_ctrl *v4l2_ctrl_new(struct v4l2_ctrl_handler *hdl,
+@@ -2883,6 +2890,9 @@ static struct v4l2_ctrl *v4l2_ctrl_new(struct v4l2_ctrl_handler *hdl,
case V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS:
elem_size = sizeof(struct v4l2_ctrl_hevc_slice_params);
break;
@@ -2898,7 +2898,7 @@ index 3acc914888f6..4addfaefdfb4 100644
#define RKVDEC_MODE_VP9 2
#define RKVDEC_RPS_MODE BIT(24)
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
-index f3cb15dc60ca..fa53bbce95f2 100644
+index f3578c5ea902..a44db1aa161e 100644
--- a/drivers/staging/media/rkvdec/rkvdec.c
+++ b/drivers/staging/media/rkvdec/rkvdec.c
@@ -162,6 +162,61 @@ static const u32 rkvdec_h264_decoded_fmts[] = {
@@ -3038,7 +3038,7 @@ index 03ba848411c6..b8ad7fc2271c 100644
.stop = rkvdec_hevc_stop,
.run = rkvdec_hevc_run,
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
-index fa53bbce95f2..8c8c075635a1 100644
+index a44db1aa161e..7419ae7027ab 100644
--- a/drivers/staging/media/rkvdec/rkvdec.c
+++ b/drivers/staging/media/rkvdec/rkvdec.c
@@ -79,6 +79,26 @@ static int rkvdec_try_ctrl(struct v4l2_ctrl *ctrl)
@@ -3243,7 +3243,7 @@ Signed-off-by: Alex Bee
2 files changed, 84 insertions(+), 30 deletions(-)
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
-index 8c8c075635a1..6c19b535f468 100644
+index 7419ae7027ab..ab8b42f4f98c 100644
--- a/drivers/staging/media/rkvdec/rkvdec.c
+++ b/drivers/staging/media/rkvdec/rkvdec.c
@@ -14,6 +14,7 @@
@@ -3515,7 +3515,7 @@ Signed-off-by: Alex Bee
1 file changed, 8 insertions(+)
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
-index 6c19b535f468..c3fbf9c94a11 100644
+index ab8b42f4f98c..162623567a1d 100644
--- a/drivers/staging/media/rkvdec/rkvdec.c
+++ b/drivers/staging/media/rkvdec/rkvdec.c
@@ -1285,11 +1285,19 @@ static const struct rkvdec_variant rk3399_rkvdec_variant = {
diff --git a/scripts/uboot_helper b/scripts/uboot_helper
index da3b7dbb5b..6eb71406ff 100755
--- a/scripts/uboot_helper
+++ b/scripts/uboot_helper
@@ -289,7 +289,7 @@ devices = \
'config': 'evb-rk3399_defconfig'
},
'rock-pi-4': {
- 'dtb': 'rk3399-rock-pi-4a.dtb',
+ 'dtb': 'rk3399-rock-pi-4b.dtb',
'config': 'evb-rk3399_defconfig'
},
'rock-pi-n10': {
@@ -301,7 +301,7 @@ devices = \
'config': 'evb-rk3399_defconfig'
},
'roc-pc': {
- 'dtb': 'rk3399-roc-pc.dtb',
+ 'dtb': 'rk3399-roc-pc-mezzanine.dtb',
'config': 'evb-rk3399_defconfig'
},
'sapphire': {