pmaports/device/community/device-pine64-pinephone/eg25.initd
Oliver Smith 517f905b84
pine64-pinephone: update devicepkg for 5.9 kernel (MR 1614)
* update modem init for modem_power
* adjust alsa configs
* remove obsolete megapixels config file

Related: https://xnux.eu/log/#020
Co-Authored-By: Martijn Braam <martijn@brixit.nl>
2020-10-20 18:02:24 +02:00

33 lines
746 B
Text

#!/sbin/openrc-run
description="Starting EG25 WWAN module"
depend()
{
before ofono
}
start()
{
ebegin "Enabling EG25 WWAN module"
echo 1 > /sys/class/modem-power/modem-power/device/powered
eend $?
}
stop()
{
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
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
}