sunxi-6.16: Add megous patches for v6.16.7

This commit is contained in:
The-going
2025-09-17 21:42:08 +03:00
committed by Igor
parent fc3cc6b6e3
commit c1b82e9824
243 changed files with 40083 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
From babd7ba10901306332153cf26d6b97700c3a0630 Mon Sep 17 00:00:00 2001
From: Arnav Singh <me@arnavion.dev>
Date: Mon, 6 May 2024 16:36:06 -0700
Subject: arm64: dts: sun50i: Define orientation and rotation for PinePhone
front camera
This enables libcamera to detect the correct orientation from
the device tree and propagate it further to e.g. Pipewire.
Signed-off-by: Arnav Singh <me@arnavion.dev>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index 1a57720c25ef..f0f1367c5868 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -593,6 +593,9 @@ gc2145: front-camera@3c {
reset-gpios = <&pio 4 16 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; /* PE16 */
enable-gpios = <&pio 4 17 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; /* PE17 */
+ orientation = <0>;
+ rotation = <90>;
+
port {
gc2145_ep: endpoint {
remote-endpoint = <&csi_gc2145_ep>;
--
2.51.0

View File

@@ -0,0 +1,30 @@
From 3b1f07be7287ba414ee6920c1d5a22d200733b37 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Tue, 14 Nov 2017 02:47:51 +0100
Subject: ARM: dts: axp813: Add charger LED
PMIC supports charging status indication via a LED. Add support
for it.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm/boot/dts/allwinner/axp81x.dtsi | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/allwinner/axp81x.dtsi b/arch/arm/boot/dts/allwinner/axp81x.dtsi
index ebaf1c3ce8db..a4b1be159b02 100644
--- a/arch/arm/boot/dts/allwinner/axp81x.dtsi
+++ b/arch/arm/boot/dts/allwinner/axp81x.dtsi
@@ -161,4 +161,9 @@ reg_drivevbus: drivevbus {
usb_power_supply: usb-power {
compatible = "x-powers,axp813-usb-power-supply";
};
+
+ charger_led: charger-led {
+ compatible = "x-powers,axp813-charger-led";
+ status = "disabled";
+ };
};
--
2.51.0

View File

@@ -0,0 +1,185 @@
From 65ab846a1feda2dcedb84b393bee71fa34593c4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Sun, 23 Feb 2020 01:23:10 +0100
Subject: ARM: dts: sun5i: Add PocketBook Touch Lux 3 display/ctp support
Add support for display and touchscreen via out-of-tree drivers.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
.../sun5i-a13-pocketbook-touch-lux-3.dts | 105 +++++++++++++++++-
1 file changed, 103 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/allwinner/sun5i-a13-pocketbook-touch-lux-3.dts b/arch/arm/boot/dts/allwinner/sun5i-a13-pocketbook-touch-lux-3.dts
index d60407772e5d..db28ab621804 100644
--- a/arch/arm/boot/dts/allwinner/sun5i-a13-pocketbook-touch-lux-3.dts
+++ b/arch/arm/boot/dts/allwinner/sun5i-a13-pocketbook-touch-lux-3.dts
@@ -62,6 +62,11 @@ key-left {
};
};
+ regulator-eink {
+ compatible = "custom,reg-userspace-consumer";
+ controlled-supply = <&tp65185x>;
+ };
+
reg_1v8: regulator-1v8 {
compatible = "regulator-fixed";
regulator-name = "vdd-1v8-nor-ctp";
@@ -79,7 +84,6 @@ reg_1v8_nor: regulator-nor {
gpio = <&pio 2 14 GPIO_ACTIVE_HIGH>;
enable-active-high;
vin-supply = <&reg_1v8>;
- regulator-always-on;
};
reg_1v8_ctp: regulator-ctp {
@@ -112,6 +116,7 @@ &ehci0 {
&i2c0 {
status = "okay";
+ //XXX: bsp has pullup on PB0/PB1 pins enabled, but it works without it
axp209: pmic@34 {
reg = <0x34>;
@@ -128,12 +133,42 @@ pcf8563: rtc@51 {
compatible = "nxp,pcf8563";
reg = <0x51>;
};
+
+ // hacky PMIC driver for eInk display
+ tp65185x: regulator@68 {
+ compatible = "tp,tp65185x";
+ reg = <0x68>;
+
+ regulator-min-microvolt = <3120000>;
+ regulator-max-microvolt = <3120000>;
+ regulator-name = "eink-vcom";
+
+ //XXX: we don't use interrupts in the driver right now
+ //interrupt-parent = <&pio>;
+ //interrupts = <1 10 IRQ_TYPE_LEVEL_LOW>; /* PB10 */
+
+ wakeup-gpios = <&pio 3 18 GPIO_ACTIVE_HIGH>; /* PD18 */
+ powerup-gpios = <&pio 4 7 GPIO_ACTIVE_HIGH>; /* PE7 */
+ vcom-gpios = <&pio 3 19 GPIO_ACTIVE_HIGH>; /* PD19 */
+ //XXX: not a pullup on BSP (might have an external resistor)
+ powergood-gpios = <&pio 4 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PE6 */
+ };
};
&i2c2 {
status = "okay";
- /* Touchpanel is connected here. */
+ touchpanel@24 {
+ compatible = "cypress,cyttsp4_i2c_adapter";
+ reg = <0x24>;
+
+ interrupt-parent = <&pio>;
+ interrupts = <6 11 IRQ_TYPE_EDGE_FALLING>; /* PG11 */
+
+ vdd-supply = <&reg_1v8_ctp>;
+ power-gpios = <&pio 4 5 GPIO_ACTIVE_LOW>; /* PE5 */
+ reset-gpios = <&pio 1 3 GPIO_ACTIVE_LOW>; /* PB3 */
+ };
};
&lradc {
@@ -179,6 +214,20 @@ &otg_sram {
status = "okay";
};
+&pio {
+ eink_pins_active: eink-pins-lcd {
+ pins = "PD3", "PD4", "PD5", "PD6", "PD7", "PD10", "PD11", "PD12",
+ "PD13", "PD15", "PD20", "PD21", "PD22", "PD23", "PD24";
+ function = "lcd0";
+ };
+
+ eink_pins_idle: eink-pins-gpio {
+ pins = "PD3", "PD4", "PD5", "PD6", "PD7", "PD10", "PD11", "PD12",
+ "PD13", "PD15", "PD20", "PD21", "PD22", "PD23", "PD24";
+ function = "gpio_out";
+ };
+};
+
&pwm {
pinctrl-names = "default";
pinctrl-0 = <&pwm0_pin>;
@@ -219,6 +268,55 @@ &reg_ldo3 {
regulator-ramp-delay = <1600>;
};
+&soc {
+ display-controller@1c0c000 {
+ pinctrl-names = "idle", "active";
+ pinctrl-0 = <&eink_pins_idle>;
+ pinctrl-1 = <&eink_pins_active>;
+
+ all-gpios = <&pio 3 3 GPIO_ACTIVE_HIGH>,
+ <&pio 3 4 GPIO_ACTIVE_HIGH>,
+ <&pio 3 5 GPIO_ACTIVE_HIGH>,
+ <&pio 3 6 GPIO_ACTIVE_HIGH>,
+ <&pio 3 7 GPIO_ACTIVE_HIGH>,
+ <&pio 3 10 GPIO_ACTIVE_HIGH>,
+ <&pio 3 11 GPIO_ACTIVE_HIGH>,
+ <&pio 3 12 GPIO_ACTIVE_HIGH>,
+ <&pio 3 13 GPIO_ACTIVE_HIGH>,
+ <&pio 3 15 GPIO_ACTIVE_HIGH>,
+ <&pio 3 20 GPIO_ACTIVE_HIGH>,
+ <&pio 3 21 GPIO_ACTIVE_HIGH>,
+ <&pio 3 22 GPIO_ACTIVE_HIGH>,
+ <&pio 3 23 GPIO_ACTIVE_HIGH>,
+ <&pio 3 24 GPIO_ACTIVE_HIGH>;
+
+ compatible = "custom,pocketbook-touch-lux-3-tcon0-ed060xd4-display";
+ reg = <0x01c0c000 0x1000>, // TCON0 regs
+ <0x01e60000 0x10000>; // DEBE regs
+
+ interrupts = <44>; // TCON interrupt
+
+ resets = <&ccu RST_LCD>, <&ccu RST_DE_BE>;
+ reset-names = "tcon", "be";
+
+ clocks = <&ccu CLK_AHB_LCD>, <&ccu CLK_TCON_CH0>,
+ <&ccu CLK_AHB_DE_BE>, <&ccu CLK_DE_BE>,
+ <&ccu CLK_DRAM_DE_BE>;
+ clock-names = "tcon_bus", "tcon_mod",
+ "be_bus", "be_mod",
+ "be_ram";
+
+ assigned-clocks = <&ccu CLK_DE_BE>;
+ assigned-clock-rates = <300000000>;
+
+ interconnects = <&mbus 18>;
+ interconnect-names = "dma-mem";
+
+ panel-supply = <&tp65185x>;
+ control-device-name = "eink-panel";
+ };
+};
+
&spi2 {
pinctrl-names = "default";
pinctrl-0 = <&spi2_pe_pins>, <&spi2_cs0_pe_pin>;
@@ -230,6 +328,7 @@ epd_flash: flash@0 {
compatible = "macronix,mx25u4033", "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <4000000>;
+ vdd-supply = <&reg_1v8_nor>;
};
};
@@ -253,6 +352,8 @@ &usb_power_supply {
};
&usbphy {
+ //XXX: might not work, need to test
+ usb0_vbus_det-gpios = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
usb1_vbus-supply = <&reg_ldo3>;
status = "okay";
};
--
2.51.0

View File

@@ -0,0 +1,26 @@
From c23b72ad5a483643ee89ca9f8731d92774f4735a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Sat, 5 Oct 2019 15:04:43 +0200
Subject: ARM: dts: sun5i: Add soc handle
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm/boot/dts/allwinner/sun5i.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/allwinner/sun5i.dtsi b/arch/arm/boot/dts/allwinner/sun5i.dtsi
index e6836fd4b8dc..126b80f3ca70 100644
--- a/arch/arm/boot/dts/allwinner/sun5i.dtsi
+++ b/arch/arm/boot/dts/allwinner/sun5i.dtsi
@@ -123,7 +123,7 @@ default-pool {
};
};
- soc {
+ soc: soc {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
--
2.51.0

View File

@@ -0,0 +1,27 @@
From 3204bd45b054653cd8c9b5691aea86359822a753 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Thu, 25 Jun 2020 01:57:27 +0200
Subject: ARM: dts: sun5i-a13-pocketbook-touch-lux-3: Add RTC clock-cells
This stop the driver from complaining in dmesg.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm/boot/dts/allwinner/sun5i-a13-pocketbook-touch-lux-3.dts | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/boot/dts/allwinner/sun5i-a13-pocketbook-touch-lux-3.dts b/arch/arm/boot/dts/allwinner/sun5i-a13-pocketbook-touch-lux-3.dts
index db28ab621804..ee81db68e546 100644
--- a/arch/arm/boot/dts/allwinner/sun5i-a13-pocketbook-touch-lux-3.dts
+++ b/arch/arm/boot/dts/allwinner/sun5i-a13-pocketbook-touch-lux-3.dts
@@ -132,6 +132,7 @@ &i2c1 {
pcf8563: rtc@51 {
compatible = "nxp,pcf8563";
reg = <0x51>;
+ #clock-cells = <0>;
};
// hacky PMIC driver for eInk display
--
2.51.0

View File

@@ -0,0 +1,39 @@
From 7c46723de140a192eb485cfdf9ca4ee467d93b1f Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 3 Apr 2021 20:53:26 -0500
Subject: ARM: dts: sun8i: a83t: Add MBUS node
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi b/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
index ccaaa91af9db..53f0d0360f47 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
+++ b/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
@@ -1056,6 +1056,21 @@ mdio: mdio {
};
};
+ mbus: dram-controller@1c62000 {
+ compatible = "allwinner,sun8i-a83t-mbus";
+ reg = <0x01c62000 0x1000>,
+ <0x01c63000 0x1000>;
+ reg-names = "mbus", "dram";
+ clocks = <&ccu CLK_BUS_DRAM>,
+ <&ccu CLK_DRAM>,
+ <&ccu CLK_MBUS>;
+ clock-names = "apb", "dram", "mbus";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ dma-ranges = <0x00000000 0x40000000 0xc0000000>;
+ #interconnect-cells = <1>;
+ };
+
gic: interrupt-controller@1c81000 {
compatible = "arm,gic-400";
reg = <0x01c81000 0x1000>,
--
2.51.0

View File

@@ -0,0 +1,37 @@
From dbfa68bb8bff41a44713e8248f518f045b90f176 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Mon, 9 Sep 2019 06:02:10 +0200
Subject: ARM: dts: sun8i-a83t: Add cedrus video codec support to A83T
[untested]
Not tested at all.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi b/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
index 6f88d8764e6a..e2d64a688db9 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
+++ b/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
@@ -441,6 +441,16 @@ syscon: syscon@1c00000 {
reg = <0x01c00000 0x1000>;
};
+ video-codec@01c0e000 {
+ compatible = "allwinner,sun8i-a83t-video-engine";
+ reg = <0x01c0e000 0x1000>;
+ clocks = <&ccu CLK_BUS_VE>, <&ccu CLK_VE>,
+ <&ccu CLK_DRAM_VE>;
+ clock-names = "ahb", "mod", "ram";
+ resets = <&ccu RST_BUS_VE>;
+ interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
+ };
+
dma: dma-controller@1c02000 {
compatible = "allwinner,sun8i-a83t-dma";
reg = <0x01c02000 0x1000>;
--
2.51.0

View File

@@ -0,0 +1,48 @@
From 4e1ffe039332d9041531f512c208506e571d0a5c Mon Sep 17 00:00:00 2001
From: Jernej Skrabec <jernej.skrabec@gmail.com>
Date: Sun, 9 May 2021 11:32:57 +0200
Subject: ARM: dts: sun8i: a83t: Add hdmi sound card
A83t support HDMI audio. Add a sound card node for it.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi b/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
index f83aded98482..c6e5d556f9f6 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
+++ b/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
@@ -150,6 +150,20 @@ cpu103: cpu@103 {
};
};
+ sound_hdmi: sound_hdmi {
+ compatible = "allwinner,sun9i-a80-hdmi-audio",
+ "allwinner,sun8i-a83t-hdmi-audio";
+ status = "disabled";
+
+ codec {
+ sound-dai = <&hdmi>;
+ };
+
+ cpu {
+ sound-dai = <&i2s2>;
+ };
+ };
+
timer {
compatible = "arm,armv7-timer";
interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
@@ -1059,6 +1073,7 @@ csi: camera@1cb0000 {
};
hdmi: hdmi@1ee0000 {
+ #sound-dai-cells = <0>;
compatible = "allwinner,sun8i-a83t-dw-hdmi";
reg = <0x01ee0000 0x10000>;
reg-io-width = <1>;
--
2.51.0

View File

@@ -0,0 +1,35 @@
From 455e56be4e202bd7dee9cf188e1063e874c8f5d8 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Mon, 13 Mar 2023 06:02:27 +0100
Subject: ARM: dts: sun8i-a83t: Add missing GPU trip point
Without this, thermal sensor driver fails to probe.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi b/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
index e901c62e9075..19fbca52bf90 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
+++ b/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
@@ -1307,6 +1307,15 @@ gpu_thermal: gpu-thermal {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-sensors = <&ths 2>;
+
+ trips {
+ gpu_crit: gpu-crit {
+ /* milliCelsius */
+ temperature = <100000>;
+ hysteresis = <2000>;
+ type = "critical";
+ };
+ };
};
};
};
--
2.51.0

View File

@@ -0,0 +1,69 @@
From ea78de6c4aab8eff9974c40fbefa36042e794c5e Mon Sep 17 00:00:00 2001
From: Jernej Skrabec <jernej.skrabec@gmail.com>
Date: Sun, 9 May 2021 11:34:43 +0200
Subject: ARM: dts: sun8i: a83t: Enable hdmi sound card on boards with hdmi
Each board that has HDMI connector can also transmit audio through it.
Enable HDMI sound card on all A83t boards with HDMI connector.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
arch/arm/boot/dts/allwinner/sun8i-a83t-bananapi-m3.dts | 8 ++++++++
.../arm/boot/dts/allwinner/sun8i-a83t-cubietruck-plus.dts | 8 ++++++++
2 files changed, 16 insertions(+)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-a83t-bananapi-m3.dts b/arch/arm/boot/dts/allwinner/sun8i-a83t-bananapi-m3.dts
index 32e811fa23e2..9a7117bca70d 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-a83t-bananapi-m3.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-a83t-bananapi-m3.dts
@@ -162,6 +162,10 @@ hdmi_out_con: endpoint {
};
};
+&i2s2 {
+ status = "okay";
+};
+
&mdio {
rgmii_phy: ethernet-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
@@ -380,6 +384,10 @@ &reg_sw {
regulator-name = "vcc-ephy";
};
+&sound_hdmi {
+ status = "okay";
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pb_pins>;
diff --git a/arch/arm/boot/dts/allwinner/sun8i-a83t-cubietruck-plus.dts b/arch/arm/boot/dts/allwinner/sun8i-a83t-cubietruck-plus.dts
index d5e6ddaffbce..d4d834084b12 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-a83t-cubietruck-plus.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-a83t-cubietruck-plus.dts
@@ -197,6 +197,10 @@ hdmi_out_con: endpoint {
};
};
+&i2s2 {
+ status = "okay";
+};
+
&mdio {
rgmii_phy: ethernet-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
@@ -417,6 +421,10 @@ &reg_sw {
regulator-name = "vcc-wifi-io";
};
+&sound_hdmi {
+ status = "okay";
+};
+
&spdif {
status = "okay";
};
--
2.51.0

View File

@@ -0,0 +1,134 @@
From 75d25c0f809655532b54cdabe4e5ac810c1fa0cc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Sun, 1 Sep 2019 23:56:49 +0200
Subject: ARM: dts: sun8i-a83t: Improve CPU OPP tables (go up to 1.8GHz)
This table is for the worst SoC bin, so it should work on all A83T
bins.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi | 80 ++++++---------------
1 file changed, 22 insertions(+), 58 deletions(-)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi b/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
index 53f0d0360f47..f83aded98482 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
+++ b/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
@@ -210,45 +210,27 @@ opp-480000000 {
clock-latency-ns = <244144>; /* 8 32k periods */
};
- opp-600000000 {
- opp-hz = /bits/ 64 <600000000>;
- opp-microvolt = <840000>;
- clock-latency-ns = <244144>; /* 8 32k periods */
- };
-
- opp-720000000 {
- opp-hz = /bits/ 64 <720000000>;
- opp-microvolt = <840000>;
- clock-latency-ns = <244144>; /* 8 32k periods */
- };
-
- opp-864000000 {
- opp-hz = /bits/ 64 <864000000>;
- opp-microvolt = <840000>;
- clock-latency-ns = <244144>; /* 8 32k periods */
- };
-
- opp-912000000 {
- opp-hz = /bits/ 64 <912000000>;
+ opp-1008000000 {
+ opp-hz = /bits/ 64 <1008000000>;
opp-microvolt = <840000>;
clock-latency-ns = <244144>; /* 8 32k periods */
};
- opp-1008000000 {
- opp-hz = /bits/ 64 <1008000000>;
- opp-microvolt = <840000>;
+ opp-1412000000 {
+ opp-hz = /bits/ 64 <1412000000>;
+ opp-microvolt = <920000>;
clock-latency-ns = <244144>; /* 8 32k periods */
};
- opp-1128000000 {
- opp-hz = /bits/ 64 <1128000000>;
- opp-microvolt = <840000>;
+ opp-1608000000 {
+ opp-hz = /bits/ 64 <1608000000>;
+ opp-microvolt = <1000000>;
clock-latency-ns = <244144>; /* 8 32k periods */
};
- opp-1200000000 {
- opp-hz = /bits/ 64 <1200000000>;
- opp-microvolt = <840000>;
+ opp-1800000000 {
+ opp-hz = /bits/ 64 <1800000000>;
+ opp-microvolt = <1080000>;
clock-latency-ns = <244144>; /* 8 32k periods */
};
};
@@ -263,45 +245,27 @@ opp-480000000 {
clock-latency-ns = <244144>; /* 8 32k periods */
};
- opp-600000000 {
- opp-hz = /bits/ 64 <600000000>;
- opp-microvolt = <840000>;
- clock-latency-ns = <244144>; /* 8 32k periods */
- };
-
- opp-720000000 {
- opp-hz = /bits/ 64 <720000000>;
- opp-microvolt = <840000>;
- clock-latency-ns = <244144>; /* 8 32k periods */
- };
-
- opp-864000000 {
- opp-hz = /bits/ 64 <864000000>;
- opp-microvolt = <840000>;
- clock-latency-ns = <244144>; /* 8 32k periods */
- };
-
- opp-912000000 {
- opp-hz = /bits/ 64 <912000000>;
+ opp-1008000000 {
+ opp-hz = /bits/ 64 <1008000000>;
opp-microvolt = <840000>;
clock-latency-ns = <244144>; /* 8 32k periods */
};
- opp-1008000000 {
- opp-hz = /bits/ 64 <1008000000>;
- opp-microvolt = <840000>;
+ opp-1412000000 {
+ opp-hz = /bits/ 64 <1412000000>;
+ opp-microvolt = <920000>;
clock-latency-ns = <244144>; /* 8 32k periods */
};
- opp-1128000000 {
- opp-hz = /bits/ 64 <1128000000>;
- opp-microvolt = <840000>;
+ opp-1608000000 {
+ opp-hz = /bits/ 64 <1608000000>;
+ opp-microvolt = <1000000>;
clock-latency-ns = <244144>; /* 8 32k periods */
};
- opp-1200000000 {
- opp-hz = /bits/ 64 <1200000000>;
- opp-microvolt = <840000>;
+ opp-1800000000 {
+ opp-hz = /bits/ 64 <1800000000>;
+ opp-microvolt = <1080000>;
clock-latency-ns = <244144>; /* 8 32k periods */
};
};
--
2.51.0

View File

@@ -0,0 +1,59 @@
From 407da3bb87888f573863184cbd690280c001ad23 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Sat, 1 Feb 2020 23:41:47 +0100
Subject: ARM: dts: sun8i-a83t: Set fifo-size for uarts
Boot time optimization.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi b/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
index c6e5d556f9f6..47c8541f7779 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
+++ b/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
@@ -926,6 +926,7 @@ uart0: serial@1c28000 {
interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>;
reg-io-width = <4>;
+ fifo-size = <64>;
clocks = <&ccu CLK_BUS_UART0>;
resets = <&ccu RST_BUS_UART0>;
status = "disabled";
@@ -937,6 +938,7 @@ uart1: serial@1c28400 {
interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>;
reg-io-width = <4>;
+ fifo-size = <64>;
clocks = <&ccu CLK_BUS_UART1>;
resets = <&ccu RST_BUS_UART1>;
status = "disabled";
@@ -948,6 +950,7 @@ uart2: serial@1c28800 {
interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>;
reg-io-width = <4>;
+ fifo-size = <64>;
clocks = <&ccu CLK_BUS_UART2>;
resets = <&ccu RST_BUS_UART2>;
status = "disabled";
@@ -959,6 +962,7 @@ uart3: serial@1c28c00 {
interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>;
reg-io-width = <4>;
+ fifo-size = <64>;
clocks = <&ccu CLK_BUS_UART3>;
resets = <&ccu RST_BUS_UART3>;
status = "disabled";
@@ -970,6 +974,7 @@ uart4: serial@1c29000 {
interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>;
reg-io-width = <4>;
+ fifo-size = <64>;
clocks = <&ccu CLK_BUS_UART4>;
resets = <&ccu RST_BUS_UART4>;
status = "disabled";
--
2.51.0

View File

@@ -0,0 +1,66 @@
From 8c597603a316edf73fabf320a412b2b636c691cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Fri, 10 Nov 2017 14:33:28 +0100
Subject: ARM: dts: sun8i-a83t-tbs-a711: Add PN544 NFC support
Regulators on the schematic are named incorrectly. Both cameras are
is in fact connected to the dvdd-csi-f regulator and dvdd-csi-r is
in reality used for digital pad supply for NFC chip.
At the same time vcc-mipi regulator is not used for MIPI, but for NFC
VBAT power.
Interpreting schematics is an art form! :D
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
.../boot/dts/allwinner/sun8i-a83t-tbs-a711.dts | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
index 43982b106a4d..5cedbe2455db 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
@@ -190,6 +190,16 @@ accelerometer@18 {
interrupt-parent = <&pio>;
interrupts = <7 10 IRQ_TYPE_EDGE_RISING>; /* PH10 / EINT10 */
};
+
+ /* NFC (NPC 100) */
+ npc100: nfc@28 {
+ compatible = "nxp,nxp-nci-i2c";
+ reg = <0x28>;
+ interrupt-parent = <&r_pio>;
+ interrupts = <0 6 IRQ_TYPE_LEVEL_HIGH>; /* PL6 */
+ enable-gpios = <&pio 3 2 GPIO_ACTIVE_HIGH>; /* PD2 */
+ firmware-gpios = <&pio 3 3 GPIO_ACTIVE_HIGH>; /* PD3 */
+ };
};
&mmc0 {
@@ -368,9 +378,10 @@ &reg_dldo1 {
};
&reg_dldo2 {
- regulator-min-microvolt = <2800000>;
+ regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <4200000>;
- regulator-name = "vcc-mipi";
+ regulator-name = "vbat-nfc";
+ regulator-always-on;
};
&reg_dldo3 {
@@ -393,7 +404,8 @@ &reg_drivevbus {
&reg_eldo1 {
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <1800000>;
- regulator-name = "dvdd-csi-r";
+ regulator-name = "pvdd-nfc";
+ regulator-always-on;
};
&reg_eldo2 {
--
2.51.0

View File

@@ -0,0 +1,180 @@
From b4f121b883403a1eacbe797574da04d8b9867075 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Tue, 23 Jun 2020 19:43:24 +0200
Subject: ARM: dts: sun8i-a83t-tbs-a711: Add camera sensors (HM5065, GC2145)
The tablet has two cameras, that can be switched between. Add
support for the both of them.
Sensor is connected via parallel bus to CSI and via I2C bus to
PE14/PE15 pins. Enable CSI module and add the node for HM5065
camera sensor.
Camera sensors are connected via I2C to PE14/PE15 pins on A83T.
Unfortunately while the A83T datasheet suggests TWI2 I2C controller
can be configured to have SDA/SCL on these pins, this configuration
doesn't work in reality. We need to either use CCI I2C controller
that is part of the CSI module, or as is done in this patch, use GPIO
based bitbanging I2C driver.
Reduce camera IOVDD voltage.
Force dvdd-csi-r/f regulators to 1.8V.
This is required by camera sensors that are connected to them.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
.../dts/allwinner/sun8i-a83t-tbs-a711.dts | 101 +++++++++++++++++-
1 file changed, 99 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
index ce1a8d98b548..ba3ea3199c69 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
@@ -70,6 +70,16 @@ backlight: backlight {
default-brightness-level = <9>;
};
+ i2c_gpio: i2c-gpio {
+ compatible = "i2c-gpio";
+ /* PE15 = sda, PE14 = scl */
+ sda-gpios = <&pio 4 15 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+ scl-gpios = <&pio 4 14 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+ i2c-gpio,delay-us = <1>; /* ~100 kHz */
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+
panel {
compatible = "tbs,a711-panel", "panel-lvds";
backlight = <&backlight>;
@@ -215,6 +225,13 @@ link2_codec: codec {
};
};
+&ccu {
+ /* Use a stable clock source with known fixed rate for MCLK */
+ assigned-clocks = <&ccu CLK_CSI_MCLK>;
+ assigned-clock-parents = <&osc24M>;
+ assigned-clock-rates = <24000000>;
+};
+
&cpu0 {
cpu-supply = <&reg_dcdc2>;
};
@@ -223,6 +240,37 @@ &cpu100 {
cpu-supply = <&reg_dcdc3>;
};
+&csi {
+ pinctrl-names = "default";
+ pinctrl-0 = <&csi_8bit_parallel_pins>, <&csi_mclk_pin>;
+ status = "okay";
+
+ port {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ csi_hm5065_ep: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&hm5065_ep>;
+ bus-width = <8>;
+ data-active = <1>;
+ pclk-sample = <0>;
+ hsync-active = <0>;
+ vsync-active = <1>;
+ };
+
+ csi_gc2145_ep: endpoint@1 {
+ reg = <1>;
+ remote-endpoint = <&gc2145_ep>;
+ bus-width = <8>;
+ hsync-active = <1>;
+ vsync-active = <1>;
+ data-active = <1>;
+ pclk-sample = <1>;
+ };
+ };
+};
+
&de {
status = "okay";
};
@@ -283,6 +331,55 @@ npc100: nfc@28 {
};
};
+&i2c_gpio {
+ hm5065: rear-camera@1f {
+ compatible = "himax,hm5065";
+ reg = <0x1f>;
+ clocks = <&ccu CLK_CSI_MCLK>;
+ clock-names = "xclk";
+ IOVDD-supply = <&reg_dldo3>;
+ AVDD-supply = <&reg_dldo4>;
+ DVDD-supply = <&reg_eldo3>;
+ AFVDD-supply = <&reg_dldo3>;
+ reset-gpios = <&pio 4 18 GPIO_ACTIVE_LOW>; /* PE18 */
+ enable-gpios = <&pio 4 19 GPIO_ACTIVE_HIGH>; /* PE19 */
+
+ port {
+ hm5065_ep: endpoint {
+ remote-endpoint = <&csi_hm5065_ep>;
+ bus-width = <8>;
+ data-active = <1>;
+ pclk-sample = <0>;
+ hsync-active = <0>;
+ vsync-active = <1>;
+ };
+ };
+ };
+
+ gc2145: front-camera@3c {
+ compatible = "galaxycore,gc2145";
+ reg = <0x3c>;
+ clocks = <&ccu CLK_CSI_MCLK>;
+ clock-names = "xclk";
+ IOVDD-supply = <&reg_dldo3>;
+ AVDD-supply = <&reg_dldo4>;
+ DVDD-supply = <&reg_eldo3>;
+ reset-gpios = <&pio 4 16 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; /* PE16 */
+ enable-gpios = <&pio 4 17 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; /* PE17 */
+
+ port {
+ gc2145_ep: endpoint {
+ remote-endpoint = <&csi_gc2145_ep>;
+ bus-width = <8>;
+ hsync-active = <1>;
+ vsync-active = <1>;
+ data-active = <1>;
+ pclk-sample = <1>;
+ };
+ };
+ };
+};
+
&i2s0 {
status = "okay";
pinctrl-names = "default";
@@ -500,7 +597,7 @@ &reg_drivevbus {
};
&reg_eldo1 {
- regulator-min-microvolt = <1200000>;
+ regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-name = "pvdd-nfc";
regulator-always-on;
@@ -513,7 +610,7 @@ &reg_eldo2 {
};
&reg_eldo3 {
- regulator-min-microvolt = <1200000>;
+ regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-name = "dvdd-csi-f";
};
--
2.51.0

View File

@@ -0,0 +1,32 @@
From 019b5fe6a62f804b0a3c1bc32b014bea4983dc50 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Wed, 8 Nov 2017 21:57:45 +0100
Subject: ARM: dts: sun8i-a83t-tbs-a711: Add flash led support
---
arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
index ba3ea3199c69..23eb11e99b98 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
@@ -61,6 +61,15 @@ chosen {
stdout-path = "serial0:115200n8";
};
+ leds {
+ compatible = "gpio-leds";
+
+ flash_led {
+ label = "flash";
+ gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>;
+ };
+ };
+
backlight: backlight {
compatible = "pwm-backlight";
pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
--
2.51.0

View File

@@ -0,0 +1,61 @@
From 5b1f89dbd335917afc7e2f63467562509eabf4d7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Myl=C3=A8ne=20Josserand?=
<mylene.josserand@free-electrons.com>
Date: Thu, 6 Jul 2017 10:57:55 +0200
Subject: ARM: dts: sun8i-a83t-tbs-a711: Add powerup/down support for the 3G
modem
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The modem needs tree gpios to be powered-up:
- PL10 = reset
- PL8 = On/Off
- PL9 = vbat
Because of that, the PL9 corresponds to the regulator's gpio whereas
the PL8 (on/off) will be a power-gpio of the power sequence.
Thanks to that, the modem is powered up:
# lsusb
Bus 001 Device 004: ID 19d2:ffeb
Signed-off-by: Ondrej Jirman <megi@xff.cz>
Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
---
arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
index 5cedbe2455db..f7d8e5425233 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
@@ -118,7 +118,7 @@ reg_vmain: reg-vmain {
regulator-name = "vmain";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
- gpio = <&r_pio 0 9 GPIO_ACTIVE_HIGH>;
+ gpio = <&r_pio 0 9 GPIO_ACTIVE_HIGH>; /* PL9 */
enable-active-high;
vin-supply = <&reg_vbat>;
};
@@ -134,6 +134,17 @@ wifi_pwrseq: pwrseq {
clocks = <&ac100_rtc 1>;
clock-names = "ext_clock";
};
+
+ modem {
+ compatible = "zte,mg3732";
+ char-device-name = "modem-power";
+
+ power-supply = <&reg_vmain>;
+
+ enable-gpios = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */
+ reset-gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */
+ wakeup-gpios = <&r_pio 0 11 GPIO_ACTIVE_HIGH>; /* PL11 */
+ };
};
&cpu0 {
--
2.51.0

View File

@@ -0,0 +1,30 @@
From d3aafc0e82f025df6608fc273e11287bcaaed7e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Tue, 23 Jun 2020 19:15:37 +0200
Subject: ARM: dts: sun8i-a83t-tbs-a711: Add regulators to the accelerometer
The bosch,bma250 driver will fail to probe if the regulators are
not specified in DT, because it tries to set voltage on dummy
regulators, which fails with EINVAL.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
index 925891a1d6d9..ce1a8d98b548 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
@@ -268,6 +268,8 @@ accelerometer@18 {
reg = <0x18>;
interrupt-parent = <&pio>;
interrupts = <7 10 IRQ_TYPE_EDGE_RISING>; /* PH10 / EINT10 */
+ vdd-supply = <&reg_dcdc1>;
+ vddio-supply = <&reg_dcdc1>;
};
/* NFC (NPC 100) */
--
2.51.0

View File

@@ -0,0 +1,131 @@
From 28d9bff7bbc1085a8126a9a70d7dfb3b6a62f1b9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Sat, 22 Feb 2020 23:40:29 +0100
Subject: ARM: dts: sun8i-a83t-tbs-a711: Add sound support via AC100 codec
...
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
.../dts/allwinner/sun8i-a83t-tbs-a711.dts | 85 +++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
index f7d8e5425233..925891a1d6d9 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
@@ -145,6 +145,74 @@ modem {
reset-gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */
wakeup-gpios = <&r_pio 0 11 GPIO_ACTIVE_HIGH>; /* PL11 */
};
+
+ bt_sco_codec: bt-sco-codec {
+ #sound-dai-cells = <1>;
+ compatible = "linux,bt-sco";
+ sound-name-prefix = "Bluetooth";
+ };
+
+ speaker_amp: audio-amplifier {
+ compatible = "simple-audio-amplifier";
+ enable-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */
+ sound-name-prefix = "Speaker Amp";
+ };
+
+ sound: sound {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "simple-audio-card";
+ simple-audio-card,name = "ac100-audio";
+ simple-audio-card,aux-devs = <&ac100_codec_analog>, <&speaker_amp>;
+ simple-audio-card,widgets = "Microphone", "Headset Microphone",
+ "Microphone", "Internal Microphone",
+ "Headphone", "Headphone Jack",
+ "Speaker", "Internal Speaker";
+ simple-audio-card,routing =
+ "Headphone Jack", "HP",
+ "Internal Speaker", "Speaker Amp OUTL",
+ "Speaker Amp INL", "SPKOUTL",
+ "Left DAC", "DACL",
+ "Right DAC", "DACR",
+ "ADCL", "Left ADC",
+ "ADCR", "Right ADC",
+ "Internal Microphone", "MBIAS",
+ "MIC1", "Internal Microphone",
+ "Headset Microphone", "HBIAS",
+ "MIC2", "Headset Microphone";
+
+ simple-audio-card,dai-link@0 {
+ format = "i2s";
+ frame-master = <&link0_cpu>;
+ bitclock-master = <&link0_cpu>;
+ mclk-fs = <512>;
+
+ link0_cpu: cpu {
+ sound-dai = <&i2s0>;
+ };
+
+ link0_codec: codec {
+ sound-dai = <&ac100_codec 0>;
+ };
+ };
+
+ simple-audio-card,dai-link@2 {
+ format = "dsp_a";
+ frame-master = <&link2_codec>;
+ bitclock-master = <&link2_codec>;
+ bitclock-inversion;
+
+ link2_cpu: cpu {
+ sound-dai = <&bt_sco_codec 0>;
+ };
+
+ link2_codec: codec {
+ sound-dai = <&ac100_codec 2>;
+ dai-tdm-slot-num = <2>;
+ dai-tdm-slot-width = <16>;
+ };
+ };
+ };
};
&cpu0 {
@@ -213,6 +281,12 @@ npc100: nfc@28 {
};
};
+&i2s0 {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2s0_pins>;
+};
+
&mmc0 {
vmmc-supply = <&reg_dcdc1>;
pinctrl-names = "default";
@@ -293,12 +367,23 @@ ac100: codec@e89 {
compatible = "x-powers,ac100";
reg = <0xe89>;
+ ac100_codec_analog: codec-analog {
+ compatible = "x-powers,ac100-codec-analog";
+ cpvdd-supply = <&reg_aldo2>;
+ };
+
ac100_codec: codec {
+ #sound-dai-cells = <1>;
compatible = "x-powers,ac100-codec";
interrupt-parent = <&r_pio>;
interrupts = <0 12 IRQ_TYPE_LEVEL_LOW>; /* PL12 */
#clock-cells = <0>;
clock-output-names = "4M_adda";
+
+ LDOIN-supply = <&reg_aldo2>;
+ AVCC-supply = <&reg_aldo3>;
+ VDDIO1-supply = <&reg_dcdc1>;
+ VDDIO2-supply = <&reg_dldo1>;
};
ac100_rtc: rtc {
--
2.51.0

View File

@@ -0,0 +1,39 @@
From bc4e7ff402a8509cfc6a1c65c434b76adab1b767 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Sat, 9 Nov 2019 23:55:48 +0100
Subject: ARM: dts: sun8i-a83t-tbs-a711: Add support for the vibrator motor
The board has a vibrator mottor. Hook it to the input subsystem.
According to the PMIC specification, LDO needs to be enabled (value 0b11)
to achieve the specified max driving current of 150mA. We can't drive
the motor with just GPIO mode.
In GPIO mode the chip is probably just using the regular CMOS logic
output circuitry (typically limited to around 20-35mA, but not specified
in this datasheet).
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
index 23eb11e99b98..81e1271482ed 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
@@ -118,6 +118,11 @@ panel_input: endpoint {
};
};
+ vibrator {
+ compatible = "gpio-vibrator";
+ vcc-supply = <&reg_ldo_io1>;
+ };
+
reg_gps: reg-gps {
compatible = "regulator-fixed";
regulator-name = "gps";
--
2.51.0

View File

@@ -0,0 +1,31 @@
From 0395da54b8196c91aa132f56e6ab0d0e4abdc589 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Sun, 23 Feb 2020 13:21:58 +0100
Subject: ARM: dts: sun8i-a83t-tbs-a711: Enable charging LED
The tablet has a LED connected to the PMIC. The LED is visible in the
top right corner of the tablet. Enable it.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
index 6a90763d8736..6edeaf8ed431 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
@@ -519,6 +519,10 @@ &battery_power_supply {
status = "okay";
};
+&charger_led {
+ status = "okay";
+};
+
&reg_aldo1 {
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
--
2.51.0

View File

@@ -0,0 +1,47 @@
From 059050249c1d35276ebc8323bcddeee8510e2c1e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Tue, 23 Jun 2020 19:19:46 +0200
Subject: ARM: dts: sun8i-a83t-tbs-a711: Give Linux more privileges over SCPI
This is needed since on A83T there's no PSCI/ATF implementation.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi b/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
index e5f003d00f03..e901c62e9075 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
+++ b/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
@@ -286,7 +286,7 @@ opp-1800000000 {
scpi_protocol: scpi {
compatible = "arm,scpi";
- mboxes = <&msgbox 2>, <&msgbox 3>;
+ mboxes = <&msgbox 0>, <&msgbox 1>;
mbox-names = "tx", "rx";
shmem = <&scpi_sram>;
};
@@ -424,6 +424,9 @@ syscon: syscon@1c00000 {
compatible = "allwinner,sun8i-a83t-system-controller",
"syscon";
reg = <0x01c00000 0x1000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
sram_a2: sram@40000 {
compatible = "mmio-sram";
@@ -434,7 +437,7 @@ sram_a2: sram@40000 {
scpi_sram: scp-shmem@13c00 {
compatible = "arm,scp-shmem";
- reg = <0x13c00 0x200>;
+ reg = <0x13e00 0x200>;
};
};
--
2.51.0

View File

@@ -0,0 +1,30 @@
From 0676a665a91d8b48e0d7042a15809ff8e5378762 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Fri, 8 Dec 2017 12:44:22 +0100
Subject: ARM: dts: sun8i-a83t-tbs-a711: Increase voltage on the vibrator
Vibrator motor is weak at the current voltage. Increase the voltage.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
index 81e1271482ed..6a90763d8736 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-a83t-tbs-a711.dts
@@ -650,8 +650,8 @@ &reg_ldo_io0 {
};
&reg_ldo_io1 {
- regulator-min-microvolt = <3100000>;
- regulator-max-microvolt = <3100000>;
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
regulator-name = "vcc-vb";
status = "okay";
};
--
2.51.0

View File

@@ -0,0 +1,42 @@
From 9ed682abf8c8c9b0f701562789f208757b8f39ca Mon Sep 17 00:00:00 2001
From: Jernej Skrabec <jernej.skrabec@gmail.com>
Date: Sun, 9 May 2021 11:14:51 +0200
Subject: ARM: dts: sun8i: h2-plus: bananapi-m2-zero: Enable HDMI audio
BananaPi M2 Zero has HDMI output and thus supports HDMI audio. Enable
it.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
.../boot/dts/allwinner/sun8i-h2-plus-bananapi-m2-zero.dts | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-h2-plus-bananapi-m2-zero.dts b/arch/arm/boot/dts/allwinner/sun8i-h2-plus-bananapi-m2-zero.dts
index d3a7c9fa23e4..f40c2d0483b5 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-h2-plus-bananapi-m2-zero.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-h2-plus-bananapi-m2-zero.dts
@@ -133,6 +133,10 @@ hdmi_out_con: endpoint {
};
};
+&i2s2 {
+ status = "okay";
+};
+
&mmc0 {
vmmc-supply = <&reg_vcc3v3>;
bus-width = <4>;
@@ -256,6 +260,10 @@ &r_pio {
"", "", "", "", "", "", "", "";
};
+&sound_hdmi {
+ status = "okay";
+};
+
&usb_otg {
dr_mode = "otg";
status = "okay";
--
2.51.0

View File

@@ -0,0 +1,272 @@
From 5323f01be1bd567087b616965c90581d2fc8ed08 Mon Sep 17 00:00:00 2001
From: Jernej Skrabec <jernej.skrabec@gmail.com>
Date: Sun, 9 May 2021 11:06:37 +0200
Subject: ARM: dts: sun8i: h3: Enable hdmi sound card on boards with hdmi
Each board that has HDMI connector can also transmit audio through it.
Enable HDMI sound card on all H3 boards with HDMI connector.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
arch/arm/boot/dts/allwinner/sun8i-h3-beelink-x2.dts | 8 ++++++++
.../dts/allwinner/sun8i-h3-emlid-neutis-n5h3-devboard.dts | 8 ++++++++
arch/arm/boot/dts/allwinner/sun8i-h3-nanopi-m1-plus.dts | 8 ++++++++
arch/arm/boot/dts/allwinner/sun8i-h3-nanopi-m1.dts | 8 ++++++++
arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-2.dts | 8 ++++++++
arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-lite.dts | 8 ++++++++
arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-one.dts | 8 ++++++++
arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-pc.dts | 8 ++++++++
.../boot/dts/allwinner/sun8i-h3-orangepi-zero-plus2.dts | 8 ++++++++
arch/arm/boot/dts/allwinner/sun8i-h3-rervision-dvk.dts | 8 ++++++++
10 files changed, 80 insertions(+)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-h3-beelink-x2.dts b/arch/arm/boot/dts/allwinner/sun8i-h3-beelink-x2.dts
index 5b77300307de..2fa04f508216 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-h3-beelink-x2.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-h3-beelink-x2.dts
@@ -159,6 +159,10 @@ hdmi_out_con: endpoint {
};
};
+&i2s2 {
+ status = "okay";
+};
+
&ir {
linux,rc-map-name = "rc-tanix-tx3mini";
pinctrl-names = "default";
@@ -213,6 +217,10 @@ &reg_usb0_vbus {
status = "okay";
};
+&sound_hdmi {
+ status = "okay";
+};
+
&spdif {
pinctrl-names = "default";
pinctrl-0 = <&spdif_tx_pin>;
diff --git a/arch/arm/boot/dts/allwinner/sun8i-h3-emlid-neutis-n5h3-devboard.dts b/arch/arm/boot/dts/allwinner/sun8i-h3-emlid-neutis-n5h3-devboard.dts
index 02fbe00cde97..61d6529dcc70 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-h3-emlid-neutis-n5h3-devboard.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-h3-emlid-neutis-n5h3-devboard.dts
@@ -70,3 +70,11 @@ hdmi_out_con: endpoint {
&i2c1 {
status = "okay";
};
+
+&i2s2 {
+ status = "okay";
+};
+
+&sound_hdmi {
+ status = "okay";
+};
diff --git a/arch/arm/boot/dts/allwinner/sun8i-h3-nanopi-m1-plus.dts b/arch/arm/boot/dts/allwinner/sun8i-h3-nanopi-m1-plus.dts
index 59bd0746acf8..10ae138b14f0 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-h3-nanopi-m1-plus.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-h3-nanopi-m1-plus.dts
@@ -118,6 +118,10 @@ hdmi_out_con: endpoint {
};
};
+&i2s2 {
+ status = "okay";
+};
+
&ir {
pinctrl-names = "default";
pinctrl-0 = <&r_ir_rx_pin>;
@@ -159,6 +163,10 @@ &ohci2 {
status = "okay";
};
+&sound_hdmi {
+ status = "okay";
+};
+
&uart3 {
pinctrl-names = "default";
pinctrl-0 = <&uart3_pins>, <&uart3_rts_cts_pins>;
diff --git a/arch/arm/boot/dts/allwinner/sun8i-h3-nanopi-m1.dts b/arch/arm/boot/dts/allwinner/sun8i-h3-nanopi-m1.dts
index 69243dcb30a6..9393779f33b6 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-h3-nanopi-m1.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-h3-nanopi-m1.dts
@@ -91,6 +91,10 @@ hdmi_out_con: endpoint {
};
};
+&i2s2 {
+ status = "okay";
+};
+
&ir {
pinctrl-names = "default";
pinctrl-0 = <&r_ir_rx_pin>;
@@ -104,3 +108,7 @@ &ohci1 {
&ohci2 {
status = "okay";
};
+
+&sound_hdmi {
+ status = "okay";
+};
diff --git a/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-2.dts b/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-2.dts
index d2ae47b074bf..7fac0c8906e8 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-2.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-2.dts
@@ -145,6 +145,10 @@ hdmi_out_con: endpoint {
};
};
+&i2s2 {
+ status = "okay";
+};
+
&ir {
pinctrl-names = "default";
pinctrl-0 = <&r_ir_rx_pin>;
@@ -179,6 +183,10 @@ &reg_usb1_vbus {
status = "okay";
};
+&sound_hdmi {
+ status = "okay";
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pa_pins>;
diff --git a/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-lite.dts b/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-lite.dts
index 6a4316a52469..28ec2a5b1a5c 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-lite.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-lite.dts
@@ -120,6 +120,10 @@ hdmi_out_con: endpoint {
};
};
+&i2s2 {
+ status = "okay";
+};
+
&ir {
pinctrl-names = "default";
pinctrl-0 = <&r_ir_rx_pin>;
@@ -156,6 +160,10 @@ &ohci2 {
status = "okay";
};
+&sound_hdmi {
+ status = "okay";
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pa_pins>;
diff --git a/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-one.dts b/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-one.dts
index 59f6f6d5e7ca..927fd1bab07d 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-one.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-one.dts
@@ -146,6 +146,10 @@ hdmi_out_con: endpoint {
};
};
+&i2s2 {
+ status = "okay";
+};
+
&mmc0 {
vmmc-supply = <&reg_vcc3v3>;
bus-width = <4>;
@@ -166,6 +170,10 @@ &reg_usb0_vbus {
status = "okay";
};
+&sound_hdmi {
+ status = "okay";
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pa_pins>;
diff --git a/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-pc.dts b/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-pc.dts
index 92a58e362004..624e248e3ffc 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-pc.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-pc.dts
@@ -147,6 +147,10 @@ hdmi_out_con: endpoint {
};
};
+&i2s2 {
+ status = "okay";
+};
+
&ir {
pinctrl-names = "default";
pinctrl-0 = <&r_ir_rx_pin>;
@@ -206,6 +210,10 @@ &reg_usb0_vbus {
status = "okay";
};
+&sound_hdmi {
+ status = "okay";
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pa_pins>;
diff --git a/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-zero-plus2.dts b/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-zero-plus2.dts
index 7a6444a10e25..4073d34af23c 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-zero-plus2.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-zero-plus2.dts
@@ -117,6 +117,10 @@ hdmi_out_con: endpoint {
};
};
+&i2s2 {
+ status = "okay";
+};
+
&mmc0 {
vmmc-supply = <&reg_vcc3v3>;
bus-width = <4>;
@@ -155,6 +159,10 @@ &ohci0 {
status = "okay";
};
+&sound_hdmi {
+ status = "okay";
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pa_pins>;
diff --git a/arch/arm/boot/dts/allwinner/sun8i-h3-rervision-dvk.dts b/arch/arm/boot/dts/allwinner/sun8i-h3-rervision-dvk.dts
index 4738f3a9efe4..ee645912ee39 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-h3-rervision-dvk.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-h3-rervision-dvk.dts
@@ -69,6 +69,10 @@ hdmi_out_con: endpoint {
};
};
+&i2s2 {
+ status = "okay";
+};
+
&mmc0 {
bus-width = <4>;
cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
@@ -98,6 +102,10 @@ &ohci3 {
status = "okay";
};
+&sound_hdmi {
+ status = "okay";
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pa_pins>;
--
2.51.0

View File

@@ -0,0 +1,72 @@
From cb05a11519a68c95d48d47b6d42fd68e81f51bb2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Mon, 17 Aug 2020 23:43:53 +0200
Subject: ARM: dts: sun8i-h3: Use my own more aggressive OPPs on H3
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm/boot/dts/allwinner/sun8i-h3.dtsi | 36 +++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-h3.dtsi b/arch/arm/boot/dts/allwinner/sun8i-h3.dtsi
index cfd039840b43..4f19608b727c 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-h3.dtsi
+++ b/arch/arm/boot/dts/allwinner/sun8i-h3.dtsi
@@ -48,6 +48,12 @@ cpu0_opp_table: opp-table-cpu {
compatible = "operating-points-v2";
opp-shared;
+ opp-480000000 {
+ opp-hz = /bits/ 64 <480000000>;
+ opp-microvolt = <1040000 1040000 1300000>;
+ clock-latency-ns = <244144>; /* 8 32k periods */
+ };
+
opp-648000000 {
opp-hz = /bits/ 64 <648000000>;
opp-microvolt = <1040000 1040000 1300000>;
@@ -60,11 +66,41 @@ opp-816000000 {
clock-latency-ns = <244144>; /* 8 32k periods */
};
+ opp-960000000 {
+ opp-hz = /bits/ 64 <960000000>;
+ opp-microvolt = <1200000 1200000 1300000>;
+ clock-latency-ns = <244144>; /* 8 32k periods */
+ };
+
opp-1008000000 {
opp-hz = /bits/ 64 <1008000000>;
opp-microvolt = <1200000 1200000 1300000>;
clock-latency-ns = <244144>; /* 8 32k periods */
};
+
+ opp-1104000000 {
+ opp-hz = /bits/ 64 <1104000000>;
+ opp-microvolt = <1320000 1320000 1320000>;
+ clock-latency-ns = <244144>; /* 8 32k periods */
+ };
+
+ opp-1200000000 {
+ opp-hz = /bits/ 64 <1200000000>;
+ opp-microvolt = <1320000 1320000 1320000>;
+ clock-latency-ns = <244144>; /* 8 32k periods */
+ };
+
+ opp-1296000000 {
+ opp-hz = /bits/ 64 <1296000000>;
+ opp-microvolt = <1340000 1340000 1340000>;
+ clock-latency-ns = <244144>; /* 8 32k periods */
+ };
+
+ opp-1368000000 {
+ opp-hz = /bits/ 64 <1368000000>;
+ opp-microvolt = <1400000 1400000 1400000>;
+ clock-latency-ns = <244144>; /* 8 32k periods */
+ };
};
cpus {
--
2.51.0

View File

@@ -0,0 +1,49 @@
From 251198af980dcd9fe85a78514f114dcf193538c3 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Sat, 2 Apr 2022 02:24:26 +0200
Subject: ARM: dts: sun8i-h3-orange-pi-one: Enable all gpio header UARTs
---
arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-one.dts | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-one.dts b/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-one.dts
index f5476cdab8a4..64c489e356ce 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-one.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-one.dts
@@ -54,6 +54,9 @@ / {
aliases {
ethernet0 = &emac;
serial0 = &uart0;
+ serial1 = &uart1;
+ serial2 = &uart2;
+ serial3 = &uart3;
};
chosen {
@@ -183,19 +186,19 @@ &uart0 {
&uart1 {
pinctrl-names = "default";
pinctrl-0 = <&uart1_pins>;
- status = "disabled";
+ status = "okay";
};
&uart2 {
pinctrl-names = "default";
pinctrl-0 = <&uart2_pins>;
- status = "disabled";
+ status = "okay";
};
&uart3 {
pinctrl-names = "default";
pinctrl-0 = <&uart3_pins>;
- status = "disabled";
+ status = "okay";
};
&usb_otg {
--
2.51.0

View File

@@ -0,0 +1,31 @@
From 64f543a201145dfbc832be06aa3dc6d942d96bf1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Sun, 13 May 2018 21:00:43 +0200
Subject: ARM: dts: sun8i-h3-orange-pi-pc: Increase max CPUX voltage to 1.4V
When using thermal regulation we can afford to go higher. Also add
regulator-ramp-delay, because regulator takes some time to change
voltage.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-pc.dts | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-pc.dts b/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-pc.dts
index b96e015f54ee..92a58e362004 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-pc.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-pc.dts
@@ -194,7 +194,8 @@ reg_vdd_cpux: regulator@65 {
* Use 1.0V as the minimum voltage instead.
*/
regulator-min-microvolt = <1000000>;
- regulator-max-microvolt = <1300000>;
+ regulator-max-microvolt = <1400000>;
+ regulator-ramp-delay = <200>;
regulator-boot-on;
regulator-always-on;
};
--
2.51.0

View File

@@ -0,0 +1,48 @@
From f72b5462f63489d3e37b03a9a7f778d5842f0620 Mon Sep 17 00:00:00 2001
From: Jernej Skrabec <jernej.skrabec@gmail.com>
Date: Sun, 9 May 2021 11:50:56 +0200
Subject: ARM: dts: sun8i: r40: Add hdmi sound card
R40 support HDMI audio. Add a sound card node for it.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
arch/arm/boot/dts/allwinner/sun8i-r40.dtsi | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-r40.dtsi b/arch/arm/boot/dts/allwinner/sun8i-r40.dtsi
index fa162f7fa9f0..135aca6a8b1a 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-r40.dtsi
+++ b/arch/arm/boot/dts/allwinner/sun8i-r40.dtsi
@@ -124,6 +124,20 @@ de: display-engine {
status = "disabled";
};
+ sound_hdmi: sound_hdmi {
+ compatible = "allwinner,sun9i-a80-hdmi-audio",
+ "allwinner,sun8i-r40-hdmi-audio";
+ status = "disabled";
+
+ codec {
+ sound-dai = <&hdmi>;
+ };
+
+ cpu {
+ sound-dai = <&i2s2>;
+ };
+ };
+
thermal-zones {
cpu_thermal: cpu0-thermal {
/* milliseconds */
@@ -1265,6 +1279,7 @@ gic: interrupt-controller@1c81000 {
};
hdmi: hdmi@1ee0000 {
+ #sound-dai-cells = <0>;
compatible = "allwinner,sun8i-r40-dw-hdmi",
"allwinner,sun8i-a83t-dw-hdmi";
reg = <0x01ee0000 0x10000>;
--
2.51.0

View File

@@ -0,0 +1,42 @@
From 42a96825b819aef86f3c08ba6eb435cf4262c10c Mon Sep 17 00:00:00 2001
From: Jernej Skrabec <jernej.skrabec@gmail.com>
Date: Sun, 9 May 2021 11:52:43 +0200
Subject: ARM: dts: sun8i: r40: bananapi-m2-ultra: Enable HDMI audio
BananaPi M2 Ultra has HDMI output and thus supports HDMI audio. Enable
it.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
.../boot/dts/allwinner/sun8i-r40-bananapi-m2-ultra.dts | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/boot/dts/allwinner/sun8i-r40-bananapi-m2-ultra.dts
index cd2351acc32f..a91213e8d2c1 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-r40-bananapi-m2-ultra.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-r40-bananapi-m2-ultra.dts
@@ -169,6 +169,10 @@ axp22x: pmic@34 {
#include "axp22x.dtsi"
+&i2s2 {
+ status = "okay";
+};
+
&ir0 {
status = "okay";
};
@@ -304,6 +308,10 @@ &reg_eldo3 {
regulator-name = "vdd1v2-sata";
};
+&sound_hdmi {
+ status = "okay";
+};
+
&tcon_tv0 {
status = "okay";
};
--
2.51.0

View File

@@ -0,0 +1,42 @@
From f7ebb1938b694b81fa4be16f1bd191aeb30ab6be Mon Sep 17 00:00:00 2001
From: Jernej Skrabec <jernej.skrabec@gmail.com>
Date: Sun, 9 May 2021 12:00:46 +0200
Subject: ARM: dts: sun8i: v40: bananapi-m2-berry: Enable HDMI audio
BananaPi M2 Berry has HDMI output and thus supports HDMI audio. Enable
it.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
.../boot/dts/allwinner/sun8i-v40-bananapi-m2-berry.dts | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/allwinner/sun8i-v40-bananapi-m2-berry.dts
index 6575ef274453..0e1395a3d052 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-v40-bananapi-m2-berry.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-v40-bananapi-m2-berry.dts
@@ -160,6 +160,10 @@ axp22x: pmic@34 {
#include "axp22x.dtsi"
+&i2s2 {
+ status = "okay";
+};
+
&mmc0 {
vmmc-supply = <&reg_dcdc1>;
bus-width = <4>;
@@ -275,6 +279,10 @@ &reg_eldo3 {
regulator-name = "vdd1v2-sata";
};
+&sound_hdmi {
+ status = "okay";
+};
+
&tcon_tv0 {
status = "okay";
};
--
2.51.0

View File

@@ -0,0 +1,29 @@
From d19697dd4b59d117a79f218bce9d0e0ec909d6e4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Sun, 12 Nov 2017 19:03:39 +0100
Subject: ARM: dts: suni-a83t: Add i2s0 pins
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi b/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
index e2d64a688db9..ccaaa91af9db 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
+++ b/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
@@ -829,6 +829,11 @@ spdif_tx_pin: spdif-tx-pin {
function = "spdif";
};
+ i2s0_pins: i2s0-pins {
+ pins = "PB4", "PB5", "PB6", "PB7", "PB8";
+ function = "i2s0";
+ };
+
uart0_pb_pins: uart0-pb-pins {
pins = "PB9", "PB10";
function = "uart0";
--
2.51.0

View File

@@ -0,0 +1,66 @@
From 3e83ea68d7e6cbe55637ee15ca8d613b57496ca6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Mon, 25 Jan 2021 01:15:58 +0100
Subject: ARM: dts: sunxi: Add aliases for MMC
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm/boot/dts/allwinner/sun5i.dtsi | 6 ++++++
arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi | 6 ++++++
arch/arm/boot/dts/allwinner/sun8i-h3.dtsi | 6 ++++++
3 files changed, 18 insertions(+)
diff --git a/arch/arm/boot/dts/allwinner/sun5i.dtsi b/arch/arm/boot/dts/allwinner/sun5i.dtsi
index 126b80f3ca70..a15effbbbc51 100644
--- a/arch/arm/boot/dts/allwinner/sun5i.dtsi
+++ b/arch/arm/boot/dts/allwinner/sun5i.dtsi
@@ -51,6 +51,12 @@ / {
#address-cells = <1>;
#size-cells = <1>;
+ aliases {
+ mmc0 = &mmc0;
+ mmc1 = &mmc1;
+ mmc2 = &mmc2;
+ };
+
cpus {
#address-cells = <1>;
#size-cells = <0>;
diff --git a/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi b/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
index 19fbca52bf90..20d7112c9192 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
+++ b/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
@@ -57,6 +57,12 @@ / {
#address-cells = <1>;
#size-cells = <1>;
+ aliases {
+ mmc0 = &mmc0;
+ mmc1 = &mmc1;
+ mmc2 = &mmc2;
+ };
+
cpus {
#address-cells = <1>;
#size-cells = <0>;
diff --git a/arch/arm/boot/dts/allwinner/sun8i-h3.dtsi b/arch/arm/boot/dts/allwinner/sun8i-h3.dtsi
index 2b28c1306405..a5bf9e0b5ec0 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-h3.dtsi
+++ b/arch/arm/boot/dts/allwinner/sun8i-h3.dtsi
@@ -44,6 +44,12 @@
#include <dt-bindings/thermal/thermal.h>
/ {
+ aliases {
+ mmc0 = &mmc0;
+ mmc1 = &mmc1;
+ mmc2 = &mmc2;
+ };
+
cpu0_opp_table: opp-table-cpu {
compatible = "operating-points-v2";
opp-shared;
--
2.51.0

View File

@@ -0,0 +1,52 @@
From ae4167d13fa154234c7fc616fa7a57d60020cc39 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Wed, 1 Jan 2020 16:14:29 -0600
Subject: ARM: dts: sunxi: a83t: Add SCPI protocol
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi b/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
index 47c8541f7779..e5f003d00f03 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
+++ b/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
@@ -284,6 +284,13 @@ opp-1800000000 {
};
};
+ scpi_protocol: scpi {
+ compatible = "arm,scpi";
+ mboxes = <&msgbox 2>, <&msgbox 3>;
+ mbox-names = "tx", "rx";
+ shmem = <&scpi_sram>;
+ };
+
soc {
compatible = "simple-bus";
#address-cells = <1>;
@@ -417,6 +424,20 @@ syscon: syscon@1c00000 {
compatible = "allwinner,sun8i-a83t-system-controller",
"syscon";
reg = <0x01c00000 0x1000>;
+
+ sram_a2: sram@40000 {
+ compatible = "mmio-sram";
+ reg = <0x00040000 0x14000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges = <0 0x00040000 0x14000>;
+
+ scpi_sram: scp-shmem@13c00 {
+ compatible = "arm,scp-shmem";
+ reg = <0x13c00 0x200>;
+ };
+ };
+
};
video-codec@01c0e000 {
--
2.51.0

View File

@@ -0,0 +1,81 @@
From bb01531627146b6235b863e36fa978cef608d538 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Wed, 1 Jan 2020 16:12:36 -0600
Subject: ARM: dts: sunxi: h3/h5: Add SCPI protocol
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/arm/boot/dts/allwinner/sun8i-h3.dtsi | 13 +++++++++++++
arch/arm/boot/dts/allwinner/sunxi-h3-h5.dtsi | 7 +++++++
arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi | 13 +++++++++++++
3 files changed, 33 insertions(+)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-h3.dtsi b/arch/arm/boot/dts/allwinner/sun8i-h3.dtsi
index 4f19608b727c..2b28c1306405 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-h3.dtsi
+++ b/arch/arm/boot/dts/allwinner/sun8i-h3.dtsi
@@ -206,6 +206,19 @@ syscon: system-control@1c00000 {
#size-cells = <1>;
ranges;
+ sram_a2: sram@40000 {
+ compatible = "mmio-sram";
+ reg = <0x00040000 0xc000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges = <0 0x00040000 0xc000>;
+
+ scpi_sram: scp-shmem@bc00 {
+ compatible = "arm,scp-shmem";
+ reg = <0xbc00 0x200>;
+ };
+ };
+
sram_c: sram@1d00000 {
compatible = "mmio-sram";
reg = <0x01d00000 0x80000>;
diff --git a/arch/arm/boot/dts/allwinner/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/allwinner/sunxi-h3-h5.dtsi
index a872fc586ab6..ebc64458084c 100644
--- a/arch/arm/boot/dts/allwinner/sunxi-h3-h5.dtsi
+++ b/arch/arm/boot/dts/allwinner/sunxi-h3-h5.dtsi
@@ -120,6 +120,13 @@ de: display-engine {
status = "disabled";
};
+ scpi_protocol: scpi {
+ compatible = "arm,scpi";
+ mboxes = <&msgbox 2>, <&msgbox 3>;
+ mbox-names = "tx", "rx";
+ shmem = <&scpi_sram>;
+ };
+
soc {
compatible = "simple-bus";
#address-cells = <1>;
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi
index 01a29c1988a6..49481e725a4e 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi
@@ -82,6 +82,19 @@ syscon: system-control@1c00000 {
#size-cells = <1>;
ranges;
+ sram_a2: sram@40000 {
+ compatible = "mmio-sram";
+ reg = <0x00040000 0x14000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges = <0 0x00040000 0x14000>;
+
+ scpi_sram: scp-shmem@13c00 {
+ compatible = "arm,scp-shmem";
+ reg = <0x13c00 0x200>;
+ };
+ };
+
sram_c1: sram@18000 {
compatible = "mmio-sram";
reg = <0x00018000 0x1c000>;
--
2.51.0

View File

@@ -0,0 +1,48 @@
From 52961661dcef9266fc76b8c4755004e1e013a643 Mon Sep 17 00:00:00 2001
From: Jernej Skrabec <jernej.skrabec@gmail.com>
Date: Sun, 9 May 2021 11:04:58 +0200
Subject: ARM: dts: sunxi: h3/h5: Add hdmi sound card
H3 and H5 support HDMI audio. Add a sound card node for it.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
arch/arm/boot/dts/allwinner/sunxi-h3-h5.dtsi | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/arch/arm/boot/dts/allwinner/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/allwinner/sunxi-h3-h5.dtsi
index 7df60515a903..0f19e7c00c50 100644
--- a/arch/arm/boot/dts/allwinner/sunxi-h3-h5.dtsi
+++ b/arch/arm/boot/dts/allwinner/sunxi-h3-h5.dtsi
@@ -106,6 +106,20 @@ de: display-engine {
status = "disabled";
};
+ sound_hdmi: sound_hdmi {
+ compatible = "allwinner,sun9i-a80-hdmi-audio",
+ "allwinner,sun8i-h3-hdmi-audio";
+ status = "disabled";
+
+ codec {
+ sound-dai = <&hdmi>;
+ };
+
+ cpu {
+ sound-dai = <&i2s2>;
+ };
+ };
+
soc {
compatible = "simple-bus";
#address-cells = <1>;
@@ -818,6 +832,7 @@ csi: camera@1cb0000 {
};
hdmi: hdmi@1ee0000 {
+ #sound-dai-cells = <0>;
compatible = "allwinner,sun8i-h3-dw-hdmi",
"allwinner,sun8i-a83t-dw-hdmi";
reg = <0x01ee0000 0x10000>;
--
2.51.0

View File

@@ -0,0 +1,88 @@
From 44ed294ee215d25c629c547d7aa767d6d474f658 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Wed, 23 Oct 2019 05:06:29 +0200
Subject: ARM: sunxi: Add experimental suspend to memory implementation for
A83T
This just ends with WFI, but all secondary CPUs will be shut down.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm/mach-sunxi/sunxi.c | 46 +++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c
index e1b7945aac99..2d6b7b4528e9 100644
--- a/arch/arm/mach-sunxi/sunxi.c
+++ b/arch/arm/mach-sunxi/sunxi.c
@@ -12,10 +12,13 @@
#include <linux/init.h>
#include <linux/of_clk.h>
#include <linux/platform_device.h>
+#include <linux/of_platform.h>
#include <linux/reset/sunxi.h>
+#include <linux/suspend.h>
#include <asm/mach/arch.h>
#include <asm/secure_cntvoff.h>
+#include <asm/suspend.h>
static const char * const sunxi_board_dt_compat[] = {
"allwinner,sun4i-a10",
@@ -86,10 +89,53 @@ static const char * const sun8i_a83t_cntvoff_board_dt_compat[] = {
NULL,
};
+#ifdef CONFIG_PM_SLEEP
+static int sun8i_a83t_pm_valid(suspend_state_t state)
+{
+ return state == PM_SUSPEND_MEM;
+}
+
+static int sun8i_a83t_suspend_finish(unsigned long val)
+{
+ // don't do much
+ cpu_do_idle();
+ return 0;
+}
+
+static int sun8i_a83t_pm_enter(suspend_state_t state)
+{
+ switch (state) {
+ case PM_SUSPEND_MEM:
+ cpu_suspend(0, sun8i_a83t_suspend_finish);
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+static const struct platform_suspend_ops sun8i_a83t_pm_ops = {
+ .enter = sun8i_a83t_pm_enter,
+ .valid = sun8i_a83t_pm_valid,
+};
+#define SUN8I_A83T_PM_OPS &sun8i_a83t_pm_ops
+#else
+#define SUN8I_A83T_PM_OPS NULL
+#endif
+
+static void __init sun8i_a83t_init_machine(void)
+{
+ suspend_set_ops(SUN8I_A83T_PM_OPS);
+
+ of_platform_default_populate(NULL, NULL, NULL);
+}
+
DT_MACHINE_START(SUN8I_A83T_CNTVOFF_DT, "Allwinner A83t board")
.init_early = sun8i_a83t_cntvoff_init,
.init_time = sun6i_timer_init,
.dt_compat = sun8i_a83t_cntvoff_board_dt_compat,
+ .init_machine = sun8i_a83t_init_machine,
MACHINE_END
static const char * const sun9i_board_dt_compat[] = {
--
2.51.0

View File

@@ -0,0 +1,54 @@
From 368c89a83102c2b8e8c6acf72963bfb90caa1d24 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Sat, 2 Nov 2019 15:21:04 +0100
Subject: ARM: sunxi: Use SCPI to send suspend message to SCP on A83T
We use undefined value of 3, to mean SUSPEND_SYSTEM. SCP should:
- kill CPU0
- kill cluster 0
- shutdown power to both clusters (Linux MCPM doesn't do that)
...
- reverse all of the above on interrupt
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm/mach-sunxi/sunxi.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c
index 2d6b7b4528e9..d4c25c33455d 100644
--- a/arch/arm/mach-sunxi/sunxi.c
+++ b/arch/arm/mach-sunxi/sunxi.c
@@ -14,6 +14,7 @@
#include <linux/platform_device.h>
#include <linux/of_platform.h>
#include <linux/reset/sunxi.h>
+#include <linux/scpi_protocol.h>
#include <linux/suspend.h>
#include <asm/mach/arch.h>
@@ -97,8 +98,18 @@ static int sun8i_a83t_pm_valid(suspend_state_t state)
static int sun8i_a83t_suspend_finish(unsigned long val)
{
- // don't do much
- cpu_do_idle();
+ struct scpi_ops *scpi;
+
+ scpi = get_scpi_ops();
+ if (scpi && scpi->sys_set_power_state) {
+ //HACK: use invalid state to mean: suspend last CPU and the system
+ scpi->sys_set_power_state(3);
+ cpu_do_idle();
+ } else {
+ // don't do much if scpi is not available
+ cpu_do_idle();
+ }
+
return 0;
}
--
2.51.0

View File

@@ -0,0 +1,27 @@
From ff4d244c254a1dbca345d139552df8e96a74d76d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Wed, 23 Oct 2019 05:08:04 +0200
Subject: ARM: sunxi: sunxi_cpu0_hotplug_support_set is not supported on A83T
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm/mach-sunxi/mc_smp.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm/mach-sunxi/mc_smp.c b/arch/arm/mach-sunxi/mc_smp.c
index 277f6aa8e6c2..ca237d50db4b 100644
--- a/arch/arm/mach-sunxi/mc_smp.c
+++ b/arch/arm/mach-sunxi/mc_smp.c
@@ -146,6 +146,9 @@ static int sunxi_cpu_power_switch_set(unsigned int cpu, unsigned int cluster,
static void sunxi_cpu0_hotplug_support_set(bool enable)
{
+ if (is_a83t)
+ return;
+
if (enable) {
writel(CPU0_SUPPORT_HOTPLUG_MAGIC0, sram_b_smp_base);
writel(CPU0_SUPPORT_HOTPLUG_MAGIC1, sram_b_smp_base + 0x4);
--
2.51.0

View File

@@ -0,0 +1,233 @@
From 1ab2cc80d4c013f9f63ff7cc0412894abad1b575 Mon Sep 17 00:00:00 2001
From: Jernej Skrabec <jernej.skrabec@gmail.com>
Date: Tue, 10 Nov 2020 20:42:44 +0100
Subject: ASOC: sun9i-hdmi-audio: Initial implementation
This implements HDMI audio sound card which is used to enable HDMI audio
on all Allwinner SoCs with DW-HDMI core. First such SoC is A80, but it's
been used on plenty of others, like A64, A83t, H2+, H3, H5, H6, R40 and
V40.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
sound/soc/sunxi/Kconfig | 8 ++
sound/soc/sunxi/Makefile | 1 +
sound/soc/sunxi/sun9i-hdmi-audio.c | 178 +++++++++++++++++++++++++++++
3 files changed, 187 insertions(+)
create mode 100644 sound/soc/sunxi/sun9i-hdmi-audio.c
diff --git a/sound/soc/sunxi/Kconfig b/sound/soc/sunxi/Kconfig
index f87b061f59b2..753c38c5d554 100644
--- a/sound/soc/sunxi/Kconfig
+++ b/sound/soc/sunxi/Kconfig
@@ -76,6 +76,14 @@ config SND_SUN50I_DMIC
Say Y or M to add support for the DMIC audio block in the Allwinner
H6 and affiliated SoCs.
+config SND_SUN9I_HDMI_AUDIO
+ tristate "Allwinner sun9i HDMI Audio Sound Card"
+ depends on OF
+ depends on SND_SUN4I_I2S
+ help
+ Say Y or M to add support for the HDMI Audio sound card for Allwinner
+ SoCs with DW-HDMI core.
+
config SND_SUN8I_ADDA_PR_REGMAP
tristate
select REGMAP
diff --git a/sound/soc/sunxi/Makefile b/sound/soc/sunxi/Makefile
index 6131aea97efa..19800277105c 100644
--- a/sound/soc/sunxi/Makefile
+++ b/sound/soc/sunxi/Makefile
@@ -8,3 +8,4 @@ obj-$(CONFIG_SND_SUN50I_CODEC_ANALOG) += sun50i-codec-analog.o
obj-$(CONFIG_SND_SUN8I_CODEC) += sun8i-codec.o
obj-$(CONFIG_SND_SUN8I_ADDA_PR_REGMAP) += sun8i-adda-pr-regmap.o
obj-$(CONFIG_SND_SUN50I_DMIC) += sun50i-dmic.o
+obj-$(CONFIG_SND_SUN9I_HDMI_AUDIO) += sun9i-hdmi-audio.o
diff --git a/sound/soc/sunxi/sun9i-hdmi-audio.c b/sound/soc/sunxi/sun9i-hdmi-audio.c
new file mode 100644
index 000000000000..d64b208d6f03
--- /dev/null
+++ b/sound/soc/sunxi/sun9i-hdmi-audio.c
@@ -0,0 +1,178 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// sun9i hdmi audio sound card
+//
+// Copyright (C) 2021 Jernej Skrabec <jernej.skrabec@gmail.com>
+
+#include <linux/module.h>
+#include <linux/of_platform.h>
+
+#include <sound/soc.h>
+#include <sound/soc-dai.h>
+
+static int sun9i_hdmi_audio_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params)
+{
+ struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
+ unsigned int mclk;
+
+ mclk = params_rate(params) * 128;
+
+ return snd_soc_dai_set_sysclk(snd_soc_rtd_to_cpu(rtd, 0), 0, mclk,
+ SND_SOC_CLOCK_OUT);
+}
+
+static const struct snd_soc_ops sun9i_hdmi_audio_ops = {
+ .hw_params = sun9i_hdmi_audio_hw_params,
+};
+
+static int sun9i_hdmi_audio_dai_init(struct snd_soc_pcm_runtime *rtd)
+{
+ int ret;
+
+ /* TODO: switch to custom api once it's implemented in sun4i-i2s */
+ ret = snd_soc_dai_set_tdm_slot(snd_soc_rtd_to_cpu(rtd, 0), 0, 0, 2, 32);
+ if (ret) {
+ dev_err(snd_soc_rtd_to_cpu(rtd, 0)->dev,
+ "setting tdm link slots failed\n");
+ return ret;
+ }
+
+ return 0;
+}
+
+static int sun9i_hdmi_audio_parse_dai(struct device_node *node,
+ struct snd_soc_dai_link_component *dlc)
+{
+ struct of_phandle_args args;
+ int ret;
+
+ if (!node)
+ return 0;
+
+ ret = of_parse_phandle_with_args(node, "sound-dai",
+ "#sound-dai-cells", 0, &args);
+ if (ret)
+ return ret;
+
+ ret = snd_soc_get_dai_name(&args, &dlc->dai_name);
+ if (ret < 0) {
+ of_node_put(args.np);
+
+ return ret;
+ }
+
+ dlc->of_node = args.np;
+
+ return 0;
+}
+
+static int sun9i_hdmi_audio_probe(struct platform_device *pdev)
+{
+ struct snd_soc_dai_link_component *dlc;
+ struct device *dev = &pdev->dev;
+ struct snd_soc_dai_link *link;
+ struct snd_soc_card *card;
+ struct device_node *child;
+ int ret;
+
+ card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL);
+ if (!card)
+ return -ENOMEM;
+
+ link = devm_kzalloc(dev, sizeof(*link), GFP_KERNEL);
+ if (!link)
+ return -ENOMEM;
+
+ dlc = devm_kzalloc(dev, sizeof(*dlc) * 3, GFP_KERNEL);
+ if (!dlc)
+ return -ENOMEM;
+
+ child = of_get_child_by_name(dev->of_node, "codec");
+ if (!child)
+ return -ENODEV;
+
+ ret = sun9i_hdmi_audio_parse_dai(child, &dlc[1]);
+ of_node_put(child);
+ if (ret)
+ return ret;
+
+ child = of_get_child_by_name(dev->of_node, "cpu");
+ if (!child) {
+ ret = -ENODEV;
+ goto out_err;
+ }
+
+ ret = sun9i_hdmi_audio_parse_dai(child, &dlc[0]);
+ of_node_put(child);
+ if (ret)
+ goto out_err;
+
+ dlc[2].of_node = dlc[0].of_node;
+
+ platform_set_drvdata(pdev, card);
+
+ link->cpus = &dlc[0];
+ link->codecs = &dlc[1];
+ link->platforms = &dlc[2];
+
+ link->num_cpus = 1;
+ link->num_codecs = 1;
+ link->num_platforms = 1;
+
+ link->playback_only = 1;
+
+ link->name = "SUN9I-HDMI";
+ link->stream_name = "SUN9I-HDMI PCM";
+
+ link->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_IF | SND_SOC_DAIFMT_CBC_CFC;
+
+ link->ops = &sun9i_hdmi_audio_ops;
+ link->init = sun9i_hdmi_audio_dai_init;
+
+ card->dai_link = link;
+ card->num_links = 1;
+ card->owner = THIS_MODULE;
+ card->dev = dev;
+ card->name = "sun9i-hdmi";
+
+ ret = devm_snd_soc_register_card(dev, card);
+ if (ret)
+ goto out_err;
+
+ return 0;
+
+out_err:
+ of_node_put(dlc[0].of_node);
+ of_node_put(dlc[1].of_node);
+
+ return ret;
+}
+
+static void sun9i_hdmi_audio_remove(struct platform_device *pdev)
+{
+ struct snd_soc_card *card = platform_get_drvdata(pdev);
+
+ of_node_put(card->dai_link->cpus->of_node);
+ of_node_put(card->dai_link->codecs->of_node);
+}
+
+static const struct of_device_id sun9i_hdmi_audio_match[] = {
+ { .compatible = "allwinner,sun9i-a80-hdmi-audio" },
+ {}
+};
+MODULE_DEVICE_TABLE(of, sun9i_hdmi_audio_match);
+
+static struct platform_driver sun9i_hdmi_audio_driver = {
+ .probe = sun9i_hdmi_audio_probe,
+ .remove = sun9i_hdmi_audio_remove,
+ .driver = {
+ .name = "sun9i-hdmi-audio",
+ .of_match_table = sun9i_hdmi_audio_match,
+ },
+};
+module_platform_driver(sun9i_hdmi_audio_driver);
+
+MODULE_DESCRIPTION("sun9i HDMI Audio Sound Card");
+MODULE_AUTHOR("Jernej Skrabec <jernej.skrabec@gmail.com>");
+MODULE_LICENSE("GPL v2");
--
2.51.0

View File

@@ -0,0 +1,154 @@
From 82745a579de223e56b7c35c8e4a5e7f9e91e409c Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Fri, 25 Sep 2020 21:42:52 -0500
Subject: ASoC: ec25: New codec driver for the EC25 modem
The EC25 LTE modem has a PCM interface, and supports 16-bit PCM audio at
an 8 kHz or 16 kHz sameple rate.
Suggested-by: Luca Weiss <luca@z3ntu.xyz>
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
sound/soc/codecs/Kconfig | 3 ++
sound/soc/codecs/Makefile | 2 +
sound/soc/codecs/ec25.c | 94 +++++++++++++++++++++++++++++++++++++++
3 files changed, 99 insertions(+)
create mode 100644 sound/soc/codecs/ec25.c
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 126f897312d4..28ec636f5a7b 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -1174,6 +1174,9 @@ config SND_SOC_HDMI_CODEC
select SND_PCM_IEC958
select HDMI
+config SND_SOC_EC25
+ tristate "EC25 LTE module CODEC"
+
config SND_SOC_ES7134
tristate "Everest Semi ES7134 CODEC"
diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile
index 6d7aa109ede7..e1923e1d283f 100644
--- a/sound/soc/codecs/Makefile
+++ b/sound/soc/codecs/Makefile
@@ -124,6 +124,7 @@ snd-soc-da7219-y := da7219.o da7219-aad.o
snd-soc-da732x-y := da732x.o
snd-soc-da9055-y := da9055.o
snd-soc-dmic-y := dmic.o
+snd-soc-ec25-y := ec25.o
snd-soc-es7134-y := es7134.o
snd-soc-es7241-y := es7241.o
snd-soc-es83xx-dsm-common-y := es83xx-dsm-common.o
@@ -548,6 +549,7 @@ obj-$(CONFIG_SND_SOC_DA7219) += snd-soc-da7219.o
obj-$(CONFIG_SND_SOC_DA732X) += snd-soc-da732x.o
obj-$(CONFIG_SND_SOC_DA9055) += snd-soc-da9055.o
obj-$(CONFIG_SND_SOC_DMIC) += snd-soc-dmic.o
+obj-$(CONFIG_SND_SOC_EC25) += snd-soc-ec25.o
obj-$(CONFIG_SND_SOC_ES7134) += snd-soc-es7134.o
obj-$(CONFIG_SND_SOC_ES7241) += snd-soc-es7241.o
obj-$(CONFIG_SND_SOC_ES83XX_DSM_COMMON) += snd-soc-es83xx-dsm-common.o
diff --git a/sound/soc/codecs/ec25.c b/sound/soc/codecs/ec25.c
new file mode 100644
index 000000000000..4f9b6b06cce7
--- /dev/null
+++ b/sound/soc/codecs/ec25.c
@@ -0,0 +1,94 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#include <linux/module.h>
+#include <sound/soc.h>
+
+static const struct snd_soc_dapm_widget ec25_dapm_widgets[] = {
+ SND_SOC_DAPM_OUTPUT("AOUT"),
+ SND_SOC_DAPM_INPUT("AIN"),
+};
+
+static const struct snd_soc_dapm_route ec25_dapm_routes[] = {
+ { "AOUT", NULL, "Playback" },
+ { "AOUT", NULL, "Wideband Playback" },
+ { "Capture", NULL, "AIN" },
+ { "Wideband Capture", NULL, "AIN" },
+};
+
+static const struct snd_soc_component_driver ec25_component_driver = {
+ .dapm_widgets = ec25_dapm_widgets,
+ .num_dapm_widgets = ARRAY_SIZE(ec25_dapm_widgets),
+ .dapm_routes = ec25_dapm_routes,
+ .num_dapm_routes = ARRAY_SIZE(ec25_dapm_routes),
+ .endianness = 1,
+};
+
+static struct snd_soc_dai_driver ec25_dais[] = {
+ {
+ .name = "ec25",
+ .capture = {
+ .stream_name = "Capture",
+ .channels_min = 1,
+ .channels_max = 1,
+ .rates = SNDRV_PCM_RATE_8000,
+ .formats = SNDRV_PCM_FMTBIT_S16_LE,
+ },
+ .playback = {
+ .stream_name = "Playback",
+ .channels_min = 1,
+ .channels_max = 1,
+ .rates = SNDRV_PCM_RATE_8000,
+ .formats = SNDRV_PCM_FMTBIT_S16_LE,
+ },
+ .symmetric_rate = 1,
+ .symmetric_channels = 1,
+ .symmetric_sample_bits = 1,
+ },
+ {
+ .name = "ec25-wb",
+ .capture = {
+ .stream_name = "Wideband Capture",
+ .channels_min = 1,
+ .channels_max = 1,
+ .rates = SNDRV_PCM_RATE_16000,
+ .formats = SNDRV_PCM_FMTBIT_S16_LE,
+ },
+ .playback = {
+ .stream_name = "Wideband Playback",
+ .channels_min = 1,
+ .channels_max = 1,
+ .rates = SNDRV_PCM_RATE_16000,
+ .formats = SNDRV_PCM_FMTBIT_S16_LE,
+ },
+ .symmetric_rate = 1,
+ .symmetric_channels = 1,
+ .symmetric_sample_bits = 1,
+ },
+};
+
+static int ec25_codec_probe(struct platform_device *pdev)
+{
+ return devm_snd_soc_register_component(&pdev->dev, &ec25_component_driver,
+ ec25_dais, ARRAY_SIZE(ec25_dais));
+}
+
+static const struct of_device_id ec25_codec_of_match[] = {
+ { .compatible = "quectel,ec25", },
+ {},
+};
+MODULE_DEVICE_TABLE(of, ec25_codec_of_match);
+
+static struct platform_driver ec25_codec_driver = {
+ .driver = {
+ .name = "ec25",
+ .of_match_table = of_match_ptr(ec25_codec_of_match),
+ },
+ .probe = ec25_codec_probe,
+};
+
+module_platform_driver(ec25_codec_driver);
+
+MODULE_DESCRIPTION("ASoC ec25 driver");
+MODULE_AUTHOR("Samuel Holland <samuel@sholland.org>");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:ec25");
--
2.51.0

View File

@@ -0,0 +1,45 @@
From d7510ae26674448d46b308be4f2ddab88a087093 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Mon, 15 Aug 2022 02:23:37 +0200
Subject: ASoC: rockchip: Fix doubling of playback speed after system sleep
There is some issue with CRU on RK3399 that can be reproduced by:
- playing some audio and stopping the playback (so that runtime PM suspends I2S)
- putting system to deep sleep and resuming it (using mainline TF-A)
- playing some audio (audio plays at 2x the normal speed)
If the audio is kept playing during system sleep cycle, the issue
does not manifest. Relevant registers in CRU are identical in bug/
no-bug scenarios, so this patch is just touching the CRU registers
without actually changing anything in the end. Touching the registers
fixes the playback speed, though.
Inspired by: https://github.com/djselbeck/linux/commit/cb4be5dec3fa18c4b344c11fed3fc57aa3bea424
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
sound/soc/rockchip/rockchip_i2s.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c
index 0a0a95b4f520..6dce1db85427 100644
--- a/sound/soc/rockchip/rockchip_i2s.c
+++ b/sound/soc/rockchip/rockchip_i2s.c
@@ -114,6 +114,13 @@ static int i2s_runtime_resume(struct device *dev)
if (ret)
clk_disable_unprepare(i2s->mclk);
+ if (ret == 0) {
+ unsigned long rate = clk_get_rate(i2s->mclk);
+
+ clk_set_rate(i2s->mclk, rate - 1);
+ clk_set_rate(i2s->mclk, rate);
+ }
+
return ret;
}
--
2.51.0

View File

@@ -0,0 +1,67 @@
From 8977f7a800aeac075fed063786f6f46e92a593eb Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Tue, 14 May 2024 10:46:10 +0200
Subject: ASoC: simple-card: Allow to define pins for aux jack devices
This restores original behavior of jack pins on Pinephone, as it was
before upstreaming jack detection to codec driver.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
sound/soc/generic/simple-card-utils.c | 40 +++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index 355f7ec8943c..5de2e0612a87 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -879,6 +879,46 @@ int simple_util_init_aux_jacks(struct simple_util_priv *priv, char *prefix)
continue;
(void)snd_soc_component_set_jack(component, jack, NULL);
+
+ /* add pins to the jack */
+ int count = of_property_count_strings(card->dev->of_node, "simple-audio-card,jack-pins");
+ if (count < 0) {
+ if (count != -EINVAL)
+ dev_warn(card->dev, "Invalid jack-pins property\n");
+ continue;
+ }
+ if (count % 2) {
+ dev_warn(card->dev, "jack-pins property must have even number of strings\n");
+ continue;
+ }
+
+ for (int idx = 0; idx < count; idx += 2) {
+ const char *aux_dev_name, *pin_name;
+ u32 mask;
+
+ ret = of_property_read_string_index(card->dev->of_node, "simple-audio-card,jack-pins", idx, &aux_dev_name);
+ if (ret < 0)
+ continue;
+ ret = of_property_read_string_index(card->dev->of_node, "simple-audio-card,jack-pins", idx + 1, &pin_name);
+ if (ret < 0)
+ continue;
+ ret = of_property_read_u32_index(card->dev->of_node, "simple-audio-card,jack-pins-mask", idx / 2, &mask);
+ if (ret < 0) {
+ dev_warn(card->dev, "jack-pins-mask for jack pin %s/%s can't be read\n", aux_dev_name, pin_name);
+ continue;
+ }
+
+ if (!strcmp(aux_dev_name, component->name)) {
+ struct snd_soc_jack_pin *pin = devm_kzalloc(card->dev, sizeof(*pin), GFP_KERNEL);
+
+ pin->pin = pin_name;
+ pin->mask = mask;
+
+ dev_info(card->dev, "Adding jack %s pin %s (mask %d)\n",
+ aux_dev_name, pin_name, pin->mask);
+ snd_soc_jack_add_pins(jack, 1, pin);
+ }
+ }
}
return 0;
}
--
2.51.0

View File

@@ -0,0 +1,129 @@
From ed4d0a091a27c0cf4df577178de481f0b7f534db Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Sat, 17 Feb 2024 01:13:39 +0100
Subject: ASoC: sun8i-codec: Add debug output for jack detection
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
sound/soc/sunxi/sun8i-codec.c | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/sound/soc/sunxi/sun8i-codec.c b/sound/soc/sunxi/sun8i-codec.c
index 9bf5dab1b803..3dcaf4267e41 100644
--- a/sound/soc/sunxi/sun8i-codec.c
+++ b/sound/soc/sunxi/sun8i-codec.c
@@ -9,6 +9,8 @@
* Mylène Josserand <mylene.josserand@free-electrons.com>
*/
+#define DEBUG
+
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/clk.h>
@@ -234,6 +236,7 @@ struct sun8i_codec {
int jack_status;
int jack_type;
int jack_last_sample;
+ unsigned jack_last_btn;
ktime_t jack_hbias_ready;
struct mutex jack_mutex;
int last_hmic_irq;
@@ -1341,6 +1344,8 @@ static void sun8i_codec_set_hmic_bias(struct sun8i_codec *scodec, bool enable)
snd_soc_dapm_sync(dapm);
+ dev_dbg(scodec->component->dev, "HMIC bias %s\n", enable ? "on" : "off");
+
regmap_update_bits(scodec->regmap, SUN8I_HMIC_CTRL1,
irq_mask, enable ? irq_mask : 0);
}
@@ -1349,6 +1354,7 @@ static void sun8i_codec_jack_work(struct work_struct *work)
{
struct sun8i_codec *scodec = container_of(work, struct sun8i_codec,
jack_work.work);
+ struct device *dev = scodec->component->dev;
unsigned int mdata;
int type;
@@ -1359,6 +1365,7 @@ static void sun8i_codec_jack_work(struct work_struct *work)
return;
scodec->jack_last_sample = -1;
+ scodec->jack_last_btn = 0;
if (scodec->jack_type & SND_JACK_MICROPHONE) {
/*
@@ -1416,6 +1423,8 @@ static void sun8i_codec_jack_work(struct work_struct *work)
snd_soc_jack_report(scodec->jack, type, scodec->jack_type);
scodec->jack_status = SUN8I_JACK_STATUS_CONNECTED;
+
+ dev_dbg(dev, "jack: plug-in reported\n");
} else if (scodec->jack_status == SUN8I_JACK_STATUS_CONNECTED) {
if (scodec->last_hmic_irq != SUN8I_HMIC_STS_JACK_OUT_IRQ_ST)
return;
@@ -1425,14 +1434,18 @@ static void sun8i_codec_jack_work(struct work_struct *work)
sun8i_codec_set_hmic_bias(scodec, false);
snd_soc_jack_report(scodec->jack, 0, scodec->jack_type);
+
+ dev_dbg(dev, "jack: plug-out reported\n");
}
}
static irqreturn_t sun8i_codec_jack_irq(int irq, void *dev_id)
{
struct sun8i_codec *scodec = dev_id;
+ struct device *dev = scodec->component->dev;
int type = SND_JACK_HEADSET;
unsigned int status, value;
+ unsigned btn_chg = 0;
guard(mutex)(&scodec->jack_mutex);
@@ -1444,6 +1457,8 @@ static irqreturn_t sun8i_codec_jack_irq(int irq, void *dev_id)
* 100ms after each interrupt..
*/
if (status & BIT(SUN8I_HMIC_STS_JACK_OUT_IRQ_ST)) {
+ dev_dbg(dev, "jack: irq plug-out\n");
+
/*
* Out interrupt has priority over in interrupt so that if
* we get both, we assume the disconnected state, which is
@@ -1453,6 +1468,8 @@ static irqreturn_t sun8i_codec_jack_irq(int irq, void *dev_id)
mod_delayed_work(system_power_efficient_wq, &scodec->jack_work,
msecs_to_jiffies(100));
} else if (status & BIT(SUN8I_HMIC_STS_JACK_IN_IRQ_ST)) {
+ dev_dbg(dev, "jack: irq plug-in\n");
+
scodec->last_hmic_irq = SUN8I_HMIC_STS_JACK_IN_IRQ_ST;
mod_delayed_work(system_power_efficient_wq, &scodec->jack_work,
msecs_to_jiffies(100));
@@ -1486,9 +1503,22 @@ static irqreturn_t sun8i_codec_jack_irq(int irq, void *dev_id)
* samples are identical.
*/
if (scodec->jack_last_sample >= 0 &&
- scodec->jack_last_sample == value)
+ scodec->jack_last_sample == value) {
snd_soc_jack_report(scodec->jack, type,
scodec->jack_type);
+ btn_chg = (scodec->jack_last_btn ^ type) & SUN8I_CODEC_BUTTONS;
+ scodec->jack_last_btn = type;
+ }
+
+ if (btn_chg & SND_JACK_BTN_0)
+ dev_dbg(dev, "jack: key_%spress BTN_0 (%#x)\n",
+ type & SND_JACK_BTN_0 ? "" : "de", value);
+ if (btn_chg & SND_JACK_BTN_1)
+ dev_dbg(dev, "jack: key_%spress BTN_1 (%#x)\n",
+ type & SND_JACK_BTN_1 ? "" : "de", value);
+ if (btn_chg & SND_JACK_BTN_2)
+ dev_dbg(dev, "jack: key_%spress BTN_2 (%#x)\n",
+ type & SND_JACK_BTN_2 ? "" : "de", value);
scodec->jack_last_sample = value;
}
--
2.51.0

View File

@@ -0,0 +1,47 @@
From ac76eb562601f29b0bca131770d85936a398fac3 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Sat, 2 Mar 2024 14:55:31 +0100
Subject: ASoC: sun8i-codec: Allow the jack type to be set via device tree
This makes the codec's jack detection functionality usable from within
simple-sound-card.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
sound/soc/sunxi/sun8i-codec.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/sound/soc/sunxi/sun8i-codec.c b/sound/soc/sunxi/sun8i-codec.c
index 7b3496caa31e..44ed07595c87 100644
--- a/sound/soc/sunxi/sun8i-codec.c
+++ b/sound/soc/sunxi/sun8i-codec.c
@@ -1560,6 +1560,18 @@ static void sun8i_codec_disable_jack_detect(struct snd_soc_component *component)
scodec->jack = NULL;
}
+static int sun8i_codec_component_get_jack_type(struct snd_soc_component *component)
+{
+ struct device_node *node = component->dev->of_node;
+
+ if (of_property_match_string(node, "jack-type", "headset") >= 0)
+ return SND_JACK_HEADSET | SUN8I_CODEC_BUTTONS;
+ else if (of_property_match_string(node, "jack-type", "headphone") >= 0)
+ return SND_JACK_HEADPHONE;
+
+ return 0;
+}
+
static int sun8i_codec_component_set_jack(struct snd_soc_component *component,
struct snd_soc_jack *jack, void *data)
{
@@ -1581,6 +1593,7 @@ static const struct snd_soc_component_driver sun8i_soc_component = {
.dapm_routes = sun8i_codec_dapm_routes,
.num_dapm_routes = ARRAY_SIZE(sun8i_codec_dapm_routes),
.set_jack = sun8i_codec_component_set_jack,
+ .get_jack_type = sun8i_codec_component_get_jack_type,
.probe = sun8i_codec_component_probe,
.idle_bias_on = 1,
.suspend_bias_off = 1,
--
2.51.0

View File

@@ -0,0 +1,48 @@
From 282f0e41b191b88d286081221ac40120252fb41f Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Tue, 26 Mar 2024 17:38:38 +0100
Subject: ASoC: sun8i-codec: Set jack_type from DT in probe
Jack type needs to be set in probe so that it can be used later on.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
sound/soc/sunxi/sun8i-codec.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/sound/soc/sunxi/sun8i-codec.c b/sound/soc/sunxi/sun8i-codec.c
index 3dcaf4267e41..222eac963759 100644
--- a/sound/soc/sunxi/sun8i-codec.c
+++ b/sound/soc/sunxi/sun8i-codec.c
@@ -1599,14 +1599,9 @@ static void sun8i_codec_disable_jack_detect(struct snd_soc_component *component)
static int sun8i_codec_component_get_jack_type(struct snd_soc_component *component)
{
- struct device_node *node = component->dev->of_node;
-
- if (of_property_match_string(node, "jack-type", "headset") >= 0)
- return SND_JACK_HEADSET | SUN8I_CODEC_BUTTONS;
- else if (of_property_match_string(node, "jack-type", "headphone") >= 0)
- return SND_JACK_HEADPHONE;
+ struct sun8i_codec *scodec = snd_soc_component_get_drvdata(component);
- return 0;
+ return scodec->jack_type;
}
static int sun8i_codec_component_set_jack(struct snd_soc_component *component,
@@ -1668,6 +1663,11 @@ static int sun8i_codec_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, scodec);
+ if (of_property_match_string(pdev->dev.of_node, "jack-type", "headset") >= 0)
+ scodec->jack_type = SND_JACK_HEADSET | SUN8I_CODEC_BUTTONS;
+ else if (of_property_match_string(pdev->dev.of_node, "jack-type", "headphone") >= 0)
+ scodec->jack_type = SND_JACK_HEADPHONE;
+
if (scodec->quirks->bus_clock) {
scodec->clk_bus = devm_clk_get(&pdev->dev, "bus");
if (IS_ERR(scodec->clk_bus)) {
--
2.51.0

View File

@@ -0,0 +1,31 @@
From 4034f4e90fe681ff4645fe724424ae48f3909e19 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Fri, 23 Feb 2024 01:58:40 +0100
Subject: ASoC: sun8i-codec: define button keycodes
This is likely not upstreamable, but simple. :)
---
sound/soc/sunxi/sun8i-codec.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/sound/soc/sunxi/sun8i-codec.c b/sound/soc/sunxi/sun8i-codec.c
index 44ed07595c87..9bf5dab1b803 100644
--- a/sound/soc/sunxi/sun8i-codec.c
+++ b/sound/soc/sunxi/sun8i-codec.c
@@ -1538,6 +1538,13 @@ static int sun8i_codec_enable_jack_detect(struct snd_soc_component *component,
if (ret)
return ret;
+ if (jack->jack->type & SND_JACK_MICROPHONE) {
+ snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
+ snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOLUMEUP);
+ snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN);
+ snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
+ }
+
return 0;
}
--
2.51.0

View File

@@ -0,0 +1,215 @@
From 13de56c82a52f64f32089881b77152aefc01595d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Tue, 22 Nov 2016 01:01:49 +0100
Subject: Add README.md with information and u-boot patches
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
...Fix-PLL1-setup-to-never-use-dividers.patch | 33 ++++
README.md | 154 ++++++++++++++++++
2 files changed, 187 insertions(+)
create mode 100644 0001-sunxi-h3-Fix-PLL1-setup-to-never-use-dividers.patch
create mode 100644 README.md
diff --git a/0001-sunxi-h3-Fix-PLL1-setup-to-never-use-dividers.patch b/0001-sunxi-h3-Fix-PLL1-setup-to-never-use-dividers.patch
new file mode 100644
index 000000000000..2b892e805a2b
--- /dev/null
+++ b/0001-sunxi-h3-Fix-PLL1-setup-to-never-use-dividers.patch
@@ -0,0 +1,33 @@
+From 7f5071f906f79bdc99d6b4b0ccf0cb280abe740b Mon Sep 17 00:00:00 2001
+From: Ondrej Jirman <megi@xff.cz>
+Date: Tue, 20 Dec 2016 11:25:12 +0100
+Subject: [PATCH] sunxi: h3: Fix PLL1 setup to never use dividers
+
+Kernel would lower the divider on first CLK change and cause the
+lock up.
+---
+ arch/arm/mach-sunxi/clock_sun6i.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/arch/arm/mach-sunxi/clock_sun6i.c b/arch/arm/mach-sunxi/clock_sun6i.c
+index 50fb302a19..91aa2a0478 100644
+--- a/arch/arm/mach-sunxi/clock_sun6i.c
++++ b/arch/arm/mach-sunxi/clock_sun6i.c
+@@ -94,11 +94,10 @@ void clock_set_pll1(unsigned int clk)
+ int k = 1;
+ int m = 1;
+
+- if (clk > 1152000000) {
+- k = 2;
+- } else if (clk > 768000000) {
++ if (clk >= 1368000000) {
+ k = 3;
+- m = 2;
++ } else if (clk >= 768000000) {
++ k = 2;
+ }
+
+ /* Switch to 24MHz clock while changing PLL1 */
+--
+2.11.0
+
diff --git a/README.md b/README.md
new file mode 100644
index 000000000000..74c4c16416d3
--- /dev/null
+++ b/README.md
@@ -0,0 +1,154 @@
+Mainline linux kernel for Orange Pi PC/PC2/PC3/One, TBS A711, PinePhone (Pro), PocketBook Touch Lux 3
+------------------------------------------------------------------------------------------------------
+
+This kernel tree is meant for:
+
+- Orange Pi One
+- Orange Pi PC
+- Orange Pi PC 2
+- Orange Pi 3
+- PinePhone 1.0, 1.1 and 1.2(a/b)
+- TBS A711 Tablet
+- PocketBook Touch Lux 3
+- Pinebook Pro
+- Pinephone Pro
+
+Features in addition to mainline:
+
+- [Orange Pi One/PC/PC2] More aggressive OPPs for CPU
+- [All] Mark one of DRM planes as a cursor plane, speeding up Xorg based desktop with modesetting driver
+- [Orange Pi One/PC/PC2] Configure on-board micro-switches to perform system power off function
+- [Orange Pi One/PC/PC2/3] HDMI audio
+- [Orange Pi 3] Ethernet
+- [TBS A711] HM5065 (back camera) / GC2145 (front camera)
+- [PinePhone] WiFi, Bluetooth, Audio, Modem power, HDMI out over USB-C, USB-C support, cameras, PMIC improvements, power management, fixes here and there
+- [PocketBook Touch Lux 3] Display and Touchscreen support
+- [Pinephone Pro] Everything
+
+Pre-built u-boot and kernels are available at https://xff.cz/kernels/
+
+You may need some firmware files for some part of the functionality. Those are
+available at: https://megous.com/git/linux-firmware
+
+If you want to reproduce my pre-built kernels exactly, you'll need to uncomment
+CONFIG_EXTRA_FIRMWARE_DIR and CONFIG_EXTRA_FIRMWARE in the defconfigs, and
+point CONFIG_EXTRA_FIRMWARE_DIR to a directory on your computer where the
+clone of https://megous.com/git/linux-firmware resides.
+
+You can also leave those two config options commented out, and copy the contents
+of https://megous.com/git/linux-firmware to /lib/firmware/ on the target device.
+
+You can use this kernel to run a desktop environment on Orange Pi SBCs,
+Arch Linux on your Pinephone, or to have a completely opensource OS on
+a Pocketbook e-ink book reader.
+
+Have fun!
+
+
+Build instructions
+------------------
+
+These are rudimentary instructions and you need to understand what you're doing.
+These are just core steps required to build the ATF/u-boot/kernel. Downloading,
+verifying, renaming to correct directories is not described or mentioned. You
+should be able to infer missing necessary steps yourself for your particular needs.
+
+Get necessary toolchains from:
+
+- https://releases.linaro.org/components/toolchain/binaries/latest/aarch64-linux-gnu/ for 64bit Orange Pi PC2 and Orange Pi 3, PinePhone
+- https://releases.linaro.org/components/toolchain/binaries/latest/arm-linux-gnueabihf/ for 32bit Orange Pis, Pocketbook, TBS tablet
+
+Extract toolchains and prepare the environment:
+
+ CWD=`pwd`
+ OUT=$CWD/builds
+ SRC=$CWD/u-boot
+ export PATH="$PATH:$CWD/Toolchains/arm/bin:$CWD/Toolchains/aarch64/bin"
+
+For Orange Pi PC2, Orange Pi 3 or PinePhone:
+
+ export CROSS_COMPILE=aarch64-linux-gnu-
+ export KBUILD_OUTPUT=$OUT/.tmp/uboot-pc2
+ rm -rf "$KBUILD_OUTPUT"
+ mkdir -p $KBUILD_OUTPUT $OUT/pc2
+
+Get and build ATF from https://github.com/ARM-software/arm-trusted-firmware:
+
+ make -C "$CWD/arm-trusted-firmware" PLAT=sun50i_a64 DEBUG=1 bl31
+ cp "$CWD/arm-trusted-firmware/build/sun50i_a64/debug/bl31.bin" "$KBUILD_OUTPUT"
+
+Use sun50i_a64 for Orange Pi PC2 or PinePhone and sun50i_h6 for Orange Pi 3.
+
+Build u-boot from https://megous.com/git/u-boot/ (opi-v2020.04 branch) with appropriate
+defconfig (orangepi_one_defconfig, orangepi_pc2_defconfig, orangepi_pc_defconfig, orangepi_3_defconfig, tbs_a711_defconfig, pinephone_defconfig).
+
+My u-boot branch already has all the necessary patches integrated and is configured for quick u-boot/kernel startup.
+
+ make -C u-boot orangepi_pc2_defconfig
+ make -C u-boot -j5
+
+ cp $KBUILD_OUTPUT/.config $OUT/pc2/uboot.config
+ cat $KBUILD_OUTPUT/{spl/sunxi-spl.bin,u-boot.itb} > $OUT/pc2/uboot.bin
+
+Get kernel from this repository and checkout the latest orange-pi-5.18 branch.
+
+Build the kernel for 64-bit boards:
+
+ export ARCH=arm64
+ export CROSS_COMPILE=aarch64-linux-gnu-
+ export KBUILD_OUTPUT=$OUT/.tmp/linux-arm64
+ mkdir -p $KBUILD_OUTPUT $OUT/pc2
+
+ make -C linux orangepi_defconfig
+ # or make -C linux pocketbook_touch_lux_3_defconfig
+ # or make -C linux tbs_a711_defconfig
+ make -C linux -j5 clean
+ make -C linux -j5 Image dtbs
+
+ cp -f $KBUILD_OUTPUT/arch/arm64/boot/Image $OUT/pc2/
+ cp -f $KBUILD_OUTPUT/.config $OUT/pc2/linux.config
+ cp -f $KBUILD_OUTPUT/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dtb $OUT/pc2/board.dtb
+
+Build the kernel for 32-bit boards:
+
+ export ARCH=arm
+ export CROSS_COMPILE=arm-linux-gnueabihf-
+ export KBUILD_OUTPUT=$OUT/.tmp/linux-arm
+ mkdir -p $KBUILD_OUTPUT $OUT/pc
+
+ make orangepi_defconfig
+ # or make pinephone_defconfig
+ make -C linux orangepi_defconfig
+ make -C linux -j5 clean
+ make -C linux -j5 zImage dtbs
+
+ cp -f $KBUILD_OUTPUT/arch/arm/boot/zImage $OUT/pc/
+ cp -f $KBUILD_OUTPUT/.config $OUT/pc/linux.config
+ cp -f $KBUILD_OUTPUT/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dtb $OUT/pc/board.dtb
+ # Or use sun8i-h3-orangepi-one.dtb for Orange Pi One
+
+
+PinePhone
+---------
+
+I don't run u-boot on PinePhone, so my pre-built kernel packages don't come
+with u-boot built for PinePhone.
+
+
+Kernel lockup issues
+--------------------
+
+*If you're getting lockups on boot or later during thermal regulation,
+you're missing an u-boot patch.*
+
+This patch is necessary to run this kernel!
+
+These lockups are caused by improper NKMP clock factors selection
+in u-boot for PLL_CPUX. (M divider should not be used. P divider
+should be used only for frequencies below 240MHz.)
+
+This patch for u-boot fixes it:
+
+ 0001-sunxi-h3-Fix-PLL1-setup-to-never-use-dividers.patch
+
+Kernel side is already fixed in this kernel tree.
--
2.51.0

View File

@@ -0,0 +1,66 @@
From 7bd8ad9c9778bb66afee88678c1a45d44a59be5d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Fri, 18 Aug 2017 13:56:06 +0200
Subject: Add support for my private Sapomat device
---
arch/arm/boot/dts/allwinner/Makefile | 1 +
.../sun8i-h3-orangepi-pc-sapomat.dts | 34 +++++++++++++++++++
2 files changed, 35 insertions(+)
create mode 100644 arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-pc-sapomat.dts
diff --git a/arch/arm/boot/dts/allwinner/Makefile b/arch/arm/boot/dts/allwinner/Makefile
index d799ad153b37..326ff9c7de72 100644
--- a/arch/arm/boot/dts/allwinner/Makefile
+++ b/arch/arm/boot/dts/allwinner/Makefile
@@ -240,6 +240,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \
sun8i-h3-orangepi-lite.dtb \
sun8i-h3-orangepi-one.dtb \
sun8i-h3-orangepi-pc.dtb \
+ sun8i-h3-orangepi-pc-sapomat.dtb \
sun8i-h3-orangepi-pc-plus.dtb \
sun8i-h3-orangepi-plus.dtb \
sun8i-h3-orangepi-plus2e.dtb \
diff --git a/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-pc-sapomat.dts b/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-pc-sapomat.dts
new file mode 100644
index 000000000000..55c82d5fb63f
--- /dev/null
+++ b/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-pc-sapomat.dts
@@ -0,0 +1,34 @@
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include "sun8i-h3-orangepi-pc.dts"
+
+/ {
+ model = "Xunlong Orange Pi PC Sapomat";
+
+ sapomat_gpio_keys {
+ compatible = "gpio-keys-polled";
+ poll-interval = <50>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&sapomat_btn_pins>;
+
+ red_btn {
+ label = "Red Button";
+ linux,code = <BTN_4>;
+ gpios = <&pio 2 4 GPIO_ACTIVE_LOW>; /* PC4 */
+ };
+
+ green_btn {
+ label = "Green Button";
+ linux,code = <BTN_5>;
+ gpios = <&pio 2 7 GPIO_ACTIVE_LOW>; /* PC7 */
+ };
+ };
+};
+
+&pio {
+ sapomat_btn_pins: btn_pins@0 {
+ pins = "PC4", "PC7";
+ function = "gpio_in";
+ bias-pull-up;
+ };
+};
--
2.51.0

View File

@@ -0,0 +1,53 @@
From e8b24e85296e6acfe0151a2ea9a7c8d498c85cd3 Mon Sep 17 00:00:00 2001
From: "Steinar H. Gunderson" <steinar+kernel@gunderson.no>
Date: Mon, 4 Nov 2024 15:35:38 +0000
Subject: Fix broken allwinner,sram dependency on h616, h618
On BigTreeTech CB1, the thermal sensor has an allwinner,sram
property pointing to <&syscon>. However, Armbian has an out-of-tree
kernel patch that creates dependencies based on allwinner,sram
properties, which assumes that they point to sram nodes exactly
two levels below the syscon node (instead of the syscon itself).
This manifests itself as the thermal sensor refusing to load with
a nonsensical error message:
[ 23.775976] platform 5070400.thermal-sensor: deferred probe pending: platform: wait for supplier
Note that it does not say _which_ supplier it is waiting for
(the message ends in a space and then no supplier). The patch
was unproblematic in the 5.6 megous patch set, where it was
introduced, and in 6.6, which is current for Armbian, but in
6.8, the sun8i-thermal driver got mainlined, with this extra
property compared to the out-of-tree version we used before
(since it wants to clear a special bit at 0x300000 instead of
relying on the firmware to do so before kernel boot).
Fix by being a bit more flexible when we walk up the tree,
so that we always stop at the syscon node.
Tested on a Sovol SV08, which is CB1-based.
Signed-off-by: Steinar H. Gunderson <steinar+kernel@gunderson.no>
---
drivers/of/property.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/of/property.c b/drivers/of/property.c
index 934468f306d2..632520524453 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -1503,8 +1503,9 @@ static struct device_node *parse_allwinner_sram(struct device_node *np,
return NULL;
sram_node = of_parse_phandle(np, prop_name, 0);
- sram_node = of_get_parent(sram_node);
- sram_node = of_get_parent(sram_node);
+ while (sram_node && !of_node_is_type(sram_node, "syscon")) {
+ sram_node = of_get_parent(sram_node);
+ }
return sram_node;
}
--
2.51.0

View File

@@ -0,0 +1,32 @@
From 5d46a9e553570329c9b6482186b28766ae1fae21 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Sat, 26 Aug 2023 10:55:24 +0200
Subject: Fix intptr_t typedef
GCC includes the same typedef, but on some 32bit platforms it's defined
as int, leading to conflicts.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
include/linux/types.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/linux/types.h b/include/linux/types.h
index 6dfdb8e8e4c3..73bed912e7e8 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -40,7 +40,11 @@ typedef __kernel_uid16_t uid16_t;
typedef __kernel_gid16_t gid16_t;
typedef unsigned long uintptr_t;
+#if __SIZEOF_POINTER__ == __SIZEOF_INT__
+typedef int intptr_t;
+#else
typedef long intptr_t;
+#endif
#ifdef CONFIG_HAVE_UID16
/* This is defined by arch/{arch}/include/asm/posix_types.h */
--
2.51.0

View File

@@ -0,0 +1,30 @@
From 2ce741f43a65732bd9078046c272743d06a41701 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Sat, 30 Sep 2017 21:31:35 +0200
Subject: MAINTAINERS: Add entry for Himax HM5065
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
MAINTAINERS | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index c0b444e5fd5a..f00104b455d7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -10810,6 +10810,12 @@ L: linux-kernel@vger.kernel.org
S: Maintained
F: drivers/misc/hisi_hikey_usb.c
+HIMAX HM5065 SENSOR DRIVER
+M: Ondrej Jirman <kernel@xff.cz>
+L: linux-media@vger.kernel.org
+S: Supported
+F: drivers/media/i2c/hm5065.c
+
HIMAX HX83112B TOUCHSCREEN SUPPORT
M: Job Noorman <job@noorman.info>
L: linux-input@vger.kernel.org
--
2.51.0

View File

@@ -0,0 +1,39 @@
From 325a2fb637eaac4bee2a6ea78e10040b6b2e7c7d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Fri, 18 Aug 2017 13:55:48 +0200
Subject: Make microbuttons on Orange Pi PC and PC 2 work as power off buttons
---
arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-one.dts | 2 +-
arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-one.dts b/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-one.dts
index 927fd1bab07d..f5476cdab8a4 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-one.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-one.dts
@@ -91,7 +91,7 @@ gpio-keys {
switch-4 {
label = "sw4";
- linux,code = <BTN_0>;
+ linux,code = <KEY_POWER>;
gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
};
};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts
index f420acc6f49f..3d16a6efa2a7 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts
@@ -60,7 +60,7 @@ gpio-keys {
key-sw4 {
label = "sw4";
- linux,code = <BTN_0>;
+ linux,code = <KEY_POWER>;
gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
wakeup-source;
};
--
2.51.0

View File

@@ -0,0 +1,40 @@
From 3f375e42748006d39032cb24896f6ad01c57f507 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Mon, 10 Feb 2020 01:00:12 +0100
Subject: Mark some slow drivers for async probe with PROBE_PREFER_ASYNCHRONOUS
This makes it faster to boot TBS A711 tablet.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
drivers/iio/accel/bma180.c | 1 +
drivers/nfc/nxp-nci/i2c.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c
index 93a868678722..c637d04a2a76 100644
--- a/drivers/iio/accel/bma180.c
+++ b/drivers/iio/accel/bma180.c
@@ -1126,6 +1126,7 @@ static struct i2c_driver bma180_driver = {
.name = "bma180",
.pm = pm_sleep_ptr(&bma180_pm_ops),
.of_match_table = bma180_of_match,
+ .probe_type = PROBE_PREFER_ASYNCHRONOUS,
},
.probe = bma180_probe,
.remove = bma180_remove,
diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
index 049662ffdf97..35986be81ee3 100644
--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -348,6 +348,7 @@ static struct i2c_driver nxp_nci_i2c_driver = {
.name = NXP_NCI_I2C_DRIVER_NAME,
.acpi_match_table = ACPI_PTR(acpi_id),
.of_match_table = of_nxp_nci_i2c_match,
+ .probe_type = PROBE_PREFER_ASYNCHRONOUS,
},
.probe = nxp_nci_i2c_probe,
.id_table = nxp_nci_i2c_id_table,
--
2.51.0

View File

@@ -0,0 +1,115 @@
From c3623224b8c0f881cd2f75fe43399d765612dcfd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Sun, 9 May 2021 23:43:21 +0200
Subject: Move a node to avoid merge conflict
---
arch/arm/boot/dts/allwinner/sunxi-h3-h5.dtsi | 12 ++++-----
.../dts/allwinner/sun50i-h6-orangepi-3.dts | 8 +++---
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 27 +++++++++----------
3 files changed, 23 insertions(+), 24 deletions(-)
diff --git a/arch/arm/boot/dts/allwinner/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/allwinner/sunxi-h3-h5.dtsi
index 0f19e7c00c50..a872fc586ab6 100644
--- a/arch/arm/boot/dts/allwinner/sunxi-h3-h5.dtsi
+++ b/arch/arm/boot/dts/allwinner/sunxi-h3-h5.dtsi
@@ -100,12 +100,6 @@ osc32k: osc32k-clk {
};
};
- de: display-engine {
- compatible = "allwinner,sun8i-h3-display-engine";
- allwinner,pipelines = <&mixer0>;
- status = "disabled";
- };
-
sound_hdmi: sound_hdmi {
compatible = "allwinner,sun9i-a80-hdmi-audio",
"allwinner,sun8i-h3-hdmi-audio";
@@ -120,6 +114,12 @@ cpu {
};
};
+ de: display-engine {
+ compatible = "allwinner,sun8i-h3-display-engine";
+ allwinner,pipelines = <&mixer0>;
+ status = "disabled";
+ };
+
soc {
compatible = "simple-bus";
#address-cells = <1>;
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts
index 4cc21a55a7c1..e05cf8eb5474 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts
@@ -128,6 +128,10 @@ &gpu {
status = "okay";
};
+&i2s1 {
+ status = "okay";
+};
+
&hdmi {
status = "okay";
};
@@ -167,10 +171,6 @@ ext_rgmii_phy: ethernet-phy@1 {
};
};
-&i2s1 {
- status = "okay";
-};
-
&mmc0 {
vmmc-supply = <&reg_cldo1>;
cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
index ff67281bc090..9f1094bdb965 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
@@ -122,20 +122,6 @@ psci {
method = "smc";
};
- sound_hdmi: sound_hdmi {
- compatible = "allwinner,sun9i-a80-hdmi-audio",
- "allwinner,sun50i-h6-hdmi-audio";
- status = "disabled";
-
- codec {
- sound-dai = <&hdmi>;
- };
-
- cpu {
- sound-dai = <&i2s1>;
- };
- };
-
timer {
compatible = "arm,armv8-timer";
arm,no-tick-in-suspend;
@@ -149,6 +135,19 @@ timer {
(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
};
+ sound_hdmi: sound_hdmi {
+ compatible = "allwinner,sun9i-a80-hdmi-audio",
+ "allwinner,sun50i-h6-hdmi-audio";
+ status = "disabled";
+
+ codec {
+ sound-dai = <&hdmi>;
+ };
+
+ cpu {
+ sound-dai = <&i2s1>;
+ };
+ };
soc {
compatible = "simple-bus";
--
2.51.0

View File

@@ -0,0 +1,28 @@
From 49999c3dbebce9f4542e5f0a9db55377c611c011 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Sun, 1 Nov 2020 02:57:38 +0100
Subject: Revert "drm/sun4i: lvds: Invert the LVDS polarity"
This reverts commit 3bc46a083fa9f475dd2e0ab8717d9839b070b8d9.
---
drivers/gpu/drm/sun4i/sun4i_tcon.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
index 960e83c8291d..fca95b76e258 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
@@ -476,7 +476,9 @@ static void sun4i_tcon0_mode_set_lvds(struct sun4i_tcon *tcon,
SUN4I_TCON0_BASIC2_V_TOTAL(mode->crtc_vtotal * 2) |
SUN4I_TCON0_BASIC2_V_BACKPORCH(bp));
- reg = SUN4I_TCON0_LVDS_IF_CLK_SEL_TCON0;
+ reg = SUN4I_TCON0_LVDS_IF_CLK_SEL_TCON0 |
+ SUN4I_TCON0_LVDS_IF_DATA_POL_NORMAL |
+ SUN4I_TCON0_LVDS_IF_CLK_POL_NORMAL;
if (sun4i_tcon_get_pixel_depth(encoder) == 24)
reg |= SUN4I_TCON0_LVDS_IF_BITWIDTH_24BITS;
else
--
2.51.0

View File

@@ -0,0 +1,39 @@
From f09463fbf2e97fc513284548edc066724bb834f8 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Tue, 7 May 2024 18:39:12 +0200
Subject: Revert "usb: typec: tcpm: unregister existing source caps before
re-registration"
This reverts commit 230ecdf71a644c9c73e0e6735b33173074ae3f94.
---
drivers/usb/typec/tcpm/tcpm.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
index 1f6fdfaa34bf..1043efce328d 100644
--- a/drivers/usb/typec/tcpm/tcpm.c
+++ b/drivers/usb/typec/tcpm/tcpm.c
@@ -3110,7 +3110,7 @@ static int tcpm_register_source_caps(struct tcpm_port *port)
{
struct usb_power_delivery_desc desc = { port->negotiated_rev };
struct usb_power_delivery_capabilities_desc caps = { };
- struct usb_power_delivery_capabilities *cap = port->partner_source_caps;
+ struct usb_power_delivery_capabilities *cap;
if (!port->partner_pd)
port->partner_pd = usb_power_delivery_register(NULL, &desc);
@@ -3120,11 +3120,6 @@ static int tcpm_register_source_caps(struct tcpm_port *port)
memcpy(caps.pdo, port->source_caps, sizeof(u32) * port->nr_source_caps);
caps.role = TYPEC_SOURCE;
- if (cap) {
- usb_power_delivery_unregister_capabilities(cap);
- port->partner_source_caps = NULL;
- }
-
cap = usb_power_delivery_register_capabilities(port->partner_pd, &caps);
if (IS_ERR(cap))
return PTR_ERR(cap);
--
2.51.0

View File

@@ -0,0 +1,35 @@
From c0add6f072c443e3cdf2ce1387a5da46c82e6399 Mon Sep 17 00:00:00 2001
From: Icenowy Zheng <icenowy@aosc.io>
Date: Mon, 20 Jul 2020 01:11:34 +0800
Subject: arm64: allwinner: dts: a64: enable K101-IM2BYL02 panel for PineTab
Newer PineTab may switch to K101-IM2BYL02.
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts
index 50a0e1916743..6056c965baf6 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts
@@ -200,12 +200,10 @@ &dsi {
status = "okay";
panel@0 {
- compatible = "feixin,k101-im2ba02";
+ compatible = "feixin,k101-im2byl02";
reg = <0>;
- avdd-supply = <&reg_dc1sw>;
- dvdd-supply = <&reg_dc1sw>;
- cvdd-supply = <&reg_ldo_io1>;
- reset-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */
+ power-supply = <&reg_dc1sw>;
+ reset-gpios = <&pio 3 24 GPIO_ACTIVE_LOW>; /* PD24 */
backlight = <&backlight>;
};
};
--
2.51.0

View File

@@ -0,0 +1,66 @@
From 0a4a41fa8ade7228868aa848a58c2be52e3ebe75 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sun, 6 Dec 2020 11:15:34 -0600
Subject: arm64: dts: allwinner: Enforce consistent MMC numbering
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 6 ++++++
arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi | 6 ++++++
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 6 ++++++
3 files changed, 18 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index c061387abe41..c4272550580c 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -18,6 +18,12 @@ / {
#address-cells = <1>;
#size-cells = <1>;
+ aliases {
+ mmc0 = &mmc0;
+ mmc1 = &mmc1;
+ mmc2 = &mmc2;
+ };
+
chosen {
#address-cells = <1>;
#size-cells = <1>;
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi
index 630fcab5defb..a40826c507d0 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi
@@ -6,6 +6,12 @@
#include <dt-bindings/thermal/thermal.h>
/ {
+ aliases {
+ mmc0 = &mmc0;
+ mmc1 = &mmc1;
+ mmc2 = &mmc2;
+ };
+
cpus {
#address-cells = <1>;
#size-cells = <0>;
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
index 9f1094bdb965..7d52ba6e5d6c 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
@@ -17,6 +17,12 @@ / {
#address-cells = <1>;
#size-cells = <1>;
+ aliases {
+ mmc0 = &mmc0;
+ mmc1 = &mmc1;
+ mmc2 = &mmc2;
+ };
+
cpus {
#address-cells = <1>;
#size-cells = <0>;
--
2.51.0

View File

@@ -0,0 +1,48 @@
From cb90c0e2677a987f4928d2030c7af510b1baf629 Mon Sep 17 00:00:00 2001
From: Jernej Skrabec <jernej.skrabec@gmail.com>
Date: Sun, 9 May 2021 10:39:56 +0200
Subject: arm64: dts: allwinner: a64: Add hdmi sound card
A64 supports HDMI audio. Add a sound card node for it.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index 0fecf0abb204..9a43bcc2f489 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -196,6 +196,20 @@ link0_codec: codec {
};
};
+ sound_hdmi: sound_hdmi {
+ compatible = "allwinner,sun9i-a80-hdmi-audio",
+ "allwinner,sun50i-a64-hdmi-audio";
+ status = "disabled";
+
+ codec {
+ sound-dai = <&hdmi>;
+ };
+
+ cpu {
+ sound-dai = <&i2s2>;
+ };
+ };
+
timer {
compatible = "arm,armv8-timer";
allwinner,erratum-unknown1;
@@ -1261,6 +1275,7 @@ deinterlace: deinterlace@1e00000 {
};
hdmi: hdmi@1ee0000 {
+ #sound-dai-cells = <0>;
compatible = "allwinner,sun50i-a64-dw-hdmi",
"allwinner,sun8i-a83t-dw-hdmi";
reg = <0x01ee0000 0x10000>;
--
2.51.0

View File

@@ -0,0 +1,204 @@
From 46db097304f674f7daff29b6710463e1b6ac62e0 Mon Sep 17 00:00:00 2001
From: Jernej Skrabec <jernej.skrabec@gmail.com>
Date: Sun, 9 May 2021 10:42:16 +0200
Subject: arm64: dts: allwinner: a64: Enable hdmi sound card on boards with
hdmi
Each board that has HDMI connector can also transmit audio through it.
Enable HDMI sound card on all A64 boards with HDMI connector.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts | 8 ++++++++
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts | 8 ++++++++
arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts | 7 +++++++
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts | 8 ++++++++
arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 8 ++++++++
.../boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts | 8 ++++++++
arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts | 8 ++++++++
7 files changed, 55 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
index d1f415acd7b5..0b68888c9eef 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
@@ -130,6 +130,10 @@ &i2c1_pins {
bias-pull-up;
};
+&i2s2 {
+ status = "okay";
+};
+
&mdio {
ext_rgmii_phy: ethernet-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
@@ -341,6 +345,10 @@ &sound {
"MIC1", "Onboard Microphone";
};
+&sound_hdmi {
+ status = "okay";
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pb_pins>;
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
index dec9960a7440..b6142224c329 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
@@ -102,6 +102,10 @@ &i2c1_pins {
bias-pull-up;
};
+&i2s2 {
+ status = "okay";
+};
+
&mdio {
ext_rgmii_phy: ethernet-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
@@ -252,6 +256,10 @@ &simplefb_hdmi {
vcc-hdmi-supply = <&reg_dldo1>;
};
+&sound_hdmi {
+ status = "okay";
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pb_pins>;
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
index fd3794678c33..0cc2e11dcb92 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
@@ -120,6 +120,10 @@ hdmi_out_con: endpoint {
};
};
+&i2s2 {
+ status = "okay";
+};
+
&mdio {
ext_rgmii_phy: ethernet-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
@@ -355,6 +359,9 @@ &sound {
"MIC1", "Microphone Jack Left",
"Microphone Jack Right", "MBIAS",
"MIC2", "Microphone Jack Right";
+};
+
+&sound_hdmi {
status = "okay";
};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts
index c8303a66438d..9194ca4b1e19 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts
@@ -137,6 +137,10 @@ hdmi_out_con: endpoint {
};
};
+&i2s2 {
+ status = "okay";
+};
+
&mdio {
ext_rgmii_phy: ethernet-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
@@ -340,6 +344,10 @@ &sound {
"MIC1", "Onboard Microphone";
};
+&sound_hdmi {
+ status = "okay";
+};
+
&spi0 {
status = "okay";
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
index 3256acec1ff9..1e6c0e2f5dad 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
@@ -107,6 +107,10 @@ &i2c1_pins {
bias-pull-up;
};
+&i2s2 {
+ status = "okay";
+};
+
&mdio {
ext_rmii_phy1: ethernet-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
@@ -281,6 +285,10 @@ &sound {
status = "okay";
};
+&sound_hdmi {
+ status = "okay";
+};
+
/* On Euler connector */
&spdif {
status = "disabled";
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts
index 231e652cab67..6a009b06c5bb 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts
@@ -96,6 +96,10 @@ hdmi_out_con: endpoint {
};
};
+&i2s2 {
+ status = "okay";
+};
+
&mdio {
ext_rgmii_phy: ethernet-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
@@ -180,6 +184,10 @@ &sound {
status = "okay";
};
+&sound_hdmi {
+ status = "okay";
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pb_pins>;
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts
index ec055510af8b..992dc947551d 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts
@@ -150,6 +150,10 @@ anx6345_in: endpoint {
};
};
+&i2s2 {
+ status = "okay";
+};
+
&mixer0 {
status = "okay";
};
@@ -366,6 +370,10 @@ &sound {
status = "okay";
};
+&sound_hdmi {
+ status = "okay";
+};
+
&tcon0 {
pinctrl-names = "default";
pinctrl-0 = <&lcd_rgb666_pins>;
--
2.51.0

View File

@@ -0,0 +1,32 @@
From 6ccacf9c0f118a48731436f46b0632e058e536fc Mon Sep 17 00:00:00 2001
From: Icenowy Zheng <icenowy@aosc.io>
Date: Sun, 30 Jun 2019 22:45:34 +0800
Subject: arm64: dts: allwinner: a64: Fix LRADC compatible
The LRADC reference voltage of A64 is 2.0V, and AVCC is 3.0V. So the
internal voltage divider is 2/3 (the A10 value), not 3/4 (the A83T
value).
Fix the compatible string of the A64 LRADC.
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index d53a6f7e086a..c061387abe41 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -921,7 +921,7 @@ spdif: spdif@1c21000 {
lradc: lradc@1c21800 {
compatible = "allwinner,sun50i-a64-lradc",
- "allwinner,sun8i-a83t-r-lradc";
+ "allwinner,sun4i-a10-lradc-keys";
reg = <0x01c21800 0x400>;
interrupt-parent = <&r_intc>;
interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
--
2.51.0

View File

@@ -0,0 +1,99 @@
From bfbed3e6926704dccb61277ec991afff33b84628 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Tue, 17 Nov 2020 01:06:30 +0100
Subject: arm64: dts: allwinner: a64: pinetab: add front camera
---
.../boot/dts/allwinner/sun50i-a64-pinetab.dts | 50 ++++++++++++++++---
1 file changed, 44 insertions(+), 6 deletions(-)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts
index f5fb1ee32dad..50a0e1916743 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts
@@ -55,12 +55,35 @@ i2c-csi {
#address-cells = <1>;
#size-cells = <0>;
+ /* Front camera */
+ gc2145: front-camera@3c {
+ compatible = "galaxycore,gc2145";
+ reg = <0x3c>;
+ clocks = <&ccu CLK_CSI_MCLK>;
+ clock-names = "xclk";
+
+ AVDD-supply = <&reg_dldo3>;
+ DVDD-supply = <&reg_aldo1>;
+ IOVDD-supply = <&reg_eldo3>;
+ reset-gpios = <&pio 4 16 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; /* PE16 */
+ enable-gpios = <&pio 4 17 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; /* PE17 */
+
+ port {
+ gc2145_ep: endpoint {
+ remote-endpoint = <&csi_gc2145_ep>;
+ bus-width = <8>;
+ hsync-active = <1>;
+ vsync-active = <1>;
+ data-active = <1>;
+ pclk-sample = <1>;
+ };
+ };
+ };
+
/* Rear camera */
- ov5640: camera@3c {
+ ov5640: rear-camera@4c {
compatible = "ovti,ov5640";
- reg = <0x3c>;
- pinctrl-names = "default";
- pinctrl-0 = <&csi_mclk_pin>;
+ reg = <0x4c>;
clocks = <&ccu CLK_CSI_MCLK>;
clock-names = "xclk";
@@ -72,7 +95,7 @@ ov5640: camera@3c {
port {
ov5640_ep: endpoint {
- remote-endpoint = <&csi_ep>;
+ remote-endpoint = <&csi_ov5640_ep>;
bus-width = <8>;
hsync-active = <1>; /* Active high */
vsync-active = <0>; /* Active low */
@@ -131,10 +154,15 @@ &cpu3 {
};
&csi {
+ pinctrl-0 = <&csi_pins>, <&csi_mclk_pin>;
status = "okay";
port {
- csi_ep: endpoint {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ csi_ov5640_ep: endpoint@0 {
+ reg = <0>;
remote-endpoint = <&ov5640_ep>;
bus-width = <8>;
hsync-active = <1>; /* Active high */
@@ -142,6 +170,16 @@ csi_ep: endpoint {
data-active = <1>; /* Active high */
pclk-sample = <1>; /* Rising */
};
+
+ csi_gc2145_ep: endpoint@1 {
+ reg = <1>;
+ remote-endpoint = <&gc2145_ep>;
+ bus-width=<8>;
+ hsync-active = <1>; /* Active high */
+ vsync-active = <1>; /* Active high */
+ data-active = <1>; /* Active high */
+ pclk-sample = <1>; /* Rising */
+ };
};
};
--
2.51.0

View File

@@ -0,0 +1,113 @@
From cf056f9d1d534ffae9793137b755214549cdb572 Mon Sep 17 00:00:00 2001
From: Jernej Skrabec <jernej.skrabec@gmail.com>
Date: Sun, 9 May 2021 12:40:31 +0200
Subject: arm64: dts: allwinner: h5: Enable hdmi sound card on boards with hdmi
Each board that has HDMI connector can also transmit audio through it.
Enable HDMI sound card on all H5 boards with HDMI connector.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
.../dts/allwinner/sun50i-h5-emlid-neutis-n5-devboard.dts | 8 ++++++++
arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts | 8 ++++++++
.../arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts | 8 ++++++++
.../boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts | 8 ++++++++
4 files changed, 32 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-emlid-neutis-n5-devboard.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-emlid-neutis-n5-devboard.dts
index 076a0b983101..5882b62097a9 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-emlid-neutis-n5-devboard.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-emlid-neutis-n5-devboard.dts
@@ -69,3 +69,11 @@ hdmi_out_con: endpoint {
&i2c1 {
status = "okay";
};
+
+&i2s2 {
+ status = "okay";
+};
+
+&sound_hdmi {
+ status = "okay";
+};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts
index 0f29da7d51e6..f420acc6f49f 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts
@@ -145,6 +145,10 @@ hdmi_out_con: endpoint {
};
};
+&i2s2 {
+ status = "okay";
+};
+
&ir {
pinctrl-names = "default";
pinctrl-0 = <&r_ir_rx_pin>;
@@ -191,6 +195,10 @@ reg_vdd_cpux: regulator@65 {
};
};
+&sound_hdmi {
+ status = "okay";
+};
+
&spi0 {
status = "okay";
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts
index d4fc4e60e4e7..42d0ffa4a864 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts
@@ -145,6 +145,10 @@ hdmi_out_con: endpoint {
};
};
+&i2s2 {
+ status = "okay";
+};
+
&ir {
pinctrl-names = "default";
pinctrl-0 = <&r_ir_rx_pin>;
@@ -183,6 +187,10 @@ &ohci3 {
status = "okay";
};
+&sound_hdmi {
+ status = "okay";
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pa_pins>;
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
index 3eb986c354a9..281d37d46d43 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
@@ -77,6 +77,10 @@ hdmi_out_con: endpoint {
};
};
+&i2s2 {
+ status = "okay";
+};
+
&mmc0 {
vmmc-supply = <&reg_vcc3v3>;
disable-wp;
@@ -116,6 +120,10 @@ &ohci0 {
status = "okay";
};
+&sound_hdmi {
+ status = "okay";
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pa_pins>;
--
2.51.0

View File

@@ -0,0 +1,56 @@
From 82458044eed7f24ff5810818c05aaceb87522ddf Mon Sep 17 00:00:00 2001
From: Jernej Skrabec <jernej.skrabec@gmail.com>
Date: Tue, 10 Nov 2020 20:43:28 +0100
Subject: arm64: dts: allwinner: h6: Add hdmi sound card
H6 supports HDMI audio. Add a sound card node for it.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
index 73e8604315c5..ff67281bc090 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
@@ -122,6 +122,20 @@ psci {
method = "smc";
};
+ sound_hdmi: sound_hdmi {
+ compatible = "allwinner,sun9i-a80-hdmi-audio",
+ "allwinner,sun50i-h6-hdmi-audio";
+ status = "disabled";
+
+ codec {
+ sound-dai = <&hdmi>;
+ };
+
+ cpu {
+ sound-dai = <&i2s1>;
+ };
+ };
+
timer {
compatible = "arm,armv8-timer";
arm,no-tick-in-suspend;
@@ -135,6 +149,7 @@ timer {
(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
};
+
soc {
compatible = "simple-bus";
#address-cells = <1>;
@@ -813,6 +828,7 @@ ohci3: usb@5311400 {
};
hdmi: hdmi@6000000 {
+ #sound-dai-cells = <0>;
compatible = "allwinner,sun50i-h6-dw-hdmi";
reg = <0x06000000 0x10000>;
reg-io-width = <1>;
--
2.51.0

View File

@@ -0,0 +1,123 @@
From ff19a25fd2ae104ad9bc5c9bb49cec698552bff2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Tue, 11 Jan 2022 13:08:47 +0100
Subject: arm64: dts: allwinner: h6: Enable hdmi sound card on boards with hdmi
Each board that has HDMI connector can also transmit audio through it.
Enable HDMI sound card on all H6 boards with HDMI connector.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts | 8 ++++++++
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts | 8 ++++++++
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi | 8 ++++++++
arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts | 8 ++++++++
4 files changed, 32 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts
index 2c64d834a2c4..bf1e98ded8f5 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts
@@ -119,6 +119,10 @@ hdmi_out_con: endpoint {
};
};
+&i2s1 {
+ status = "okay";
+};
+
&mdio {
ext_rgmii_phy: ethernet-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
@@ -291,6 +295,10 @@ &r_pio {
vcc-pm-supply = <&reg_aldo1>;
};
+&sound_hdmi {
+ status = "okay";
+};
+
&spdif {
pinctrl-names = "default";
pinctrl-0 = <&spdif_tx_pin>;
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts
index cd1dd0192181..4cc21a55a7c1 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts
@@ -167,6 +167,10 @@ ext_rgmii_phy: ethernet-phy@1 {
};
};
+&i2s1 {
+ status = "okay";
+};
+
&mmc0 {
vmmc-supply = <&reg_cldo1>;
cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
@@ -340,6 +344,10 @@ &rtc {
clocks = <&ext_osc32k>;
};
+&sound_hdmi {
+ status = "okay";
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_ph_pins>;
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi
index e34dbb992021..283ccedf61ad 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi
@@ -91,6 +91,10 @@ hdmi_out_con: endpoint {
};
};
+&i2s1 {
+ status = "okay";
+};
+
&mmc0 {
vmmc-supply = <&reg_cldo1>;
cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
@@ -245,6 +249,10 @@ &rtc {
clocks = <&ext_osc32k>;
};
+&sound_hdmi {
+ status = "okay";
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_ph_pins>;
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
index fa7a765ee828..95aea02bce40 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
@@ -123,6 +123,10 @@ hdmi_out_con: endpoint {
};
};
+&i2s1 {
+ status = "okay";
+};
+
&mdio {
ext_rgmii_phy: ethernet-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
@@ -299,6 +303,10 @@ &rtc {
clocks = <&ext_osc32k>;
};
+&sound_hdmi {
+ status = "okay";
+};
+
/*
* The CS pin is shared with the MMC2 CMD pin, so we cannot have the SPI
* flash and eMMC at the same time, as one of them would fail probing.
--
2.51.0

View File

@@ -0,0 +1,105 @@
From da61763234048d21610acb51d67924cf4aaabcd9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Tue, 20 Aug 2019 14:54:48 +0200
Subject: arm64: dts: allwinner: orange-pi-3: Enable ethernet
Orange Pi 3 has two regulators that power the Realtek RTL8211E
PHY. According to the datasheet, both regulators need to be enabled
at the same time, or that "phy-io" should be enabled slightly earlier
than "phy" regulator.
RTL8211E/RTL8211EG datasheet says:
Note 4: 2.5V (or 1.8/1.5V) RGMII power should be risen simultaneously
or slightly earlier than 3.3V power. Rising 2.5V (or 1.8/1.5V) power
later than 3.3V power may lead to errors.
The driver ensures the regulator enable ordering. The timing is set
in DT via startup-delay-us.
We also need to wait at least 30ms after power-up/reset, before
accessing the PHY registers.
All values of RX/TX delay were tested exhaustively and a middle one
of the range of working values was chosen.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
.../dts/allwinner/sun50i-h6-orangepi-3.dts | 40 +++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts
index dc7381c944c9..cd1dd0192181 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts
@@ -15,6 +15,7 @@ / {
aliases {
serial0 = &uart0;
serial1 = &uart1;
+ ethernet0 = &emac;
};
chosen {
@@ -64,6 +65,15 @@ reg_vcc5v: vcc5v {
regulator-always-on;
};
+ reg_gmac_2v5: gmac-2v5 {
+ compatible = "regulator-fixed";
+ regulator-name = "gmac-2v5";
+ regulator-min-microvolt = <2500000>;
+ regulator-max-microvolt = <2500000>;
+ enable-active-high;
+ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */
+ };
+
reg_vcc33_wifi: vcc33-wifi {
/* Always on 3.3V regulator for WiFi and BT */
compatible = "regulator-fixed";
@@ -128,6 +138,35 @@ hdmi_out_con: endpoint {
};
};
+&emac {
+ pinctrl-names = "default";
+ pinctrl-0 = <&ext_rgmii_pins>;
+ phy-mode = "rgmii-id";
+ phy-handle = <&ext_rgmii_phy>;
+ /*
+ * The board uses 2.5V RGMII signalling. Power sequence to enable
+ * the phy is to enable GMAC-2V5 and GMAC-3V (aldo2) power rails
+ * at the same time and to wait 100ms. The driver enables phy-io
+ * first. Delay is achieved with enable-ramp-delay on reg_aldo2.
+ */
+ phy-supply = <&reg_aldo2>;
+ phy-io-supply = <&reg_gmac_2v5>;
+ allwinner,rx-delay-ps = <200>;
+ allwinner,tx-delay-ps = <200>;
+ status = "okay";
+};
+
+&mdio {
+ ext_rgmii_phy: ethernet-phy@1 {
+ compatible = "ethernet-phy-ieee802.3-c22";
+ reg = <1>;
+
+ reset-gpios = <&pio 3 14 GPIO_ACTIVE_LOW>; /* PD14 */
+ reset-assert-us = <15000>;
+ reset-deassert-us = <40000>;
+ };
+};
+
&mmc0 {
vmmc-supply = <&reg_cldo1>;
cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
@@ -208,6 +247,7 @@ reg_aldo2: aldo2 {
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-name = "vcc33-audio-tv-ephy-mac";
+ regulator-enable-ramp-delay = <100000>;
};
/* ALDO3 is shorted to CLDO1 */
--
2.51.0

View File

@@ -0,0 +1,62 @@
From 7ff04b0bdae864def87539f21ed65134d883be29 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Fri, 22 Nov 2024 23:41:48 +0100
Subject: arm64: dts: rk3399: Add dmc_opp_table
This was removed in v6.12. Re-add it with original values.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm64/boot/dts/rockchip/rk3399.dtsi | 29 ++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
index 6bc1249d99e6..bb9205bebf9f 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
@@ -104,6 +104,31 @@ opp05 {
opp-microvolt = <1100000 1100000 1150000>;
};
};
+
+ dmc_opp_table: opp-table-3 {
+ compatible = "operating-points-v2";
+
+ opp00 {
+ opp-hz = /bits/ 64 <328000000>;
+ opp-microvolt = <900000>;
+ };
+ opp01 {
+ opp-hz = /bits/ 64 <416000000>;
+ opp-microvolt = <900000>;
+ };
+ opp02 {
+ opp-hz = /bits/ 64 <666000000>;
+ opp-microvolt = <900000>;
+ };
+ opp03 {
+ opp-hz = /bits/ 64 <856000000>;
+ opp-microvolt = <900000>;
+ };
+ opp04 {
+ opp-hz = /bits/ 64 <928000000>;
+ opp-microvolt = <925000>;
+ };
+ };
};
&cpu_l0 {
@@ -130,6 +155,10 @@ &cpu_b1 {
operating-points-v2 = <&cluster1_opp>;
};
+&dmc {
+ operating-points-v2 = <&dmc_opp_table>;
+};
+
&gpu {
operating-points-v2 = <&gpu_opp_table>;
};
--
2.51.0

View File

@@ -0,0 +1,62 @@
From e95ac8b6eaba41268ad0082de8b96b7a8ed5fb63 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Thu, 28 Nov 2024 11:16:31 +0100
Subject: arm64: dts: rockchip: rk3399-s: Add DMC table
This is used by Pinephone Pro.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm64/boot/dts/rockchip/rk3399-s.dtsi | 29 ++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-s.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-s.dtsi
index e54f451af9f3..82b941720294 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-s.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-s.dtsi
@@ -92,6 +92,31 @@ opp05 {
opp-microvolt = <1100000 1100000 1150000>;
};
};
+
+ dmc_opp_table: opp-table-3 {
+ compatible = "operating-points-v2";
+
+ opp00 {
+ opp-hz = /bits/ 64 <328000000>;
+ opp-microvolt = <900000>;
+ };
+ opp01 {
+ opp-hz = /bits/ 64 <416000000>;
+ opp-microvolt = <900000>;
+ };
+ opp02 {
+ opp-hz = /bits/ 64 <666000000>;
+ opp-microvolt = <900000>;
+ };
+ opp03 {
+ opp-hz = /bits/ 64 <856000000>;
+ opp-microvolt = <900000>;
+ };
+ opp04 {
+ opp-hz = /bits/ 64 <928000000>;
+ opp-microvolt = <925000>;
+ };
+ };
};
&cpu_l0 {
@@ -118,6 +143,10 @@ &cpu_b1 {
operating-points-v2 = <&cluster1_opp>;
};
+&dmc {
+ operating-points-v2 = <&dmc_opp_table>;
+};
+
&gpu {
operating-points-v2 = <&gpu_opp_table>;
};
--
2.51.0

View File

@@ -0,0 +1,47 @@
From fb9e2ab89fa45ece10369840291cb8ac2813c5d9 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Sat, 24 Sep 2022 21:59:07 +0200
Subject: arm64: dts: rockchip: rk356x: Fix PCIe register map and ranges
I have two Realtek PCIe wifi cards connected over the 4 port PCIe bridge
to Quartz64-A. The cards fail to work, when nvme SSD is connected at the
same time to the bridge. Without nvme connected, cards work fine. The
issue seems to be related to mixed use of devices which make use of I/O
ranges and memory ranges.
This patch changes I/O, MEM and config mappings so that config and I/O
mappings use the 0xf4000000 outbound address space, and MEM range uses
the whole 0x300000000 outbound space.
These values were suggested by pgwipeout:
https://lore.kernel.org/lkml/875ygbsrf3.fsf@bloch.sibelius.xs4all.nl/T/#m84b5f6992cc26dffe0d3783c0d8c9c86e5e10c10
This is identical to how BSP does the mappings.
This change to the regs/ranges makes the issue go away and both nvme and
wifi cards work when connected at the same time to the bridge. I tested
the nvme with large amount of reads/writes, both behind the PCIe bridge
and when directly connected to Quartz64-A board.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm64/boot/dts/rockchip/rk356x-base.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi b/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi
index fd2214b6fad4..53d7bd65f9e6 100644
--- a/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi
@@ -966,7 +966,7 @@ pcie2x1: pcie@fe260000 {
<0 0 0 4 &pcie_intc 3>;
linux,pci-domain = <0>;
num-ib-windows = <6>;
- num-ob-windows = <2>;
+ num-ob-windows = <8>;
max-link-speed = <2>;
msi-map = <0x0 &its 0x0 0x1000>;
num-lanes = <1>;
--
2.51.0

View File

@@ -0,0 +1,30 @@
From a5b7326c857524e90c52998545ba7f6fb572bca0 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Tue, 14 May 2024 10:47:05 +0200
Subject: arm64: dts: sun50-a64-pinephone: Define jack pins in DT
To restore pre v6.8 behavior of the sound card.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index f0f1367c5868..d502c1392b8e 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -999,6 +999,10 @@ &sound {
"MIC1", "Internal Microphone",
"Headset Microphone", "HBIAS",
"MIC2", "Headset Microphone";
+ simple-audio-card,jack-pins =
+ "1c22e00.codec", "Headphone Jack",
+ "1c22e00.codec", "Headset Microphone";
+ simple-audio-card,jack-pins-mask = <1>, <2>;
simple-audio-card,dai-link@1 {
format = "dsp_a";
--
2.51.0

View File

@@ -0,0 +1,31 @@
From 9159b591ce223a9b432e31410c522d653f5b059d Mon Sep 17 00:00:00 2001
From: Arnav Singh <me@arnavion.dev>
Date: Mon, 6 May 2024 16:36:04 -0700
Subject: arm64: dts: sun50i: Define orientation and rotation for PinePhone
rear camera
This enables libcamera to detect the correct orientation from
the device tree and propagate it further to e.g. Pipewire.
Signed-off-by: Arnav Singh <me@arnavion.dev>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index e7e90e5baff4..1a57720c25ef 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -617,6 +617,9 @@ ov5640: rear-camera@4c {
reset-gpios = <&pio 3 3 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; /* PD3 */
powerdown-gpios = <&pio 2 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; /* PC0 */
+ orientation = <1>;
+ rotation = <270>;
+
port {
ov5640_ep: endpoint {
remote-endpoint = <&csi_ov5640_ep>;
--
2.51.0

View File

@@ -0,0 +1,59 @@
From 538b7bed8233cd18367cd34fb607d8a967aff845 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Sat, 1 Feb 2020 23:41:18 +0100
Subject: arm64: dts: sun50i-a64: Set fifo-size for uarts
Boot time optimization.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index 9a43bcc2f489..d53a6f7e086a 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -1012,6 +1012,7 @@ uart0: serial@1c28000 {
interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>;
reg-io-width = <4>;
+ fifo-size = <64>;
clocks = <&ccu CLK_BUS_UART0>;
resets = <&ccu RST_BUS_UART0>;
status = "disabled";
@@ -1023,6 +1024,7 @@ uart1: serial@1c28400 {
interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>;
reg-io-width = <4>;
+ fifo-size = <64>;
clocks = <&ccu CLK_BUS_UART1>;
resets = <&ccu RST_BUS_UART1>;
status = "disabled";
@@ -1034,6 +1036,7 @@ uart2: serial@1c28800 {
interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>;
reg-io-width = <4>;
+ fifo-size = <64>;
clocks = <&ccu CLK_BUS_UART2>;
resets = <&ccu RST_BUS_UART2>;
status = "disabled";
@@ -1045,6 +1048,7 @@ uart3: serial@1c28c00 {
interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>;
reg-io-width = <4>;
+ fifo-size = <64>;
clocks = <&ccu CLK_BUS_UART3>;
resets = <&ccu RST_BUS_UART3>;
status = "disabled";
@@ -1056,6 +1060,7 @@ uart4: serial@1c29000 {
interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>;
reg-io-width = <4>;
+ fifo-size = <64>;
clocks = <&ccu CLK_BUS_UART4>;
resets = <&ccu RST_BUS_UART4>;
status = "disabled";
--
2.51.0

View File

@@ -0,0 +1,416 @@
From 82c1ef311dfa48e730d927ae71322bfee0430545 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Wed, 8 Jul 2020 00:58:16 +0200
Subject: arm64: dts: sun50i-a64-pinephone: Add Type-C support for all PP
variants 1.0-1.2
There are differences in GPIO and how VBUS is handled. Describe them
in DTS. Thankfully we can support both unmodded and modded variants
of 1.0 and 1.1 boards with one DTS. No need for more subvariants.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
.../allwinner/sun50i-a64-pinephone-1.0.dts | 86 +++++++++++++++++++
.../allwinner/sun50i-a64-pinephone-1.1.dts | 86 +++++++++++++++++++
.../allwinner/sun50i-a64-pinephone-1.2.dts | 60 +++++++++++++
.../dts/allwinner/sun50i-a64-pinephone.dtsi | 68 ++++++++++++++-
4 files changed, 299 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts
index 219f720b8b7d..498ae493d176 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts
@@ -8,6 +8,92 @@
/ {
model = "Pine64 PinePhone Developer Batch (1.0)";
compatible = "pine64,pinephone-1.0", "pine64,pinephone", "allwinner,sun50i-a64";
+
+ reg_vbus: usb0-vbus {
+ compatible = "regulator-fixed";
+ regulator-name = "usb0-vbus";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */
+ enable-active-high;
+ vin-supply = <&reg_drivevbus>;
+ };
+};
+
+&axp803 {
+ x-powers,drive-vbus-en;
+};
+
+&i2c0 {
+ hdmi-bridge@28 {
+ compatible = "analogix,anx7688";
+ reg = <0x28>;
+
+ interrupt-parent = <&r_pio>;
+ interrupts = <0 11 IRQ_TYPE_EDGE_FALLING>; /* PL11 */
+
+ enable-gpios = <&pio 3 10 GPIO_ACTIVE_LOW>; /* PD10 */
+ reset-gpios = <&r_pio 0 9 GPIO_ACTIVE_HIGH>; /* PL9 */
+
+ cabledet-gpios = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */
+
+ avdd10-supply = <&reg_anx1v0>;
+ dvdd10-supply = <&reg_anx1v0>;
+ /* This is for the HW hack variant, but will also work for non-modified version. */
+ avdd18-supply = <&reg_ldo_io1>;
+ dvdd18-supply = <&reg_ldo_io1>;
+ avdd33-supply = <&reg_dldo1>;
+ vconn-supply = <&reg_vconn5v0>;
+ hdmi_vt-supply = <&reg_dldo1>;
+
+ source-caps = <
+ PDO_FIXED(5000, 500, PDO_FIXED_DATA_SWAP | PDO_FIXED_USB_COMM | PDO_FIXED_DUAL_ROLE)
+ >;
+
+ sink-caps = <
+ PDO_FIXED(5000, 3000, PDO_FIXED_DATA_SWAP | PDO_FIXED_USB_COMM | PDO_FIXED_DUAL_ROLE)
+ >;
+
+ /*
+ * ANX7688 can't enable/disable USB-5V <-> DCIN switch by
+ * itself, and PMIC's N_VBUSEN is not connected anywhere either,
+ * so we need to configure everything in software:
+ *
+ * - get the VBUS status from ANX7688 via I2C
+ * - configure PMIC to let it know vbus drive status (via
+ * reg_drivevbus)
+ * - enable VBUS switch and USB-5V regulator (via reg_vbus
+ * and reg_usb_5v)
+ */
+ vbus-supply = <&reg_vbus>;
+ vbus_in-supply = <&usb_power_supply>;
+
+ port {
+ typec0_dr_sw: endpoint {
+ remote-endpoint = <&usb0_drd_sw>;
+ };
+ };
+ };
+};
+
+/*
+ * The N_VBUSEN pin is disconnected, but we need to inform the PMIC about
+ * the VBUS status anyway. To avoid the pin from floating and to inform
+ * the PMIC, about VBUS status, we couple reg_drivevbus with reg_vbus.
+ */
+&reg_drivevbus {
+ vin-supply = <&reg_usb_5v>;
+ status = "okay";
+};
+
+&usbphy {
+ usb-role-switch;
+
+ port {
+ usb0_drd_sw: endpoint {
+ remote-endpoint = <&typec0_dr_sw>;
+ };
+ };
};
&codec_analog {
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
index 723af64a9cee..73275308f484 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
@@ -8,6 +8,20 @@
/ {
model = "Pine64 PinePhone Braveheart (1.1)";
compatible = "pine64,pinephone-1.1", "pine64,pinephone", "allwinner,sun50i-a64";
+
+ reg_vbus: usb0-vbus {
+ compatible = "regulator-fixed";
+ regulator-name = "usb0-vbus";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */
+ enable-active-high;
+ vin-supply = <&reg_drivevbus>;
+ };
+};
+
+&axp803 {
+ x-powers,drive-vbus-en;
};
&backlight {
@@ -33,7 +47,79 @@ &codec_analog {
allwinner,internal-bias-resistor;
};
+&i2c0 {
+ hdmi-bridge@28 {
+ compatible = "analogix,anx7688";
+ reg = <0x28>;
+
+ interrupt-parent = <&r_pio>;
+ interrupts = <0 11 IRQ_TYPE_EDGE_FALLING>; /* PL11 */
+
+ enable-gpios = <&pio 3 10 GPIO_ACTIVE_LOW>; /* PD10 */
+ reset-gpios = <&r_pio 0 9 GPIO_ACTIVE_HIGH>; /* PL9 */
+
+ cabledet-gpios = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */
+
+ avdd10-supply = <&reg_anx1v0>;
+ dvdd10-supply = <&reg_anx1v0>;
+ /* This is for the HW hack variant, but will also work for non-modified version. */
+ avdd18-supply = <&reg_ldo_io1>;
+ dvdd18-supply = <&reg_ldo_io1>;
+ avdd33-supply = <&reg_dldo1>;
+ vconn-supply = <&reg_vconn5v0>;
+ hdmi_vt-supply = <&reg_dldo1>;
+
+ source-caps = <
+ PDO_FIXED(5000, 500, PDO_FIXED_DATA_SWAP | PDO_FIXED_USB_COMM | PDO_FIXED_DUAL_ROLE)
+ >;
+
+ sink-caps = <
+ PDO_FIXED(5000, 3000, PDO_FIXED_DATA_SWAP | PDO_FIXED_USB_COMM | PDO_FIXED_DUAL_ROLE)
+ >;
+
+ /*
+ * ANX7688 can't enable/disable USB-5V <-> DCIN switch by
+ * itself, and PMIC's N_VBUSEN is not connected anywhere either,
+ * so we need to configure everything in software:
+ *
+ * - get the VBUS status from ANX7688 via I2C
+ * - configure PMIC to let it know vbus drive status (via
+ * reg_drivevbus)
+ * - enable VBUS switch and USB-5V regulator (via reg_vbus
+ * and reg_usb_5v)
+ */
+ vbus-supply = <&reg_vbus>;
+ vbus_in-supply = <&usb_power_supply>;
+
+ port {
+ typec0_dr_sw: endpoint {
+ remote-endpoint = <&usb0_drd_sw>;
+ };
+ };
+ };
+};
+
+/*
+ * The N_VBUSEN pin is disconnected, but we need to inform the PMIC about
+ * the VBUS status anyway. To avoid the pin from floating and to inform
+ * the PMIC, about VBUS status, we couple reg_drivevbus with reg_vbus.
+ */
+&reg_drivevbus {
+ vin-supply = <&reg_usb_5v>;
+ status = "okay";
+};
+
&sgm3140 {
enable-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */
flash-gpios = <&pio 2 3 GPIO_ACTIVE_HIGH>; /* PC3 */
};
+
+&usbphy {
+ usb-role-switch;
+
+ port {
+ usb0_drd_sw: endpoint {
+ remote-endpoint = <&typec0_dr_sw>;
+ };
+ };
+};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
index 4e7e237cb46a..40127186606f 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
@@ -48,7 +48,67 @@ &mmc1 {
mmc-pwrseq = <&wifi_pwrseq>;
};
+&i2c0 {
+ hdmi-bridge@28 {
+ compatible = "analogix,anx7688";
+ reg = <0x28>;
+
+ interrupt-parent = <&r_pio>;
+ interrupts = <0 11 IRQ_TYPE_EDGE_FALLING>; /* PL11 */
+
+ enable-gpios = <&pio 3 10 GPIO_ACTIVE_LOW>; /* PD10 */
+ reset-gpios = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */
+
+ cabledet-gpios = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */
+
+ avdd10-supply = <&reg_anx1v0>;
+ dvdd10-supply = <&reg_anx1v0>;
+ avdd18-supply = <&reg_ldo_io1>;
+ dvdd18-supply = <&reg_ldo_io1>;
+ avdd33-supply = <&reg_dcdc1>;
+ vconn-supply = <&reg_vconn5v0>;
+ hdmi_vt-supply = <&reg_dldo1>;
+
+ source-caps = <
+ PDO_FIXED(5000, 500, PDO_FIXED_DATA_SWAP | PDO_FIXED_USB_COMM | PDO_FIXED_DUAL_ROLE)
+ >;
+
+ sink-caps = <
+ PDO_FIXED(5000, 3000, PDO_FIXED_DATA_SWAP | PDO_FIXED_USB_COMM | PDO_FIXED_DUAL_ROLE)
+ >;
+
+ /*
+ * ANX7688 will enable/disable USB-5V <-> DCIN switch by itself
+ * via VBUS_CTRL pin. The driver just has to enable the USB-5V
+ * so that the switch has power.
+ */
+ vbus-supply = <&reg_usb_5v>;
+ vbus_in-supply = <&usb_power_supply>;
+
+ port {
+ typec0_dr_sw: endpoint {
+ remote-endpoint = <&usb0_drd_sw>;
+ };
+ };
+ };
+};
+
+&reg_anx1v0 {
+ gpio = <&pio 3 11 GPIO_ACTIVE_HIGH>; /* PD11 */
+ enable-active-high;
+};
+
&sgm3140 {
enable-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */
flash-gpios = <&pio 2 3 GPIO_ACTIVE_HIGH>; /* PC3 */
};
+
+&usbphy {
+ usb-role-switch;
+
+ port {
+ usb0_drd_sw: endpoint {
+ remote-endpoint = <&typec0_dr_sw>;
+ };
+ };
+};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index 5d55c6f82352..e8f6c016e1b3 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -10,6 +10,7 @@
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/pwm/pwm.h>
+#include <dt-bindings/usb/pd.h>
/ {
chassis-type = "handset";
@@ -70,6 +71,24 @@ led2: led-2 {
};
};
+ hdmi-connector {
+ compatible = "hdmi-connector";
+ type = "a";
+
+ port {
+ hdmi_con_in: endpoint {
+ remote-endpoint = <&hdmi_out_con>;
+ };
+ };
+ };
+
+ reg_anx1v0: anx1v0 {
+ compatible = "regulator-fixed";
+ regulator-name = "anx1v0";
+ regulator-min-microvolt = <1000000>;
+ regulator-max-microvolt = <1000000>;
+ };
+
multi-led {
compatible = "leds-group-multicolor";
color = <LED_COLOR_ID_RGB>;
@@ -85,6 +104,24 @@ reg_ps: ps-regulator {
regulator-boot-on;
};
+ reg_usb_5v: usb-5v {
+ compatible = "regulator-fixed";
+ regulator-name = "usb-5v";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ gpio = <&pio 3 8 GPIO_ACTIVE_HIGH>; /* PD8 */
+ enable-active-high;
+ };
+
+ reg_vbat_bb: vbat-bb {
+ compatible = "regulator-fixed";
+ regulator-name = "vbat-bb";
+ regulator-min-microvolt = <3500000>;
+ regulator-max-microvolt = <3500000>;
+ gpio = <&r_pio 0 7 GPIO_ACTIVE_HIGH>; /* PL7 */
+ enable-active-high;
+ };
+
reg_vbat_wifi: vbat-wifi {
compatible = "regulator-fixed";
regulator-min-microvolt = <3300000>;
@@ -92,6 +129,16 @@ reg_vbat_wifi: vbat-wifi {
regulator-name = "vbat-wifi";
};
+ /* This is a charge pump for CC1 and CC2 pins on USB-C connector. */
+ reg_vconn5v0: vconn5v0 {
+ compatible = "regulator-fixed";
+ regulator-name = "vconn5v0";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ gpio = <&pio 3 9 GPIO_ACTIVE_HIGH>; /* PD9 */
+ enable-active-high;
+ };
+
sgm3140: led-controller {
compatible = "sgmicro,sgm3140";
vin-supply = <&reg_dcdc1>;
@@ -207,6 +254,21 @@ &ehci1 {
status = "okay";
};
+&hdmi {
+ hvcc-supply = <&reg_dldo1>;
+ status = "okay";
+};
+
+&hdmi_out {
+ hdmi_out_con: endpoint {
+ remote-endpoint = <&hdmi_con_in>;
+ };
+};
+
+&sound_hdmi {
+ status = "okay";
+};
+
&i2c_csi {
gc2145: front-camera@3c {
compatible = "galaxycore,gc2145";
@@ -330,6 +392,10 @@ &i2c2 {
status = "okay";
};
+&i2s2 {
+ status = "okay";
+};
+
&lradc {
vref-supply = <&reg_aldo3>;
wakeup-source;
@@ -623,7 +689,7 @@ &uart3 {
};
&usb_otg {
- dr_mode = "peripheral";
+ dr_mode = "otg";
status = "okay";
};
--
2.51.0

View File

@@ -0,0 +1,187 @@
From 15ef8921384b272e193a44812ec8f84eb982ce2a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Mon, 28 Sep 2020 04:35:13 +0200
Subject: arm64: dts: sun50i-a64-pinephone: Add detailed OCV to capactiy
conversion table
This ensures that discharging stops at 3V, and that charging current
limits are enforced. It also allows for more precise capacity reporting
(on my device at the very least, at room temperature).
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
.../dts/allwinner/sun50i-a64-pinephone.dtsi | 151 ++++++++++++++++++
1 file changed, 151 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index e8f6c016e1b3..13213a3704a1 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -28,6 +28,156 @@ backlight: backlight {
/* Backlight configuration differs per PinePhone revision. */
};
+ bat: battery {
+ compatible = "simple-battery";
+ voltage-min-design-microvolt = <3000000>;
+ voltage-max-design-microvolt = <4350000>;
+ energy-full-design-microwatt-hours = <12000000>;
+ charge-full-design-microamp-hours = <2750000>;
+ precharge-current-microamp = <130000>;
+ charge-term-current-microamp = <50000>;
+ constant-charge-current-max-microamp = <1300000>;
+ constant-charge-voltage-max-microvolt = <4350000>;
+ factory-internal-resistance-micro-ohms = <150000>;
+ resistance-temp-table = <20 150>;
+ ocv-capacity-celsius = <20>;
+ ocv-capacity-table-0 =
+ <4334000 100>,
+ <4319700 99>,
+ <4304300 98>,
+ <4292200 97>,
+ <4280100 96>,
+ <4269100 95>,
+ <4253700 94>,
+ <4242700 93>,
+ <4232800 92>,
+ <4222900 91>,
+ <4211900 90>,
+ <4203100 89>,
+ <4192100 88>,
+ <4177800 87>,
+ <4167900 86>,
+ <4155800 85>,
+ <4147000 84>,
+ <4136000 83>,
+ <4126100 82>,
+ <4111800 81>,
+ <4102999 80>,
+ <4093100 79>,
+ <4084300 78>,
+ <4075500 77>,
+ <4064500 76>,
+ <4054600 75>,
+ <4042500 74>,
+ <4035900 73>,
+ <4029300 72>,
+ <4018300 71>,
+ <4006200 70>,
+ <3993000 69>,
+ <3974300 68>,
+ <3964400 67>,
+ <3956700 66>,
+ <3949000 65>,
+ <3943500 64>,
+ <3938000 63>,
+ <3931400 62>,
+ <3923700 61>,
+ <3917100 60>,
+ <3903900 59>,
+ <3895100 58>,
+ <3887400 57>,
+ <3878600 56>,
+ <3870900 55>,
+ <3863200 54>,
+ <3855500 53>,
+ <3848900 52>,
+ <3837900 51>,
+ <3830200 50>,
+ <3825800 49>,
+ <3821400 48>,
+ <3815900 47>,
+ <3810400 46>,
+ <3806000 45>,
+ <3801600 44>,
+ <3797200 43>,
+ <3792800 42>,
+ <3789500 41>,
+ <3786200 40>,
+ <3781800 39>,
+ <3778500 38>,
+ <3775200 37>,
+ <3770800 36>,
+ <3764200 35>,
+ <3760900 34>,
+ <3758700 33>,
+ <3755400 32>,
+ <3754300 31>,
+ <3752100 30>,
+ <3748800 29>,
+ <3749900 28>,
+ <3745500 27>,
+ <3742200 26>,
+ <3741100 25>,
+ <3737800 24>,
+ <3734500 23>,
+ <3731200 22>,
+ <3730100 21>,
+ <3724600 20>,
+ <3722400 19>,
+ <3718000 18>,
+ <3713600 17>,
+ <3708100 16>,
+ <3701500 15>,
+ <3689400 14>,
+ <3682800 13>,
+ <3674000 12>,
+ <3666300 11>,
+ <3659700 10>,
+ <3653100 9>,
+ <3647600 8>,
+ <3641000 7>,
+ <3625600 6>,
+ <3613500 5>,
+ <3591500 4>,
+ <3554100 3>,
+ <3489200 2>,
+ <3393500 1>,
+ <3256000 0>;
+ x-powers,ocv-capacity-table =
+ <0xc0 0>,
+ <0xc1 1>,
+ <0xc2 1>,
+ <0xc3 2>,
+ <0xc4 2>,
+ <0xc5 4>,
+ <0xc6 4>,
+ <0xc7 5>,
+ <0xc8 6>,
+ <0xc9 8>,
+ <0xca 11>,
+ <0xcb 15>,
+ <0xcc 22>,
+ <0xcd 36>,
+ <0xce 44>,
+ <0xcf 48>,
+ <0xd0 51>,
+ <0xd1 53>,
+ <0xd2 56>,
+ <0xd3 60>,
+ <0xd4 64>,
+ <0xd5 69>,
+ <0xd6 71>,
+ <0xd7 75>,
+ <0xd8 78>,
+ <0xd9 82>,
+ <0xda 84>,
+ <0xdb 85>,
+ <0xdc 88>,
+ <0xdd 92>,
+ <0xde 95>,
+ <0xdf 98>;
+ };
+
bt_sco_codec: bt-sco-codec {
#sound-dai-cells = <1>;
compatible = "linux,bt-sco";
@@ -499,6 +649,7 @@ axp803: pmic@3a3 {
&battery_power_supply {
status = "okay";
+ monitored-battery = <&bat>;
};
&reg_aldo1 {
--
2.51.0

View File

@@ -0,0 +1,130 @@
From a9b433c7c17a1a0e308fe3364a79f54ab640569c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Wed, 8 Apr 2020 14:13:08 +0200
Subject: arm64: dts: sun50i-a64-pinephone: Add front/back cameras
Pinephone has OV5640 back camera and GC2145 front camera. Add support
for both.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
.../dts/allwinner/sun50i-a64-pinephone.dtsi | 89 +++++++++++++++++++
1 file changed, 89 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index 4bc6c1ef2cde..5d55c6f82352 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -36,6 +36,15 @@ chosen {
stdout-path = "serial0:115200n8";
};
+ i2c_csi: i2c-csi {
+ compatible = "i2c-gpio";
+ sda-gpios = <&pio 4 13 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; /* PE13 */
+ scl-gpios = <&pio 4 12 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; /* PE12 */
+ i2c-gpio,delay-us = <3>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+
leds {
compatible = "gpio-leds";
@@ -134,6 +143,36 @@ &cpu3 {
cpu-supply = <&reg_dcdc2>;
};
+&csi {
+ pinctrl-0 = <&csi_pins>, <&csi_mclk_pin>;
+ status = "okay";
+
+ port {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ csi_ov5640_ep: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&ov5640_ep>;
+ bus-width = <8>;
+ hsync-active = <1>; /* Active high */
+ vsync-active = <0>; /* Active low */
+ data-active = <1>; /* Active high */
+ pclk-sample = <1>; /* Rising */
+ };
+
+ csi_gc2145_ep: endpoint@1 {
+ reg = <1>;
+ remote-endpoint = <&gc2145_ep>;
+ bus-width = <8>;
+ hsync-active = <1>;
+ vsync-active = <1>;
+ data-active = <1>;
+ pclk-sample = <1>;
+ };
+ };
+};
+
&dai {
status = "okay";
};
@@ -168,6 +207,56 @@ &ehci1 {
status = "okay";
};
+&i2c_csi {
+ gc2145: front-camera@3c {
+ compatible = "galaxycore,gc2145";
+ reg = <0x3c>;
+ clocks = <&ccu CLK_CSI_MCLK>;
+ clock-names = "xclk";
+
+ AVDD-supply = <&reg_dldo3>;
+ DVDD-supply = <&reg_aldo1>;
+ IOVDD-supply = <&reg_eldo3>;
+ reset-gpios = <&pio 4 16 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; /* PE16 */
+ enable-gpios = <&pio 4 17 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; /* PE17 */
+
+ port {
+ gc2145_ep: endpoint {
+ remote-endpoint = <&csi_gc2145_ep>;
+ bus-width = <8>;
+ hsync-active = <1>;
+ vsync-active = <1>;
+ data-active = <1>;
+ pclk-sample = <1>;
+ };
+ };
+ };
+
+ ov5640: rear-camera@4c {
+ compatible = "ovti,ov5640";
+ reg = <0x4c>;
+ clocks = <&ccu CLK_CSI_MCLK>;
+ clock-names = "xclk";
+
+ AVDD-supply = <&reg_dldo3>;
+ DOVDD-supply = <&reg_aldo1>; /* shared with AFVCC */
+ DVDD-supply = <&reg_eldo3>;
+ reset-gpios = <&pio 3 3 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; /* PD3 */
+ powerdown-gpios = <&pio 2 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; /* PC0 */
+
+ port {
+ ov5640_ep: endpoint {
+ remote-endpoint = <&csi_ov5640_ep>;
+ bus-width = <8>;
+ hsync-active = <1>; /* Active high */
+ vsync-active = <0>; /* Active low */
+ data-active = <1>; /* Active high */
+ pclk-sample = <1>; /* Rising */
+ };
+ };
+ };
+};
+
&i2c0 {
status = "okay";
--
2.51.0

View File

@@ -0,0 +1,26 @@
From e0c585577e066959d3749845aefc89c44b857165 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Sun, 17 Jan 2021 23:06:03 +0100
Subject: arm64: dts: sun50i-a64-pinephone: Add interrupt pin for WiFi
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index c2746a21b021..3885a1fd3916 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -599,6 +599,8 @@ &mmc1 {
rtl8723cs: wifi@1 {
reg = <1>;
+ interrupt-parent = <&r_pio>;
+ interrupts = <0 3 IRQ_TYPE_EDGE_FALLING>; /* PL3 */
};
};
--
2.51.0

View File

@@ -0,0 +1,119 @@
From a02549f60d913332f50fad6f2c5907169633ab5d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Wed, 8 Jul 2020 01:00:48 +0200
Subject: arm64: dts: sun50i-a64-pinephone: Add modem power manager
Pinephone has a EG25-G modem that needs a special powerup/powerdown
sequence. Add a power manager to manage the modem power.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
.../allwinner/sun50i-a64-pinephone-1.0.dts | 22 ++++++++++++++++++
.../allwinner/sun50i-a64-pinephone-1.1.dts | 23 +++++++++++++++++++
.../allwinner/sun50i-a64-pinephone-1.2.dts | 23 +++++++++++++++++++
3 files changed, 68 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts
index 498ae493d176..ff01e2be26e7 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts
@@ -86,6 +86,28 @@ &reg_drivevbus {
status = "okay";
};
+&uart3 {
+ modem {
+ compatible = "quectel,eg25";
+ char-device-name = "modem-power";
+
+ power-supply = <&reg_vbat_bb>; /* PL7 */
+
+ enable-gpios = <&pio 7 8 GPIO_ACTIVE_LOW>; /* PH8 */
+ reset-gpios = <&pio 2 4 GPIO_ACTIVE_HIGH>; /* PC4 */
+ pwrkey-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
+
+ sleep-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
+ wakeup-gpios = <&pio 1 2 GPIO_ACTIVE_HIGH>; /* PB2-RI */
+
+ cts-gpios = <&pio 3 5 GPIO_ACTIVE_HIGH>; /* PD5-CTS */
+ dtr-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6-DTR */
+ rts-gpios = <&pio 3 4 GPIO_ACTIVE_HIGH>; /* PD4-RTS */
+
+ quectel,qdai = "1,1,0,1,0,0,1,1";
+ };
+};
+
&usbphy {
usb-role-switch;
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
index 73275308f484..93dc8512fe45 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
@@ -114,6 +114,29 @@ &sgm3140 {
flash-gpios = <&pio 2 3 GPIO_ACTIVE_HIGH>; /* PC3 */
};
+&uart3 {
+ modem {
+ compatible = "quectel,eg25";
+ char-device-name = "modem-power";
+
+ power-supply = <&reg_vbat_bb>; /* PL7 */
+
+ enable-gpios = <&pio 7 8 GPIO_ACTIVE_LOW>; /* PH8 */
+ reset-gpios = <&pio 2 4 GPIO_ACTIVE_HIGH>; /* PC4 */
+ status-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
+ status-pwrkey-multiplexed; /* status acts as pwrkey */
+
+ sleep-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
+ wakeup-gpios = <&pio 1 2 GPIO_ACTIVE_HIGH>; /* PB2-RI */
+
+ dtr-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6-DTR */
+ cts-gpios = <&pio 3 5 GPIO_ACTIVE_HIGH>; /* PD5-CTS */
+ rts-gpios = <&pio 3 4 GPIO_ACTIVE_HIGH>; /* PD4-RTS */
+
+ quectel,qdai = "1,1,0,1,0,0,1,1";
+ };
+};
+
&usbphy {
usb-role-switch;
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
index 40127186606f..5e988230e6e4 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
@@ -103,6 +103,29 @@ &sgm3140 {
flash-gpios = <&pio 2 3 GPIO_ACTIVE_HIGH>; /* PC3 */
};
+&uart3 {
+ modem {
+ compatible = "quectel,eg25";
+ char-device-name = "modem-power";
+
+ power-supply = <&reg_vbat_bb>; /* PL7 */
+
+ enable-gpios = <&pio 7 8 GPIO_ACTIVE_LOW>; /* PH8 */
+ reset-gpios = <&pio 2 4 GPIO_ACTIVE_HIGH>; /* PC4 */
+ status-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */
+ pwrkey-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
+
+ host-ready-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
+ wakeup-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6-RI */
+
+ dtr-gpios = <&pio 1 2 GPIO_ACTIVE_HIGH>; /* PB2-DTR */
+ cts-gpios = <&pio 3 5 GPIO_ACTIVE_HIGH>; /* PD5-CTS */
+ rts-gpios = <&pio 3 4 GPIO_ACTIVE_HIGH>; /* PD4-RTS */
+
+ quectel,qdai = "1,1,0,1,0,0,1,1";
+ };
+};
+
&usbphy {
usb-role-switch;
--
2.51.0

View File

@@ -0,0 +1,27 @@
From 4b1c8532a7fbfc7e2b3e42fa41ccd45b31bfd8e3 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Sat, 20 May 2023 16:58:11 +0200
Subject: arm64: dts: sun50i-a64-pinephone: Add power supply to stk3311
This makes the driver disable the supply during sleep.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index 7de884adadb1..7d02c43cef05 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -656,6 +656,7 @@ light-sensor@48 {
reg = <0x48>;
interrupt-parent = <&pio>;
interrupts = <1 0 IRQ_TYPE_EDGE_FALLING>; /* PB0 */
+ vdd-supply = <&reg_ldo_io0>;
};
/* Accelerometer/gyroscope */
--
2.51.0

View File

@@ -0,0 +1,80 @@
From 308f56b99b313484b257e4d574b45f305d20c29c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Mon, 15 Feb 2021 17:45:13 +0100
Subject: arm64: dts: sun50i-a64-pinephone: Add reboot mode driver
With the latest p-boot (released 2021-02-15), you can reboot to
a particular boot option or to the menu, to FEL, to eMMC bootloader,
regardless of the user defined p-boot defaults.
Call reboot with cmd of LINUX_REBOOT_CMD_RESTART2 and arg:
- fel Reboot to FEL
- emmc-egon Reboot with chainload of bootloader from eMMC
- sd1-8 Reboot to SD bootfs option
- emmc1-8 Reboot to eMMC bootfs option
- menu Reboot to p-boot menu
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
.../dts/allwinner/sun50i-a64-pinephone.dtsi | 37 +++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index 7d02c43cef05..aeb282eba4b5 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -423,6 +423,34 @@ sgm3140_flash: led {
};
};
+ /* PinePhone specific reboot modes for p-boot. */
+ reboot-mode {
+ compatible = "nvmem-reboot-mode";
+ nvmem-cells = <&reboot_mode>;
+ nvmem-cell-names = "reboot-mode";
+
+ mode-normal = <0x0>;
+ mode-fel = <0xb0010fe1>;
+ mode-emmc-egon = <0xb001e33c>;
+ mode-sd1 = <0xb0010020>;
+ mode-sd2 = <0xb0010021>;
+ mode-sd3 = <0xb0010022>;
+ mode-sd4 = <0xb0010023>;
+ mode-sd5 = <0xb0010024>;
+ mode-sd6 = <0xb0010025>;
+ mode-sd7 = <0xb0010026>;
+ mode-sd8 = <0xb0010027>;
+ mode-emmc1 = <0xb0010000>;
+ mode-emmc2 = <0xb0010001>;
+ mode-emmc3 = <0xb0010002>;
+ mode-emmc4 = <0xb0010003>;
+ mode-emmc5 = <0xb0010004>;
+ mode-emmc6 = <0xb0010005>;
+ mode-emmc7 = <0xb0010006>;
+ mode-emmc8 = <0xb0010007>;
+ mode-menu = <0xb00100ff>;
+ };
+
speaker_amp: audio-amplifier {
compatible = "simple-audio-amplifier";
enable-gpios = <&pio 2 7 GPIO_ACTIVE_HIGH>; /* PC7 */
@@ -931,6 +959,15 @@ &reg_rtc_ldo {
regulator-name = "vcc-rtc";
};
+&rtc {
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ reboot_mode: reboot-mode@4 {
+ reg = <0x4 0x4>;
+ };
+};
+
&sound {
status = "okay";
simple-audio-card,name = "PinePhone";
--
2.51.0

View File

@@ -0,0 +1,54 @@
From 360891b201c9534abc7441aca1db3eb3aeaeea3f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Mon, 18 Oct 2021 17:41:25 +0200
Subject: arm64: dts: sun50i-a64-pinephone: Add supply for i2c bus to anx7688
The bus power needs to be enabled for anx7688 to be able to communicate
with the master.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts | 1 +
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts | 1 +
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts | 1 +
3 files changed, 3 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts
index 8f6ea6b06aa9..cfb9518e057f 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts
@@ -43,6 +43,7 @@ hdmi-bridge@28 {
avdd18-supply = <&reg_ldo_io1>;
dvdd18-supply = <&reg_ldo_io1>;
avdd33-supply = <&reg_dldo1>;
+ i2c-supply = <&reg_ldo_io0>;
vconn-supply = <&reg_vconn5v0>;
hdmi_vt-supply = <&reg_dldo1>;
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
index 63ceae07a0e0..35cb92e3b5f1 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
@@ -52,6 +52,7 @@ hdmi-bridge@28 {
avdd18-supply = <&reg_ldo_io1>;
dvdd18-supply = <&reg_ldo_io1>;
avdd33-supply = <&reg_dldo1>;
+ i2c-supply = <&reg_ldo_io0>;
vconn-supply = <&reg_vconn5v0>;
hdmi_vt-supply = <&reg_dldo1>;
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
index d28a23e98232..aeb5c69fe51d 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
@@ -51,6 +51,7 @@ hdmi-bridge@28 {
avdd18-supply = <&reg_ldo_io1>;
dvdd18-supply = <&reg_ldo_io1>;
avdd33-supply = <&reg_dcdc1>;
+ i2c-supply = <&reg_ldo_io0>;
vconn-supply = <&reg_vconn5v0>;
hdmi_vt-supply = <&reg_dldo1>;
--
2.51.0

View File

@@ -0,0 +1,33 @@
From f16fd80bf929f431bb28d9adf059db5acd058c69 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Thu, 6 Feb 2020 23:49:27 -0600
Subject: arm64: dts: sun50i-a64-pinephone: Add support for Bluetooth audio
The PinePhone has a Bluetooth chip with its PCM interface connected to
AIF3. Add the DAI link so headeset audio can be routed in hardware.
Even though the link is mono, configuring the link for 2 slots is
required for compatibility with AIF2, which uses a single 32-bit slot,
and which shares its clock dividers with AIF3. Using equal clock
frequencies allows the modem and headset to be used at the same time.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index 91312b0ab896..4f471e80dcd8 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -181,6 +181,7 @@ bat: battery {
bt_sco_codec: bt-sco-codec {
#sound-dai-cells = <1>;
compatible = "linux,bt-sco";
+ sound-name-prefix = "Bluetooth";
};
chosen {
--
2.51.0

View File

@@ -0,0 +1,54 @@
From 3abf71beb7655982c8ea766110734342d1b4b975 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Thu, 10 Nov 2022 20:11:10 +0100
Subject: arm64: dts: sun50i-a64-pinephone: Add support for Pinephone 1.2 beta
Beta versions uses a different magnetometer chip.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm64/boot/dts/allwinner/Makefile | 1 +
.../allwinner/sun50i-a64-pinephone-1.2b.dts | 19 +++++++++++++++++++
2 files changed, 20 insertions(+)
create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2b.dts
diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
index 773cc02a13d0..a733b69fbb6b 100644
--- a/arch/arm64/boot/dts/allwinner/Makefile
+++ b/arch/arm64/boot/dts/allwinner/Makefile
@@ -12,6 +12,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinebook.dtb
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinephone-1.0.dtb
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinephone-1.1.dtb
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinephone-1.2.dtb
+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinephone-1.2b.dtb
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab.dtb
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab-early-adopter.dtb
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2b.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2b.dts
new file mode 100644
index 000000000000..f5ac2e9ca836
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2b.dts
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+// Copyright (C) 2020 Ondrej Jirman <megous@megous.com>
+
+/dts-v1/;
+
+#include "sun50i-a64-pinephone-1.2.dts"
+
+/ {
+ model = "Pine64 PinePhone (1.2b)";
+ compatible = "pine64,pinephone-1.2b", "pine64,pinephone", "allwinner,sun50i-a64";
+};
+
+&lis3mdl {
+ status = "disabled";
+};
+
+&af8133j {
+ status = "okay";
+};
--
2.51.0

View File

@@ -0,0 +1,170 @@
From 1df14f80a2234d5d78d556d7de6dd5357350401e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Fri, 21 Jan 2022 23:28:48 +0100
Subject: arm64: dts: sun50i-a64-pinephone: Add support for Pinephone keyboard
Pinephone keyboard can be used with Pinephone. Describe it in
the device tree.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
.../dts/allwinner/sun50i-a64-pinephone.dtsi | 136 ++++++++++++++++++
1 file changed, 136 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index 97c2f5956ef5..0124635431d5 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -178,6 +178,122 @@ bat: battery {
<0xdf 98>;
};
+ ppkb_battery: keyboard-battery {
+ compatible = "simple-battery";
+ voltage-min-design-microvolt = <3000000>;
+ voltage-max-design-microvolt = <4200000>;
+ energy-full-design-microwatt-hours = <21000000>;
+ charge-full-design-microamp-hours = <6000000>;
+ precharge-current-microamp = <100000>;
+ charge-term-current-microamp = <50000>;
+ constant-charge-current-max-microamp = <2000000>;
+ constant-charge-voltage-max-microvolt = <4200000>;
+ factory-internal-resistance-micro-ohms = <120000>;
+ ocv-capacity-celsius = <20>;
+ ocv-capacity-table-0 =
+ <4147328 100>,
+ <4132636 99>,
+ <4121720 98>,
+ <4110905 97>,
+ <4102063 96>,
+ <4092428 95>,
+ <4082371 94>,
+ <4074137 93>,
+ <4064172 92>,
+ <4056387 91>,
+ <4047198 90>,
+ <4038599 89>,
+ <4030933 88>,
+ <4021831 87>,
+ <4012613 86>,
+ <4003863 85>,
+ <3995132 84>,
+ <3986108 83>,
+ <3977434 82>,
+ <3967977 81>,
+ <3960286 80>,
+ <3951737 79>,
+ <3943518 78>,
+ <3935723 77>,
+ <3928692 76>,
+ <3920093 75>,
+ <3912676 74>,
+ <3905481 73>,
+ <3899881 72>,
+ <3892341 71>,
+ <3887140 70>,
+ <3880005 69>,
+ <3876060 68>,
+ <3869195 67>,
+ <3863234 66>,
+ <3857808 65>,
+ <3851464 64>,
+ <3846976 63>,
+ <3840724 62>,
+ <3835254 61>,
+ <3830946 60>,
+ <3826564 59>,
+ <3821275 58>,
+ <3817413 57>,
+ <3811941 56>,
+ <3808947 55>,
+ <3804959 54>,
+ <3800958 53>,
+ <3797447 52>,
+ <3794303 51>,
+ <3790341 50>,
+ <3787022 49>,
+ <3783436 48>,
+ <3779936 47>,
+ <3776176 46>,
+ <3772160 45>,
+ <3769348 44>,
+ <3766705 43>,
+ <3762481 42>,
+ <3760894 41>,
+ <3758396 40>,
+ <3755803 39>,
+ <3753543 38>,
+ <3749691 37>,
+ <3747026 36>,
+ <3743937 35>,
+ <3741872 34>,
+ <3738529 33>,
+ <3737528 32>,
+ <3734059 31>,
+ <3731586 30>,
+ <3728576 29>,
+ <3725939 28>,
+ <3721208 27>,
+ <3718239 26>,
+ <3713032 25>,
+ <3709785 24>,
+ <3704045 23>,
+ <3701203 22>,
+ <3695965 21>,
+ <3691074 20>,
+ <3684562 19>,
+ <3679140 18>,
+ <3670993 17>,
+ <3664243 16>,
+ <3655383 15>,
+ <3647666 14>,
+ <3642747 13>,
+ <3637775 12>,
+ <3632593 11>,
+ <3627120 10>,
+ <3620923 9>,
+ <3611465 8>,
+ <3597536 7>,
+ <3577366 6>,
+ <3545253 5>,
+ <3497377 4>,
+ <3430377 3>,
+ <3337780 2>,
+ <3183953 1>,
+ <3064061 0>;
+ };
+
bt_sco_codec: bt-sco-codec {
#sound-dai-cells = <1>;
compatible = "linux,bt-sco";
@@ -550,6 +666,26 @@ accelerometer@68 {
/* Connected to pogo pins (external spring based pinheader for user addons) */
&i2c2 {
status = "okay";
+
+ ppkb: keyboard@15 {
+ compatible = "pine64,pinephone-keyboard";
+ reg = <0x15>;
+ interrupt-parent = <&r_pio>;
+ interrupts = <0 12 IRQ_TYPE_EDGE_FALLING>; /* PL12 */
+ vbat-supply = <&reg_usb_5v>;
+ wakeup-source;
+
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ charger@75 {
+ compatible = "injoinic,ip5209";
+ reg = <0x75>;
+ monitored-battery = <&ppkb_battery>;
+ };
+ };
+ };
};
&i2s2 {
--
2.51.0

View File

@@ -0,0 +1,71 @@
From d33975afbcf46a53258f1ed2f4f5602d7b1ccfaa Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Wed, 5 Feb 2020 23:14:27 -0600
Subject: arm64: dts: sun50i-a64-pinephone: Add support for modem audio
The PinePhone has a Quectel EG25-G modem (a variant of the EC25) with
its PCM interface connected to AIF2. Add the DAI link so call audio can
be routed in hardware.
The modem supports two fixed sample rates, and one fixed word size, with
a variable BCLK frequency. Use the minimum supported BCLK frequency,
which corresponds to a slot width of 32 bits.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
.../dts/allwinner/sun50i-a64-pinephone.dtsi | 25 ++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index 4f471e80dcd8..76e55a0e415a 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -188,6 +188,12 @@ chosen {
stdout-path = "serial0:115200n8";
};
+ ec25_codec: ec25-codec {
+ #sound-dai-cells = <1>;
+ compatible = "quectel,ec25";
+ sound-name-prefix = "Modem";
+ };
+
i2c_csi: i2c-csi {
compatible = "i2c-gpio";
sda-gpios = <&pio 4 13 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; /* PE13 */
@@ -316,7 +322,7 @@ vibrator {
&codec {
pinctrl-names = "default";
- pinctrl-0 = <&aif3_pins>;
+ pinctrl-0 = <&aif2_pins>, <&aif3_pins>;
status = "okay";
};
@@ -799,6 +805,23 @@ &sound {
"Headset Microphone", "HBIAS",
"MIC2", "Headset Microphone";
+ simple-audio-card,dai-link@1 {
+ format = "dsp_a";
+ frame-master = <&link1_codec>;
+ bitclock-master = <&link1_codec>;
+ bitclock-inversion;
+
+ link1_cpu: cpu {
+ sound-dai = <&ec25_codec 0>;
+ };
+
+ link1_codec: codec {
+ sound-dai = <&codec 1>;
+ dai-tdm-slot-num = <1>;
+ dai-tdm-slot-width = <32>;
+ };
+ };
+
simple-audio-card,dai-link@2 {
format = "dsp_a";
frame-master = <&link2_codec>;
--
2.51.0

View File

@@ -0,0 +1,35 @@
From a1398167dbe8f451aaf5331159806738863cb988 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Mon, 30 Nov 2020 06:14:07 +0100
Subject: arm64: dts: sun50i-a64-pinephone: Bump I2C frequency to 400kHz
High speed. :)
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index 76e55a0e415a..c2746a21b021 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -478,6 +478,7 @@ ov5640_ep: endpoint {
&i2c0 {
status = "okay";
+ clock-frequency = <400000>;
touchscreen@5d {
compatible = "goodix,gt917s";
@@ -495,6 +496,7 @@ touchscreen@5d {
&i2c1 {
status = "okay";
+ clock-frequency = <400000>;
/* Alternative magnetometer */
af8133j: magnetometer@1c {
--
2.51.0

View File

@@ -0,0 +1,29 @@
From a987a03decda46c52dbcc0e399ca2349d48f6b97 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Mon, 26 Apr 2021 01:31:27 +0200
Subject: arm64: dts: sun50i-a64-pinephone: Don't make lradc keys a wakeup
source
This allow the crust to reach lower suspend state.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index f3b1c0e5493f..97c2f5956ef5 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -558,7 +558,7 @@ &i2s2 {
&lradc {
vref-supply = <&reg_aldo3>;
- wakeup-source;
+// wakeup-source;
status = "okay";
button-200 {
--
2.51.0

View File

@@ -0,0 +1,34 @@
From 058f37ec620528d6d4ebc11aba6d0b65694185fb Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Sat, 16 Apr 2022 02:12:06 +0200
Subject: arm64: dts: sun50i-a64-pinephone: Enable Pinephone Keyboard power
manager
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index 0124635431d5..7de884adadb1 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -434,6 +434,15 @@ vibrator {
enable-gpios = <&pio 3 2 GPIO_ACTIVE_HIGH>; /* PD2 */
vcc-supply = <&reg_dcdc1>;
};
+
+ keyboard-power {
+ compatible = "megi,pinephone-keyboard-power-manager";
+ phone-battery = "axp20x-battery";
+ phone-usb = "axp20x-usb";
+ kb-battery = "ip5xxx-battery";
+ kb-boost = "ip5xxx-boost";
+ kb-usb = "ip5xxx-usb";
+ };
};
&codec {
--
2.51.0

View File

@@ -0,0 +1,29 @@
From dcdcb612a1bb9a614bbddaf099b7866851b0786d Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Wed, 23 Sep 2020 00:13:54 -0500
Subject: arm64: dts: sun50i-a64-pinephone: Enable internal HMIC bias
Revisions 1.0 and 1.1 of the PinePhone mainboard do not have an external
resistor connecting HBIAS to MIC2. Enable the internal resistor to
provide the appropriate mic bias.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts
index ff01e2be26e7..8f6ea6b06aa9 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts
@@ -126,3 +126,7 @@ &sgm3140 {
enable-gpios = <&pio 2 3 GPIO_ACTIVE_HIGH>; /* PC3 */
flash-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */
};
+
+&codec_analog {
+ allwinner,internal-bias-resistor;
+};
--
2.51.0

View File

@@ -0,0 +1,29 @@
From 6945687a57dff96300080ec1edb2df467f376050 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Wed, 5 Aug 2020 11:19:01 +0200
Subject: arm64: dts: sun50i-a64-pinephone: Fix BH modem manager behavior
PP 1.1 has STATUS line multiplexed with POWER KEY, but reading it doesn't
work reliably. Just treat 1.1 as if it was 1.0, and ignore the STATUS.
---
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
index 93dc8512fe45..d67f31ef529e 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
@@ -123,8 +123,8 @@ modem {
enable-gpios = <&pio 7 8 GPIO_ACTIVE_LOW>; /* PH8 */
reset-gpios = <&pio 2 4 GPIO_ACTIVE_HIGH>; /* PC4 */
- status-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
- status-pwrkey-multiplexed; /* status acts as pwrkey */
+ pwrkey-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
+ //status-pwrkey-multiplexed; /* status acts as pwrkey */
sleep-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
wakeup-gpios = <&pio 1 2 GPIO_ACTIVE_HIGH>; /* PB2-RI */
--
2.51.0

View File

@@ -0,0 +1,28 @@
From 97a40516954459a0b55a9c49c3130910be5c6b10 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Sun, 25 Apr 2021 03:17:39 +0200
Subject: arm64: dts: sun50i-a64-pinephone: Power off the touch controller in
sleep
Otherwise it stays on and consumes quite a bit of power.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index 3885a1fd3916..f3b1c0e5493f 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -491,6 +491,7 @@ touchscreen@5d {
VDDIO-supply = <&reg_ldo_io0>;
touchscreen-size-x = <720>;
touchscreen-size-y = <1440>;
+ poweroff-in-suspend;
};
};
--
2.51.0

View File

@@ -0,0 +1,73 @@
From 5fb3c2c424a0c02e59943fba68dc9448de0f7f10 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Mon, 7 Jun 2021 20:23:52 +0200
Subject: arm64: dts: sun50i-a64-pinephone: Set minimum backlight duty cycle to
10%
Instead of creating our own table, use existing lth_brightness
functionality in the pwm_bl driver.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
.../dts/allwinner/sun50i-a64-pinephone-1.1.dts | 16 +---------------
.../dts/allwinner/sun50i-a64-pinephone-1.2.dts | 17 +----------------
2 files changed, 2 insertions(+), 31 deletions(-)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
index d67f31ef529e..63ceae07a0e0 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
@@ -26,21 +26,7 @@ &axp803 {
&backlight {
power-supply = <&reg_ldo_io0>;
- /*
- * PWM backlight circuit on this PinePhone revision was changed since
- * 1.0, and the lowest PWM duty cycle that doesn't lead to backlight
- * being off is around 20%. Duty cycle for the lowest brightness level
- * also varries quite a bit between individual boards, so the lowest
- * value here was chosen as a safe default.
- */
- brightness-levels = <
- 774 793 814 842
- 882 935 1003 1088
- 1192 1316 1462 1633
- 1830 2054 2309 2596
- 2916 3271 3664 4096>;
- num-interpolated-steps = <50>;
- default-brightness-level = <400>;
+ lth-brightness = <10>;
};
&codec_analog {
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
index 5e988230e6e4..d28a23e98232 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
@@ -17,22 +17,7 @@ wifi_pwrseq: wifi-pwrseq {
&backlight {
power-supply = <&reg_ldo_io0>;
- /*
- * PWM backlight circuit on this PinePhone revision was changed since 1.0,
- * and the lowest PWM duty cycle that doesn't lead to backlight being off
- * is around 10%. Duty cycle for the lowest brightness level also varries
- * quite a bit between individual boards, so the lowest value here was
- * chosen as a safe default.
- */
- brightness-levels = <
- 5000 5248 5506 5858 6345
- 6987 7805 8823 10062 11543
- 13287 15317 17654 20319 23336
- 26724 30505 34702 39335 44427
- 50000
- >;
- num-interpolated-steps = <50>;
- default-brightness-level = <500>;
+ lth-brightness = <10>;
};
&lis3mdl {
--
2.51.0

View File

@@ -0,0 +1,43 @@
From b241ef1dff821a0915ac1345a27256ce913a3937 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Thu, 6 Feb 2020 04:58:32 +0100
Subject: arm64: dts: sun50i-a64-pinephone: Shorten post-power-on-delay on mmcs
These are not needed.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index 13213a3704a1..91312b0ab896 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -574,6 +574,7 @@ &mmc0 {
cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
disable-wp;
bus-width = <4>;
+ post-power-on-delay-ms = <1>; /* power is already turned on by the bootloader */
status = "okay";
};
@@ -584,6 +585,7 @@ &mmc1 {
vqmmc-supply = <&reg_dldo4>;
bus-width = <4>;
non-removable;
+ post-power-on-delay-ms = <1>; /* wifi power is always on */
status = "okay";
rtl8723cs: wifi@1 {
@@ -599,6 +601,7 @@ &mmc2 {
bus-width = <8>;
non-removable;
cap-mmc-hw-reset;
+ post-power-on-delay-ms = <1>; /* power is already turned on by the bootloader */
status = "okay";
};
--
2.51.0

View File

@@ -0,0 +1,35 @@
From f1a9b4f7e3a451514b09daa50b43494f8f86612c Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Fri, 23 Feb 2024 01:53:14 +0100
Subject: arm64: dts: sun50i-a64-pinephone: Use newer jack detection
implementaion
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index aeb282eba4b5..e7e90e5baff4 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -476,6 +476,7 @@ keyboard-power {
&codec {
pinctrl-names = "default";
pinctrl-0 = <&aif2_pins>, <&aif3_pins>;
+ jack-type = "headset";
status = "okay";
};
@@ -971,7 +972,7 @@ reboot_mode: reboot-mode@4 {
&sound {
status = "okay";
simple-audio-card,name = "PinePhone";
- simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>;
+ simple-audio-card,aux-devs = <&codec_analog>, <&codec>, <&speaker_amp>;
simple-audio-card,widgets = "Microphone", "Headset Microphone",
"Microphone", "Internal Microphone",
"Headphone", "Headphone Jack",
--
2.51.0

View File

@@ -0,0 +1,84 @@
From 472d4b36112e4463498f165982d47ef15c36be28 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Tue, 26 Oct 2021 01:25:46 +0200
Subject: arm64: dts: sun50i-a64-pinephone: Workaround broken HDMI HPD signal
HDMI HPD signal from ANX7688 to SoC's HDMI PHY is wrongly level
shifted and does not register most of the time at the SoC's input.
We need to do the signalling in software. Link anx7688 to hdmi
driver via extcon interface.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts | 6 +++++-
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts | 6 +++++-
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts | 6 +++++-
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts
index cfb9518e057f..0530881d8401 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts
@@ -25,7 +25,7 @@ &axp803 {
};
&i2c0 {
- hdmi-bridge@28 {
+ anx7688: hdmi-bridge@28 {
compatible = "analogix,anx7688";
reg = <0x28>;
@@ -131,3 +131,7 @@ &sgm3140 {
&codec_analog {
allwinner,internal-bias-resistor;
};
+
+&hdmi {
+ extcon = <&anx7688 0>;
+};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
index 35cb92e3b5f1..053e4add9973 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
@@ -34,7 +34,7 @@ &codec_analog {
};
&i2c0 {
- hdmi-bridge@28 {
+ anx7688: hdmi-bridge@28 {
compatible = "analogix,anx7688";
reg = <0x28>;
@@ -133,3 +133,7 @@ usb0_drd_sw: endpoint {
};
};
};
+
+&hdmi {
+ extcon = <&anx7688 0>;
+};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
index aeb5c69fe51d..c4e3547e02e9 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
@@ -34,7 +34,7 @@ &mmc1 {
};
&i2c0 {
- hdmi-bridge@28 {
+ anx7688: hdmi-bridge@28 {
compatible = "analogix,anx7688";
reg = <0x28>;
@@ -121,3 +121,7 @@ usb0_drd_sw: endpoint {
};
};
};
+
+&hdmi {
+ extcon = <&anx7688 0>;
+};
--
2.51.0

View File

@@ -0,0 +1,38 @@
From c3ebe28518e3178406d7b112db9b1475355975f3 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Sun, 18 Feb 2024 17:39:58 +0100
Subject: arm64: dts: sun50i-a64-pinetab: Add accelerometer
Add accelerometer. Patch picked up from here:
https://github.com/dreemurrs-embedded/Pine64-Arch/blob/master/PKGBUILDS/pine64/linux-megi/pinetab-accelerometer.patch
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts
index b7ab7d28914e..8c91ed7083d7 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts
@@ -237,7 +237,15 @@ &i2c0_pins {
&i2c1 {
status = "okay";
- /* TODO: add Bochs BMA223 accelerometer here */
+ bma223@18 {
+ compatible = "bosch,bma223", "bosch,bma222e";
+ reg = <0x18>;
+ interrupt-parent = <&pio>;
+ interrupts = <7 5 IRQ_TYPE_LEVEL_HIGH>; /* PH5 */
+ mount-matrix = "0", "-1", "0",
+ "-1", "0", "0",
+ "0", "0", "-1";
+ };
};
&lradc {
--
2.51.0

View File

@@ -0,0 +1,28 @@
From 3fb6768c3303c9a8bb0465cca521c0977fe02c92 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Sun, 18 Feb 2024 17:38:00 +0100
Subject: arm64: dts: sun50i-a64-pinetab: Name sound card PineTab
There's no upstream UCM for PineTab, yet. So I guess we can safely
rename it. Pine64-Arch is using this name.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts
index 6056c965baf6..b7ab7d28914e 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts
@@ -475,6 +475,7 @@ hdmi_out_con: endpoint {
&sound {
status = "okay";
+ simple-audio-card,name = "PineTab";
simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>;
simple-audio-card,widgets = "Microphone", "Internal Microphone Left",
"Microphone", "Internal Microphone Right",
--
2.51.0

View File

@@ -0,0 +1,44 @@
From 3b4036339ed5ffeb92f907d0b47b736bf5b12637 Mon Sep 17 00:00:00 2001
From: Icenowy Zheng <icenowy@aosc.io>
Date: Sun, 14 Apr 2019 23:46:47 +0800
Subject: arm64: dts: sun50i-a64-pinetab: enable RTL8723CS bluetooth
PineTab has a RTL8723CS Wi-Fi/BT combo chip on board, the bluetooth part
of it communicates with A64 via UART, and the power of it is controlled
with some GPIO at PL bank.
Enable the bluetooth in the device tree.
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
.../boot/dts/allwinner/sun50i-a64-pinetab.dts | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts
index 8c91ed7083d7..419fe19b4a6f 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts
@@ -511,6 +511,20 @@ &uart0 {
status = "okay";
};
+&uart1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+ status = "okay";
+
+ bluetooth {
+ compatible = "realtek,rtl8723cs-bt";
+ reset-gpios = <&r_pio 0 4 GPIO_ACTIVE_LOW>; /* PL4 */
+ device-wake-gpios = <&r_pio 0 5 GPIO_ACTIVE_LOW>; /* PL5 */
+ host-wake-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */
+ firmware-postfix = "pinebook";
+ };
+};
+
&usb_otg {
dr_mode = "otg";
status = "okay";
--
2.51.0

View File

@@ -0,0 +1,35 @@
From 9ecccf77a9e6bdcaad4ab62225f14f4e42da0147 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Mon, 13 Mar 2023 06:02:46 +0100
Subject: arm64: dts: sun50i-h5: Add missing GPU trip point
Without this, thermal sensor driver fails to probe.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi
index 49481e725a4e..630fcab5defb 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi
@@ -230,6 +230,15 @@ gpu-thermal {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-sensors = <&ths 1>;
+
+ trips {
+ gpu_crit: gpu-crit {
+ /* milliCelsius */
+ temperature = <110000>;
+ hysteresis = <2000>;
+ type = "critical";
+ };
+ };
};
};
};
--
2.51.0

Some files were not shown because too many files have changed in this diff Show More