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

Commit 1f7495cc authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hbtp-input : fix L13A electric leakage issue"

parents 561f555c 266b6ba1
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ struct hbtp_data {
	bool override_disp_coords;
	bool manage_afe_power_ana;
	bool manage_power_dig;
	bool regulator_enabled;
	u32 power_on_delay;
	u32 power_off_delay;
	bool manage_pin_ctrl;
@@ -360,6 +361,11 @@ static int hbtp_pdev_power_on(struct hbtp_data *hbtp, bool on)
	if (!on)
		goto reg_off;

	if (hbtp->regulator_enabled) {
		pr_debug("%s: regulator already enabled\n", __func__);
		return 0;
	}

	if (hbtp->vcc_ana) {
		ret = reg_set_load_check(hbtp->vcc_ana,
			hbtp->afe_load_ua);
@@ -403,9 +409,16 @@ static int hbtp_pdev_power_on(struct hbtp_data *hbtp, bool on)
		}
	}

	hbtp->regulator_enabled = true;

	return 0;

reg_off:
	if (!hbtp->regulator_enabled) {
		pr_debug("%s: regulator not enabled\n", __func__);
		return 0;
	}

	if (hbtp->vcc_dig) {
		reg_set_load_check(hbtp->vcc_dig, 0);
		regulator_disable(hbtp->vcc_dig);
@@ -422,6 +435,9 @@ static int hbtp_pdev_power_on(struct hbtp_data *hbtp, bool on)
		reg_set_load_check(hbtp->vcc_ana, 0);
		regulator_disable(hbtp->vcc_ana);
	}

	hbtp->regulator_enabled = false;

	return 0;
}