Commit Graph

8 Commits

Author SHA1 Message Date
Stephen Boyd 6ee5c04407 regulator: qcom_spmi: Keep trying to add regulators if read fails
On some designs, a handful of the regulators can't be read via
SPMI transactions because they're "secure" and not intended to be
touched by non-secure processors. This driver unconditionally
attempts to read the id registers of all the regulators though,
leading to probe failing and no regulators being registered.
Let's ignore any errors from failing to read the registers and
keep adding other regulators so that this driver can probe on
such devices.

Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-03-28 10:41:02 +01:00
Stephen Boyd 50314e55a1 regulator: qcom_spmi: Add support for pm8994
Document the regulators available on pm8994 and add support for
this PMIC to the SPMI PMIC regulator driver.

Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-03-28 10:41:02 +01:00
Stephen Boyd e2adfacde6 regulator: qcom-spmi: Add vendor specific configuration
Add support for over current protection (OCP), pin control
selection, soft start strength, and auto-mode.

Cc: <devicetree@vger.kernel.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-24 18:29:45 +01:00
Axel Lin 5d506a5ad4 regulator: qcom_spmi-regulator: Use DIV_ROUND_UP instead of open-coded
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Andy Gross <agross@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-09 19:02:42 +01:00
Axel Lin 419d06a1cf regulator: qcom_spmi: Fix calculating number of voltages
n /= range->step_uV + 1; is equivalent to n /= (range->step_uV + 1);
which is wrong. Fix it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-19 16:28:17 +01:00
Stephen Boyd 9b2dfee395 regulator: qcom_spmi: Add missing braces for aligned code
drivers/regulator/qcom_spmi-regulator.c:751:3-50: code aligned
with following code on line 753
drivers/regulator/qcom_spmi-regulator.c:584:3-41: code aligned
with following code on line 587

These lines where missing braces causing the break to always
be executed even when it shouldn't be. Fix it.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Reviewed-by: Andy Gross <agross@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-17 08:54:19 +01:00
Julia Lawall 0f94bffad4 regulator: fix simple_return.cocci warnings
Simplify a trivial if-return sequence and combine with a
preceding function call.

Generated by: scripts/coccinelle/misc/simple_return.cocci

CC: Mark Brown <broonie@kernel.org>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16 15:58:53 +01:00
Stephen Boyd e92a404741 regulator: Add QCOM SPMI regulator driver
Add an SPMI regulator driver for Qualcomm's PM8841, PM8941, and
PM8916 PMICs. This driver is based largely on code from
codeaurora.org[1].

[1] https://www.codeaurora.org/cgit/quic/la/kernel/msm-3.10/tree/drivers/regulator/qpnp-regulator.c?h=msm-3.10
Cc: David Collins <collinsd@codeaurora.org>
Cc: <devicetree@vger.kernel.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16 12:14:54 +01:00