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

Commit 2dab48ef authored by Mark Brown's avatar Mark Brown
Browse files

Merge remote-tracking branches 'regulator/topic/load',...

Merge remote-tracking branches 'regulator/topic/load', 'regulator/topic/max77802', 'regulator/topic/pwm', 'regulator/topic/qcom-smd' and 'regulator/topic/stw481x' into regulator-next
Loading
Loading
Loading
Loading
+24 −1
Original line number Diff line number Diff line
@@ -8,7 +8,28 @@ regulators that can be controlled over I2C.

Following properties should be present in main device node of the MFD chip.

Optional node:
Optional properties:
- inb1-supply:  The input supply for BUCK1
- inb2-supply:  The input supply for BUCK2
- inb3-supply:  The input supply for BUCK3
- inb4-supply:  The input supply for BUCK4
- inb5-supply:  The input supply for BUCK5
- inb6-supply:  The input supply for BUCK6
- inb7-supply:  The input supply for BUCK7
- inb8-supply:  The input supply for BUCK8
- inb9-supply:  The input supply for BUCK9
- inb10-supply: The input supply for BUCK10
- inl1-supply:  The input supply for LDO8 and LDO15
- inl2-supply:  The input supply for LDO17, LDO27, LDO30 and LDO35
- inl3-supply:  The input supply for LDO3, LDO5, LDO6 and LDO7
- inl4-supply:  The input supply for LDO10, LDO11, LDO13 and LDO14
- inl5-supply:  The input supply for LDO9 and LDO19
- inl6-supply:  The input supply for LDO4, LDO21, LDO24 and LDO33
- inl7-supply:  The input supply for LDO18, LDO20, LDO28 and LDO29
- inl9-supply:  The input supply for LDO12, LDO23, LDO25, LDO26, LDO32 and LDO34
- inl10-supply: The input supply for LDO1 and LDO2

Optional nodes:
- regulators : The regulators of max77802 have to be instantiated
  under subnode named "regulators" using the following format.

@@ -58,6 +79,8 @@ Example:
		#address-cells = <1>;
		#size-cells = <0>;

		inb1-supply = <&parent_reg>;

		regulators {
			ldo1_reg: LDO1 {
				regulator-name = "vdd_1v0";
+1 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ Optional properties:
- regulator-always-on: boolean, regulator should never be disabled
- regulator-boot-on: bootloader/firmware enabled regulator
- regulator-allow-bypass: allow the regulator to go into bypass mode
- regulator-allow-set-load: allow the regulator performance level to be configured
- <name>-supply: phandle to the parent supply/regulator node
- regulator-ramp-delay: ramp delay for regulator(in uV/uS)
  For hardware which supports disabling ramp rate, it should be explicitly
+1 −1
Original line number Diff line number Diff line
@@ -627,7 +627,7 @@ config REGULATOR_TI_ABB

config REGULATOR_STW481X_VMMC
	bool "ST Microelectronics STW481X VMMC regulator"
	depends on MFD_STW481X
	depends on MFD_STW481X || COMPILE_TEST
	default y if MFD_STW481X
	help
	  This driver supports the internal VMMC regulator in the STw481x
+3 −0
Original line number Diff line number Diff line
@@ -76,6 +76,9 @@ static void of_get_regulation_constraints(struct device_node *np,
	if (of_property_read_bool(np, "regulator-allow-bypass"))
		constraints->valid_ops_mask |= REGULATOR_CHANGE_BYPASS;

	if (of_property_read_bool(np, "regulator-allow-set-load"))
		constraints->valid_ops_mask |= REGULATOR_CHANGE_DRMS;

	ret = of_property_read_u32(np, "regulator-ramp-delay", &pval);
	if (!ret) {
		if (pval)
+29 −6
Original line number Diff line number Diff line
@@ -69,12 +69,6 @@ static int pwm_regulator_set_voltage_sel(struct regulator_dev *rdev,

	drvdata->state = selector;

	ret = pwm_enable(drvdata->pwm);
	if (ret) {
		dev_err(&rdev->dev, "Failed to enable PWM\n");
		return ret;
	}

	return 0;
}

@@ -89,6 +83,29 @@ static int pwm_regulator_list_voltage(struct regulator_dev *rdev,
	return drvdata->duty_cycle_table[selector].uV;
}

static int pwm_regulator_enable(struct regulator_dev *dev)
{
	struct pwm_regulator_data *drvdata = rdev_get_drvdata(dev);

	return pwm_enable(drvdata->pwm);
}

static int pwm_regulator_disable(struct regulator_dev *dev)
{
	struct pwm_regulator_data *drvdata = rdev_get_drvdata(dev);

	pwm_disable(drvdata->pwm);

	return 0;
}

static int pwm_regulator_is_enabled(struct regulator_dev *dev)
{
	struct pwm_regulator_data *drvdata = rdev_get_drvdata(dev);

	return pwm_is_enabled(drvdata->pwm);
}

/**
 * Continuous voltage call-backs
 */
@@ -144,11 +161,17 @@ static struct regulator_ops pwm_regulator_voltage_table_ops = {
	.get_voltage_sel = pwm_regulator_get_voltage_sel,
	.list_voltage    = pwm_regulator_list_voltage,
	.map_voltage     = regulator_map_voltage_iterate,
	.enable          = pwm_regulator_enable,
	.disable         = pwm_regulator_disable,
	.is_enabled      = pwm_regulator_is_enabled,
};

static struct regulator_ops pwm_regulator_voltage_continuous_ops = {
	.get_voltage = pwm_regulator_get_voltage,
	.set_voltage = pwm_regulator_set_voltage,
	.enable          = pwm_regulator_enable,
	.disable         = pwm_regulator_disable,
	.is_enabled      = pwm_regulator_is_enabled,
};

static struct regulator_desc pwm_regulator_desc = {
Loading