pmaports/device/community/device-pine64-pinephone/eg25.initd
Bart Ribbers 557a83d1ca
pine64-pinephone: move to community (MR 1175)
[ci:skip-build]: already built successfully in CI
2020-05-17 15:00:12 +02:00

37 lines
859 B
Text

#!/sbin/openrc-run
description="Starting EG25 WWAN module"
depend()
{
before ofono
}
start()
{
ebegin "Enabling EG25 WWAN module"
# GPIO35 is PWRKEY
# GPIO68 is RESET_N
# GPIO232 is W_DISABLE#
for i in 35 68 232
do
[ -e /sys/class/gpio/gpio$i ] && continue
echo $i > /sys/class/gpio/export || return 1
echo out > /sys/class/gpio/gpio$i/direction || return 1
done
echo 0 > /sys/class/gpio/gpio68/value || return 1
echo 0 > /sys/class/gpio/gpio232/value || return 1
( echo 1 > /sys/class/gpio/gpio35/value && sleep 2 && echo 0 > /sys/class/gpio/gpio35/value ) || return 1
}
stop()
{
ebegin "Disabling EG25 WWAN module"
echo 1 > /sys/class/gpio/gpio68/value
echo 1 > /sys/class/gpio/gpio232/value
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
}