device-pine64-pinephone: Enable jack detection (MR 1943)

Enable headset jack detection and automatic switching in the UCM
This commit is contained in:
Martijn Braam 2021-02-09 13:56:34 +01:00 committed by Bart Ribbers
parent 49a45c5567
commit 6fe006aa52
No known key found for this signature in database
GPG key ID: 699D16185DAFAE61
5 changed files with 48 additions and 10 deletions

View file

@ -5,7 +5,7 @@
# Co-Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=device-pine64-pinephone
pkgver=0.20
pkgrel=0
pkgrel=1
pkgdesc="PINE64 PinePhone"
url="https://postmarketos.org"
license="MIT"
@ -166,6 +166,6 @@ fa063e2863afc48e627acc1a5b213a81499ba1dd30325f74f118a44e3964aec7e597b1f4bd318b7c
0c81d758e1bcb56ed2cdaf91124121ebbd4dd7a5e25f02a7685b837faf660949d05f6b07b39a1c6a9ca22a7029cdcf3c6dac8f1038e37c8a34cb7c5702e9df51 setup-modem.sh.ofono
f4b5509fd6a8b23f3667f5e7262b3a19c607a37cb9eaf7d0e93eb826d45c26ec12df4810879bacb8e4042bb83cc80b2b436224c8d47b6d67361369a724bbf7ee sysrq.conf
b20d4fb9f08a1bbc1c12ce6940e438a00f5c8d400fbc5071e951ffc69f77d2421204472e86f1a7df0488d250f3ec16205b75d4eac8c3cb5521fe9a02ea24865a uboot-script.cmd
420c0053c7eb115065a2a30ce7e669f05bda0dd7f416633e4917ed50db46a52ce0b613b2452bcd12d2813cf0401b0a1b489306b0f0e77e5b46a2a2e46368d6a2 HiFi.conf
de88fc198c11637d9c6465f8a6fb4deab3d0802bdb52ffaa9a08833aa0ef63689b674b12b44cb314f3870d9d21fc3ae55f8db03c9a838860301be60a88e48835 HiFi.conf
e852b48a687f9b2a0eca444aa3d00a1818aead9f5e5d28e070b51c9d6f8ec648e66f1d88e2bfa94d74533f9ffb9aacc1703da2a06693f85fa04ff97fd7528012 PinePhone.conf
5bb910286b2e224aaee0bc08d18d75d9d6466f6c83ef8939036cf0f6aba6a8bcb56d114002d88eb6ed8266d03ee599fbac2f5b43e786b86b7c2eda10547a3878 VoiceCall.conf"
6c6ffd481a1ac66864f2c713ac4c16c8e112e49a6bc2ff3bb0d492426504cad0e953275a8ed13f247ef8c95bdd1814d9aea934ff76bb4dfada6b1b7b2eedea19 VoiceCall.conf"

View file

@ -96,7 +96,7 @@ SectionDevice."Mic" {
cset "name='Mic1 Capture Switch' off"
]
Value {
CapturePriority 500
CapturePriority 100
CapturePCM "hw:${CardId},0"
CaptureChannels 2
}
@ -113,9 +113,10 @@ SectionDevice."Headset" {
cset "name='Mic2 Capture Switch' off"
]
Value {
CapturePriority 100
CapturePriority 500
CapturePCM "hw:${CardId},0"
CaptureChannels 2
JackControl "Headset Microphone Jack"
}
}
SectionDevice."Headphones" {
@ -134,7 +135,8 @@ SectionDevice."Headphones" {
PlaybackVolume "Headphone Playback Volume"
PlaybackSwitch "Headphone Playback Switch"
PlaybackChannels 2
PlaybackPriority 100
PlaybackPriority 500
PlaybackPCM "hw:${CardId},0"
JackControl "Headset Microphone Jack"
}
}

View file

