[Om2008.9] power on GPS

Alastair Johnson alastair at truebox.co.uk
Wed Oct 29 10:43:42 CET 2008


Matthias Apitz wrote:
> Hello,
> 
> what is the diffference of these two driver files:
> 
> root at om-gta02:~# cat /sys/class/i2c-adapter/i2c-0/0-0073/neo1973-pm-gps.0/pwron
> 0
> root at om-gta02:~# cat /sys/devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0073/neo1973-pm-gps.0/pwron
> 0
> root at om-gta02:~# echo 1 > /sys/class/i2c-adapter/i2c-0/0-0073/neo1973-pm-gps.0/pwron
> root at om-gta02:~# cat /sys/class/i2c-adapter/i2c-0/0-0073/neo1973-pm-gps.0/pwron
> 1
> root at om-gta02:~# cat /sys/devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0073/neo1973-pm-gps.0/pwron
> 1
> 
> and: where to put the statement to power on best? in /etc/init.d/gpsd?

They are two routes to the same file IIRC.

/etc/init.d/gpsd is a fair place to do it, but it may be overwritten if 
you update the gpsd package. I used to use a pair of scripts to start 
and stop bluetooth under 2007.2 but they should still work. You could 
always combine them with a check on the current power state to make it 
toggle, which would be better if you want to add a .desktop file.

#!/bin/sh
# Bring up gps - power up module and start gpsd
echo "1" > /sys/bus/platform/devices/neo1973-pm-gps.0/pwron
/etc/init.d/gpsd start

#!/bin/sh
# Bring down gps - stop gpsd and turn off the module
/etc/init.d/gpsd stop
echo "0" > /sys/bus/platform/devices/neo1973-pm-gps.0/pwron




More information about the community mailing list