All of lore.kernel.org
 help / color / mirror / Atom feed
From: neil.armstrong@linaro.org
To: Dmitry Rokosov <ddrokosov@sberdevices.ru>,
	gregkh@linuxfoundation.org, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, khilman@baylibre.com,
	jbrunet@baylibre.com, martin.blumenstingl@googlemail.com,
	mturquette@baylibre.com, vkoul@kernel.org, kishon@kernel.org,
	hminas@synopsys.com, Thinh.Nguyen@synopsys.com
Cc: yue.wang@amlogic.com, hanjie.lin@amlogic.com,
	kernel@sberdevices.ru, rockosov@gmail.com,
	linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-amlogic@lists.infradead.org, linux-phy@lists.infradead.org
Subject: Re: [PATCH v2 1/5] phy: amlogic: enable/disable clkin during Amlogic USB PHY init/exit
Date: Tue, 18 Apr 2023 13:42:34 +0200	[thread overview]
Message-ID: <1acdf7b3-cbe4-5689-7c35-5146bc1f07f4@linaro.org> (raw)
In-Reply-To: <20230418111612.19479-2-ddrokosov@sberdevices.ru>

On 18/04/2023 13:16, Dmitry Rokosov wrote:
> Previously, all Amlogic boards used the XTAL clock as the default board
> clock for the USB PHY input, so there was no need to enable it.
> However, with the introduction of new Amlogic SoCs like the A1 family,
> the USB PHY now uses a gated clock. Hence, it is necessary to enable
> this gated clock during the PHY initialization sequence, or disable it
> during the PHY exit, as appropriate.
> 
> Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
> ---
>   drivers/phy/amlogic/phy-meson-g12a-usb2.c | 13 +++++++++++--
>   1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/phy/amlogic/phy-meson-g12a-usb2.c b/drivers/phy/amlogic/phy-meson-g12a-usb2.c
> index 9d1efa0d9394..80938751da4f 100644
> --- a/drivers/phy/amlogic/phy-meson-g12a-usb2.c
> +++ b/drivers/phy/amlogic/phy-meson-g12a-usb2.c
> @@ -172,10 +172,16 @@ static int phy_meson_g12a_usb2_init(struct phy *phy)
>   	int ret;
>   	unsigned int value;
>   
> -	ret = reset_control_reset(priv->reset);
> +	ret = clk_prepare_enable(priv->clk);
>   	if (ret)
>   		return ret;
>   
> +	ret = reset_control_reset(priv->reset);
> +	if (ret) {
> +		clk_disable_unprepare(priv->clk);
> +		return ret;
> +	}
> +
>   	udelay(RESET_COMPLETE_TIME);
>   
>   	/* usb2_otg_aca_en == 0 */
> @@ -277,8 +283,11 @@ static int phy_meson_g12a_usb2_init(struct phy *phy)
>   static int phy_meson_g12a_usb2_exit(struct phy *phy)
>   {
>   	struct phy_meson_g12a_usb2_priv *priv = phy_get_drvdata(phy);
> +	int ret = reset_control_reset(priv->reset);
> +
> +	clk_disable_unprepare(priv->clk);
>   
> -	return reset_control_reset(priv->reset);
> +	return ret;
>   }
>   
>   /* set_mode is not needed, mode setting is handled via the UTMI bus */

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

WARNING: multiple messages have this Message-ID (diff)
From: neil.armstrong@linaro.org
To: Dmitry Rokosov <ddrokosov@sberdevices.ru>,
	gregkh@linuxfoundation.org, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, khilman@baylibre.com,
	jbrunet@baylibre.com, martin.blumenstingl@googlemail.com,
	mturquette@baylibre.com, vkoul@kernel.org, kishon@kernel.org,
	hminas@synopsys.com, Thinh.Nguyen@synopsys.com
Cc: yue.wang@amlogic.com, hanjie.lin@amlogic.com,
	kernel@sberdevices.ru, rockosov@gmail.com,
	linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-amlogic@lists.infradead.org, linux-phy@lists.infradead.org
Subject: Re: [PATCH v2 1/5] phy: amlogic: enable/disable clkin during Amlogic USB PHY init/exit
Date: Tue, 18 Apr 2023 13:42:34 +0200	[thread overview]
Message-ID: <1acdf7b3-cbe4-5689-7c35-5146bc1f07f4@linaro.org> (raw)
In-Reply-To: <20230418111612.19479-2-ddrokosov@sberdevices.ru>

