Timed Output Vibrator Driver Marcin Mielczarczyk
marcin.mielczarczyk@tieto.com
2010 ST-Ericsson Linux standard functions This documentation is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For more details see the file COPYING in the source distribution of Linux.
Introduction This documentation describes the implementation of ST-Ericsson's Timed Output Vibrator driver for the ST-Ericsson Linux platforms. Getting Started There are no special compilation flags needed to build the Timed Output Vibrator driver.
Basic Tutorial Before using this driver few parameters shall be defined in the platform data structure: Boost level - vibrator speed in the the startup stage Boost time - vibrator startup period On level - vibrator moderate speed On time - vibrator moderate period Off level - vibrator speed in the stop stage Off time - vibrator stop period NOTE: If the time elapsing between the ON and OFF sequence is smaller than the 'boost' period, then OFF is delayed until the 'boost' expires. If the time elapsing between the OFF and ON sequence is smaller than the 'off' period, then ON is delayed until the 'off' period expires. The ON request when vibrator is in 'boost' or 'on' stage is ignored. The OFF request when vibrator is in the 'off' stage is ignored. To enable the Timed Output Vibrator driver using Kconfig, go to Device Drivers -> Staging -> Android and enable the following: ST-Ericsson Timed Output Vibrator driver
Concepts Vibrator driver registers as timed output class device (implemented for Android). Tasks Timed Output Vibrator can be controlled from user space using following device: /sys/class/timed_output/vibrator/enable To turn on the vibrator for 1s, following command should be executed: echo 1000 > /sys/class/timed_output/vibrator/enable To turn off the vibrator if enabled, then the following command should be executed: echo 0 > /sys/class/timed_output/vibrator/enable To get the remaining time, the following command should be executed: cat /sys/class/timed_output/vibrator/enable Driver Configuration and Interaction There are no configuration parameters for Timed Output Vibrator Driver.
Implemented operations in driver All available operations are provided by Timed Output class driver. Supported device driver operations enable Calls vibra_enable() function which controls timer and workqueue get_time Calls vibra_get_time() function which returns time remaining to the end of vibration
Driver loading parameters Not Applicable.
Driver IO Control Not Applicable.
Driver Interaction with Sysfs Timed Output Vibrator driver is available in sysfs as /sys/class/timed_output/vibrator enable Direction read-write Attribute file type Text file File path /sys/class/timed_output/vibrator/enable Description Vibrator is enabled for given period of time on file write (in miliseconds). When written 0, vibrator stops. When file is read, it gives remaining time to disable vibrator (in miliseconds).
Driver Interaction using /proc filesystem Not Applicable.
Other means for Driver Interaction Not Applicable.
Driver Node File Not aplicable.
Known Bugs And Assumptions None. Public Functions Provided Not Applicable. Internal Functions Provided This chapter contains the autogenerated documentation of the internal functions. !Edrivers/staging/android/ste_timed_vibra.c