OMAP vibration device

From WebOS Internals
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

The device which vibrates when the phone gets a call is able to be controlled on a rooted Pre via sysfs. This can be done manually or through shell scripts.

root@castle:/# cd /sys/bus/platform/devices/omap_vibe/
root@castle:/sys/devices/platform/omap_vibe# ls -F
bus@         direction   driver@      duty_cycle  modalias    power/       subsystem@   uevent

The file direction indicates if the vibration is currently on or off

root@castle:/sys/devices/platform/omap_vibe# cat direction
0

When it is 0, the device is off, at any other value the device is on.

root@castle:/sys/devices/platform/omap_vibe# echo -n 1 > direction

The intensity of the vibration can be changed by modifying the duty_cycle file, but the results of this seem to be affected by the charging state of the phone. On the charger (touchstone or USB) the lowest accepted value seems to be 20 which produces a very SLOW vibration, but when on battery power no values below 50 produce vibration. The highest accepted value is 100. The default value is 50.

root@castle:/sys/devices/platform/omap_vibe# echo 100 > duty_cycle
root@castle:/sys/devices/platform/omap_vibe# echo 20 > duty_cycle
root@castle:/sys/devices/platform/omap_vibe# echo 50 > duty_cycle