Commit graph

4352 commits

Author SHA1 Message Date
Linus Torvalds
7c3d49b0b5 regulator: Fixes for v5.14
A few driver specific fixes that came in since the merge window, plus a
 change to mark the regulator-fixed-domain DT binding as deprecated in
 order to try to to discourage any new users while a better solution is
 put in place.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmD4WckACgkQJNaLcl1U
 h9DltAgAgxwqrdGPLt/0rGlhpI183L6x81fbLcbvVYwWiyUDqU1rSqZhR+UnxkOf
 3tOX4B+4EJTNpArLRcoXD2uu1KP92AhOwv3uGKsJGibS0OC6AwV7adyK+qkBuZsS
 IJgyI63YfRGP1udWfklZle+CxK6JIRMILbT9oTMGoWrPnK3QfS2rNDapTtpfYRn1
 PTIu0TqMQ6xKHg8XPbtmD4INbrbhxP0H3848g0ZhohGozEwggKSEwB1c55cbQc2J
 I3HpBMVk3sO0UrG6NBpX+fSj0BT4MwjNdFDgmstgwEn/31gSSDjAxaHnfZqWLJqJ
 cW6rlhw0eSqRXAjrqh6WfK5QiojRXw==
 =+jG2
 -----END PGP SIGNATURE-----

Merge tag 'regulator-fix-v5.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator fixes from Mark Brown:
 "A few driver specific fixes that came in since the merge window, plus
  a change to mark the regulator-fixed-domain DT binding as deprecated
  in order to try to to discourage any new users while a better solution
  is put in place"

* tag 'regulator-fix-v5.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: hi6421: Fix getting wrong drvdata
  regulator: mtk-dvfsrc: Fix wrong dev pointer for devm_regulator_register
  regulator: fixed: Mark regulator-fixed-domain as deprecated
  regulator: bd9576: Fix testing wrong flag in check_temp_flag_mismatch
  regulator: hi6421v600: Fix getting wrong drvdata that causes boot failure
  regulator: rt5033: Fix n_voltages settings for BUCK and LDO
  regulator: rtmv20: Fix wrong mask for strobe-polarity-high
