Commit Graph

9 Commits

Author SHA1 Message Date
Mark Brown b735e47f6e Merge remote-tracking branch 'regulator/topic/devm' into regulator-next 2013-10-24 11:11:35 +01:00
Mark Brown 513b485a2d Merge remote-tracking branch 'regulator/topic/da9063' into regulator-next 2013-10-24 11:11:34 +01:00
Jingoo Han e97bba912e regulator: da9063: use devm_regulator_register()
Use devm_regulator_register() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-30 18:10:52 +01:00
Geert Uytterhoeven 0fdfd40aca regulator: da9063: Add missing initialization of da9063_reg_matches
With gcc 4.1.2:

drivers/regulator/da9063-regulator.c: In function ‘da9063_regulator_probe’:
drivers/regulator/da9063-regulator.c:847: warning: ‘da9063_reg_matches’ is used
uninitialized in this function

If the parent device already has platform data, da9063_reg_matches will
not be initialized.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-17 00:27:08 +01:00
Geert Uytterhoeven e8cb204c67 regulator: da9063: Fix PTR_ERR/ERR_PTR mismatch
If CONFIG_OF=n:

drivers/regulator/da9063-regulator.c: In function ‘da9063_parse_regulators_dt’:
drivers/regulator/da9063-regulator.c:712: warning: passing argument 1 of ‘PTR_ERR’ makes pointer from integer without a cast
drivers/regulator/da9063-regulator.c:712: warning: return makes pointer from integer without a cast

Use ERR_PTR() to encode an error code in a pointer.
PTR_ERR() is meant to decode an error code from a pointer.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-10 18:11:41 +01:00
Axel Lin 632b3d62bc regulator: da9063: Statize da9063_ldo_lim_event
da9063_ldo_lim_event() is only referenced in this driver, make it static.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-01 13:44:18 +01:00
Axel Lin e515800b74 regulator: da9063: Use IS_ERR to check return value of regulator_register()
regulator_register() does not return NULL, it returns ERR_PTR on error.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-30 15:24:42 +01:00
Axel Lin 556dcf903d regulator: da9063: Optimize da9063_set_current_limit implementation
All the current limit tables have the values in ascend order.
So we can slightly optimize the for loop iteration because the first match
is the minimal value.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-30 15:24:42 +01:00
Krystian Garbaciak 69ca3e58d1 regulator: da9063: Add Dialog DA9063 voltage regulators support.
The driver adds support for the following DA9063 PMIC regulators:
 - 11x LDOs (named LDO1 - LDO11),
 - 6x buck converters (BCORE1, BCORE2, BPRO, BMEM, BIO, BPERI),

Regulators provide following operations:
 - REGULATOR_CHANGE_STATUS and REGULATOR_CHANGE_VOLTAGE for all regulators,
 - REGULATOR_CHANGE_MODE for LDOs and buck converters, where:
     - LDOs allow REGULATOR_MODE_NORMAL and REGULATOR_MODE_STANDBY,
     - buck converters allow REGULATOR_MODE_FAST, REGULATOR_MODE_NORMAL
       and REGULATOR_MODE_STANDBY,
 - REGULATOR_CHANGE_CURRENT for buck converters (current limits).

The driver generates REGULATOR_EVENT_OVER_CURRENT for LDO3, LDO4, LDO7, LDO8
and LDO11.

Internally, PMIC provides two voltage configurations for normal and suspend
system state for each regulator. The driver switches between those on
suspend/wake-up to provide quick and fluent output voltage change.

This driver requires MFD core driver for operation.

Signed-off-by: Krystian Garbaciak <krystian.garbaciak@diasemi.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-29 19:34:59 +01:00