[PATCH] arm64: dts: rockchip: Add pa_en pinctrl to clockworkpi-a06 for speaker amplifier toggling
This probably still depends on some alsa-ucm-conf changes I'm making for this, but this will now allow for the Speaker Amp to be properly disabled via the "Speaker Switch". With the alsa-ucm-conf changes I'm making, it enables speaker to correctly turn off when plugging in headphones and vice-versa when unplugging headphones. It also fixes the speaker pop on power-off as well (again, possibly dependent on the alsa-ucm-conf changes)
Click to expand patch
From 87368f2ccc851b429c585dcfadc2ec78dc1caf71 Mon Sep 17 00:00:00 2001
From: Max Fierke <max@maxfierke.com>
Date: Sat, 8 Jan 2022 13:43:34 -0600
Subject: [PATCH] arm64: dts: rockchip: Add pa_en pinctrl to clockworkpi-a06
for speaker amplifier toggling
---
0001-arm64-dts-clockworkpi-a06-dts.patch | 35 +++++++++++++-----------
PKGBUILD | 2 +-
2 files changed, 20 insertions(+), 17 deletions(-)
diff --git a/0001-arm64-dts-clockworkpi-a06-dts.patch b/0001-arm64-dts-clockworkpi-a06-dts.patch
index 5661bb8..3c486c9 100644
--- a/0001-arm64-dts-clockworkpi-a06-dts.patch
+++ b/0001-arm64-dts-clockworkpi-a06-dts.patch
@@ -15,7 +15,7 @@ new file mode 100644
index 000000000..1c8fb451a
--- /dev/null
+++ b/arch/arm64/boot/dts/rockchip/rk3399-clockworkpi-a06.dts 2021-12-05 20:46:08.851233995 -0600
-@@ -0,0 +1,985 @@
+@@ -0,0 +1,989 @@
+/*
+ * SPDX-License-Identifier: (GPL-2.0+ or MIT)
+ * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd.
@@ -190,34 +190,36 @@ index 000000000..1c8fb451a
+ simple-audio-card,pin-switches = "Speaker";
+
+ simple-audio-card,cpu {
-+ sound-dai = <&i2s0>;
-+ system-clock-frequency = <11289600>;
++ sound-dai = <&i2s0>;
++ system-clock-frequency = <11289600>;
+ };
+ simple-audio-card,codec {
-+ sound-dai = <&es8388>;
-+ system-clock-frequency = <11289600>;
++ sound-dai = <&es8388>;
++ system-clock-frequency = <11289600>;
+ };
+ };
+
+ speaker_amp: speaker-amplifier {
+ compatible = "simple-audio-amplifier";
++ pinctrl-names = "default";
++ pinctrl-0 = <&pa_en>;
+ enable-gpios = <&gpio3 RK_PB1 GPIO_ACTIVE_HIGH>;
+ sound-name-prefix = "Speaker Amplifier";
+ VCC-supply = <&vcc5v0_sys>;
+ };
+
+ battery: battery@0 {
-+ compatible = "simple-battery";
-+ constant-charge-current-max-microamp = <2100000>;
-+ voltage-min-design-microvolt = <3300000>;
++ compatible = "simple-battery";
++ constant-charge-current-max-microamp = <2100000>;
++ voltage-min-design-microvolt = <3300000>;
+ };
+
+ ocp8178_backlight: backlight@0 {
-+ compatible = "ocp8178-backlight";
-+ backlight-control-gpios = <&gpio4 RK_PD6 GPIO_ACTIVE_HIGH>;
-+ default-brightness = <5>;
-+ pinctrl-names = "default";
-+ pinctrl-0 = <&backlight_control>;
++ compatible = "ocp8178-backlight";
++ backlight-control-gpios = <&gpio4 RK_PD6 GPIO_ACTIVE_HIGH>;
++ default-brightness = <5>;
++ pinctrl-names = "default";
++ pinctrl-0 = <&backlight_control>;
+ };
+
+};
@@ -606,9 +608,6 @@ index 000000000..1c8fb451a
+ compatible = "everest,es8388", "everest,es8328";
+ status = "okay";
+ reg = <0x11>;
-+ // audio-switch-gpio = <&gpio4 27 GPIO_ACTIVE_HIGH>;
-+ // hp-det-gpio = <&gpio4 28 GPIO_ACTIVE_HIGH>;
-+ // spk-ctl-gpio = <&gpio3 9 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&audio_switch>;
+ DVDD-supply = <&vcca1v8_codec>;
@@ -999,6 +998,10 @@ index 000000000..1c8fb451a
+ hp_det: hp-det {
+ rockchip,pins = <4 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
++
++ pa_en: pa-en {
++ rockchip,pins = <3 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
++ };
+ };
+};
+
diff --git a/PKGBUILD b/PKGBUILD
index 3847e4f..5883a6c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -33,7 +33,7 @@ md5sums=('071d49ff4e020d58c04f9f3f76d3b594'
'9e6b7f44db105fef525d715213dce7cf'
'e2f08e3bc6d1b36e7000233abab1bfc7'
'a897b51be2d05ddb5b7b1a7a7f5a5205'
- 'd93f1605366fab999c80e28e1a3d1370'
+ 'eea25fcfce96e8d40c058883764903ce'
'fc826c917102f2f2d16690fe9322464f'
'd19290c5ba9e9ded60770a04c08ef9ca'
'3203d018422505068fc22b909df871aa'
--
2.34.1
0001-arm64-dts-rockchip-Add-pa_en-pinctrl-to-clockworkpi-.patch