From: Benjamin Bara <bbara93@gmail.com>
To: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
support.opensource@diasemi.com
Cc: DLG-Adam.Ward.opensource@dm.renesas.com,
linux-kernel@vger.kernel.org,
Matti Vaittinen <mazziesaccount@gmail.com>,
Benjamin Bara <benjamin.bara@skidata.com>
Subject: [PATCH RFC v2 2/2] regulator: da9063: disable monitoring while regulator is off
Date: Fri, 21 Apr 2023 11:13:07 +0200 [thread overview]
Message-ID: <20230419-dynamic-vmon-v2-2-c303bcc75ebc@skidata.com> (raw)
In-Reply-To: <20230419-dynamic-vmon-v2-0-c303bcc75ebc@skidata.com>
From: Benjamin Bara <benjamin.bara@skidata.com>
The PWR_OK state of the da9063 indicates whether all monitored voltages
are within the expected range. When a regulator is disabled without
disabling its voltage monitor before, the PWR_OK state becomes false. On
our board, this invalid state leads to a hard reset.
Therefore, prevent the invalid state by disabling the monitor before the
regulator is disabled.
This still requires to explicitly enable the voltage monitor in the
device tree and has no impact otherwise.
TODO: clarify if a MODE change has impact on the voltage monitor
Signed-off-by: Benjamin Bara <benjamin.bara@skidata.com>
---
drivers/regulator/da9063-regulator.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/regulator/da9063-regulator.c b/drivers/regulator/da9063-regulator.c
index 82f52a2a031a..13a6b189f23a 100644
--- a/drivers/regulator/da9063-regulator.c
+++ b/drivers/regulator/da9063-regulator.c
@@ -99,6 +99,7 @@ struct da9063_regulator_info {
.desc.vsel_reg = DA9063_REG_V##regl_name##_A, \
.desc.vsel_mask = DA9063_V##regl_name##_MASK, \
.desc.linear_min_sel = DA9063_V##regl_name##_BIAS, \
+ .desc.mon_disable_while_reg_off = 1, \
.sleep = BFIELD(DA9063_REG_V##regl_name##_A, DA9063_LDO_SL), \
.suspend = BFIELD(DA9063_REG_##regl_name##_CONT, DA9063_LDO_CONF), \
.suspend_sleep = BFIELD(DA9063_REG_V##regl_name##_B, DA9063_LDO_SL), \
@@ -124,6 +125,7 @@ struct da9063_regulator_info {
.desc.vsel_reg = DA9063_REG_V##regl_name##_A, \
.desc.vsel_mask = DA9063_VBUCK_MASK, \
.desc.linear_min_sel = DA9063_VBUCK_BIAS, \
+ .desc.mon_disable_while_reg_off = 1, \
.sleep = BFIELD(DA9063_REG_V##regl_name##_A, DA9063_BUCK_SL), \
.suspend = BFIELD(DA9063_REG_##regl_name##_CONT, DA9063_BUCK_CONF), \
.suspend_sleep = BFIELD(DA9063_REG_V##regl_name##_B, DA9063_BUCK_SL), \
--
2.34.1
prev parent reply other threads:[~2023-04-21 9:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-21 9:13 [PATCH RFC v2 0/2] regulator: dynamic voltage monitoring support Benjamin Bara
2023-04-21 9:13 ` [PATCH RFC v2 1/2] regulator: add properties to disable monitoring on actions Benjamin Bara
2023-04-24 13:30 ` Matti Vaittinen
2023-04-21 9:13 ` Benjamin Bara [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230419-dynamic-vmon-v2-2-c303bcc75ebc@skidata.com \
--to=bbara93@gmail.com \
--cc=DLG-Adam.Ward.opensource@dm.renesas.com \
--cc=benjamin.bara@skidata.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mazziesaccount@gmail.com \
--cc=support.opensource@diasemi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®