2019-09-10 04:21:13 +00:00
|
|
|
#!/sbin/openrc-run
|
|
|
|
|
|
|
|
description="Starting EG25 WWAN module"
|
|
|
|
|
|
|
|
depend()
|
|
|
|
{
|
|
|
|
before ofono
|
|
|
|
}
|
|
|
|
|
|
|
|
start()
|
|
|
|
{
|
|
|
|
ebegin "Enabling EG25 WWAN module"
|
2020-09-30 19:26:49 +00:00
|
|
|
echo 1 > /sys/class/modem-power/modem-power/device/powered
|
|
|
|
eend $?
|
2019-09-10 04:21:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stop()
|
|
|
|
{
|
2020-09-30 19:26:49 +00:00
|
|
|
if [ -d /sys/class/modem-power/modem-power ]; then
|
|
|
|
ebegin "Disabling EG25 WWAN module (modem_power)"
|
|
|
|
echo 0 > /sys/class/modem-power/modem-power/device/powered
|
|
|
|
eend $?
|
|
|
|
else
|
|
|
|
# Keep legacy code path for shutdown of old kernel after upgrade
|
|
|
|
ebegin "Disabling EG25 WWAN module (legacy)"
|
|
|
|
echo 1 > /sys/class/gpio/gpio68/value
|
|
|
|
echo 1 > /sys/class/gpio/gpio232/value
|
2019-09-10 04:21:13 +00:00
|
|
|
|
2020-09-30 19:26:49 +00:00
|
|
|
echo 1 > /sys/class/gpio/gpio35/value && sleep 2 && echo 0 > /sys/class/gpio/gpio35/value
|
|
|
|
sleep 30 # Wait for the module to power off
|
|
|
|
eend 0
|
|
|
|
fi
|
2019-09-10 04:21:13 +00:00
|
|
|
}
|