Remove nxp_ground_select property.
Delete the use of NXP vref peripheral CSR register REFL_GRL_SEL bit.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
For DA1469x if PM config is selected PM_DEVICE must also
be selected for GPIO to work when device enters/exists
deep sleep.
Previously GPIO and regulator drivers selected PM_DEVICE
when PM was enabled.
Now it is moved to SOC instead.
PM_DEVICE selection in GPIO could result in circular dependency
for mcux if MEMC_MCUX_FLEXSPI (which is already dependent on PM_DEVICE)
was to be additionally dependent on GPIO.
Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
This patch fixes a compiler warning about the val being used
uninitialized. The previously present if check did not seem to satisfy
compiler. Hence the val is now explictly initialized.
Signed-off-by: Balaji Srinivasan <balaji.srinivasan@nordicsemi.no>
Bug in "enable/disable" argument parsing would cause
the oppostive of the requested setting to get
passed to active discharge API invocation.
Signed-off-by: Mike J. Chen <mjchen@google.com>
Previously only the upper/first 3 digits of a micro value
would be printed, dropping the last 3 digits. This could cause
misleading output for cmds like vlist.
Signed-off-by: Mike J. Chen <mjchen@google.com>
Argument to FIELD_GET macro was mixed up resulting in
incorrect values being reported for voltage and current
Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
Adds a handler to check error flag bits. This should be called
by applications that call regulator_enable and receive -EINVAL
as a return.
Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
Adds support for the PGOOD pin. This pin is asserted by the
regulator when converter startup has completed and the output
is stable. If the PGOOD pin is not used, the PGOOD state is
check via the PGOOD_PIN_STS bit.
Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
Enables the converter via I2C as the else case when the EN pin
conditional fails. This used to not matter as no code followed,
but this will change in subsequent patches.
Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
This change restore DCDC configuration after system resumes.
When CONFIG_PM_DEVICE is enabled each of the four rails that
support DCDC handle resume in regulator_da1469x_pm_action function.
Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
Removes conditional calling k_busy_wait() on single threaded
systems and uses k_sleep for both single and multi threaded
systems.
Commit e375d82 ("kernel: Implement k_sleep for Single Thread")
eliminated the need to call k_busy_wait() on single threaded
systems in place of k_sleep.
Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
Removes conditional calling k_busy_wait() on single threaded
systems and uses k_sleep for both single and multi threaded
systems.
Commit e375d82 ("kernel: Implement k_sleep for Single Thread")
eliminated the need to call k_busy_wait() on single threaded
systems in place of k_sleep.
Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
Configures and initializes the EN GPIO to inactive prior
to calling the soft reset sequence during probe. The EN
pin may have been left asserted by the hardware on some systems.
Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
Added is_enabled devicetree property to fake regulator.
Allows testing of init behaviour when regulator is enabled
in hardware.
Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
Adds support for the CP9314 switched capacitor converter. The
CP9314 is a multi-level DC/DC converter capable of operating in
2:1 and 3:1 modes.
Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
Add an active discharge api for regulators. This uses the already
existing but previously unused regulator-active-discharge
property.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
There can be a case where not all regulators are being used,
resulting in an unused-const-variable warning,
so let's add a __maybe_unused keyword to suppress it.
Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
The setting of initial state in handled by the common driver,
which calls the enable function for any regulator that has
regulator-boot-on set, and is not already enabled.
Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
Reference counting was broken when adding the enable delay.
Now reverted to previous pattern.
Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
This add regulator driver for Smartbond DA1469X SOC.
Driver can control VDD, V14, V18, V18P, V30 rails,
full voltage range supported by SOC is covered.
For VDD, V14, V18, V18P DCDC can be configured.
Special VDD_CLAMP (always on) and VDD_SLEPP are added
to allow configuration of VDD in sleep modes.
Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
Do not enable subsystem/driver shell modules by default and stop abusing
CONFIG_SHELL_MINIMAL, which is internal to the shell subsystem, to decide
when to enable a driver shell.
The list of shell modules has grown considerably through the
years. Enabling CONFIG_SHELL for doing e.g. an interactive debug session
leads to a large number of shell modules also being enabled unless
explicitly disabled, which again leads to non-negligible increases in
RAM/ROM usage.
This commit attempts to establish a policy of subsystem/driver shell
modules being disabled by default, requiring the user/application to
explicitly enable only those needed.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
A configurable delay during regulator switch on is currently
only supported by the GPIO and fixed regulator drivers.
This functionality has been moved to the common driver, so it can
be easily added to any regulator driver.
Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
The load switch / LDO pin configuration function now
correctly configures the associated GPIO pin.
Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
Added boot state detection, so that the reference count is
set correctly and enable/disable work as expected.
With this fix it is no longer necessary to set
regulator-boot-on when the regulator is enabled in hardware.
Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
Add a new `clist` regulator shell subcommand that prints
the list of supported current limits for specified regulator device.
Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
Adds support for using the fixed and GPIO regulator drivers when
multithreading is disabled, such as in MCUboot.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Add binding, include header, and driver for NXP VREF IP block.
NXP VREF is an internal voltage reference generator on some SOCs
that fits well with the regulator API in zephyr.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Regulator voltage setting is not applied if the device output
is already configured for the requested voltage.
This change is needed to ensure correct device behaviour.
Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
AXP192 is a small power management IC, that also
features 5 GPIOS.
Besides GPIO driver this commit also includes needed modifications
in axp192 regulator and mfd driver as LDOIO0 functioanlity
is multiplexed with GPIO0 pin.
Signed-off-by: Martin Kiepfer <mrmarteng@teleschirm.org>