summaryrefslogtreecommitdiff
path: root/drivers/regulator
AgeCommit message (Collapse)AuthorFilesLines
2021-04-29Merge tag 'mfd-next-5.13' of ↵Linus Torvalds6-68/+730
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-27Merge tag 'regulator-v5.13' of ↵Linus Torvalds14-119/+386
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator updates from Mark Brown: "Not much going on with regulator this cycle, even in terms of cleanups and fixes things were fairly quiet. - New helper for setting ramp delay - Conversion of the Qualcomm RPMH bindings to YAML - Support for Tang Cheng TCS4525" * tag 'regulator-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (26 commits) regulator: Add binding for TCS4525 regulator: fan53555: Add TCS4525 DCDC support dt-bindings: vendor-prefixes: Add Tang Cheng (TCS) regulator: core: Fix off_on_delay handling regulator: core: Respect off_on_delay at startup regulator: core.c: Improve a comment regulator: Avoid a double 'of_node_get' in 'regulator_of_get_init_node()' regulator: core.c: Fix indentation of comment regulator: s2mps11: Drop initialization via platform data regulator: s2mpa01: Drop initialization via platform data regulator: da9121: automotive variants identity fix regulator: Add regmap helper for ramp-delay setting regulator: helpers: Export helper voltage listing regulator: Add compatibles for PM7325/PMR735A regulator: Convert RPMh regulator bindings to YAML regulator: qcom-rpmh: Add PM7325/PMR735A regulator support regulator: qcom-rpmh: Add pmic5_ftsmps520 buck regulator: mt6360: remove redundant error print regulator: bd9576: Fix return from bd957x_probe() regulator: add missing call to of_node_put() ...
2021-04-26Merge tag 'arm-drivers-5.13' of ↵Linus Torvalds1-19/+23
git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC driver updates from Arnd Bergmann: "Updates for SoC specific drivers include a few subsystems that have their own maintainers but send them through the soc tree: TEE/OP-TEE: - Add tracepoints around calls to secure world Memory controller drivers: - Minor fixes for Renesas, Exynos, Mediatek and Tegra platforms - Add debug statistics to Tegra20 memory controller - Update Tegra bindings and convert to dtschema ARM SCMI Firmware: - Support for modular SCMI protocols and vendor specific extensions - New SCMI IIO driver - Per-cpu DVFS The other driver changes are all from the platform maintainers directly and reflect the drivers that don't fit into any other subsystem as well as treewide changes for a particular platform. SoCFPGA: - Various cleanups contributed by Krzysztof Kozlowski Mediatek: - add MT8183 support to mutex driver - MMSYS: use per SoC array to describe the possible routing - add MMSYS support for MT8183 and MT8167 - add support for PMIC wrapper with integrated arbiter - add support for MT8192/MT6873 Tegra: - Bug fixes to PMC and clock drivers NXP/i.MX: - Update SCU power domain driver to keep console domain power on. - Add missing ADC1 power domain to SCU power domain driver. - Update comments for single global power domain in SCU power domain driver. - Add i.MX51/i.MX53 unique id support to i.MX SoC driver. NXP/FSL SoC driver updates for v5.13 - Add ACPI support for RCPM driver - Use generic io{read,write} for QE drivers after performance optimized for PowerPC - Fix QBMAN probe to cleanup HW states correctly for kexec - Various cleanup and style fix for QBMAN/QE/GUTS drivers OMAP: - Preparation to use devicetree for genpd - ti-sysc needs iorange check improved when the interconnect target module has no control registers listed - ti-sysc needs to probe l4_wkup and l4_cfg interconnects first to avoid issues with missing resources and unnecessary deferred probe - ti-sysc debug option can now detect more devices - ti-sysc now warns if an old incomplete devicetree data is found as we now rely on it being complete for am3 and 4 - soc init code needs to check for prcm and prm nodes for omap4/5 and dra7 - omap-prm driver needs to enable autoidle retention support for omap4 - omap5 clocks are missing gpmc and ocmc clock registers - pci-dra7xx now needs to use builtin_platform_driver instead of using builtin_platform_driver_probe for deferred probe to work Raspberry Pi: - Fix-up all RPi firmware drivers so as for unbind to happen in an orderly fashion - Support for RPi's PoE hat PWM bus Qualcomm - Improved detection for SCM calling conventions - Support for OEM specific wifi firmware path - Added drivers for SC7280/SM8350: RPMH, LLCC< AOSS QMP" * tag 'arm-drivers-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (165 commits) soc: aspeed: fix a ternary sign expansion bug memory: mtk-smi: Add device-link between smi-larb and smi-common memory: samsung: exynos5422-dmc: handle clk_set_parent() failure memory: renesas-rpc-if: fix possible NULL pointer dereference of resource clk: socfpga: fix iomem pointer cast on 64-bit soc: aspeed: Adapt to new LPC device tree layout pinctrl: aspeed-g5: Adapt to new LPC device tree layout ipmi: kcs: aspeed: Adapt to new LPC DTS layout ARM: dts: Remove LPC BMC and Host partitions dt-bindings: aspeed-lpc: Remove LPC partitioning soc: fsl: enable acpi support in RCPM driver soc: qcom: mdt_loader: Detect truncated read of segments soc: qcom: mdt_loader: Validate that p_filesz < p_memsz soc: qcom: pdr: Fix error return code in pdr_register_listener firmware: qcom_scm: Fix kernel-doc function names to match firmware: qcom_scm: Suppress sysfs bind attributes firmware: qcom_scm: Workaround lack of "is available" call on SC7180 firmware: qcom_scm: Reduce locking section for __get_convention() firmware: qcom_scm: Make __qcom_scm_is_call_available() return bool Revert "soc: fsl: qe: introduce qe_io{read,write}* wrappers" ...
2021-04-26Merge tag 'staging-5.13-rc1' of ↵Linus Torvalds3-0/+309
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging/IIO driver updates from Greg KH: "Here is the big set of staging and IIO driver updates for 5.13-rc1. Lots of little churn in here, and some larger churn as well. Major things are: - removal of wimax drivers, no one has this hardware anymore for this failed "experiment". - removal of the Google gasket driver, turns out no one wanted to maintain it or cares about it anymore, so they asked for it to be removed. - comedi finally moves out of the staging directory into drivers/comedi This is one of the oldest kernel subsystems around, being created in the 2.0 kernel days, and was one of the first things added to drivers/staging/ when that was created over 15 years ago. It should have been moved out of staging a long time ago, it's well maintained and used by loads of different devices in the real world every day. Nice to see this finally happen. - so many tiny coding style cleanups it's not funny. Perfect storm of at least 2 different intern project application deadlines combined to provide a huge number of new contributions in this area from people learning how to do kernel development. Great job to everyone involved here. There's also the normal updates for IIO drivers with new IIO drivers and updates all over that subsystem. All of these have been in linux-next for a while with no reported issues" * tag 'staging-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (907 commits) staging: octeon: Use 'for_each_child_of_node' Staging: rtl8723bs: rtw_xmit: fixed tabbing issue staging: rtl8188eu: remove unused function parameters staging: rtl8188eu: cmdThread is a task_struct staging: rtl8188eu: remove constant variable and dead code staging: rtl8188eu: change bLeisurePs' type to bool staging: rtl8723bs: remove empty #ifdef block staging: rtl8723bs: remove unused DBG_871X_LEVEL macro declarations staging: rtl8723bs: split too long line staging: rtl8723bs: fix indentation in if block staging: rtl8723bs: fix code indent issue staging: rtl8723bs: replace DBG_871X_LEVEL logs with netdev_*() staging: rtl8192e: indent statement properly staging: rtl8723bs: Remove led_blink_hdl() and everything related staging: comedi: move out of staging directory staging: rtl8723bs: remove sdio_drv_priv structure staging: rtl8723bs: remove unused argument in function staging: rtl8723bs: remove DBG_871X_SEL_NL macro declaration staging: rtl8723bs: replace DBG_871X_SEL_NL with netdev_dbg() staging: rtl8723bs: fix indentation issue introduced by long line split ...
2021-04-23regulator: fan53555: Add TCS4525 DCDC supportJoseph Chen1-14/+122
TCS4525 main features: - 2.7V to 5.5V Input Voltage Range; - 3MHz Constant Switching Frequency; - 5A Available Load Current; - Programmable Output Voltage: 0.6V to 1.4V in 6.25mV Steps; - PFM/PWM Operation for Optimum Increased Efficiency; Signed-off-by: Joseph Chen <chenjh@rock-chips.com> [Ezequiel: Forward port] Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Link: https://lore.kernel.org/r/20210421210338.43819-3-ezequiel@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-23regulator: core: Fix off_on_delay handlingVincent Whitchurch1-25/+8
The jiffies-based off_on_delay implementation has a couple of problems that cause it to sometimes not actually delay for the required time: (1) If, for example, the off_on_delay time is equivalent to one jiffy, and the ->last_off_jiffy is set just before a new jiffy starts, then _regulator_do_enable() does not wait at all since it checks using time_before(). (2) When jiffies overflows, the value of "remaining" becomes higher than "max_delay" and the code simply proceeds without waiting. Fix these problems by changing it to use ktime_t instead. [Note that since jiffies doesn't start at zero but at INITIAL_JIFFIES ("-5 minutes"), (2) above also led to the code not delaying if the first regulator_enable() is called when the ->last_off_jiffy is not initialised, such as for regulators with ->constraints->boot_on set. It's not clear to me if this was intended or not, but I've preserved this behaviour explicitly with the check for a non-zero ->last_off.] Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com> Link: https://lore.kernel.org/r/20210423114524.26414-1-vincent.whitchurch@axis.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-23Merge branch 'for-5.12' of ↵Mark Brown4-32/+71
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-5.13
2021-04-22regulator: core: Respect off_on_delay at startupVincent Whitchurch1-0/+2
We currently do not respect off_on_delay the first time we turn on a regulator. This is problematic since the regulator could have been turned off by the bootloader, or it could it have been turned off during the probe of the regulator driver (such as when regulator-fixed requests the enable GPIO), either of which could potentially have happened less than off_on_delay microseconds ago before the first time a client requests for the regulator to be turned on. We can't know exactly when the regulator was turned off, but initialise off_on_delay to the current time when registering the regulator, so that we guarantee that we respect the off_on_delay in all cases. Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com> Link: https://lore.kernel.org/r/20210422083044.11479-1-vincent.whitchurch@axis.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-21Merge series "mfd/rtc/regulator: Drop board file support for Samsung PMIC" ↵Mark Brown2-24/+2
from Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>: Hi, The Samsung PMIC drivers since long time are used only on devicetree platforms (Samsung Exynos) and there are no users with board files. Drop the support for board files entirely and depend on OF for matching. This makes the code smaller and simpler. Dependencies ============ The MFD pieces are rebased on my previous sec-core dirver changes: mfd: sec: Simplify getting of_device_id match data https://lore.kernel.org/linux-samsung-soc/20210420113929.278082-1-krzysztof.kozlowski@canonical.com/T/#t Applying - can be independent ============================= The last RTC and regulator patches can be picked up independently via regulator and rtc trees. There are no board files currently, so the code in these drivers is basically dead code and feature-bisection is preserved. Best regards, Krzysztof Krzysztof Kozlowski (9): mfd: sec: Drop support for board files and require devicetree mfd: sec: Remove unused cfg_pmic_irq in platform data mfd: sec: Remove unused device_type in platform data mfd: sec: Remove unused irq_base in platform data mfd: sec: Enable wakeup from suspend via devicetree property mfd: sec: Remove unused platform data members rtc: s5m: Remove reference to parent's device pdata regulator: s2mpa01: Drop initialization via platform data regulator: s2mps11: Drop initialization via platform data drivers/mfd/Kconfig | 1 + drivers/mfd/sec-core.c | 64 +++++--------------------------- drivers/mfd/sec-irq.c | 4 +- drivers/regulator/s2mpa01.c | 4 -- drivers/regulator/s2mps11.c | 22 +---------- drivers/rtc/rtc-s5m.c | 6 --- include/linux/mfd/samsung/core.h | 33 ---------------- 7 files changed, 14 insertions(+), 120 deletions(-) -- 2.25.1
2021-04-21regulator: core.c: Improve a commentSebastian Fricke1-1/+4
s/regulator may on/regulator may already be enabled/ s/or left on/or was left on/ The aim of this patch is to make the comment more readable and to make it clear, that this is about a regulator, that is already enabled instead of a regulator that may be switched on. Signed-off-by: Sebastian Fricke <sebastian.fricke@posteo.net> Link: https://lore.kernel.org/r/20210421055236.13148-1-sebastian.fricke@posteo.net Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-21regulator: Avoid a double 'of_node_get' in 'regulator_of_get_init_node()'Christophe JAILLET1-1/+5
'for_each_available_child_of_node()' already performs an 'of_node_get()' on child, so there is no need to perform another one before returning. Otherwise, a double 'get' is performed and a resource may never be released. Fixes: 925c85e21ed8 ("regulator: Factor out location of init data OF node") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/a79f0068812b89ff412d572a1171f22109c24132.1618947049.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-21regulator: core.c: Fix indentation of commentShubhankar Kuranagatti1-7/+14
Shifted the closing */ of multiline comment to a new line This is done to maintain code uniformity Signed-off-by: Shubhankar Kuranagatti <shubhankarvk@gmail.com> Link: https://lore.kernel.org/r/20210420034718.t7wudu6xcfpahflv@kewl-virtual-machine Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-21regulator: s2mps11: Drop initialization via platform dataKrzysztof Kozlowski1-20/+2
None of the platforms with S2MPS11 use board files, so any initialization via platform data can be safely removed. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Link: https://lore.kernel.org/r/20210420170244.13467-5-krzysztof.kozlowski@canonical.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-21regulator: s2mpa01: Drop initialization via platform dataKrzysztof Kozlowski1-4/+0
None of the platforms with S2MPA01 use board files, so any initialization via platform data can be safely removed. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Link: https://lore.kernel.org/r/20210420170244.13467-4-krzysztof.kozlowski@canonical.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-21regulator: da9121: automotive variants identity fixAdam Ward2-28/+65
This patch fixes identification of DA913x parts by the DA9121 driver, where a lack of clarity lead to implementation on the basis that variant IDs were to be identical to the equivalent rated non-automotive parts. There is a new emphasis on the DT identity to cope with overlap in these ID's - this is not considered to be problematic, because projects would be exclusively using automotive or consumer grade parts. Signed-off-by: Adam Ward <Adam.Ward.opensource@diasemi.com> Link: https://lore.kernel.org/r/20210421120306.DB5B880007F@slsrvapps-01.diasemi.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-14Merge tag 'v5.12-rc7' into driver-core-nextGreg Kroah-Hartman1-4/+4
We need the driver core fix in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-14Merge tags 'ib-mfd-clk-gpio-regulator-rtc-v5.13', 'ib-mfd-extcon-v5.13', ↵Lee Jones5-16/+109
'ib-mfd-input-v5.13-1', 'ib-mfd-platform-x86-v5.13', 'ib-mfd-power-v5.13', 'ib-mfd-pwm-rtc-v5.13-1' and 'ib-regulator-list-ramp-helpers-v5.13' into ibs-for-mfd-merged Immutable branch between MFD, Clock, GPIO, Regulator and RTC due for the v5.13 merge window Immutable branch between MFD and Extcon due for the v5.13 merge window Immutable branch between MFD and Input due for the v5.13 merge window Immutable branch between MFD and Platform/x86 due for the v5.13 merge window Immutable branch between MFD and Power due for the v5.13 merge window Immutable branch between MFD, PWM and RTC due for the v5.13 merge window
2021-04-14regulator: Support ROHM BD71815 regulatorsMatti Vaittinen3-0/+664
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-14regulator: bd718x7, bd71828: Use ramp-delay helperMatti Vaittinen2-66/+45
Use generic regamp ramp-delay helper function instead of implementing own. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2021-04-14regulator: rohm-regulator: Support SNVS HW state.Matti Vaittinen1-0/+6
The ROHM BD71815 supports setting voltage levels/regulator status for HW-states "RUN", "SUSPEND", "LPSR" and "SNVS". Add DT parsing helper also for SNVS state. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2021-04-14regulator: rohm-regulator: linear voltage supportMatti Vaittinen1-2/+15
The helper for obtaining HW-state based DVS voltage levels currently only works for regulators using linear-ranges. Extend support to regulators with simple linear mappings and add also proper error path if pickable-ranges regulators call this. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2021-04-02Merge series "Support ROHM BD71815 PMIC" from Matti Vaittinen ↵Mark Brown2-9/+94
<matti.vaittinen@fi.rohmeurope.com>: Patch series introducing support for ROHM BD71815 PMIC ROHM BD71815 is a power management IC used in some battery powered systems. It contains regulators, GPO(s), charger + coulomb counter, RTC and a clock gate. All regulators can be controlled via I2C. LDO4 can additionally be set to be enabled/disabled by a GPIO. LDO3 voltage could be selected from two voltages written into separate VSEL reisters using GPIO but this mode is not supported by driver. On top of that the PMIC has the typical HW state machine which is present also on many other ROHM PMICs. IC contains two GPOs - but one of the GPOs is marked as GND in data-sheet. Thus the driver by default only exposes one GPO. The second GPO can be enabled by special DT property. RTC is almost similar to what is on BD71828. For currently used features only the register address offset to RTC block differs. The charger driver is not included in this series. ROHM has a charger driver with some fuel-gauging logig written in but this is not included here. I am working on separating the logic from HW specific driver and supporting both BD71815 and BD71828 chargers in separate patch series. Changelog v5: Regulator: - Added regmap helper for regulator ramp-delay and taken it in use (patches 13, 14, 16 - they can be just dropped if ramp-delay helper is not a good idea. Patch 15 implements old-fashioned ramp-delay) GPIO: - styling changes to GPIO (Mostly suggested by Andy) - implemented init_valid_mask (but can't count on it yet) Changelog v4: - Sorted ROHM chip ID enum - Statcized DVS structures in regulator driver - Minor styling for regulator driver - rebased on v5.12-rc4 Changelog v3: - GPIO clean-up as suggested by Bartosz - MFD clean-up as suggested by Lee - clk-mode dt-binding handling in MFD driver corrected to reflect new property values. - Dropped already applied patches - Rebased on v5.12-rc2 Changelog v2: - Rebased on top of v5.11-rc3 - Added another "preliminary patch" which fixes HW-dvs voltage handling (patch 1) - split regulator patch to two. - changed dt-binding patch ordering. regulators: - staticized probe - removed some unnecessary defines - updated comments - split rohm-regulator patch adding SNVS and supporting simple linear mapping into two - one adding support for mapping, other adding SNVS. GPIO: - removed unnecessary headers - clarified dev/parent->dev usage - removed forgotten #define DEBUG dt-bindings: - changed patch order to meet ref-dependencies - added missing regulator nodes - changed string property for clk mode to tristated MFD: - header cleanups. CLK: - fixed commit message -- Matti Vaittinen (19): rtc: bd70528: Do not require parent data mfd: bd718x7: simplify by cleaning unnecessary device data dt_bindings: bd71828: Add clock output mode dt_bindings: regulator: Add ROHM BD71815 PMIC regulators dt_bindings: mfd: Add ROHM BD71815 PMIC mfd: Add ROHM BD71815 ID mfd: Sort ROHM chip ID list for better readability mfd: Support for ROHM BD71815 PMIC core gpio: support ROHM BD71815 GPOs regulator: helpers: Export helper voltage listing regulator: rohm-regulator: linear voltage support regulator: rohm-regulator: Support SNVS HW state. regulator: Add regmap helper for ramp-delay setting regulator: bd718x7, bd71828: Use ramp-delay helper regulator: Support ROHM BD71815 regulators regulator: bd71815: use ramp-delay helper clk: bd718x7: Add support for clk gate on ROHM BD71815 PMIC rtc: bd70528: Support RTC on ROHM BD71815 MAINTAINERS: Add ROHM BD71815AGW .../bindings/mfd/rohm,bd71815-pmic.yaml | 201 ++++++ .../bindings/mfd/rohm,bd71828-pmic.yaml | 6 + .../regulator/rohm,bd71815-regulator.yaml | 116 ++++ MAINTAINERS | 3 + drivers/clk/clk-bd718x7.c | 9 +- drivers/gpio/Kconfig | 10 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-bd71815.c | 193 ++++++ drivers/mfd/Kconfig | 15 +- drivers/mfd/rohm-bd71828.c | 486 +++++++++---- drivers/mfd/rohm-bd718x7.c | 43 +- drivers/regulator/Kconfig | 11 + drivers/regulator/Makefile | 1 + drivers/regulator/bd71815-regulator.c | 651 ++++++++++++++++++ drivers/regulator/bd71828-regulator.c | 51 +- drivers/regulator/bd718x7-regulator.c | 60 +- drivers/regulator/helpers.c | 101 ++- drivers/regulator/rohm-regulator.c | 23 +- drivers/rtc/Kconfig | 6 +- drivers/rtc/rtc-bd70528.c | 104 +-- include/linux/mfd/rohm-bd71815.h | 562 +++++++++++++++ include/linux/mfd/rohm-bd71828.h | 3 + include/linux/mfd/rohm-bd718x7.h | 13 - include/linux/mfd/rohm-generic.h | 15 +- include/linux/regulator/driver.h | 7 + 25 files changed, 2393 insertions(+), 298 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/rohm,bd71815-pmic.yaml create mode 100644 Documentation/devicetree/bindings/regulator/rohm,bd71815-regulator.yaml create mode 100644 drivers/gpio/gpio-bd71815.c create mode 100644 drivers/regulator/bd71815-regulator.c create mode 100644 include/linux/mfd/rohm-bd71815.h base-commit: 0d02ec6b3136c73c09e7859f0d0e4e2c4c07b49b -- 2.25.4 -- Matti Vaittinen, Linux device drivers ROHM Semiconductors, Finland SWDC Kiviharjunlenkki 1E 90220 OULU FINLAND ~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~ Simon says - in Latin please. ~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~ Thanks to Simon Glass for the translation =]
2021-04-02regulator: Add regmap helper for ramp-delay settingMatti Vaittinen1-0/+65
Quite a few regulator ICs do support setting ramp-delay by writing a value matching the delay to a ramp-delay register. Provide a simple helper for table-based delay setting. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Link: https://lore.kernel.org/r/f101f1db564cf32cb58719c77af0b00d7236bb89.1617020713.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-02regulator: helpers: Export helper voltage listingMatti Vaittinen1-8/+28
Some drivers need to translate voltage values to selectors prior regulator registration. Currently a regulator_desc based list_voltages helper is only exported for regulators using the linear_ranges. Export similar helper also for regulators using simple linear mapping. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Link: https://lore.kernel.org/r/1200ef7a50c84327ada019b85f6527b4fc9b5ce1.1617020713.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-02regulator: hi6421v600-regulator: move it from stagingMauro Carvalho Chehab3-0/+309
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-01regulator: qcom-rpmh: Add PM7325/PMR735A regulator supportsatya priya1-1/+52
Add support for PM7325/PMR735A regulators. This ensures that consumers are able to modify the physical state of PMIC regulators. Signed-off-by: satya priya <skakit@codeaurora.org> Reviewed-by: Matthias Kaehlcke <mka@chromium.org> Link: https://lore.kernel.org/r/1617192339-3760-3-git-send-email-skakit@codeaurora.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-01regulator: qcom-rpmh: Add pmic5_ftsmps520 bucksatya priya1-0/+9
Add pmic5_ftsmps520 buck as this is required for PM7325 and PMR735A PMICs. Signed-off-by: satya priya <skakit@codeaurora.org> Reviewed-by: Matthias Kaehlcke <mka@chromium.org> Link: https://lore.kernel.org/r/1617192339-3760-2-git-send-email-skakit@codeaurora.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-30regulator: scmi: Port driver to the new scmi_voltage_proto_ops interfaceCristian Marussi1-19/+23
Port the scmi regulator driver to the new SCMI voltage interface based on protocol handles and common devm_get_ops(). Link: https://lore.kernel.org/r/20210316124903.35011-30-cristian.marussi@arm.com Cc: Mark Brown <broonie@kernel.org> Tested-by: Florian Fainelli <f.fainelli@gmail.com> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Cristian Marussi <cristian.marussi@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2021-03-24regulator: mt6360: remove redundant error printJian Dong1-3/+1
fixes coccicheck warning: drivers/regulator/mt6360-regulator.c:384:3-10: line 384 is redundant because platform_get_irq() already prints an error in fact it is not platform_get_irq but platform_get_irq_byname print error Signed-off-by: Jian Dong <dongjian@yulong.com> Link: https://lore.kernel.org/r/1616555474-158789-1-git-send-email-dj0227@163.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-23regulator: qcom_spmi-regulator: Clean-up by using managed work initMatti Vaittinen1-26/+8
Few drivers implement remove call-back only for ensuring a delayed work gets cancelled prior driver removal. Clean-up these by switching to use devm_delayed_work_autocancel() instead. Additionally, this helps avoiding mixing devm and manual resource management and cleans up a (theoretical?) bug where devm managed over-current IRQ might schedule a new work item after wq was cleaned at remove(). This change is compile-tested only. All testing is appreciated. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Link: https://lore.kernel.org/r/3bd35bb43257f4bf5b99f75d207ed5e1e08d1d38.1616506559.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-15regulator: bd9576: Fix return from bd957x_probe()Dan Carpenter1-7/+4
The probe() function returns an uninitialized variable in the success path. There is no need for the "err" variable at all, just delete it. Fixes: b014e9fae7e7 ("regulator: Support ROHM BD9576MUF and BD9573MUF") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Link: https://lore.kernel.org/r/YEsbfLJfEWtnRpoU@mwanda Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-15regulator: bd9571mwv: Convert device attribute to sysfs_emit()Geert Uytterhoeven1-1/+1
Convert the "backup_mode" device attribute from sprintf() to sysfs_emit(), as the latter is aware of the PAGE_SIZE buffer. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20210312130242.3390038-4-geert+renesas@glider.be Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-15regulator: bd9571mwv: Fix regulator name printed on registration failureGeert Uytterhoeven1-1/+1
If a regulator fails to register, the driver prints an error message like: bd9571mwv-regulator bd9571mwv-regulator.6.auto: failed to register bd9571mwv-regulator regulator However, the platform device's name is already printed as part of dev_err(), and does not allow the user to distinguish among the various regulators that are part of the PMIC. Fix this by printing regulator_desc.name instead, to change the message like: bd9571mwv-regulator bd9571mwv-regulator.6.auto: failed to register DVFS regulator Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Link: https://lore.kernel.org/r/20210312130242.3390038-3-geert+renesas@glider.be Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-15regulator: bd9571mwv: Fix AVS and DVFS voltage rangeGeert Uytterhoeven1-2/+2
According to Table 30 ("DVFS_MoniVDAC [6:0] Setting Table") in the BD9571MWV-M Datasheet Rev. 002, the valid voltage range is 600..1100 mV (settings 0x3c..0x6e). While the lower limit is taken into account (by setting regulator_desc.linear_min_sel to 0x3c), the upper limit is not. Fix this by reducing regulator_desc.n_voltages from 0x80 to 0x6f. Fixes: e85c5a153fe237f2 ("regulator: Add ROHM BD9571MWV-M PMIC regulator driver") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20210312130242.3390038-2-geert+renesas@glider.be Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-11regulator: mt6315: Fix off-by-one for .n_voltagesAxel Lin1-1/+1
The valid selector is 0 ~ 0xbf, so the .n_voltages should be 0xc0. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210311020558.579597-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10regulator: add missing call to of_node_put()Yang Li1-1/+3
In one of the error paths of the for_each_child_of_node() loop, add missing call to of_node_put(). Fix the following coccicheck warning: ./drivers/regulator/scmi-regulator.c:343:1-23: WARNING: Function "for_each_child_of_node" should have of_node_put() before return around line 347. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Link: https://lore.kernel.org/r/1614303575-27436-1-git-send-email-yang.lee@linux.alibaba.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10regulator: pf8x00: Use regulator_map_voltage_ascend for pf8x00_buck7_opsAxel Lin1-0/+1
The voltages in pf8x00_sw7_voltages are in ascendant order, so use regulator_map_voltage_ascend. Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Adrien Grassein <adrien.grassein@gmail.com> Link: https://lore.kernel.org/r/20210216060128.126938-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10regulator: spmi: Add support for ULT LV_P50 and ULT P300AngeloGioacchino Del Regno1-0/+2
The ULT LV_P50 shares the same configuration as the other ULT LV_Pxxx and the ULT P300 shares the same as the other ULT Pxxx. These two regulator types are found on PM8950 and its variants. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org> Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org> Link: https://lore.kernel.org/r/20210225213514.117031-1-konrad.dybcio@somainline.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10regulator: rt4831: Fix return value check in rt4831_regulator_probe()Wei Yongjun1-2/+2
In case of error, the function dev_get_regmap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 9351ab8b0cb6 ("regulator: rt4831: Adds support for Richtek RT4831 DSV regulator") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Link: https://lore.kernel.org/r/20210305034930.3236099-1-weiyongjun1@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10regulator: pca9450: Clear PRESET_EN bit to fix BUCK1/2/3 voltage settingFrieder Schrempf1-0/+8
The driver uses the DVS registers PCA9450_REG_BUCKxOUT_DVS0 to set the voltage for the buck regulators 1, 2 and 3. This has no effect as the PRESET_EN bit is set by default and therefore the preset values are used instead, which are set to 850 mV. To fix this we clear the PRESET_EN bit at time of initialization. Fixes: 0935ff5f1f0a ("regulator: pca9450: add pca9450 pmic driver") Cc: <stable@vger.kernel.org> Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de> Link: https://lore.kernel.org/r/20210222115229.166620-1-frieder.schrempf@kontron.de Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10regulator: qcom-rpmh: Use correct buck for S1C regulatorsatya priya1-1/+1
Use correct buck, that is, pmic5_hfsmps515 for S1C regulator of PM8350C PMIC. Signed-off-by: satya priya <skakit@codeaurora.org> Link: https://lore.kernel.org/r/1614155592-14060-7-git-send-email-skakit@codeaurora.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10regulator: qcom-rpmh: Correct the pmic5_hfsmps515 bucksatya priya1-2/+2
Correct the REGULATOR_LINEAR_RANGE and n_voltges for pmic5_hfsmps515 buck. Signed-off-by: satya priya <skakit@codeaurora.org> Link: https://lore.kernel.org/r/1614155592-14060-4-git-send-email-skakit@codeaurora.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10regulator: pca9450: Fix return value when failing to get sd-vsel GPIOFrieder Schrempf1-1/+1
This fixes the return value of pca9450_i2c_probe() to use the correct error code when getting the sd-vsel GPIO fails. Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de> Link: https://lore.kernel.org/r/20210222150809.208942-1-frieder.schrempf@kontron.de Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10regulator: mt6315: Return REGULATOR_MODE_INVALID for invalid modeAxel Lin1-1/+1
-EINVAL is not a valid return value for .of_map_mode, return REGULATOR_MODE_INVALID instead. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210215034813.45510-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-22Merge tag 'mfd-next-5.12' of ↵Linus Torvalds1-25/+34
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "Core Frameworks: - Standardise MFD_CELL_* helpers New Drivers: - Add support for Acer Iconia Tab A500 Embedded Controller New Device Support: - Add support for ROHM BD9574MWF to BD9571MWV - Add support for Intel Alder Lake PCH-P PCI to LPSS - Add support for Intel Alder Lake PCH-S PCI to LPSS New Functionality: - Support ACPI enumeration; arizona Fix-ups: - Managed resources; bd9571mwv - DT additions/fix-ups; bd9571mwv, iqs62x, max8997, gateworks-gsc, ene-kb930 - Convert to SPDX; bd9571mw - Fix return values/error handling; sunxi - Provide SOFTDEP; arizona - Make use of DIV_ROUND_UP; mcp-sa11x0 - Use generic APIs; arizona - Add MAC address sysfs entries; intel-m10-bmc - Trivial: Coding-style fix-ups; iqs62x - Trivial: Remove superflouous code; iqs62x - Clear-up naming conventions; iqs62x Bug Fixes: - Fix 'pointer from integer' error; altera-sysmgr - Convert SGI_MFD_IOC3 from tristate to bool; Kconfig - Fix interrupt handling; gateworks-gsc - Extend required delay; iqs62x - Do not use I2C polling during calibration; iqs62x - Do no adjust clock frequency during calibration; iqs62x - Fix use-after-free; wm831x-auxad" * tag 'mfd-next-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (32 commits) mfd: wm831x-auxadc: Prevent use after free in wm831x_auxadc_read_irq() mfd: iqs62x: Do not change clock frequency during ATI mfd: iqs62x: Do not poll during ATI mfd: iqs62x: Increase interrupt handler return delay mfd: iqs62x: Rename regmap_config struct mfd: iqs62x: Remove unused bit mask mfd: iqs62x: Remove superfluous whitespace above fallthroughs mfd: intel-lpss: Add Intel Alder Lake PCH-S PCI IDs mfd: intel-m10-bmc: Expose MAC address and count mfd: Add driver for Embedded Controller found on Acer Iconia Tab A500 dt-bindings: mfd: Add ENE KB930 Embedded Controller binding dt-bindings: mfd: gateworks-gsc: Add fan-tach mode mfd: intel-lpss: Add Intel Alder Lake PCH-P PCI IDs mfd: gateworks-gsc: Fix interrupt type mfd: Standardise MFD_CELL_* helper names mfd: mcp-sa11x0: Use DIV_ROUND_UP to calculate rw_timeout mfd: max8997: Add of_compatible to Extcon and Charger mfd_cell dt-bindings: mfd: Correct the node name of the panel LED mfd: sgi-ioc3: Turn Kconfig option into a bool mfd: altera-sysmgr: Fix physical address storing more ...
2021-02-12Merge remote-tracking branch 'regulator/for-5.12' into regulator-nextMark Brown20-1273/+2442
2021-02-12regulator: bd718x7, bd71828, Fix dvs voltage levelsMatti Vaittinen1-3/+6
The ROHM BD718x7 and BD71828 drivers support setting HW state specific voltages from device-tree. This is used also by various in-tree DTS files. These drivers do incorrectly try to compose bit-map using enum values. By a chance this works for first two valid levels having values 1 and 2 - but setting values for the rest of the levels do indicate capability of setting values for first levels as well. Luckily the regulators which support setting values for SUSPEND/LPSR do usually also support setting values for RUN and IDLE too - thus this has not been such a fatal issue. Fix this by defining the old enum values as bits and fixing the parsing code. This allows keeping existing IC specific drivers intact and only slightly changing the rohm-regulator.c Fixes: 21b72156ede8b ("regulator: bd718x7: Split driver to common and bd718x7 specific parts") Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Acked-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20210212080023.GA880728@localhost.localdomain Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-11regulator: pca9450: Enable system reset on WDOG_B assertionFrieder Schrempf1-0/+8
By default the PCA9450 doesn't handle the assertion of the WDOG_B signal, but this is required to guarantee that things like software resets triggered by the watchdog work reliably. As we don't want to rely on the bootloader to enable this, we tell the PMIC to issue a cold reset in case the WDOG_B signal is asserted (WDOG_B_CFG = 10), just as the NXP U-Boot code does. Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de> Link: https://lore.kernel.org/r/20210211105534.38972-3-frieder.schrempf@kontron.de Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-11regulator: pca9450: Add SD_VSEL GPIO for LDO5Frieder Schrempf1-0/+14
LDO5 has two separate control registers. LDO5CTRL_L is used if the input signal SD_VSEL is low and LDO5CTRL_H if it is high. The current driver implementation only uses LDO5CTRL_H. To make this work on boards that have SD_VSEL connected to a GPIO, we add support for specifying an optional GPIO and setting it to high at probe time. In the future we might also want to add support for boards that have SD_VSEL set to a fixed low level. In this case we need to change the driver to be able to use the LDO5CTRL_L register. Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de> Link: https://lore.kernel.org/r/20210211105534.38972-1-frieder.schrempf@kontron.de Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-11regulator: qcom-rpmh: fix pm8009 ldo7Jonathan Marek1-1/+1
Use the correct name to avoid ldo7 commands being sent to ldo6's address. Fixes: 06369bcc15a1 ("regulator: qcom-rpmh: Add support for SM8150") Signed-off-by: Jonathan Marek <jonathan@marek.ca> Reviewed-by: Vinod Koul <vkoul@kernel.org> Link: https://lore.kernel.org/r/20210211034935.5622-1-jonathan@marek.ca Signed-off-by: Mark Brown <broonie@kernel.org>