feat: Add aw87xxx codec for AyaNeo/Ayn/Orange Pi handheld speaker amplifiers - #102
feat: Add aw87xxx codec for AyaNeo/Ayn/Orange Pi handheld speaker amplifiers#102hijae wants to merge 2 commits into
Conversation
…re selection Adds the Awinic AW87XXX Smart K PA codec driver, ported from hhd-dev/patchwork. This chip is used as the speaker amplifier on several handhelds (AyaNeo Flip KB/DS, AIR 1S, AIR Plus, Kun; Ayn Loki MiniPro; Orange Pi NEO-01 per the DMI match table below), none of which currently have audio output without this driver. Verified on AyaNeo Flip KB. Includes DMI-based firmware filename selection so multiple devices' firmware blobs can coexist under /lib/firmware without collision. Co-developed-by: bouhaa <boukehaarsma23@gmail.com> Co-developed-by: Antheas Kapenekakis <git@antheas.dev> Signed-off-by: Hijae Song <hijae@naver.com>
linux/of_gpio.h has been removed from the tree. None of these files actually use anything from it (no of_gpio_* calls), so drop the dead include to fix the build. Signed-off-by: Hijae Song <hijae@naver.com>
|
Companion PR enabling this in the build config: OpenGamingCollective/kernel-packages#36 — |
|
Are we planning to upstream this, or rework it before hand? Authorship makes it somewhat of a challenge. |
CONFIG_SND_SOC_AW87XXX is added by OpenGamingCollective/linux#102. Enable it as a module so it's actually built. Signed-off-by: Hijae Song <hijae@naver.com>
|
For the AYANEO Air 1S another quirk in the ALC269 codec is necessary to fix audio output. I commented on the initial bug report in @hijae Do you want to include a fix for that in this PR as well or should this be done via a separate PR? Working patch to fix audio output on the AYANEO Air 1SI went back and forth with an LLM to write this, but I am neither a kernel contributor nor am I experienced in C. I understand the code, but I do not understand why This fix is should even be safer than the upstream one as we are only targeting the Air 1S specifically. diff --git a/sound/hda/codecs/realtek/alc269.c b/sound/hda/codecs/realtek/alc269.c
index cae327e1d9..390bf19966 100644
--- a/sound/hda/codecs/realtek/alc269.c
+++ b/sound/hda/codecs/realtek/alc269.c
@@ -3998,6 +3998,7 @@
ALC269VB_FIXUP_ASUS_ZENBOOK,
ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE,
+ ALC269_FIXUP_AYANEO_AIR_1S,
ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
ALC269VB_FIXUP_ORDISSIMO_EVE2,
ALC283_FIXUP_CHROME_BOOK,
@@ -4299,6 +4300,19 @@
ALC285_LENOVO_DAC_RENAME,
};
+static void alc269_fixup_ayaneo_air_1s(struct hda_codec *codec,
+ const struct hda_fixup *fix, int action)
+{
+ if (action != HDA_FIXUP_ACT_PRE_PROBE)
+ return;
+
+ if (!dmi_match(DMI_SYS_VENDOR, "AYANEO") ||
+ !dmi_match(DMI_PRODUCT_NAME, "AIR 1S"))
+ return;
+
+ snd_hda_codec_set_pincfg(codec, 0x1a, 0x90170110);
+}
+
/* A special fixup for Lenovo C940 and Yoga Duet 7;
* both have the very same PCI SSID, and we need to apply different fixups
* depending on the codec ID
@@ -4530,6 +4544,10 @@
{ }
},
},
+ [ALC269_FIXUP_AYANEO_AIR_1S] = {
+ .type = HDA_FIXUP_FUNC,
+ .v.func = alc269_fixup_ayaneo_air_1s,
+ },
[ALC269_FIXUP_AMIC] = {
.type = HDA_FIXUP_PINS,
.v.pins = (const struct hda_pintbl[]) {
@@ -8213,6 +8231,7 @@
SND_PCI_QUIRK(0x1f4c, 0xb020, "Minisforum AI X1 Pro",
ALC245_FIXUP_MINISFORUM_JACK_DETECT),
SND_PCI_QUIRK(0x1f4c, 0xe001, "Minisforum V3 (SE)", ALC245_FIXUP_BASS_HP_DAC),
+ SND_PCI_QUIRK(0x1f66, 0x0103, "AYANEO AIR 1S", ALC269_FIXUP_AYANEO_AIR_1S),
SND_PCI_QUIRK(0x1f66, 0x0105, "Ayaneo Portable Game Player", ALC287_FIXUP_CS35L41_I2C_2),
SND_PCI_QUIRK(0x2014, 0x800a, "Positivo ARN50", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
SND_PCI_QUIRK(0x2039, 0x0001, "Inspur S14-G1", ALC295_FIXUP_CHROME_BOOK), |
|
@bl1nk |
|
We'll most likely carry this patch as it is needed for many devices. The authorship issue is administrative. I asked bl1nk to see if you could cherry-pick that patch as well. It will depend on these being merged so it makes it simpler to include. |
Context
Several handhelds (AyaNeo Flip KB/DS, AIR 1S, AIR Plus, Kun; Ayn Loki MiniPro; Orange Pi NEO-01) use the Awinic AW87XXX Smart K PA as their speaker amplifier, identified over ACPI as AWDZ8830. Mainline Linux has no driver for this chip — the closest match (aw87390.c) doesn't recognize it. Without this driver these devices have no speaker output at all.
This driver was lost when Bazzite's kernel source switched to OGC, unrelated to the driver itself. Ported here referencing ChimeraOS's kernel, which carries the same driver. See ublue-os/bazzite#5374 for the resulting regression report (AyaNeo AIR 1S, no audio since the kernel switch).
Changes
linux/of_gpio.hinclude (header no longer exists in this tree) so it builds on current kernels.Testing
Built out-of-tree against this branch's exact source (kernel-devel 7.2.0-ogc4.1) and verified on real AyaNeo Flip KB hardware — chip probes correctly (chip_id 0x5a, product aw87559), and speaker audio works, including after a fresh reboot.