diff options
author | dragonn | 2021-05-15 21:02:31 +0200 |
---|---|---|
committer | dragonn | 2021-05-15 21:02:31 +0200 |
commit | ae281f1495751a91c08a269a6d12fb29b7ae25c1 (patch) | |
tree | 875378973ece57890c1c3f8dd883666245a288d3 | |
parent | 6b88a5ca6b51a67c938256f3680925f2e66ab00f (diff) | |
download | aur-ae281f1495751a91c08a269a6d12fb29b7ae25c1.tar.gz |
5.12.4
-rw-r--r-- | .SRCINFO | 12 | ||||
-rw-r--r-- | 5.12.4--Add-jack-toggle-support-for-headphones-on-Asus-ROG-Z.patch | 94 | ||||
-rw-r--r-- | PKGBUILD | 67 |
3 files changed, 156 insertions, 17 deletions
@@ -1,7 +1,7 @@ pkgbase = linux-g14 pkgdesc = Linux - pkgver = 5.12.2.arch1 - pkgrel = 2 + pkgver = 5.12.4.arch1 + pkgrel = 1 url = https://lab.retarded.farm/zappel/asus-rog-zephyrus-g14/ arch = x86_64 license = GPL2 @@ -12,11 +12,12 @@ pkgbase = linux-g14 makedepends = xmlto makedepends = git options = !strip - source = archlinux-linux::git+https://git.archlinux.org/linux.git?signed#tag=v5.12.2-arch1 + source = archlinux-linux::git+https://git.archlinux.org/linux.git?signed#tag=v5.12.4-arch1 source = config source = sys-kernel_arch-sources-g14_files_6008-HID-asus-Filter-keyboard-EC-for-old-ROG-keyboard.patch source = sys-kernel_arch-sources-g14_files-6010-acpi_unused.patch - source = https://gitlab.com/asus-linux/fedora-kernel/-/archive/50c4293d202534b2773149500aac51f13fd76c9b/fedora-kernel-50c4293d202534b2773149500aac51f13fd76c9b.zip + source = https://gitlab.com/asus-linux/fedora-kernel/-/archive/29f433a6b9ba268b0202ac8200cf2ce38d6071b7/fedora-kernel-29f433a6b9ba268b0202ac8200cf2ce38d6071b7.zip + source = 5.12.4--Add-jack-toggle-support-for-headphones-on-Asus-ROG-Z.patch validpgpkeys = ABAF11C65A2970B130ABE3C479BE3E4300411886 validpgpkeys = 647F28654894E3BD457199BE38DBBDC86092693E validpgpkeys = A2FF3A36AAA56654109064AB19802F8B0D70FC30 @@ -24,7 +25,8 @@ pkgbase = linux-g14 sha256sums = bcb8a47c2396af9a2afcd26d1200f9424d2af0fa6f6749d3c09417a919f5c60c sha256sums = d9f5742fed4406396698897aa042d4d5fdbfd7c51add7483a777f9ab41901aac sha256sums = c384049787c8f0008accf9c4d053eb407b76242fe522e1aed1fe8a9c59f9d996 - sha256sums = 9554d5c1939ec7b8da344f29ae09ea56345316856cfe821bf4415048e6c70192 + sha256sums = ce2a5e79ed29c701529f0aa2d854bab79d9f5cbdd173e13774f6e1f4e8ae585f + sha256sums = f52aadc1ebcdc118bb50769e4f5a4c036521c09ffecba48cb34392e1a687ac0a pkgname = linux-g14 pkgdesc = The Linux kernel and modules diff --git a/5.12.4--Add-jack-toggle-support-for-headphones-on-Asus-ROG-Z.patch b/5.12.4--Add-jack-toggle-support-for-headphones-on-Asus-ROG-Z.patch new file mode 100644 index 000000000000..cfb792776657 --- /dev/null +++ b/5.12.4--Add-jack-toggle-support-for-headphones-on-Asus-ROG-Z.patch @@ -0,0 +1,94 @@ +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c +index 8ec57bd351df..b1d965743282 100644 +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -6232,6 +6232,35 @@ static void alc294_fixup_gx502_hp(struct hda_codec *codec, + } + } + ++static void alc294_gu502_toggle_output(struct hda_codec *codec, ++ struct hda_jack_callback *cb) ++{ ++ /* Windows sets 0x10 to 0x8420 for Node 0x20 which is ++ * responsible from changes between speakers and headphones ++ */ ++ if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT) ++ alc_write_coef_idx(codec, 0x10, 0x8420); ++ else ++ alc_write_coef_idx(codec, 0x10, 0x0a20); ++} ++ ++static void alc294_fixup_gu502_hp(struct hda_codec *codec, ++ const struct hda_fixup *fix, int action) ++{ ++ if (!is_jack_detectable(codec, 0x21)) ++ return; ++ ++ switch (action) { ++ case HDA_FIXUP_ACT_PRE_PROBE: ++ snd_hda_jack_detect_enable_callback(codec, 0x21, ++ alc294_gu502_toggle_output); ++ break; ++ case HDA_FIXUP_ACT_INIT: ++ alc294_gu502_toggle_output(codec, NULL); ++ break; ++ } ++} ++ + static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec, + const struct hda_fixup *fix, int action) + { +@@ -6446,6 +6475,9 @@ enum { + ALC294_FIXUP_ASUS_GX502_HP, + ALC294_FIXUP_ASUS_GX502_PINS, + ALC294_FIXUP_ASUS_GX502_VERBS, ++ ALC294_FIXUP_ASUS_GU502_HP, ++ ALC294_FIXUP_ASUS_GU502_PINS, ++ ALC294_FIXUP_ASUS_GU502_VERBS, + ALC285_FIXUP_HP_GPIO_LED, + ALC285_FIXUP_HP_MUTE_LED, + ALC236_FIXUP_HP_GPIO_LED, +@@ -7683,6 +7715,35 @@ static const struct hda_fixup alc269_fixups[] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc294_fixup_gx502_hp, + }, ++ [ALC294_FIXUP_ASUS_GU502_PINS] = { ++ .type = HDA_FIXUP_PINS, ++ .v.pins = (const struct hda_pintbl[]) { ++ { 0x19, 0x01a11050 }, /* rear HP mic */ ++ { 0x1a, 0x01a11830 }, /* rear external mic */ ++ { 0x21, 0x012110f0 }, /* rear HP out */ ++ { } ++ }, ++ .chained = true, ++ .chain_id = ALC294_FIXUP_ASUS_GU502_VERBS ++ }, ++ [ALC294_FIXUP_ASUS_GU502_VERBS] = { ++ .type = HDA_FIXUP_VERBS, ++ .v.verbs = (const struct hda_verb[]) { ++ /* set 0x15 to HP-OUT ctrl */ ++ { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 }, ++ /* unmute the 0x15 amp */ ++ { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 }, ++ /* set 0x1b to HP-OUT */ ++ { 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 }, ++ { } ++ }, ++ .chained = true, ++ .chain_id = ALC294_FIXUP_ASUS_GU502_HP ++ }, ++ [ALC294_FIXUP_ASUS_GU502_HP] = { ++ .type = HDA_FIXUP_FUNC, ++ .v.func = alc294_fixup_gu502_hp, ++ }, + [ALC294_FIXUP_ASUS_COEF_1B] = { + .type = HDA_FIXUP_VERBS, + .v.verbs = (const struct hda_verb[]) { +@@ -8173,6 +8234,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { + SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), + SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK), + SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS), ++ SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS), + SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC), + SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC), + SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE), @@ -1,8 +1,8 @@ # Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com> pkgbase=linux-g14 -pkgver=5.12.2.arch1 -pkgrel=2 +pkgver=5.12.4.arch1 +pkgrel=1 pkgdesc='Linux' _srctag=v${pkgver%.*}-${pkgver##*.} url="https://lab.retarded.farm/zappel/asus-rog-zephyrus-g14/" @@ -15,13 +15,14 @@ makedepends=( ) options=('!strip') _srcname=archlinux-linux -_fedora_kernel_commit_id=50c4293d202534b2773149500aac51f13fd76c9b +_fedora_kernel_commit_id=29f433a6b9ba268b0202ac8200cf2ce38d6071b7 source=( "$_srcname::git+https://git.archlinux.org/linux.git?signed#tag=$_srctag" config # the main kernel config file "sys-kernel_arch-sources-g14_files_6008-HID-asus-Filter-keyboard-EC-for-old-ROG-keyboard.patch" "sys-kernel_arch-sources-g14_files-6010-acpi_unused.patch" "https://gitlab.com/asus-linux/fedora-kernel/-/archive/$_fedora_kernel_commit_id/fedora-kernel-$_fedora_kernel_commit_id.zip" + "5.12.4--Add-jack-toggle-support-for-headphones-on-Asus-ROG-Z.patch" ) validpgpkeys=( 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds @@ -33,12 +34,38 @@ sha256sums=('SKIP' 'bcb8a47c2396af9a2afcd26d1200f9424d2af0fa6f6749d3c09417a919f5c60c' 'd9f5742fed4406396698897aa042d4d5fdbfd7c51add7483a777f9ab41901aac' 'c384049787c8f0008accf9c4d053eb407b76242fe522e1aed1fe8a9c59f9d996' - '9554d5c1939ec7b8da344f29ae09ea56345316856cfe821bf4415048e6c70192') + 'ce2a5e79ed29c701529f0aa2d854bab79d9f5cbdd173e13774f6e1f4e8ae585f' + 'f52aadc1ebcdc118bb50769e4f5a4c036521c09ffecba48cb34392e1a687ac0a') + +_fedora_kernel_patch_skip_list=( + # fedora kernel patches to skip + # use plain file names or bash glob syntax, ** don't quote globs ** + + # multi-select and ranges examples + #00{03,05,08}-drm-amdgpu*.patch + #00{01..12}-drm-amdgpu*.patch + + "linux-kernel-test.patch" # test patch, please ignore + patch-*-redhat.patch # wildcard match any redhat patch version + 00{01..12}-drm-amdgpu*.patch # upstreamed in 5.12 + + # upstreamed + "0001-HID-asus-Filter-keyboard-EC-for-old-ROG-keyboard.patch" + "0001-ALSA-hda-realtek-GA503-use-same-quirks-as-GA401.patch" + + # patch broken in 5.12.4, updated and included in package sources + "0001-Add-jack-toggle-support-for-headphones-on-Asus-ROG-Z.patch" +) export KBUILD_BUILD_HOST=archlinux export KBUILD_BUILD_USER=$pkgbase export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" +_fedora_patch_in_skip_list() { + for p in "${_fedora_kernel_patch_skip_list[@]}"; do [[ "$1" == $p ]] && return 0; done + return 1 +} + prepare() { cd $_srcname @@ -56,17 +83,33 @@ prepare() { patch -Np1 < "../$src" done - for src in ../fedora-kernel-$_fedora_kernel_commit_id/*.patch; do - src="${src%%::*}" + msg2 "Applying asus-linux patches..." + local p_err=() + local p_meh=() + + # this will apply only enabled patches from the fedora-linux kernel.spec + # this stops us from applying broken or in-progress patches that are in git but aren't actually in use + + local _fkernel_path="../fedora-kernel-${_fedora_kernel_commit_id}" + for src in $(awk -F ' ' '/^ApplyOptionalPatch.*patch$/{print $2}' "${_fkernel_path}/kernel.spec"); do src="${src##*/}" - [[ $src = *.patch ]] || continue - if [ "$src" != "0001-drm-amdgpu-use-runpm-flag-rather-than-fbcon-for-kfd-.patch" ] && - [ "$src" != "0006-drm-amdgpu-move-s0ix-check-into-amdgpu_device_ip_sus.patch" ] && - [ "$src" != "patch-5.11-redhat.patch" ]; then - echo "Applying patch $src..." - OUT="$(patch --forward -Np1 < "../fedora-kernel-$_fedora_kernel_commit_id/$src")" || echo "${OUT}" | grep "Skipping patch" -q || (echo "$OUT" && false); + _fedora_patch_in_skip_list "$src" && continue + echo "Applying patch $src..." + if OUT="$(patch --forward -Np1 < "${_fkernel_path}/$src")"; then + : #plain "Applied patch $src..." + else + # if you want to ignore a specific patch failure for some reason do it right here, then 'continue' + if { echo "$OUT" | grep -qiE 'hunk(|s) FAILED'; }; then + error "Patch failed $src" && echo "$OUT" && p_err+=("$src") && _throw=y + else + warning "Duplicate patch $src" && p_meh+=("$src") + fi fi done + (( ${#p_err[@]} > 0 )) && error "Failed patches:" && for p in ${p_err[@]}; do plain "$p"; done + (( ${#p_meh[@]} > 0 )) && warning "Duplicate patches:" && for p in ${p_meh[@]}; do plain "$p"; done + # if throw is defined we had a hard patch failure, propagate it and stop so we can address + [[ -z "$_throw" ]] echo "Setting config..." cp ../config .config |