Skip to content

Commit d328ac1

Browse files
committed
Reenable i2c, spi, and both LEDs
These were disabled with the update to Linux 6.1 since the new device tree didn't include them. This adds them back.
1 parent 5fa15da commit d328ac1

File tree

2 files changed

+98
-0
lines changed

2 files changed

+98
-0
lines changed

linux/linux-6.1.defconfig

+1
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ CONFIG_MMC_SUNXI=y
270270
CONFIG_NEW_LEDS=y
271271
CONFIG_LEDS_CLASS=y
272272
CONFIG_LEDS_CLASS_MULTICOLOR=y
273+
CONFIG_LEDS_SUN50I_A100=y
273274
CONFIG_LEDS_PWM=y
274275
CONFIG_LEDS_TRIGGERS=y
275276
CONFIG_LEDS_TRIGGER_TIMER=y
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
From 20dc2a6c82650cf2ce90f495e79456e188802f06 Mon Sep 17 00:00:00 2001
2+
From: Frank Hunleth <[email protected]>
3+
Date: Mon, 16 Jan 2023 17:06:35 +0000
4+
Subject: [PATCH] mangopi: enable leds, spi and i2c0
5+
6+
---
7+
arch/riscv/dts/sun20i-d1-mangopi-mq-pro.dts | 77 +++++++++++++++++++++
8+
1 file changed, 77 insertions(+)
9+
10+
diff --git a/arch/riscv/dts/sun20i-d1-mangopi-mq-pro.dts b/arch/riscv/dts/sun20i-d1-mangopi-mq-pro.dts
11+
index a7149baf..16b24db7 100644
12+
--- a/arch/riscv/dts/sun20i-d1-mangopi-mq-pro.dts
13+
+++ b/arch/riscv/dts/sun20i-d1-mangopi-mq-pro.dts
14+
@@ -167,3 +167,80 @@
15+
usb0_vbus-supply = <&reg_vcc>;
16+
status = "okay";
17+
};
18+
+
19+
+&pwm {
20+
+ pinctrl-0 = <&pwm2_pd18_pin>;
21+
+ pinctrl-names = "default";
22+
+ status = "okay";
23+
+};
24+
+
25+
+&ledc {
26+
+ pinctrl-0 = <&ledc_pc0_pin>;
27+
+ pinctrl-names = "default";
28+
+ status = "okay";
29+
+
30+
+ multi-led@0 {
31+
+ reg = <0x0>;
32+
+ color = <LED_COLOR_ID_RGB>;
33+
+ function = LED_FUNCTION_STATUS;
34+
+ };
35+
+};
36+
+
37+
+&pio {
38+
+ i2c0_pg12_pins: i2c0-pg12-pins {
39+
+ pins = "PG12", "PG13";
40+
+ function = "i2c0";
41+
+ };
42+
+
43+
+ spi1_clock_and_data_pd_pins: spi1-clock-and-data-pd-pins {
44+
+ pins = "PD11", "PD12", "PD13";
45+
+ function = "spi1";
46+
+ };
47+
+
48+
+ spi1_cs_pd_pins: spi1-cs-pd-pins {
49+
+ pins = "PD10", "PD15";
50+
+ function = "gpio_out";
51+
+ };
52+
+};
53+
+
54+
+&spi1 {
55+
+ /* SPI-1 Notes
56+
+ *
57+
+ * 1. Using the SPI controller to set the chip select pins didn't work for either
58+
+ * chip select. CS0 (PD10) would go low during the transaction, but would also
59+
+ * go low 2s after the transaction (matches runtime PM timer). I couldn't get
60+
+ * CS1 (PD15) to work.
61+
+ * 2. CS0 (PD10) and CS1 (PD15) are configured as GPIO outputs. DBI-DCX(PD14) was
62+
+ * removed from pinctrl and is available for other uses now.
63+
+ * 3. The use of "rohm,dh2228fv" for the spidev devices is just used to get the
64+
+ * usermode access.
65+
+ */
66+
+ pinctrl-0 = <&spi1_clock_and_data_pd_pins>;
67+
+ pinctrl-1 = <&spi1_cs_pd_pins>;
68+
+ pinctrl-names = "default";
69+
+ status = "okay";
70+
+ num-cs = <2>;
71+
+ cs-gpios = <&pio 3 10 GPIO_ACTIVE_HIGH>, <&pio 3 15 GPIO_ACTIVE_HIGH>; /* PD10 and PD15 */
72+
+
73+
+ spidev0: spidev@0 {
74+
+ compatible = "rohm,dh2228fv";
75+
+ reg = <0>;
76+
+ #address-cells = <1>;
77+
+ #size-cells = <0>;
78+
+ spi-max-frequency = <100000000>;
79+
+ };
80+
+
81+
+ spidev1: spidev@1 {
82+
+ compatible = "rohm,dh2228fv";
83+
+ reg = <1>;
84+
+ #address-cells = <1>;
85+
+ #size-cells = <0>;
86+
+ spi-max-frequency = <100000000>;
87+
+ };
88+
+};
89+
+
90+
+&i2c0 {
91+
+ pinctrl-0 = <&i2c0_pg12_pins>;
92+
+ pinctrl-names = "default";
93+
+ status = "okay";
94+
+};
95+
--
96+
2.34.1
97+

0 commit comments

Comments
 (0)