2021-07-21 12:37:49 -07:00
Axel Lin
1c73daee4b
regulator: hi6421: Fix getting wrong drvdata
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>
2021-07-11 23:44:37 +01:00
Axel Lin
ea986908cc
regulator: mtk-dvfsrc: Fix wrong dev pointer for devm_regulator_register
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>
2021-07-07 12:01:32 +01:00
Linus Torvalds
463c09d09d - Core Frameworks
- Fix Software Node clean-up code
 
  - New Drivers
    - Add support for MediaTek MT6359 PMIC
    - Add support for Qualcomm PM8008 PMIC
    - Add support for Richtek RT4831
 
  - New Device Support
    - Add support for Audio CODECs to Rockchip RK817
    - Add support for Alder Lake-M to Intel LPSS PCI
    - Add support for Periph Device Charge to ChromeOS EC
 
  - New Functionality
    - Provide additional IRQs; wcd934x
    - Add optional Reset functionality; lp87565
 
  - Fix-ups
    - Namespacing & visibility; lp87565
    - Differentiate between Power and Home key IRQs; mt6358
    - Export I2C device tables; da9052-i2c, stmpe-i2c
    - Adapt IRQ flags; max8907, rn5t61, max8907
    - Make some functions/devices optional; axp20x, cros_ec_dev
    - Explicitly include used header files; ioc3
    - Remove superfluous lines; MAINTAINERS, sec-core, st,stm32-timers
    - Resolve Kerneldoc issues; omap-usb-host, omap-usb-tll, si476x-cmd, si476x-i2c
    - Convert to a module; arizona-core
    - Copyright changes; hi655x-pmic
    - Drop support for board file initialisation; sec-core
    - Trivial; spelling, whitespace etc; lp87565, si476x-cmd, mt6360-core, wm831x-core,
 					twl-core, db8500-prcmu
    - Simplify various implementations; wcd934x, mt6360-core, max8997, max8998,
                                        da9052-i2c, da9062-core, sec-core,
    - Device Tree binding changes; google,cros-ec, richtek,rt4831-backlight,
                                   db8500-prcmu, qcom,pm8008, qcom,spmi-pmic
    - Use provided APIs to simplify; t7l66xb, as3722, da9055-core, tps80031, 88pm800,
                                 88pm805, asic3, sun6i-prcm,
 				wm831x-core, wm831x-otp,
 				ucb1x00-assabet, timberdale, sm501,
 				pcf50633-core, kempld-core,
 				janz-cmodio, intel_soc_pmic_bxtwc, ab8500-core
 
  - Bug Fixes
    - Fix unused variable warning; rk817_codec
    - Fix regulator voltage configuration; rohm-bd71828
    - Fix ongoing freeing of regmap_config 'name' issue; syscon
    - Fix error handling path; da9063-i2c
    - Fix Kconfig issues; MFD_MP2629
    - Fix DMA mask warnings; motorola-cpcap
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmDjETYACgkQUa+KL4f8
 d2GmAw/7BbJpXUc8Rbw09qEWf/jOmmoQ+H1U5Gjvw6rbHMmGxFRce1Xf/01JAW8U
 ypffmQ/oSJgR1c5l5/g0+Tbn4LFmgGAxG+4RGdTVe4H81wjraKAnRLoJTFl74cD7
 LahcrUPkSf50VrrkiephO/yGvU53XfOhbJMQf21OM7TCoskWLUUyB72akBAyu6jC
 +cxi3DymyG26E1xG6opYFrY7VmQ3Wj+QywiJs0GYbik0nBgEGrG6fctTPKLNbv/Q
 duCRwVnZvoYbVHw5lwfYMRy/gsOU8/cLiWZOxpbng9J3C/PP19L+DHGrOp/l7RNc
 D7FLHZWiFwI3sHPnxaJQx87cOQ6WiVy1Q/fyVR2OyJkvk5wedIrBfLtvSuN3f2gb
 C4U6g0+PxGlkmf4Q5QqLRmJRUN6vqAglTa885M+INwOiNCTD/nfh+EFztIi1biX4
 dW3A+IYCl4Mx5DjIfv+cfoAD57fTHyhIaHJAKNgSUbKAfIJ/UeeuCgSomb2PgHNv
 fA6uECRgTTYC6HdZ1+5dj9hJdb1BPW6l01uDKLVs5NyXQ4trgOzCgvcy5jJgLxlC
 QCatkKejfqK9XLoJBN5Bn6G74X08zoSbykOPHZBdD40leR6LeMr4wlsKJRi8XAeJ
 YbaUWbPQCOSgvrw1bZLpXQyc49myxyJMmG69TTopOTmXt3aglag=
 =g7ix
 -----END PGP SIGNATURE-----

Merge tag 'mfd-next-5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull mfd updates from Lee Jones:
 "Core Frameworks:
   - Fix Software Node clean-up code

  New Drivers:
   - Add support for MediaTek MT6359 PMIC
   - Add support for Qualcomm PM8008 PMIC
   - Add support for Richtek RT4831

  New Device Support:
   - Add support for Audio CODECs to Rockchip RK817
   - Add support for Alder Lake-M to Intel LPSS PCI
   - Add support for Periph Device Charge to ChromeOS EC

  New Functionality:
   - Provide additional IRQs for wcd934x
   - Add optional Reset functionality to lp87565

  Fix-ups:
   - Namespacing & visibility fixes to lp87565
   - Differentiate between Power and Home key IRQs in mt6358
   - Export I2C device tables in da9052-i2c, stmpe-i2c
   - Adapt IRQ flags in max8907, rn5t61, max8907
   - Make some functions/devices optional in axp20x, cros_ec_dev
   - Explicitly include used header files in ioc3
   - Remove superfluous lines in MAINTAINERS, sec-core, st,stm32-timers
   - Resolve Kerneldoc issues in omap-usb-host, omap-usb-tll, si476x-cmd, si476x-i2c
   - Convert arizona-core to a module
   - Copyright changes in hi655x-pmic
   - Drop support for board file initialisation in sec-core
   - Trivial spelling, whitespace etc updates in lp87565, si476x-cmd,
     mt6360-core, wm831x-core, twl-core, db8500-prcmu
   - Simplify various implementations of wcd934x, mt6360-core, max8997,
     max8998, da9052-i2c, da9062-core, sec-core,
   - Device Tree binding changes in google,cros-ec,
     richtek,rt4831-backlight, db8500-prcmu, qcom,pm8008, qcom,spmi-pmic
   - Use provided APIs to simplify t7l66xb, as3722, da9055-core,
     tps80031, 88pm800, 88pm805, asic3, sun6i-prcm, wm831x-core,
     wm831x-otp, ucb1x00-assabet, timberdale, sm501, pcf50633-core,
     kempld-core, janz-cmodio, intel_soc_pmic_bxtwc, ab8500-core

  Bug Fixes:
   - Fix unused variable warning in rk817_codec
   - Fix regulator voltage configuration in rohm-bd71828
   - Fix ongoing freeing of regmap_config 'name' issue in syscon
   - Fix error handling path in da9063-i2c
   - Fix Kconfig issues in MFD_MP2629
   - Fix DMA mask warnings in motorola-cpcap"

