Commit Graph

388 Commits

Author SHA1 Message Date
Alistair Francis cb17820ef7
regulator: sy7636a: Remove requirement on sy7636a mfd
Signed-off-by: Alistair Francis <alistair@alistair23.me>
Link: https://lore.kernel.org/r/20211015122551.38951-5-alistair@alistair23.me
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-21 14:18:58 +01:00
Ramona Alexandra Nechita f1e5ecc5b7
regulator: fix typo in Kconfig and max8973-regulator
MAX8973 is supposed to be MAX8973A. Kconfig and the
initial comment of max8973-regulator.c were modified
accordingly.

Signed-off-by: Ramona Alexandra Nechita <ramona.nechita@analog.com>
Link: https://lore.kernel.org/r/20210920061137.10884-1-ramona.nechita@analog.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-20 13:38:16 +01:00
Cai Huoqing b36061c2ea
regulator: ti-abb: Kconfig: Add helper dependency on COMPILE_TEST
COMPILE_TEST is helpful to find compilation errors in other platform(e.g.X86).
In this case, the support of COMPILE_TEST is added, so this module could
be compiled in other platform(e.g.X86), without ARCH_SYNQUACER configuration.

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Link: https://lore.kernel.org/r/20210908105738.1933-1-caihuoqing@baidu.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-13 01:59:23 +01:00
ChiYuan Huang 0555d41497
regulator: rtq2134: Add support for Richtek RTQ2134 SubPMIC
This adds support for Richtek RTQ2134 SubPMIC.

Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Link: https://lore.kernel.org/r/1626422636-29458-2-git-send-email-u0084500@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-20 13:37:29 +01:00
Colin Ian King f020e4d0b4
regulator: Fix a couple of spelling mistakes in Kconfig
There are a couple of spelling mistakes in the Kconfig text. Fix them.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210719103429.15544-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-19 12:58:50 +01:00
ChiYuan Huang f40f940971
regulator: rt6752: Add support for Richtek RTQ6752
Add suport for Richtek RTQ6752.

Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Link: https://lore.kernel.org/r/1625845236-30285-2-git-send-email-u0084500@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-11 23:50:42 +01:00
Mark Brown 7fb593cbd8
Merge remote-tracking branch 'regulator/for-5.14' into regulator-next 2021-06-23 16:56:31 +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
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
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
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
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
ChiYuan Huang a747070e9b
regulator: rt6245: Add support for Richtek RT6245
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>
2021-06-03 19:34:51 +01:00
ChiYuan Huang de20b747c5
regulator: rt6160: Add support for Richtek RT6160
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>
2021-06-02 12:03:36 +01:00
Wen Su d7a58decc7 regulator: mt6359: Add support for MT6359 regulator
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>
2021-06-01 16:44:31 +01:00
Matti Vaittinen 71de5d6e63
regulator: bd70528: Drop BD70528 support
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>
2021-06-01 14:05:24 +01:00
Axel Lin 5f01de6ffa
regulator: rtmv20: Add Richtek to Kconfig text
The other Richtek drivers has Richtek prefix, make it consistent.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210530124101.477727-2-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-01 14:03:04 +01:00
Randy Dunlap 5ba3747dbc
regulator: bd71815: add select to fix build
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>
2021-05-24 09:51:34 +01:00
Linus Torvalds 71a5cc28e8 - Core Frameworks
- 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
  ...
2021-04-28 15:59:13 -07:00
Matti Vaittinen 1aad39001e regulator: Support ROHM BD71815 regulators
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>
2021-04-14 10:20:50 +01:00
Mauro Carvalho Chehab 507614ba25 regulator: hi6421v600-regulator: move it from staging
This driver is ready for mainstream. Move it out of staging.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/815b79a4e93f133478d9a5b2dd429526dcfe1dde.1616695231.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-02 15:11:17 +02:00
Hsin-Hsiung Wang 7aa382cfe7
regulator: mt6315: Add support for MT6315 regulator
The MT6315 is a regulator found on boards based on MediaTek MT8192 and
probably other SoCs. It connects as a slave to SoC using SPMI.

Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
Link: https://lore.kernel.org/r/1612678457-11548-3-git-send-email-hsin-hsiung.wang@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-08 11:48:48 +00:00
Arnd Bergmann d93d6f52bd
regulator: remove ab3100 driver
The ST-Ericsson U300 platform is getting removed, so this driver is no
longer needed.

Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210120151307.1726876-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 18:14:20 +00:00
Adrien Grassein 4d23b84d1f
regulator: pf8x00: add a doc for the module
pf8x00 module build was not documented.

Signed-off-by: Adrien Grassein <adrien.grassein@gmail.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Link: https://lore.kernel.org/r/20210114174714.122561-2-adrien.grassein@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-15 14:16:11 +00:00
henryc.chen a0db6b0aa6
regulator: Regulator driver for the Mediatek DVFSRC
Driver for regulators exposed by the DVFSRC (dynamic voltage and
frequency scaling resource collector) found in devices based on
mt8183 and newer platforms.

Signed-off-by: Henry Chen <henryc.chen@mediatek.com>
Link: https://lore.kernel.org/r/1608790134-27425-12-git-send-email-henryc.chen@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-05 14:35:26 +00:00
Mark Brown c42088491c
Merge branch 'regulator-5.11' into regulator-5.12 2021-01-04 17:09:23 +00:00
Arnd Bergmann d957d1610c
regulator: qcom-rpmh: add QCOM_COMMAND_DB dependency
A built-in regulator driver cannot link against a modular cmd_db driver:

qcom-rpmh-regulator.c:(.text+0x174): undefined reference to `cmd_db_read_addr'

There is already a dependency for RPMh, so add another one of this
type for cmd_db.

Fixes: 34c5aa2666 ("regulator: Kconfig: Fix REGULATOR_QCOM_RPMH dependencies to avoid build error")
Fixes: 46fc033eba ("regulator: add QCOM RPMh regulator driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20201230145712.3133110-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-04 14:26:15 +00:00
Cristian Ciocaltea 3b15ccac16
regulator: Add regulator driver for ATC260x PMICs
Add support for the DC-DC converters and LDO regulators found in
the ATC2603C and ATC2609A chip variants of the Actions Semi ATC260x
family of PMICs.

Co-developed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
Link: https://lore.kernel.org/r/1117b1a01b3948446cb3cc407e52de3a5d4212b0.1609258905.git.cristian.ciocaltea@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-30 13:54:24 +00:00
ChiYuan Huang 9351ab8b0c
regulator: rt4831: Adds support for Richtek RT4831 DSV regulator
Adds support for Richtek RT4831 DSV Regulator

Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Link: https://lore.kernel.org/r/1608217244-314-6-git-send-email-u0084500@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-28 12:24:50 +00:00
Randy Dunlap ac6b559d81
regulator: qcom-rpmh: fix build after QCOM_COMMAND_DB is tristate
Restrict REGULATOR_QCOM_RPMH to QCOM_COMMAND_DB it the latter is enabled.

Fixes this build error:
  microblaze-linux-ld: drivers/regulator/qcom-rpmh-regulator.o: in function `rpmh_regulator_probe':
  (.text+0x354): undefined reference to `cmd_db_read_addr'

Fixes: 778279f4f5 ("soc: qcom: cmd-db: allow loading as a module")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Lina Iyer <ilina@codeaurora.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Reviewed-by: Lina Iyer <ilina@codeaurora.org>
Link: https://lore.kernel.org/r/20201225185004.20747-1-rdunlap@infradead.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-28 12:24:48 +00:00
Mark Brown 5e999f10a1
Merge remote-tracking branch 'regulator/for-5.11' into regulator-next 2020-12-11 17:48:32 +00:00
Fabio Estevam 6a6939d5f5
regulator: pfuze100: Convert the driver to DT-only
Since 5.10-rc1 i.MX is a devicetree-only platform, so simplify the code
by removing the unused non-DT support.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20201210212748.5849-1-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-11 13:23:06 +00:00
Adam Ward c860476b9e
regulator: da9121: Add device variant regmaps
Add ability to probe device and validate configuration, then apply a regmap
configuration for a single or dual buck device accordingly.

Signed-off-by: Adam Ward <Adam.Ward.opensource@diasemi.com>
Link: https://lore.kernel.org/r/068c6b8d5e1b4e221e899e4c914c429429a2ec7d.1606755367.git.Adam.Ward.opensource@diasemi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-01 12:17:58 +00:00
Jagan Teki d3795d6321
regulator: Add NXP PF8X00 regulator driver
Add NXP PF8100/PF8121A/PF8200 regulator driver.

PF8100/PF8121A/PF8200 is PMIC designed for highperformance
consumer applications. It features seven high efficiency buck,
four linear and one vsnvs regulators.

Tested in Engicam i.Core MX8M Mini SOM platform boards.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Link: https://lore.kernel.org/r/20201130112329.104614-2-jagan@amarulasolutions.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-30 12:56:19 +00:00
John Stultz 34c5aa2666
regulator: Kconfig: Fix REGULATOR_QCOM_RPMH dependencies to avoid build error
The kernel test robot reported the following build error:

All errors (new ones prefixed by >>):

   xtensa-linux-ld: drivers/regulator/qcom-rpmh-regulator.o: in function `rpmh_regulator_vrm_get_voltage_sel':
   qcom-rpmh-regulator.c:(.text+0x270): undefined reference to `rpmh_write'
   xtensa-linux-ld: drivers/regulator/qcom-rpmh-regulator.o: in function `rpmh_regulator_send_request':
   qcom-rpmh-regulator.c:(.text+0x2f2): undefined reference to `rpmh_write'
   xtensa-linux-ld: drivers/regulator/qcom-rpmh-regulator.o: in function `rpmh_regulator_vrm_get_voltage_sel':
