[PATCH 0/6] PinePhone Device Tree Enhancements

26 views
Skip to first unread message

Samuel Holland

unread,
Nov 5, 2020, 12:41:40 AM11/5/20
to Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, linux-ar...@lists.infradead.org, Rob Herring, devic...@vger.kernel.org, linux-...@vger.kernel.org, linux...@googlegroups.com, Samuel Holland
This series fixes a couple of small issues with the PinePhone device
tree, and collects some patches adding support for peripherals that
recently received driver or DT binding support.

Luca Weiss (1):
arm64: dts: allwinner: pinephone: Add LED flash

Ondrej Jirman (3):
arm64: dts: allwinner: pinephone: Add light/proximity sensor
arm64: dts: allwinner: pinephone: Add WiFi support
arm64: dts: allwinner: pinephone: Add Bluetooth support

Samuel Holland (2):
arm64: dts: allwinner: pinephone: Remove AC power supply
arm64: dts: allwinner: pinephone: Set ALDO3 to exactly 3v0

.../allwinner/sun50i-a64-pinephone-1.0.dts | 5 ++
.../allwinner/sun50i-a64-pinephone-1.1.dts | 5 ++
.../allwinner/sun50i-a64-pinephone-1.2.dts | 14 ++++
.../dts/allwinner/sun50i-a64-pinephone.dtsi | 64 +++++++++++++++++--
4 files changed, 82 insertions(+), 6 deletions(-)

--
2.26.2

Samuel Holland

unread,
Nov 5, 2020, 12:41:41 AM11/5/20
to Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, linux-ar...@lists.infradead.org, Rob Herring, devic...@vger.kernel.org, linux-...@vger.kernel.org, linux...@googlegroups.com, Samuel Holland, Ondrej Jirman
From: Ondrej Jirman <meg...@megous.com>

The PinePhone has a Realtek rtl8723cs Bluetooth controller.

Signed-off-by: Ondrej Jirman <meg...@megous.com>
Signed-off-by: Samuel Holland <sam...@sholland.org>
---
.../boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index e173096a7e68..1083055a731f 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -447,6 +447,19 @@ &uart0 {
status = "okay";
};

+&uart1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+ status = "okay";
+
+ bluetooth {
+ compatible = "realtek,rtl8723cs-bt";
+ device-wake-gpios = <&pio 7 6 GPIO_ACTIVE_LOW>; /* PH6 */
+ enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
+ host-wake-gpios = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* PL5 */
+ };
+};
+
/* Connected to the modem (hardware flow control can't be used) */
&uart3 {
pinctrl-names = "default";
--
2.26.2

Samuel Holland

unread,
Nov 5, 2020, 12:41:41 AM11/5/20
to Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, linux-ar...@lists.infradead.org, Rob Herring, devic...@vger.kernel.org, linux-...@vger.kernel.org, linux...@googlegroups.com, Samuel Holland, Luca Weiss
From: Luca Weiss <lu...@z3ntu.xyz>

All revisions of the PinePhone have an SGM3140 LED flash. The gpios were
swapped on v1.0 of the board, but this was fixed in later revisions.

Signed-off-by: Luca Weiss <lu...@z3ntu.xyz>
Signed-off-by: Samuel Holland <sam...@sholland.org>
---
.../boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts | 5 +++++
.../boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts | 5 +++++
.../boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts | 5 +++++
.../boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 11 +++++++++++
4 files changed, 26 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 0c42272106af..3d5a2ae9aa39 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
@@ -9,3 +9,8 @@ / {
model = "Pine64 PinePhone Developer Batch (1.0)";
compatible = "pine64,pinephone-1.0", "allwinner,sun50i-a64";
};
+
+&sgm3140 {
+ enable-gpios = <&pio 2 3 GPIO_ACTIVE_HIGH>; /* PC3 */
+ flash-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */
+};
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 3e99a87e9ce5..c9b9f6e9ee8c 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
@@ -28,3 +28,8 @@ &backlight {
num-interpolated-steps = <50>;
default-brightness-level = <400>;
};
+
+&sgm3140 {
+ enable-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */
+ flash-gpios = <&pio 2 3 GPIO_ACTIVE_HIGH>; /* PC3 */
+};
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 a9f5b670c9b8..94e4f11e0215 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
@@ -38,3 +38,8 @@ &lis3mdl {
interrupt-parent = <&pio>;
interrupts = <1 1 IRQ_TYPE_EDGE_RISING>; /* PB1 */
};
+
+&sgm3140 {
+ enable-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */
+ flash-gpios = <&pio 2 3 GPIO_ACTIVE_HIGH>; /* PC3 */
+};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index 57c89c3b71e9..e595a8262920 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -49,6 +49,17 @@ red {
};
};