* tag 'mfd-next-5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (83 commits)
  mfd: cros_ec: Add peripheral device charger
  mfd: max8907: Remove IRQF_NO_AUTOEN flag
  mfd: ab8500-core: Use DEVICE_ATTR_RO/RW macro
  mfd: intel_soc_pmic_bxtwc: Use DEVICE_ATTR_ADMIN_RW macro
  mfd: janz-cmodio: Use DEVICE_ATTR_RO macro
  mfd: kempld-core: Use DEVICE_ATTR_RO macro
  mfd: pcf50633: Use DEVICE_ATTR_ADMIN_RO macro
  mfd: sm501: Use DEVICE_ATTR_RO macro
  mfd: timberdale: Use DEVICE_ATTR_RO macro
  mfd: ucb1x00-assabet: Use DEVICE_ATTR_RO macro
  mfd: wm831x: Use DEVICE_ATTR_RO macro
  mfd: wm831x: Use DEFINE_RES_IRQ_NAMED() and DEFINE_RES_IRQ() to simplify code
  dt-bindings: mfd: stm32-timers: Remove #address/size cells from required properties
  mfd: sun6i-prcm: Use DEFINE_RES_MEM() to simplify code
  mfd: asic3: Use DEFINE_RES_MEM() and DEFINE_RES_IRQ() to simplify code
  mfd: 88pm805: Use DEFINE_RES_IRQ_NAMED() to simplify code
  mfd: 88pm800: Use DEFINE_RES_IRQ_NAMED() to simplify code
  mfd: tps80031: Use DEFINE_RES_IRQ() to simplify code
  mfd: da9055: Use DEFINE_RES_IRQ_NAMED() to simplify code
  mfd: as3722: Use DEFINE_RES_IRQ_NAMED() to simplify code
  ...
2021-07-05 12:10:34 -07:00
Axel Lin
8888ef2304
regulator: bd9576: Fix testing wrong flag in check_temp_flag_mismatch
Fix trivial copy-paste typo.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/20210623153443.623856-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-01 14:50:30 +01:00
Axel Lin
5db5dd5be7
regulator: hi6421v600: Fix getting wrong drvdata that causes boot failure
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>
2021-06-30 13:49:32 +01:00
ChiYuan Huang
2b6a761be0
regulator: rtmv20: Fix wrong mask for strobe-polarity-high
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>
2021-06-28 17:48:45 +01:00
Mark Brown
7fb593cbd8
Merge remote-tracking branch 'regulator/for-5.14' into regulator-next 2021-06-23 16:56:31 +01:00
Mark Brown
ebad413c3c
Merge remote-tracking branch 'regulator/for-5.13' into regulator-linus 2021-06-23 16:56:28 +01:00
Colin Ian King
ddf275b219
regulator: bd9576: Fix uninitializes variable may_have_irqs
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>
2021-06-23 12:34:42 +01:00
Axel Lin
1aeb1a72f3
regulator: max8893: Select REGMAP_I2C to fix build error
Fix build error if REGMAP_I2C is not set.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210622141526.472175-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-23 12:34:41 +01:00
Axel Lin
a336dc8f68
regulator: da9052: Ensure enough delay time for .set_voltage_time_sel
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>
2021-06-23 12:34:40 +01:00
Hsin-Hsiung Wang
50c9462edc
regulator: mt6358: Fix vdram2 .vsel_mask
The valid vsel value are 0 and 12, so the .vsel_mask should be 0xf.

Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
Reviewed-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/1624424169-510-1-git-send-email-hsin-hsiung.wang@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-23 11:48:32 +01:00
Axel Lin
9bc146acc3
regulator: hi6421v600: Fix setting wrong driver_data
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>
2021-06-22 12:47:18 +01:00
Mark Brown
d1c02a7451
Merge series "regulator: qcom,rpmh-regulator: Add support for pmic available on SA8155p-adp board" from Bhupesh Sharma <bhupesh.sharma@linaro.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
2021-06-21 19:31:17 +01:00
Mark Brown
9d598cd737
Merge series "Extend regulator notification support" from Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>:
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
2021-06-21 19:28:42 +01:00
Matti Vaittinen
e71e7d3df7
regulator: bd9576: Fix the driver name in id table
Driver name was changed in MFD cell:
https://lore.kernel.org/lkml/560b9748094392493ebf7af11b6cc558776c4fd5.1613031055.git.matti.vaittinen@fi.rohmeurope.com/
Fix the ID table to match this.

