From testing on hardware the poll_enable_time isn't required and
sometimes causes the driver probe to fail so let's remove it.
Signed-off-by: Alistair Francis <alistair@alistair23.me>
Link: https://lore.kernel.org/r/20210803084456.198-5-alistair@alistair23.me
Signed-off-by: Mark Brown <broonie@kernel.org>
Enable regmap cache to reduce i2c transactions and corresponding
interrupts if regulator is accessed frequently. Since the register map
is small, we use a FLAT regmap cache.
Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Link: https://lore.kernel.org/r/20210803165211.3b00db29@xhacker.debian
Signed-off-by: Mark Brown <broonie@kernel.org>
Enable regmap cache to reduce i2c transactions and corresponding
interrupts if regulator is accessed frequently. Since the register map
is small -- there's only one register in sy8824c and sy8824e, there
are only two registers in sy20276 and sy20278, so we use a FLAT regmap
cache.
Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Link: https://lore.kernel.org/r/20210803165043.042ec24d@xhacker.debian
Signed-off-by: Mark Brown <broonie@kernel.org>
The arrays containing the regulator's voltage ranges are
currently named after the first ldo which uses such range.
However, it sounds a lot clearer if those are named with
the voltage range instead.
No functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/1bdff1d1f23753b69c8044160decfad1e8553d08.1627121912.git.mchehab+huawei@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Instead of returning error directly, use dev_err_probe. This avoids
messages in the dmesg log for devices which will be probed again later.
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Link: https://lore.kernel.org/r/20210721165716.19915-1-macroalpha82@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Reg will be reset in below two conditions.
1. 'Enable' pin from H to L.
2. Both PAVDD and NAVDD are all disabled.
And 'Enable' pin also control i2c communication capability.
This patch is to Seperate the if condition in enable/disable callback for
reg cache manipulation.
Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Link: https://lore.kernel.org/r/1626407746-23156-1-git-send-email-u0084500@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
In addition to the ability of merging some power outputs, this chip has
an overdrive mode.
BCORE1, BCORE2 and BPRO have this ability, in which case the legal
current draw is increased from 2 amps to 2.5 amps (at the expense of
a quiescent current increase), and the configurable current limits
are doubled.
If a current higher than maximum half-current mode is requested, enable
overdrive, and scale the current limit down.
Symmetrically, scale the current limit up when querying a overdrive-enabled
regulator.
Signed-off-by: Vincent Pelletier <plr.vincent@gmail.com>
Reviewed-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Link: https://lore.kernel.org/r/824518e6391b783a12eba9ff0527f06607a34bfb.1626160826.git.plr.vincent@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Don't populate the const array func_base on the stack but instead it
static. Makes the object code smaller by 55 bytes:
Before:
text data bss dec hex filename
6422 3216 64 9702 25e6 drivers/regulator/rt6245-regulator.o
After:
text data bss dec hex filename
6303 3280 64 9647 25af drivers/regulator/rt6245-regulator.o
Reduction of 55 bytes
(gcc version 10.3.0)
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210715141531.27672-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
These APIs aren't used anywhere and most-likely exist because of the
general principle of C APIs, where if an API function does an
allocation/registration, it must also have an equivalent
deallocation/deregistration counterpart.
For devm_ functions this isn't all that true (for all cases), as the idea
of these function is to provide an auto-cleanup logic on drivers/system
de-init.
Removing these discourages any weird logic that could be created with
such an API functions.
Alexandru Ardelean (4):
regulator: devres: remove devm_regulator_unregister_notifier()
function
regulator: devres: remove devm_regulator_unregister() function
regulator: devres: remove
devm_regulator_bulk_unregister_supply_alias()
regulator: devres: unexport devm_regulator_unregister_supply_alias()
drivers/regulator/devres.c | 105 +----------------------------
include/linux/regulator/consumer.h | 23 -------
include/linux/regulator/driver.h | 1 -
3 files changed, 2 insertions(+), 127 deletions(-)
--
2.31.1
The ROHM BD71837/47/50/78 do support enabling/disabling the under/over
voltage protection. Add support for enabling/disabling the protection
according to the device-tree information.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/20210705105416.GA1189560@localhost.localdomain
Signed-off-by: Mark Brown <broonie@kernel.org>
Instead of linear mapping, Use linear range to map all voltage selection.
Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Reviewed-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/1625553939-9109-1-git-send-email-u0084500@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The TPS65910 regulator now gets a deferred probe until supply regulator is
registered. Silence noisy error message about the deferred probe.
Reported-by: Matt Merhar <mattmerhar@protonmail.com> # Ouya T30
Tested-by: Matt Merhar <mattmerhar@protonmail.com> # Ouya T30
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210705201211.16082-1-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The shift setting can be calculated via the corresponding mask field,
so remove these shift fields.
The usage of da_vsel_mask is different from other mask defines because
current code does shift regval before mask with the da_vsel_mask.
Do proper shit to da_vsel_mask setting so we can calculate the shift.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210629130503.2183574-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This API hook isn't used anywhere outside of the regulator devres code.
This function is needed for the devm_regulator_bulk_register_supply_alias()
function on the error path, to cleanup any previously registered supply
aliases.
This change makes the devm_regulator_unregister_supply_alias() local to the
regulator core framework, to avoid it being used in any weird logic.
It's also removing the doc-string for
devm_regulator_unregister_supply_alias(), since it doesn't need to be
documented anymore, as no other external consumer should use it.
Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
Link: https://lore.kernel.org/r/20210625122324.327585-5-aardelean@deviqon.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This API hook isn't used anywhere and most-likely exists because of the
general principle of C APIs, where if an API function does an
allocation/registration, it must also have an equivalent
deallocation/deregistration counterpart.
For devm_ functions this isn't all that true (for all cases), as the idea
of these function is to provide an auto-cleanup logic on drivers/system
de-init.
Removing this also discourages any weird logic that could be created with
such an API function.
Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
Link: https://lore.kernel.org/r/20210625122324.327585-4-aardelean@deviqon.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This API hook isn't used anywhere and most-likely exists because of the
general principle of C APIs, where if an API function does an
allocation/registration, it must also have an equivalent
deallocation/deregistration counterpart.
For devm_ functions this isn't all that true (for all cases), as the idea
of these function is to provide an auto-cleanup logic on drivers/system
de-init.
Removing this also discourages any weird logic that could be created with
such an API function.
Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
Link: https://lore.kernel.org/r/20210625122324.327585-3-aardelean@deviqon.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Since config.dev = pdev->dev.parent in current code, so
dev_get_drvdata(rdev->dev.parent) call in hi6421_regulator_enable
returns the drvdata of the mfd device rather than the regulator. Fix it.
This was broken while converting to use simplified DT parsing because the
config.dev changed from pdev->dev to pdev->dev.parent for parsing the
parent's of_node.
Fixes: 29dc269a85 ("regulator: hi6421: Convert to use simplified DT parsing")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210630095959.2411543-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
If use dev->parent, the regulator_unregister will not be called when this
driver is unloaded. Fix it by using dev instead.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210702142140.2678130-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Since config.dev = pdev->dev.parent in current code, so
dev_get_drvdata(rdev->dev.parent) actually returns the drvdata of the mfd
device rather than the regulator. Fix it.
Fixes: 9bc146acc3 ("regulator: hi6421v600: Fix setting wrong driver_data")
Reported-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Tested-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/20210630074246.2305166-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Fix wrong mask for strobe-polarity-high.
Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
In-reply-to: <CAFRkauB=0KwrJW19nJTTagdHhBR=V2R8YFWG3R3oVXt=rBRsqw@mail.gmail.com>
Reviewed-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/1624723112-26653-1-git-send-email-u0084500@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The boolean variable may_have_irqs is not ininitialized and is
only being set to true in the case where chip is ROHM_CHIP_TYPE_BD9576.
Fix this by ininitialized may_have_irqs to false.
Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: e7bf1fa58c ("regulator: bd9576: Support error reporting")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/20210622144730.22821-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Use DIV_ROUND_UP to prevent truncation by integer division issue.
This ensures we return enough delay time.
Also fix returning negative value when new_sel < old_sel.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210618141412.4014912-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Current code set "config.driver_data = sreg" but sreg only init the mutex,
the othere fields are just zero. Fix it by pass *info to config.driver_data
so each regulator can get corresponding data by rdev_get_drvdata().
Separate enable_mutex from struct hi6421_spmi_reg_info since only need one
mutex for the driver.
Fixes: d2dfd50a0b ("staging: hikey9xx: hi6421v600-regulator: move LDO config from DT")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210622043329.392072-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Changes since v2:
-----------------
- v2 series can be found here: https://lore.kernel.org/linux-arm-msm/20210615074543.26700-1-bhupesh.sharma@linaro.org/T/#m8303d27d561b30133992da88198abb78ea833e21
- Addressed review comments from Bjorn and Mark.
- As per suggestion from Bjorn, seperated the patches in different
patchsets (specific to each subsystem) to ease review and patch application.
Changes since v1:
-----------------
- v1 series can be found here: https://lore.kernel.org/linux-arm-msm/20210607113840.15435-1-bhupesh.sharma@linaro.org/T/#mc524fe82798d4c4fb75dd0333318955e0406ad18
- Addressed review comments from Bjorn and Vinod received on the v1
series.
This series adds the regulator support code for SA8155p-adp board
which is based on Qualcomm snapdragon sa8155p SoC which in turn is
simiar to the sm8150 SoC.
This board supports a new PMIC PMM8155AU.
While at it, also make some cosmetic changes to the regulator driver
and dt-bindings to make sure the compatibles are alphabetical and also
fix issues with extra comma(s) at the end of terminator line(s).
Cc: Mark Brown <broonie@kernel.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Bhupesh Sharma (5):
dt-bindings: regulator: qcom,rpmh-regulator: Arrange compatibles
alphabetically
dt-bindings: regulator: qcom,rpmh-regulator: Add compatible for
SA8155p-adp board pmic
regulator: qcom-rpmh: Cleanup terminator line commas
regulator: qcom-rpmh: Add terminator at the end of pm7325x_vreg_data[]
array
regulator: qcom-rpmh: Add new regulator found on SA8155p adp board
.../regulator/qcom,rpmh-regulator.yaml | 17 ++---
drivers/regulator/qcom-rpmh-regulator.c | 62 +++++++++++++++----
2 files changed, 59 insertions(+), 20 deletions(-)
--
2.31.1
Extend regulator notification support
This series extends the regulator notification and error flag support.
Initial discussion on the topic can be found here:
https://lore.kernel.org/lkml/6046836e22b8252983f08d5621c35ececb97820d.camel@fi.rohmeurope.com/
In a nutshell - the series adds:
1. WARNING level events/error flags. (Patch 3)
Current regulator 'ERROR' event notifications for over/under
voltage, over current and over temperature are used to indicate
condition where monitored entity is so badly "off" that it actually
indicates a hardware error which can not be recovered. The most
typical hanling for that is believed to be a (graceful)
system-shutdown. Here we add set of 'WARNING' level flags to allow
sending notifications to consumers before things are 'that badly off'
so that consumer drivers can implement recovery-actions.
2. Device-tree properties for specifying limit values. (Patches 1, 5)
Add limits for above mentioned 'ERROR' and 'WARNING' levels (which
send notifications to consumers) and also for a 'PROTECTION' level
(which will be used to immediately shut-down the regulator(s) W/O
informing consumer drivers. Typically implemented by hardware).
Property parsing is implemented in regulator core which then calls
callback operations for limit setting from the IC drivers. A
warning is emitted if protection is requested by device tree but the
underlying IC does not support configuring requested protection.
3. Helpers which can be registered by IC. (Patch 4)
Target is to avoid implementing IRQ handling and IRQ storm protection
in each IC driver. (Many of the ICs implementin these IRQs do not allow
masking or acking the IRQ but keep the IRQ asserted for the whole
duration of problem keeping the processor in IRQ handling loop).
4. Emergency poweroff function (refactored out of the thermal_core to
kernel/reboot.c) which is called if IC fires error IRQs but IC reading
fails and given retry-count is exceeded. (Patches 2, 4)
Please note that the mutex in the emergency shutdown was replaced by a
simple atomic in order to allow call from any context.
The helper was attempted to be done so it could be used to implement
roughly same logic as is used in qcom-labibb regulator. This means
amongst other things a safety shut-down if IC registers are not readable.
Using these shut-down retry counters are optional. The idea is that the
helper could be also used by simpler ICs which do not provide status
register(s) which can be used to check if error is still active.
ICs which do not have such status register can simply omit the 'renable'
callback (and retry-counts etc) - and helper assumes the situation is Ok
and re-enables IRQ after given time period. If problem persists the
handler is ran again and another notification is sent - but at least the
delay allows processor to avoid IRQ loop.
Patch 7 takes this notification support in use at BD9576MUF.
Patch 8 is related to MFD change which is not really related to the RFC
here. It was added to this series in order to avoid potential conflicts.
Patch 9 adds a maintainers entry.
Changelog v10-RESEND:
- rebased on v5.13-rc4
Changelog v10:
- rebased on v5.13-rc2
- Move rdev_*() print macros to the internal.h and use rdev_dbg()
from irq_helpers.c
- Export rdev_get_name() and move it from coupler.h to driver.h for
others to use. (It was already in coupler.h but not exported -
usage was limited and coupler.h does not sound like optimal place
as rdev_name is not only used by coupled regulators)
- Send all regulator notifications from irq_helpers.c at one OR'd
event for the sake of simplicity. For BD9576 this does not matter
as it has own IRQ for each event case. Header defining events says
they may be OR'd.
- Change WARN() at protection shutdown to pr_emerg as suggested by
Petr.
Changelog v9:
- rebases on v5.13-rc1
- Update thermal documentation
- Fix regulator notification event number
Changelog v8:
- split shutdown API adding and thermal core taking it in use to
own patches.
- replace the spinlock with atomic when ensuring the emergency
shutdown is only called once.
Changelog v7:
general:
- rebased on v5.12-rc7
- new patch for refactoring the hw-failure reboot logic out of
thermal_core.c for others to use.
notification helpers:
- fix regulator error_flags query
- grammar/typos
- do not BUG() but attempt to shut-down the system
- use BITS_PER_TYPE()
Changelog v6:
Add MAINTAINERS entry
Changes to IRQ notifiers
- move devm functions to drivers/regulator/devres.c
- drop irq validity check
- use devm_add_action_or_reset()
- fix styling issues
- fix kerneldocs
Changelog v5:
- Fix the badly formatted pr_emerg() call.
Changelog v4:
- rebased on v5.12-rc6
- dropped RFC
- fix external FET DT-binding.
- improve prints for cases when expecting HW failure.
- styling and typos
Changelog v3:
Regulator core:
- Fix dangling pointer access at regulator_irq_helper()
stpmic1_regulator:
- fix function prototype (compile error)
bd9576-regulator:
- Update over current limits to what was given in new data-sheet
(REV00K)
- Allow over-current monitoring without external FET. Set limits to
values given in data-sheet (REV00K).
Changelog v2:
Generic:
- rebase on v5.12-rc2 + BD9576 series
- Split devm variant of delayed wq to own series
Regulator framework:
- Provide non devm variant of IRQ notification helpers
- shorten dt-property names as suggested by Rob
- unconditionally call map_event in IRQ handling and require it to be
populated
BD9576 regulators:
- change the FET resistance property to micro-ohms
- fix voltage computation in OC limit setting
BD9573 and BD9576 support set of "protection" interrupts for "fatal"
issues. Those lead to SOC reset as PMIC shuts the power outputs. Thus
there is no relevant IRQ handling for them.
Few "detection" interrupts were added to the BD9576 with the idea that
SOC could take some recovery-action before error gets unrecoverable.
Add support for over and under voltage detection for Vout1 ... Vout4
and VoutL1. Add over-current detection for VoutS1 and finally a
thermal warning (common for all regulators) which alerts 30 C
before temperature reaches the thermal shutdown point. This way
consumer drivers can build error-recovery mechanisms.
Unfortunately the BD9576 interrupt logic was not re-evaluated. IRQs
are not designed to be properly acknowleged - and IRQ line is kept
active for whole duration of error condition (in comparison to
informing only about state change).
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/05c4f7a8e30ef1d4d5f3ceab07da4ebe68f5b4ed.1622628334.git.matti.vaittinen@fi.rohmeurope.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Provide helper function for IC's implementing regulator notifications
when an IRQ fires. The helper also works for IRQs which can not be acked.
Helper can be set to disable the IRQ at handler and then re-enabling it
on delayed work later. The helper also adds regulator_get_error_flags()
errors in cache for the duration of IRQ disabling.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/ebdf86d8c22b924667ec2385330e30fcbfac0119.1622628334.git.matti.vaittinen@fi.rohmeurope.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The rdev print helpers are a nice way to print messages related to a
specific regulator device. Move them from core.c to internal.h
As the rdev print helpers use rdev_get_name() export it from core.c. Also
move the declaration from coupler.h to driver.h because the rdev name is
not just a coupled regulator property. I guess the main audience for
rdev_get_name() will be the regulator core and drivers.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/dc7fd70dc31de4d0e820b7646bb78eeb04f80735.1622628333.git.matti.vaittinen@fi.rohmeurope.com
Signed-off-by: Mark Brown <broonie@kernel.org>
commit db27f8294c changed eco_mode << (ffs(sreg->eco_mode_mask) - 1)
to sreg->eco_mode_mask << (ffs(sreg->eco_mode_mask) - 1) which is wrong.
Fix it by simply set val = sreg->eco_mode_mask.
In additional, sreg->eco_mode_mask can be 0 (LDO3, LDO33, LDO34).
Return -EINVAL if idle mode is not supported when sreg->eco_mode_mask is 0.
While at it, also use unsigned int for reg_val/val which is the expected
type for regmap_read and regmap_update_bits.
Fixes: db27f8294c ("staging: regulator: hi6421v600-regulator: use shorter names for OF properties")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210619123423.4091429-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
SA8155p-adp board supports a new regulator - pmm8155au.
The output power management circuits in this regulator include:
- FTS510 smps,
- HFS510 smps, and
- LDO510 linear regulators
Add support for the same.
Cc: Mark Brown <broonie@kernel.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20210617051712.345372-6-bhupesh.sharma@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Add missing terminator(s) at the end of pm7325x_vreg_data[]
array instances.
Fixes: c4e5aa3dbe ("regulator: qcom-rpmh: Add PM7325/PMR735A regulator support")
Cc: Mark Brown <broonie@kernel.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Link: https://lore.kernel.org/r/20210617051712.345372-5-bhupesh.sharma@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Cleanup the qcom-rpmh regulator driver to remove comma(s)
at the end of the terminator line(s).
Cc: Mark Brown <broonie@kernel.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Link: https://lore.kernel.org/r/20210617051712.345372-4-bhupesh.sharma@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Current code sets config.driver_data to a zero initialized regulator
which is obviously wrong. Fix it.
Fixes: 4618119b9b ("regulator: hi655x: enable regulator for hi655x PMIC")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210620132715.60215-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Instead of returning the the PTR_ERR directly, use dev_err_probe which
will also correctly set the deferred probe reason in
/sys/kernel/debug/deferred_devices, making it easier to debug missing
devices on the system.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Link: https://lore.kernel.org/r/20210616125331.153414-1-r.czerwinski@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
At the context with *rdev, use rdev_get_drvdata() is more intuitive.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Alistair Francis <alistair@alistair23.me>
Link: https://lore.kernel.org/r/20210616034458.3499522-3-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
It's only used in this file and never changed, make it static const.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Alistair Francis <alistair@alistair23.me>
Link: https://lore.kernel.org/r/20210616034458.3499522-2-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The platform_device_id table is supposed to be zero-terminated.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Alistair Francis <alistair@alistair23.me>
Link: https://lore.kernel.org/r/20210616034458.3499522-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The vsel active level is for the normal voltage, the opposite level is
the suspend voltage.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: ChiYuan Huang <cy_huang@richtek.com>
Link: https://lore.kernel.org/r/20210616011816.3479406-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
All the voltage tables have entries in ascendant order, so use
regulator_map_voltage_ascend to speed up the mapping.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210610134128.2477821-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This adds regulator_sync_voltage_rdev(), which is used as a dependency
for new Tegra power domain code.
-----BEGIN PGP SIGNATURE-----
iQJHBAABCAAxFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAmDDivETHHRyZWRpbmdA
bnZpZGlhLmNvbQAKCRDdI6zXfz6zoTdHD/9sFhALQjPLLj6g8ioa0VHoF/QlxFS8
XA+Ws4syPVxx+QfbrteJMoh98pASRovKUsKUheOQsvWgetprMSpf0/vg9630+4ap
hRmmiCb8SCFZw8aGYUVObKNUfepPqOM4ArrhcPbiw/aF4vGt7GZB1eXP5++yWLfS
BgY6gC9XVFLvxDHVnB6MqtHzGNlxBcj50f+uZiz5I4/Vk2CkUp9wjS2gZFhRVNao
ZFK0xVObbmBlgeMulE604rkCUkZHfdtXDF7gEApCrv5H2eZ2kNKBjEDxarOyngvb
SRkeVjQwDvc5RJ1dBNIlqcCAScpQr4ryCLK+gPLEHwcqEDaz94ClkyMt+TF9Ox40
QYMEvhz+kTo7LCg8r8rS9T/LoXMRdafxlJDK81Kqg+MaqkEKl5qpy15poc9CkyQX
Rrkrpf45dmYPcz7VVpJ6/6MejiUNAKcIAxuP6n2SlXqyN4ViuJGGI27fLw7hDSFs
X1ithEhc7/9kNCuhyZ6rmi3OKk24GoGX5tSPjyt1M+LiAm2U7GF1AItPDRu//ZgB
5A4bLgQUX6YmS0EyRjNlru1xYn1JwjLIbuwoq4acxcrCVvoRQ+ZIatPOEEU9K7Fc
wfoglwFyE9EnSkmUNBpOu/neFRYj2OzCWT6uKtxeDU/8cx6NGPi0TNOlaxrf3RFF
2jZj8MEJVHSWYw==
=/dXp
-----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmDHMi0ACgkQJNaLcl1U
h9Dbvgf/dAcS9d9lgjijzGYcvsh3hBpWqimMrO/dfXlalqXfdU0VN82++0WIcpC7
uoQ2I6RwU4NNTvMUjbmyQsYONMBNthxYEgGDdtwOE03TLVJHc9KyKCzRLFp0E0sX
wHvoAbSZbzd1OIC+96iWJzeC9rq24LX5IaP8301hWKFhbZpo3/uP9yTgQuxSp0cf
tuQDu8vzW7TuC7pxy06FgCmVhsEd2OXEO+wu9OWzMoIAh2Z82KlEb8j0cpV0G0d1
jPdDanaFwJ3LZevbMXZQnJyCGRhFU74vboSC3Vb8e2H7eCwb68s3Z5mo1Dxq6M3o
qE9JGQRgVVOHr67vYXfirOzmhz2D5g==
=5rP3
-----END PGP SIGNATURE-----
Merge tag 'for-5.14-regulator' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into regulator-5.14
regulator: Changes for v5.14-rc1
This adds regulator_sync_voltage_rdev(), which is used as a dependency
for new Tegra power domain code.
A collection of fixes for the regulator API that have come up since the
merge window, including a big batch of fixes from Axel Lin's usual
careful and detailed review. The one stand out fix here is Dmitry
Baryshkov's fix for an issue where we fail to power on the parents of
always on regulators during system startup if they weren't already
powered on.
-----BEGIN PGP SIGNATURE-----
iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmC/ao0ACgkQJNaLcl1U
h9AoqQf9GYtljFSON07MAOWwMgnjuMQ+rl0ZadqKKzq74QMMi4bxVKDWkftQ28/5
Ulk2M/mxRE6C1OEpOJl9ZnG9K0fWpOdnTURkYgW0FsJniEDiF7ZkdoFypwu93jOD
0r+3QCw/Ti9i08pOdlpFpUKU5rp/O9HYmouOTzBOCiM1SMb9TkkX5GBoDVw8+cWd
2PZqKQXEsaK1uNzeaXYw6UO8+IdSpVQRzSEILdtVWyHCNmXDDJWfI3vYeeqDbhYr
C+E3UdrO1ftNsOoJv33NqhscMnulkZDZ6H6lgbLX2FyFAe2M9N+AildGlkR5H1GD
xH3q3EvkOE2Y2X3zHteLdJ3MoI91cQ==
=poWJ
-----END PGP SIGNATURE-----
Merge tag 'regulator-fix-v5.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator fixes from Mark Brown:
"A collection of fixes for the regulator API that have come up since
the merge window, including a big batch of fixes from Axel Lin's usual
careful and detailed review.
The one stand out fix here is Dmitry Baryshkov's fix for an issue
where we fail to power on the parents of always on regulators during
system startup if they weren't already powered on"
* tag 'regulator-fix-v5.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (21 commits)
regulator: rt4801: Fix NULL pointer dereference if priv->enable_gpios is NULL
regulator: hi6421v600: Fix .vsel_mask setting
regulator: bd718x7: Fix the BUCK7 voltage setting on BD71837
regulator: atc260x: Fix n_voltages and min_sel for pickable linear ranges
regulator: rtmv20: Fix to make regcache value first reading back from HW
regulator: mt6315: Fix function prototype for mt6315_map_mode
regulator: rtmv20: Add Richtek to Kconfig text
regulator: rtmv20: Fix .set_current_limit/.get_current_limit callbacks
regulator: hisilicon: use the correct HiSilicon copyright
regulator: bd71828: Fix .n_voltages settings
regulator: bd70528: Fix off-by-one for buck123 .n_voltages setting
regulator: max77620: Silence deferred probe error
regulator: max77620: Use device_set_of_node_from_dev()
regulator: scmi: Fix off-by-one for linear regulators .n_voltages setting
regulator: core: resolve supply for boot-on/always-on regulators
regulator: fixed: Ensure enable_counter is correct if reg_domain_disable fails
regulator: Check ramp_delay_table for regulator_set_ramp_delay_regmap
regulator: fan53880: Fix missing n_voltages setting
regulator: da9121: Return REGULATOR_MODE_INVALID for invalid mode
regulator: fan53555: fix TCS4525 voltage calulation
...
According to the datasheet:
REGISTER DETAILS − 0x02 BUCK, BUCK_OUT is BIT0 ~ BIT7.
So vsel_mask for FAN53880_BUCK should be 0xFF.
Fixes: e6dea51e2d ("regulator: fan53880: Add initial support")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210607142907.1599905-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The content of bd71815_regulators is never changed, no need to duplicate
it, thus remove descs[BD71815_REGULATOR_CNT].
The *regmap, *dev and *rdev[BD71815_REGULATOR_CNT] are not really needed.
The *gps is unused.
Thus the struct bd71815_pmic can be removed.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/20210607143002.1600017-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Use regulator_set_ramp_delay_regmap instead of open-coded
LTC3589_LINEAR_REG() no longer call LTC3589_REG() now.
Only LTC3589_LINEAR_REG() needs to set go_bit, thus remove go_bit
parameter from LTC3589_REG() macro.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210604115803.1260976-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The MT6359_BUCK and MT6359_LDO_LINEAR macros setup both
linear settings (min_uV, uV_step, linear_min_sel) and linar_range
(linear_ranges, n_linear_ranges) settings.
All the linear range tables actually only has one entry.
Let's simplify it by using linear instead of linear range.
The linear_min_sel setting is 0 for all cases, remove it
from the macros.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210606065052.1417111-3-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
For rk3399pro boards the tcs4526 regulator supports the vdd_gpu
regulator. The tcs4526 regulator has a chip id of <0>.
Add the compatibile tcs,tcs4526
without this patch, the dmesg output is:
fan53555-regulator 0-0010: Chip ID 0 not supported!
fan53555-regulator 0-0010: Failed to setup device!
fan53555-regulator: probe of 0-0010 failed with error -22
with this patch, the dmesg output is:
vdd_gpu: supplied by vcc5v0_sys
The regulators are described as:
- Dedicated power management IC TCS4525
- Lithium battery protection chip TCS4526
This has been tested with a Radxa Rock Pi N10.
Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
Link: https://lore.kernel.org/r/20210602112943.GA119@5f9be87369f8
Signed-off-by: Mark Brown <broonie@kernel.org>
Richtek RT6245 is a high-performance, synchronous step-down converter
that can deliver up to 14A output current with an input supply voltage
range of 4.5V to 17V.
Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Link: https://lore.kernel.org/r/1622699844-19203-2-git-send-email-u0084500@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The di->slew_reg/di->slew_mask/di->slew_shift was not set in current code,
fix it.
Fixes: f2a9eb975a ("regulator: fan53555: Add support for FAN53526")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210525124017.2550029-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
max77802_set_ramp_delay_2bit() returns -EINVAL when id > MAX77802_BUCK4.
This was a leftover in commit b0615f1da5
("regulator: max77802: Split regulator operations for BUCKs").
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210523072320.2174443-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Use DEVICE_ATTR_RO/RW macro helper instead of plain DEVICE_ATTR, which
makes the code a bit shorter and easier to read.
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Link: https://lore.kernel.org/r/20210602080526.11117-1-thunder.leizhen@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add support for Richtek RT6160 voltage regulator. It can provide up
to 3A output current within the adjustable voltage from 2025mV
to 5200mV. It integrate a buckboost converter to support wide input
voltage range from 2200mV to 5500mV.
Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Link: https://lore.kernel.org/r/1622611906-2403-2-git-send-email-u0084500@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Use DEVICE_ATTR_RO() helper instead of plain DEVICE_ATTR(),
which makes the code a bit shorter and easier to read.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20210529115226.25376-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Changing the BD71837 voltages for other regulators except the first 4 BUCKs
should be forbidden when the regulator is enabled. There may be out-of-spec
voltage spikes if the voltage of these "non DVS" bucks is changed when
enabled. This restriction was accidentally removed when the LDO voltage
change was allowed for BD71847. (It was not noticed that the BD71837
BUCK7 used same voltage setting function as LDOs).
Additionally this bug causes incorrect voltage monitoring register access.
The voltage change function accidentally used for bd71837 BUCK7 is
intended to only handle LDO voltage changes. A BD71847 LDO specific
voltage monitoring disabling code gets executed on BD71837 and register
offsets are wrongly calculated as regulator is assumed to be an LDO.
Prevent the BD71837 BUCK7 voltage change when BUCK7 is enabled by using
the correct voltage setting operation.
Fixes: 9bcbabafa1 ("regulator: bd718x7: remove voltage change restriction from BD71847 LDOs")
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/bd8c00931421fafa57e3fdf46557a83075b7cc17.1622610103.git.matti.vaittinen@fi.rohmeurope.com
Signed-off-by: Mark Brown <broonie@kernel.org>
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmC3UjQACgkQUa+KL4f8
d2FOXRAArFhjSte5NR6lSI46znDRXVGTsw9VXfJO/7K8uFnHM1aSU0ViyVmtGqba
z6QHazztq9J0EP99Q8Ikgk4vrlUEpnAut9pS5qjfvrTTl3e7YHhJ+Gl+Z7Vhyo47
AlrzfXAO0lFsH/96vFPuPv3mlXBW/bDuI/vL05uMp9vV+VGYqh9f9nO1P6LxD40w
bmxHNeqJ8fooc/w0ZU7wLfUL2orSkwN2kFoBBDHUndUXu7lmeBq50XfX4h/kPN7Y
33GiRRN3OdJ8qG46cAhoj5Xu88bh8Wp1SvqI32gAkFYfwYHMBFUIqwd847UAnUCq
xxQNLJ97zzwO6Qh9Aldu3EFrOqN1SFUIPO337DIeHet1gwS7EdDXM6JxTUKOWHV5
ICQOYbvB0U/0Pdp2khSGaYF4djs0Hc6p3JRNmBcttfzAbEL9uxvCZSgVQF1sr/Eu
kr08mHomj8AQgqoT0RoZkACB3a4K1yczjj6zj9Kp9f1r2p7zppFrSXHCNSGG6w3h
EQcXjBfsMcDs2HiH7Xd/ZHV5LXu4cdqOPPnQelPKLOfvDMhBv7yhtSkhS8oynT07
Pkd/bQ6cAURRjhNszS8B36Nh6TL8DHYXRob8pA7v1lWz9QNRpIxPxEwBNKiDrPoR
Rhako+wV6+6bA7UpLU7whYmh7T41rQ18lWU6ccnMjxdsetWICS0=
=bG7Q
-----END PGP SIGNATURE-----
mergetag object 5258f7eed4
type commit
tag tb-mfd-gpio-regulator-v5.14
tagger Lee Jones <lee.jones@linaro.org> 1621427664 +0100
Immutable branch between MFD, GPIO and Regulator due for the v5.14 merge window
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmClBdAACgkQUa+KL4f8
d2GtTBAArjoVbpfb5aAGooCsxzc4xRIDkINTYjzfnQCOXKmhD2p9yvlnLlMd4mX3
mDEdBNl2T7dOW9lOf9gj6ubOfTXqZE9jYWvE9FptTtklSLOuB/ZO/d79v1OF9gm/
P0jmKmrwZyGv5fCowwswbVCUwjpmDUbDKRXz2izfnqI58gMW2YYVYJt3Jb8nrWi/
QvVzPP8xUp5Nnu8KdbuW5pBI8J9CquqnmM9QWvKb5IuKnkYyhJLJYGhH11UWTgM+
guF7XH6Phw8HPGPkmbN4Wbx4uh0KLQgaXTu4zSTsDSyz8n45Cq7zkpeUOvHuHpIe
bbodBRC+XdvWFc4O0SWi+U5VcnPhhyKvZ7wOvNdoJaNoOryDqjQPLr+xeE0XvDST
3aCblZc2jFhOrMdHK3DdzOduOcOw/d5nzKR+QjZAboyhZu0CmiJ/NReXmTRq0C8O
KOgrr8i0h85UPk1t8a2yp4MQjpXqa1zpznVbKKOgAvMh7uPkAUwMk7NC31VQZWDi
8xvcVnDvObpZsPpksFys5leF2LZgqKLoDhkmRCNrKZ7PNF7Yl19kGzEGl/ch0icr
LUAt7oBi9do7sh9HLaPIvD+jNRpbbG+7sZtghvUFPdYnEjQT6q/YAa/aYuN8rcT2
/Tz7kqSoRetQ7Ao34wtD+UA1pnZ+8v4S2Gvli0b+csKBC8CIL4Q=
=j0mE
-----END PGP SIGNATURE-----
mergetag object 4cfc965475
type commit
tag tb-mfd-regulator-rtc-v5.14
tagger Lee Jones <lee.jones@linaro.org> 1622562292 +0100
Immutable branch between MFD, Regulator and RTC due for the v5.14 merge window
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmC2VfQACgkQUa+KL4f8
d2HW9BAAtNvDUH5JvV/thmAmHBGXTrK5XuqMgnx2q/ReCMpW1sUgJJ+W81YJ4uKW
qxNU7QknXgv/YGVZwU6U2w1ikpr0LjUr95pIxMnA91Jr+GlirbtuuqjqK/cjwvnp
ENecwhYdVb1tDsTUsAxcpYqgw2zO+/e7jJW63hhTTmTgXhWZDRmTzcpvtLKfyZa+
4qnmpZmIS2qAwcc0H3gvZoj+EeRR/ljlH1hOGHzSQop/dHgYpSsmNHDARZ18gmJs
F6OZJqtVlEbdt9TzWwmWUIWvTeKw/i9bQHSxreSgJho0TQryfeGUO+5wbrTikg5f
QBL9BPblBvuVNT5lydzq37z4AMY/yK6MqR0MhU8AISuz55so0/g+7xDwkwjRNRXa
plxzoxNv7br7Xp5q1WF/P5UGCSceVjf4AsFgaJYt0q6IJF/RBiBsFyoCDm+5Kue9
0oeXD8S3Z35A5dON12wFH8SZWeG4LdUYPHdo6JBWOpKx+WhAa5CaUoCzoiYKVEzE
RUwJqVnKuHWTNc3A2BUYSk6hhBpNNiuLLyZpn6hLQ7cNeJ2ZNdEDvW09KRqBhM2F
e3Eo4pFj7a4o6CDjBtNbH9HnxURMcNZ3GnpOrlz+b2l7msLPCIonnlOKW9e9fs3F
ZYQmioy00EL8ZCwNX/XqJMqe4HIMnjh4b46Pl+2MFeBoOST0zPc=
=pL6Z
-----END PGP SIGNATURE-----
Merge tags 'tb-mfd-asoc-v5.14-1', 'tb-mfd-gpio-regulator-v5.14' and 'tb-mfd-regulator-rtc-v5.14' into ibs-for-mfd-merged
Immutable branch between MFD and ASoC due for the v5.14 merge window
Immutable branch between MFD, GPIO and Regulator due for the v5.14 merge window
Immutable branch between MFD, Regulator and RTC due for the v5.14 merge window
The MT6359P is a eco version for MT6359 regulator.
We add support based on MT6359 regulator driver.
Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
The MT6359 is a regulator found on boards based on MediaTek MT6779 and
probably other SoCs. It is a so called pmic and connects as a slave to
SoC using SPI, wrapped inside the pmic-wrapper.
Signed-off-by: Wen Su <wen.su@mediatek.com>
Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
The only known BD70528 use-cases are such that the PMIC is controlled
from separate MCU which is not running Linux. I am not aware of
any Linux driver users. Furthermore, it seems there is no demand for
this IC. Let's ease the maintenance burden and drop the driver. We can
always add it back if there is sudden need for it.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/d7271362129edceebc512b49efed9ee7c3efcb6a.1622116622.git.matti.vaittinen@fi.rohmeurope.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The .n_voltages was missed for pickable linear ranges, fix it.
The min_sel for each pickable range should be starting from 0.
Also fix atc260x_ldo_voltage_range_sel setting (bit 5 - LDO<N>_VOL_SEL
in datasheet).
Fixes: 3b15ccac16 ("regulator: Add regulator driver for ATC260x PMICs")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
Link: https://lore.kernel.org/r/20210528230147.363974-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Current code does not set .curr_table and .n_linear_ranges settings,
so it cannot use the regulator_get/set_current_limit_regmap helpers.
If we setup the curr_table, it will has 200 entries.
Implement customized .set_current_limit/.get_current_limit callbacks
instead.
Fixes: b8c054a5ea ("regulator: rtmv20: Adds support for Richtek RTMV20 load switch regulator")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: ChiYuan Huang <cy_huang@richtek.com>
Link: https://lore.kernel.org/r/20210530124101.477727-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Some NVIDIA Tegra devices use a CPU soft-reset method for the reboot and
in this case we need to restore the coupled voltages to the state that is
suitable for hardware during boot. Add new regulator_sync_voltage_rdev()
helper which is needed by regulator drivers in order to sync voltage of
a coupled regulators.
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
./drivers/regulator/bd71815-regulator.c:644:3-8: No need to set .owner here. The core will do it.
Remove .owner field if calls are used which set it automatically
Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
Acked-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Message-Id: <1622109244-54739-1-git-send-email-zou_wei@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Use regulator_set_ramp_delay_regmap instead of open-coded.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Message-Id: <20210525141203.2562884-1-axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Add missing .owner field in regulator_desc, which is used for refcounting.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Message-Id: <20210524123735.2363676-1-axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@sirena.org.uk>
Use regulator_set_ramp_delay_regmap instead of open-coded.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Message-Id: <20210522023018.2025188-1-axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@sirena.org.uk>
Use regulator_set_ramp_delay_regmap instead of open-coded.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Message-Id: <20210525102708.2519323-1-axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@sirena.org.uk>
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>
Hi,
The next-20210521 started to fail on Nexus 7 because of the change to
regulator core that caused regression of the MAX77620 regulator driver.
The regulator driver is now getting a deferred probe and turned out
driver wasn't ready for this. The root of the problem is that OF node
of the PMIC MFD sub-device is shared with the PINCTRL sub-device and we
need to convey this information to the driver core, otherwise it will
try to claim GPIO pin that is already claimed by PINCTRL and fail the
probe.
Dmitry Osipenko (2):
regulator: max77620: Use device_set_of_node_from_dev()
regulator: max77620: Silence deferred probe error
drivers/regulator/max77620-regulator.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
--
2.30.2
Use regulator_set_ramp_delay_regmap instead of open-coded.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/20210522124250.2121076-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Mend the Kconfig for REGULATOR_BD71815 to prevent build errors:
riscv32-linux-ld: drivers/regulator/bd71815-regulator.o: in function `.L0 ':
regulator.c:289: undefined reference to `rohm_regulator_set_dvs_levels'
riscv32-linux-ld: drivers/regulator/bd71815-regulator.c:370: undefined reference to `rohm_regulator_set_dvs_levels'
Fixes: 1aad39001e ("regulator: Support ROHM BD71815 regulators")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/20210523001427.13500-1-rdunlap@infradead.org
Signed-off-by: Mark Brown <broonie@kernel.org>
One of previous changes to regulator core causes PMIC regulators to
re-probe until supply regulator is registered. Silence noisy error
message about the deferred probe.
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210523224243.13219-3-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The MAX77620 driver fails to re-probe on deferred probe because driver
core tries to claim resources that are already claimed by the PINCTRL
device. Use device_set_of_node_from_dev() helper which marks OF node as
reused, skipping erroneous execution of pinctrl_bind_pins() for the PMIC
device on the re-probe.
Fixes: aea6cb9970 ("regulator: resolve supply after creating regulator")
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210523224243.13219-2-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
For linear regulators, the .n_voltages is (max_uv - min_uv) / uv_step + 1.
Fixes: 0fbeae70ee ("regulator: add SCMI driver")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20210521073020.1944981-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
For the boot-on/always-on regulators the set_machine_constrainst() is
called before resolving rdev->supply. Thus the code would try to enable
rdev before enabling supplying regulator. Enforce resolving supply
regulator before enabling rdev.
Fixes: aea6cb9970 ("regulator: resolve supply after creating regulator")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20210519221224.2868496-1-dmitry.baryshkov@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
dev_pm_genpd_set_performance_state() may fail, so had better to check it's
return value before decreasing priv->enable_counter.
Fixes: bf3a28cf42 ("regulator: fixed: support using power domain for enable/disable")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210520111811.1806293-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Return -EINVAL if ramp_delay_table is NULL.
Also add WARN_ON since the driver code needs fix if this happened.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210519132255.1683863-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This enum is used only internally to the regulator driver for buck indexes.
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Include linux/of.h and linux/gpio/consumer.h to fix below errors:
error: implicit declaration of function ‘of_match_ptr’
error: implicit declaration of function ‘devm_gpiod_get_from_of_node’
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/20210518114843.1495152-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
-EINVAL is not a valid return value for .of_map_mode, return
REGULATOR_MODE_INVALID instead.
Fixes: 65ac97042d ("regulator: da9121: add mode support")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Adam Ward <Adam.Ward.opensource@diasemi.com>
Link: https://lore.kernel.org/r/20210517052721.1063375-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The tcs4525 regulator has a chip id of <12>.
Only allow the driver to bind to the correct chip id for safety, in
accordance with the other supported devices.
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Link: https://lore.kernel.org/r/20210511211335.2935163-3-pgwipeout@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The TCS4525 has 128 voltage steps. With the calculation set to 127 the
most significant bit is disregarded which leads to a miscalculation of
the voltage by about 200mv.
Fix the calculation to end deadlock on the rk3566-quartz64 which uses
this as the cpu regulator.
Fixes: 914df8faa7 ("regulator: fan53555: Add TCS4525 DCDC support")
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Link: https://lore.kernel.org/r/20210511211335.2935163-2-pgwipeout@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The tcs4525 voltage calculation is incorrect, which leads to a deadlock
on the rk3566-quartz64 board when loading cpufreq.
Fix the voltage calculation to correct the deadlock.
While we are at it, add a safety check and clean up the function names
to be more accurate.
Peter Geis (3):
regulator: fan53555: fix TCS4525 voltage calulation
regulator: fan53555: only bind tcs4525 to correct chip id
regulator: fan53555: fix tcs4525 function names
drivers/regulator/fan53555.c | 44 ++++++++++++++++++++++--------------
1 file changed, 27 insertions(+), 17 deletions(-)
--
2.25.1
The TCS4525 has 128 voltage steps. With the calculation set to 127 the
most significant bit is disregarded which leads to a miscalculation of
the voltage by about 200mv.
Fix the calculation to end deadlock on the rk3566-quartz64 which uses
this as the cpu regulator.
Fixes: 914df8faa7 ("regulator: fan53555: Add TCS4525 DCDC support")
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Link: https://lore.kernel.org/r/20210511211335.2935163-2-pgwipeout@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This patch adds missing MODULE_DEVICE_TABLE definition which generates
correct modalias for automatic loading of this driver when it is built
as an external module.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
Link: https://lore.kernel.org/r/1620705198-104566-1-git-send-email-zou_wei@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
V3:
- Drop the SoC regulator constraints for
regulator-min-microamp
regulator-max-microamp
These will be applied on a per-board basis - Mark Brown
V2:
The first version of this patch set the current limit to 3 amps as was done
in downstream. Mark indicated a preference to set this on a per-system
basis instead of blitzing it, as in downstream.
Looking at what was upstream versus what was in my working tree I saw that
in fact the VBUS boost driver had been upstreamed minus accompanying DTS in
pm8150b.
So there's no need for a fixes as this driver doesn't appear to be in use.
A subsequent patchset will enable the VBUS boost for the two relevant
upstream platforms.
First thing though, is the driver + dts change.
- Use regulator_set_current_limit_regmap/regulator_get_current_limit_regmap
with a relevant current-to-bitmap lookup.
- Add a parallel DTS entry to the pm8150b
It looks like this was submitted upstream but not followed up on
I've add regulator-min-microamp/regulator-max-microamp to Wesley's
original work.
I've made sure to test that its possible to set the current to anything in
the range of 500 mA to 3 A and confirmed the output on a scope.
Once these two patches are in, I'll send out board enablement for the
sm8150-mtp and qrb5165-rb5.
https://lore.kernel.org/linux-arm-msm/8687acdb-75e9-5fc5-dd3e-9a19615676b5@linaro.org/T/#t
Bryan O'Donoghue (1):
regulator: Add a routine to set the current limit for QCOM PMIC VBUS
Wesley Cheng (1):
arm64: boot: dts: qcom: pm8150b: Add DTS node for PMIC VBUS booster
arch/arm64/boot/dts/qcom/pm8150b.dtsi | 6 ++++++
drivers/regulator/qcom_usb_vbus-regulator.c | 12 ++++++++++++
2 files changed, 18 insertions(+)
--
2.30.1
Use rdev->regmap instead of pmic->regmap.
With this change, hi6421_spmi_regulator_disable can be removed and use
regulator_disable_regmap instead.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210430085555.1127994-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add hooks to regulator_get_current_limit_regmap() and
regulator_set_current_limit_regmap() with an accompanying map of amperages.
This lets us use the existing helper functions to map requested current
settings to register bit-map/indicies.
This change is required to elevate the default 2 Amps set by the bootloader
to 3 Amps or indeed to constrain the value lower as the system design may
dictate.
The valid range is 500 mA to 3 A in increments of 500 mA.
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Link: https://lore.kernel.org/r/20210427130712.2005456-2-bryan.odonoghue@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
- Add support for Software Nodes to MFD Core
- Remove support for Device Properties from MFD Core
- Use standard APIs in MFD Core
- New Drivers
- Add support for ROHM BD9576MUF and BD9573MUF PMICs
- Add support for Netronix Embedded Controller, PWM and RTC
- Add support for Actions Semi ATC260x PMICs and OnKey
- New Device Support
- Add support for DG1 PCIe Graphics Card to Intel PMT
- Add support for ROHM BD71815 PMIC to ROHM BD71828
- Add support for Tolino Shine 2 HD to Netronix Embedded Controller
- Add support for AX10 BMC Secure Updates to Intel M10 BMC
- Removed Device Support
- Remove Arizona Extcon support from MFD
- Remove ST-E AB8500 Power Supply code from MFD
- Remove AB3100 altogether
- New Functionality
- Add support for SMBus and I2C modes to Dialog DA9063
- Switch to using Software Nodes in Intel (various)
- New/converted Device Tree bindings; rohm,bd71815-pmic, rohm,bd9576-pmic,
netronix,ntxec, actions,atc260x,
ricoh,rn5t618, qcom-pm8xxx
- Fix-ups
- Fix error handling/path; intel_pmt
- Simplify code; rohm-bd718x7, ab8500-core, intel-m10-bmc
- Trivial clean-ups (reordering, spelling); rohm-generic, rn5t618, max8997
- Use correct data-type; db8500-prcmu
- Remove superfluous code; lp87565, intel_quark_i2c_gpi, lpc_sch, twl
- Use generic APIs/defines; lm3533-core, intel_quark_i2c_gpio
- Regmap related fix-ups; intel-m10-bmc, sec-core
- Reorder resource freeing during remove; intel_quark_i2c_gpio
- Make table indexing more robust; intel_quark_i2c_gpio
- Fix reference imbalances; arizona-irq
- Staticify and (un)constify things; arizona-spi, stmpe, ene-kb3930,
intel-lpss-acpi, intel-lpss-pci,
atc260x-i2c, intel_quark_i2c_gpio
- Bug Fixes
- Fix incorrect (register) values; intel-m10-bmc
- Kconfig related fixes; ABX500_CORE
- Do not clear the Auto Reload Register; stm32-timers
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmCJIPEACgkQUa+KL4f8
d2FRZA//Xu9f8u2uLuIfuhxIjUUXOqIjRAFnkhKlgGZhKsY8BohjQ80Tj9yp6UKy
St6ABwACO0hJap4zL4FxPW9+HXTmqZvAibnvHnvZdYSQ3ai6x9h6kTNvhSNLeRQU
fuY7eN8kpAHHiHNKNJCsQLQMvcIyP7+0KAP6qir5GYsMjiXspWq7THUnfBi2JXC6
y60guDo9XrgmQTO+pB870UJrKLM/h+iiohNRGxLFlShKhFCgbTB/wyw6bFeKy1SB
0/6XuY6fOt1IQyBDuzw383Q2faMWO9U+es29bwvFxdqJDK0MHQXC47zBba2q94wL
/9i/HSoz9dRHnTJNYUKWsVcPv4T84w/Iq7scyDvE00ubehJ+oo/M7Au3M6Tt3M1/
6lBAwFYXiwhQnp9EP3nwPwgJF6JzX1IGuMOsUAqrVFOEMuIkZKbRdUlatUhqepJT
spV4/TOfztAhY/7BzEOZLnF8cFNjmL5sn42/UzSRW708V5SxuTNsS48KJ4l0c7Er
CZSTlR/T1rKkWqf7ejaS2TNqMCdYyB3vZW0quDxZTHTZHv9huNUvtbKPR7jmd+4p
mrMIik7EE4BzC5m8tBPnXXZl+Og0keeYv4LUDBuLDX1agrxYIErl4ITvQTqqMfX1
Jt14SIjSO56iu2ngQuvGWwegVK4/urO2kBJKUAH1QN1OocNaajQ=
=IJSL
-----END PGP SIGNATURE-----
Merge tag 'mfd-next-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd
Pull MFD updates from Lee Jones:
"Core Framework:
- Add support for Software Nodes to MFD Core
- Remove support for Device Properties from MFD Core
- Use standard APIs in MFD Core
New Drivers:
- Add support for ROHM BD9576MUF and BD9573MUF PMICs
- Add support for Netronix Embedded Controller, PWM and RTC
- Add support for Actions Semi ATC260x PMICs and OnKey
New Device Support:
- Add support for DG1 PCIe Graphics Card to Intel PMT
- Add support for ROHM BD71815 PMIC to ROHM BD71828
- Add support for Tolino Shine 2 HD to Netronix Embedded Controller
- Add support for AX10 BMC Secure Updates to Intel M10 BMC
Removed Device Support:
- Remove Arizona Extcon support from MFD
- Remove ST-E AB8500 Power Supply code from MFD
- Remove AB3100 altogether
New Functionality:
- Add support for SMBus and I2C modes to Dialog DA9063
- Switch to using Software Nodes in Intel (various)
New/converted Device Tree bindings:
- rohm bd71815-pmic, rohm bd9576-pmic, netronix ntxec, actions
atc260x, ricoh rn5t618, qcom pm8xxx
- Fix-ups:
- Fix error handling/path; intel_pmt
- Simplify code; rohm-bd718x7, ab8500-core, intel-m10-bmc
- Trivial clean-ups (reordering, spelling); rohm-generic, rn5t618,
max8997
- Use correct data-type; db8500-prcmu
- Remove superfluous code; lp87565, intel_quark_i2c_gpi, lpc_sch, twl
- Use generic APIs/defines; lm3533-core, intel_quark_i2c_gpio
- Regmap related fix-ups; intel-m10-bmc, sec-core
- Reorder resource freeing during remove; intel_quark_i2c_gpio
- Make table indexing more robust; intel_quark_i2c_gpio
- Fix reference imbalances; arizona-irq
- Staticify and (un)constify things; arizona-spi, stmpe, ene-kb3930,
intel-lpss-acpi, intel-lpss-pci, atc260x-i2c, intel_quark_i2c_gpio
Bug Fixes:
- Fix incorrect (register) values; intel-m10-bmc
- Kconfig related fixes; ABX500_CORE
- Do not clear the Auto Reload Register; stm32-timers"
* tag 'mfd-next-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (84 commits)
mfd: intel-m10-bmc: Add support for MAX10 BMC Secure Updates
Revert "mfd: max8997: Add of_compatible to Extcon and Charger mfd_cell"
mfd: twl: Remove unused inline function twl4030charger_usb_en()
dt-bindings: mfd: Convert pm8xxx bindings to yaml
dt-bindings: mfd: Add compatible for pmk8350 rtc
i2c: designware: Get rid of legacy platform data
mfd: intel_quark_i2c_gpio: Convert I²C to use software nodes
mfd: lpc_sch: Partially revert "Add support for Intel Quark X1000"
mfd: arizona: Fix rumtime PM imbalance on error
mfd: max8997: Replace 8998 with 8997
mfd: core: Use acpi_find_child_device() for child devices lookup
mfd: intel_quark_i2c_gpio: Don't play dirty trick with const
mfd: intel_quark_i2c_gpio: Enable MSI interrupt
mfd: intel_quark_i2c_gpio: Reuse BAR definitions for MFD cell indexing
mfd: ntxec: Support for EC in Tolino Shine 2 HD
mfd: stm32-timers: Avoid clearing auto reload register
mfd: intel_quark_i2c_gpio: Replace I²C speeds with descriptive definitions
mfd: intel_quark_i2c_gpio: Remove unused struct device member
mfd: intel_quark_i2c_gpio: Unregister resources in reversed order
mfd: Kconfig: ABX500_CORE should depend on ARCH_U8500
...
Not much going on with regulator this cycle, even in terms of cleanups
and fixes things were fairly quiet.
- New helper for setting ramp delay.
- Conversion of the Qualcomm RPMH bindings to YAML.
- Support for Tang Cheng TCS4525.
-----BEGIN PGP SIGNATURE-----
iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmCGwr0ACgkQJNaLcl1U
h9AoxQf9GL9+ikg6p5RagNLslkcdsKaCfQJKzUTKIJGfFbmYLOqxNPyrFX2R3Dv3
YPGDzWwT7ZdBbXyXO5fr7Y8iqO+STyLeQnSCT0TSGATKrst+Gjwrt6Jc4pzyaPAc
lRC6atB1Lprucqh3gH4KTsuFPw6ag/44EdNevr37e9o2u5f3hLsy23Ng+xhP4Wfp
S7R18OGSpW0kHuLwomfjLC6sk1QfLnw6hIoDc7znmnndxQE1+z89p7SZ46hrf4hf
2bcWMLiXqthhzITTDUY41SmqSQVpSCyBjEjjIMcn6PdjJolTAHJuP3+wuLQYWf5r
MBhgxTssJTm+y4QlOhRoeoqAWJAxXw==
=9ZSz
-----END PGP SIGNATURE-----
Merge tag 'regulator-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator updates from Mark Brown:
"Not much going on with regulator this cycle, even in terms of cleanups
and fixes things were fairly quiet.
- New helper for setting ramp delay
- Conversion of the Qualcomm RPMH bindings to YAML
- Support for Tang Cheng TCS4525"
* tag 'regulator-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (26 commits)
regulator: Add binding for TCS4525
regulator: fan53555: Add TCS4525 DCDC support
dt-bindings: vendor-prefixes: Add Tang Cheng (TCS)
regulator: core: Fix off_on_delay handling
regulator: core: Respect off_on_delay at startup
regulator: core.c: Improve a comment
regulator: Avoid a double 'of_node_get' in 'regulator_of_get_init_node()'
regulator: core.c: Fix indentation of comment
regulator: s2mps11: Drop initialization via platform data
regulator: s2mpa01: Drop initialization via platform data
regulator: da9121: automotive variants identity fix
regulator: Add regmap helper for ramp-delay setting
regulator: helpers: Export helper voltage listing
regulator: Add compatibles for PM7325/PMR735A
regulator: Convert RPMh regulator bindings to YAML
regulator: qcom-rpmh: Add PM7325/PMR735A regulator support
regulator: qcom-rpmh: Add pmic5_ftsmps520 buck
regulator: mt6360: remove redundant error print
regulator: bd9576: Fix return from bd957x_probe()
regulator: add missing call to of_node_put()
...
Updates for SoC specific drivers include a few subsystems that
have their own maintainers but send them through the soc tree:
TEE/OP-TEE:
- Add tracepoints around calls to secure world
Memory controller drivers:
- Minor fixes for Renesas, Exynos, Mediatek and Tegra platforms
- Add debug statistics to Tegra20 memory controller
- Update Tegra bindings and convert to dtschema
ARM SCMI Firmware:
- Support for modular SCMI protocols and vendor specific extensions
- New SCMI IIO driver
- Per-cpu DVFS
The other driver changes are all from the platform maintainers
directly and reflect the drivers that don't fit into any other
subsystem as well as treewide changes for a particular platform.
SoCFPGA:
- Various cleanups contributed by Krzysztof Kozlowski
Mediatek:
- add MT8183 support to mutex driver
- MMSYS: use per SoC array to describe the possible routing
- add MMSYS support for MT8183 and MT8167
- add support for PMIC wrapper with integrated arbiter
- add support for MT8192/MT6873
Tegra:
- Bug fixes to PMC and clock drivers
NXP/i.MX:
- Update SCU power domain driver to keep console domain power on.
- Add missing ADC1 power domain to SCU power domain driver.
- Update comments for single global power domain in SCU power domain
driver.
- Add i.MX51/i.MX53 unique id support to i.MX SoC driver.
NXP/FSL SoC driver updates for v5.13
- Add ACPI support for RCPM driver
- Use generic io{read,write} for QE drivers after performance optimized
for PowerPC
- Fix QBMAN probe to cleanup HW states correctly for kexec
- Various cleanup and style fix for QBMAN/QE/GUTS drivers
OMAP:
- Preparation to use devicetree for genpd
- ti-sysc needs iorange check improved when the interconnect target module
has no control registers listed
- ti-sysc needs to probe l4_wkup and l4_cfg interconnects first to avoid
issues with missing resources and unnecessary deferred probe
- ti-sysc debug option can now detect more devices
- ti-sysc now warns if an old incomplete devicetree data is found as we
now rely on it being complete for am3 and 4
- soc init code needs to check for prcm and prm nodes for omap4/5 and dra7
- omap-prm driver needs to enable autoidle retention support for omap4
- omap5 clocks are missing gpmc and ocmc clock registers
- pci-dra7xx now needs to use builtin_platform_driver instead of using
builtin_platform_driver_probe for deferred probe to work
Raspberry Pi:
- Fix-up all RPi firmware drivers so as for unbind to happen in an
orderly fashion
- Support for RPi's PoE hat PWM bus
Qualcomm
- Improved detection for SCM calling conventions
- Support for OEM specific wifi firmware path
- Added drivers for SC7280/SM8350: RPMH, LLCC< AOSS QMP
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmCC2JwACgkQmmx57+YA
GNkgRg//cBtq2NyDbjiNABxFSkmGCfcc0w0C2wjVzr4cfg6BLTbuvvlpZxI912pu
P1G2sbsdfQJ8sSeIyZos+PilWK0zHrqlaGZfKI19US45dMjpteDBgsPd7wNZwBjQ
jbops3YLjztZK1HpY4dIdvMnfxt7yRqhBWaTbPuCwQ35c5KsOM8NHB3cP3BUINWK
x1uuBCv9svppzwdDiPxneV93WKEzabOUo+WBMPyh5vnyvmW17Iif4BA/VKQxzymm
mWUi8HHpKBpvntJOKwAD2hnLAdpR3SwX20SLOpyLhnJMotbzNUEqq3LdRxDNPdHk
ry+rarJ78JGlYfpcfegf2bLf5ITNMfOyRGkjtzeYpcZIXPjufOg9DA9YtAy37k0u
L0T/9gQ+tQ01WGMca77OyUtIqJKdblZrQMfuH/yGlR99bqFQMV7rNc7GNlX1MXp/
zw4aOYrRWGtGEeAjx5JJWcYydvMSJpCrqxTz3YhgeJECHB2iA6YkV3NROR4TLW//
tfxaKqxR/KmSqE6hoVOAuuQ0BLXNlql/+4EE6MKsAOBiKPJclvmJg4CyuY8G21ev
9Su0zJnXMzai7gNu32v1pizGj26+AOhxCEgAG0mGgk2jlQSn24CKgm5e7kCUewcF
j/1XksNPT95v/K8MsLpXe5xGvF3jhA1BlFfvjJNZOrcZywBXRxg=
=iidq
-----END PGP SIGNATURE-----
Merge tag 'arm-drivers-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
Pull ARM SoC driver updates from Arnd Bergmann:
"Updates for SoC specific drivers include a few subsystems that have
their own maintainers but send them through the soc tree:
TEE/OP-TEE:
- Add tracepoints around calls to secure world
Memory controller drivers:
- Minor fixes for Renesas, Exynos, Mediatek and Tegra platforms
- Add debug statistics to Tegra20 memory controller
- Update Tegra bindings and convert to dtschema
ARM SCMI Firmware:
- Support for modular SCMI protocols and vendor specific extensions
- New SCMI IIO driver
- Per-cpu DVFS
The other driver changes are all from the platform maintainers
directly and reflect the drivers that don't fit into any other
subsystem as well as treewide changes for a particular platform.
SoCFPGA:
- Various cleanups contributed by Krzysztof Kozlowski
Mediatek:
- add MT8183 support to mutex driver
- MMSYS: use per SoC array to describe the possible routing
- add MMSYS support for MT8183 and MT8167
- add support for PMIC wrapper with integrated arbiter
- add support for MT8192/MT6873
Tegra:
- Bug fixes to PMC and clock drivers
NXP/i.MX:
- Update SCU power domain driver to keep console domain power on.
- Add missing ADC1 power domain to SCU power domain driver.
- Update comments for single global power domain in SCU power domain
driver.
- Add i.MX51/i.MX53 unique id support to i.MX SoC driver.
NXP/FSL SoC driver updates for v5.13
- Add ACPI support for RCPM driver
- Use generic io{read,write} for QE drivers after performance
optimized for PowerPC
- Fix QBMAN probe to cleanup HW states correctly for kexec
- Various cleanup and style fix for QBMAN/QE/GUTS drivers
OMAP:
- Preparation to use devicetree for genpd
- ti-sysc needs iorange check improved when the interconnect target
module has no control registers listed
- ti-sysc needs to probe l4_wkup and l4_cfg interconnects first to
avoid issues with missing resources and unnecessary deferred probe
- ti-sysc debug option can now detect more devices
- ti-sysc now warns if an old incomplete devicetree data is found as
we now rely on it being complete for am3 and 4
- soc init code needs to check for prcm and prm nodes for omap4/5 and
dra7
- omap-prm driver needs to enable autoidle retention support for
omap4
- omap5 clocks are missing gpmc and ocmc clock registers
- pci-dra7xx now needs to use builtin_platform_driver instead of
using builtin_platform_driver_probe for deferred probe to work
Raspberry Pi:
- Fix-up all RPi firmware drivers so as for unbind to happen in an
orderly fashion
- Support for RPi's PoE hat PWM bus
Qualcomm
- Improved detection for SCM calling conventions
- Support for OEM specific wifi firmware path
- Added drivers for SC7280/SM8350: RPMH, LLCC< AOSS QMP"
* tag 'arm-drivers-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (165 commits)
soc: aspeed: fix a ternary sign expansion bug
memory: mtk-smi: Add device-link between smi-larb and smi-common
memory: samsung: exynos5422-dmc: handle clk_set_parent() failure
memory: renesas-rpc-if: fix possible NULL pointer dereference of resource
clk: socfpga: fix iomem pointer cast on 64-bit
soc: aspeed: Adapt to new LPC device tree layout
pinctrl: aspeed-g5: Adapt to new LPC device tree layout
ipmi: kcs: aspeed: Adapt to new LPC DTS layout
ARM: dts: Remove LPC BMC and Host partitions
dt-bindings: aspeed-lpc: Remove LPC partitioning
soc: fsl: enable acpi support in RCPM driver
soc: qcom: mdt_loader: Detect truncated read of segments
soc: qcom: mdt_loader: Validate that p_filesz < p_memsz
soc: qcom: pdr: Fix error return code in pdr_register_listener
firmware: qcom_scm: Fix kernel-doc function names to match
firmware: qcom_scm: Suppress sysfs bind attributes
firmware: qcom_scm: Workaround lack of "is available" call on SC7180
firmware: qcom_scm: Reduce locking section for __get_convention()
firmware: qcom_scm: Make __qcom_scm_is_call_available() return bool
Revert "soc: fsl: qe: introduce qe_io{read,write}* wrappers"
...
Here is the big set of staging and IIO driver updates for 5.13-rc1.
Lots of little churn in here, and some larger churn as well. Major
things are:
- removal of wimax drivers, no one has this hardware anymore for
this failed "experiment".
- removal of the Google gasket driver, turns out no one wanted
to maintain it or cares about it anymore, so they asked for it
to be removed.
- comedi finally moves out of the staging directory into
drivers/comedi/ This is one of the oldest kernel subsystems
around, being created in the 2.0 kernel days, and was one of
the first things added to drivers/staging/ when that was
created over 15 years ago. It should have been moved out of
staging a long time ago, it's well maintained and used by
loads of different devices in the real world every day. Nice
to see this finally happen.
- so many tiny coding style cleanups it's not funny. Perfect
storm of at least 2 different intern project application
deadlines combined to provide a huge number of new
contributions in this area from people learning how to do
kernel development. Great job to everyone involved here.
There's also the normal updates for IIO drivers with new IIO drivers and
updates all over that subsystem.
All of these have been in linux-next for a while with no reported
issues.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-----BEGIN PGP SIGNATURE-----
iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCYIa1zw8cZ3JlZ0Brcm9h
aC5jb20ACgkQMUfUDdst+ykfMACgq/Qj9n6NO/P4BX55XWjRkjOmxxwAoKrYEWkG
fIdLmhh4FGWkxaJO3Izf
=PCXb
-----END PGP SIGNATURE-----
Merge tag 'staging-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging/IIO driver updates from Greg KH:
"Here is the big set of staging and IIO driver updates for 5.13-rc1.
Lots of little churn in here, and some larger churn as well. Major
things are:
- removal of wimax drivers, no one has this hardware anymore for this
failed "experiment".
- removal of the Google gasket driver, turns out no one wanted to
maintain it or cares about it anymore, so they asked for it to be
removed.
- comedi finally moves out of the staging directory into drivers/comedi
This is one of the oldest kernel subsystems around, being created
in the 2.0 kernel days, and was one of the first things added to
drivers/staging/ when that was created over 15 years ago.
It should have been moved out of staging a long time ago, it's well
maintained and used by loads of different devices in the real world
every day. Nice to see this finally happen.
- so many tiny coding style cleanups it's not funny.
Perfect storm of at least 2 different intern project application
deadlines combined to provide a huge number of new contributions in
this area from people learning how to do kernel development. Great
job to everyone involved here.
There's also the normal updates for IIO drivers with new IIO drivers
and updates all over that subsystem.
All of these have been in linux-next for a while with no reported
issues"
* tag 'staging-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (907 commits)
staging: octeon: Use 'for_each_child_of_node'
Staging: rtl8723bs: rtw_xmit: fixed tabbing issue
staging: rtl8188eu: remove unused function parameters
staging: rtl8188eu: cmdThread is a task_struct
staging: rtl8188eu: remove constant variable and dead code
staging: rtl8188eu: change bLeisurePs' type to bool
staging: rtl8723bs: remove empty #ifdef block
staging: rtl8723bs: remove unused DBG_871X_LEVEL macro declarations
staging: rtl8723bs: split too long line
staging: rtl8723bs: fix indentation in if block
staging: rtl8723bs: fix code indent issue
staging: rtl8723bs: replace DBG_871X_LEVEL logs with netdev_*()
staging: rtl8192e: indent statement properly
staging: rtl8723bs: Remove led_blink_hdl() and everything related
staging: comedi: move out of staging directory
staging: rtl8723bs: remove sdio_drv_priv structure
staging: rtl8723bs: remove unused argument in function
staging: rtl8723bs: remove DBG_871X_SEL_NL macro declaration
staging: rtl8723bs: replace DBG_871X_SEL_NL with netdev_dbg()
staging: rtl8723bs: fix indentation issue introduced by long line split
...
The jiffies-based off_on_delay implementation has a couple of problems
that cause it to sometimes not actually delay for the required time:
(1) If, for example, the off_on_delay time is equivalent to one jiffy,
and the ->last_off_jiffy is set just before a new jiffy starts,
then _regulator_do_enable() does not wait at all since it checks
using time_before().
(2) When jiffies overflows, the value of "remaining" becomes higher
than "max_delay" and the code simply proceeds without waiting.
Fix these problems by changing it to use ktime_t instead.
[Note that since jiffies doesn't start at zero but at INITIAL_JIFFIES
("-5 minutes"), (2) above also led to the code not delaying if
the first regulator_enable() is called when the ->last_off_jiffy is not
initialised, such as for regulators with ->constraints->boot_on set.
It's not clear to me if this was intended or not, but I've preserved
this behaviour explicitly with the check for a non-zero ->last_off.]
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Link: https://lore.kernel.org/r/20210423114524.26414-1-vincent.whitchurch@axis.com
Signed-off-by: Mark Brown <broonie@kernel.org>
We currently do not respect off_on_delay the first time we turn on a
regulator. This is problematic since the regulator could have been
turned off by the bootloader, or it could it have been turned off during
the probe of the regulator driver (such as when regulator-fixed requests
the enable GPIO), either of which could potentially have happened less
than off_on_delay microseconds ago before the first time a client
requests for the regulator to be turned on.
We can't know exactly when the regulator was turned off, but initialise
off_on_delay to the current time when registering the regulator, so that
we guarantee that we respect the off_on_delay in all cases.
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Link: https://lore.kernel.org/r/20210422083044.11479-1-vincent.whitchurch@axis.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Hi,
The Samsung PMIC drivers since long time are used only on devicetree
platforms (Samsung Exynos) and there are no users with board files.
Drop the support for board files entirely and depend on OF for matching.
This makes the code smaller and simpler.
Dependencies
============
The MFD pieces are rebased on my previous sec-core dirver changes:
mfd: sec: Simplify getting of_device_id match data
https://lore.kernel.org/linux-samsung-soc/20210420113929.278082-1-krzysztof.kozlowski@canonical.com/T/#t
Applying - can be independent
=============================
The last RTC and regulator patches can be picked up independently via
regulator and rtc trees. There are no board files currently, so the
code in these drivers is basically dead code and feature-bisection is
preserved.
Best regards,
Krzysztof
Krzysztof Kozlowski (9):
mfd: sec: Drop support for board files and require devicetree
mfd: sec: Remove unused cfg_pmic_irq in platform data
mfd: sec: Remove unused device_type in platform data
mfd: sec: Remove unused irq_base in platform data
mfd: sec: Enable wakeup from suspend via devicetree property
mfd: sec: Remove unused platform data members
rtc: s5m: Remove reference to parent's device pdata
regulator: s2mpa01: Drop initialization via platform data
regulator: s2mps11: Drop initialization via platform data
drivers/mfd/Kconfig | 1 +
drivers/mfd/sec-core.c | 64 +++++---------------------------
drivers/mfd/sec-irq.c | 4 +-
drivers/regulator/s2mpa01.c | 4 --
drivers/regulator/s2mps11.c | 22 +----------
drivers/rtc/rtc-s5m.c | 6 ---
include/linux/mfd/samsung/core.h | 33 ----------------
7 files changed, 14 insertions(+), 120 deletions(-)
--
2.25.1
s/regulator may on/regulator may already be enabled/
s/or left on/or was left on/
The aim of this patch is to make the comment more readable and to make
it clear, that this is about a regulator, that is already enabled instead
of a regulator that may be switched on.
Signed-off-by: Sebastian Fricke <sebastian.fricke@posteo.net>
Link: https://lore.kernel.org/r/20210421055236.13148-1-sebastian.fricke@posteo.net
Signed-off-by: Mark Brown <broonie@kernel.org>
'for_each_available_child_of_node()' already performs an 'of_node_get()'
on child, so there is no need to perform another one before returning.
Otherwise, a double 'get' is performed and a resource may never be
released.
Fixes: 925c85e21e ("regulator: Factor out location of init data OF node")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/a79f0068812b89ff412d572a1171f22109c24132.1618947049.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
This patch fixes identification of DA913x parts by the DA9121 driver,
where a lack of clarity lead to implementation on the basis that variant
IDs were to be identical to the equivalent rated non-automotive parts.
There is a new emphasis on the DT identity to cope with overlap in these
ID's - this is not considered to be problematic, because projects would
be exclusively using automotive or consumer grade parts.
Signed-off-by: Adam Ward <Adam.Ward.opensource@diasemi.com>
Link: https://lore.kernel.org/r/20210421120306.DB5B880007F@slsrvapps-01.diasemi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
-----BEGIN PGP SIGNATURE-----
iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAmBzdS0eHHRvcnZhbGRz
QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiGDdAIAIpKH/tAHhH7s7QH
m5ewgE8foP7M5Ue9fp3+JmbtaYSzhCAMcKhqGtat/zk5PvA9AoYCDXrTetfYtBHh
LUOmhL9hcKItNobfkYBok6BiFjGUEL3HMqz5w+MUsMwnXIc4RXqfJmsQ932z9Kxf
yDwe6ehIzJVrQLI/C0mTamYRHu2aiZ1VWzhKuT493rLeg0R2odCCIClPN+/QvCwb
8/sk6l1c8eOUYYMUzKFZifaZGb12qDjRt4pZmk51aMTzg0WCpElJG+7Uqr4QQhZP
p6xeNuUQq6WwxtlDkmo79Uzkrurb5tN2/hZ1RcJhs3EdHfpR0MjIyH3Znnb31gnu
39VjHhg=
=4KP/
-----END PGP SIGNATURE-----
Merge tag 'v5.12-rc7' into driver-core-next
We need the driver core fix in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmB2tEoACgkQUa+KL4f8
d2GqwRAAoslBlgvaQy5UB/dD1sVFzNNeqUhXJIYHMN0AvC5BRiysEBUqWotf0CKp
ywl34SRiEyZ7RAgyYZpZ3gR7pmx8tPSf8PzKMLyZgzOfj5JjEM35Qu7oxPpi7Cnl
g6kRvlUyVHeFS0uNkUORg7pG3MA43kx6u2SjjEHIyPdDgjmT9QWHH8/8sQdv++Hs
AOFvsqe5rIpyDKvY0h/xG018AMq8Gr3kZNCg2rYPoxzzjXWZK5CPInzbLnrkZ0Nh
HEehgtEYN+QmFp6tU1AdJXDReEckQkyOGJ1jSy5sPAKWJ0NKKzaTjwcP8T0KN7Nw
03VYhA6iom9U4oQGVxZLKKm20QRvevx2ZzYU8yK9qEamwsGADBwlNxO1v3C4dYUT
AC1xrmu570Hr7EaZYQkU0s4kjqIyZfm9JOTcsltOGYACvE34tgIMiIR5qu1VXnmX
OcOBUGiQqFovu+zYgHvMhggjclTYu5xM+DH7coi9iFLc7FftbjXF+T8Q/EV/qAfL
SaVbCQ1XYMefA92pI4kntHMhTe+eNSEDHodc1Tuw/dN4kEJ82R13WpCojH5L739I
VXaB7GO11W6iVD1wgmv03pf2Ce+TLifHZE90t8GSh5zztND1qI60c3Mc4KOSkGHU
i5qbGdyFph2MYnWzydPJgSNXoCzLsT/sHwABprOIa7/05mNfEyc=
=7O9a
-----END PGP SIGNATURE-----
mergetag object a908a71669
type commit
tag ib-mfd-extcon-v5.13
tagger Lee Jones <lee.jones@linaro.org> 1616067995 +0000
Immutable branch between MFD and Extcon due for the v5.13 merge window
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmBTPZsACgkQUa+KL4f8
d2Ew4g/8CZnru5gfuR2uMZIReS8Q4RniTKe3IoQNGE+nyZFp8heJm5sJ/tcHzHuX
RcBbuY9hLhhZRvQ+WrveYiXYdC3tH/8j/5mHj6CLJDwh8ukEf9H/tcNAx1T0Y8by
C3Y/lY7avAzfTorJQ2g+LRkbuei3mojTpUuEiwgdJEzydbg/GzYVv2edRvdCkW0Y
6xCg8ufmWBTjrHHoXm4/wtGSJ2L17coieSRSIiQ4KsGf8xM6QAnUEXbwQV3KjlVS
SbI0gucfjnYYdsYqrPy+yyA8gzA5utP/0Zis4pfDG1Av1dBm6ZfD5n/z+KYyJUoG
C1GPkqxukZODBitwO6PdCoHpFTsbwfoqz6HD8o+6oFqScdBtU7C8SectMpis0G4/
j3VrstGL6T0GgzuVmy5EnpPkqyiiJh3Smv5ZS91Rztiy4CTTvLlkrw5+h0GP9aR7
uUfNmQU65KCG4WscnwuWeImcQzxRAlsiI0QxXFmHhIxZFG8Bq2z11V5rcpYdJXgx
GbkOml6iq+G1UQu3sKYgLlE2Lg3IlehjytAbpY0Qoj9VE1FeE8STgYQMEwT5TqIB
Em6T1fkpXp2kho92rmJ+rjcAJp7rKmlSQHO0xgbJwbzZsA5rKvClAn3PZmoZs7HY
VHmeWjPihoo7qJTx7LVhWEtYptKG31JqCRPFTbVXjeCvClnjcFU=
=3CZN
-----END PGP SIGNATURE-----
mergetag object eac013a0b7
type commit
tag ib-mfd-input-v5.13-1
tagger Lee Jones <lee.jones@linaro.org> 1615374673 +0000
Immutable branch between MFD and Input due for the v5.13 merge window
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmBIqV8ACgkQUa+KL4f8
d2EmIw//fydErEBA/TsNSSMfAxK+WRY3xDFdTwK9NorfJiyPFMwsfIZ2Y0BdGHpa
cNz4EMqcfKgHzblbla5EOW64RDIIFQfDTiuCJTGaTB5LUlI56hnKEuiKlrtKlQMC
3ZSxY5+SY5OFwof4LFPCASyn0N3bH8Mdd1inyFAIphFrgHKez353B9N2RwePlpLq
7jWaGABQVo28cPpkLl3Slo064xadzS2+Sklwii8gOOvtAGMkLkvLpFEcGCNFRX7l
OBnw8QP3SCg14b7hrtSys2g7onpH3M5eDt5LwJVqOXEY5SCWJUoultF0msNuGVlq
XGxJATebx0iU3IByhgTFmzj3ymCWZ7I/EeXD1GI0Fn5EscK1AsrRimlQNcxq9Nm7
tb/mV3FZlkNi6FjOq/rQ90QgT20t74tGrU9qpXlbwpB2Z9jO3GCDTFLt0XQFEE/4
83nqIjhYfbpkNXfRTH6/FPtFWqpfw+U8/kNMNWSk9BNta+67++vBQzeFAYWC6hFK
m7LTzyDNb/EHstAYdXIDblEX4x1VLOilKMaltRqlQC9sUZ4ZpA4YxFJKX21mtGBX
0jrM2SLeBff+Xv4i/UdoiGBC2uWiBPWW0G94IkDwpCM272q5br8LxTuKIzWCv4w4
/4J8bXtVfmXl74lXw90ZnMwHApq95+yPDd2g8XTcdo+zctSqS6E=
=NF6J
-----END PGP SIGNATURE-----
mergetag object aa47ad3f85
type commit
tag ib-mfd-platform-x86-v5.13
tagger Lee Jones <lee.jones@linaro.org> 1615373744 +0000
Immutable branch between MFD and Platform/x86 due for the v5.13 merge window
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmBIpbAACgkQUa+KL4f8
d2H/NA//bVtt5HlRE0LE8QYOrP2+KmAOOOmIH4eU4eTfn82xMWVmsX+1AsC7ANx0
eq2pPB3BDQU2MkT9YvtZCud5/3TKYPJfzDl5qppkYTxS7BgRPPnFMXLSi5CofiH9
dDYSE1Iv0XMPBboJoce/RaBck/yWm5DLWHUR2w8Nc3n61uHCFrPBZeI058ZZXYnh
DZyiItaVIHDs1jIrVjS87SGcIoSXjfWgBFQkTS9jLneZcC0HRebGA78raEHzeBVK
Zpx5syisRoPkT+Hxb+Qe28ffqf9Qc/RyOpRnhmCDA0xxskembakati/XhnHtbHaT
kXmSvsC+OeDXZw8jeVTPz8ZGEmd4H2GLXuVAMuQbOlfuPZgFP+9V5C4LFu2oiT9v
t9USjr3VgqjGocVntP9B1PgqiDlHuzLinvB614WYPFIXiHJa0xKoEzTQlUbUTn22
v9Tvyfgx5oczktpavCm3YzgWRyFxphaE++vSIBOJlACoqYQT6At0wnn2qr2+mTL0
dZy6H/vEXLQFGRcwDmHWDRBoU9D1QTQzWIsl8u8+Pq9SGoa12YmpwOjsuK3WP3wS
iRl1q35AuyEp6zaclowlW4qcTGlwRMN5rUzReMmRbfg3xqwxj6FwxY87fYtDc7Uu
E3dklJjeZeSGw3rAJSRQzm0JMhlkRWyFdZ6KPxfnWzsPmrza2vY=
=340a
-----END PGP SIGNATURE-----
mergetag object ee0975c308
type commit
tag ib-mfd-power-v5.13
tagger Lee Jones <lee.jones@linaro.org> 1616489771 +0000
Immutable branch between MFD and Power due for the v5.13 merge window
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmBZrSsACgkQUa+KL4f8
d2EyiA/9GRBj8piXoHnlqA4lkExInTddmts2r7aDtmPa1iCUT5XeyIoiSWdnFz++
fr9ion87/T89zVJWLMGHi5HRlOEQwR0eG8VUF7rAp8qV9ANOOB8sYi0KC4k1ADet
+SNTqUYIbA3xrlH+DSPBRmyWMJ6EHkrtmzBCO4PUyxEexFFGSGz3BuEkCdhKMsUb
/t/AqxLEs9v8dHOIWHTlKK9M1divTdBkqN8mwUfGMDqvtCpFXIuSZ3koTnK9wJyd
Pqw+5XAoL8cMfSkQrwIpZGRdzyCa9f0iOJz8gdYYKxq1575zGxUTM53z3MYb+ujX
ei3oO99bCNLezcWozBNEJIlk4LK2FdzWFrlimsxE+2IStH9p1TE3voWFUJh+tL3f
mbYHNJr35pBNRXA07iQccA9V2zCFAeN4GaeRrY59blcfw8fvOGcWwni8YDbWmmGz
E/xYv7WeNtrzrELNDMpGJ4w909EItfXEsWyzItJBhI5ThsRPOpET7uBolkEfbd5M
jjGM2pGeLq++Zd1c2kBzc3a2gW60iGNI6dMBpZWCwCCPe1Vz7okiu1hVULMYYXgZ
B7F8xzM60phdlMUrFu/tFyYPOs8/0w8tk5QjGiD7/FkLsFhD6UdJsD0r02PCtqN+
4BRGwOmZWED83XVDTkwVR61GWPP7mWl5AUywe2XdPBo6/jhWTBY=
=+5eM
-----END PGP SIGNATURE-----
mergetag object edbda8f787
type commit
tag ib-mfd-pwm-rtc-v5.13-1
tagger Lee Jones <lee.jones@linaro.org> 1615374433 +0000
Immutable branch between MFD, PWM and RTC due for the v5.13 merge window
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmBIqH8ACgkQUa+KL4f8
d2F8EhAAi4vdKdfmlkJYcOS/wwWHR+wF3LOrTdmv80oP19/QY5Ctk/zgjYOmet+K
WOLFOH0WCwp+NlEpiFDhlhAqApFNw4F24Dp4iiMGfYF+ohpoDNMIV9bYC9PpLeF1
IsXo/vRsYQN9JtHZEHlICbw+W60jfTx4F1woQVuMM1sTIb65DVlHHEGKBFH4v+ys
fXZWTIhMCnVrJvM26dU4YZ0uj3RbAZlzK5itOzIwaU6OLitc0XlFGH+zsIiHioNl
wsfJJc5WzeJwCbanqsdiA+lAQ3oRhzns0bOSeTyf0xWS1HzKSMBhpkvGLa//5kmD
I5HEtw46OvWtvZ8AaBVeHVlIGZ+00Yxs3ORFK/koGOFcTayh/7QjhS8/wSIW0yp8
Nxwr8OXpHLicJceIm7/1OpfSbawnY0f93Cu2c6rzDLWz0JTzO6f5EmfFr8I/T+bB
7gexysH3JoOYutsPD9EsEoaexFx4ZsYSoPQJ5Jf74pmMJUUkDwzSo2DQb34DM8Ja
uRwka56ayuubhEX8jd5hru/X7Ikl2GYoMG/ZsZ09BfWhGA3F55R6cn0+UiEwj03M
rn6/FSl8EHgAQ5W7JT85rucbBAT2HmuZWV2OFSM3ldlD1Tws/GucDRELn9q37YpS
w7bq+hXd6sHEJnx1vtVnJoXx+0DJdZ00koj4h3xdNm936p7K9/w=
=DySP
-----END PGP SIGNATURE-----
Merge tags 'ib-mfd-clk-gpio-regulator-rtc-v5.13', 'ib-mfd-extcon-v5.13', 'ib-mfd-input-v5.13-1', 'ib-mfd-platform-x86-v5.13', 'ib-mfd-power-v5.13', 'ib-mfd-pwm-rtc-v5.13-1' and 'ib-regulator-list-ramp-helpers-v5.13' into ibs-for-mfd-merged
Immutable branch between MFD, Clock, GPIO, Regulator and RTC due for the v5.13 merge window
Immutable branch between MFD and Extcon due for the v5.13 merge window
Immutable branch between MFD and Input due for the v5.13 merge window
Immutable branch between MFD and Platform/x86 due for the v5.13 merge window
Immutable branch between MFD and Power due for the v5.13 merge window
Immutable branch between MFD, PWM and RTC due for the v5.13 merge window
Support voltage control for regulators on ROHM BD71815 PMIC.
ROHM BD71815 contains 5 bucks, 7 LDOs and a boost (intended for LED).
Bucks 1 and 2 support HW state based voltage level and enable states. Other
regulators support HW state based enable states. All bucks and LDOs 1-5
allow voltage changes for RUN state and LDO4 can be enabled/disabled via
GPIO.
LDO3 does support changing between two predetermined voltages by using
a GPIO but this functionality is not included in this commit.
This work is derived from driver originally written by Tony Luo
<luofc@embedinfo.com> - although not much of original work is left.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Use generic regamp ramp-delay helper function instead of implementing own.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
The ROHM BD71815 supports setting voltage levels/regulator status
for HW-states "RUN", "SUSPEND", "LPSR" and "SNVS". Add DT parsing
helper also for SNVS state.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
The helper for obtaining HW-state based DVS voltage levels currently only
works for regulators using linear-ranges. Extend support to regulators with
simple linear mappings and add also proper error path if pickable-ranges
regulators call this.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Patch series introducing support for ROHM BD71815 PMIC
ROHM BD71815 is a power management IC used in some battery powered
systems. It contains regulators, GPO(s), charger + coulomb counter, RTC
and a clock gate.
All regulators can be controlled via I2C. LDO4 can additionally be set to
be enabled/disabled by a GPIO. LDO3 voltage could be selected from two
voltages written into separate VSEL reisters using GPIO but this mode is
not supported by driver. On top of that the PMIC has the typical HW
state machine which is present also on many other ROHM PMICs.
IC contains two GPOs - but one of the GPOs is marked as GND in
data-sheet. Thus the driver by default only exposes one GPO. The second
GPO can be enabled by special DT property.
RTC is almost similar to what is on BD71828. For currently used features
only the register address offset to RTC block differs.
The charger driver is not included in this series. ROHM has a charger
driver with some fuel-gauging logig written in but this is not included
here. I am working on separating the logic from HW specific driver and
supporting both BD71815 and BD71828 chargers in separate patch series.
Changelog v5:
Regulator:
- Added regmap helper for regulator ramp-delay and taken it in use
(patches 13, 14, 16 - they can be just dropped if ramp-delay helper is not
a good idea. Patch 15 implements old-fashioned ramp-delay)
GPIO:
- styling changes to GPIO (Mostly suggested by Andy)
- implemented init_valid_mask (but can't count on it yet)
Changelog v4:
- Sorted ROHM chip ID enum
- Statcized DVS structures in regulator driver
- Minor styling for regulator driver
- rebased on v5.12-rc4
Changelog v3:
- GPIO clean-up as suggested by Bartosz
- MFD clean-up as suggested by Lee
- clk-mode dt-binding handling in MFD driver corrected to reflect new
property values.
- Dropped already applied patches
- Rebased on v5.12-rc2
Changelog v2:
- Rebased on top of v5.11-rc3
- Added another "preliminary patch" which fixes HW-dvs voltage
handling (patch 1)
- split regulator patch to two.
- changed dt-binding patch ordering.
regulators:
- staticized probe
- removed some unnecessary defines
- updated comments
- split rohm-regulator patch adding SNVS and supporting simple
linear mapping into two - one adding support for mapping, other
adding SNVS.
GPIO:
- removed unnecessary headers
- clarified dev/parent->dev usage
- removed forgotten #define DEBUG
dt-bindings:
- changed patch order to meet ref-dependencies
- added missing regulator nodes
- changed string property for clk mode to tristated
MFD:
- header cleanups.
CLK:
- fixed commit message
--
Matti Vaittinen (19):
rtc: bd70528: Do not require parent data
mfd: bd718x7: simplify by cleaning unnecessary device data
dt_bindings: bd71828: Add clock output mode
dt_bindings: regulator: Add ROHM BD71815 PMIC regulators
dt_bindings: mfd: Add ROHM BD71815 PMIC
mfd: Add ROHM BD71815 ID
mfd: Sort ROHM chip ID list for better readability
mfd: Support for ROHM BD71815 PMIC core
gpio: support ROHM BD71815 GPOs
regulator: helpers: Export helper voltage listing
regulator: rohm-regulator: linear voltage support
regulator: rohm-regulator: Support SNVS HW state.
regulator: Add regmap helper for ramp-delay setting
regulator: bd718x7, bd71828: Use ramp-delay helper
regulator: Support ROHM BD71815 regulators
regulator: bd71815: use ramp-delay helper
clk: bd718x7: Add support for clk gate on ROHM BD71815 PMIC
rtc: bd70528: Support RTC on ROHM BD71815
MAINTAINERS: Add ROHM BD71815AGW
.../bindings/mfd/rohm,bd71815-pmic.yaml | 201 ++++++
.../bindings/mfd/rohm,bd71828-pmic.yaml | 6 +
.../regulator/rohm,bd71815-regulator.yaml | 116 ++++
MAINTAINERS | 3 +
drivers/clk/clk-bd718x7.c | 9 +-
drivers/gpio/Kconfig | 10 +
drivers/gpio/Makefile | 1 +
drivers/gpio/gpio-bd71815.c | 193 ++++++
drivers/mfd/Kconfig | 15 +-
drivers/mfd/rohm-bd71828.c | 486 +++++++++----
drivers/mfd/rohm-bd718x7.c | 43 +-
drivers/regulator/Kconfig | 11 +
drivers/regulator/Makefile | 1 +
drivers/regulator/bd71815-regulator.c | 651 ++++++++++++++++++
drivers/regulator/bd71828-regulator.c | 51 +-
drivers/regulator/bd718x7-regulator.c | 60 +-
drivers/regulator/helpers.c | 101 ++-
drivers/regulator/rohm-regulator.c | 23 +-
drivers/rtc/Kconfig | 6 +-
drivers/rtc/rtc-bd70528.c | 104 +--
include/linux/mfd/rohm-bd71815.h | 562 +++++++++++++++
include/linux/mfd/rohm-bd71828.h | 3 +
include/linux/mfd/rohm-bd718x7.h | 13 -
include/linux/mfd/rohm-generic.h | 15 +-
include/linux/regulator/driver.h | 7 +
25 files changed, 2393 insertions(+), 298 deletions(-)
create mode 100644 Documentation/devicetree/bindings/mfd/rohm,bd71815-pmic.yaml
create mode 100644 Documentation/devicetree/bindings/regulator/rohm,bd71815-regulator.yaml
create mode 100644 drivers/gpio/gpio-bd71815.c
create mode 100644 drivers/regulator/bd71815-regulator.c
create mode 100644 include/linux/mfd/rohm-bd71815.h
base-commit: 0d02ec6b31
--
2.25.4
--
Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland SWDC
Kiviharjunlenkki 1E
90220 OULU
FINLAND
~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~
Simon says - in Latin please.
~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~
Thanks to Simon Glass for the translation =]
Some drivers need to translate voltage values to selectors prior regulator
registration. Currently a regulator_desc based list_voltages helper is only
exported for regulators using the linear_ranges. Export similar helper also
for regulators using simple linear mapping.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/1200ef7a50c84327ada019b85f6527b4fc9b5ce1.1617020713.git.matti.vaittinen@fi.rohmeurope.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add support for PM7325/PMR735A regulators. This ensures
that consumers are able to modify the physical state of PMIC
regulators.
Signed-off-by: satya priya <skakit@codeaurora.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Link: https://lore.kernel.org/r/1617192339-3760-3-git-send-email-skakit@codeaurora.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Port the scmi regulator driver to the new SCMI voltage interface based
on protocol handles and common devm_get_ops().
Link: https://lore.kernel.org/r/20210316124903.35011-30-cristian.marussi@arm.com
Cc: Mark Brown <broonie@kernel.org>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
fixes coccicheck warning:
drivers/regulator/mt6360-regulator.c:384:3-10: line 384 is
redundant because platform_get_irq() already prints an error
in fact it is not platform_get_irq but platform_get_irq_byname print error
Signed-off-by: Jian Dong <dongjian@yulong.com>
Link: https://lore.kernel.org/r/1616555474-158789-1-git-send-email-dj0227@163.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Few drivers implement remove call-back only for ensuring a delayed
work gets cancelled prior driver removal. Clean-up these by switching
to use devm_delayed_work_autocancel() instead.
Additionally, this helps avoiding mixing devm and manual resource
management and cleans up a (theoretical?) bug where devm managed
over-current IRQ might schedule a new work item after wq was cleaned
at remove().
This change is compile-tested only. All testing is appreciated.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/3bd35bb43257f4bf5b99f75d207ed5e1e08d1d38.1616506559.git.matti.vaittinen@fi.rohmeurope.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The probe() function returns an uninitialized variable in the success
path. There is no need for the "err" variable at all, just delete it.
Fixes: b014e9fae7 ("regulator: Support ROHM BD9576MUF and BD9573MUF")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/YEsbfLJfEWtnRpoU@mwanda
Signed-off-by: Mark Brown <broonie@kernel.org>
Convert the "backup_mode" device attribute from sprintf() to
sysfs_emit(), as the latter is aware of the PAGE_SIZE buffer.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20210312130242.3390038-4-geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
If a regulator fails to register, the driver prints an error message
like:
bd9571mwv-regulator bd9571mwv-regulator.6.auto: failed to register bd9571mwv-regulator regulator
However, the platform device's name is already printed as part of
dev_err(), and does not allow the user to distinguish among the various
regulators that are part of the PMIC.
Fix this by printing regulator_desc.name instead, to change the message
like:
bd9571mwv-regulator bd9571mwv-regulator.6.auto: failed to register DVFS regulator
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/20210312130242.3390038-3-geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
According to Table 30 ("DVFS_MoniVDAC [6:0] Setting Table") in the
BD9571MWV-M Datasheet Rev. 002, the valid voltage range is 600..1100 mV
(settings 0x3c..0x6e). While the lower limit is taken into account (by
setting regulator_desc.linear_min_sel to 0x3c), the upper limit is not.
Fix this by reducing regulator_desc.n_voltages from 0x80 to 0x6f.
Fixes: e85c5a153f ("regulator: Add ROHM BD9571MWV-M PMIC regulator driver")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20210312130242.3390038-2-geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
In one of the error paths of the for_each_child_of_node() loop,
add missing call to of_node_put().
Fix the following coccicheck warning:
./drivers/regulator/scmi-regulator.c:343:1-23: WARNING: Function
"for_each_child_of_node" should have of_node_put() before return around
line 347.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/r/1614303575-27436-1-git-send-email-yang.lee@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The voltages in pf8x00_sw7_voltages are in ascendant order, so use
regulator_map_voltage_ascend.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Adrien Grassein <adrien.grassein@gmail.com>
Link: https://lore.kernel.org/r/20210216060128.126938-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The ULT LV_P50 shares the same configuration as the other ULT LV_Pxxx
and the ULT P300 shares the same as the other ULT Pxxx.
These two regulator types are found on PM8950 and its variants.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Link: https://lore.kernel.org/r/20210225213514.117031-1-konrad.dybcio@somainline.org
Signed-off-by: Mark Brown <broonie@kernel.org>
In case of error, the function dev_get_regmap() returns NULL
pointer not ERR_PTR(). The IS_ERR() test in the return value
check should be replaced with NULL test.
Fixes: 9351ab8b0c ("regulator: rt4831: Adds support for Richtek RT4831 DSV regulator")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20210305034930.3236099-1-weiyongjun1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver uses the DVS registers PCA9450_REG_BUCKxOUT_DVS0 to set the
voltage for the buck regulators 1, 2 and 3. This has no effect as the
PRESET_EN bit is set by default and therefore the preset values are used
instead, which are set to 850 mV.
To fix this we clear the PRESET_EN bit at time of initialization.
Fixes: 0935ff5f1f ("regulator: pca9450: add pca9450 pmic driver")
Cc: <stable@vger.kernel.org>
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Link: https://lore.kernel.org/r/20210222115229.166620-1-frieder.schrempf@kontron.de
Signed-off-by: Mark Brown <broonie@kernel.org>
This fixes the return value of pca9450_i2c_probe() to use the correct
error code when getting the sd-vsel GPIO fails.
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Link: https://lore.kernel.org/r/20210222150809.208942-1-frieder.schrempf@kontron.de
Signed-off-by: Mark Brown <broonie@kernel.org>
- Standardise MFD_CELL_* helpers
- New Drivers
- Add support for Acer Iconia Tab A500 Embedded Controller
- New Device Support
- Add support for ROHM BD9574MWF to BD9571MWV
- Add support for Intel Alder Lake PCH-P PCI to LPSS
- Add support for Intel Alder Lake PCH-S PCI to LPSS
- New Functionality
- Support ACPI enumeration; arizona
- Fix-ups
- Managed resources; bd9571mwv
- DT additions/fix-ups; bd9571mwv, iqs62x, max8997, gateworks-gsc, ene-kb930
- Convert to SPDX; bd9571mw
- Fix return values/error handling; sunxi
- Provide SOFTDEP; arizona
- Make use of DIV_ROUND_UP; mcp-sa11x0
- Use generic APIs; arizona
- Add MAC address sysfs entries; intel-m10-bmc
- Trivial: Coding-style fix-ups; iqs62x
- Trivial: Remove superflouous code; iqs62x
- Clear-up naming conventions; iqs62x
- Bug Fixes
- Fix 'pointer from integer' error; altera-sysmgr
- Convert SGI_MFD_IOC3 from tristate to bool; Kconfig
- Fix interrupt handling; gateworks-gsc
- Extend required delay; iqs62x
- Do not use I2C polling during calibration; iqs62x
- Do no adjust clock frequency during calibration; iqs62x
- Fix use-after-free; wm831x-auxad
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmAr4agACgkQUa+KL4f8
d2GcqhAAkfGRWU7RVWlOK2NcYIDGiSU5kAJgirwIpDxkZM+kNjYITm+jt5JYBdIc
B1ShJSgc3kgcs62nTUTqkGjL6IQyI6aPsI4oF57XnN6nmIGzSQ84cCSbBn7eXUIP
wF2/4V0L+eE7i6TaZNcyZ4EltkKvo06MCs35eUATyFLB/9ZfhBCRjQlk5z4YOG6n
Mc3VJiLSpNv8PWTL+tw76RMk8mScUFaKwra8fYK4OVG/zjJ43tsADu4G6gF7FkZE
Erlp+fvFFmSR5STEri8cY0AFjHYHGWrST7lQ0HUsgM72A+TjFsy2X6WsDZzwVp+Z
Ymk0T4NAQWJ/QBu2kwws0L2EieYTtzY1DjKJV6MIiwp1OWIK+TQGV9zPgkXFq404
Rcw6LZjkEgeMJFx/4ljK5xC/y6CKGguxrXCYDVj0aeU+OcC1nnjx9KJwYWCsfwWU
0QUIPK0Fy0m2L0Jy/MeDakHtdkPzBLWOe5ybE9EmY8EV+RUorH6bEWVA6cmsJNgq
ycUlx8hK0nO+yIOMFua8Tk4+0gpcS9QrSGNoz3Iw/sZa6knX4vyvHxyebu/91qas
VwnU//s8LzpeiYu8hsjlbZsZTlP4Gnc2QhaWW757hTwykwMjhlHLAo/CZ85LVzCg
mmd1xybdMsQFAAoemp6D1HixLG/cMP5bflqCB+hZ8SUhHOiPZNU=
=ieAS
-----END PGP SIGNATURE-----
Merge tag 'mfd-next-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd
Pull MFD updates from Lee Jones:
"Core Frameworks:
- Standardise MFD_CELL_* helpers
New Drivers:
- Add support for Acer Iconia Tab A500 Embedded Controller
New Device Support:
- Add support for ROHM BD9574MWF to BD9571MWV
- Add support for Intel Alder Lake PCH-P PCI to LPSS
- Add support for Intel Alder Lake PCH-S PCI to LPSS
New Functionality:
- Support ACPI enumeration; arizona
Fix-ups:
- Managed resources; bd9571mwv
- DT additions/fix-ups; bd9571mwv, iqs62x, max8997, gateworks-gsc, ene-kb930
- Convert to SPDX; bd9571mw
- Fix return values/error handling; sunxi
- Provide SOFTDEP; arizona
- Make use of DIV_ROUND_UP; mcp-sa11x0
- Use generic APIs; arizona
- Add MAC address sysfs entries; intel-m10-bmc
- Trivial: Coding-style fix-ups; iqs62x
- Trivial: Remove superflouous code; iqs62x
- Clear-up naming conventions; iqs62x
Bug Fixes:
- Fix 'pointer from integer' error; altera-sysmgr
- Convert SGI_MFD_IOC3 from tristate to bool; Kconfig
- Fix interrupt handling; gateworks-gsc
- Extend required delay; iqs62x
- Do not use I2C polling during calibration; iqs62x
- Do no adjust clock frequency during calibration; iqs62x
- Fix use-after-free; wm831x-auxad"
* tag 'mfd-next-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (32 commits)
mfd: wm831x-auxadc: Prevent use after free in wm831x_auxadc_read_irq()
mfd: iqs62x: Do not change clock frequency during ATI
mfd: iqs62x: Do not poll during ATI
mfd: iqs62x: Increase interrupt handler return delay
mfd: iqs62x: Rename regmap_config struct
mfd: iqs62x: Remove unused bit mask
mfd: iqs62x: Remove superfluous whitespace above fallthroughs
mfd: intel-lpss: Add Intel Alder Lake PCH-S PCI IDs
mfd: intel-m10-bmc: Expose MAC address and count
mfd: Add driver for Embedded Controller found on Acer Iconia Tab A500
dt-bindings: mfd: Add ENE KB930 Embedded Controller binding
dt-bindings: mfd: gateworks-gsc: Add fan-tach mode
mfd: intel-lpss: Add Intel Alder Lake PCH-P PCI IDs
mfd: gateworks-gsc: Fix interrupt type
mfd: Standardise MFD_CELL_* helper names
mfd: mcp-sa11x0: Use DIV_ROUND_UP to calculate rw_timeout
mfd: max8997: Add of_compatible to Extcon and Charger mfd_cell
dt-bindings: mfd: Correct the node name of the panel LED
mfd: sgi-ioc3: Turn Kconfig option into a bool
mfd: altera-sysmgr: Fix physical address storing more
...
The ROHM BD718x7 and BD71828 drivers support setting HW state
specific voltages from device-tree. This is used also by various
in-tree DTS files.
These drivers do incorrectly try to compose bit-map using enum
values. By a chance this works for first two valid levels having
values 1 and 2 - but setting values for the rest of the levels
do indicate capability of setting values for first levels as
well. Luckily the regulators which support setting values for
SUSPEND/LPSR do usually also support setting values for RUN
and IDLE too - thus this has not been such a fatal issue.
Fix this by defining the old enum values as bits and fixing the
parsing code. This allows keeping existing IC specific drivers
intact and only slightly changing the rohm-regulator.c
Fixes: 21b72156ed ("regulator: bd718x7: Split driver to common and bd718x7 specific parts")
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20210212080023.GA880728@localhost.localdomain
Signed-off-by: Mark Brown <broonie@kernel.org>
By default the PCA9450 doesn't handle the assertion of the WDOG_B
signal, but this is required to guarantee that things like software
resets triggered by the watchdog work reliably.
As we don't want to rely on the bootloader to enable this, we tell
the PMIC to issue a cold reset in case the WDOG_B signal is
asserted (WDOG_B_CFG = 10), just as the NXP U-Boot code does.
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Link: https://lore.kernel.org/r/20210211105534.38972-3-frieder.schrempf@kontron.de
Signed-off-by: Mark Brown <broonie@kernel.org>
LDO5 has two separate control registers. LDO5CTRL_L is used if the
input signal SD_VSEL is low and LDO5CTRL_H if it is high.
The current driver implementation only uses LDO5CTRL_H. To make this
work on boards that have SD_VSEL connected to a GPIO, we add support
for specifying an optional GPIO and setting it to high at probe time.
In the future we might also want to add support for boards that have
SD_VSEL set to a fixed low level. In this case we need to change the
driver to be able to use the LDO5CTRL_L register.
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Link: https://lore.kernel.org/r/20210211105534.38972-1-frieder.schrempf@kontron.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Use the correct name to avoid ldo7 commands being sent to ldo6's address.
Fixes: 06369bcc15 ("regulator: qcom-rpmh: Add support for SM8150")
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20210211034935.5622-1-jonathan@marek.ca
Signed-off-by: Mark Brown <broonie@kernel.org>
Calling the disable_irq() from irq handler might be a bad idea as
disable_irq() should wait for handlers to run. I don't see why
this wouldn't deadlock in wait_event waiting for the threaded
handler to complete.
Use disable_irq_nosync() instead.
Fixes: 390af53e04 ("regulator: qcom-labibb: Implement short-circuit and over-current IRQs")
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
Link: https://lore.kernel.org/r/f2c4c88d90bf7473e1b84b8a99b7b33d7a081764.1612249657.git.matti.vaittinen@fi.rohmeurope.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Sometimes regulator_get() gets called twice for the same supply on the
same device. This may happen e.g. when a framework / library is used
which uses the regulator; and the driver itself also needs to enable
the regulator in some cases where the framework will not enable it.
Commit ff268b56ce ("regulator: core: Don't spew backtraces on
duplicate sysfs") already takes care of the backtrace which would
trigger when creating a duplicate consumer symlink under
/sys/class/regulator/regulator.%d in this scenario.
Commit c33d442328 ("debugfs: make error message a bit more verbose")
causes a new error to get logged in this scenario:
[ 26.938425] debugfs: Directory 'wm5102-codec-MICVDD' with parent 'spi-WM510204:00-MICVDD' already present!
There is no _nowarn variant of debugfs_create_dir(), but we can detect
and avoid this problem by checking the return value of the earlier
sysfs_create_link_nowarn() call.
Add a check for the earlier sysfs_create_link_nowarn() failing with
-EEXIST and skip the debugfs_create_dir() call in that case, avoiding
this error getting logged.
Fixes: c33d442328 ("debugfs: make error message a bit more verbose")
Cc: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210122183250.370571-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This patch adds suspend/resume support so that it is possible to
configure the LDOs and BUCKs as on or off during suspend phase as
well as to configure suspend specific voltages.
Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
Link: https://lore.kernel.org/r/4c2e79d4fa96befdc9a6c59c3ff27b0a34f9fb56.camel@googlemail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Make regulator_sync_voltage() to re-balance voltage state of a coupled
regulators instead of changing the voltage directly.
Tested-by: Peter Geis <pgwipeout@gmail.com> # Ouya T30
Tested-by: Dmitry Osipenko <digetx@gmail.com> # A500 T20 and Nexus7 T30
Tested-by: Nicolas Chauvet <kwizart@gmail.com> # PAZ00 T20
Tested-by: Matt Merhar <mattmerhar@protonmail.com> # Ouya T30
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210122174311.28230-1-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
With commit eaa7995c52 (regulator: core: avoid
regulator_resolve_supply() race condition) we started holding the rdev
lock while resolving supplies, an operation that requires holding the
regulator_list_mutex. This results in lockdep warnings since in other
places we take the list mutex then the mutex on an individual rdev.
Since the goal is to make sure that we don't call set_supply() twice
rather than a concern about the cost of resolution pull the rdev lock
and check for duplicate resolution down to immediately before we do the
set_supply() and drop it again once the allocation is done.
Fixes: eaa7995c52 (regulator: core: avoid regulator_resolve_supply() race condition)
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210122132042.10306-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>