+ sgm3140: led-controller {
+ compatible = "sgmicro,sgm3140";
+ vin-supply = <&reg_dcdc1>;
+
+ sgm3140_flash: led {
+ function = LED_FUNCTION_FLASH;
+ color = <LED_COLOR_ID_WHITE>;
+ flash-max-timeout-us = <250000>;
+ };
+ };
+
speaker_amp: audio-amplifier {
compatible = "simple-audio-amplifier";
enable-gpios = <&pio 2 7 GPIO_ACTIVE_HIGH>; /* PC7 */
--
2.26.2

Samuel Holland

unread,
Nov 5, 2020, 12:41:41 AM11/5/20
to Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, linux-ar...@lists.infradead.org, Rob Herring, devic...@vger.kernel.org, linux-...@vger.kernel.org, linux...@googlegroups.com, Samuel Holland
The AXP803 in the Pinephone has its ACIN and VBUS pins shorted together.
In this configuration, the VBUS control registers take priority over the
ACIN control registers, which means the ACIN sysfs knobs have no effect.
Remove the AC power supply from the DTS, since VBUS is really the only
power supply.

Signed-off-by: Samuel Holland <sam...@sholland.org>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 4 ----
1 file changed, 4 deletions(-)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index 25150aba749d..48050bbd941d 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -251,10 +251,6 @@ axp803: pmic@3a3 {

#include "axp803.dtsi"

-&ac_power_supply {
- status = "okay";
-};
-
&battery_power_supply {
status = "okay";
};
--
2.26.2

Samuel Holland

unread,
Nov 5, 2020, 12:41:41 AM11/5/20
to Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, linux-ar...@lists.infradead.org, Rob Herring, devic...@vger.kernel.org, linux-...@vger.kernel.org, linux...@googlegroups.com, Samuel Holland, Ondrej Jirman
From: Ondrej Jirman <meg...@megous.com>

The PinePhone has a Realtek rtl8723cs WiFi module.

On mainboard revisions 1.0 and 1.1, the reset input is always pulled
high, so no power sequence is needed. On mainboard revision 1.2, the
reset input is connected to PL2.

Signed-off-by: Ondrej Jirman <meg...@megous.com>
Signed-off-by: Samuel Holland <sam...@sholland.org>
---
.../allwinner/sun50i-a64-pinephone-1.2.dts | 9 ++++++++
.../dts/allwinner/sun50i-a64-pinephone.dtsi | 22 +++++++++++++++++++
2 files changed, 31 insertions(+)

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 94e4f11e0215..e7cf9d8577c1 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
@@ -8,6 +8,11 @@
/ {
model = "Pine64 PinePhone (1.2)";
compatible = "pine64,pinephone-1.2", "allwinner,sun50i-a64";
+
+ wifi_pwrseq: wifi_pwrseq {
+ compatible = "mmc-pwrseq-simple";
+ reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
+ };
};

&backlight {
@@ -39,6 +44,10 @@ &lis3mdl {
interrupts = <1 1 IRQ_TYPE_EDGE_RISING>; /* PB1 */
};

+&mmc1 {
+ mmc-pwrseq = <&wifi_pwrseq>;
+};
+
&sgm3140 {
enable-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */
flash-gpios = <&pio 2 3 GPIO_ACTIVE_HIGH>; /* PC3 */
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index 9544d7658794..e173096a7e68 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -13,6 +13,7 @@

/ {
aliases {
+ ethernet0 = &rtl8723cs;
serial0 = &uart0;
};

@@ -49,6 +50,13 @@ red {
};
};

+ reg_vbat_wifi: vbat-wifi {
+ compatible = "regulator-fixed";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-name = "vbat-wifi";
+ };
+
sgm3140: led-controller {
compatible = "sgmicro,sgm3140";
vin-supply = <&reg_dcdc1>;
@@ -216,6 +224,20 @@ &mmc0 {
status = "okay";
};

+&mmc1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mmc1_pins>;
+ vmmc-supply = <&reg_vbat_wifi>;
+ vqmmc-supply = <&reg_dldo4>;
+ bus-width = <4>;
+ non-removable;
+ status = "okay";
+
+ rtl8723cs: wifi@1 {
+ reg = <1>;
+ };
+};
+
&mmc2 {
pinctrl-names = "default";
pinctrl-0 = <&mmc2_pins>;
--
2.26.2

Samuel Holland

unread,
Nov 5, 2020, 12:41:42 AM11/5/20
to Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, linux-ar...@lists.infradead.org, Rob Herring, devic...@vger.kernel.org, linux-...@vger.kernel.org, linux...@googlegroups.com, Samuel Holland, Ondrej Jirman
From: Ondrej Jirman <meg...@megous.com>

Pinephone has STK3311-X proximity sensor. Add support for it.

Signed-off-by: Ondrej Jirman <meg...@megous.com>
Signed-off-by: Samuel Holland <sam...@sholland.org>
---
.../arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index e595a8262920..9544d7658794 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -160,6 +160,16 @@ lis3mdl: lis3mdl@1e {
vddio-supply = <&reg_dldo1>;
};

+ /* Light/proximity sensor */
+ stk3311@48 {
+ compatible = "sensortek,stk3311";
+ reg = <0x48>;
+ interrupt-parent = <&pio>;
+ interrupts = <1 0 IRQ_TYPE_EDGE_FALLING>; /* PB0 */
+ vdd-supply = <&reg_ldo_io0>;
+ leda-supply = <&reg_dldo1>;
+ };
+
/* Accelerometer/gyroscope */
mpu6050@68 {
compatible = "invensense,mpu6050";
--
2.26.2

Maxime Ripard

unread,
Nov 5, 2020, 6:23:28 AM11/5/20
to Samuel Holland, Chen-Yu Tsai, Jernej Skrabec, linux-ar...@lists.infradead.org, Rob Herring, devic...@vger.kernel.org, linux-...@vger.kernel.org, linux...@googlegroups.com, Ondrej Jirman
Hi,
The node names should be the class of the device, not the model. The
other sensors here have a similar issue though, so I've applied it, but
could you send a subsequent patch fixing this?

Thanks!
Maxime
signature.asc

Maxime Ripard

unread,
Nov 5, 2020, 6:24:16 AM11/5/20
to Samuel Holland, Chen-Yu Tsai, Jernej Skrabec, linux-ar...@lists.infradead.org, Rob Herring, devic...@vger.kernel.org, linux-...@vger.kernel.org, linux...@googlegroups.com, Ondrej Jirman
Underscores are not valid in node names. I've fixed it while applying

Maxime
signature.asc

Maxime Ripard

unread,
Nov 5, 2020, 6:25:30 AM11/5/20
to Samuel Holland, Chen-Yu Tsai, Jernej Skrabec, linux-ar...@lists.infradead.org, Rob Herring, devic...@vger.kernel.org, linux-...@vger.kernel.org, linux...@googlegroups.com
On Wed, Nov 04, 2020 at 11:41:29PM -0600, Samuel Holland wrote:
> This series fixes a couple of small issues with the PinePhone device
> tree, and collects some patches adding support for peripherals that
> recently received driver or DT binding support.

Applied all those patches, thanks!
Maxime
signature.asc
Reply all
Reply to author
Forward
0 new messages