@ -118,9 +118,10 @@ SectionDevice."Headset" {
cset "name='Mic2 Capture Switch' off"
]
Value {
CapturePriority 100
CapturePriority 500
CapturePCM "hw:${CardId},0"
CaptureChannels 2
JackControl "Headset Microphone Jack"
}
}
SectionDevice."Headphones" {
@ -139,7 +140,8 @@ SectionDevice."Headphones" {
PlaybackVolume "Headphone Playback Volume"
PlaybackSwitch "Headphone Playback Switch"
PlaybackChannels 2
PlaybackPriority 100
PlaybackPriority 500
PlaybackPCM "hw:${CardId},0"
JackControl "Headset Microphone Jack"
}
}

View file

@ -0,0 +1,32 @@
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index 086b5ebfa512..b4a71b02c474 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -304,11 +304,13 @@ &codec {
pinctrl-names = "default";
pinctrl-0 = <&aif2_pins>, <&aif3_pins>;
status = "okay";
+ allwinner,inverted-jack-detection;
};
&codec_analog {
cpvdd-supply = <&reg_eldo1>;
status = "okay";
+ allwinner,internal-bias-resistor;
};
&cpu0 {
@@ -758,11 +760,11 @@ &sound {
simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>;
simple-audio-card,widgets = "Microphone", "Headset Microphone",
"Microphone", "Internal Microphone",
- "Headphone", "Headphone Jack",
+ "Headphone", "Headphone",
"Speaker", "Internal Earpiece",
"Speaker", "Internal Speaker";
simple-audio-card,routing =
- "Headphone Jack", "HP",
+ "Headphone", "HP",
"Internal Earpiece", "EARPIECE",
"Internal Speaker", "Speaker Amp OUTL",
"Internal Speaker", "Speaker Amp OUTR",

View file

@ -6,7 +6,7 @@ _flavor=postmarketos-allwinner
_config="config-$_flavor.$CARCH"
pkgname=linux-$_flavor
pkgver=5.10.12_git20210130
pkgrel=2
pkgrel=3
_tag="orange-pi-5.10-20210130-2109"
pkgdesc="Kernel fork with Pine64 patches (megi's tree, slightly patched)"
arch="aarch64"
@ -37,6 +37,7 @@ source="$pkgname-$_tag.tar.gz::https://github.com/megous/linux/archive/$_tag.tar
0009-leds-gpio-set-max_brightness-to-1.patch
0010-dts-pinephone-Add-pine64-pinephone-to-compat-list.patch
0011-dts-pinephone-drop-modem-power-node.patch
0012-dts-headphone-jack-detection.patch
"
subpackages="$pkgname-dev"
builddir="$srcdir/linux-$_tag"
@ -88,4 +89,5 @@ sha512sums="3cbab8dfc280cdbdfb84f028a41c649e43d57841e4cf9dd8c1476f07b733fc397558
510e1cf463485315f99dfc86511fb7271591159c39cf1bbeecbc1056f8861c35603d61946f3488bfbb7a779ce9324c69d230fa159386b7920f866b47ada444a4 0008-media-ov5640-Implement-autofocus.patch
6dee374e8459279e2e61894ab9146574283dad61605e4547a1258dd09e02646e46712059431b4086aebb95d24ab44c8b5dc21aa9d004f0190f864045a20b336a 0009-leds-gpio-set-max_brightness-to-1.patch
27c091b4fd306b5f6fbadac5881ecc5465804ea910eb299445f7d4f04d09e05b8cb708bf4ac24f9ae2a77afa287bfbebe691f6d90db189896c6951ff8f30bcf5 0010-dts-pinephone-Add-pine64-pinephone-to-compat-list.patch
1d0683871027bd13e03e469fc23c3394b3dbfb48115e19b03638f68970ccfa9583b70ab21d76e68973af803d5387f474f4fe58c90e58985f96c6aec8489aa96a 0011-dts-pinephone-drop-modem-power-node.patch"
1d0683871027bd13e03e469fc23c3394b3dbfb48115e19b03638f68970ccfa9583b70ab21d76e68973af803d5387f474f4fe58c90e58985f96c6aec8489aa96a 0011-dts-pinephone-drop-modem-power-node.patch
c93490ebfd7405df2784d78b45bc7ddf985cfa270d0d94c054002f582541f11d28fe216db849cae99d78c3250187d667f305f8a4848d505d0a69a0cbc559be82 0012-dts-headphone-jack-detection.patch"