linux/Documentation
Mark Brown 62dc2554d3
ASoC: qcom: audioreach: support WSA speakers only on WSA2
Neil Armstrong <neil.armstrong@linaro.org> says:

The Qualcom SM8650 based Ayaneo Pocket S2 gaming device has a set
of 2 WSA speakers connected on the WSA2 lines.

But the Audioreach DSP only handles WSA2 in pair with the WSA
interface by using the upper bits of the active_channels_mask
for WSA2 and the lower bits for WSA:

 __________________________________________________
| Bits  |     3    |     2    |   1     |     0   |
---------------------------------------------------
| Line  | WSA2 Ch2 | WSA2 Ch1 | WSA Ch2 | WSA Ch1 |
---------------------------------------------------

Setting only the WSA2 upper bits is perfectly valid and
functional but the current Audioreach code builds the bitmask
from the channels count with:
	active_channels_mask = (1 << num_channels) - 1;

In order to enable the WSA2 bits the channel count should be 4,
but the lower WSA bits are then also enabled and the DSP errors
out when trying to play on the disabled WSA interface.

A solution would've been to add a fake WSA2 topology element which
would be translated into the top bits only, but it's not clean and
add some special exceptions in the generic Audioreach code.

The solution suggested by Srinivas is to use the channel mapping to
set this bitmask.

This works but makes all the other calls using the channel mapping fail
because the DSP requires the channel_mapping table to start from index 0
and using num_channel length in order to apply the mapping on the
active_channels_mask bits in order.

So if you have an active_channels_mask like:
 _______________________
| Bits  | 3 | 2 | 1 | 0 |
-------------------------
| Mask  | 1 | 1 | 0 | 0 |
------------------------

And the channel mapping:
 _________________________________
| Channel |  3 |  2 |   1  |   0  |
-----------------------------------
| Mapping | FR | FL | NULL | NULL |
-----------------------------------

Will need to be converted to:
 ____________________
| Channel |  1 |  0 |
---------------------
| Mapping | FR | FL |
---------------------

And the DSP will map FR on WSA2 Ch2 and FL on WSA2 Ch1 as:
 _________________________________
| Line    |  WSA2 Ch2 | WSA2 Ch1 |
----------------------------------
| Mapping |     FR    |     FL   |
----------------------------------

So we need to skip the empty channel mapping entries in all other
users of the channel_map to build valid channel_mapping tables.

This should not break any other usecases since the default channel
mapping always start from index 0, and will add flexibilty to allow
some special non linear mapping for other interfaces as well.

Finally we add a special prepare callback for the Ayaneo PS2 sound card
which sets the custom channel mapping for the WSA interface to make audio
work properly on the gaming device.

Link: https://patch.msgid.link/20260728-topic-sm8650-ayaneo-pocket-s2-wsa2-fix-v3-0-b29f44720178@linaro.org
2026-07-31 13:28:42 +01:00
..
ABI 12 hotfixes. 8 are cc:stable and the remainder address post-7.1 issues or 2026-07-20 13:04:47 -07:00
accel
accounting
admin-guide Docs/admin-guide/cgroup-v2: note blkcg_debug_stats gates io.latency stats 2026-07-07 12:26:23 -10:00
arch RISC-V updates for v7.2-rc3 2026-07-12 11:25:40 -07:00
block for-7.2/block-20260615 2026-06-16 13:02:47 +05:30
bpf Documentation/bpf: Refresh map_lru_hash_update.dot for rqspinlock 2026-06-07 18:46:13 -07:00
cdrom
core-api liveupdate: updates for 7.2-rc1 2026-06-21 09:46:14 -07:00
cpu-freq cpufreq: Use policy->min/max init as QoS request 2026-06-08 18:42:14 +02:00
crypto lib/crypto: docs: Improve introduction sentence 2026-07-09 11:06:05 -04:00
dev-tools linux_kselftest-next-7.2-rc1-second 2026-06-23 07:35:37 -07:00
devicetree ASoC: qcom: audioreach: support WSA speakers only on WSA2 2026-07-31 13:28:42 +01:00
doc-guide
driver-api A handful of late-arriving docs fixes, along with one document update 2026-06-25 09:09:38 -07:00
edac
fault-injection
fb
features LoongArch: Add THREAD_INFO_IN_TASK implementation 2026-06-25 13:03:47 +08:00
filesystems ksmbd: doc: update feature support status for durable handles and compression 2026-06-30 21:29:46 -05:00
firmware_class
firmware-guide
fpga
gpu drm-next for 7.2-rc1 2026-06-17 10:21:00 +01:00
hid
hwmon docs: hwmon: ltc4283: fix malformed table docs build error 2026-06-29 08:47:44 -07:00
i2c
iio docs: iio: adc: ad4691: add driver documentation 2026-05-31 11:14:22 +01:00
images
infiniband docs: infiniband: correct name of option to enable the ib_uverbs module 2026-06-16 14:47:24 -03:00
input Input: userio - allow setting other id values 2026-06-01 21:49:14 -07:00
kbuild kconfig: add optional warnings for changed input values 2026-06-18 11:46:32 -07:00
kernel-hacking
leds LEDs for v7.2 2026-06-18 14:45:08 -07:00
litmus-tests
livepatch
locking Things have calmed down a bit on the docs front, with no earthshaking 2026-06-16 08:35:59 +05:30
maintainer
mhi
misc-devices
mm A handful of late-arriving docs fixes, along with one document update 2026-06-25 09:09:38 -07:00
netlabel
netlink netlink: specs: rt-link: convert bridge port flag attributes to u8 2026-07-20 18:14:42 -07:00
networking vlan: defer real device state propagation to netdev_work 2026-06-25 10:18:40 -07:00
nvdimm
nvme
PCI
pcmcia
peci
power
process MAINTAINERS: update ndesaulniers 2026-07-06 15:49:29 -07:00
RCU
rust s390 updates for 7.2 merge window 2026-06-16 05:08:13 +05:30
scheduler sched_ext: Documentation: Fix ops table header reference 2026-07-07 12:23:33 -10:00
scsi
security integrity-v7.2 2026-06-19 11:32:05 -07:00
sound Documentation: sound: tas675x: Fix temperature range and impedance documentation 2026-07-01 19:52:38 +01:00
sphinx docs: maintainers_include: keep the last entry at the end 2026-05-25 14:24:09 -06:00
sphinx-includes
sphinx-static
spi
staging
sunrpc/xdr Documentation: Add the RPC language description of NLM version 3 2026-06-09 16:32:59 -04:00
target
tee
timers
tools A handful of late-arriving docs fixes, along with one document update 2026-06-25 09:09:38 -07:00
trace A handful of late-arriving docs fixes, along with one document update 2026-06-25 09:09:38 -07:00
translations MAINTAINERS: update ndesaulniers 2026-07-06 15:49:29 -07:00
usb
userspace-api Char/Misc/IIO/FPGA/GPIB/etc driver updates for 7.2-rc1 2026-06-22 12:20:21 -07:00
virt s390: 2026-06-25 10:21:13 -07:00
w1
watchdog docs: watchdog: Fix brackets 2026-07-02 07:12:58 -07:00
wmi modpost: Handle malformed WMI GUID strings 2026-06-12 16:01:55 +03:00
.gitignore
.renames.txt
atomic_bitops.txt
atomic_t.txt
Changes
CodingStyle
conf.py
docutils.conf
index.rst
Kconfig
Makefile
memory-barriers.txt
SubmittingPatches
subsystem-apis.rst