Sunxi 5.10: Fix ISO C90 forbids mixed declarations and code (#3329)

* Revert "Calculate patches changes only on first level since this fails when including subfolder. Bug in sort. Needs to be reworked once"

 Return `megous` patches

This reverts commit 2eae831889.

* Sunxi 5.10: Fix ISO C90 forbids mixed declarations and code
This commit is contained in:
The-going
2021-12-08 18:15:41 +03:00
committed by GitHub
parent fe9c032aac
commit c86dd24180
23 changed files with 1500 additions and 1 deletions

View File

@@ -0,0 +1,66 @@
From ce6f8ce7dd4b56edfe76ff8d2fca0c73596b0ed8 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Fri, 10 Nov 2017 14:33:28 +0100
Subject: [PATCH 019/351] 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 <megous@megous.com>
---
arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index e2fc046e43e2..b581836357fb 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
@@ -195,6 +195,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 {
@@ -377,9 +387,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 {
@@ -402,7 +413,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.34.0

View File

@@ -0,0 +1,32 @@
From 1ec094c747303890a7860971248f17bae7154a8b Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Wed, 8 Nov 2017 21:57:45 +0100
Subject: [PATCH 032/351] ARM: dts: sun8i-a83t-tbs-a711: Add flash led support
---
arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index b06dd5d3dac0..315833203481 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/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.34.0

View File

@@ -0,0 +1,61 @@
From c2191d630ca8a232cb20c6bd2eafed7546a20270 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: [PATCH 020/351] 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 <megous@megous.com>
Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
---
arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index b581836357fb..02c71eec8b82 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
@@ -123,7 +123,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>;
};
@@ -139,6 +139,17 @@ wifi_pwrseq: wifi_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.34.0

View File

@@ -0,0 +1,144 @@
From 4e4c89df7f4ec07a315b458022bba170aeade73a Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Tue, 23 Jun 2020 19:43:24 +0200
Subject: [PATCH 027/351] ARM: dts: sun8i-a83t-tbs-a711: Add rear camera sensor
(HM5065)
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 <megous@megous.com>
# Conflicts:
# arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
---
arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 64 ++++++++++++++++++++++-
1 file changed, 62 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index 71d5923d2e34..af9a83988e5e 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/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>;
@@ -220,6 +230,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>;
};
@@ -228,6 +245,23 @@ &cpu100 {
cpu-supply = <&reg_dcdc3>;
};
+&csi {
+ pinctrl-names = "default";
+ pinctrl-0 = <&csi_8bit_parallel_pins>, <&csi_mclk_pin>;
+ status = "okay";
+};
+
+&csi_in {
+ csi_hm5065_ep: endpoint {
+ remote-endpoint = <&hm5065_ep>;
+ bus-width = <8>;
+ data-active = <1>;
+ pclk-sample = <0>;
+ hsync-active = <0>;
+ vsync-active = <1>;
+ };
+};
+
&de {
status = "okay";
};
@@ -288,6 +322,32 @@ npc100: nfc@28 {
};
};
+&i2c_gpio {
+ hm5065: 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>;
+ };
+ };
+ };
+};
+
&i2s0 {
status = "okay";
pinctrl-names = "default";
@@ -509,7 +569,7 @@ &reg_drivevbus {
};
&reg_eldo1 {
- regulator-min-microvolt = <1200000>;
+ regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-name = "pvdd-nfc";
regulator-always-on;
@@ -522,7 +582,7 @@ &reg_eldo2 {
};
&reg_eldo3 {
- regulator-min-microvolt = <1200000>;
+ regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-name = "dvdd-csi-f";
};
--
2.34.0

View File

@@ -0,0 +1,31 @@
From d6784d09a45295202b9f354597c6297a41886aef Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Tue, 23 Jun 2020 19:15:37 +0200
Subject: [PATCH 024/351] 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 <megous@megous.com>
---
arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index 05f460acdaa7..491aa409fc46 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
@@ -273,6 +273,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.34.0

View File

@@ -0,0 +1,132 @@
From 49b4bd1dc8cc973097bb71d0ebbff2b7b91a2950 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Sat, 22 Feb 2020 23:40:29 +0100
Subject: [PATCH 023/351] ARM: dts: sun8i-a83t-tbs-a711: Add sound support via
AC100 codec
...
Signed-off-by: Ondrej Jirman <megous@megous.com>
---
arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 85 +++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index 02c71eec8b82..05f460acdaa7 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
@@ -150,6 +150,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 {
@@ -218,6 +286,12 @@ npc100: nfc@28 {
};
};
+&i2s0 {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2s0_pins>;
+};
+
&mmc0 {
vmmc-supply = <&reg_dcdc1>;
pinctrl-names = "default";
@@ -298,12 +372,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.34.0

View File

@@ -0,0 +1,90 @@
From 2df77f845102bc493fa9537e7c5df2640eda68a4 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Tue, 23 Jun 2020 19:45:29 +0200
Subject: [PATCH 028/351] ARM: dts: sun8i-a83t-tbs-a711: Add support for the
front camera (gc2145)
The tablet has two cameras, that can be switched between. Add
support for the front one.
Signed-off-by: Ondrej Jirman <megous@megous.com>
---
arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 41 +++++++++++++++++++++--
1 file changed, 39 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index af9a83988e5e..b06dd5d3dac0 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
@@ -252,7 +252,11 @@ &csi {
};
&csi_in {
- csi_hm5065_ep: endpoint {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ csi_hm5065_ep: endpoint@0 {
+ reg = <0>;
remote-endpoint = <&hm5065_ep>;
bus-width = <8>;
data-active = <1>;
@@ -260,6 +264,16 @@ csi_hm5065_ep: endpoint {
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 {
@@ -323,7 +337,7 @@ npc100: nfc@28 {
};
&i2c_gpio {
- hm5065: camera@1f {
+ hm5065: rear-camera@1f {
compatible = "himax,hm5065";
reg = <0x1f>;
clocks = <&ccu CLK_CSI_MCLK>;
@@ -346,6 +360,29 @@ hm5065_ep: endpoint {
};
};
};
+
+ 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 {
--
2.34.0

View File

@@ -0,0 +1,40 @@
From 6b921f916b560f61c67689196035416e20958c1a Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Sat, 9 Nov 2019 23:55:48 +0100
Subject: [PATCH 016/351] 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 <megous@megous.com>
---
arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index 9029e6ad461b..189e21b80d68 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
@@ -99,6 +99,11 @@ panel_input: endpoint {
};
};
+ vibrator {
+ compatible = "gpio-vibrator";
+ vcc-supply = <&reg_ldo_io1>;
+ };
+
reg_gps: reg-gps {
compatible = "regulator-fixed";
regulator-name = "gps";
--
2.34.0

View File

@@ -0,0 +1,33 @@
From 84b0e659ea7a63c0f8419e709e994c105c239149 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Tue, 23 Jun 2020 19:17:37 +0200
Subject: [PATCH 025/351] ARM: dts: sun8i-a83t-tbs-a711: Don't increase BT baud
rate to 1.5MHz
Since Linux 5.6, increasing the baud rate makes the bt_bcm fail to
switch frequencies for reasons outside of BT driver changes between
v5.5 and v5.6.
Reasons are unknown.
Signed-off-by: Ondrej Jirman <megous@megous.com>
---
arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index 491aa409fc46..71d5923d2e34 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
@@ -593,7 +593,7 @@ bluetooth {
device-wakeup-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
host-wakeup-gpios = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* PL5 */
shutdown-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
- max-speed = <1500000>;
+// max-speed = <1500000>; stopped working in v5.6
};
};
--
2.34.0

View File

@@ -0,0 +1,31 @@
From 3185b8a7bd55319cc65ca45841f6b4382313379d Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Sun, 23 Feb 2020 13:21:58 +0100
Subject: [PATCH 011/351] 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 <megous@megous.com>
---
arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index bfc9bb277a49..9029e6ad461b 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
@@ -300,6 +300,10 @@ &battery_power_supply {
status = "okay";
};
+&charger_led {
+ status = "okay";
+};
+
&reg_aldo1 {
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
--
2.34.0

View File

@@ -0,0 +1,48 @@
From 9422d0d8ad4f42afaa1effec91bb8fe177c10612 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Tue, 23 Jun 2020 19:19:46 +0200
Subject: [PATCH 162/323] 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 <megous@megous.com>
---
arch/arm/boot/dts/sun8i-a83t.dtsi | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi b/arch/arm/boot/dts/sun8i-a83t.dtsi
index 51a757dfb..642ceeef1 100644
--- a/arch/arm/boot/dts/sun8i-a83t.dtsi
+++ b/arch/arm/boot/dts/sun8i-a83t.dtsi
@@ -272,7 +272,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>;
};
@@ -410,6 +410,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";
@@ -420,7 +423,7 @@ sram_a2: sram@40000 {
scpi_sram: scp-shmem@13c00 {
compatible = "arm,scp-shmem";
- reg = <0x13c00 0x200>;
+ reg = <0x13e00 0x200>;
};
};
--
2.34.0

View File

@@ -0,0 +1,31 @@
From 6b227410d7f9750b7bd16d55949d93ffa0ab0400 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Fri, 8 Dec 2017 12:44:22 +0100
Subject: [PATCH 017/351] 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 <megous@megous.com>
---
arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index 189e21b80d68..e2fc046e43e2 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
@@ -438,8 +438,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.34.0

View File

@@ -13,16 +13,27 @@
megous/arm64-dts-sun50i-h5-orangepi-pc2-Add-CPUX-regulator-.patch
megous/ARM-dts-axp813-Add-charger-LED.patch
megous/ARM-dts-sun8i-a83t-Improve-CPU-OPP-tables-go-up-to-1.patch
megous/ARM-dts-sun8i-a83t-tbs-a711-Enable-charging-LED.patch
megous/cpufreq-sun50i-Show-detected-CPU-bin-for-easier-debu.patch
megous/dt-bindings-input-gpio-vibrator-Don-t-require-enable.patch
megous/input-gpio-vibra-Allow-to-use-vcc-supply-alone-to-co.patch
megous/ARM-dts-sun8i-a83t-tbs-a711-Add-support-for-the-vibr.patch
megous/ARM-dts-sun8i-a83t-tbs-a711-Increase-voltage-on-the-.patch
megous/nfc-pn544-Add-support-for-VBAT-PVDD-regulators.patch
megous/ARM-dts-sun8i-a83t-tbs-a711-Add-PN544-NFC-support.patch
megous/ARM-dts-sun8i-a83t-tbs-a711-Add-powerup-down-support.patch
megous/ARM-dts-sun8i-a83t-Add-cedrus-video-codec-support-to.patch
megous/ARM-dts-suni-a83t-Add-i2s0-pins.patch
megous/ARM-dts-sun8i-a83t-tbs-a711-Add-sound-support-via-AC.patch
megous/ARM-dts-sun8i-a83t-tbs-a711-Add-regulators-to-the-ac.patch
megous/ARM-dts-sun8i-a83t-tbs-a711-Don-t-increase-BT-baud-r.patch
megous/bluetooth-bcm-Restore-drive_rts_on_open-true-behavio.patch
megous/ARM-dts-sun8i-a83t-tbs-a711-Add-rear-camera-sensor-H.patch
megous/ARM-dts-sun8i-a83t-tbs-a711-Add-support-for-the-fron.patch
megous/mailbox-Allow-to-run-mailbox-while-timekeeping-is-su.patch
megous/ARM-sunxi-Add-experimental-suspend-to-memory-impleme.patch
megous/ARM-sunxi-sunxi_cpu0_hotplug_support_set-is-not-supp.patch
megous/ARM-dts-sun8i-a83t-tbs-a711-Add-flash-led-support.patch
megous/firmware-scpi-Add-support-for-sending-a-SCPI_CMD_SET.patch
megous/mmc-add-delay-after-power-class-selection.patch
megous/firmware-scpi-Don-t-probe-SCP-during-SCPI-driver-pro.patch
@@ -153,6 +164,7 @@
megous/arm64-dts-allwinner-a64-Move-wakeup-capable-IRQs-to-.patch
megous/arm64-dts-allwinner-h6-Fix-indentation-of-IR-node.patch
megous/arm64-dts-allwinner-h6-Move-wakeup-capable-IRQs-to-r.patch
megous/ARM-dts-sun8i-a83t-tbs-a711-Give-Linux-more-privileg.patch
megous/irqchip-sun6i-r-Fix-interrupt-handling-on-A83T.patch
megous/Revert-i2c-mv64xxx-Add-runtime-PM-support.patch
megous/misc-modem-power-Power-manager-for-modems.patch

View File

@@ -0,0 +1,195 @@
From 79df7b65a963d0fd414f90ce873e1a2f10f49b95 Mon Sep 17 00:00:00 2001
From: The-going <48602507+The-going@users.noreply.github.com>
Date: Mon, 22 Feb 2021 17:19:43 +0300
Subject: [PATCH] Fix declaration after statement
ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
---
drivers/spi/spi.c | 2 +-
drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 4 ++--
drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 4 ++--
drivers/media/i2c/gc2145.c | 9 +++++----
drivers/media/i2c/ov5640.c | 2 +-
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 2 +-
drivers/video/backlight/pwm_bl.c | 3 ++-
7 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 0c65b6565..a61e891a7 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -3339,7 +3339,7 @@ static int __spi_validate_bits_per_word(struct spi_controller *ctlr,
int spi_setup(struct spi_device *spi)
{
unsigned bad_bits, ugly_bits;
- int status;
+ int status, ret;
/* check mode to prevent that DUAL and QUAD set at the same time
*/
@@ -3400,7 +3400,7 @@ int spi_setup(struct spi_device *spi)
if (gpio_is_valid(spi->cs_gpio)) {
dev_info(&spi->dev, "spi_setup / gpio_is_valid(%d) ... doing gpio_request ...\n", spi->cs_gpio);
- int ret = gpio_request(spi->cs_gpio, dev_name(&spi->dev));
+ ret = gpio_request(spi->cs_gpio, dev_name(&spi->dev));
if (ret) {
dev_err(&spi->dev, "failed to request gpio\n");
}
diff --git a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c
index 5ef1f7513..2fbdbb28b 100644
--- a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c
+++ b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c
@@ -29,6 +29,7 @@ static void sun8i_ui_layer_enable(struct sun8i_mixer *mixer, int channel,
{
u32 val, bld_base, ch_base;
unsigned int old_pipe_ch;
+ unsigned tmp;
bld_base = sun8i_blender_base(mixer);
ch_base = sun8i_channel_base(mixer, channel);
@@ -102,7 +103,6 @@ static void sun8i_ui_layer_enable(struct sun8i_mixer *mixer, int channel,
DRM_DEBUG_DRIVER(" enable pipe %d <- ch %d\n", zpos, channel);
}
- unsigned tmp;
regmap_read(mixer->engine.regs,
SUN8I_MIXER_CHAN_UI_LAYER_ATTR(ch_base, overlay), &tmp);
DRM_DEBUG_DRIVER(" post-en-dis %08x\n", tmp);
@@ -213,6 +213,7 @@ static int sun8i_ui_layer_update_formats(struct sun8i_mixer *mixer, int channel,
const struct drm_format_info *fmt;
u32 val, ch_base, hw_fmt;
int ret;
+ unsigned tmp;
ch_base = sun8i_channel_base(mixer, channel);
@@ -223,7 +224,6 @@ static int sun8i_ui_layer_update_formats(struct sun8i_mixer *mixer, int channel,
return -EINVAL;
}
- unsigned tmp;
regmap_read(mixer->engine.regs,
SUN8I_MIXER_CHAN_UI_LAYER_ATTR(ch_base, overlay), &tmp);
DRM_DEBUG_DRIVER(" pre-format %08x\n", tmp);
diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
index c393c388e..07528e5ef 100644
--- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
+++ b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
@@ -23,6 +23,7 @@ static void sun8i_vi_layer_enable(struct sun8i_mixer *mixer, int channel,
{
u32 val, bld_base, ch_base;
unsigned int old_pipe_ch;
+ unsigned tmp;
bld_base = sun8i_blender_base(mixer);
ch_base = sun8i_channel_base(mixer, channel);
@@ -96,7 +97,6 @@ static void sun8i_vi_layer_enable(struct sun8i_mixer *mixer, int channel,
DRM_DEBUG_DRIVER(" enable pipe %d <- ch %d\n", zpos, channel);
}
- unsigned tmp;
regmap_read(mixer->engine.regs,
SUN8I_MIXER_CHAN_VI_LAYER_ATTR(ch_base, overlay), &tmp);
DRM_DEBUG_DRIVER(" post-en-dis %08x\n", tmp);
@@ -270,6 +270,7 @@ static int sun8i_vi_layer_update_formats(struct sun8i_mixer *mixer, int channel,
u32 val, ch_base, csc_mode, hw_fmt;
const struct drm_format_info *fmt;
int ret;
+ unsigned tmp;
ch_base = sun8i_channel_base(mixer, channel);
@@ -280,7 +281,6 @@ static int sun8i_vi_layer_update_formats(struct sun8i_mixer *mixer, int channel,
return ret;
}
- unsigned tmp;
regmap_read(mixer->engine.regs,
SUN8I_MIXER_CHAN_VI_LAYER_ATTR(ch_base, overlay), &tmp);
DRM_DEBUG_DRIVER(" pre-format %08x\n", tmp);
diff --git a/drivers/media/i2c/gc2145.c b/drivers/media/i2c/gc2145.c
index bed611045..d3e2a0d21 100644
--- a/drivers/media/i2c/gc2145.c
+++ b/drivers/media/i2c/gc2145.c
@@ -1562,6 +1562,8 @@ static int gc2145_setup_mode(struct gc2145_dev *sensor)
unsigned long height = sensor->fmt.height;
unsigned long framerate = sensor->frame_interval.denominator;
const struct gc2145_pixfmt *pix_fmt;
+ unsigned long rt, ft, ft_rt;
+ int i;
pix_fmt = gc2145_find_format(sensor->fmt.code);
if (!pix_fmt) {
@@ -1691,10 +1693,9 @@ static int gc2145_setup_mode(struct gc2145_dev *sensor)
//XXX: calculate auto exposure settings, there are 4 slots that the HW
//uses and exposure settings are set in row_time units
- unsigned long rt = gc2145_sensor_params_get_row_period(&params);
- unsigned long ft = gc2145_sensor_params_get_frame_period(&params);
- unsigned long ft_rt = ft / rt / 4;
- int i;
+ rt = gc2145_sensor_params_get_row_period(&params);
+ ft = gc2145_sensor_params_get_frame_period(&params);
+ ft_rt = ft / rt / 4;
for (i = 0; i < 7; i++) {
// exposure settings for exposure levels
diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c
index 13ffb2541..129e62649 100644
--- a/drivers/media/i2c/ov5640.c
+++ b/drivers/media/i2c/ov5640.c
@@ -1746,6 +1746,7 @@ static int ov5640_set_mode(struct ov5640_dev *sensor)
bool auto_exp = sensor->ctrls.auto_exp->val == V4L2_EXPOSURE_AUTO;
unsigned long rate;
int ret;
+ u8 tmp;
dn_mode = mode->dn_mode;
orig_dn_mode = orig_mode->dn_mode;
@@ -1818,7 +1819,6 @@ static int ov5640_set_mode(struct ov5640_dev *sensor)
if (ret < 0)
return ret;
- u8 tmp;
ret = ov5640_read_reg(sensor, 0x5308, &tmp);
if (ret)
return ret;
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
index c94e1bbcf..28d4fe350 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
@@ -1307,7 +1307,7 @@ static int sun8i_dwmac_remove(struct platform_device *pdev)
static void sun8i_dwmac_shutdown(struct platform_device *pdev)
{
- struct net_device *ndev = dev_get_drvdata(&pdev->dev);;
+ struct net_device *ndev = dev_get_drvdata(&pdev->dev);
struct stmmac_priv *priv = netdev_priv(ndev);
struct sunxi_priv_data *gmac = priv->plat->bsp_priv;
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index c16ab5c34..b73a1ec67 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -453,6 +453,7 @@ static int pwm_backlight_probe(struct platform_device *pdev)
struct device_node *node = pdev->dev.of_node;
struct pwm_bl_data *pb;
struct pwm_state state, state_real;
+ u64 level;
unsigned int i;
int ret;
@@ -636,7 +637,7 @@ static int pwm_backlight_probe(struct platform_device *pdev)
* the brightness determined by the driver
*/
pwm_get_state(pb->pwm, &state);
- u64 level = (u64)state.duty_cycle * pb->scale;
+ level = (u64)state.duty_cycle * pb->scale;
do_div(level, (u64)state.period);
for (i = 0; i <= data->max_brightness; i++) {
--
2.26.2

View File

@@ -0,0 +1,66 @@
From 990399a1687415aca469645241ed270d38aef1ab Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Fri, 10 Nov 2017 14:33:28 +0100
Subject: [PATCH 123/467] 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 <megous@megous.com>
---
arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index d07e154d3..fd8ee8c81 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
@@ -195,6 +195,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 {
@@ -377,9 +387,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 {
@@ -402,7 +413,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.34.0

View File

@@ -0,0 +1,181 @@
From 8d227fdc3fba35c6442dd2f29cbaa425471a17a4 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Tue, 23 Jun 2020 19:43:24 +0200
Subject: [PATCH 137/467] 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 <megous@megous.com>
---
arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 101 +++++++++++++++++++++-
1 file changed, 99 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index d9281c8d3..b18a511aa 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/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>;
@@ -220,6 +230,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>;
};
@@ -228,6 +245,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";
};
@@ -288,6 +336,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";
@@ -509,7 +606,7 @@ &reg_drivevbus {
};
&reg_eldo1 {
- regulator-min-microvolt = <1200000>;
+ regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-name = "pvdd-nfc";
regulator-always-on;
@@ -522,7 +619,7 @@ &reg_eldo2 {
};
&reg_eldo3 {
- regulator-min-microvolt = <1200000>;
+ regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-name = "dvdd-csi-f";
};
--
2.34.0

View File

@@ -0,0 +1,32 @@
From 97a6c6528dd740cab34873fc879480afa46f2494 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Wed, 8 Nov 2017 21:57:45 +0100
Subject: [PATCH 139/467] ARM: dts: sun8i-a83t-tbs-a711: Add flash led support
---
arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index b18a511aa..5e90be7d0 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/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.34.0

View File

@@ -0,0 +1,61 @@
From 66914eeff37db376c0b8608d8722e48ed6f56e3f 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: [PATCH 125/467] 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 <megous@megous.com>
Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
---
arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index fd8ee8c81..36a72c001 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
@@ -123,7 +123,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>;
};
@@ -139,6 +139,17 @@ wifi_pwrseq: wifi_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.34.0

View File

@@ -0,0 +1,31 @@
From 1180ff151a6640182c2bf50bf429364e7b744b63 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Tue, 23 Jun 2020 19:15:37 +0200
Subject: [PATCH 133/467] 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 <megous@megous.com>
---
arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index 603918c62..d9281c8d3 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
@@ -273,6 +273,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.34.0

View File

@@ -0,0 +1,132 @@
From 4e708ab83cbc21d47c1fb5a86b64975972869e4e Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Sat, 22 Feb 2020 23:40:29 +0100
Subject: [PATCH 131/467] ARM: dts: sun8i-a83t-tbs-a711: Add sound support via
AC100 codec
...
Signed-off-by: Ondrej Jirman <megous@megous.com>
---
arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 85 +++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index 36a72c001..603918c62 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
@@ -150,6 +150,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 {
@@ -218,6 +286,12 @@ npc100: nfc@28 {
};
};
+&i2s0 {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2s0_pins>;
+};
+
&mmc0 {
vmmc-supply = <&reg_dcdc1>;
pinctrl-names = "default";
@@ -298,12 +372,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.34.0

View File

@@ -0,0 +1,40 @@
From 430b30597272af34e06a3b8c199813ffc07f2ca2 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Sat, 9 Nov 2019 23:55:48 +0100
Subject: [PATCH 117/467] 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 <megous@megous.com>
---
arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index fa4d28481..fc6eae25e 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
@@ -99,6 +99,11 @@ panel_input: endpoint {
};
};
+ vibrator {
+ compatible = "gpio-vibrator";
+ vcc-supply = <&reg_ldo_io1>;
+ };
+
reg_gps: reg-gps {
compatible = "regulator-fixed";
regulator-name = "gps";
--
2.34.0

View File

@@ -113,26 +113,35 @@
megous/dt-bindings-leds-Add-a-binding-for-AXP813-charger-le.patch
megous/leds-axp20x-Support-charger-LED-on-AXP20x-like-PMICs.patch
megous/ARM-dts-axp813-Add-charger-LED.patch
megous/ARM-dts-sun8i-a83t-tbs-a711-Enable-charging-LED.patch
megous/clk-sunxi-ng-Set-maximum-P-and-M-factors-to-1-for-H3.patch
megous/dt-bindings-input-gpio-vibrator-Don-t-require-enable.patch
megous/clk-sunxi-ng-Don-t-use-CPU-PLL-gating-and-CPUX-repar.patch
megous/input-gpio-vibra-Allow-to-use-vcc-supply-alone-to-co.patch
megous/armhf-dts-sun8i-h3-Use-my-own-more-aggressive-OPPs-on-.patch
megous/ARM-dts-sun8i-h3-Use-my-own-more-aggressive-OPPs-on-.patch
megous/ARM-dts-sun8i-a83t-tbs-a711-Add-support-for-the-vibr.patch
megous/arm64-dts-sun50i-h5-Use-my-own-more-aggressive-OPPs-.patch
megous/ARM-dts-sun8i-a83t-tbs-a711-Increase-voltage-on-the-.patch
megous/ARM-dts-sun8i-h3-orange-pi-pc-Increase-max-CPUX-volt.patch
megous/nfc-pn544-Add-support-for-VBAT-PVDD-regulators.patch
megous/arm64-dts-sun50i-h5-orangepi-pc2-Add-CPUX-regulator-.patch
megous/ARM-dts-sun8i-a83t-tbs-a711-Add-PN544-NFC-support.patch
megous/ARM-dts-sun8i-a83t-Improve-CPU-OPP-tables-go-up-to-1.patch
megous/ARM-dts-sun8i-a83t-tbs-a711-Add-powerup-down-support.patch
megous/cpufreq-sun50i-Show-detected-CPU-bin-for-easier-debu.patch
megous/ARM-dts-sun8i-a83t-Add-cedrus-video-codec-support-to.patch
megous/mailbox-Allow-to-run-mailbox-while-timekeeping-is-su.patch
megous/ARM-dts-suni-a83t-Add-i2s0-pins.patch
megous/ARM-sunxi-Add-experimental-suspend-to-memory-impleme.patch
megous/ARM-dts-sun8i-a83t-tbs-a711-Add-sound-support-via-AC.patch
megous/ARM-sunxi-sunxi_cpu0_hotplug_support_set-is-not-supp.patch
megous/ARM-dts-sun8i-a83t-tbs-a711-Add-regulators-to-the-ac.patch
megous/firmware-scpi-Add-support-for-sending-a-SCPI_CMD_SET.patch
megous/bluetooth-bcm-Restore-drive_rts_on_open-true-behavio.patch
megous/firmware-scpi-Don-t-probe-SCP-during-SCPI-driver-pro.patch
megous/ARM-dts-sun8i-a83t-tbs-a711-Add-camera-sensors-HM506.patch
megous/ARM-sunxi-Use-SCPI-to-send-suspend-message-to-SCP-on.patch
megous/ARM-dts-sun8i-a83t-tbs-a711-Add-flash-led-support.patch
megous/gnss-ubx-Send-soft-powerdown-message-on-suspend.patch
megous/mmc-add-delay-after-power-class-selection.patch
megous/input-sun4i-lradc-keys-Add-wakup-support.patch
@@ -249,6 +258,7 @@
megous/ARM-dts-sunxi-h3-h5-Add-SCPI-protocol.patch
megous/arm64-dts-allwinner-a64-Add-SCPI-protocol.patch
megous/arm64-dts-allwinner-h6-Add-SCPI-protocol.patch
megous/ARM-dts-sun8i-a83t-tbs-a711-Give-Linux-more-privileg.patch
megous/arm64-xor-Select-32regs-without-benchmark-to-speed-u.patch
megous/misc-modem-power-Power-manager-for-modems.patch
megous/misc-modem-power-Add-blocking-variant-of-sysfs-power.patch