On 18/04/2023 13:16, Dmitry Rokosov wrote:
> Previously, all Amlogic boards used the XTAL clock as the default board
> clock for the USB PHY input, so there was no need to enable it.
> However, with the introduction of new Amlogic SoCs like the A1 family,
> the USB PHY now uses a gated clock. Hence, it is necessary to enable
> this gated clock during the PHY initialization sequence, or disable it
> during the PHY exit, as appropriate.
> 
> Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
> ---
>   drivers/phy/amlogic/phy-meson-g12a-usb2.c | 13 +++++++++++--
>   1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/phy/amlogic/phy-meson-g12a-usb2.c b/drivers/phy/amlogic/phy-meson-g12a-usb2.c
> index 9d1efa0d9394..80938751da4f 100644
> --- a/drivers/phy/amlogic/phy-meson-g12a-usb2.c
> +++ b/drivers/phy/amlogic/phy-meson-g12a-usb2.c
> @@ -172,10 +172,16 @@ static int phy_meson_g12a_usb2_init(struct phy *phy)
>   	int ret;
>   	unsigned int value;
>   
> -	ret = reset_control_reset(priv->reset);
> +	ret = clk_prepare_enable(priv->clk);
>   	if (ret)
>   		return ret;
>   
> +	ret = reset_control_reset(priv->reset);
> +	if (ret) {
> +		clk_disable_unprepare(priv->clk);
> +		return ret;
> +	}
> +
>   	udelay(RESET_COMPLETE_TIME);
>   
>   	/* usb2_otg_aca_en == 0 */
> @@ -277,8 +283,11 @@ static int phy_meson_g12a_usb2_init(struct phy *phy)
>   static int phy_meson_g12a_usb2_exit(struct phy *phy)
>   {
>   	struct phy_meson_g12a_usb2_priv *priv = phy_get_drvdata(phy);
> +	int ret = reset_control_reset(priv->reset);
> +
> +	clk_disable_unprepare(priv->clk);
>   
> -	return reset_control_reset(priv->reset);
> +	return ret;
>   }
>   
>   /* set_mode is not needed, mode setting is handled via the UTMI bus */

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: neil.armstrong@linaro.org
To: Dmitry Rokosov <ddrokosov@sberdevices.ru>,
	gregkh@linuxfoundation.org, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, khilman@baylibre.com,
	jbrunet@baylibre.com, martin.blumenstingl@googlemail.com,
	mturquette@baylibre.com, vkoul@kernel.org, kishon@kernel.org,
	hminas@synopsys.com, Thinh.Nguyen@synopsys.com
Cc: yue.wang@amlogic.com, hanjie.lin@amlogic.com,
	kernel@sberdevices.ru, rockosov@gmail.com,
	linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-amlogic@lists.infradead.org, linux-phy@lists.infradead.org
Subject: Re: [PATCH v2 1/5] phy: amlogic: enable/disable clkin during Amlogic USB PHY init/exit
Date: Tue, 18 Apr 2023 13:42:34 +0200	[thread overview]
Message-ID: <1acdf7b3-cbe4-5689-7c35-5146bc1f07f4@linaro.org> (raw)
In-Reply-To: <20230418111612.19479-2-ddrokosov@sberdevices.ru>

On 18/04/2023 13:16, Dmitry Rokosov wrote:
> Previously, all Amlogic boards used the XTAL clock as the default board
> clock for the USB PHY input, so there was no need to enable it.
> However, with the introduction of new Amlogic SoCs like the A1 family,
> the USB PHY now uses a gated clock. Hence, it is necessary to enable
> this gated clock during the PHY initialization sequence, or disable it
> during the PHY exit, as appropriate.
> 
> Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
> ---
>   drivers/phy/amlogic/phy-meson-g12a-usb2.c | 13 +++++++++++--
>   1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/phy/amlogic/phy-meson-g12a-usb2.c b/drivers/phy/amlogic/phy-meson-g12a-usb2.c
> index 9d1efa0d9394..80938751da4f 100644
> --- a/drivers/phy/amlogic/phy-meson-g12a-usb2.c
> +++ b/drivers/phy/amlogic/phy-meson-g12a-usb2.c
> @@ -172,10 +172,16 @@ static int phy_meson_g12a_usb2_init(struct phy *phy)
>   	int ret;
>   	unsigned int value;
>   
> -	ret = reset_control_reset(priv->reset);
> +	ret = clk_prepare_enable(priv->clk);
>   	if (ret)
>   		return ret;
>   
> +	ret = reset_control_reset(priv->reset);
> +	if (ret) {
> +		clk_disable_unprepare(priv->clk);
> +		return ret;
> +	}
> +
>   	udelay(RESET_COMPLETE_TIME);
>   
>   	/* usb2_otg_aca_en == 0 */
> @@ -277,8 +283,11 @@ static int phy_meson_g12a_usb2_init(struct phy *phy)
>   static int phy_meson_g12a_usb2_exit(struct phy *phy)
>   {
>   	struct phy_meson_g12a_usb2_priv *priv = phy_get_drvdata(phy);
> +	int ret = reset_control_reset(priv->reset);
> +
> +	clk_disable_unprepare(priv->clk);
>   
> -	return reset_control_reset(priv->reset);
> +	return ret;
>   }
>   
>   /* set_mode is not needed, mode setting is handled via the UTMI bus */

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

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

