All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Jianqun Xu <jay.xu@rock-chips.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	 Lee Jones <lee.jones@linaro.org>,
	zhangchangzhong@huawei.com,  Heiko Stuebner <heiko@sntech.de>,
	 "open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>,
	 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/4] soc: rockchip: io-domain: do more thing about regulator notify
Date: Mon, 16 Aug 2021 14:39:50 +0200	[thread overview]
Message-ID: <CAPDyKFqYPfYqmFWHy818EKam7AOk1gNs99JAy3=W5cDGeE1QrQ@mail.gmail.com> (raw)
In-Reply-To: <20210816032003.1162779-5-jay.xu@rock-chips.com>

On Mon, 16 Aug 2021 at 05:20, Jianqun Xu <jay.xu@rock-chips.com> wrote:
>
> Do a fix to rockchip io-domain, follow this orders:
>
> * system running state
>   -> io-domain vsel to 3.3V
>     -> 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.

Can you please try to elaborate on the problem a bit more, as I don't
quite get the problem.

What regulator is causing this problem? Who is the consumer of the regulator?

Kind regards
Uffe

>
> Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
> ---
>  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..af5fb11ad9a3 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 = (unsigned long)data;
>         } else {
>                 return NOTIFY_OK;
>         }
> --
> 2.25.1
>
>
>

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

WARNING: multiple messages have this Message-ID (diff)
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Jianqun Xu <jay.xu@rock-chips.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Lee Jones <lee.jones@linaro.org>,
	zhangchangzhong@huawei.com, Heiko Stuebner <heiko@sntech.de>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/4] soc: rockchip: io-domain: do more thing about regulator notify
Date: Mon, 16 Aug 2021 14:39:50 +0200	[thread overview]
Message-ID: <CAPDyKFqYPfYqmFWHy818EKam7AOk1gNs99JAy3=W5cDGeE1QrQ@mail.gmail.com> (raw)
In-Reply-To: <20210816032003.1162779-5-jay.xu@rock-chips.com>

On Mon, 16 Aug 2021 at 05:20, Jianqun Xu <jay.xu@rock-chips.com> wrote:
>
> Do a fix to rockchip io-domain, follow this orders:
>
> * system running state
>   -> io-domain vsel to 3.3V
>     -> 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.

Can you please try to elaborate on the problem a bit more, as I don't
quite get the problem.

What regulator is causing this problem? Who is the consumer of the regulator?

Kind regards
Uffe

>
> Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
> ---
>  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..af5fb11ad9a3 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 = (unsigned long)data;
>         } else {
>                 return NOTIFY_OK;
>         }
> --
> 2.25.1
>
>
>

  reply	other threads:[~2021-08-16 12:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-16  3:19 [PATCH 0/4] regulator pre-enable Jianqun Xu
2021-08-16  3:19 ` Jianqun Xu
2021-08-16  3:20 ` [PATCH 1/4] regulator: add PRE_ENABLE event define Jianqun Xu
2021-08-16  3:20   ` Jianqun Xu
2021-08-16  3:20 ` [PATCH 2/4] regulator: core: notify regulator enable with the voltage value Jianqun Xu
2021-08-16  3:20   ` Jianqun Xu
2021-08-16 12:00   ` Mark Brown
2021-08-16 12:00     ` Mark Brown
2021-08-17  3:17     ` jay.xu
2021-08-17  3:23       ` jay.xu
2021-08-16  3:20 ` [PATCH 3/4] regulator: core: add pre-enable event notify to regulator Jianqun Xu
2021-08-16  3:20   ` Jianqun Xu
2021-08-16  3:20 ` [PATCH 4/4] soc: rockchip: io-domain: do more thing about regulator notify Jianqun Xu
2021-08-16  3:20   ` Jianqun Xu
2021-08-16 12:39   ` Ulf Hansson [this message]
2021-08-16 12:39     ` Ulf Hansson

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='CAPDyKFqYPfYqmFWHy818EKam7AOk1gNs99JAy3=W5cDGeE1QrQ@mail.gmail.com' \
    --to=ulf.hansson@linaro.org \
    --cc=broonie@kernel.org \
    --cc=heiko@sntech.de \
    --cc=jay.xu@rock-chips.com \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.