Fixes: b1b3ced389 ("mfd: Support ROHM BD9576MUF and BD9573MUF")
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/e0483149333626b3bea298f305cf2809429d1822.1622628334.git.matti.vaittinen@fi.rohmeurope.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-21 13:08:51 +01:00
Matti Vaittinen
e7bf1fa58c
regulator: bd9576: Support error reporting
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>
2021-06-21 13:08:51 +01:00
Matti Vaittinen
89a6a5e56c
regulator: add property parsing and callbacks to set protection limits
Add DT property parsing code and setting callback for regulator over/under
voltage, over-current and temperature error limits.

Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/e7b8007ba9eae7076178bf3363fb942ccb1cc9a5.1622628334.git.matti.vaittinen@fi.rohmeurope.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-21 13:08:41 +01:00
Matti Vaittinen
7111c6d1b3
regulator: IRQ based event/error notification helpers
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>
2021-06-21 13:08:40 +01:00
Matti Vaittinen
157d223019
regulator: move rdev_print helpers to internal.h
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>
2021-06-21 13:08:39 +01:00
Axel Lin
57c045bc72
regulator: hi6421v600: Fix setting idle mode
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>
2021-06-21 13:07:46 +01:00
Sergey Larin
d83f778c62
regulator: max8893: add regulator driver
MAX8893 is a simple regulator which can be found on some of Sasmsung
phones.

Signed-off-by: Sergey Larin <cerg2010cerg2010@mail.ru>
Link: https://lore.kernel.org/r/20210618141607.884-1-cerg2010cerg2010@mail.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-21 13:07:44 +01:00
Axel Lin
ae60e6a9d2
regulator: hi6421: Use correct variable type for regmap api val argument
Use unsigned int instead of u32 for regmap_read/regmap_update_bits val
argument.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210619124133.4096683-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-21 13:07:43 +01:00
Bhupesh Sharma
9a336ed97d
regulator: qcom-rpmh: Add new regulator found on SA8155p adp board
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>
2021-06-21 13:07:27 +01:00
Bhupesh Sharma
f26cdadad7
regulator: qcom-rpmh: Add terminator at the end of pm7325x_vreg_data[] array
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>
2021-06-21 13:07:26 +01:00
Bhupesh Sharma
ba5dabf40e
regulator: qcom-rpmh: Cleanup terminator line commas
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>
2021-06-21 13:07:25 +01:00
Axel Lin
61eb1b24f9
regulator: hi655x: Fix pass wrong pointer to config.driver_data
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>
2021-06-21 13:02:05 +01:00
Rouven Czerwinski
7740ab84c1
regulator: fixed: use dev_err_probe for gpio
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>
2021-06-16 15:41:20 +01:00
Axel Lin
830c364f4a
regulator: sy7636a: Use rdev_get_drvdata at proper place
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>
2021-06-16 15:41:19 +01:00
Axel Lin
31a89d297e
regulator: sy7636a: Make regulator_desc static const
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>
2021-06-16 15:41:18 +01:00
Axel Lin
686f6b31bf
regulator: sy7636a: Add terminating entry for platform_device_id table
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>
2021-06-16 15:41:17 +01:00
Axel Lin
512d895664
regulator: rt6160: Fix setting suspend voltage
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>
2021-06-16 15:41:16 +01:00
Axel Lin
70d654ea3d
regulator: mt6315: Fix checking return value of devm_regmap_init_spmi_ext
devm_regmap_init_spmi_ext() returns ERR_PTR() on error.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210615132934.3453965-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-15 16:43:01 +01:00
Alistair Francis
8c485bedfb
regulator: sy7636a: Initial commit
Initial support for the Silergy SY7636A-regulator Power Management chip.

