#!/bin/sh
# s10e-dp-audio: HDMI sound on the S10e. Loads s10e_dp_audio (the DisplayPort's sound card, "S10eHDMI") the first
# time a display is connected to the USB-C port; the module then stays until reboot: unplugged it holds nothing (the
# DP clocks off, its DMA idle, the phone sleeps as before), and unloading it is where it oopsed (2026-11-06). It asks
# the port for its state as it loads, so a display that is already up gets its sound too.
# Run at boot and on every DRM hotplug (71-s10e-dp-audio.rules).
grep -qx connected /sys/class/drm/card*-DP-*/status 2>/dev/null || exit 0
grep -q '^s10e_dp_audio ' /proc/modules && exit 0
exec modprobe s10e_dp_audio
