summaryrefslogtreecommitdiff
path: root/pm/power.d/intel-audio-powersave
blob: 3d42ae3b74d0d035f7ef3a7748b8609aef19c847 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

# Allow the driver to put the audio hardware to sleep
# once the driver has been inactive for a second.
# This hook should work with at least the ac97 and hda codecs.

audio_powersave() {
    for dev in /sys/module/snd_*_codec/parameters/power_save; do
	[ -w $dev ] && echo $1 > $dev
    done
}

case $1 in
    true) audio_powersave 1 ;;
    false) audio_powersave 0 ;;
    *) exit $NA
esac

exit 0