dt-bindings: regulator: Add property for I2C level shifter
Subsystems (2)
PATCH 1/5 dt-bindings: regulator: Add property for I2C level shifter
From: Per-Daniel Olsson <[email protected]>
By setting nxp,i2c-lt-enable the I2C level translator is enabled.
--- .../devicetree/bindings/regulator/nxp,pca9450-regulator.yaml | 5 +++++ 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml +5 -0
@@ -92,6 +92,11 @@ properties: LDO5CTRL_L or LDO5CTRL_H register. Use this if the SD_VSEL signal is connected to a host GPIO. + nxp,i2c-lt-enable: + type: boolean + description: + Indicates that the I2C Level Translator is used. + required: - compatible - reg
Signature · 1 line
2.20.1
PATCH 2/5 regulator: pca9450: Make I2C Level Translator configurable
From: Per-Daniel Olsson <[email protected]>
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.
--- drivers/regulator/pca9450-regulator.c | 11 +++++++++++ include/linux/regulator/pca9450.h | 7 +++++++ 2 files changed, 18 insertions(+)
drivers/regulator/pca9450-regulator.c +11 -0
@@ -810,6 +810,17 @@ static int pca9450_i2c_probe(struct i2c_client *i2c,return ret; } +if (of_property_read_bool (i2c->dev.of_node,"nxp,i2c-lt-enable" )) { +/* Enable I2C Level Translator */ + ret =regmap_update_bits (pca9450->regmap,PCA9450_REG_CONFIG2 , +I2C_LT_MASK ,I2C_LT_ON_STANDBY_RUN ); +if (ret) { +dev_err (&i2c->dev, +"Failed to enable I2C level translator\n" ); +return ret; + } + } +/* * The driver uses the LDO5CTRL_H register to control the LDO5 regulator. * This is only valid if the SD_VSEL input of the PMIC is high. Let's
include/linux/regulator/pca9450.h +7 -0
@@ -226,4 +226,11 @@ enum {#define WDOG_B_CFG_COLD_LDO12 0x80#define WDOG_B_CFG_COLD 0xC0 +/* PCA9450_REG_CONFIG2 bits */ +#define I2C_LT_MASK 0x03 +#define I2C_LT_FORCE_DISABLE 0x00 +#define I2C_LT_ON_STANDBY_RUN 0x01 +#define I2C_LT_ON_RUN 0x02 +#define I2C_LT_FORCE_ENABLE 0x03 +#endif /* __LINUX_REG_PCA9450_H__ */
Signature · 1 line
2.20.1
PATCH 3/5 dt-bindings: regulator: Add property for WDOG_B warm reset
In reply to Rickard AnderssonFrom: Rickard x Andersson <[email protected]>
Make it possible to do warm reset on WDOG_B assertion.
--- .../bindings/regulator/nxp,pca9450-regulator.yaml | 6 ++++++ 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml +6 -0
@@ -97,6 +97,12 @@ properties: description: Indicates that the I2C Level Translator is used. + nxp,wdog_b-warm-reset: + type: boolean + description: + When WDOG_B signal is asserted a warm reset will be done instead of cold + reset. + required: - compatible - reg
Signature · 1 line
2.20.1
PATCH 4/5 regulator: pca9450: Make warm reset on WDOG_B assertion
In reply to Rickard AnderssonFrom: Rickard x Andersson <[email protected]>
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.
--- drivers/regulator/pca9450-regulator.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/regulator/pca9450-regulator.c +7 -1
@@ -702,6 +702,7 @@ static int pca9450_i2c_probe(struct i2c_client *i2c,struct regulator_config config = { };struct pca9450 *pca9450;unsigned int device_id, i; +unsigned int reset_ctrl;int ret;if (!i2c->irq) {
@@ -802,9 +803,14 @@ static int pca9450_i2c_probe(struct i2c_client *i2c,return ret; } +if (of_property_read_bool (i2c->dev.of_node,"nxp,wdog_b-warm-reset" )) + reset_ctrl =WDOG_B_CFG_WARM ; +else + reset_ctrl =WDOG_B_CFG_COLD_LDO12 ; +/* Set reset behavior on assertion of WDOG_B signal */ ret =regmap_update_bits (pca9450->regmap,PCA9450_REG_RESET_CTRL , -WDOG_B_CFG_MASK ,WDOG_B_CFG_COLD_LDO12 ); +WDOG_B_CFG_MASK , reset_ctrl);if (ret) {dev_err (&i2c->dev,"Failed to set WDOG_B reset behavior\n" );return ret;
Signature · 1 line
2.20.1
PATCH 5/5 regulator: pca9450: Enable DVS control via PMIC_STBY_REQ
In reply to Rickard AnderssonFrom: Rickard x Andersson <[email protected]>
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.
--- drivers/regulator/pca9450-regulator.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/regulator/pca9450-regulator.c +8 -0
@@ -174,6 +174,14 @@ static int buck_set_dvs(const struct regulator_desc *desc, } } +if (ret ==0 ) { +struct pca9450_regulator_desc *regulator =container_of (desc, + struct pca9450_regulator_desc, desc); + +/* Enable DVS control through PMIC_STBY_REQ for this BUCK */ + ret =regmap_update_bits (regmap, regulator->desc.enable_reg, +BUCK1_DVS_CTRL ,BUCK1_DVS_CTRL ); + }return ret; }
Signature · 1 line
2.20.1
Mark Brown
maintainerQuoted 7 lines · Rickard Andersson
From: Per-Daniel Olsson <[email protected]>
By setting nxp,i2c-lt-enable the I2C level translator is enabled.
Signed-off-by Per-Daniel Olsson <[email protected]>---
You've not provided a Signed-off-by for this so I can't do anything with it, please see Documentation/process/submitting-patches.rst for details on what this is and why it's important.
Mark Brown
maintainerRe: (subset) [PATCH 1/5] dt-bindings: regulator: Add property for I2C level shifter
In reply to Rickard AnderssonQuoted 6 lines · Rickard Andersson
From: Per-Daniel Olsson <[email protected]>
By setting nxp,i2c-lt-enable the I2C level translator is enabled.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
Thanks!
[3/5] dt-bindings: regulator: Add property for WDOG_B warm reset
(no commit info)
[4/5] regulator: pca9450: Make warm reset on WDOG_B assertion
commit: 2364a64d0673f5044e6a52cb17d6d60c6f1f8329
[5/5] regulator: pca9450: Enable DVS control via PMIC_STBY_REQ
commit: 20078e3bbe6e5adb1a88f03f9609d532d99c690cAll being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark