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

Commit 0603b37e authored by Mark Brown's avatar Mark Brown
Browse files

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

Merge remote-tracking branches 'regulator/topic/helpers', 'regulator/topic/hi655x', 'regulator/topic/lm363x', 'regulator/topic/ltc3589' and 'regulator/topic/ltc3676' into regulator-next
Loading
Loading
Loading
Loading
+76 −2
Original line number Diff line number Diff line
@@ -8,8 +8,8 @@ Required property:

Optional properties:
  LM3632 has external enable pins for two LDOs.
  - ti,lcm-en1-gpio: A GPIO specifier for Vpos control pin.
  - ti,lcm-en2-gpio: A GPIO specifier for Vneg control pin.
  - enable-gpios: Two GPIO specifiers for Vpos and Vneg control pins.
                  The first entry is Vpos, the second is Vneg enable pin.

Child nodes:
  LM3631
@@ -30,5 +30,79 @@ Child nodes:

Examples: Please refer to ti-lmu dt-bindings [2].

lm3631@29 {
	compatible = "ti,lm3631";
	reg = <0x29>;

	regulators {
		compatible = "ti,lm363x-regulator";

		vboost {
			regulator-name = "lcd_boost";
			regulator-min-microvolt = <4500000>;
			regulator-max-microvolt = <6350000>;
			regulator-always-on;
		};

		vcont {
			regulator-name = "lcd_vcont";
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <3300000>;
		};

		voref {
			regulator-name = "lcd_voref";
			regulator-min-microvolt = <4000000>;
			regulator-max-microvolt = <6000000>;
		};

		vpos {
			regulator-name = "lcd_vpos";
			regulator-min-microvolt = <4000000>;
			regulator-max-microvolt = <6000000>;
			regulator-boot-on;
		};

		vneg {
			regulator-name = "lcd_vneg";
			regulator-min-microvolt = <4000000>;
			regulator-max-microvolt = <6000000>;
			regulator-boot-on;
		};
	};
};

lm3632@11 {
	compatible = "ti,lm3632";
	reg = <0x11>;

	regulators {
		compatible = "ti,lm363x-regulator";

		/* GPIO1_16 for Vpos, GPIO1_28 is for Vneg */
		enable-gpios = <&gpio1 16 GPIO_ACTIVE_HIGH>,
				<&gpio1 28 GPIO_ACTIVE_HIGH>;

		vboost {
			regulator-name = "lcd_boost";
			regulator-min-microvolt = <4500000>;
			regulator-max-microvolt = <6400000>;
			regulator-always-on;
		};

		vpos {
			regulator-name = "lcd_vpos";
			regulator-min-microvolt = <4000000>;
			regulator-max-microvolt = <6000000>;
		};

		vneg {
			regulator-name = "lcd_vneg";
			regulator-min-microvolt = <4000000>;
			regulator-max-microvolt = <6000000>;
		};
	};
};

[1] ../regulator/regulator.txt
[2] ../mfd/ti-lmu.txt
+36 −0
Original line number Diff line number Diff line
@@ -445,6 +445,42 @@ int regulator_set_bypass_regmap(struct regulator_dev *rdev, bool enable)
}
EXPORT_SYMBOL_GPL(regulator_set_bypass_regmap);

/**
 * regulator_set_soft_start_regmap - Default set_soft_start() using regmap
 *
 * @rdev: device to operate on.
 */
int regulator_set_soft_start_regmap(struct regulator_dev *rdev)
{
	unsigned int val;

	val = rdev->desc->soft_start_val_on;
	if (!val)
		val = rdev->desc->soft_start_mask;

	return regmap_update_bits(rdev->regmap, rdev->desc->soft_start_reg,
				  rdev->desc->soft_start_mask, val);
}
EXPORT_SYMBOL_GPL(regulator_set_soft_start_regmap);

/**
 * regulator_set_pull_down_regmap - Default set_pull_down() using regmap
 *
 * @rdev: device to operate on.
 */
int regulator_set_pull_down_regmap(struct regulator_dev *rdev)
{
	unsigned int val;

	val = rdev->desc->pull_down_val_on;
	if (!val)
		val = rdev->desc->pull_down_mask;

	return regmap_update_bits(rdev->regmap, rdev->desc->pull_down_reg,
				  rdev->desc->pull_down_mask, val);
}
EXPORT_SYMBOL_GPL(regulator_set_pull_down_regmap);

/**
 * regulator_get_bypass_regmap - Default get_bypass() using regmap
 *
+7 −0
Original line number Diff line number Diff line
@@ -214,7 +214,14 @@ static int hi655x_regulator_probe(struct platform_device *pdev)
	return 0;
}

static const struct platform_device_id hi655x_regulator_table[] = {
	{ .name = "hi655x-regulator" },
	{},
};
MODULE_DEVICE_TABLE(platform, hi655x_regulator_table);

static struct platform_driver hi655x_regulator_driver = {
	.id_table = hi655x_regulator_table,
	.driver = {
		.name	= "hi655x-regulator",
	},
+2 −2
Original line number Diff line number Diff line
@@ -227,9 +227,9 @@ static int lm363x_regulator_of_get_enable_gpio(struct device_node *np, int id)
	 */
	switch (id) {
	case LM3632_LDO_POS:
		return of_get_named_gpio(np, "ti,lcm-en1-gpio", 0);
		return of_get_named_gpio(np, "enable-gpios", 0);
	case LM3632_LDO_NEG:
		return of_get_named_gpio(np, "ti,lcm-en2-gpio", 0);
		return of_get_named_gpio(np, "enable-gpios", 1);
	default:
		return -EINVAL;
	}
+24 −1
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/regmap.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/of_regulator.h>
@@ -470,6 +471,10 @@ static int ltc3589_probe(struct i2c_client *client,
		return -ENOMEM;

	i2c_set_clientdata(client, ltc3589);
	if (client->dev.of_node)
		ltc3589->variant = (enum ltc3589_variant)
			of_device_get_match_data(&client->dev);
	else
		ltc3589->variant = id->driver_data;
	ltc3589->dev = dev;

@@ -542,9 +547,27 @@ static struct i2c_device_id ltc3589_i2c_id[] = {
};
MODULE_DEVICE_TABLE(i2c, ltc3589_i2c_id);

static const struct of_device_id ltc3589_of_match[] = {
	{
		.compatible = "lltc,ltc3589",
		.data = (void *)LTC3589,
	},
	{
		.compatible = "lltc,ltc3589-1",
		.data = (void *)LTC3589_1,
	},
	{
		.compatible = "lltc,ltc3589-2",
		.data = (void *)LTC3589_2,
	},
	{ },
};
MODULE_DEVICE_TABLE(of, ltc3589_of_match);

static struct i2c_driver ltc3589_driver = {
	.driver = {
		.name = DRIVER_NAME,
		.of_match_table = of_match_ptr(ltc3589_of_match),
	},
	.probe = ltc3589_probe,
	.id_table = ltc3589_i2c_id,
Loading