Commit graph

11 commits

Author SHA1 Message Date
Dan Murphy bff5e80715 regulator: lm363x: Add support for LM36274
Adding regulator support for the LM36274 backlight driver.
This device can leverage this existing code as the functionality
and registers are common enough between the LM36274 and the LM363x
series of devices.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Acked-by: Mark Brown <broonie@kernel.org>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
2019-06-06 20:38:38 +02:00
Axel Lin 55c083d896
regulator: lm363x: Constify regulator_ops
The lm363x_boost_voltage_table_ops and lm363x_regulator_voltage_table_ops
never need to be modified, make them const so compiler can put them to
.rodata.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-03 11:10:22 +07:00
Axel Lin 8a76f10721
regulator: lm363x: Use proper data type for regmap_read arguments
regmap_read() takes unsigned int reg and unsigned int *val arguments,
use proper data type for these arguments.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-03 11:09:59 +07:00
Axel Lin c68f47aa02
regulator: lm363x: Check return value of gpiod_get_index_optional
gpiod_get_index_optional can return ERR_PTR, add IS_ERR checking for it.
While at it, also remove a redundant NULL test for gpiod in error path.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-08 16:50:52 +00:00
Linus Walleij e8a33aa0e3
regulator: lm363x: Let core handle GPIO descriptor
Use the gpiod_get() rather than the devm_* version so that the
regulator core can handle the lifecycle of these descriptors.

Fixes: b2d751b7f6 ("regulator: lm363x: Pass descriptor instead of GPIO number")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-11 01:03:49 +00:00
Linus Walleij 63239e4bf7
regulator: Fetch enable gpiods nonexclusive
Since the core regulator code is treating GPIO descriptors as
nonexclusive, i.e. it assumes that the enable GPIO line may be
shared with several regulators, let's add the flag introduced
for fixing this problem on fixed regulators to all drivers
fetching GPIO descriptors to avoid possible regressions.

Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-15 10:48:59 +01:00
Linus Walleij b2d751b7f6
regulator: lm363x: Pass descriptor instead of GPIO number
Instead of passing a global GPIO number, pass a descriptor looked
up with the standard devm_gpiod_get_index_optional() call.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-24 16:50:28 +01:00
Milo Kim 9503b5085f regulator: lm363x: Use generic DT property name for external control pins
Vpos and Vneg LDOs can be enabled or disabled by external GPIOs.
Use general DT property 'enable-gpios' for this usage.
Two enable pins are differentiable by selecting the index number.

Signed-off-by: Milo Kim <milo.kim@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 14:59:22 +01:00
Axel Lin faa5cf3af3 regulator: lm363x: Staticise ldo_cont_enable_time
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-30 11:32:52 +00:00
Axel Lin a8bc6ca070 regulator: lm363x: Remove struct lm363x_regulator which is not necessary
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-30 11:32:48 +00:00
Milo Kim 3a8d1a73a0 regulator: add LM363X driver
LM363X regulator driver supports LM3631 and LM3632.
LM3631 has 5 regulators. LM3632 provides 3 regulators.
One boost output and LDOs are used for the display module.
Boost voltage is configurable but always on.
Supported operations for LDOs are enabled/disabled and voltage change.

Two LDOs of LM3632 can be controlled by external pins.
Those are configured through the DT properties.

Signed-off-by: Milo Kim <milo.kim@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-27 12:37:26 +00:00