[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <10951990.zapYfy813O@diego>
Date: Tue, 25 Feb 2025 23:07:44 +0100
From: Heiko Stübner <heiko@...ech.de>
To: vkoul@...nel.org, kishon@...nel.org
Cc: linux-phy@...ts.infradead.org, linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org,
quentin.schulz@...rry.de, sebastian.reichel@...labora.com,
Heiko Stuebner <heiko.stuebner@...rry.de>
Subject:
Re: [PATCH 2/2] phy: rockchip: usbdp: re-init the phy on orientation-change
Am Dienstag, 25. Februar 2025, 19:45:19 MEZ schrieb Heiko Stuebner:
> diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
> index 7b17c82ebcfc..b63259a90d85 100644
> --- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
> +++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
> @@ -1277,6 +1277,7 @@ static int rk_udphy_orien_sw_set(struct typec_switch_dev *sw,
> enum typec_orientation orien)
> {
> struct rk_udphy *udphy = typec_switch_get_drvdata(sw);
> + int ret = 0;
>
> mutex_lock(&udphy->mutex);
>
> @@ -1292,6 +1293,12 @@ static int rk_udphy_orien_sw_set(struct typec_switch_dev *sw,
> rk_udphy_set_typec_default_mapping(udphy);
> rk_udphy_usb_bvalid_enable(udphy, true);
>
> + /* re-init the phy if already on */
> + if (udphy->status != UDPHY_MODE_NONE) {
> + rk_udphy_disable(udphy);
> + ret = rk_udphy_setup(udphy);
> + }
> +
just realized that
if (udphy->status != UDPHY_MODE_NONE)
ret = rk_udphy_init(udphy);
does the same, and we really don't need to disable and re-enable the
phy's clocks that are the added via rk_udphy_disable and _setup.
So will give it a day and send a v2 then.
Heiko
Powered by blists - more mailing lists