summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/pca9450-regulator.c
Commit message (Collapse)AuthorAgeFilesLines
* regulator: Explicitly include correct DT includesRob Herring2023-07-141-1/+0
| | | | | | | | | | | | | | | The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20230714174930.4063320-1-robh@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: Merge up fixesMark Brown2023-05-251-2/+2
|\ | | | | | | So we can base some new debugfs work on it.
| * regulator: pca9450: Fix BUCK2 enable_maskAlexander Stein2023-05-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | This fixes a copy & paste error. No functional change intended, BUCK1_ENMODE_MASK equals BUCK2_ENMODE_MASK. Fixes: 0935ff5f1f0a ("regulator: pca9450: add pca9450 pmic driver") Originally-from: Robin Gong <yibin.gong@nxp.com Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de Link: https://lore.kernel.org/r/20230512081935.2396180-1-alexander.stein@ew.tq-group.com Signed-off-by: Mark Brown <broonie@kernel.org
* | regulator: Switch i2c drivers back to use .probe()Uwe Kleine-König2023-05-081-1/+1
|/ | | | | | | | | | | | After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de Link: https://lore.kernel.org/r/20230505220218.1239542-1-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org
* regulator: Set PROBE_PREFER_ASYNCHRONOUS for drivers between 5.4 and 5.10Douglas Anderson2023-03-201-0/+1
| | | | | | | | | | This follows on the change ("regulator: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in 4.14") but changes regulators didn't exist in Linux 5.4 but did exist in Linux 5.10. Signed-off-by: Douglas Anderson <dianders@chromium.org> Link: https://lore.kernel.org/r/20230316125351.4.I01f21c98901641a009890590ddc1354c0f294e5e@changeid Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: pca9450-regulator: Convert to i2c's .probe_new()Uwe Kleine-König2022-11-221-3/+2
| | | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-for-MFD-by: Lee Jones <lee@kernel.org> Acked-for-Backlight-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-553-uwe@kleine-koenig.org Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: pca9450: Enable DVS control via PMIC_STBY_REQRickard x Andersson2022-05-031-0/+8
| | | | | | | | | | | When DVS is enabled via the devicetree properties "nxp,dvs-run-voltage" and "nxp,dvs-standby-voltage" then also the bit that enables DVS control via PMIC_STBY_REQ pin should be set. Signed-off-by: Rickard x Andersson <rickaran@axis.com> Link: https://lore.kernel.org/r/20220429072211.24957-5-rickaran@axis.com Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: pca9450: Make warm reset on WDOG_B assertionRickard x Andersson2022-05-031-1/+7
| | | | | | | | | | | | The default configuration of the PMIC behavior makes the PMIC power cycle most regulators on WDOG_B assertion. This power cycling causes the memory contents of OCRAM to be lost. Some systems neeeds some memory that survives reset and reboot, therefore this patch is created. Signed-off-by: Rickard x Andersson <rickaran@axis.com> Link: https://lore.kernel.org/r/20220429072211.24957-4-rickaran@axis.com Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: pca9450: Make I2C Level Translator configurablePer-Daniel Olsson2022-05-031-0/+11
| | | | | | | | | | | Make the I2C Level Translator included in PCA9450 configurable from devicetree. The reset state is off. By setting nxp,i2c-lt-enable, the I2C Level Translator will be enabled while in STANDBY or RUN state. Signed-off-by: Per-Daniel Olsson <perdo@axis.com> Signed-off-by: Rickard x Andersson <rickaran@axis.com> Link: https://lore.kernel.org/r/20220429072211.24957-2-rickaran@axis.com Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: pca9450: Convert to use regulator_set_ramp_delay_regmapAxel Lin2021-06-011-27/+24
| | | | | | | | Use regulator_set_ramp_delay_regmap instead of open-coded. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210526122408.78156-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: pca9450: Clear PRESET_EN bit to fix BUCK1/2/3 voltage settingFrieder Schrempf2021-03-101-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>
* regulator: pca9450: Fix return value when failing to get sd-vsel GPIOFrieder Schrempf2021-03-101-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>
* regulator: pca9450: Enable system reset on WDOG_B assertionFrieder Schrempf2021-02-111-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>
* regulator: pca9450: Add SD_VSEL GPIO for LDO5Frieder Schrempf2021-02-111-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>
* regulator: pca9450: Constify static regulator_opsRikard Falkeborn2020-09-141-3/+3
| | | | | | | | | | The only usages of these is to assign their address to the ops field in the regulator_desc struct, which is a const pointer. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Link: https://lore.kernel.org/r/20200913084114.8851-5-rikard.falkeborn@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: pca9450: Convert to use module_i2c_driverAxel Lin2020-07-271-11/+1
| | | | | | | | Use module_i2c_driver to simplify driver init boilerplate. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20200725014414.1825183-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: pca9450: add pca9450 pmic driverRobin Gong2020-07-061-0/+843
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>