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

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

Merge "msm: krait-regulator: Add flag to disable LDO mode usage"

parents da4699fc 301dead5
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -55,6 +55,9 @@ Required properties:
				to LDO mode. Acceptable values are from 1000uV to 100000uV
- qcom,cpu-num:			Indicates what cpu this regulator controls

Optional properties:
- qcom,ldo-disable:		Indicates whether to disable using LDO mode

Any property defined as part of the core regulator
binding, defined in regulator.txt, can also be used.

+9 −0
Original line number Diff line number Diff line
@@ -222,6 +222,7 @@ struct krait_power_vreg {
	int				ldo_threshold_uV;
	int				ldo_delta_uV;
	int				cpu_num;
	bool				ldo_disable;
	int				coeff1;
	int				coeff2;
	bool				reg_en;
@@ -656,6 +657,9 @@ static void __switch_to_using_ldo(void *info)
{
	struct krait_power_vreg *kvreg = info;

	if (kvreg->ldo_disable)
		return;

	/*
	 * if the krait is in ldo mode and a voltage change is requested on the
	 * ldo switch to using hs before changing ldo voltage
@@ -1201,6 +1205,7 @@ static int krait_power_probe(struct platform_device *pdev)
	int headroom_uV, retention_uV, ldo_default_uV, ldo_threshold_uV;
	int ldo_delta_uV;
	int cpu_num;
	bool ldo_disable = false;

	if (pdev->dev.of_node) {
		/* Get init_data from device tree. */
@@ -1284,6 +1289,9 @@ static int krait_power_probe(struct platform_device *pdev)
			pr_err("bad cpu-num= %d specified\n", cpu_num);
			return -EINVAL;
		}

		ldo_disable = of_property_read_bool(pdev->dev.of_node,
					"qcom,ldo-disable");
	}

	if (!init_data) {
@@ -1337,6 +1345,7 @@ static int krait_power_probe(struct platform_device *pdev)
	kvreg->ldo_threshold_uV = ldo_threshold_uV;
	kvreg->ldo_delta_uV	= ldo_delta_uV;
	kvreg->cpu_num		= cpu_num;
	kvreg->ldo_disable	= ldo_disable;
	kvreg->force_bhs	= true;

	platform_set_drvdata(pdev, kvreg);