diff options
author | Shreshtha Kumar Sahu <shreshthakumar.sahu@stericsson.com> | 2010-12-09 13:33:29 +0530 |
---|---|---|
committer | Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com> | 2010-12-20 07:58:15 +0100 |
commit | b4e3d1a1ff6cbfa5901c60dbfe9694a55880d5d7 (patch) | |
tree | d936674fbb9b3d50ee4793e11f57e438ea3b5e3c /drivers/staging | |
parent | 22f9ef62510dd4e1d7902dce1fd091f3f8909682 (diff) |
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.
ST-Ericsson ID: ER 276022
Signed-off-by: Shreshtha Kumar Sahu <shreshthakumar.sahu@stericsson.com>
Change-Id: I93f16df9305b82e1c5203e21358eeadf8c70d40e
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/10663
Reviewed-by: QATOOLS
Reviewed-by: Deepak KARDA <deepak.karda@stericsson.com>
Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/android/ste_timed_vibra.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/staging/android/ste_timed_vibra.c b/drivers/staging/android/ste_timed_vibra.c index 9ea8a26bf92..069ab38082c 100644 --- a/drivers/staging/android/ste_timed_vibra.c +++ b/drivers/staging/android/ste_timed_vibra.c @@ -15,7 +15,6 @@ #include <linux/ste_timed_vibra.h> #include "timed_output.h" -#include <mach/ste_audio_io_vibrator.h> /** * struct vibra_info - Vibrator information structure @@ -56,10 +55,7 @@ static void vibra_control_work(struct work_struct *work) struct vibra_info *vinfo = container_of(work, struct vibra_info, vibra_work); unsigned val = 0; - struct ste_vibra_speed speed = { - .positive = 0, - .negative = 0, - }; + unsigned char speed_pos = 0, speed_neg = 0; unsigned long flags; spin_lock_irqsave(&vinfo->vibra_lock, flags); @@ -69,17 +65,17 @@ static void vibra_control_work(struct work_struct *work) switch (vinfo->vibra_state) { case STE_VIBRA_BOOST: /* Turn on both vibrators with boost speed */ - speed.positive = vinfo->pdata->boost_level; + speed_pos = vinfo->pdata->boost_level; val = vinfo->pdata->boost_time; break; case STE_VIBRA_ON: /* Turn on both vibrators with speed */ - speed.positive = vinfo->pdata->on_level; + speed_pos = vinfo->pdata->on_level; val = vinfo->timeout - vinfo->pdata->boost_time; break; case STE_VIBRA_OFF: /* Turn on both vibrators with reversed speed */ - speed.negative = vinfo->pdata->off_level; + speed_neg = vinfo->pdata->off_level; val = vinfo->pdata->off_time; break; case STE_VIBRA_IDLE: @@ -91,9 +87,9 @@ static void vibra_control_work(struct work_struct *work) spin_unlock_irqrestore(&vinfo->vibra_lock, flags); /* Send new settings */ - ste_audioio_vibrator_pwm_control( - STE_AUDIOIO_CLIENT_TIMED_VIBRA, - speed, speed); + vinfo->pdata->timed_vibra_control( + speed_pos, speed_neg, + speed_pos, speed_neg); /* Start timer if it's not in IDLE state */ if (vinfo->vibra_state != STE_VIBRA_IDLE) { |