Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5bcb606a authored by Ajit Kumar's avatar Ajit Kumar
Browse files

soc: qcom: bgdeamon: call the gpio apis in correct order



Call the gpio APIs in correct order to reset BG.

Change-Id: Ie3eb6db5a253e8244c53940abb0d600895919783
Signed-off-by: default avatarAjit Kumar <kajit@codeaurora.org>
parent 904fabdd
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -306,10 +306,23 @@ static int bgchar_write_cmd(struct bg_ui_data *fui_obj_msg, int type)

int bg_soft_reset(void)
{
	/*pull down reset gpio */
	gpio_direction_output(bgreset_gpio, 0);
	pr_debug("do BG reset using gpio %d\n", bgreset_gpio);
	if (!gpio_is_valid(bgreset_gpio)) {
		pr_err("gpio %d is not valid\n", bgreset_gpio);
		return -ENXIO;
	}
	if (gpio_direction_output(bgreset_gpio, 1))
		pr_err("gpio %d direction not set\n", bgreset_gpio);

	/* Sleep for 50ms for hardware to detect signal as high */
	msleep(50);

	gpio_set_value(bgreset_gpio, 0);

	/* Sleep for 50ms for hardware to detect signal as high */
	msleep(50);
	gpio_set_value(bgreset_gpio, 1);

	return 0;
}
EXPORT_SYMBOL(bg_soft_reset);