From: Jianqun Xu <jay.xu@rock-chips.com>
To: lgirdwood@gmail.com, broonie@kernel.org, ulf.hansson@linaro.org,
lee.jones@linaro.org, zhangchangzhong@huawei.com,
heiko@sntech.de
Cc: linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
Jianqun Xu <jay.xu@rock-chips.com>
Subject: [PATCH v3] soc: rockchip: io-domain: set 3.3V before regulator disable
Date: Wed, 18 Aug 2021 09:09:56 +0800 [thread overview]
Message-ID: <20210818010956.1446770-1-jay.xu@rock-chips.com> (raw)
Do a fix to rockchip io-domain, follow this orders:
* system running state
-> io-domain vsel to 3.3V (actually is done by pre-disable)
-> regulator_enable
-> vsel change according to regulator voltage
* system running state
-> io-domain vsel to 3.3V
-> regulator_disable
Found on some Rockchip SoCs, the regulator enable or disable without
care about the io-domain maybe caused soc damaged.
Tested on RV1126 EVB.
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
---
v3:
- abandon PRE-ENABLE patch
- delete the EVENT_PRE_ENABLE case
v2: none
v1: first version
drivers/soc/rockchip/io-domain.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/soc/rockchip/io-domain.c b/drivers/soc/rockchip/io-domain.c
index cf8182fc3642..3c59077fafb1 100644
--- a/drivers/soc/rockchip/io-domain.c
+++ b/drivers/soc/rockchip/io-domain.c
@@ -123,6 +123,12 @@ static int rockchip_iodomain_notify(struct notifier_block *nb,
} else if (event & (REGULATOR_EVENT_VOLTAGE_CHANGE |
REGULATOR_EVENT_ABORT_VOLTAGE_CHANGE)) {
uV = (unsigned long)data;
+ } else if (event & REGULATOR_EVENT_PRE_ENABLE) {
+ uV = MAX_VOLTAGE_3_3;
+ } else if (event & REGULATOR_EVENT_PRE_DISABLE) {
+ uV = MAX_VOLTAGE_3_3;
+ } else if (event & REGULATOR_EVENT_ENABLE) {
+ uV = regulator_get_voltage(supply->reg);
} else {
return NOTIFY_OK;
}
--
2.25.1
next reply other threads:[~2021-08-18 1:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-18 1:09 Jianqun Xu [this message]
2021-08-18 5:11 ` kernel test robot
2021-08-18 5:56 ` kernel test robot
2021-08-18 12:27 ` Mark Brown
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=20210818010956.1446770-1-jay.xu@rock-chips.com \
--to=jay.xu@rock-chips.com \
--cc=broonie@kernel.org \
--cc=heiko@sntech.de \
--cc=lee.jones@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=ulf.hansson@linaro.org \
--cc=zhangchangzhong@huawei.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®