|
@@ -201,6 +201,13 @@ static int vibra_play(struct input_dev *input, void *data,
|
|
|
struct vibra_info *info = input_get_drvdata(input);
|
|
|
int ret;
|
|
|
|
|
|
+ /* Do not allow effect, while the routing is set to use audio */
|
|
|
+ ret = twl6040_get_vibralr_status(info->twl6040);
|
|
|
+ if (ret & TWL6040_VIBSEL) {
|
|
|
+ dev_info(&input->dev, "Vibra is configured for audio\n");
|
|
|
+ return -EBUSY;
|
|
|
+ }
|
|
|
+
|
|
|
info->weak_speed = effect->u.rumble.weak_magnitude;
|
|
|
info->strong_speed = effect->u.rumble.strong_magnitude;
|
|
|
info->direction = effect->direction < EFFECT_DIR_180_DEG ? 1 : -1;
|