Signed-off-by: Alistair Francis <alistair@alistair23.me>
Link: https://lore.kernel.org/r/20210615103400.946-3-alistair@alistair23.me
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-15 16:43:00 +01:00
Axel Lin
f3f4f37d53
regulator: rt6160: Remove vsel_active_low from struct rt6160_priv
Use a local variable instead is enough, this simplifies the code.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210615103947.3387994-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-15 12:51:53 +01:00
Axel Lin
00430f71b2
regulator: hi6421v600: Use regulator_map_voltage_ascend
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>
2021-06-14 15:04:59 +01:00
ChiYuan Huang
23f95199b6
regulator: rt6160: Remove dummy line and add module description
Remove dummy line and add module description.

Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Link: https://lore.kernel.org/r/1623335910-5385-1-git-send-email-u0084500@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-14 15:04:58 +01:00
Axel Lin
b113ec2d85
regulator: rt6160: Convert to use regulator_set_ramp_delay_regmap
Use regulator_set_ramp_delay_regmap instead of open-coded.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210603093809.1108629-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-14 12:36:42 +01:00
Mark Brown
2bce8174f7 regulator: Changes for v5.14-rc1
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.
2021-06-14 11:40:41 +01:00
Linus Torvalds
9b1111fa80 regulator: Fixes for v5.14
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
  ...
2021-06-08 09:41:16 -07:00
Axel Lin
2e11737a77
regulator: fan53880: Fix vsel_mask setting for FAN53880_BUCK
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>
2021-06-08 13:37:47 +01:00
Axel Lin
0ea461b4f2
regulator: bd71815: Get rid of struct bd71815_pmic
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>
2021-06-08 13:37:46 +01:00
Axel Lin
ba6622c433
regulator: ltc3589: Convert to use regulator_set_ramp_delay_regmap
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>
2021-06-08 13:37:45 +01:00
Axel Lin
73d4ae57f8
regulator: mt6359: Get rid of linear_range tables
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>
2021-06-07 16:24:09 +01:00
Axel Lin
5a5e31150c
regulator: mt6359: Use unsigned int for volt_tables
The regulator_desc expects "const unsigned int *volt_table", thus use
unsigned int instead of u32.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210606065052.1417111-2-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-07 16:24:09 +01:00
Axel Lin
431ea63b64
regulator: mt6358: Use unsigned int for volt_tables
The regulator_desc expects "const unsigned int *volt_table", thus use
unsigned int instead of u32.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210606065052.1417111-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-07 16:24:08 +01:00
Axel Lin
3c37d899ef
regulator: max77686: Convert to use regulator_set_ramp_delay_regmap
Use regulator_set_ramp_delay_regmap instead of open-coded.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210605013424.1298773-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-07 16:24:07 +01:00
Mark Brown
4388daa8e2 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-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmC+OdwACgkQJNaLcl1U
 h9C/Egf9HYxSvrar2DNvlhAiuumYYX+2paN7bY+8j8LnoPSe22Es5ckuAXgHc3ZA
 s07tB3P9kf3LJKPvmZFoMWLTjYtrajLNFR7dPJNxtZs3QBEz05fNhHsALA+xi3+H
 rA8LMgCVXp1JpVT0KBzPKoRyprJFP8adlT/Emk0pyRjLjxnmup3iOTjy9MD+a4m1
 t8LokQi8g3uAeqsdItKHRMQV4Y7r433Fu6NSaygvikm4Xu+oFZhD/OFlPovffYTI
 art4UrSna+EgwOIMZ2tNPlZfxOcq5KOmFZJ5yqyIKNJkjWc4M/bKaxKfVDNJ8aJ9
 6LUm9yvMdGiMbaMdnLH9+stiQvvBdA==
 =p67V
 -----END PGP SIGNATURE-----

Merge tag 'tb-mfd-regulator-rtc-v5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into regulator-5.14

Immutable branch between MFD, Regulator and RTC due for the v5.14 merge window
2021-06-07 16:23:06 +01:00
Rudi Heitbaum
5eee5eced9
regulator: fan53555: add tcs4526
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>
2021-06-04 15:27:10 +01:00