From patchwork Wed Apr 19 13:40:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 1770739 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=mail header.b=eJCCFZoV; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q1hm70v0Lz1ybF for ; Wed, 19 Apr 2023 23:41:59 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 69F328629B; Wed, 19 Apr 2023 15:40:54 +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="eJCCFZoV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8ADAA86162; Wed, 19 Apr 2023 15:40:43 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) (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 C229186270 for ; Wed, 19 Apr 2023 15:40:38 +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 [82.76.24.202]) (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 AF8BD660325A; Wed, 19 Apr 2023 14:40:37 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1681911638; bh=yMN6XEqM/zTEsnuN7Vqu7PJOxBCFsyZmpRgLlv9PxOM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eJCCFZoVR8g9M7F49HWuYqv5c3Xp9RR/cya290jFcBjbbk6D9ZETYS81zKcY7uhsH DjaqHAUQx8eNdZbozfNvcpjasOIKt6MKTZGfg+BQeSSlN4oa/MXWxQry6fZv3dhTL5 aRKH9MmRXC63wNuBwV50sqiijii5dzB8JFunDp6uMj13BXwKU4RaFqIehDrH/w+q1n LSsFZ3L7BAefYN01EsPc76F6BHGK5N+bdBOdlBTapskYQhH7JeyATpK10xFx0SXBQ3 CE0qmZGWsMVWsd/FPSKgOPVZ+WZ6WtFT/ZO1HPw89S3i8Oo83XPSy9VsHbe9FJ907O q6eTarAWnLQog== From: Eugen Hristev To: kever.yang@rock-chips.com, jonas@kwiboo.se, eugen.hristev@collabora.com, u-boot@lists.denx.de Cc: u-boot-amlogic@groups.io, xdrudis@tinet.cat, jagan@edgeble.ai, neil.armstrong@linaro.org, anarsoul@gmail.com Subject: [PATCH v5 4/6] phy: remove phy-supply related code Date: Wed, 19 Apr 2023 16:40:12 +0300 Message-Id: <20230419134014.128461-4-eugen.hristev@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230419134014.128461-1-eugen.hristev@collabora.com> References: <20230419134014.128461-1-eugen.hristev@collabora.com> MIME-Version: 1.0 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. Suggested-by: Jonas Karlman Signed-off-by: Eugen Hristev Acked-by: Neil Armstrong --- 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; }