>> qcom-rpmh-regulator.c:(.text+0x274): undefined reference to `rpmh_write_async'
   xtensa-linux-ld: drivers/regulator/qcom-rpmh-regulator.o: in function `rpmh_regulator_send_request':
   qcom-rpmh-regulator.c:(.text+0x2fc): undefined reference to `rpmh_write_async'

Which is due to REGULATOR_QCOM_RPMH depending on
QCOM_RPMH || COMPILE_TEST. The problem is that QOM_RPMH can now
be a module, which in that case requires REGULATOR_QCOM_RPMH=m
to build.

However, if COMPILE_TEST is enabled, REGULATOR_QCOM_RPMH can be
set to =y while QCOM_RPMH=m which will cause build failures.

The fix here is to add (QCOM_RPMH=n && COMPILE_TEST) to the
dependency.

Feedback would be appreciated!

Cc: Todd Kjos <tkjos@google.com>
Cc: Saravana Kannan <saravanak@google.com>
Cc: Andy Gross <agross@kernel.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Rajendra Nayak <rnayak@codeaurora.org>
Cc: Maulik Shah <mkshah@codeaurora.org>
Cc: Stephen Boyd <swboyd@chromium.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: linux-arm-msm@vger.kernel.org
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20201123222359.103822-1-john.stultz@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-24 14:14:01 +00:00
Cristian Marussi 0fbeae70ee
regulator: add SCMI driver
Add a simple regulator based on SCMI Voltage Domain Protocol.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
----
v6 --> v7
- add proper blank lines between semantic blocks
- fix return value on error path of scmi_reg_is_enabled()
- use generic Failure message on err path of info_get()
- fix comment containing apostrophe

v3 --> v4
- using of_match_full_name core regulator flag
- avoid coccinelle falde complaints about pointer-sized allocations

v2 --> v3
- remove multiple linear mappings support
- removed duplicated voltage name printout
- added a few comments
- simplified return path in scmi_reg_set_voltage_sel()

v1 --> v2
- removed duplicate regulator naming
- removed redundant .get/set_voltage ops: only _sel variants implemented
- removed condexpr on fail path to increase readability

v0 --> v1
- fixed init_data constraint parsing
- fixes for v5.8 (linear_range.h)
- fixed commit message content and subject line format
- factored out SCMI core specific changes to distinct patch
- reworked Kconfig and Makefile to keep proper alphabetic order
- fixed SPDX comment style
- removed unneeded inline functions
- reworked conditionals for legibility
- fixed some return paths to properly report SCMI original errors codes
- added some more descriptive error messages when fw returns invalid ranges
- removed unneeded explicit devm_regulator_unregister from .remove()
Link: https://lore.kernel.org/r/20201123202336.46701-4-cristian.marussi@arm.com

Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-23 20:42:03 +00:00
Vincent Whitchurch e6ff10f24c
regulator: Add support for DA9121 regulator
Add support for the Dialog Semiconductor DA9121, a single-channel
dual-phase buck converter controlled via I2C.

Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Link: https://lore.kernel.org/r/20201103100021.19603-3-vincent.whitchurch@axis.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-03 13:19:46 +00:00
ChiYuan Huang b8c054a5ea
regulator: rtmv20: Adds support for Richtek RTMV20 load switch regulator
Add support for Richtek RTMV20 load switch regulator.

Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Link: https://lore.kernel.org/r/1601277584-5526-1-git-send-email-u0084500@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-28 19:26:32 +01:00
Krzysztof Kozlowski 0c7d1b4d0c
regulator: enable compile testing for Maxim and Samsung PMIC drivers
Most of Maxim and Samsung PMIC/MUIC regulator drivers can be compile
tested to increase build coverage.  This allows to build them on
configurations without I2C (as I2C is required by dependency - parent
MFD driver).

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20200920214107.6299-1-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-22 00:45:15 +01:00
Mark Brown 0199f86661
Merge series "Support ROHM BD9576MUF and BD9573MUF PMICs" from Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>:
Initial support for ROHM BD9576MUF and BD9573MUF PMICs.

These PMICs are primarily intended to be used to power the R-Car family
processors. BD9576MUF includes some additional safety features the
BD9573MUF does not have. This initial version of drivers does not
utilize these features and for now the SW behaviour is identical.

Please note that this version of drivers is only tested on BD9576MUF
but according to the data-sheets the relevant parts of registers should
be same so drivers should also work on BD9573MUF.

This patch series includes MFD, watchdog and regulator drivers with
basic functionality such as:

- Enabling and pinging the watchdog
- configuring watchog timeout / window from device-tree
- reading regulator states/voltages
- enabling/disabling VOUT1 (VD50) when control mode B is used.

This patch series does not bring interrupt support. BD9576MUF and BD9573MUF
are designed to keep the IRQ line low for whole duration of error
condition. IRQ can't be 'acked'. So proper IRQ support would require
some IRQ limiter implementation (delayed unmask?) in order to not hog
the CPU.

---

Matti Vaittinen (6):
  dt_bindings: mfd: Add ROHM BD9576MUF and BD9573MUF PMICs
  dt_bindings: regulator: Add ROHM BD9576MUF and BD9573MUF PMICs
  mfd: Support ROHM BD9576MUF and BD9573MUF
  wdt: Support wdt on ROHM BD9576MUF and BD9573MUF
  regulator: Support ROHM BD9576MUF and BD9573MUF
  MAINTAINERS: Add ROHM BD9576MUF and BD9573MUF drivers

 .../bindings/mfd/rohm,bd9576-pmic.yaml        | 129 +++++++
 .../regulator/rohm,bd9576-regulator.yaml      |  33 ++
 MAINTAINERS                                   |   4 +
 drivers/mfd/Kconfig                           |  11 +
 drivers/mfd/Makefile                          |   1 +
 drivers/mfd/rohm-bd9576.c                     | 130 +++++++
 drivers/regulator/Kconfig                     |  10 +
 drivers/regulator/Makefile                    |   1 +
 drivers/regulator/bd9576-regulator.c          | 337 ++++++++++++++++++
 drivers/watchdog/Kconfig                      |  13 +
 drivers/watchdog/Makefile                     |   1 +
 drivers/watchdog/bd9576_wdt.c                 | 295 +++++++++++++++
 include/linux/mfd/rohm-bd957x.h               |  61 ++++
 include/linux/mfd/rohm-generic.h              |   2 +
 14 files changed, 1028 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/rohm,bd9576-pmic.yaml
 create mode 100644 Documentation/devicetree/bindings/regulator/rohm,bd9576-regulator.yaml
 create mode 100644 drivers/mfd/rohm-bd9576.c
 create mode 100644 drivers/regulator/bd9576-regulator.c
 create mode 100644 drivers/watchdog/bd9576_wdt.c
 create mode 100644 include/linux/mfd/rohm-bd957x.h

base-commit: f4d51dffc6
--
2.21.0

--
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 =]
2020-09-17 18:25:39 +01:00
Matti Vaittinen b014e9fae7
regulator: Support ROHM BD9576MUF and BD9573MUF
Add initial support for ROHM BD9576MUF and BD9573MUF PMICs regulators.
These PMICs are mainly used to power the R-Car series processors.

The BD9576 includes some functional-safety features which are not
present on BD9573.

Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/78baea1d7922506827ca717e277e4e6b391bbb78.1600329307.git.matti.vaittinen@fi.rohmeurope.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17 18:25:36 +01:00
Gene Chen d321571d5e
regulator: mt6360: Add support for MT6360 regulator
Add MT6360 regulator driver that contains two BUCKs and six LDOs

Signed-off-by: Gene Chen <gene_chen@richtek.com>
Link: https://lore.kernel.org/r/1598438958-26802-2-git-send-email-gene.chen.richtek@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-26 13:41:10 +01:00
Axel Lin 02532cb805
regulator: rt4801: Select REGMAP_I2C to fix build error
Fix build error when CONFIG_REGMAP_I2C is not set.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20200819085959.1914471-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-19 13:02:11 +01:00
Marek Vasut 3857347227
regulator: rpi-panel: Add regulator/backlight driver for RPi panel
This regulator/backlight driver handles the ATTINY88 present on the
RPi 7" touchscreen panel and exposes the power/backlight interfaces.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Eric Anholt <eric@anholt.net>
Cc: Mark Brown <broonie@kernel.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
To: dri-devel@lists.freedesktop.org
Link: https://lore.kernel.org/r/20200809105938.6388-2-marex@denx.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-18 17:18:42 +01:00
ChiYuan Huang 5bbbfc7f7f
regulator: rt4801: Add support for RT4801 Display Bias regulator driver
Adds support for the RT4801 DSV. It has two regulators (DSVP/DSVN) with
an I2C interface. DSVP/DSVN can provide the display panel module for the
positive/negative voltage range from (+/-)4V to (+/-)6V.

Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Link: https://lore.kernel.org/r/1597461262-25878-1-git-send-email-u0084500@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-18 17:18:35 +01:00
Mark Brown 3f02794888
Merge remote-tracking branch 'regulator/for-5.9' into regulator-next 2020-07-30 23:27:08 +01:00
Nisha Kumari 498ab2fdf8
regulator: qcom: Add labibb driver
Qualcomm platforms have LAB(LCD AMOLED Boost)/IBB(Inverting Buck Boost)
regulators, labibb for short, which are used as power supply for
LCD Mode displays.

This patch adds labibb regulator driver for pmi8998 PMIC, found on
SDM845 platforms.

  [sumits: reworked the driver design as per upstream review]

Signed-off-by: Nisha Kumari <nishakumari@codeaurora.org>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: https://lore.kernel.org/r/20200622124110.20971-5-sumit.semwal@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-15 15:47:16 +01:00
Christoph Fritz 318b8a09f2
regulator: fan53880: Add support for COMPILE_TEST
This patch adds support for COMPILE_TEST while fixing a warning when
no support for device tree is there.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
Link: https://lore.kernel.org/r/1c437154873ace65ff738a0ebca511308f1cecc1.camel@googlemail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-07 13:50:46 +01:00
Robin Gong 0935ff5f1f
regulator: pca9450: add pca9450 pmic driver
Add NXP pca9450 pmic driver.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Link: https://lore.kernel.org/r/1593793178-9737-2-git-send-email-yibin.gong@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-06 15:23:33 +01:00
Christoph Fritz e6dea51e2d
regulator: fan53880: Add initial support
This patch adds support for ON Semiconductor FAN53880 regulator.

The FAN53880 is an I2C porgrammable power management IC (PMIC)
that contains a BUCK (step-down converter), four LDOs (low dropouts)
and one BOOST (step-up converter).  It is designed for mobile power
applications.

Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
Link: https://lore.kernel.org/r/20200702210846.31659-2-chf.fritz@googlemail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-03 18:00:28 +01:00
Jisheng Zhang 38fc6f2957
regulator: add support for SY8827N regulator
The SY8827N from Silergy Corp is a single output DC/DC converter. The
voltage can be controlled via I2C.

Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Link: https://lore.kernel.org/r/20200702171438.20edc523@xhacker.debian
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-02 15:52:00 +01:00
Wesley Cheng 4fe66d5a62
regulator: Add support for QCOM PMIC VBUS booster
Some Qualcomm PMICs have the capability to source the VBUS output to
connected peripherals.  This driver will register a regulator to the
regulator list to enable or disable this source by an external driver.

Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>
Link: https://lore.kernel.org/r/20200626185516.18018-5-wcheng@codeaurora.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-01 18:07:15 +01:00
Axel Lin 1b3bcca208
regulator: mt6358: Remove BROKEN dependency
The MFD part is merged into v5.8-rc1, thus remove BROKEN dependency.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20200616135030.1163660-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-17 13:01:19 +01:00
Pi-Hsun Shih 8d9f8d57e0
regulator: Add driver for cros-ec-regulator
Add driver for cros-ec-regulator, representing a voltage regulator that
is connected and controlled by ChromeOS EC, and is controlled by kernel
with EC host commands.

Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org>
Reviewed-by: Prashant Malani <pmalani@chromium.org>
Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Link: https://lore.kernel.org/r/20200612040526.192878-4-pihsun@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-15 22:40:14 +01:00
Mark Brown c50ad6dbf6 lib: Add linear ranges helper library and start using it
Series extracts a "linear ranges" helper out of the regulator
 framework. Linear ranges helper is intended to help converting
 real-world values to register values when conversion is linear. I
 suspect this is useful also for power subsystem and possibly for clk.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl61lKwTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0HxeB/9dblIbC+28MvcEHXCcYBZBouOnrM8E
 bIOMXkgEj1uL78ozOm7tMCgEpaKgv6BHdDuClCBvjbr0uOtAi0qUiv0IBotuVrdo
 lq73l8l7OPz6TFFKIt8WsgwKnzdkuQC08+qrZasAdluRQnqnmkU2tvl2y9zaaaR4
 6hGw+Nwx/pgeCXCa3pu+rCYwA7g0Tf8a6DDC6LyQWZameBJ1ey/YDjhJEeSmY7P7
 306zs8YVxHhQMLUQ5T7DA6r/KWMNkO1SOueCqTjxWZc/XamGEcbsZG1cWrAnkoE2
 VKLXBtYC75coNxIiu8ZxnQwLLdz1EQPdtg0qmzSjXJ68QjbWWzf4K1ra
 =LG9G
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl61lPUTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0GuGB/9kDFxKo0DWsH6tqZGS/retk0ddT+4B
 mnkkZGvoKkkDe1lh84vRbrPHhiI9LIXaj3lFgzyYeTuAi9tb77mPNnYIPLDye7bO
 OvgJgovo4tK3dUVSUFatvOhuAMSZLyN2WjWRX+YeHMd1nNZSHxEz0CuG3npNtuKa
 KoZd0Dfom4ds66qDlWdfonFhMJbMvQbEs4BhnfdvpD/soylyDB+29SHlhTBv8+UC
 I7BNzsmVDlp/JyrX3yJbuTum9wbPaMLcyL96EbvRykmTywz5FXudffqzPfPnoQxT
 rbN5DfwKsnySToUYDfp9dcIMyTF0/MtneaeBMRu2NIkpMmnicvExNrbU
 =/+DM
 -----END PGP SIGNATURE-----

Merge tag 'linear-ranges-lib' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-5.8

lib: Add linear ranges helper library and start using it

Series extracts a "linear ranges" helper out of the regulator
framework. Linear ranges helper is intended to help converting
real-world values to register values when conversion is linear. I
suspect this is useful also for power subsystem and possibly for clk.
2020-05-08 18:20:51 +01:00
Matti Vaittinen 60ab7f4153
regulator: use linear_ranges helper
Change the regulator helpers to use common linear_ranges code.

Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Link: https://lore.kernel.org/r/64f01d5e381b8631a271616b7790f9d5640974fb.1588944082.git.matti.vaittinen@fi.rohmeurope.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-08 18:18:13 +01:00
Iskren Chernev e7314653dc
regulator: max77826: Add max77826 regulator driver
Adding regulator driver for the Maxim max77826 device.
The max77826 PMIC contains a high-efficiency BUCK regulator, a BUCK
BOOST regulator and 15 LDOs. It is designed for smartphone and tablet
applications and is accessed over I2C.

Signed-off-by: Iskren Chernev <iskren.chernev@gmail.com>
Link: https://lore.kernel.org/r/20200414172250.2363235-2-iskren.chernev@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-14 19:01:19 +01:00
Jisheng Zhang 97be82880b
regulator: add support for MP8869 regulator
The MP8869 from Monolithic Power Systems is a single output DC/DC
converter. The voltage can be controlled via I2C.

Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Link: https://lore.kernel.org/r/20200316223020.1a6d92ae@xhacker
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-16 18:27:34 +00:00
Anson Huang 6179b0e90c
regulator: anatop: Improve Kconfig dependency
ANATOP regulator should depend on ARCH_MXC or COMPILE_TEST.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Link: https://lore.kernel.org/r/1583150118-8014-1-git-send-email-Anson.Huang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-02 14:48:11 +00:00
Saravanan Sekar a273188b87
regulator: mp5416: add mp5416 regulator driver
Adding regulator driver for the device mp5416.
The MP5416 PMIC device contains four DC-DC buck converters and
five regulators, accessed over I2C.

Signed-off-by: Saravanan Sekar <sravanhome@gmail.com>
Link: https://lore.kernel.org/r/20200204110419.25933-3-sravanhome@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-11 11:34:34 +00:00
Linus Torvalds af32f3a414 - New Drivers
- Add support for ROHM BD71828 PMICs and GPIOs
    - Add support for Qualcomm Aqstic Audio Codecs WCD9340 and WCD9341
 
 - New Device Support
    - Add support for BD71828 to BD70528 RTC driver
    - Add support for Intel's Jasper Lake to LPSS PCI
 
  - New Functionality
    - Add support for Power Key to ROHM BD71828
    - Add support for Clocks to ROHM BD71828
    - Add support for GPIOs to Dialog DA9062
    - Add support for USB PD Notify to ChromiumOS EC
    - Allow callers to specify args when requesting regmap lookup; syscon
 
  - Fix-ups
    - Improve error handling and sanity checking; atmel-hlcdc, dln2
    - Device Tree support/documentation; bd71828, da9062, xylon,logicvc,
                                         ab8500, max14577, atmel-usart
    - Match devices using platform IDs; bd7xxxx
    - Refactor BD718x7 regulator component; bd718x7-regulator
    - Use standard interfaces/helpers; syscon, sm501
    - Trivial (whitespace, spelling, etc); ab8500-core, Kconfig
    - Remove unused code; db8500-prcmu, tqmx86
    - Wait until boot has finished before accessing registers; madera-core
    - Provide missing register value defaults; cs47l15-tables
    - Allow more time for hardware to reset; madera-core
 
  - Bug Fixes
    - Fix erroneous register values; rohm-bd70528
    - Fix register volatility; axp20x, rn5t618
    - Fix Kconfig dependencies; MFD_MAX77650
    - Fix incorrect compatible string; da9062-core
    - Fix syscon_regmap_lookup_by_phandle_args() stub; syscon
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAl44Ga0ACgkQUa+KL4f8
 d2HRJg//VdigHgOTX/eJggI67n36kTgho+VzwRwLuSedDBFIkh5S8NWO7bFyf1Y4
 Qn+MybJtCvPQeUVmqO6cUi0/VqXgwW4mUe5L6oQKIsPYzfmhuc/XF+DA2S8ulOBj
 CckAM15i4WARCtNtFH12EaGGekLPAkik9nZE5EH7vS89TUxLMKbir72U+qFju6mu
 o2F8B7QbDe2jxaooxZ11zPjECwJfzgdXe+FipmogL1itLT+1phpirlttY4R5/4LV
 t3jKb3GI5xN+YWqyXHFF1EKtQEHTkYyKcby2It+8ksYAKiueY0hAuX7+pt1KXWjb
 ReM/hYH5dqjJSz6MjajrInHlpAf8iqtzNdXznSm/hQ9X+YHpaqmdYBt9bTg3pbR/
 z5F0q32e716K/XcJIv2igizT2EZDZIb2AG9oh0D93Z10tPgTpp0CTkcSsSw4CpnP
 MM60B2RN6RI/1MVK1eWRfWVSLbopsForetlnwXhTxY0Zr/7Hd+l+2ndz8IJE+vya
 86jq9yXv7kndwcKNIuUy5jIE2XV9JIbjwwDd4a8tbQgOMkSWHuV3pN+qnT6+/kRh
 TS/LFI49rjJauB85XdqhZc2+i0Eo78ctIdxQebKNZe6wz+r5Y5NTMMCZ5TjScxJX
 aSKRepOEtSbnKloUi5HZ71zfX/waTxzgyodkF7UJk3eEtzlDF8o=
 =t4+B
 -----END PGP SIGNATURE-----

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

Pull MFD updates from Lee Jones:
 "New Drivers:
   - Add support for ROHM BD71828 PMICs and GPIOs
   - Add support for Qualcomm Aqstic Audio Codecs WCD9340 and WCD9341

  New Device Support:
   - Add support for BD71828 to BD70528 RTC driver
   - Add support for Intel's Jasper Lake to LPSS PCI

  New Functionality:
   - Add support for Power Key to ROHM BD71828
   - Add support for Clocks to ROHM BD71828
   - Add support for GPIOs to Dialog DA9062
   - Add support for USB PD Notify to ChromiumOS EC
   - Allow callers to specify args when requesting regmap lookup; syscon

  Fix-ups:
   - Improve error handling and sanity checking; atmel-hlcdc, dln2
   - Device Tree support/documentation; bd71828, da9062, xylon,logicvc,
     ab8500, max14577, atmel-usart
   - Match devices using platform IDs; bd7xxxx
   - Refactor BD718x7 regulator component; bd718x7-regulator
   - Use standard interfaces/helpers; syscon, sm501
   - Trivial (whitespace, spelling, etc); ab8500-core, Kconfig
   - Remove unused code; db8500-prcmu, tqmx86
   - Wait until boot has finished before accessing registers;
     madera-core
   - Provide missing register value defaults; cs47l15-tables
   - Allow more time for hardware to reset; madera-core

  Bug Fixes:
   - Fix erroneous register values; rohm-bd70528
   - Fix register volatility; axp20x, rn5t618
   - Fix Kconfig dependencies; MFD_MAX77650
   - Fix incorrect compatible string; da9062-core
   - Fix syscon_regmap_lookup_by_phandle_args() stub; syscon"

* tag 'mfd-next-5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (41 commits)
  mfd: syscon: Fix syscon_regmap_lookup_by_phandle_args() dummy
  mfd: wcd934x: Add support to wcd9340/wcd9341 codec
  mfd: syscon: Add arguments support for syscon reference
  mfd: rn5t618: Mark ADC control register volatile
  dt-bindings: atmel-usart: Add microchip,sam9x60-{usart, dbgu}
  dt-bindings: atmel-usart: Remove wildcard
  mfd: cros_ec: Add cros-usbpd-notify subdevice
  mfd: da9062: Fix watchdog compatible string
  mfd: madera: Allow more time for hardware reset
  mfd: cs47l15: Add missing register default
  mfd: madera: Wait for boot done before accessing any other registers
  mfd: Kconfig: Rename Samsung to lowercase
  mfd: tqmx86: remove set but not used variable 'i2c_ien'
  mfd: dbx500-prcmu: Drop DSI pll clock functions
  mfd: dbx500-prcmu: Drop set_display_clocks()
  mfd: max77650: Select REGMAP_IRQ in Kconfig
  mfd: axp20x: Mark AXP20X_VBUS_IPSOUT_MGMT as volatile
  mfd: ab8500: Fix ab8500-clk typo
  mfd: intel-lpss: Add Intel Jasper Lake PCI IDs
  dt-bindings: mfd: max14577: Add reference to max14040_battery.txt descriptions
  ...
2020-02-03 14:51:57 +00:00
Matti Vaittinen 21b72156ed regulator: bd718x7: Split driver to common and bd718x7 specific parts
Few ROHM PMICs allow setting the voltage states for different system states
like RUN, IDLE, SUSPEND and LPSR. States are then changed via SoC specific
mechanisms. bd718x7 driver implemented device-tree parsing functions for
these state specific voltages. The parsing functions can be re-used by
other ROHM chip drivers like bd71828. Split the generic functions from
bd718x7-regulator.c to rohm-regulator.c and export them for other modules
to use.

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>
2020-01-24 07:22:53 +00:00
Robert Marko ebf652b408
regulator: add IPQ4019 SDHCI VQMMC LDO driver
This introduces the IPQ4019 VQMMC LDO driver needed for
the SD/EMMC driver I/O level operation.
This will enable introducing SD/EMMC support for the built-in controller.

Signed-off-by: Mantas Pucka <mantas@8devices.com>
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Link: https://lore.kernel.org/r/20200112113003.11110-1-robert.marko@sartura.hr
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-13 15:03:24 +00:00
Saravanan Sekar 6501c1f54a
regulator: mpq7920: add mpq7920 regulator driver
Adding regulator driver for the device mpq7920.
The MPQ7920 PMIC device contains four DC-DC buck converters and
five regulators, is designed for automotive and accessed over I2C.

Fixed sparse warning reported on this patch
Reported-by: kbuild test robot <lkp@intel.com>

Signed-off-by: Saravanan Sekar <sravanhome@gmail.com>
Link: https://lore.kernel.org/r/20200109195346.30270-1-sravanhome@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-09 21:24:54 +00:00
Markus Reichl c66f1cbad5
regulator: mp8859: add config option and build entry
Add entries for the mp8859 regulator driver
to the build system.

Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
Link: https://lore.kernel.org/r/20200106211633.2882-3-m.reichl@fivetechno.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-08 15:57:30 +00:00
Matti Vaittinen 522498f8cb
regulator: bd71828: Basic support for ROHM bd71828 PMIC regulators
ROHM BD71828 is a power management IC containing 7 bucks and 7 LDOs. Bucks
1,2,6 and 7 can be assigned to a regulator group controlled by run-levels.
Eg. Voltages and enable/disable statuses for specific run-levels (run0 to
run3) can be set via register interface and run level changes can then be
done either via I2C or GPIO.

This initial commit does not support assigning bucks to be controlled via
run-levels but only allows them to be individually controlled.

LDO5 voltage can also be controlled by GPIO2 pin and register interfaces
but this driver only supports the control via register.

Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/5b1c4a22c7945e97ff2a7924abfeb3239043f8eb.1576054779.git.matti.vaittinen@fi.rohmeurope.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-12-17 12:36:15 +00:00
Krzysztof Kozlowski 76bec25b32
regulator: Fix Kconfig indentation
Adjust indentation from spaces to tab (+optional two spaces) as in
coding style with command like:
	$ sed -e 's/^        /\t/' -i */Kconfig

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20191120133949.13996-1-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-11-20 17:10:58 +00:00
Mark Brown 50bc5731f7
regulator: mt6358: Add BROKEN dependency while waiting for MFD to merge
The mt6358 driver was merged in error, it depends on an existing MFD
rather than a newly added one and needs updates to that driver.  Disable
the build until those are merged.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-30 12:29:22 +01:00
Hsin-Hsiung Wang f67ff1bd58
regulator: mt6358: Add support for MT6358 regulator
The MT6358 is a regulator found on boards based on MediaTek MT8183 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: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
Link: https://lore.kernel.org/r/1566531931-9772-8-git-send-email-hsin-hsiung.wang@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-28 11:51:27 +01:00
Jisheng Zhang 67a7b05b29
regulator: sy8824x: add SY8824E support
The only difference between SY8824E and SY8824C/D is the vsel_min.

Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Link: https://lore.kernel.org/r/20190827163537.52023c4e@xhacker.debian
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-27 20:46:12 +01:00
Jisheng Zhang d5a2b82203
regulator: add support for SY8824C regulator
SY8824C is an I2C attached single output regulator made by Silergy Corp,
which is used on several Synaptics berlin platforms to control the
power supply of the ARM cores.

Add a driver for it.

Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Link: https://lore.kernel.org/r/20190827163418.1a32fc48@xhacker.debian
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-27 20:45:50 +01:00
YueHaibing 5375f1efd7
regulator: act8865: Fix build error without CONFIG_POWER_SUPPLY
Building without CONFIG_POWER_SUPPLY will fail:

drivers/regulator/act8865-regulator.o: In function `act8865_pmic_probe':
act8865-regulator.c:(.text+0x357): undefined reference to `devm_power_supply_register'
drivers/regulator/act8865-regulator.o: In function `act8600_charger_get_property':
act8865-regulator.c:(.text+0x3f1): undefined reference to `power_supply_get_drvdata'

Add POWER_SUPPLY dependency to Kconfig.

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 2d09a79bf6 ("regulator: act8865: Add support for act8600 charger")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190807133822.67124-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-08 20:42:29 +01:00
Linus Torvalds 8de262531f - Core Frameworks
- Set 'struct device' fwnode when registering a new device
 
  - New Drivers
    - Add support for ROHM BD70528 PMIC
 
  - New Device Support
    - Add support for LP87561 4-Phase Regulator to TI LP87565 PMIC
    - Add support for RK809 and RK817 to Rockchip RK808
    - Add support for Lid Angle to ChromeOS core
    - Add support for CS47L15 CODEC to Madera core
    - Add support for CS47L92 CODEC to Madera core
    - Add support for ChromeOS (legacy) Accelerometers in ChromeOS core
    - Add support for Add Intel Elkhart Lake PCH to Intel LPSS
 
  - New Functionality
    - Provide regulator supply information when registering; madera-core
    - Additional Device Tree support; lp87565, madera, cros-ec, rohm,bd71837-pmic
    - Allow over-riding power button press via Device Tree; rohm-bd718x7
    - Differentiate between running processors; cros_ec_dev
 
  - Fix-ups
    - Big header file update; cros_ec_commands.h
    - Split header per-subsystem; rohm-bd718x7
    - Remove superfluous code; menelaus, cs5535-mfd, cs47lXX-tables
    - Trivial; sorting, coding style; intel-lpss-pci
    - Only remove Power Off functionality if set locally; rk808
    - Make use for Power Off Prepare(); rk808
    - Fix spelling mistake in header guards; stmfx
    - Properly free IDA resources
    - SPDX fixups; cs47lXX-tables, madera
    - Error path fixups; hi655x-pmic
 
  - Bug Fixes
    - Add missing break in case() statement
    - Repair undefined behaviour when not initialising variables; arizona-core, madera-core
    - Fix reference to Device Tree documentation; madera
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAl0sLxgACgkQUa+KL4f8
 d2E25Q/9HmDJIdfyDQg0xv5IM5HS1WsP9BcJCEgoRIsad4mMDRYt+ZeLbslwMhue
 E9tsFH359gGvyqR+7d6hPpEUET1UEcJy4eRD1zAc0+epllQTDHSy8oHt1dtH+8xB
 2AU5rvAKOqBk83D+V2Hkx2KcroWEQQNYIoR9/12Pi3xmEB1uaCO0/Ajd3B28bIBM
 Tzi3cVQ3U7jY9EIM44GVTsjDAbMSkQR0iab6cQF0vJAWaUmGKlsO7iRrU1XkN69V
 qXyBauI8WGiGssihrE8r+jYvHvmg7hA9OKZIckUaMXD/k7kpHbwIaFRh7gukq4Re
 Q6Cy30NfVJ1tY66/5oqN6gj5znfeuEudMCCzYAkzlROSp5eApe2Ke5ajYn3kOCZd
 ZKcsrw9Fiox1lKmuWXDbyf0nqf4zwdDPAnShRWaaF5aipwgywyGcwSigVtK4F0P5
 Hjc5RLv7GjTAJq+ZzwgKyAdtx8L0mhdLd1ZTQpEXk/g/E9dW4GF72hWj9TQ/9BnA
 ZflKv8aP3lDGRHgO3Huwi4lMzskB8BVCQMCFwLwGs5cY1oZQhAjTdJzBZjTGexhC
 evuuA8OUsCrOWMvnZf3saSdHJ1iMHtfPnqEGHRJQtNj4fFaXv80LasIomvvfJc1/
 9JlRyAgm2pF7YDrgTh65ZzBb324eKSZZoAj9XZbnTyzxUAcF69A=
 =A3jw
 -----END PGP SIGNATURE-----

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

Pull MFD updates from Lee Jones:
 "Core Frameworks:
   - Set 'struct device' fwnode when registering a new device

  New Drivers:
   - Add support for ROHM BD70528 PMIC

  New Device Support:
   - Add support for LP87561 4-Phase Regulator to TI LP87565 PMIC
   - Add support for RK809 and RK817 to Rockchip RK808
   - Add support for Lid Angle to ChromeOS core
   - Add support for CS47L15 CODEC to Madera core
   - Add support for CS47L92 CODEC to Madera core
   - Add support for ChromeOS (legacy) Accelerometers in ChromeOS core
   - Add support for Add Intel Elkhart Lake PCH to Intel LPSS

  New Functionality:
   - Provide regulator supply information when registering; madera-core
   - Additional Device Tree support; lp87565, madera, cros-ec, rohm,bd71837-pmic
   - Allow over-riding power button press via Device Tree; rohm-bd718x7
   - Differentiate between running processors; cros_ec_dev

  Fix-ups:
   - Big header file update; cros_ec_commands.h
   - Split header per-subsystem; rohm-bd718x7
   - Remove superfluous code; menelaus, cs5535-mfd, cs47lXX-tables
   - Trivial; sorting, coding style; intel-lpss-pci
   - Only remove Power Off functionality if set locally; rk808
   - Make use for Power Off Prepare(); rk808
   - Fix spelling mistake in header guards; stmfx
   - Properly free IDA resources
   - SPDX fixups; cs47lXX-tables, madera
   - Error path fixups; hi655x-pmic

  Bug Fixes:
   - Add missing break in case() statement
   - Repair undefined behaviour when not initialising variables; arizona-core, madera-core
   - Fix reference to Device Tree documentation; madera"

* tag 'mfd-next-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (45 commits)
  mfd: hi655x-pmic: Fix missing return value check for devm_regmap_init_mmio_clk
  mfd: madera: Fixup SPDX headers
  mfd: madera: Remove some unused registers and fix some defaults
  mfd: intel-lpss: Release IDA resources
  mfd: intel-lpss: Add Intel Elkhart Lake PCH PCI IDs
  mfd: cs5535-mfd: Remove ifdef OLPC noise
  mfd: stmfx: Fix macro definition spelling
  dt-bindings: mfd: Add link to ROHM BD71847 Datasheet
  MAINAINERS: Swap words in INTEL PMIC MULTIFUNCTION DEVICE DRIVERS
  mfd: cros_ec_dev: Register cros_ec_accel_legacy driver as a subdevice
  mfd: rk808: Prepare rk805 for poweroff
  mfd: rk808: Check pm_power_off pointer
  mfd: cros_ec: differentiate SCP from EC by feature bit
  dt-bindings: Add binding for cros-ec-rpmsg
  mfd: madera: Add Madera core support for CS47L92
  mfd: madera: Add Madera core support for CS47L15
  mfd: madera: Update DT bindings to add additional CODECs
  mfd: madera: Add supply mapping for MICVDD
  mfd: madera: Fix potential uninitialised use of variable
  mfd: madera: Fix bad reference to pinctrl.txt file
  ...
2019-07-15 20:18:40 -07:00
Linus Torvalds 98537ee92f regulator: Updates for v5.3
A couple of new features in the core, the most interesting one
 being support for complex regulator coupling configurations
 initially targeted at nVidia Tegra SoCs, and some new drivers but
 otherwise quite a quiet release.
 
  - Core support for gradual ramping of voltages for devices that
    can't manage large changes in hardware from Bartosz Golaszewski.
  - Core support for systems that have complex coupling requirements
    best described via code, contributed by Dmitry Osipenko.
  - New drivers for Dialog SLG51000, Qualcomm PM8005 and ST
    Microelectronics STM32-Booster.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl0jIZwTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0PG+B/9EQnjM29THpBKM6bKdl8cYcf3Hq/FX
 KNtXjwaTM0DqYtpk1RkaHgecxTJwesJ0k9AYijh0ieeMhb5UES280+6B4NqPb7xr
 UmFBbNcdk9G+x9q1TyT8akRMkCugEMscQodyk4npzZRjGv8qUsNJUY71Bq2T/JJx
 QXo5fKlWICzBahF87DCB5pKC7PKfNkx3BWCrGGXOqoBX2ZEKytyWlCa0nGUZ+LqL
 GqXmmIjKL7H8MP3avmrrRHYpeF5DLXAzH+HEIM9Y0F1cRcdgOS1Exv2eG+90a634
 yybVDBX2d5zfiEIoRnpldtB52EGXjvwbo7w1mFwh9UgJRbOCZgb+ZQXT
 =26r6
 -----END PGP SIGNATURE-----

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

Pull regulator updates from Mark Brown:
 "A couple of new features in the core, the most interesting one being
  support for complex regulator coupling configurations initially
  targeted at nVidia Tegra SoCs, and some new drivers but otherwise
  quite a quiet release.

  Summary:

   - Core support for gradual ramping of voltages for devices that can't
     manage large changes in hardware from Bartosz Golaszewski.

   - Core support for systems that have complex coupling requirements
     best described via code, contributed by Dmitry Osipenko.

   - New drivers for Dialog SLG51000, Qualcomm PM8005 and ST
     Microelectronics STM32-Booster"

* tag 'regulator-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (52 commits)
  regulator: max77650: use vsel_step
  regulator: implement selector stepping
  regulator: max77650: add MODULE_ALIAS()
  regulator: max77620: remove redundant assignment to variable ret
  dt-bindings: regulator: add support for the stm32-booster
  regulator: add support for the stm32-booster
  regulator: s2mps11: Adjust supported buck voltages to real values
  regulator: s2mps11: Fix buck7 and buck8 wrong voltages
  gpio: Fix return value mismatch of function gpiod_get_from_of_node()
  regulator: core: Expose some of core functions needed by couplers
  regulator: core: Introduce API for regulators coupling customization
  regulator: s2mps11: Add support for disabling S2MPS11 regulators in suspend
  regulator: s2mps11: Reduce number of rdev_get_id() calls
  regulator: qcom_spmi: Do NULL check for lvs
  regulator: qcom_spmi: Fix math of spmi_regulator_set_voltage_time_sel
  regulator: da9061/62: Adjust LDO voltage selection minimum value
  regulator: s2mps11: Fix ERR_PTR dereference on GPIO lookup failure
  regulator: qcom_spmi: add PMS405 SPMI regulator
  dt-bindings: qcom_spmi: Document pms405 support
  arm64: dts: msm8998-mtp: Add pm8005_s1 regulator
  ...
2019-07-09 09:15:03 -07:00
Linus Torvalds 8a3367cc80 LED updates for 5.3-rc1
-----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQUwxxKyE5l/npt8ARiEGxRG/Sl2wUCXRozKAAKCRBiEGxRG/Sl
 25okAP9I0Rmscpqjb/+GEeXH4EmL3moGzc9o/BzHRqfeO4wqYAEA+8f7L20xHe8g
 tvEGfP7mN/oBmcAfqgH5K9F4eJsBRAw=
 =NkCn
 -----END PGP SIGNATURE-----

Merge tag 'leds-for-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds

Pull LED updates from Jacek Anaszewski:

 - Add a new LED common module for ti-lmu driver family

 - Modify MFD ti-lmu bindings
        - add ti,brightness-resolution
        - add the ramp up/down property

 - Add regulator support for LM36274 driver to lm363x-regulator.c

 - New LED class drivers with DT bindings:
        - leds-spi-byte
        - leds-lm36274
        - leds-lm3697 (move the support from MFD to LED subsystem)

 - Simplify getting the I2C adapter of a client:
        - leds-tca6507
        - leds-pca955x

 - Convert LED documentation to ReST

* tag 'leds-for-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds:
  dt: leds-lm36274.txt: fix a broken reference to ti-lmu.txt
  docs: leds: convert to ReST
  leds: leds-tca6507: simplify getting the adapter of a client
  leds: leds-pca955x: simplify getting the adapter of a client
  leds: lm36274: Introduce the TI LM36274 LED driver
  dt-bindings: leds: Add LED bindings for the LM36274
  regulator: lm363x: Add support for LM36274
  mfd: ti-lmu: Add LM36274 support to the ti-lmu
  dt-bindings: mfd: Add lm36274 bindings to ti-lmu
  leds: max77650: Remove set but not used variable 'parent'
  leds: avoid flush_work in atomic context
  leds: lm3697: Introduce the lm3697 driver
  mfd: ti-lmu: Remove support for LM3697
  dt-bindings: ti-lmu: Modify dt bindings for the LM3697
  leds: TI LMU: Add common code for TI LMU devices
  leds: spi-byte: add single byte SPI LED driver
  dt-bindings: leds: Add binding for spi-byte LED.
  dt-bindings: mfd: LMU: Add ti,brightness-resolution
  dt-bindings: mfd: LMU: Add the ramp up/down property
2019-07-09 08:59:39 -07:00
Fabrice Gasnier 4e210fbeee
regulator: add support for the stm32-booster
Add support for the 3.3V booster regulator embedded in stm32h7 and stm32mp1
devices, that can be used to supply ADC analog input switches.

This regulator is supplied by vdda. It's controlled by using SYSCFG:
- STM32H7 has a unique register to set/clear the booster enable bit
- STM32MP1 has separate set and clear registers to configure it.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-07-02 12:45:12 +01:00
Heiko Stuebner e444f6d68c regulator: rk808: Add RK809 and RK817 support.
Add support for the rk809 and rk817 regulator driver.
    Their specifications are as follows:
    1. The RK809 and RK809 consist of 5 DCDCs, 9 LDOs
       and have the same registers for these components except dcdc5.
    2. The dcdc5 is a boost dcdc for RK817 and is a buck for RK809.
    3. The RK817 has one switch but The Rk809 has two.

    The output voltages are configurable and are meant to supply power
    to the main processor and other components.

Signed-off-by: Tony Xie <tony.xie@rock-chips.com>
Acked-by: Mark Brown <broonie@kernel.org>
[rebased on top of 5.2-rc1]
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2019-06-27 14:57:31 +01:00
Mark Brown e1d700f7c9 Linux 5.2-rc4
-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAlz8fAYeHHRvcnZhbGRz
 QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiG1asH/3ySguxqtqL1MCBa
 4/SZ37PHeWKMerfX6ZyJdgEqK3B+PWlmuLiOMNK5h2bPLzeQQQAmHU/mfKmpXqgB
 dHwUbG9yNnyUtTfsfRqAnCA6vpuw9Yb1oIzTCVQrgJLSWD0j7scBBvmzYqguOkto
 ThwigLUq3AILr8EfR4rh+GM+5Dn9OTEFAxwil9fPHQo7QoczwZxpURhScT6Co9TB
 DqLA3fvXbBvLs/CZy/S5vKM9hKzC+p39ApFTURvFPrelUVnythAM0dPDJg3pIn5u
 g+/+gDxDFa+7ANxvxO2ng1sJPDqJMeY/xmjJYlYyLpA33B7zLNk2vDHhAP06VTtr
 XCMhQ9s=
 =cb80
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl0JKaQTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0DIWB/9IWGRWWkTE3XNNrG3D32aP/KMPMJcG
 2ojsLawEX/URJerfR5ofvleTeb3AoE8N4jWFtXc5BcqB7OtcNNKSlKlxt3rrYO5v
 hbyd9Cc+q82iLAPwTFkLNU3MU2vZS9Q81j268lONPtEgiWDpbB2TZ52LINQ5FF+T
 D/U8ERI29nrHDQ+gSi2NLBbBuQNZqb6MIGga2e1wdJVA7NuH6rIkfFAz4oB/vFmR
 HiVTFmNjSCgb9HX9K4b0BsokFkriy5/UWCYZzjwRDQ+TjxioXkUccYZpMqfFI30F
 EfjcwxgqIbQS4cDta4bK09T0s7vUpFiNxWh7clxc2qLBrFijTKxLlNOB
 =nQaU
 -----END PGP SIGNATURE-----

Merge tag 'v5.2-rc4' into regulator-5.3

Linux 5.2-rc4
2019-06-18 19:12:47 +01:00
Dan Murphy bff5e80715 regulator: lm363x: Add support for LM36274
Adding regulator support for the LM36274 backlight driver.
This device can leverage this existing code as the functionality
and registers are common enough between the LM36274 and the LM363x
series of devices.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Acked-by: Mark Brown <broonie@kernel.org>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
2019-06-06 20:38:38 +02:00
Richard Fitzgerald 7bd7916dc8
regulator: arizona-micsupp: Add support for Cirrus Logic Madera codecs
This adds a new driver identity "madera-micsupp" and probe function
so that this driver can be used to control the micsupp regulator on
Cirrus Logic Madera codecs.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-21 21:23:40 +01:00
Richard Fitzgerald 1f5f11e737
regulator: arizona-ldo1: Add support for Cirrus Logic Madera codecs
This adds a new driver identity "madera-ldo1" and probe function
so that this driver can be used to control the LDO1 regulator on
some Cirrus Logic Madera codecs.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-21 21:23:24 +01:00
Thomas Gleixner ec8f24b7fa treewide: Add SPDX license identifier - Makefile/Kconfig
Add SPDX license identifiers to all Make/Kconfig files which:

 - Have no license information of any form

These files fall under the project license, GPL v2 only. The resulting SPDX
license identifier is:

  GPL-2.0-only

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-21 10:50:46 +02:00
Wolfram Sang 973af54c52
regulator: da9063: platform_data is gone, depend on OF
With OF being the only configuration possibility left, depend on it to
simplify some code.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Steve Twiss <stwiss.opensource@diasemi.com>
Tested-by: Steve Twiss <stwiss.opensource@diasemi.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-20 15:26:12 +01:00
Eric Jeong a867bde3dd
regulator: slg51000: add slg51000 regulator driver
Adding regulator driver for the device Dialog SLG51000.

The SLG51000 device contains seven compact and customizable low
dropout regulators and is designed for high performance camera modules
and other small multi-rail applications.

Signed-off-by: Eric Jeong <eric.jeong.opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-13 11:07:43 +01:00
Pascal PAILLET-LME 6cdae8173f
regulator: Add support for stm32 power regulators
Add support for 1V1 1V8 USB3V3 power regulators.

Signed-off-by: Pascal Paillet <p.paillet@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-15 10:58:41 +01:00
Axel Lin a71bcdfe64
regulator: uniphier: Fix build dependency
This driver does not use any syscon APIs, so remove MFD_SYSCON dependency.
Select REGMAP_MMIO since this driver uses devm_regmap_init_mmio().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-25 12:12:24 +00:00
Arnd Bergmann 0077aaaeeb
regulator: da903x: don't build with clang
The da903x driver produces an annoying false-positive warning
when built with clang:

drivers/regulator/da903x.c:395:2: error: division by zero is undefined [-Werror,-Wdivision-by-zero]
        DA9030_LDO(13, 2100, 2100, 0, INVAL, 0, 0, RCTL11, 3), /* fixed @2.1V */
        ^                          ~
drivers/regulator/da903x.c:359:2: note: expanded from macro 'DA9030_LDO'
        DA903x_LDO(DA9030, _id, min, max, step, vreg, shift, nbits, ereg, ebit)
        ^                                 ~~~~
drivers/regulator/da903x.c:320:39: note: expanded from macro 'DA903x_LDO'
                .n_voltages = (step) ? ((max - min) / step + 1) : 1,    \
                                                    ^ ~~~~
drivers/regulator/da903x.c:415:2: error: division by zero is undefined [-Werror,-Wdivision-by-zero]
        DA9034_LDO(5, 3100, 3100, 0, INVAL, 0, 0, OVER3, 7), /* fixed @3.1V */
        ^                         ~
drivers/regulator/da903x.c:356:2: note: expanded from macro 'DA9034_LDO'
        DA903x_LDO(DA9034, _id, min, max, step, vreg, shift, nbits, ereg, ebit)
        ^                                 ~~~~
drivers/regulator/da903x.c:320:39: note: expanded from macro 'DA903x_LDO'
                .n_voltages = (step) ? ((max - min) / step + 1) : 1,    \
                                                    ^ ~~~~

I already reported this as a bug in clang, but it may take a
while to fix it. As I have not been able to come up with any
reasonable workaround, I would just disable compilation here.

Link: https://bugs.llvm.org/show_bug.cgi?id=38789
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-13 15:12:38 +00:00
Bartosz Golaszewski bcc61f1c44
regulator: max77650: add regulator support
Add regulator support for max77650. We support all four variants of this
PMIC including non-linear voltage table for max77651 SBB1 rail.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-29 15:22:12 +00:00
Matti Vaittinen 99ea37bd1e
regulator: bd70528: Support ROHM BD70528 regulator block
BD70528MWV is an ultra-low Iq general purpose single-chip power
management IC for battery-powered portable devices.

Add support for controlling 3 bucks and 3 LDOs present in
ROHM BD70528.

Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-23 15:50:18 +00:00
Krzysztof Kozlowski 48f1b4efd6
regulator: Fix trivial language typos
Fix few trivial language typos in core and drivers.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-08 13:04:47 +00:00
Axel Lin 77ea906082
regulator: mcp16502: Select REGMAP_I2C to fix build error
Fix build error when CONFIG_REGMAP_I2C=m && CONFIG_REGULATOR_MCP16502=y.

drivers/regulator/mcp16502.o: In function `mcp16502_probe':
mcp16502.c:(.text+0xca): undefined reference to `__devm_regmap_init_i2c'

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-21 11:02:24 +00:00
Andrei.Stefanescu@microchip.com 919261c03e
regulator: mcp16502: add regulator driver for MCP16502
This patch adds a regulator driver for the MCP16502 PMIC.
This drivers supports basic operations through the
regulator interface such as:
- setting/reading voltage
- setting/reading operating mode
- reading current status

Signed-off-by: Andrei Stefanescu <andrei.stefanescu@microchip.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-13 12:19:04 +00:00
Charles Keepax bef9391cbe
regulator: lochnagar: Add support for the Cirrus Logic Lochnagar
Lochnagar is an evaluation and development board for Cirrus
Logic Smart CODEC and Amp devices. It allows the connection of
most Cirrus Logic devices on mini-cards, as well as allowing
connection of various application processor systems to provide a
full evaluation platform. This driver supports the board
controller chip on the Lochnagar board.

The Lochnagar board provides power supplies for the attached
CODEC/Amp device. Currently this driver supports the microphone
supplies and the digital core voltage for the attached
device. There are some additional supplies that will be
added in time but these supplies are sufficient for most
systems/use-cases.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-12 18:53:03 +02:00
pascal paillet ca55b7185b
regulator: stpmic1: add stpmic1 regulator driver
The stpmic1 PMIC embeds several regulators and switches with
different capabilities.

Signed-off-by: pascal paillet <p.paillet@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-08 18:28:10 +01:00
Matti Vaittinen 2ece646c90
regulator: bd718xx: rename bd71837 to 718xx
rename bd71837-regulator.c to bd718x7-regulator.c to reflect the
fact that also BD71847 is now supported by the driver.

Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-28 14:57:13 +01:00
David Collins 46fc033eba
regulator: add QCOM RPMh regulator driver
Add the QCOM RPMh regulator driver to manage PMIC regulators
which are controlled via RPMh on some Qualcomm Technologies, Inc.
SoCs.  RPMh is a hardware block which contains several
accelerators which are used to manage various hardware resources
that are shared between the processors of the SoC.  The final
hardware state of a regulator is determined within RPMh by
performing max aggregation of the requests made by all of the
processors.

Add support for PMIC regulator control via the voltage regulator
manager (VRM) and oscillator buffer (XOB) RPMh accelerators.
VRM supports manipulation of enable state, voltage, and mode.
XOB supports manipulation of enable state.

Signed-off-by: David Collins <collinsd@codeaurora.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-10 17:30:29 +01:00
Matti Vaittinen 410e8b4f5c
regulator: bd71837: adobt MFD changes to regulator driver
MFD part for bd71837 was changed during the review. Clean regulator part to
match changed MFD:
- renamed header file => fix include
- remove unused platdata as also type definition was removed
- Kconfig option for MFD part was changed => fix depends on clause
- Rename Kconfig option for regulators
  As Kconfig option for regulators gets now used (when dependency to MFD is
  satisfied) change it so that it won't require new change when support for
  bd71847 is added.

Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-30 14:24:20 +01:00
Kunihiko Hayashi 9df4f90954
regulator: uniphier: add regulator driver for UniPhier SoC
Initial commit to add support for regulators implemented in UniPhier SoCs.
This supports USB VBUS only.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-11 10:30:32 +01:00
Stefan Wahren 297101ab85
regulator: pfuze100: add pfuze3001 support
This extends the pfuze100 driver with pfuze3001 support.

Latest datasheet:
https://www.nxp.com/docs/en/data-sheet/PF3001.pdf

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-18 12:22:39 +01:00
Matti Vaittinen ba08799e90
regulator: bd71837: BD71837 PMIC regulator driver
Support for controlling the 8 bucks and 7 LDOs the PMIC contains.

Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-30 11:31:22 +01:00