summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMarcin Mielczarczyk <marcin.mielczarczyk@tieto.com>2010-06-18 10:04:45 +0200
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:05:07 +0200
commit0b46c6c5e70bd1a2c213647cf9d1cf935d7c4abd (patch)
treecdb3c4f116f14c0c610e72fc0c9176a5ebecd3a3 /include
parent87c870d543cc79ae3efb0460e4e593fb744973d6 (diff)
audio: u8500: Vibrator: Timed output vibrator driver
ST-Ericsson vibrator driver which registers in Android specific timed output device class. Signed-off-by: Marcin Mielczarczyk <marcin.mielczarczyk@tieto.com> Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@tieto.com> Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com> Timed output vibrator: New functionality. This patch allows to form the vibration characteristic using few parameters defined in the platform data: - boost level and period for start condition - on level as moderate speed - off level and period for brake condition Detailed information can be found here: Documentation\DocBook\ste_timed_vibra.html Signed-off-by: Grzegorz Sygieda <grzegorz.sygieda@tieto.com> Signed-off-by: Krzysztof Antonowicz <krzysztof.antonowicz@tieto.com> Signed-off-by: srinidhi kasagar <srinidhi.kasagar@stericsson.com> vibrator: remove board specific control of vibrator Platform specific control of vibrator should be present in board file (here board-mop500.c). So, for example if GPIO pins are used to control the vibrator, its control function implemenation should be in board file. This patch provides the callback function support in the driver for the same. Signed-off-by: Shreshtha Kumar Sahu <shreshthakumar.sahu@stericsson.com> android: vibrator: dont directly access ktime_t members Use ktime helper functions for converting ktime values Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com> u8500: vibra: linear vibrators using vibra-pwm Linear vibrators operate on thier required resonance frequency (for COPAL and AAC its ~150Hz). This can be provided using AUDIO DA5 path. This software *workaround* enables linear vibrators using AB8500 vibra-pwm by generating required resonace frequency using software. In addition this patch provides support for separate platform data for Linear and Rotarty vibrators. Signed-off-by: Shreshtha Kumar Sahu <shreshthakumar.sahu@stericsson.com> u8500: vibra: disable vibrator after vibration This patch disables vibrator i.e. configures the PWM duty cycle to zero after vibration duration is over. Signed-off-by: Philippe Langlais <philippe.langlais@linaro.org> u8500: optimize: linear vibra drv using vibra-pwm This patch optimizes the current implementation of "linear vibrator driver using vibra-pwm". Current implementation is CPU intensive and uses 100% of a CPU for the time period vibrator is used. ST-Ericsson ID: ER 349958 Signed-off-by: Avinash A <Avinash.a@stericsson.com> u8500: vibra: fix sleeping fn. in atomic context sleepable call - flush_workqueue called from atomic context of vibra_enable. ST-Ericsson ID: ER 351276 Signed-off-by: Avinash A <Avinash.a@stericsson.com> u8500: vibra: remove race condition in timer operation In situation described below, vibra driver can hang. In a scenario where vibra_enable is called and vibrator is running i.e. vibra_work is scheduled and vibra_timer. Suppose vibra_timer is started and has not expired yet. At this moment if vibra_work starts executing and acquires the vibra_lock and just before hrtimer_cancel is called, if old timer expires and timer callback starts executing then it will try to acquire vibra_lock and hence it will wait for vibra_lock, as it is already acquired by vibra_work. Now vibra_work->hrtimer_cancel will wait for timer callback to complete and timer callback will wait for vibra_lock to be free so that it can complete. This result in recursive waiting for vibra_lock and hence deadlock. As timer callback is running in interrupt context so above deadlock may trigger watchdog. ST-Ericsson ID: 405366 Signed-off-by: Shreshtha Kumar Sahu <shreshthakumar.sahu@stericsson.com> u8500: vibra: remove race condition in open In situation described below, vibra driver can hang. vibra_enable takes the vibra_lock and timer expires then timer callback will spin for vibra_lock. If vibra_enable tries to do hrtimer_cancel then it will wait for timer callback to complete. In above situation hrtimer_cancel will wait for timer callback to complete and timer callback will wait for vibra_lock to be free so that it can complete. This result in recursive waiting for vibra_lock and hence deadlock. As timer callback is running in interrupt context so above deadlock may trigger watchdog. ST-Ericsson ID: 407253 Signed-off-by: Shreshtha Kumar Sahu <shreshthakumar.sahu@stericsson.com> vibra:Remove unnecessary assignment of dev->parent Remove unnecessary assignment of dev->parent, because of this during timed out class unregister it is trying to free resources of parent which does not exist Signed-off-by: Naga Radhesh <naga.radheshy@stericsson.com>
Diffstat (limited to 'include')
-rw-r--r--include/sound/ux500_ab8500_ext.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/sound/ux500_ab8500_ext.h b/include/sound/ux500_ab8500_ext.h
index 1cc9a74585c..8c2b5d6bdf3 100644
--- a/include/sound/ux500_ab8500_ext.h
+++ b/include/sound/ux500_ab8500_ext.h
@@ -19,4 +19,9 @@
int ux500_ab8500_audio_gpadc_measure(struct ab8500_gpadc *gpadc,
u8 channel, bool mode, int *value);
+void ux500_ab8500_audio_pwm_vibra(unsigned char speed_left_pos,
+ unsigned char speed_left_neg,
+ unsigned char speed_right_pos,
+ unsigned char speed_right_neg);
+
#endif