Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 130F3C7EE22 for ; Mon, 15 May 2023 10:01:22 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1BE4385FF2; Mon, 15 May 2023 12:00:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="LQo++iQS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 35D1885F3D; Mon, 15 May 2023 12:00:16 +0200 (CEST) Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 818D685F74 for ; Mon, 15 May 2023 12:00:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=eugen.hristev@collabora.com Received: from eugen-station.. (unknown [46.8.172.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: ehristev) by madras.collabora.co.uk (Postfix) with ESMTPSA id 745DE66058EC; Mon, 15 May 2023 11:00:02 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1684144802; bh=f/oOIc7giRYO8DjeNTMF6RkfX5ESr69f7Gvs26MRY8o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LQo++iQSEmkm/eCYNajRmkHrU9r2GqqWArkXfIIZV4leRvH9XA+kmNu12YCsqvymZ ZUwBnEAfcfwrb0JPT5riMk1rQU5hDpmQnxYtpXEAFXxLrIrFrGOj47RaXotkNdSBXM Gf7oW26YTEdpKsWu1YHSIslFDrHMP+Di9ZT4DtvTB+nAnZI4br1x0W0PwsEyZG6E6f ZXSrfgPBTlcAgn+7PyGM8T8EIQinvahLdIUwP7lLpEG0htoqe6Zfa4LkhDebPzdEHD hExGVb96/aZ0/o2rEeB87LulY+2znffQi4WIHKVstwf8dJ/mAfDWzB4EJoSbwvLfVy Zd1Swn5LKBrWw== From: Eugen Hristev To: u-boot@lists.denx.de, kever.yang@rock-chips.com Cc: eugen.hristev@collabora.com, u-boot-amlogic@groups.io, neil.armstrong@linaro.org, jonas@kwiboo.se, xdrudis@tinet.cat, jagan@edgeble.ai, anarsoul@gmail.com Subject: [PATCH resend v5 4/6] phy: remove phy-supply related code Date: Mon, 15 May 2023 12:59:48 +0300 Message-Id: <20230515095950.23666-4-eugen.hristev@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230515095950.23666-1-eugen.hristev@collabora.com> References: <20230515095950.23666-1-eugen.hristev@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean phy-supply is now handled at uclass level. Remove it from the drivers that implement it at the driver level. Acked-by: Neil Armstrong Suggested-by: Jonas Karlman Signed-off-by: Eugen Hristev --- drivers/phy/meson-g12a-usb2.c | 48 ----------------------------------- drivers/phy/meson-gxbb-usb2.c | 38 --------------------------- drivers/phy/meson-gxl-usb2.c | 30 ---------------------- 3 files changed, 116 deletions(-) diff --git a/drivers/phy/meson-g12a-usb2.c b/drivers/phy/meson-g12a-usb2.c index 2fbba7fdae01..650b88bd1803 100644 --- a/drivers/phy/meson-g12a-usb2.c +++ b/drivers/phy/meson-g12a-usb2.c @@ -54,50 +54,12 @@ struct phy_meson_g12a_usb2_priv { struct regmap *regmap; -#if CONFIG_IS_ENABLED(DM_REGULATOR) - struct udevice *phy_supply; -#endif #if CONFIG_IS_ENABLED(CLK) struct clk clk; #endif struct reset_ctl reset; }; - -static int phy_meson_g12a_usb2_power_on(struct phy *phy) -{ -#if CONFIG_IS_ENABLED(DM_REGULATOR) - struct udevice *dev = phy->dev; - struct phy_meson_g12a_usb2_priv *priv = dev_get_priv(dev); - - if (priv->phy_supply) { - int ret = regulator_set_enable(priv->phy_supply, true); - if (ret) - return ret; - } -#endif - - return 0; -} - -static int phy_meson_g12a_usb2_power_off(struct phy *phy) -{ -#if CONFIG_IS_ENABLED(DM_REGULATOR) - struct udevice *dev = phy->dev; - struct phy_meson_g12a_usb2_priv *priv = dev_get_priv(dev); - - if (priv->phy_supply) { - int ret = regulator_set_enable(priv->phy_supply, false); - if (ret) { - pr_err("Error disabling PHY supply\n"); - return ret; - } - } -#endif - - return 0; -} - static int phy_meson_g12a_usb2_init(struct phy *phy) { struct udevice *dev = phy->dev; @@ -155,8 +117,6 @@ static int phy_meson_g12a_usb2_exit(struct phy *phy) struct phy_ops meson_g12a_usb2_phy_ops = { .init = phy_meson_g12a_usb2_init, .exit = phy_meson_g12a_usb2_exit, - .power_on = phy_meson_g12a_usb2_power_on, - .power_off = phy_meson_g12a_usb2_power_off, }; int meson_g12a_usb2_phy_probe(struct udevice *dev) @@ -193,14 +153,6 @@ int meson_g12a_usb2_phy_probe(struct udevice *dev) } #endif -#if CONFIG_IS_ENABLED(DM_REGULATOR) - ret = device_get_supply_regulator(dev, "phy-supply", &priv->phy_supply); - if (ret && ret != -ENOENT) { - pr_err("Failed to get PHY regulator\n"); - return ret; - } -#endif - return 0; } diff --git a/drivers/phy/meson-gxbb-usb2.c b/drivers/phy/meson-gxbb-usb2.c index 7a2e3d2739e8..70a80b863819 100644 --- a/drivers/phy/meson-gxbb-usb2.c +++ b/drivers/phy/meson-gxbb-usb2.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -81,9 +80,6 @@ struct phy_meson_gxbb_usb2_priv { struct regmap *regmap; struct reset_ctl_bulk resets; -#if CONFIG_IS_ENABLED(DM_REGULATOR) - struct udevice *phy_supply; -#endif }; static int phy_meson_gxbb_usb2_power_on(struct phy *phy) @@ -92,15 +88,6 @@ static int phy_meson_gxbb_usb2_power_on(struct phy *phy) struct phy_meson_gxbb_usb2_priv *priv = dev_get_priv(dev); uint val; -#if CONFIG_IS_ENABLED(DM_REGULATOR) - if (priv->phy_supply) { - int ret = regulator_set_enable(priv->phy_supply, true); - - if (ret) - return ret; - } -#endif - regmap_update_bits(priv->regmap, REG_CONFIG, REG_CONFIG_CLK_32k_ALTSEL, REG_CONFIG_CLK_32k_ALTSEL); @@ -140,26 +127,8 @@ static int phy_meson_gxbb_usb2_power_on(struct phy *phy) return 0; } -static int phy_meson_gxbb_usb2_power_off(struct phy *phy) -{ -#if CONFIG_IS_ENABLED(DM_REGULATOR) - struct udevice *dev = phy->dev; - struct phy_meson_gxbb_usb2_priv *priv = dev_get_priv(dev); - - if (priv->phy_supply) { - int ret = regulator_set_enable(priv->phy_supply, false); - - if (ret) - return ret; - } -#endif - - return 0; -} - static struct phy_ops meson_gxbb_usb2_phy_ops = { .power_on = phy_meson_gxbb_usb2_power_on, - .power_off = phy_meson_gxbb_usb2_power_off, }; static int meson_gxbb_usb2_phy_probe(struct udevice *dev) @@ -192,13 +161,6 @@ static int meson_gxbb_usb2_phy_probe(struct udevice *dev) return ret; } -#if CONFIG_IS_ENABLED(DM_REGULATOR) - ret = device_get_supply_regulator(dev, "phy-supply", &priv->phy_supply); - if (ret && ret != -ENOENT) { - pr_err("Failed to get PHY regulator\n"); - return ret; - } -#endif ret = reset_get_bulk(dev, &priv->resets); if (!ret) { ret = reset_deassert_bulk(&priv->resets); diff --git a/drivers/phy/meson-gxl-usb2.c b/drivers/phy/meson-gxl-usb2.c index 9fb376cec448..4c631310efac 100644 --- a/drivers/phy/meson-gxl-usb2.c +++ b/drivers/phy/meson-gxl-usb2.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include @@ -101,9 +100,6 @@ struct phy_meson_gxl_usb2_priv { struct regmap *regmap; -#if CONFIG_IS_ENABLED(DM_REGULATOR) - struct udevice *phy_supply; -#endif #if CONFIG_IS_ENABLED(CLK) struct clk clk; #endif @@ -167,14 +163,6 @@ static int phy_meson_gxl_usb2_power_on(struct phy *phy) phy_meson_gxl_usb2_set_mode(phy, USB_DR_MODE_HOST); -#if CONFIG_IS_ENABLED(DM_REGULATOR) - if (priv->phy_supply) { - int ret = regulator_set_enable(priv->phy_supply, true); - if (ret) - return ret; - } -#endif - return 0; } @@ -189,16 +177,6 @@ static int phy_meson_gxl_usb2_power_off(struct phy *phy) val |= U2P_R0_POWER_ON_RESET; regmap_write(priv->regmap, U2P_R0, val); -#if CONFIG_IS_ENABLED(DM_REGULATOR) - if (priv->phy_supply) { - int ret = regulator_set_enable(priv->phy_supply, false); - if (ret) { - pr_err("Error disabling PHY supply\n"); - return ret; - } - } -#endif - return 0; } @@ -229,14 +207,6 @@ int meson_gxl_usb2_phy_probe(struct udevice *dev) } #endif -#if CONFIG_IS_ENABLED(DM_REGULATOR) - ret = device_get_supply_regulator(dev, "phy-supply", &priv->phy_supply); - if (ret && ret != -ENOENT) { - pr_err("Failed to get PHY regulator\n"); - return ret; - } -#endif - return 0; } -- 2.34.1