diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/input/misc/twl6040-vibra.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/input/misc/twl6040-vibra.c b/drivers/input/misc/twl6040-vibra.c index cb741858229a..2a828e53db58 100644 --- a/drivers/input/misc/twl6040-vibra.c +++ b/drivers/input/misc/twl6040-vibra.c | |||
@@ -201,6 +201,13 @@ static int vibra_play(struct input_dev *input, void *data, | |||
201 | struct vibra_info *info = input_get_drvdata(input); | 201 | struct vibra_info *info = input_get_drvdata(input); |
202 | int ret; | 202 | int ret; |
203 | 203 | ||
204 | /* Do not allow effect, while the routing is set to use audio */ | ||
205 | ret = twl6040_get_vibralr_status(info->twl6040); | ||
206 | if (ret & TWL6040_VIBSEL) { | ||
207 | dev_info(&input->dev, "Vibra is configured for audio\n"); | ||
208 | return -EBUSY; | ||
209 | } | ||
210 | |||
204 | info->weak_speed = effect->u.rumble.weak_magnitude; | 211 | info->weak_speed = effect->u.rumble.weak_magnitude; |
205 | info->strong_speed = effect->u.rumble.strong_magnitude; | 212 | info->strong_speed = effect->u.rumble.strong_magnitude; |
206 | info->direction = effect->direction < EFFECT_DIR_180_DEG ? 1 : -1; | 213 | info->direction = effect->direction < EFFECT_DIR_180_DEG ? 1 : -1; |