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

Commit 42615c71 authored by Kyle Yan's avatar Kyle Yan Committed by Gerrit - the friendly Code Review server
Browse files

Merge "regulator: fan53555: add support to disable suspend voltage configuration" into msm-4.8

parents d9d8e17f b3590040
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -11,6 +11,10 @@ Optional properties:
		voltage. The other one is used for the runtime voltage setting
		Possible values are either <0> or <1>
  - vin-supply: regulator supplying the vin pin
  - fcs,disable-suspend: Boolean flag which specifies if suspend voltage
		configuration should be avoided. If this property is present,
		then the voltage selector register defined by
		fcs,suspend-voltage-selector should not be modified at runtime.

Example:

@@ -29,4 +33,5 @@ Example:
		regulator-min-microvolt = <600000>;
		regulator-max-microvolt = <1230000>;
		fcs,suspend-voltage-selector = <1>;
		fcs,disable-suspend;
	};
+6 −0
Original line number Diff line number Diff line
@@ -99,6 +99,8 @@ struct fan53555_device_info {
	unsigned int slew_rate;
	/* Sleep voltage cache */
	unsigned int sleep_vol_cache;
	/* Disable suspend */
	bool disable_suspend;
};

static int fan53555_set_suspend_voltage(struct regulator_dev *rdev, int uV)
@@ -106,6 +108,8 @@ static int fan53555_set_suspend_voltage(struct regulator_dev *rdev, int uV)
	struct fan53555_device_info *di = rdev_get_drvdata(rdev);
	int ret;

	if (di->disable_suspend)
		return 0;
	if (di->sleep_vol_cache == uV)
		return 0;
	ret = regulator_map_voltage_linear(rdev, uV, uV);
@@ -368,6 +372,8 @@ static int fan53555_parse_dt(struct fan53555_device_info *di,
	if (!ret)
		pdata->sleep_vsel_id = tmp;

	di->disable_suspend = of_property_read_bool(np, "fcs,disable-suspend");

	return ret;
}