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

Commit 95528a55 authored by Mark Brown's avatar Mark Brown
Browse files

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

Merge remote-tracking branches 'regulator/topic/as3711', 'regulator/topic/axp20x', 'regulator/topic/bcm590xx' and 'regulator/topic/da9211' into regulator-next
Loading
Loading
Loading
Loading
+63 −0
Original line number Diff line number Diff line
* Dialog Semiconductor DA9211/DA9213 Voltage Regulator

Required properties:
- compatible: "dlg,da9211" or "dlg,da9213".
- reg: I2C slave address, usually 0x68.
- interrupts: the interrupt outputs of the controller
- regulators: A node that houses a sub-node for each regulator within the
  device. Each sub-node is identified using the node's name, with valid
  values listed below. The content of each sub-node is defined by the
  standard binding for regulators; see regulator.txt.
  BUCKA and BUCKB.

Optional properties:
- Any optional property defined in regulator.txt

Example 1) DA9211

	pmic: da9211@68 {
		compatible = "dlg,da9211";
		reg = <0x68>;
		interrupts = <3 27>;

		regulators {
			BUCKA {
				regulator-name = "VBUCKA";
				regulator-min-microvolt = < 300000>;
				regulator-max-microvolt = <1570000>;
				regulator-min-microamp 	= <2000000>;
				regulator-max-microamp 	= <5000000>;
			};
			BUCKB {
				regulator-name = "VBUCKB";
				regulator-min-microvolt = < 300000>;
				regulator-max-microvolt = <1570000>;
				regulator-min-microamp 	= <2000000>;
				regulator-max-microamp 	= <5000000>;
			};
		};
	};

Example 2) DA92113
	pmic: da9213@68 {
		compatible = "dlg,da9213";
		reg = <0x68>;
		interrupts = <3 27>;

		regulators {
			BUCKA {
				regulator-name = "VBUCKA";
				regulator-min-microvolt = < 300000>;
				regulator-max-microvolt = <1570000>;
				regulator-min-microamp 	= <3000000>;
				regulator-max-microamp 	= <6000000>;
			};
			BUCKB {
				regulator-name = "VBUCKB";
				regulator-min-microvolt = < 300000>;
				regulator-max-microvolt = <1570000>;
				regulator-min-microamp 	= <3000000>;
				regulator-max-microamp 	= <6000000>;
			};
		};
	};
+5 −4
Original line number Diff line number Diff line
@@ -199,13 +199,14 @@ config REGULATOR_DA9210
	  interface.

config REGULATOR_DA9211
	tristate "Dialog Semiconductor DA9211/DA9212 regulator"
	tristate "Dialog Semiconductor DA9211/DA9212/DA9213/DA9214 regulator"
	depends on I2C
	select REGMAP_I2C
	help
	  Say y here to support for the Dialog Semiconductor DA9211/DA9212.
	  The DA9211/DA9212 is a multi-phase synchronous step down
	  converter 12A DC-DC Buck controlled through an I2C
	  Say y here to support for the Dialog Semiconductor DA9211/DA9212
	  /DA9213/DA9214.
	  The DA9211/DA9212/DA9213/DA9214 is a multi-phase synchronous
	  step down converter 12A or 16A DC-DC Buck controlled through an I2C
	  interface.

config REGULATOR_DBX500_PRCMU
+28 −33
Original line number Diff line number Diff line
@@ -22,12 +22,10 @@

struct as3711_regulator_info {
	struct regulator_desc	desc;
	unsigned int		max_uV;
};

struct as3711_regulator {
	struct as3711_regulator_info *reg_info;
	struct regulator_dev *rdev;
};

