Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sunxi-pwm: Fix broken PWM_SUNXI_ENHANCE driver #25

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/kernel/linux-sunxi64-edge.config
Original file line number Diff line number Diff line change
Expand Up @@ -7549,7 +7549,7 @@ CONFIG_PWM_CLK=m
CONFIG_PWM_NTXEC=m
CONFIG_PWM_PCA9685=m
CONFIG_PWM_SUN4I=m
# CONFIG_PWM_SUNXI_ENHANCE is not set
CONFIG_PWM_SUNXI_ENHANCE=m
CONFIG_PWM_XILINX=m

#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 22b7070a9a36cc54930ad1aed97efd1eb760ac46 Mon Sep 17 00:00:00 2001
From 9677ae470f1f678dac3a74d16e71c7569d0f92be Mon Sep 17 00:00:00 2001
From: Stephen Graf <[email protected]>
Date: Thu, 9 May 2024 20:59:34 -0700
Subject: Sound for H616, H618 Allwinner SOCs
Expand Down Expand Up @@ -76,10 +76,10 @@ index ce3dc6d9cd66..23553f2249c2 100644
status = "okay";
};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
index ae0a08448459..9fe66173f9d8 100644
index 3b956784ed50..726e8be2a02e 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
@@ -459,6 +459,17 @@ gic: interrupt-controller@3021000 {
@@ -465,6 +465,17 @@ gic: interrupt-controller@3021000 {
#interrupt-cells = <3>;
};

Expand All @@ -97,7 +97,7 @@ index ae0a08448459..9fe66173f9d8 100644
mmc0: mmc@4020000 {
compatible = "allwinner,sun50i-h616-mmc",
"allwinner,sun50i-a100-mmc";
@@ -787,6 +798,78 @@ mdio1: mdio {
@@ -793,6 +804,78 @@ mdio1: mdio {
};
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
From 64c697ed9cacc3f3a7a19415eb1a14ae7aceb411 Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <[email protected]>
Date: Wed, 6 Mar 2024 06:51:01 -0500
Subject: arch: arm64: dts: allwinner: sun50i-h616: spi1 cs1 pin

Signed-off-by: Patrick Yavitz <[email protected]>
---
arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
index ae0a08448459..3b956784ed50 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
@@ -404,6 +404,12 @@ spi1_cs0_pin: spi1-cs0-pin {
function = "spi1";
};

+ /omit-if-no-ref/
+ spi1_cs1_pin: spi1-cs1-pin {
+ pins = "PH9";
+ function = "spi1";
+ };
+
spdif_tx_pin: spdif-tx-pin {
pins = "PH4";
function = "spdif";
--
2.35.3

Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ index 000000000000..fba5b39cc319
+ status = "disabled";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ pinctrl-names = "default";
+ pinctrl-names = "default", "default";
+ pinctrl-0 = <&spi1_pins>, <&spi1_cs1_pin>;
+
+ spidev@1 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,152 +1,12 @@
From 8e5a8ae9a921ebd0ffe11ddedf88b605df303eb3 Mon Sep 17 00:00:00 2001
From: Alan <Alan>
Date: Tue, 30 May 2023 17:36:29 +0800
Subject: arm64: dts: sun50i-h616-bigtreetech-cb1(sd, emmc)
Subject: arm64: dts: sun50i-h616-bigtreetech-cb1

> X-Git-Archeology: > recovered message: > Signed-off-by: Alan.Ma from BigTreeTech [email protected]
> X-Git-Archeology: - Revision 9d69bb1da699f5729dc5c1dcc2d8d5f4590152fd: https://github.com/armbian/build/commit/9d69bb1da699f5729dc5c1dcc2d8d5f4590152fd
> X-Git-Archeology: Date: Tue, 30 May 2023 17:36:29 +0800
> X-Git-Archeology: From: Alan <Alan>
> X-Git-Archeology: Subject: Patches: add current(6.1) & edge(6.2) patch for BigTreeTech CB1
> X-Git-Archeology:
> X-Git-Archeology: - Revision 8562428877003ddd46045cb3429d7fdc9df4acee: https://github.com/armbian/build/commit/8562428877003ddd46045cb3429d7fdc9df4acee
> X-Git-Archeology: Date: Sat, 02 Sep 2023 03:34:28 +0518
> X-Git-Archeology: From: Gunjan Gupta <[email protected]>
> X-Git-Archeology: Subject: Allwinner: Kernel patches for 6.5-rc7 kernel
> X-Git-Archeology:
> X-Git-Archeology: - Revision bb78fac2fadb40a43a9ccb36266dbd21746c2eb6: https://github.com/armbian/build/commit/bb78fac2fadb40a43a9ccb36266dbd21746c2eb6
> X-Git-Archeology: Date: Fri, 29 Sep 2023 08:46:52 +0200
> X-Git-Archeology: From: Ricardo Pardini <[email protected]>
> X-Git-Archeology: Subject: `sunxi`/`sunxi64` `edge` 6.5.y: rebase/rewrite all patches for v6.5.5; fix UTF-8 "From:" encoding
> X-Git-Archeology:
> X-Git-Archeology: - Revision d1186b8a0e3d44d5b285e94772ebe2c17a014193: https://github.com/armbian/build/commit/d1186b8a0e3d44d5b285e94772ebe2c17a014193
> X-Git-Archeology: Date: Mon, 30 Oct 2023 22:46:11 +0518
> X-Git-Archeology: From: Gunjan Gupta <[email protected]>
> X-Git-Archeology: Subject: kernel: sunxi: Add patches for 6.6 kernel
> X-Git-Archeology:
> X-Git-Archeology: - Revision a269c9a1c5784bd89630df1652923f0d76278b61: https://github.com/armbian/build/commit/a269c9a1c5784bd89630df1652923f0d76278b61
> X-Git-Archeology: Date: Sun, 24 Dec 2023 09:13:08 +0100
> X-Git-Archeology: From: Gunjan Gupta <[email protected]>
> X-Git-Archeology: Subject: Refreshed patches using rewrite-kernel-patches command
> X-Git-Archeology:
> X-Git-Archeology: - Revision 30ef1a3e149f96200bffaf1c3138a4467b6f0aa7: https://github.com/armbian/build/commit/30ef1a3e149f96200bffaf1c3138a4467b6f0aa7
> X-Git-Archeology: Date: Sun, 24 Dec 2023 09:13:08 +0100
> X-Git-Archeology: From: Gunjan Gupta <[email protected]>
> X-Git-Archeology: Subject: Allwinner: Add kernel patches for 6.7 kernel
> X-Git-Archeology:
---
arch/arm64/boot/dts/allwinner/Makefile | 2 +
.../sun50i-h616-bigtreetech-cb1-emmc.dts | 44 ++++
.../sun50i-h616-bigtreetech-cb1-sd.dts | 35 +++
.../sun50i-h616-bigtreetech-cb1.dtsi | 223 ++++++++++++++++--
4 files changed, 287 insertions(+), 17 deletions(-)
create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h616-bigtreetech-cb1-emmc.dts
create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h616-bigtreetech-cb1-sd.dts
1 files changed, 208 insertions(+), 17 deletions(-)

diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
index 337a1502378f..341a2bd0f87c 100644
--- a/arch/arm64/boot/dts/allwinner/Makefile
+++ b/arch/arm64/boot/dts/allwinner/Makefile
@@ -52,6 +52,8 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-tanix-tx6.dtb
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-tanix-tx6-mini.dtb
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h313-tanix-tx1.dtb
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-bigtreetech-cb1-manta.dtb
+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-bigtreetech-cb1-sd.dtb
+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-bigtreetech-cb1-emmc.dtb
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-bigtreetech-pi.dtb
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-orangepi-zero2.dtb
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-x96-mate.dtb
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-bigtreetech-cb1-emmc.dts b/arch/arm64/boot/dts/allwinner/sun50i-h616-bigtreetech-cb1-emmc.dts
new file mode 100644
index 000000000000..f878c23f1d90
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-bigtreetech-cb1-emmc.dts
@@ -0,0 +1,44 @@
+// SPDX-License-Identifier: (GPL-2.0+ or MIT)
+/*
+ * Copyright (C) 2023 Alan.Ma <[email protected]>.
+ */
+
+/dts-v1/;
+
+#include "sun50i-h616-bigtreetech-cb1.dtsi"
+
+&mmc2 {
+ vmmc-supply = <&reg_dldo1>;
+
+ no-1-8-v;
+ bus-width = <8>;
+ non-removable;
+ status = "okay";
+};
+
+&ws2812 {
+ gpios = <&pio 8 15 GPIO_ACTIVE_LOW>; /* PI15 */
+};
+
+&i2c_gpio {
+ gpios = <&pio 8 6 GPIO_ACTIVE_HIGH>, /* SDA PI6 */
+ <&pio 8 4 GPIO_ACTIVE_HIGH>; /* SCL PI4 */
+};
+
+&can0_pin_irq {
+ pins = "PI3";
+};
+
+&can {
+ interrupts = <8 3 0x08>; /* PI3 IRQ_TYPE_LEVEL_LOW */
+};
+
+&tft_35 {
+ dc-gpios = <&pio 8 15 GPIO_ACTIVE_HIGH>; /* PI15 */
+};
+
+&spi1 {
+ cs-gpios = <&pio 8 5 GPIO_ACTIVE_HIGH>, /* PI5 */
+ <&pio 8 14 GPIO_ACTIVE_HIGH>, /* PI14 */
+ <&pio 8 7 GPIO_ACTIVE_HIGH>; /* PI7 */
+};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-bigtreetech-cb1-sd.dts b/arch/arm64/boot/dts/allwinner/sun50i-h616-bigtreetech-cb1-sd.dts
new file mode 100644
index 000000000000..e18dd854d74b
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-bigtreetech-cb1-sd.dts
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: (GPL-2.0+ or MIT)
+/*
+ * Copyright (C) 2023 Alan.Ma <[email protected]>.
+ */
+
+/dts-v1/;
+
+#include "sun50i-h616-bigtreetech-cb1.dtsi"
+
+&ws2812 {
+ gpios = <&pio 2 14 GPIO_ACTIVE_LOW>; /* PC14 */
+};
+
+&i2c_gpio {
+ gpios = <&pio 2 12 GPIO_ACTIVE_HIGH>, /* SDA PC12 */
+ <&pio 2 10 GPIO_ACTIVE_HIGH>; /* SCL PC10 */
+};
+
+&can0_pin_irq {
+ pins = "PC9";
+};
+
+&can {
+ interrupts = <2 9 0x08>; /* PC9 IRQ_TYPE_LEVEL_LOW */
+};
+
+&tft_35 {
+ dc-gpios = <&pio 2 14 GPIO_ACTIVE_HIGH>; /* PC14 */
+};
+
+&spi1 {
+ cs-gpios = <&pio 2 11 GPIO_ACTIVE_HIGH>, /* PC11 */
+ <&pio 2 7 GPIO_ACTIVE_HIGH>, /* PC7 */
+ <&pio 2 13 GPIO_ACTIVE_HIGH>; /* PC13 */
+};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-bigtreetech-cb1.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h616-bigtreetech-cb1.dtsi
index d12b01c5f41b..0da8f2e6e3d4 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h616-bigtreetech-cb1.dtsi
Expand Down
Loading