WARNING: multiple messages have this Message-ID (diff)
From: neil.armstrong@linaro.org
To: Dmitry Rokosov <ddrokosov@sberdevices.ru>,
	gregkh@linuxfoundation.org, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, khilman@baylibre.com,
	jbrunet@baylibre.com, martin.blumenstingl@googlemail.com,
	mturquette@baylibre.com, vkoul@kernel.org, kishon@kernel.org,
	hminas@synopsys.com, Thinh.Nguyen@synopsys.com
Cc: yue.wang@amlogic.com, hanjie.lin@amlogic.com,
	kernel@sberdevices.ru, rockosov@gmail.com,
	linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-amlogic@lists.infradead.org, linux-phy@lists.infradead.org
Subject: Re: [PATCH v2 1/5] phy: amlogic: enable/disable clkin during Amlogic USB PHY init/exit
Date: Tue, 18 Apr 2023 13:42:34 +0200	[thread overview]
Message-ID: <1acdf7b3-cbe4-5689-7c35-5146bc1f07f4@linaro.org> (raw)
In-Reply-To: <20230418111612.19479-2-ddrokosov@sberdevices.ru>

On 18/04/2023 13:16, Dmitry Rokosov wrote:
> Previously, all Amlogic boards used the XTAL clock as the default board
> clock for the USB PHY input, so there was no need to enable it.
> However, with the introduction of new Amlogic SoCs like the A1 family,
> the USB PHY now uses a gated clock. Hence, it is necessary to enable
> this gated clock during the PHY initialization sequence, or disable it
> during the PHY exit, as appropriate.
> 
> Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
> ---
>   drivers/phy/amlogic/phy-meson-g12a-usb2.c | 13 +++++++++++--
>   1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/phy/amlogic/phy-meson-g12a-usb2.c b/drivers/phy/amlogic/phy-meson-g12a-usb2.c
> index 9d1efa0d9394..80938751da4f 100644
> --- a/drivers/phy/amlogic/phy-meson-g12a-usb2.c
> +++ b/drivers/phy/amlogic/phy-meson-g12a-usb2.c
> @@ -172,10 +172,16 @@ static int phy_meson_g12a_usb2_init(struct phy *phy)
>   	int ret;
>   	unsigned int value;
>   
> -	ret = reset_control_reset(priv->reset);
> +	ret = clk_prepare_enable(priv->clk);
>   	if (ret)
>   		return ret;
>   
> +	ret = reset_control_reset(priv->reset);
> +	if (ret) {
> +		clk_disable_unprepare(priv->clk);
> +		return ret;
> +	}
> +
>   	udelay(RESET_COMPLETE_TIME);
>   
>   	/* usb2_otg_aca_en == 0 */
> @@ -277,8 +283,11 @@ static int phy_meson_g12a_usb2_init(struct phy *phy)
>   static int phy_meson_g12a_usb2_exit(struct phy *phy)
>   {
>   	struct phy_meson_g12a_usb2_priv *priv = phy_get_drvdata(phy);
> +	int ret = reset_control_reset(priv->reset);
> +
> +	clk_disable_unprepare(priv->clk);
>   
> -	return reset_control_reset(priv->reset);
> +	return ret;
>   }
>   
>   /* set_mode is not needed, mode setting is handled via the UTMI bus */

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

  reply	other threads:[~2023-04-18 11:42 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-18 11:16 [PATCH v2 0/5] arm64: meson: support Amlogic A1 USB OTG controller Dmitry Rokosov
2023-04-18 11:16 ` Dmitry Rokosov
2023-04-18 11:16 ` Dmitry Rokosov
2023-04-18 11:16 ` Dmitry Rokosov
2023-04-18 11:16 ` [PATCH v2 1/5] phy: amlogic: enable/disable clkin during Amlogic USB PHY init/exit Dmitry Rokosov
2023-04-18 11:16   ` Dmitry Rokosov
2023-04-18 11:16   ` Dmitry Rokosov
2023-04-18 11:16   ` Dmitry Rokosov
2023-04-18 11:42   ` neil.armstrong [this message]
2023-04-18 11:42     ` neil.armstrong
2023-04-18 11:42     ` neil.armstrong
2023-04-18 11:42     ` neil.armstrong
2023-04-23 17:42   ` Martin Blumenstingl
2023-04-23 17:42     ` Martin Blumenstingl
2023-04-23 17:42     ` Martin Blumenstingl
2023-04-23 17:42     ` Martin Blumenstingl
2023-04-25 10:29     ` Dmitry Rokosov
2023-04-25 10:29       ` Dmitry Rokosov
2023-04-25 10:29       ` Dmitry Rokosov
2023-04-25 10:29       ` Dmitry Rokosov
2023-04-18 11:16 ` [PATCH v2 2/5] usb: dwc2: support dwc2 IP for Amlogic A1 SoC family Dmitry Rokosov
2023-04-18 11:16   ` Dmitry Rokosov
2023-04-18 11:16   ` Dmitry Rokosov
2023-04-18 11:16   ` Dmitry Rokosov
2023-04-18 11:42   ` neil.armstrong
2023-04-18 11:42     ` neil.armstrong
2023-04-18 11:42     ` neil.armstrong
2023-04-18 11:42     ` neil.armstrong
2023-04-21  4:51   ` Minas Harutyunyan
2023-04-21  4:51     ` Minas Harutyunyan
2023-04-21  4:51     ` Minas Harutyunyan
2023-04-21  4:51     ` Minas Harutyunyan
2023-04-18 11:16 ` [PATCH v2 3/5] dt-bindings: usb: dwc2: add support for Amlogic A1 SoC USB peripheral Dmitry Rokosov
2023-04-18 11:16   ` Dmitry Rokosov
2023-04-18 11:16   ` Dmitry Rokosov
2023-04-18 11:16   ` Dmitry Rokosov
2023-04-21 18:01   ` Rob Herring
2023-04-21 18:01     ` Rob Herring
2023-04-21 18:01     ` Rob Herring
2023-04-21 18:01     ` Rob Herring
2023-04-23 17:43   ` Martin Blumenstingl
2023-04-23 17:43     ` Martin Blumenstingl
2023-04-23 17:43     ` Martin Blumenstingl
2023-04-23 17:43     ` Martin Blumenstingl
2023-04-18 11:16 ` [PATCH v2 4/5] usb: dwc3-meson-g12a: support OTG switch for all IP versions Dmitry Rokosov
2023-04-18 11:16   ` Dmitry Rokosov
2023-04-18 11:16   ` Dmitry Rokosov
2023-04-18 11:16   ` Dmitry Rokosov
2023-04-18 11:42   ` neil.armstrong
2023-04-18 11:42     ` neil.armstrong
2023-04-18 11:42     ` neil.armstrong
2023-04-18 11:42     ` neil.armstrong
2023-04-23 17:44   ` Martin Blumenstingl
2023-04-23 17:44     ` Martin Blumenstingl
2023-04-23 17:44     ` Martin Blumenstingl
2023-04-23 17:44     ` Martin Blumenstingl
2023-04-18 11:16 ` [PATCH v2 5/5] arm64: dts: meson: a1: support USB controller in OTG mode Dmitry Rokosov
2023-04-18 11:16   ` Dmitry Rokosov
2023-04-18 11:16   ` Dmitry Rokosov
2023-04-18 11:16   ` Dmitry Rokosov
2023-04-23 17:51   ` Martin Blumenstingl
2023-04-23 17:51     ` Martin Blumenstingl
2023-04-23 17:51     ` Martin Blumenstingl
2023-04-23 17:51     ` Martin Blumenstingl
2023-04-25 11:06     ` Dmitry Rokosov
2023-04-25 11:06       ` Dmitry Rokosov
2023-04-25 11:06       ` Dmitry Rokosov
2023-04-25 11:06       ` Dmitry Rokosov

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=1acdf7b3-cbe4-5689-7c35-5146bc1f07f4@linaro.org \
    --to=neil.armstrong@linaro.org \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=ddrokosov@sberdevices.ru \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hanjie.lin@amlogic.com \
    --cc=hminas@synopsys.com \
    --cc=jbrunet@baylibre.com \
    --cc=kernel@sberdevices.ru \
    --cc=khilman@baylibre.com \
    --cc=kishon@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=mturquette@baylibre.com \
    --cc=robh+dt@kernel.org \
    --cc=rockosov@gmail.com \
    --cc=vkoul@kernel.org \
    --cc=yue.wang@amlogic.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.