From 8f836ad86e5f88518537d1a4cac5cd096576affd Mon Sep 17 00:00:00 2001 From: kankan5 Date: Tue, 19 Apr 2022 19:33:49 +0800 Subject: [PATCH] dlkm: vibrator: No vibration when media controls working. details; No vibration when media controls working Change-Id: Id8820adc0d0eb5c8dfc20a27df87a1410e307278 Signed-off-by: kankan5 Reviewed-on: https://gerrit.mot.com/2246470 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Zhenghai Pan Reviewed-by: Wang Wang Submit-Approved: Jira Key --- .../misc/regulator_vibrator_mmi/moto_regulator_vibrator.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/misc/regulator_vibrator_mmi/moto_regulator_vibrator.c b/drivers/misc/regulator_vibrator_mmi/moto_regulator_vibrator.c index ea7d062b6fc6..fd0c47b95549 100644 --- a/drivers/misc/regulator_vibrator_mmi/moto_regulator_vibrator.c +++ b/drivers/misc/regulator_vibrator_mmi/moto_regulator_vibrator.c @@ -70,10 +70,10 @@ static void ext_vib_work(struct work_struct *work) if (chip->dis_short_long) { pr_warn("vib in dis short and long, play ms=%lld, dis_longms=%d\n",chip->vib_play_ms, chip->dis_long_ms); if (chip->vib_play_ms > chip->dis_long_ms) { + ret = gpio_direction_output(chip->vcc_2v6_Pin, chip->state); #ifdef CONFIG_VIBRATOR_NOISE_CAMERA mot_actuator_on_vibrate_start(); #endif - ret = gpio_direction_output(chip->vcc_2v6_Pin, chip->state); } else { ret = gpio_direction_output(chip->vcc_3v0_Pin, chip->state); @@ -96,6 +96,8 @@ static void ext_vib_work(struct work_struct *work) } else { if (chip->pwr_by_gpio) { + gpio_direction_output(chip->vcc_2v6_Pin, chip->state); + gpio_direction_output(chip->vcc_3v0_Pin, chip->state); #ifdef CONFIG_VIBRATOR_NOISE_CAMERA if (chip->dis_short_long) { if (chip->vib_play_ms > chip->dis_long_ms) { @@ -103,8 +105,6 @@ static void ext_vib_work(struct work_struct *work) } } #endif - gpio_direction_output(chip->vcc_2v6_Pin, chip->state); - gpio_direction_output(chip->vcc_3v0_Pin, chip->state); } else if (regulator_en_flag) { regulator_en_flag = false;