How to control Devices from user space (command line)
This page lists the most important devices and drivers that are specific to this board. And how they can be accessed from user space.
Headset out / AUX in
The audio amplifier is controlled by (state=0: AUX IN, state=1: AUX OUT)
echo $state >/sys/devices/virtual/gpio/gpio55/value
If enabled, you can't use the AUX IN
see [[Sound] for Audio-Sound (i.e. treating the motor as a speaker membrane)
and http://git.goldelico.com/?p=gta04-kernel.git;a=blob;f=GTA04/scripts/vibra.py for a Python script using /dev/input/rumble
power (state=0: off, state=1: on)
echo $state >/sys/devices/virtual/gpio/gpio57/value
Note: this is no longer available in 3.7 and later kernels.
AUX and Power button
The AUX button status can be read through
cat /sys/devices/virtual/gpio/gpio7/value # 0=AUX pressed
The AUX button is available through a TPS GPIO button driver as an input key event. The power button is available through the TPS driver as an input key event.
Both buttons are configured as keyboard events through /dev/input/aux and /dev/input/power.
The codes are KEY_POWER and KEY_PHONE.
Depending on the exact version of the board there may be I2C devices (besides the touch screen controller).
There should be the following commands
ADCs of the TPS65950
are available through /dev/twl4030-madc and the madc driver. See e.g. http://www.jumpnowtek.com/index.php?option=com_content&view=article&id=79&Itemid=91
- ADC0: BATID (default: 0V)
- ADC1: BATTEMP (default: 1.5V)
- ADC2: ADC2IN (default: 0V)
- ADC7: MICSENSE (no headset / short / headset)
Many values are also mapped to /sys/devices/platform/twl4030_madc_hwmon/*