WIFI: systemd: add suspend/resume service

For supporting suspend/resume with wifi activate,
brcmfmac MUST be unbinding before each suspend.

Signed-off-by: Christophe Priouzeau <christophe.priouzeau@st.com>
This commit is contained in:
Christophe Priouzeau committed 2019-02-05 11:22:32 +01:00
1 parent 0e99b96fa6
commit 9bd86c65c7
3 files changed
+70

No files matched your search

@@ -0,0 +1,13 @@
[Unit]
Description=Wifi brcmfmac sleep hook
Before=sleep.target
StopWhenUnneeded=yes
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=-/usr/bin/wifi_brcmfmac_driver.sh unbind
ExecStop=-/usr/bin/wifi_brcmfmac_driver.sh bind
[Install]
WantedBy=sleep.target
@@ -0,0 +1,29 @@
#!/bin/sh
SDMMC_PATH=/sys/bus/amba/drivers/mmci-pl18x
if [ -d $SDMMC_PATH ];
then
if [ ! -d /sys/bus/sdio/drivers/brcmfmac ];
then
exit 1;
fi
case $1 in
bind)
echo "bind driver brcmfmac/sdmmc";
echo "bind driver brcmfmac/sdmmc" > /dev/kmsg
echo 58007000.sdmmc > $SDMMC_PATH/bind
;;
unbind)
echo "unbind driver brcmfmac/sdmmc";
echo "unbind driver brcmfmac/sdmmc" > /dev/kmsg
echo 58007000.sdmmc > $SDMMC_PATH/unbind
;;
*)
echo "$0 [bind|unbind]"
echo "Bind/Unbind wifi driver brcmfmac."
;;
esac
fi