sunxi-5.19: update megous patches and switch to v5.19.5 (#4134)

* sunxi-5.19: type: Delete lines of non-existent files

* sunxi-5.19: update the upstream megous patches

* sunxi-5.19: switch EDGE to v5.19.5

* Update sunxi64_common.inc

* Update sunxi_common.inc

* Update sunxi64_common.inc

* Update sunxi_common.inc

Co-authored-by: Igor Pečovnik <igorpecovnik@users.noreply.github.com>
This commit is contained in:
The-going 2022-09-02 00:07:32 +03:00 committed by GitHub
parent ac20afc062
commit ce9e47d397
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 350 additions and 6 deletions

View File

@ -18,12 +18,12 @@ case $BRANCH in
current)
KERNEL_VERSION_LEVEL="5.15"
KERNELSWITCHOBJ="tag=v5.15.63"
KERNELSWITCHOBJ="tag=v5.15.64"
;;
edge)
KERNEL_VERSION_LEVEL=${KERNEL_VERSION_LEVEL:-5.19}
KERNELSWITCHOBJ=${KERNELSWITCHOBJ:-'tag=v5.19.4'}
KERNELSWITCHOBJ=${KERNELSWITCHOBJ:-'tag=v5.19.6'}
;;
esac

View File

@ -18,11 +18,11 @@ case $BRANCH in
;;
current)
KERNEL_VERSION_LEVEL="5.15"
KERNELSWITCHOBJ="tag=v5.15.63"
KERNELSWITCHOBJ="tag=v5.15.64"
;;
edge)
KERNEL_VERSION_LEVEL=${KERNEL_VERSION_LEVEL:-5.19}
KERNELSWITCHOBJ=${KERNELSWITCHOBJ:-'tag=v5.19.4'}
KERNELSWITCHOBJ=${KERNELSWITCHOBJ:-'tag=v5.19.6'}
;;
esac

View File

@ -0,0 +1,31 @@
From b2d530e10864ed6dfff6705ca4704ff4b59b5ec6 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Mon, 29 Aug 2022 23:27:53 +0200
Subject: [PATCH 440/440] arm64: dts: rk3399-pinebook-pro: Fix codec frequency
after boot
Better fix. (for squashing into the previous patch with the same subject)
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts
index 39a1c144e070..65e05d31812d 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts
@@ -688,8 +688,8 @@ es8316: es8316@11 {
reg = <0x11>;
clocks = <&cru SCLK_I2S_8CH_OUT>;
clock-names = "mclk";
- assigned-clocks = <&cru SCLK_I2S0_8CH>;
- assigned-clock-rates = <11289599>;
+ assigned-clocks = <&cru SCLK_I2S_8CH_OUT>, <&cru SCLK_I2S1_8CH>;
+ assigned-clock-rates = <11289599>, <11289599>;
#sound-dai-cells = <0>;
};
};
--
2.35.3

View File

