view openmoko/modem-power-ctrl.sh @ 698:9ecbf1bf2e1b

fc-iram: added '+' to getopt magic string like in fc-xram Both fc-iram and fc-xram now support secondary program invokation. If the user needs to pass some options to the secondary program, we don't want fc-iram or fc-xram to claim these options as its own, thus we need to stop getopt() from reordering arguments. This fix was already implemented in fc-xram a long time ago, but the issue was overlooked when secondary program invokation ability was added to fc-iram.
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 31 Mar 2020 03:23:26 +0000
parents ace7270e1161
children
line wrap: on
line source

#!/bin/sh

# The /sys path to the GSM power control node is different
# under different Openmoko kernel versions; you need to
# uncomment the correct version for your system.

#syspath=/sys/bus/platform/devices/neo1973-pm-gsm.0/power_on
syspath=/sys/bus/platform/devices/gta02-pm-gsm.0/power_on

case "$1" in
	on|1)
		echo 1 > $syspath
		exit 0
		;;
	off|0)
		echo 0 > $syspath
		exit 0
		;;
	boot)
		echo 0 > $syspath
		sleep .2
		echo 1 > $syspath
		exit 0
		;;
	*)
		echo "usage: $0 on|off|boot" 1>&2
		exit 1
esac