/*
@@ -132,7 +130,7 @@ static const struct regulator_linear_range as3711_dldo_ranges[] = {
	REGULATOR_LINEAR_RANGE(1750000, 0x20, 0x3f, 50000),
};

#define AS3711_REG(_id, _en_reg, _en_bit, _vmask, _vshift, _min_uV, _max_uV, _sfx)	\
#define AS3711_REG(_id, _en_reg, _en_bit, _vmask, _sfx)			   \
	[AS3711_REGULATOR_ ## _id] = {					   \
	.desc = {							   \
		.name = "as3711-regulator-" # _id,			   \
@@ -142,29 +140,27 @@ static const struct regulator_linear_range as3711_dldo_ranges[] = {
		.type = REGULATOR_VOLTAGE,				   \
		.owner = THIS_MODULE,					   \
		.vsel_reg = AS3711_ ## _id ## _VOLTAGE,			   \
		.vsel_mask = _vmask << _vshift,						\
		.vsel_mask = _vmask,					   \
		.enable_reg = AS3711_ ## _en_reg,			   \
		.enable_mask = BIT(_en_bit),				   \
		.min_uV	= _min_uV,							\
		.linear_ranges = as3711_ ## _sfx ## _ranges,		   \
		.n_linear_ranges = ARRAY_SIZE(as3711_ ## _sfx ## _ranges), \
	},								   \
	.max_uV = _max_uV,								\
}

static struct as3711_regulator_info as3711_reg_info[] = {
	AS3711_REG(SD_1, SD_CONTROL, 0, 0x7f, 0, 612500, 3350000, sd),
	AS3711_REG(SD_2, SD_CONTROL, 1, 0x7f, 0, 612500, 3350000, sd),
	AS3711_REG(SD_3, SD_CONTROL, 2, 0x7f, 0, 612500, 3350000, sd),
	AS3711_REG(SD_4, SD_CONTROL, 3, 0x7f, 0, 612500, 3350000, sd),
	AS3711_REG(LDO_1, LDO_1_VOLTAGE, 7, 0x1f, 0, 1200000, 3300000, aldo),
	AS3711_REG(LDO_2, LDO_2_VOLTAGE, 7, 0x1f, 0, 1200000, 3300000, aldo),
	AS3711_REG(LDO_3, LDO_3_VOLTAGE, 7, 0x3f, 0, 900000, 3300000, dldo),
	AS3711_REG(LDO_4, LDO_4_VOLTAGE, 7, 0x3f, 0, 900000, 3300000, dldo),
	AS3711_REG(LDO_5, LDO_5_VOLTAGE, 7, 0x3f, 0, 900000, 3300000, dldo),
	AS3711_REG(LDO_6, LDO_6_VOLTAGE, 7, 0x3f, 0, 900000, 3300000, dldo),
	AS3711_REG(LDO_7, LDO_7_VOLTAGE, 7, 0x3f, 0, 900000, 3300000, dldo),
	AS3711_REG(LDO_8, LDO_8_VOLTAGE, 7, 0x3f, 0, 900000, 3300000, dldo),
	AS3711_REG(SD_1, SD_CONTROL, 0, 0x7f, sd),
	AS3711_REG(SD_2, SD_CONTROL, 1, 0x7f, sd),
	AS3711_REG(SD_3, SD_CONTROL, 2, 0x7f, sd),
	AS3711_REG(SD_4, SD_CONTROL, 3, 0x7f, sd),
	AS3711_REG(LDO_1, LDO_1_VOLTAGE, 7, 0x1f, aldo),
	AS3711_REG(LDO_2, LDO_2_VOLTAGE, 7, 0x1f, aldo),
	AS3711_REG(LDO_3, LDO_3_VOLTAGE, 7, 0x3f, dldo),
	AS3711_REG(LDO_4, LDO_4_VOLTAGE, 7, 0x3f, dldo),
	AS3711_REG(LDO_5, LDO_5_VOLTAGE, 7, 0x3f, dldo),
	AS3711_REG(LDO_6, LDO_6_VOLTAGE, 7, 0x3f, dldo),
	AS3711_REG(LDO_7, LDO_7_VOLTAGE, 7, 0x3f, dldo),
	AS3711_REG(LDO_8, LDO_8_VOLTAGE, 7, 0x3f, dldo),
	/* StepUp output voltage depends on supplying regulator */
};

@@ -263,7 +259,6 @@ static int as3711_regulator_probe(struct platform_device *pdev)
				ri->desc.name);
			return PTR_ERR(rdev);
		}
		reg->rdev = rdev;
	}
	platform_set_drvdata(pdev, regs);
	return 0;
+1 −1
Original line number Diff line number Diff line
@@ -245,7 +245,7 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
	for (i = 0; i < AXP20X_REG_ID_MAX; i++) {
		init_data = axp20x_matches[i].init_data;

		config.dev = &pdev->dev;
		config.dev = pdev->dev.parent;
		config.init_data = init_data;
		config.regmap = axp20x->regmap;
		config.of_node = axp20x_matches[i].of_node;
+0 −8
Original line number Diff line number Diff line
@@ -202,7 +202,6 @@ static struct bcm590xx_info bcm590xx_regs[] = {
struct bcm590xx_reg {
	struct regulator_desc *desc;
	struct bcm590xx *mfd;
	struct bcm590xx_info **info;
};

static int bcm590xx_get_vsel_register(int id)
@@ -389,11 +388,6 @@ static int bcm590xx_probe(struct platform_device *pdev)
	if (!pmu->desc)
		return -ENOMEM;

	pmu->info = devm_kzalloc(&pdev->dev, BCM590XX_NUM_REGS *
			sizeof(struct bcm590xx_info *), GFP_KERNEL);
	if (!pmu->info)
		return -ENOMEM;

	info = bcm590xx_regs;

	for (i = 0; i < BCM590XX_NUM_REGS; i++, info++) {
@@ -403,8 +397,6 @@ static int bcm590xx_probe(struct platform_device *pdev)
			reg_data = NULL;

		/* Register the regulators */
		pmu->info[i] = info;

		pmu->desc[i].name = info->name;
		pmu->desc[i].supply_name = info->vin_name;
		pmu->desc[i].id = i;
Loading