@ -0,0 +1,33 @@
From fcd6cf19394430b8efca31f5917b92edc835b569 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Sat, 27 Aug 2022 20:48:32 +0200
Subject: [PATCH 436/440] ASoC: codec: rt5640: Resolve failure to set DMIC
clock after playback
rt5640_set_dai_sysclk is called with freq == 0 when playback stops. This
causes DMIC setup code to fail. I2S interface doesn't need to be active
for codec to work, so don't clear rt5640->sysclk after rt5640_set_dai_sysclk
is called with freq == 0.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
sound/soc/codecs/rt5640.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c
index 2f7e3cc4a37b..c2e0a6215e53 100644
--- a/sound/soc/codecs/rt5640.c
+++ b/sound/soc/codecs/rt5640.c
@@ -1840,6 +1840,9 @@ static int rt5640_set_dai_sysclk(struct snd_soc_dai *dai,
unsigned int reg_val = 0;
unsigned int pll_bit = 0;
+ if (freq == 0)
+ return 0;
+
switch (clk_id) {
case RT5640_SCLK_S_MCLK:
reg_val |= RT5640_SCLK_SRC_MCLK;
--
2.35.3

View File

@ -0,0 +1,30 @@
From edf4d9f856825bf04edf501a4c189a3338dbd877 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Sun, 28 Aug 2022 16:00:26 +0200
Subject: [PATCH 438/440] arm64: dts: rk3399-pinebook-pro: Fix codec frequency
after boot
Without assigned clocks, codec mclk would have too high frequency right
after boot.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts
index 9bacd625f496..39a1c144e070 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts
@@ -688,6 +688,8 @@ es8316: es8316@11 {
reg = <0x11>;
clocks = <&cru SCLK_I2S_8CH_OUT>;
clock-names = "mclk";
+ assigned-clocks = <&cru SCLK_I2S0_8CH>;
+ assigned-clock-rates = <11289599>;
#sound-dai-cells = <0>;
};
};
--
2.35.3

View File

@ -0,0 +1,38 @@
From f12f981006f00bb3ac85e8ad7b10e6ca3a20437c Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Thu, 25 Aug 2022 00:29:15 +0200
Subject: [PATCH 435/440] clk: rk3399: Allow to set rate of clk_i2s0_frac's
parent
Otherwise when when clk_i2s0 muxes to clk_i2s0_div which requires
setting high divider value on clk_i2s0_div, and then muxes back to
clk_i2s0_frac, clk_i2s0_frac would have no way to change the
clk_i2s0_div's divider ratio back to 1 so that it can satisfy the
condition for m/n > 20 for fractional division to work correctly.
Bug is reproducible by playing 44.1k audio, then 48k audio, and then
44.1k audio again. This results in clk_i2s0_div being set to 49 and
clk_i2s0_frac not being able to cope with such a low input clock rate
and audio playing extremely slowly.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
drivers/clk/rockchip/clk-rk3399.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/rockchip/clk-rk3399.c b/drivers/clk/rockchip/clk-rk3399.c
index 897581ef6761..e1639aa8db13 100644
--- a/drivers/clk/rockchip/clk-rk3399.c
+++ b/drivers/clk/rockchip/clk-rk3399.c
@@ -597,7 +597,7 @@ static struct rockchip_clk_branch rk3399_clk_branches[] __initdata = {
COMPOSITE(0, "clk_i2s0_div", mux_pll_src_cpll_gpll_p, 0,
RK3399_CLKSEL_CON(28), 7, 1, MFLAGS, 0, 7, DFLAGS,
RK3399_CLKGATE_CON(8), 3, GFLAGS),
- COMPOSITE_FRACMUX(0, "clk_i2s0_frac", "clk_i2s0_div", 0,
+ COMPOSITE_FRACMUX(0, "clk_i2s0_frac", "clk_i2s0_div", CLK_SET_RATE_PARENT,
RK3399_CLKSEL_CON(96), 0,
RK3399_CLKGATE_CON(8), 4, GFLAGS,
&rk3399_i2s0_fracmux),
--
2.35.3

View File

@ -0,0 +1,39 @@
From b75f32c61253927357bdcb31e322842ff597a39b Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Mon, 29 Aug 2022 23:27:41 +0200
Subject: [PATCH 439/440] clk: rockchip: rk3399: Fix audio clock setting on
I2S1 and I2S2 clocks
This is the same idea/issue as with previous fix for I2S0. This fixes
Pinebook Pro audio slowdown when changing playback rates.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
drivers/clk/rockchip/clk-rk3399.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/rockchip/clk-rk3399.c b/drivers/clk/rockchip/clk-rk3399.c
index e1639aa8db13..22cb025ee4f9 100644
--- a/drivers/clk/rockchip/clk-rk3399.c
+++ b/drivers/clk/rockchip/clk-rk3399.c
@@ -607,7 +607,7 @@ static struct rockchip_clk_branch rk3399_clk_branches[] __initdata = {
COMPOSITE(0, "clk_i2s1_div", mux_pll_src_cpll_gpll_p, 0,
RK3399_CLKSEL_CON(29), 7, 1, MFLAGS, 0, 7, DFLAGS,
RK3399_CLKGATE_CON(8), 6, GFLAGS),
- COMPOSITE_FRACMUX(0, "clk_i2s1_frac", "clk_i2s1_div", 0,
+ COMPOSITE_FRACMUX(0, "clk_i2s1_frac", "clk_i2s1_div", CLK_SET_RATE_PARENT,
RK3399_CLKSEL_CON(97), 0,
RK3399_CLKGATE_CON(8), 7, GFLAGS,
&rk3399_i2s1_fracmux),
@@ -617,7 +617,7 @@ static struct rockchip_clk_branch rk3399_clk_branches[] __initdata = {
COMPOSITE(0, "clk_i2s2_div", mux_pll_src_cpll_gpll_p, 0,
RK3399_CLKSEL_CON(30), 7, 1, MFLAGS, 0, 7, DFLAGS,
RK3399_CLKGATE_CON(8), 9, GFLAGS),
- COMPOSITE_FRACMUX(0, "clk_i2s2_frac", "clk_i2s2_div", 0,
+ COMPOSITE_FRACMUX(0, "clk_i2s2_frac", "clk_i2s2_div", CLK_SET_RATE_PARENT,
RK3399_CLKSEL_CON(98), 0,
RK3399_CLKGATE_CON(8), 10, GFLAGS,
&rk3399_i2s2_fracmux),
--
2.35.3

View File

@ -0,0 +1,87 @@
From 51cd30c9cb96b90595de1772a0592f77a2dbf072 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Mon, 22 Aug 2022 13:34:31 +0200
Subject: [PATCH 433/440] drm: rockchip: Don't require MIPI DSI device when
it's used for ISP
On RK3399 one MIPI DSI device can be alternatively used with the ISP1,
to provide RX DPHY. When this is the case (ISP1 is enabled in device
tree), probe success of DRM is tied to probe success of ISP1 connected
camera sensor. This can fail if the user is able to killswitch the camera
power, like on Pinephone Pro.
Detect use of MIPI DSI controller by ISP, and don't include it in
component match list in that case.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 46 +++++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
index 13ed33e74457..bb033e865315 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
@@ -356,6 +356,42 @@ static void rockchip_drm_match_remove(struct device *dev)
device_link_del(link);
}
+/*
+ * Check if ISP block linked to a mipi-dsi device via phys phandle is
+ * enabled in device tree.
+ */
+static bool rockchip_drm_is_mipi1_and_used_by_isp(struct device *dev)
+{
+ struct device_node *np = NULL, *phy_np;
+
+ if (!of_device_is_compatible(dev->of_node, "rockchip,rk3399-mipi-dsi"))
+ return false;
+
+ while (true) {
+ np = of_find_compatible_node(np, NULL, "rockchip,rk3399-cif-isp");
+ if (!np)
+ break;
+
+ if (!of_device_is_available(np)) {
+ of_node_put(np);
+ continue;
+ }
+
+ phy_np = of_parse_phandle(np, "phys", 0);
+
+ if (!phy_np)
+ continue;
+
+ of_node_put(phy_np);
+ of_node_put(np);
+
+ if (phy_np == dev->of_node)
+ return true;
+ }
+
+ return false;
+}
+
static struct component_match *rockchip_drm_match_add(struct device *dev)
{
struct component_match *match = NULL;
@@ -373,6 +409,16 @@ static struct component_match *rockchip_drm_match_add(struct device *dev)
if (!d)
break;
+ /*
+ * If mipi1 is connected to ISP, we don't want to wait for mipi1 component,
+ * because it will not be used by DRM anyway, to not tie success of camera
+ * driver probe to display pipeline initialization.
+ */
+ if (rockchip_drm_is_mipi1_and_used_by_isp(d)) {
+ dev_info(d, "used by ISP1, skipping from DRM\n");
+ continue;
+ }
+
device_link_add(dev, d, DL_FLAG_STATELESS);
component_match_add(dev, &match, component_compare_dev, d);
} while (true);
--
2.35.3

View File

@ -0,0 +1,32 @@
From 194ffdafd0599b9d157cb76d0740d275a3c12b4c Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Mon, 22 Aug 2022 15:09:56 +0200
Subject: [PATCH 434/440] drm: rockchip: Fix mem leak
Previous patch forgot to free dev node.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
index bb033e865315..96389c527fe3 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
@@ -378,9 +378,10 @@ static bool rockchip_drm_is_mipi1_and_used_by_isp(struct device *dev)
}
phy_np = of_parse_phandle(np, "phys", 0);
-
- if (!phy_np)
+ if (!phy_np) {
+ of_node_put(np);
continue;
+ }
of_node_put(phy_np);
of_node_put(np);
--
2.35.3

View File

@ -0,0 +1,36 @@
From 5b6d21991c883ca92c112bd5f37972296b5fc46a Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Sat, 27 Aug 2022 20:50:43 +0200
Subject: [PATCH 437/440] power: supply: axp20x-battery: Enable poweron by RTC
alarm
For the Pinephone to be able to poweron on RTC alarm, some bits in
PMIC need to be enabled. This will cause PMIC to be wakeable by
SoC pulling the interrupt line low.
This may need some coordination from a bootloader.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
drivers/power/supply/axp20x_battery.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/power/supply/axp20x_battery.c b/drivers/power/supply/axp20x_battery.c
index e982f66f5f28..c7834aa73d6b 100644
--- a/drivers/power/supply/axp20x_battery.c
+++ b/drivers/power/supply/axp20x_battery.c
@@ -856,6 +856,11 @@ static int axp20x_power_probe(struct platform_device *pdev)
ret = regmap_update_bits(axp20x_batt->regmap, 0x84, 0x37, 0x31);
if (ret)
goto warn_bat;
+
+ // enable poweron by RTC
+ ret = regmap_update_bits(axp20x_batt->regmap, 0x8f, BIT(7), BIT(7));
+ if (ret)
+ goto warn_bat;
}
return 0;
--
2.35.3

View File

@ -190,8 +190,6 @@
patches.megous/Bluetooth-hci_h5-Add-support-for-binding-RTL8723CS-with-device-.patch
patches.megous/drm-sun4i-Fix-wrong-location-of-clk_prepare_enable.patch
patches.megous/drm-panel-st7703-Improve-the-power-up-down-sequence-of-the-pane.patch
- patches.megous/drm-sun4i-sun6i_mipi_dsi-fix-horizontal-timing-calculation.patch
- patches.megous/Revert-drm-sun4i-sun6i_mipi_dsi-fix-horizontal-timing-calculati.patch
patches.megous/drm-sun4i-Implement-gamma-correction.patch
patches.megous/drm-sun4i-sun6i_mipi_dsi-add-support-for-generic-long-write.patch
patches.megous/clk-sunxi-ng-add-support-for-rate-resetting-notifier.patch
@ -434,6 +432,16 @@
patches.megous/ASoC-codec-rt5640-Fix-output-mixer-input-channel-list.patch
patches.megous/ASoC-codecs-rt5640-Fix-hpout-restore-when-lout-is-enabled.patch
patches.megous/arm64-dts-rk3399-pinephone-pro-Fix-initial-codec-clock-frequenc.patch
patches.megous/drm-rockchip-Don-t-require-MIPI-DSI-device-when-it-s-used-for-I.patch
# tag orange-pi-5.19-20220822-1337
patches.megous/drm-rockchip-Fix-mem-leak.patch
patches.megous/clk-rk3399-Allow-to-set-rate-of-clk_i2s0_frac-s-parent.patch
# tag orange-pi-5.19-20220825-0031
patches.megous/ASoC-codec-rt5640-Resolve-failure-to-set-DMIC-clock-after-playb.patch
patches.megous/power-supply-axp20x-battery-Enable-poweron-by-RTC-alarm.patch
patches.megous/arm64-dts-rk3399-pinebook-pro-Fix-codec-frequency-after-boot.patch
patches.megous/clk-rockchip-rk3399-Fix-audio-clock-setting-on-I2S1-and-I2S2-cl.patch
patches.megous/2-arm64-dts-rk3399-pinebook-pro-Fix-codec-frequency-after-boot.patch
#
# Automatically generated by the script mk_format_patch
#

View File

@ -432,3 +432,13 @@
patches.megous/ASoC-codec-rt5640-Fix-output-mixer-input-channel-list.patch
patches.megous/ASoC-codecs-rt5640-Fix-hpout-restore-when-lout-is-enabled.patch
patches.megous/arm64-dts-rk3399-pinephone-pro-Fix-initial-codec-clock-frequenc.patch
patches.megous/drm-rockchip-Don-t-require-MIPI-DSI-device-when-it-s-used-for-I.patch
# tag orange-pi-5.19-20220822-1337
patches.megous/drm-rockchip-Fix-mem-leak.patch
patches.megous/clk-rk3399-Allow-to-set-rate-of-clk_i2s0_frac-s-parent.patch
# tag orange-pi-5.19-20220825-0031
patches.megous/ASoC-codec-rt5640-Resolve-failure-to-set-DMIC-clock-after-playb.patch
patches.megous/power-supply-axp20x-battery-Enable-poweron-by-RTC-alarm.patch
patches.megous/arm64-dts-rk3399-pinebook-pro-Fix-codec-frequency-after-boot.patch
patches.megous/clk-rockchip-rk3399-Fix-audio-clock-setting-on-I2S1-and-I2S2-cl.patch
patches.megous/2-arm64-dts-rk3399-pinebook-pro-Fix-codec-frequency-after-boot.patch