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;