Commit 58c9f578 authored by Michael Mrozek's avatar Michael Mrozek

letux-scripts: Made all paths relative so that they will work fine from any directory

parent 645003e2
SCRIPTPATH="$(dirname "$0")"
DURATION="$1"
[ "$DURATION" ] || DURATION=60
## check DT model
# GTA04 defaults
TWL4030_MADC=$(/root/findiio "48070000.i2c:twl@48:madc") # OMAP3
TWL4030_MADC=$($SCRIPTPATH/findiio "48070000.i2c:twl@48:madc") # OMAP3
CHARGER=/sys/class/power_supply/twl4030_usb
BATTERY=/sys/class/power_supply/bq27000-battery
# alternatives
TWL6037_GPADC=$(/root/findiio "palmas-gpadc") # OMAP5
TWL6037_GPADC=$($SCRIPTPATH/findiio "palmas-gpadc") # OMAP5
[ -r "$CHARGER" ] || CHARGER=/sys/class/power_supply/bq24297
[ -r "$BATTERY" ] || BATTERY=/sys/class/power_supply/bq27621-0
[ -r "$BATTERY" ] || BATTERY=/sys/class/power_supply/bq27421-0
......@@ -52,4 +53,4 @@ do
echo "$(date) - ${VBUS}/${CHGVOLT}/${VBAT}/${BQVBAT}/${VCHG}mV - ${CHG}/${BQCHG}% - ${VSYS}mV - ${TEMP}/${BQTEMP}C - ${ICHG}/${BQCICHG}mA - ${IDPIN}" | tee -a battlog
sync
sleep $DURATION
done
\ No newline at end of file
done
......@@ -8,6 +8,7 @@
# -s: experiments for address shift register and enable command2
# -t: test if we can write single bytes through MIPI (yes we can - if command2 and address shift is already enabled)
SCRIPTPATH="$(dirname "$0")"
if ! [ "$(tr -d '\0' </proc/device-tree/ocp/dss@58000000/encoder@58004000/lcd/compatible)" = "omapdss,mipi,debug" ]
then
echo this script needs the mipi-debug driver!
......@@ -15,7 +16,7 @@ then
exit 1
fi
./bl 1
$SCRIPTPATH/bl 1
if [ ! -L dcs ]
then
......
......@@ -4,14 +4,16 @@
# it needs special hardware for the OTP programming voltage
#
SCRIPTPATH="$(dirname "$0")"
if ! [ "$(tr -d '\0' </proc/device-tree/ocp/dss@58000000/encoder@58004000/lcd/compatible)" = "omapdss,mipi,debug" ]
then
echo this script needs the mipi-debug driver!
echo use ./panelselect and choose the 'n' driver
echo use $SCRIPTPATH/panelselect and choose the 'n' driver
exit 1
fi
./bl 1
$SCRIPTPATH/bl 1
if [ ! -L dcs ]
then
......@@ -26,7 +28,7 @@ echo nopower >dcs
sleep .2
# now set up the panel as we want to have it programmed
./boe-w677l
$SCRIPTPATH/boe-w677l
read -p "Panel ok (y/n)? " yn
if [ "$yn" != "y" ]
......@@ -63,4 +65,4 @@ echo nopower >dcs # turn off 7.5V
sleep 0.2
# now the panel should have been programmed and come up without special programming sequence
./mipi-test
$SCRIPTPATH/mipi-test
......@@ -2,12 +2,13 @@
# start camera demo
#
SCRIPTPATH="$(dirname "$0")"
if [ ! "$DISPLAY" ]
then
. /root/x # set DISPLAY
. $SCRIPTPATH/x # set DISPLAY
fi
. /root/camera-setup # load setup script
. $SCRIPTPATH/camera-setup # load setup script
PATH=$PATH:/usr/bin/arm-linux-gnueabihf
......
......@@ -3,7 +3,8 @@
# see also http://projects.goldelico.com/p/gta04-kernel/page/Camera/
#
. /root/camera-setup # load setup script
SCRIPTPATH="$(dirname "$0")"
. $SCRIPTPATH/camera-setup # load setup script
PATH=$PATH:/usr/bin/arm-linux-gnueabihf
......@@ -14,4 +15,4 @@ setup "$MODE"
echo "### capturing $CAMERA at $DEVICE ###"
make capture
./capture -d $DEVICE # -o snapshot.jpg
$SCRIPTPATH/capture -d $DEVICE # -o snapshot.jpg
#!/bin/bash
TWL4030_MADC=$(/root/findiio "48070000.i2c:twl@48:madc") # OMAP3
TWL6030_GPADC=$(/root/findiio "48070000.i2c:twl@48:adc") # OMAP4
TWL6037_GPADC=$(/root/findiio "palmas-gpadc") # OMAP5
INA231=$(/root/findhwmon ina231) # Pyra modem monitor
SCRIPTPATH="$(dirname "$0")"
TWL4030_MADC=$($SCRIPTPATH/findiio "48070000.i2c:twl@48:madc") # OMAP3
TWL6030_GPADC=$($SCRIPTPATH/findiio "48070000.i2c:twl@48:adc") # OMAP4
TWL6037_GPADC=$($SCRIPTPATH/findiio "palmas-gpadc") # OMAP5
INA231=$($SCRIPTPATH/findhwmon ina231) # Pyra modem monitor
function fuel-level { # $1 is mV; $2 is mA charging current; $3 is resistance, return is % [0..100]
......
......@@ -9,10 +9,11 @@
#
# to hang up: dial -
#
# to unlock with pin, use the /root/pin script
# to unlock with pin, use the pin script
#
IF="$(/root/wwan-on)"
SCRIPTPATH="$(dirname "$0")"
IF="$($SCRIPTPATH/wwan-on)"
MODE="-sw" # default
HANDSFREE=-nhf
......@@ -49,16 +50,16 @@ case "$IF" in
function turnoff {
killall arecord
killall arecord aplay
(echo "AT+CHUP"; sleep 1) | /root/femtocom $IF
(echo "AT+CHUP"; sleep 1) | $SCRIPTPATH/femtocom $IF
}
trap "turnoff" EXIT
trap "exit 1" SIGHUP SIGINT SIGTERM
NUM=$(/root/findsoundcard "gta04")
NUM=$($SCRIPTPATH/findsoundcard "gta04")
if $HEADSET
then
/root/tvout 0 # disable tvout
$SCRIPTPATH/tvout 0 # disable tvout
amixer -c "$NUM" set 'Analog Left Main Mic' nocap
amixer -c "$NUM" set 'Analog Left Headset Mic' cap
else
......@@ -89,7 +90,7 @@ function turnoff {
echo "AT+CHUP"; sleep 3
amixer -c "$NUM" set 'Voice PCM Out' off
else
#echo "AT+CPIN=XXXX"; sleep 1 # use the /root/pin script to unlock the SIM card
#echo "AT+CPIN=XXXX"; sleep 1 # use the pin script to unlock the SIM card
echo "AT_ODO=0"; sleep 1
echo "AT_OPCMENABLE=1"; sleep 1
echo "AT_OPCMPROF=0"; sleep 1 # handset profile
......@@ -101,25 +102,25 @@ function turnoff {
if [ "$MODE" = "-sw" ]
then
arecord -Ddefault:CARD=gta04 -fS16_LE -r8000 | aplay -Ddefault:CARD=Telephony & # microphone -> modem
arecord -Ddefault:CARD=Telephony -fS16_LE -r8000 | /root/twl $HANDSFREE -stdin # modem -> earpiece, speaker, headset
arecord -Ddefault:CARD=Telephony -fS16_LE -r8000 | $SCRIPTPATH/twl $HANDSFREE -stdin # modem -> earpiece, speaker, headset
else
echo "please ctl-C to end the call" >&2
arecord -Ddefault:CARD=gta04 -fS16_LE -r8000 >/dev/null # just enable micbias
# sleep 99999 # we can't easily detect end of call (without monitoring femtocom output)
fi
fi
) | /root/femtocom $IF
) | $SCRIPTPATH/femtocom $IF
;;
/dev/ttyACM[0-4] | /dev/ttyUSB[0-4] ) # Neo900 / Pyra
(
NUM=$(/root/findsoundcard "L15")
NUM=$($SCRIPTPATH/findsoundcard "L15")
if [ "$NUMBER" == "-" ]
then
echo "AT+CHUP"; sleep 3
else
#echo "AT+CPIN=XXXX"; sleep 1 # use the /root/pin script to unlock the SIM card
#echo "AT+CPIN=XXXX"; sleep 1 # use the pin script to unlock the SIM card
echo "AT+COPS"; sleep 1
echo "AT^SAIC=3,1,1,0,1,0,1,0"; sleep 1
......@@ -127,7 +128,7 @@ function turnoff {
if [ "$MODE" = "-sw" ]
then
arecord -Ddefault:CARD=L15 -fS16_LE -r8000 | aplay -Ddefault:CARD=Telephony & # microphone -> modem
arecord -Ddefault:CARD=Telephony -fS16_LE -r8000 | /root/twl $HANDSFREE -stdin # modem -> earpiece, speaker, headset
arecord -Ddefault:CARD=Telephony -fS16_LE -r8000 | $SCRIPTPATH/twl $HANDSFREE -stdin # modem -> earpiece, speaker, headset
else
echo "please ctl-C to end the call" >&2
arecord -Ddefault:CARD=L15 -fS16_LE -r8000 >/dev/null # enable micbias
......@@ -135,6 +136,6 @@ function turnoff {
sleep 99999
fi
fi
) | /root/femtocom $IF
) | $SCRIPTPATH/femtocom $IF
esac
......@@ -2,4 +2,5 @@
[ -x fbpng ] || gcc fbpng.c -o fbpng -lpng
[ -r 1280x720_board.png ] || wget -O 1280x720_board.png http://notaz.gp2x.de/img/mess/pyra/1280x720_board.png
./fbpng 1280x720_board.png
\ No newline at end of file
SCRIPTPATH="$(dirname "$0")"
$SCRIPTPATH/fbpng 1280x720_board.png
......@@ -4,13 +4,14 @@
# fm-demo freq-in-MHz
#
SCRIPTPATH="$(dirname "$0")"
make si4721
# turn off after exit of this script
trap "./si4721 -r 0 -dn; killall arecord" EXIT
trap "$SCRIPTPATH/si4721 -r 0 -dn; killall arecord" EXIT
trap "exit 1" INT TERM QUIT HUP
NUM=$(/root/findsoundcard "gta04")
NUM=$($SCRIPTPATH/findsoundcard "gta04")
echo 1 >/sys/devices/virtual/gpio/gpio55/value # enable audio out
amixer -c "$NUM" set 'Headset' 2
......@@ -24,22 +25,22 @@ amixer -c "$NUM" set 'HeadsetR Mixer Voice' off
FREQ=$1; [ "$1" ] || FREQ=92.4
# power on (and print chip ID)
./si4721 -d -up
$SCRIPTPATH/si4721 -d -up
# tune to specified frequency
echo ./si4721 -t $(python -c "print '%.0f' % ($FREQ*100)")
./si4721 -t $(python -c "print '%.0f' % ($FREQ*100)")
echo $SCRIPTPATH/si4721 -t $(python -c "print '%.0f' % ($FREQ*100)")
$SCRIPTPATH/si4721 -t $(python -c "print '%.0f' % ($FREQ*100)")
sleep 1
./si4721 -ts
$SCRIPTPATH/si4721 -ts
# start PCM (incl. clocks)
arecord -Ddefault:CARD=Tuner -c2 -fS16_LE -r48000 | tee radio.wav | aplay& # receiver -> earpiece / speaker / headset
# arecord -fS16_LE -c2 -r48000 | aplay -Dhw:4,0 & # microphone -> transmitter
# set sample rate (32 .. 48 kHz)
./si4721 -r 48000
$SCRIPTPATH/si4721 -r 48000
# loop and print signal strength
while true
## FIXME: loop should abort when arecord aborts (PCM error)
do
# print signal strength
./si4721 -s
$SCRIPTPATH/si4721 -s
sleep 1
done
......@@ -3,7 +3,8 @@
# see also http://projects.goldelico.com/p/gta04-kernel/page/GPS/
#
SERIAL=$(/root/gps-on)
SCRIPTPATH="$(dirname "$0")"
SERIAL=$($SCRIPTPATH/gps-on)
echo "### starting gpsd $SERIAL ###"
killall gpsd # kill any existing
......@@ -25,5 +26,5 @@ then
fi
echo "### starting foxtrot gps ###"
. /root/x
. $SCRIPTPATH/x
dbus-launch foxtrotgps
......@@ -5,6 +5,8 @@
# usage: gps-on
#
SCRIPTPATH="$(dirname "$0")"
rfkill unblock gps # turn on LNA etc.
case "$(cat /sys/firmware/devicetree/base/model)" in
......@@ -15,7 +17,7 @@ case "$(cat /sys/firmware/devicetree/base/model)" in
;;
esac
IF="$(/root/wwan-on)"
IF="$($SCRIPTPATH/wwan-on)"
case "$IF" in
"" )
......@@ -41,7 +43,7 @@ case "$IF" in
exit 1
(
echo "AT^SDPORT=4"; sleep1 # switch to multiplexed data mode
) | /root/femtocom $IF >&2
) | $SCRIPTPATH/femtocom $IF >&2
echo should now make modem re-enumerate and restart this script
;;
......@@ -55,7 +57,7 @@ case "$IF" in
echo 'AT^SGPSC="Nmea/Output","on"'; sleep 0.4 # enable data stream
echo 'AT^SGPSC="Nmea/Urc","on"'; sleep 0.4 # unsolicited reports
echo 'AT^SGPSC="Power/Antenna","auto"'; sleep 1.0 # * switch LNA to auto mode
) | /root/femtocom $IF >&2 &
) | $SCRIPTPATH/femtocom $IF >&2 &
echo /dev/ttyACM2
;;
......@@ -65,8 +67,8 @@ case "$IF" in
echo 'AT^SGPSC="Engine","1"'; sleep 1.0 # enable GPS
echo 'AT^SGPSC="Nmea/Output","on"'; sleep 0.4 # normal output
echo 'AT^SGPSC="Power/Antenna","auto"'; sleep 1.0 # * switch LNA to auto mode
) | /root/femtocom $IF >&2 &
) | $SCRIPTPATH/femtocom $IF >&2 &
echo /dev/ttyUSB1
;;
esac
\ No newline at end of file
esac
......@@ -2,6 +2,7 @@
# start multiple background processes with 100% CPU load
#
SCRIPTPATH="$(dirname "$0")"
function loop {
while true
do
......@@ -15,14 +16,14 @@ if [ "$1" = "-n" ]
then
# neon_loop requests higher CPU load than a bash loop
[ neon_loop.S -nt neon_loop ] && gcc -o neon_loop neon_loop.S -mfpu=neon -mcpu=native
LOOP=./neon_loop
LOOP=$SCRIPTPATH/neon_loop
fi
if [ "$1" = "-n2" ]
then
# neon_loop2 requests even higher CPU load
[ neon_loop2.S -nt neon_loop2 ] && gcc -o neon_loop2 neon_loop2.S -mfpu=neon -mcpu=native
LOOP=./neon_loop2
LOOP=$SCRIPTPATH/neon_loop2
fi
CORES=$(fgrep processor /proc/cpuinfo | wc -l) # find from /proc/cpuinfo
......@@ -30,7 +31,7 @@ CORES=$(fgrep processor /proc/cpuinfo | wc -l) # find from /proc/cpuinfo
echo "100% load stress test for $CORES cores running $LOOP"
# run once in this shell so that we define the 'temperatures' function for the loop
. ./temperatures
. $SCRIPTPATH/temperatures
# start as many 100% load processes as we have cores
for i in $(seq 1 $CORES)
......
......@@ -10,6 +10,7 @@
TESTER_VERSION="6.2"
TESTER_RECOMMENDED_KERNEL="4.10"
TESTER_DATE="09 Jun 2017"
SCRIPTPATH="$(dirname "$0")"
MODEL=$(tr -d '\0' </proc/device-tree/model 2>/dev/null)
......@@ -565,8 +566,8 @@ function test_uboot {
}
function test_si47xx {
(cd /root && make si4721 >/dev/null 2>&1)
VAL=$(echo $(/root/si4721 -i /dev/i2c-1 -d -up -dn))
(cd $SCRIPTPATH && make si4721 >/dev/null 2>&1)
VAL=$(echo $($SCRIPTPATH/si4721 -i /dev/i2c-1 -d -up -dn))
case "$VAL" in
"init resp: 80 get_chiprev resp: 80 1532300000323042 powered off" | \
"init resp: 80 get_chiprev resp: 80 0532300000323042 powered off" )
......@@ -586,12 +587,12 @@ function test_usb_ip {
}
function test_vibra {
[ -r /dev/input/rumble ] && ./vibra.py
[ -r /dev/input/rumble ] && $SCRIPTPATH/vibra.py
report $? ${FUNCNAME} "" "running rumble effect demo"
}
function test_audio {
./twl -d - >/dev/null 2>&1
$SCRIPTPATH/twl -d - >/dev/null 2>&1
report $? ${FUNCNAME} "" "running audio demo"
}
......@@ -614,13 +615,13 @@ function test_lcd {
function test_tvout {
. x >/dev/null
./tvout 1 2>/dev/null
$SCRIPTPATH/tvout 1 2>/dev/null
report $? ${FUNCNAME} "" "enabling TVOut"
}
function test_tvout_off {
. x >/dev/null
./tvout 0 2>/dev/null
$SCRIPTPATH/tvout 0 2>/dev/null
report $? ${FUNCNAME} "" "switching back to LCD"
}
......@@ -633,7 +634,7 @@ function test_ext_antenna {
}
function test_gps {
GPS=$(/root/gps-on 2>/dev/null)
GPS=$($SCRIPTPATH/gps-on 2>/dev/null)
report $? ${FUNCNAME}_interface "$GPS" "GPS interface"
[ "$GPS" ] && read -t 10 LINE <$GPS && echo $LINE | fgrep '$GP
$GNGNS
......@@ -651,9 +652,9 @@ function test_wwan_usb {
function test_wwan_option {
# do subtests by sending AT commands
(cd /root && make femtocom >/dev/null 2>&1)
WWAN=$(/root/wwan-on 2>/dev/null)
(echo AT_OID; sleep 1) | ./femtocom "$WWAN" | fgrep ':' >/tmp/$$.values
(cd $SCRIPTPATH && make femtocom >/dev/null 2>&1)
WWAN=$($SCRIPTPATH/wwan-on 2>/dev/null)
(echo AT_OID; sleep 1) | $SCRIPTPATH/femtocom "$WWAN" | fgrep ':' >/tmp/$$.values
cat /tmp/$$.values | while read KEY VAL
do
case "$KEY" in
......@@ -679,7 +680,7 @@ function test_wwan_option {
#testing "GTM601-Wakeup" "check for 3G Wakeup through AT_ORESET"
for i in 1 2 3
do
if (echo AT_ORESET; sleep 15) | /root/femtocom "$WWAN" >/dev/null | ( evtest /dev/input/incoming & sleep 15; kill $! ) | fgrep -e 'type 1 (Key), code 240 (Unknown), value 1' -e 'type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 1' 2>/dev/null 1>&2
if (echo AT_ORESET; sleep 15) | $SCRIPTPATH/femtocom "$WWAN" >/dev/null | ( evtest /dev/input/incoming & sleep 15; kill $! ) | fgrep -e 'type 1 (Key), code 240 (Unknown), value 1' -e 'type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 1' 2>/dev/null 1>&2
then
true
break
......@@ -696,15 +697,15 @@ function test_wwan_hwmon { # $1: on/off
}
function test_wwan_gemalto {
(cd /root && make femtocom >/dev/null 2>&1)
WWAN=$(/root/wwan-on 2>/dev/null)
(cd $SCRIPTPATH && make femtocom >/dev/null 2>&1)
WWAN=$($SCRIPTPATH/wwan-on 2>/dev/null)
test_wwan_hwmon on
(echo AT+CGMI; sleep 0.2
echo AT+CGMM; sleep 0.2
echo AT+CGMR; sleep 0.2
echo AT+CGSN; sleep 1) | ./femtocom "$WWAN" >/tmp/$$.values
echo AT+CGSN; sleep 1) | $SCRIPTPATH/femtocom "$WWAN" >/tmp/$$.values
AT="?"
cat /tmp/$$.values | while read LINE
do
......@@ -734,7 +735,7 @@ function test_wwan_gemalto {
function test_wwan_off {
# known to fail on GTA04A3
/root/wwan-off >/dev/null
$SCRIPTPATH/wwan-off >/dev/null
report $? ${FUNCNAME} "$WWAN" "WWAN power off command"
sleep 5
## check through lsusb if it is really off
......@@ -747,8 +748,8 @@ function test_wwan_off {
function test_wwan {
# check for USB presence of either OPTION or Gemalto
(cd /root && make femtocom >/dev/null 2>&1)
WWAN=$(/root/wwan-on 2>/dev/null)
(cd $SCRIPTPATH && make femtocom >/dev/null 2>&1)
WWAN=$($SCRIPTPATH/wwan-on 2>/dev/null)
R=$?
test_wwan_usb
report $R ${FUNCNAME}_interface "$WWAN" "WWAN interface"
......@@ -768,7 +769,7 @@ function test_wwan {
function test_bluetooth {
# test if it turns on VAUX4=$(findregulator "VAUX4") on GTA04A[2-4]
read ADDR < <(/root/bt-scan 2>/dev/null | fgrep 'BD Address:' | cut -d ':' -f 2-7 | cut -d ' ' -f 1)
read ADDR < <($SCRIPTPATH/bt-scan 2>/dev/null | fgrep 'BD Address:' | cut -d ':' -f 2-7 | cut -d ' ' -f 1)
[ "$ADDR" ]
report $? ${FUNCNAME}_scan "$ADDR" "Bluetooth scan"
......@@ -789,7 +790,7 @@ function test_wlan {
lsmod | fgrep -q libertas_sdio >/dev/null
report $? ${FUNCNAME}_libertas "" "libertas loaded (chip found on interface)"
read -t 30 BSS ADDR < <(/root/wlan-scan 2>/dev/null)
read -t 30 BSS ADDR < <($SCRIPTPATH/wlan-scan 2>/dev/null)
[ "$ADDR" ]
report $? ${FUNCNAME}_scan "$ADDR" "WLAN scan"
......
......@@ -2,6 +2,7 @@
# Pyra energy consumption measurement tool
#
SCRIPTPATH="$(dirname "$0")"
# disable charger
echo 0 >/sys/class/power_supply/bq24297/input_current_limit
......@@ -23,30 +24,30 @@ function measure
# full intensity, turn everything on
echo 10 >/sys/class/backlight/backlight/brightness
echo 10 >/sys/class/backlight/keyboard-backlight/brightness
./bl 1
./kbl 1
$SCRIPTPATH/bl 1
$SCRIPTPATH/kbl 1
( cd /sys/class/leds; for i in *; do echo "default-on" >$i/trigger; done )
ifconfig wlan0 up
measure "full activity"
# turn off all
./kbl 0
./bl 0
$SCRIPTPATH/kbl 0
$SCRIPTPATH/bl 0
( cd /sys/class/leds; for i in *; do echo "none" >$i/trigger; done )
ifconfig wlan0 down
./ssd2858 -off >/dev/null
$SCRIPTPATH/ssd2858 -off >/dev/null
measure "all off except OMAP"
# add backlight
./bl 1
$SCRIPTPATH/bl 1
measure "backlight on"
# add SSD
./ssd2858 -r -f 3 -p -s >/dev/null
$SCRIPTPATH/ssd2858 -r -f 3 -p -s >/dev/null
measure "ssd on"
# add keyboard
./kbl 1
$SCRIPTPATH/kbl 1
measure "keyboard on"
# add all LEDs
......@@ -58,16 +59,16 @@ measure "wlan turned on" # assumes it was on
ifconfig wlan0 up
# turn on WWAN (we can't easily turn off)
WWAN=$(./wwan-on)
WWAN=$($SCRIPTPATH/wwan-on)
measure "wwan $WWAN turned on"
# (echo "at^turn off"; sleep 0.5)| ./femtocom $WWAN
# (echo "at^turn off"; sleep 0.5)| $SCRIPTPATH/femtocom $WWAN
rfkill block wwan
# should try to turn off USB host power...
R1=$(./findregulator modem_vbus_hdmi_power)
R2=$(./findregulator host1_vbus_power)
R3=$(./findregulator host2_vbus_power)
R4=$(./findregulator modem_vbus_power)
R1=$($SCRIPTPATH/findregulator modem_vbus_hdmi_power)
R2=$($SCRIPTPATH/findregulator host1_vbus_power)
R3=$($SCRIPTPATH/findregulator host2_vbus_power)
R4=$($SCRIPTPATH/findregulator modem_vbus_power)
# findregulator + echo 0 >$REG/power ?
# measure "USB host power off"
......
#
# /root/mictest: demo for twl6040 mic + headset
# mictest: demo for twl6040 mic + headset
#
while [ "$1" ]
......@@ -26,4 +26,4 @@ done
# we must delay arecord a little so that the amixer
# commands by the twl script are already done
(sleep 1; arecord -Ddefault:CARD=L15 -c 2) | tee /tmp/echo.wav | /root/twl $FLAGS -t wav -
(sleep 1; arecord -c 2) | tee /tmp/echo.wav | $SCRIPTPATH/twl $FLAGS -t wav -
......@@ -2,14 +2,15 @@
# using the panel-mipi-debug driver
# we are assuming no specific controller (i.e. use the default settings of the panel)
SCRIPTPATH="$(dirname "$0")"
if ! [ "$(tr -d '\0' </proc/device-tree/ocp/dss@58000000/encoder@58004000/lcd/compatible)" = "omapdss,mipi,debug" ]
then
echo this script needs the mipi-debug driver!
echo use ./panelselect and choose the 'n' driver
echo use $SCRIPTPATH/panelselect and choose the 'n' driver
exit 1
fi
./bl 1
$SCRIPTPATH/bl 1
if [ ! -L dcs ]
then
......
......@@ -7,6 +7,7 @@
# usage: otg [1 | 1.5]
#
SCRIPTPATH="$(dirname "$0")"
PYRA=false
case $(tr -d '\0' </proc/device-tree/model) in
......@@ -24,14 +25,14 @@ esac
# locate the OTG regulator and its device (the bq24297 charger)
if $PYRA
then
OTG_REG=$(/root/findregulator "otg")
OTG_REG=$($SCRIPTPATH/findregulator "otg")
BQ24297=$OTG_REG/device # same as /sys/class/power_supply/bq24297/device
else
OTG_REG=$(/root/findregulator "smps10")
OTG_REG=$($SCRIPTPATH/findregulator "smps10")
fi
# locate Palmas for ADC
TWL6037_GPADC=$(/root/findiio "palmas-gpadc") # OMAP5
TWL6037_GPADC=$($SCRIPTPATH/findiio "palmas-gpadc") # OMAP5
# enable/disable
case "$1" in
......
......@@ -2,6 +2,7 @@ FORMAT=sxga
BUS=1
ADDR=0x30
SCRIPTPATH="$(dirname "$0")"
# send mplayer output to host
if [ ! "$DISPLAY" ]
......@@ -19,7 +20,7 @@ function isrunning {
function start {
if ! isrunning
then
./camera-demo $FORMAT >/dev/null 2>&1 &
$SCRIPTPATH/camera-demo $FORMAT >/dev/null 2>&1 &
sleep 8
fi
}
......@@ -54,4 +55,4 @@ case "$1" in
-qqvga ) stop; FORMAT=qqvga; start;;
-cif ) stop; FORMAT=cif; start;;
*) echo unknown command $1; exit 1;;
esac
\ No newline at end of file
esac
......@@ -3,7 +3,8 @@
#
# usage: pin number
IF="$(/root/wwan-on)"
SCRIPTPATH="$(dirname "$0")"
IF="$($SCRIPTPATH/wwan-on)"
case "$IF" in
"" )
......@@ -14,7 +15,7 @@ case "$IF" in
* )
(
echo "AT+CPIN=$1"; sleep 3
) | /root/femtocom $IF
) | $SCRIPTPATH/femtocom $IF
;;
esac