History log of /linux-master/drivers/regulator/qcom_smd-regulator.c
Revision Date Author Comments
# 5df3b41b 09-Jan-2024 Konrad Dybcio <konrad.dybcio@linaro.org>

regulator: qcom_smd: Keep one rpm handle for all vregs

For no apparent reason (as there's just one RPM per SoC), all vregs
currently store a copy of a pointer to smd_rpm. Introduce a single,
global one to save up on space in each definition.

bloat-o-meter reports a slight uptick:

Total: Before=44008, After=44080, chg +0.16%

However the saved n * sizeof(ptr) for every dynamically allocated
regulator quickly makes up for it.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://msgid.link/r/20240109-rpm_vreg_cleanup-v3-1-fa0201029f78@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# ad663ce6 14-Dec-2023 Varadarajan Narayanan <quic_varada@quicinc.com>

regulator: qcom_smd: Add LDO5 MP5496 regulator

Add support for LDO5 regulator. This is used by IPQ9574 USB.

Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
Rule: <add>
Link: https://lore.kernel.org/stable/20231214104052.3267039-1-quic_varada%40quicinc.com
Link: https://msgid.link/r/20231214104052.3267039-1-quic_varada@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 18cc1cd0 06-Nov-2023 Dang Huynh <danct12@riseup.net>

regulator: qcom_smd: Add PM8937 regulators

The PM8937 is found on boards with MSM8917, MSM8937, MSM8940 SoCs and
APQ variants.

It provides 6 SMPS (two are controlled by SPMI) and 23 LDO regulators.

Signed-off-by: Dang Huynh <danct12@riseup.net>
Reviewed-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20231106-pm8937-v1-5-ec51d9eeec53@riseup.net
Signed-off-by: Mark Brown <broonie@kernel.org>


# 045a44d4 14-Jul-2023 Rob Herring <robh@kernel.org>

regulator: Explicitly include correct DT includes

The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230714174930.4063320-1-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 60bbee7d 07-Apr-2023 Devi Priya <quic_devipriy@quicinc.com>

regulator: qcom_smd: Add MP5496 S1 regulator

Adding support for MP5496 S1 regulator on IPQ9574 SoC.

Co-developed-by: Praveenkumar I <quic_ipkumar@quicinc.com>
Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
Signed-off-by: Devi Priya <quic_devipriy@quicinc.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20230407155727.20615-3-quic_devipriy@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 259b93b2 16-Mar-2023 Douglas Anderson <dianders@chromium.org>

regulator: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in 4.14

Probing of regulators can be a slow operation and can contribute to
slower boot times. This is especially true if a regulator is turned on
at probe time (with regulator-boot-on or regulator-always-on) and the
regulator requires delays (off-on-time, ramp time, etc).

While the overall kernel is not ready to switch to async probe by
default, as per the discussion on the mailing lists [1] it is believed
that the regulator subsystem is in good shape and we can move
regulator drivers over wholesale. There is no way to just magically
opt in all regulators (regulators are just normal drivers like
platform_driver), so we set PROBE_PREFER_ASYNCHRONOUS for all
regulators found in 'drivers/regulator' individually.

Given the number of drivers touched and the impossibility to test this
ahead of time, it wouldn't be shocking at all if this caused a
regression for someone. If there is a regression caused by this patch,
it's likely to be one of the cases talked about in [1]. As a "quick
fix", drivers involved in the regression could be fixed by changing
them to PROBE_FORCE_SYNCHRONOUS. That being said, the correct fix
would be to directly fix the problem that caused the issue with async
probe.

The approach here follows a similar approach that was used for the mmc
subsystem several years ago [2]. In fact, I ran nearly the same python
script to auto-generate the changes. The only thing I changed was to
search for "i2c_driver", "spmi_driver", and "spi_driver" in addition
to "platform_driver".

[1] https://lore.kernel.org/r/06db017f-e985-4434-8d1d-02ca2100cca0@sirena.org.uk
[2] https://lore.kernel.org/r/20200903232441.2694866-1-dianders@chromium.org/

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20230316125351.1.I2a4677392a38db5758dee0788b2cea5872562a82@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>


# 91016037 10-Nov-2022 Konrad Dybcio <konrad.dybcio@linaro.org>

regulator: qcom_smd: Fix PMR735a S3 regulator spec

PMR735a has a wider range than previously defined. Fix it.

Fixes: 0cda8c43aa24 ("regulator: qcom_smd: Add PMR735a regulators")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20221110121225.9216-1-konrad.dybcio@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 0cda8c43 08-Nov-2022 Konrad Dybcio <konrad.dybcio@linaro.org>

regulator: qcom_smd: Add PMR735a regulators

PMR735a is already supported in the RPMH regulator driver, but
there are cases where it's bundled with SMD RPM SoCs. Port it over
to qcom_smd-regulator to enable usage in such cases.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20221109110846.45789-2-konrad.dybcio@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 95b5f3ef 02-Aug-2022 Iskren Chernev <iskren.chernev@gmail.com>

regulator: qcom_smd: Add PM6125 RPM regulators

The ranges and types are taken from the relevant SPMI driver:

- ftsmps_510: s1-s4, s8
- buck_510: s5-s7
- ldo_nX_510: l1-l4, l6-l8, l17-18
- ldo_mv_pX_510: l5, l15, l19-l24
- ldo_lv_pX_510: l9-l14, l16

Signed-off-by: Adam Skladowski <a39.skl@gmail.com>
Signed-off-by: Iskren Chernev <iskren.chernev@gmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20220802221112.2280686-14-iskren.chernev@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# a39d0100 02-Aug-2022 Iskren Chernev <iskren.chernev@gmail.com>

regulator: qcom_smd: Sort pmics alphabetically (part 3)

The sorting is split in multiple commits for easier reviewing.

Signed-off-by: Iskren Chernev <iskren.chernev@gmail.com>
Link: https://lore.kernel.org/r/20220802221112.2280686-13-iskren.chernev@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 13b3d005 02-Aug-2022 Iskren Chernev <iskren.chernev@gmail.com>

regulator: qcom_smd: Sort pmics alphabetically (part 2)

The sorting is split in multiple commits for easier reviewing.

Signed-off-by: Iskren Chernev <iskren.chernev@gmail.com>
Link: https://lore.kernel.org/r/20220802221112.2280686-12-iskren.chernev@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 8e584e84 02-Aug-2022 Iskren Chernev <iskren.chernev@gmail.com>

regulator: qcom_smd: Sort pmics alphabetically (part 1)

The sorting is split in multiple commits for easier reviewing.

Signed-off-by: Iskren Chernev <iskren.chernev@gmail.com>
Link: https://lore.kernel.org/r/20220802221112.2280686-11-iskren.chernev@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# bc4d1932 23-Jun-2022 Stephan Gerhold <stephan.gerhold@kernkonzept.com>

regulator: qcom_smd: Add PM8909 RPM regulators

The set of regulators available in the PM8909 PMIC is similar to PM8916
which is already supported by the driver. s3, s4 and l16 are missing.
However, probing the SPMI hardware identification registers using the
qcom_spmi-regulator driver reveals that the regulators in PM8909 are
actually some kind of mixture between PM8916 and PM8226:

- ult_lo_smps (= pm8916_buck_lvo_smps): s1
- ult_ho_smps (= pm8916_buck_hvo_smps): s2
- ult_nldo (= pm8916_nldo): l1, l2, l3, l10
- ult_pldo (= pm8916_pldo): l4, l8, l9, l12-l15, l17, l18
- pldo (= pm8226_pldo): l5, l6, l7, l11

Use this mapping to add the rpm_regulator_data for PM8909 by reusing
the existing regulator definitions.

Signed-off-by: Stephan Gerhold <stephan.gerhold@kernkonzept.com>
Link: https://lore.kernel.org/r/20220623094614.1410180-4-stephan.gerhold@kernkonzept.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# e8977917 23-Jun-2022 Stephan Gerhold <stephan.gerhold@kernkonzept.com>

regulator: qcom_smd: Fix pm8916_pldo range

The PM8916 device specification [1] documents a programmable range of
1.75V to 3.337V with 12.5mV steps for the PMOS LDOs in PM8916. This
range is also used when controlling the regulator directly using the
qcom_spmi-regulator driver ("ult_pldo" there).

However, for some reason the qcom_smd-regulator driver allows a much
larger range for the same hardware component. This could be simply a
typo, since the start of the range is essentially just missing a '1'.

In practice this does not cause any major problems, since the driver
just sends the actual voltage to the RPM firmware instead of making use
of the incorrect voltage selector. Still, having the wrong range there
is confusing and prevents the regulator core from validating requests
correctly.

[1]: https://developer.qualcomm.com/download/sd410/pm8916pm8916-1-power-management-ic-device-specification.pdf

Fixes: 57d6567680ed ("regulator: qcom-smd: Add PM8916 support")
Signed-off-by: Stephan Gerhold <stephan.gerhold@kernkonzept.com>
Link: https://lore.kernel.org/r/20220623094614.1410180-2-stephan.gerhold@kernkonzept.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# f210f387 04-Jun-2022 Robert Marko <robimarko@gmail.com>

regulator: qcom_smd: add get_voltage to MP5496

Add the get_voltage OP to MP5496 ops using the generic rpm_reg_get_voltage.

Signed-off-by: Robert Marko <robimarko@gmail.com>
Link: https://lore.kernel.org/r/20220604193300.125758-1-robimarko@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 122e951e 04-Jun-2022 Robert Marko <robimarko@gmail.com>

regulator: qcom_smd: correct MP5496 ranges

Currently set MP5496 Buck and LDO ranges dont match its datasheet[1].
According to the datasheet:
Buck range is 0.6-2.1875V with a 12.5mV step
LDO range is 0.8-3.975V with a 25mV step.

So, correct the ranges according to the datasheet[1].

[1] https://www.monolithicpower.com/en/documentview/productdocument/index/version/2/document_type/Datasheet/lang/en/sku/MP5496GR/document_id/6906/

Signed-off-by: Robert Marko <robimarko@gmail.com>
Link: https://lore.kernel.org/r/20220604193300.125758-2-robimarko@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# b11b3d21 30-Apr-2022 Konrad Dybcio <konrad.dybcio@somainline.org>

regulator: qcom_smd: Fix up PM8950 regulator configuration

Following changes have been made:

- S5, L4, L18, L20 and L21 were removed (S5 is managed by
SPMI, whereas the rest seems not to exist [or at least it's blocked
by Sony Loire /MSM8956/ RPM firmware])

- Supply maps have were adjusted to reflect regulator changes.

Fixes: e44adca5fa25 ("regulator: qcom_smd: Add PM8950 regulators")
Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Link: https://lore.kernel.org/r/20220430163753.609909-1-konrad.dybcio@somainline.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 6390d42c 14-Jan-2022 kernel test robot <lkp@intel.com>

regulator: qcom_smd: fix for_each_child.cocci warnings

drivers/regulator/qcom_smd-regulator.c:1318:1-33: WARNING: Function "for_each_available_child_of_node" should have of_node_put() before return around line 1321.

Semantic patch information:
False positives can be due to function calls within the for_each
loop that may encapsulate an of_node_put.

Generated by: scripts/coccinelle/iterators/for_each_child.cocci

Fixes: 14e2976fbabd ("regulator: qcom_smd: Align probe function with rpmh-regulator")
CC: Konrad Dybcio <konrad.dybcio@somainline.org>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
Link: https://lore.kernel.org/r/alpine.DEB.2.22.394.2201151210170.3051@hadrien
Signed-off-by: Mark Brown <broonie@kernel.org>


# 14e2976f 29-Dec-2021 Konrad Dybcio <konrad.dybcio@somainline.org>

regulator: qcom_smd: Align probe function with rpmh-regulator

The RPMh regulator driver is much newer and gets more attention, which in
consequence makes it do a few things better. Update qcom_smd-regulator's
probe function to mimic what rpmh-regulator does to address a couple of
issues:

- Probe defer now works correctly, before it used to, well,
kinda just die.. This fixes reliable probing on (at least) PM8994,
because Linux apparently cannot deal with supply map dependencies yet..

- Regulator data is now matched more sanely: regulator data is matched
against each individual regulator node name and throwing an -EINVAL if
data is missing, instead of just assuming everything is fine and
iterating over all subsequent array members.

- status = "disabled" will now work for disabling individual regulators in
DT. Previously it didn't seem to do much if anything at all.

Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Link: https://lore.kernel.org/r/20211230023442.1123424-1-konrad.dybcio@somainline.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 400c9315 26-Sep-2021 Shawn Guo <shawn.guo@linaro.org>

regulator: qcom_smd: Add PM2250 regulators

PM2250 is commonly used with QCM2290/QCS2290 SoCs, and provides 4 SMPS
and 22 LDO regulators. The LDO regulators are the same types found on
PM660.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Link: https://lore.kernel.org/r/20210926084549.29880-3-shawn.guo@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# e0f33921 20-May-2021 Axel Lin <axel.lin@ingics.com>

regulator: qcom_smd: Make pm8953_lnldo linear_ranges entries properly sorted

For better readability, make linear_ranges entries sort by selector.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Message-Id: <20210520112719.1814396-1-axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@sirena.org.uk>


# 8c816d56 02-May-2021 Bartosz Dudziak <bartosz.dudziak@snejp.pl>

regulator: qcom_smd: Add PM8226 regulator support

Add support for PM8226 regulator which is commonly used with MSM8226 SoCs.

Signed-off-by: Bartosz Dudziak <bartosz.dudziak@snejp.pl>
Link: https://lore.kernel.org/r/20210502115304.8570-2-bartosz.dudziak@snejp.pl
Signed-off-by: Mark Brown <broonie@kernel.org>


# b1a2fb10 04-Oct-2020 Vladimir Lypak <junak.pub@gmail.com>

regulator: qcom_smd: add pm8953 regulators

The PM8953 is commonly used on board with MSM8953 SoCs or its variants:
APQ8053, SDM(SDA)450 and SDM(SDA)632.
It provides 7 SMPS and 23 LDO regulators.

Signed-off-by: Vladimir Lypak <junak.pub@gmail.com>
Link: https://lore.kernel.org/r/20201004083413.324351-1-junak.pub@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 6d849653 26-Sep-2020 AngeloGioacchino Del Regno <kholk11@gmail.com>

regulator: qcom_smd: Add PM660/PM660L regulator support

The PM660 and PM660L are a very very common PMIC combo, found on
boards using the SDM630, SDM636, SDM660 (and SDA variants) SoC.

PM660 provides 6 SMPS and 19 LDOs (of which one is unaccesible),
while PM660L provides 5 SMPS (of which S3 and S4 are combined),
10 LDOs and a Buck-or-Boost (BoB) regulator.

The PM660L IC also provides other regulators that are very
specialized (for example, for the display) and will be managed
in the other appropriate drivers (for example, labibb).

Signed-off-by: AngeloGioacchino Del Regno <kholk11@gmail.com>
Link: https://lore.kernel.org/r/20200926125549.13191-6-kholk11@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 47894c85 22-Jun-2020 Kathiravan T <kathirav@codeaurora.org>

regulator: qcom_smd: Add MP5496 regulators

IPQ6018 SoC uses the PMIC MP5496. SMPA2 and LDOA2 regulator controls the
APSS and SDCC voltage scaling respectively. Add support for the same.

Signed-off-by: Kathiravan T <kathirav@codeaurora.org>
Link: https://lore.kernel.org/r/1592889472-6843-5-git-send-email-kathirav@codeaurora.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# bfa29acd 26-Jun-2020 Lee Jones <lee.jones@linaro.org>

regulator: qcom_smd-regulator: Remove unused 'struct regulator_desc pmi8994_boost'

This was an upstreaming error. Remove it as it's not to be used.

Fixes the following W=1 kernel build warning:

drivers/regulator/qcom_smd-regulator.c:477:36: warning: ‘pmi8994_boost’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Andy Gross <agross@kernel.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: linux-arm-msm@vger.kernel.org
Link: https://lore.kernel.org/r/20200626065738.93412-10-lee.jones@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 0d46f698 20-Jun-2020 Konrad Dybcio <konradybcio@gmail.com>

regulator: qcom_smd: Fix pmi8994 label

s3 was mislabeled as s2. Fix it.

Signed-off-by: Konrad Dybcio <konradybcio@gmail.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20200620144639.335093-19-konradybcio@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 60ab7f41 08-May-2020 Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>

regulator: use linear_ranges helper

Change the regulator helpers to use common linear_ranges code.

Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Link: https://lore.kernel.org/r/64f01d5e381b8631a271616b7790f9d5640974fb.1588944082.git.matti.vaittinen@fi.rohmeurope.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 86332c34 23-Mar-2020 Bjorn Andersson <bjorn.andersson@linaro.org>

regulator: qcom_smd: Add pmi8994 regulator support

The pmi8994 is commonly found on MSM8996 based devices, such as the
Dragonboard 820c, where it supplies power to a number of LDOs on the
primary PMIC.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20200324041424.518160-1-bjorn.andersson@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# e44adca5 21-Sep-2019 Angelo G. Del Regno <kholk11@gmail.com>

regulator: qcom_smd: Add PM8950 regulators

The PM8950 provides 6 SMPS regulators, of which 5 HFSMPS
and one FTSMPS2.5 (s5), and 23 LDOs.
Add these to the RPM regulator driver.

Signed-off-by: Angelo G. Del Regno <kholk11@gmail.com>
Link: https://lore.kernel.org/r/20190921095043.62593-4-kholk11@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 97fb5e8d 29-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 and
only version 2 as published by the free software foundation this
program is distributed in the hope that it will be useful but
without any warranty without even the implied warranty of
merchantability or fitness for a particular purpose see the gnu
general public license for more details

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

has been chosen to replace the boilerplate/reference in 294 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190529141900.825281744@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# fd805d99 22-Jan-2019 Bjorn Andersson <bjorn.andersson@linaro.org>

regulator: qcom-smd: Batch up requests for disabled regulators

In some scenarios the early stages of the boot chain has configured
regulators to be in a required state, but the later stages has skipped
to inform the RPM about it's requirements.

But as the SMD RPM regulators are being initialized voltage change
requests will be issued to align the voltage with the valid ranges. The
RPM aggregates all parameters for the specific regulator, the voltage
will be adjusted and the "enabled" state will be "off" - and the
regulator is turned off.

This patch addresses this problem by caching the requested enable state,
voltage and load and send the parameters in a batch, depending on the
enable state - effectively delaying the voltage request for disabled
regulators.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>


# f589d95b 19-Sep-2018 Bjorn Andersson <bjorn.andersson@linaro.org>

regulator: qcom: Add PMS405 regulators

The PMS405 provdies 5 SMPS regulators and 13 LDOs, add these to the RPM
regulator driver.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 3cdb741e 27-Mar-2018 Bjorn Andersson <bjorn.andersson@linaro.org>

regulator: qcom: smd: Add pm8998 and pmi8998 regulators

Add the pm8998 and pmi8998 regulators as used in the MSM8998 platform.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 6a2e3c3e 21-Mar-2018 Stephen Boyd <swboyd@chromium.org>

regulator: qcom_smd: Drop regulator/{machine,of_regulator} includes

These seem to be leftovers from previous developments of the driver but
they never got removed. Dropping them still allows the code to compile
so everything must be fine.

Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>


# e3b53b8a 06-Jul-2017 Gustavo A. R. Silva <garsilva@embeddedor.com>

regulator: qcom_smd: add NULL check on of_match_device() return value

Check return value from call to of_match_device()
in order to prevent a NULL pointer dereference.

In case of NULL print error message and return.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 14a16992 18-Jan-2017 Rajendra Nayak <rnayak@codeaurora.org>

regulator: qcom-smd: Add PM8994 regulator support

This patch adds support for the PM8994 regulators found on msm8992,
msm8994 and msm8996 platforms.

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
[bjorn: Add DT binding doc and vdd_lvs1_2 supply]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>


# c488f007 11-Jul-2016 Stephen Boyd <sboyd@codeaurora.org>

regulator: qcom_smd: Fix voltage ranges for pma8084 ftsmps and pldo

The voltage ranges listed here are wrong. The pma8084 pldo
supports three different overlapping voltage ranges with
differing step sizes and the pma8084 ftsmps supports two. These
ranges can be seen in the "native" spmi regulator driver
(qcom_spmi-regulator.c) at pldo_ranges[] and ftsmps_ranges[]
respectively. Port these ranges over to the RPM SMD regulator
driver so that we list the appropriate set of supported voltages
on these types of regulators.

Fixes: ee01d0c91ef1 ("regulator: qcom-smd: Add support for PMA8084")
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Reviewed-by: Andy Gross <andy.gross@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 29028477 11-Jul-2016 Stephen Boyd <sboyd@codeaurora.org>

regulator: qcom_smd: Fix voltage ranges for pm8x41

The voltage ranges listed here are wrong. The correct ranges can
be seen in the "native" spmi regulator driver
qcom_spmi-regulator.c at pldo_ranges[], ftsmps_ranges[] and
boost_ranges[] for the pldo, ftsmps, and boost type regulators.
Port these ranges over to the RPM SMD regulator driver so that we
list the appropriate set of supported voltages on pldos.

Doing this allows us to specify a voltage like 3075000 for l24,
whereas before that wasn't a supported voltage.

Fixes: da65e367b67e ("regulator: Regulator driver for the Qualcomm RPM")
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Reviewed-by: Andy Gross <andy.gross@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>


# b7a8524c 11-Jul-2016 Stephen Boyd <sboyd@codeaurora.org>

regulator: qcom_smd: Avoid overlapping linear voltage ranges

The pm8x41_hfsmps ranges overlap. The first range is from 375000
to 1562500:

375000 + (95 * 12500) == 1562500

and the second range starts at 1550000. Interestingly, the second
range ends at the correct value when it's set to be the
appropriate start value, 1575000:

1575000 + ((158 - 96) * 25000) == 3125000

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Reviewed-by: Andy Gross <andy.gross@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 43160ffd 14-Jun-2016 Axel Lin <axel.lin@ingics.com>

regulator: qcom_smd: Remove list_voltage callback for rpm_smps_ldo_ops_fixed

Use regulator_list_voltage_linear_range in rpm_smps_ldo_ops_fixed is
wrong because it is used for fixed regulator without any linear range.
The rpm_smps_ldo_ops_fixed is used for pm8941_lnldo which has fixed_uV
set and n_voltages = 1. In this case, regulator_list_voltage() can return
rdev->desc->fixed_uV without .list_voltage implementation.

Fixes: 3bfbb4d1a480 ("regulator: qcom_smd: add list_voltage callback")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 3bfbb4d1 02-Jun-2016 Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

regulator: qcom_smd: add list_voltage callback

This patch adds support to list_voltage callback, so that consumers
like mmc core, can get information of supported voltage range.

Without this patch there is no way for mmc core to know this voltage range.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>


# d1e44b6b 02-Jun-2016 Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

regulator: qcom_smd: add regulator ops for pm8941 lnldo

After "regulator: qcom_smd: add list_voltage callback" patch adding
pm8941 lnldo regulators would bug on list_voltages as it is a fixed
regulator without any linear range.
This patch fixes that issue by adding dedicated ops for pm8941 lnldo
without list_voltages callback.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org # v4.6


# a8a47540 02-Jun-2016 Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

regulator: qcom_smd: add list_voltage callback

This patch adds support to list_voltage callback, so that consumers
like mmc core, can get information of supported voltage range.

Without this patch there is no way for mmc core to know this voltage range.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org # v4.6


# ee01d0c9 14-Dec-2015 Andy Gross <agross@codeaurora.org>

regulator: qcom-smd: Add support for PMA8084

This patch adds support and documentation for the PMA8084 regulators
found on APQ8084 platforms.

Signed-off-by: Andy Gross <agross@codeaurora.org>
Acked-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 57d65676 14-Dec-2015 Andy Gross <agross@codeaurora.org>

regulator: qcom-smd: Add PM8916 support

This patch adds support and documentation for the PM8916 regulators
found on MSM8916 platforms.

Acked-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Andy Gross <agross@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>


# a3e123c1 12-Oct-2015 Bjorn Andersson <bjorn.andersson@sonymobile.com>

regulator: qcom-smd: Correct set_load() unit

The set_load() op deals with uA while the SMD packets used mA, so
convert as we're building the packet.

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 2c652a98 02-Sep-2015 Stephen Boyd <sboyd@codeaurora.org>

regulator: qcom_smd: Handle big endian CPUs

The smd rpm structures are always in little endian, but this
driver is not capable of being used on big endian CPUs. Annotate
the little endian data members and update the code to do the
proper byte swapping.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 5a286aae 18-Aug-2015 Axel Lin <axel.lin@ingics.com>

regulator: qcom_smd: Set n_voltages for pm8941_lnldo

Just setting fixed_uV is not enough, the regulator core will also check
n_voltages setting. The fixed_uV only works when n_voltages is 1.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# da65e367 17-Aug-2015 Bjorn Andersson <bjorn.andersson@sonymobile.com>

regulator: Regulator driver for the Qualcomm RPM

Driver for regulators exposed by the Resource Power Manager (RPM) found
in devices based on Qualcomm 8974 and newer platforms.

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Acked-by: Andy Gross <agross@codeaurora.org>
Tested-by: Tim Bird <tim.bird@sonymobile.com>
Signed-off-by: Mark Brown <broonie@kernel.org>