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

Commit c16bcf03 authored by Mark Brown's avatar Mark Brown
Browse files

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

Merge remote-tracking branches 'regulator/topic/da9063', 'regulator/topic/doc', 'regulator/topic/fan53555', 'regulator/topic/gpio' and 'regulator/topic/ilim' into regulator-next
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -7,18 +7,20 @@ Optional properties:
- regulator-microvolt-offset: Offset applied to voltages to compensate for voltage drops
- regulator-min-microamp: smallest current consumers may set
- regulator-max-microamp: largest current consumers may set
- regulator-input-current-limit-microamp: maximum input current regulator allows
- 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
- <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
  intialised to zero (regulator-ramp-delay = <0>) for disabling ramp delay.
  initialised to zero (regulator-ramp-delay = <0>) for disabling ramp delay.
- regulator-enable-ramp-delay: The time taken, in microseconds, for the supply
  rail to reach the target voltage, plus/minus whatever tolerance the board
  design requires. This property describes the total system ramp time
  required due to the combination of internal ramping of the regulator itself,
  and board design issues such as trace capacitance and load on the supply.
- regulator-soft-start: Enable soft start so that voltage ramps slowly
- regulator-state-mem sub-root node for Suspend-to-RAM mode
  : suspend to memory, the device goes to sleep, but all data stored in memory,
  only some external interrupt can wake the device.
@@ -37,6 +39,9 @@ Optional properties:
- regulator-initial-mode: initial operating mode. The set of possible operating
  modes depends on the capabilities of every hardware so each device binding
  documentation explains which values the regulator supports.
- regulator-system-load: Load in uA present on regulator that is not captured by
  any consumer request.
- regulator-pull-down: Enable pull down resistor when the regulator is disabled.

Deprecated properties:
- regulator-compatible: If a regulator chip contains multiple
+1 −1
Original line number Diff line number Diff line
@@ -243,7 +243,7 @@ config REGULATOR_FAN53555

config REGULATOR_GPIO
	tristate "GPIO regulator support"
	depends on GPIOLIB
	depends on GPIOLIB || COMPILE_TEST
	help
	  This driver provides support for regulators that can be
	  controlled via gpios.
+27 −0
Original line number Diff line number Diff line
@@ -678,6 +678,8 @@ static int drms_uA_update(struct regulator_dev *rdev)
	list_for_each_entry(sibling, &rdev->consumer_list, list)
		current_uA += sibling->uA_load;

	current_uA += rdev->constraints->system_load;

	if (rdev->desc->ops->set_load) {
		/* set the optimum mode for our new total regulator load */
		err = rdev->desc->ops->set_load(rdev, current_uA);
@@ -1011,6 +1013,15 @@ static int set_machine_constraints(struct regulator_dev *rdev,
	if (ret != 0)
		goto out;

	if (rdev->constraints->ilim_uA && ops->set_input_current_limit) {
		ret = ops->set_input_current_limit(rdev,
						   rdev->constraints->ilim_uA);
		if (ret < 0) {
			rdev_err(rdev, "failed to set input limit\n");
			goto out;
		}
	}

	/* do we need to setup our suspend state */
	if (rdev->constraints->initial_state) {
		ret = suspend_prepare(rdev, rdev->constraints->initial_state);
@@ -1054,6 +1065,22 @@ static int set_machine_constraints(struct regulator_dev *rdev,
		}
	}

	if (rdev->constraints->pull_down && ops->set_pull_down) {
		ret = ops->set_pull_down(rdev);
		if (ret < 0) {
			rdev_err(rdev, "failed to set pull down\n");
			goto out;
		}
	}

	if (rdev->constraints->soft_start && ops->set_soft_start) {
		ret = ops->set_soft_start(rdev);
		if (ret < 0) {
			rdev_err(rdev, "failed to set soft start\n");
			goto out;
		}
	}

	print_constraints(rdev);
	return 0;
out:
+3 −18
Original line number Diff line number Diff line
@@ -117,9 +117,6 @@ struct da9063_regulator {

/* Encapsulates all information for the regulators driver */
struct da9063_regulators {
	int					irq_ldo_lim;
	int					irq_uvov;

	unsigned				n_regulators;
	/* Array size to be defined during init. Keep at end. */
	struct da9063_regulator			regulator[0];
@@ -867,26 +864,15 @@ static int da9063_regulator_probe(struct platform_device *pdev)
		return irq;
	}

	ret = request_threaded_irq(irq,
	ret = devm_request_threaded_irq(&pdev->dev, irq,
				NULL, da9063_ldo_lim_event,
				IRQF_TRIGGER_LOW | IRQF_ONESHOT,
				"LDO_LIM", regulators);
	if (ret) {
		dev_err(&pdev->dev,
				"Failed to request LDO_LIM IRQ.\n");
		regulators->irq_ldo_lim = -ENXIO;
	}

	return 0;
		dev_err(&pdev->dev, "Failed to request LDO_LIM IRQ.\n");
		return ret;
	}

static int da9063_regulator_remove(struct platform_device *pdev)
{
	struct da9063_regulators *regulators = platform_get_drvdata(pdev);

	free_irq(regulators->irq_ldo_lim, regulators);
	free_irq(regulators->irq_uvov, regulators);

	return 0;
}

@@ -895,7 +881,6 @@ static struct platform_driver da9063_regulator_driver = {
		.name = DA9063_DRVNAME_REGULATORS,
	},
	.probe = da9063_regulator_probe,
	.remove = da9063_regulator_remove,
};

static int __init da9063_regulator_init(void)
+1 −0
Original line number Diff line number Diff line
@@ -182,6 +182,7 @@ static int fan53555_set_ramp(struct regulator_dev *rdev, int ramp)
static struct regulator_ops fan53555_regulator_ops = {
	.set_voltage_sel = regulator_set_voltage_sel_regmap,
	.get_voltage_sel = regulator_get_voltage_sel_regmap,
	.set_voltage_time_sel = regulator_set_voltage_time_sel,
	.map_voltage = regulator_map_voltage_linear,
	.list_voltage = regulator_list_voltage_linear,
	.set_suspend_voltage = fan53555_set_suspend_voltage,
Loading