From patchwork Thu Jun 20 07:42:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 805971 Delivered-To: patch@linaro.org Received: by 2002:a5d:508d:0:b0:362:4979:7f74 with SMTP id a13csp167159wrt; Thu, 20 Jun 2024 00:43:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUbDS75lE+8unMXtSfYdu3psgJUl8bnqmrgXcTmiP7hsmIVAmPXP1oPekGOQZas+pROJDyhGvZzGhfiiWOR7hnT X-Google-Smtp-Source: AGHT+IFjsZisemozZcJ6lIdo/vx4kRBN1urJz974ScMHy8NEB6QXivnjDqjJzRZqJni+89mvmk5L X-Received: by 2002:a17:907:2d88:b0:a6f:5723:fb11 with SMTP id a640c23a62f3a-a6fab77a5c9mr332007466b.58.1718869411408; Thu, 20 Jun 2024 00:43:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718869411; cv=none; d=google.com; s=arc-20160816; b=a5NnbcFqN20X1+fjKIo0JkrzZl6gpnhftYcW5jwq5QRbwxzzkTsr6S3XdJ1hDMcV8O D4vkb0R/djETdPXB/T9P51GHENsJuPNXDda1V0tdrj/VVDjADnQYplyyd1/PcSQpE4zL b39MJyjdJ0km3jPAxZqz/iMi7TBXs2EsQIiX2SP0PTHLlcJp8UVtixLpzXF8CRgqtAc7 XboIQNRHm+qwV5NI10HQTPuTt1IxxGQYUqvCjoOSCA9tv9OkqR5Ic5HTK0Hr8mgRyl9G oBkMauVUWT8TdfRc4VnHMaudl7sMlYkYKO+0jo7j1EaLPRZy7QfwJ8pgGWaLekijvoKM +gRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=3s6QvRaLgBM9BVS5oof8t32fnskrrrw/ilAd8VvZ3SI=; fh=NktPinskGi40WAEH3I3w2N36lh9XpfoYUwAKkJtgcV4=; b=mHAXWE9fFau1TwZxwI+9UP7TYpoDZf/NXhXBLm0O9tChVCWY9Wtz2vpuHIYjWj9hIG Kgfwt68E6xAu8zk/cEzxC4GMkyVggDPF+9lFl3ZhrLzrmvFUCuRab77wEfTASO5It353 KnYQ+lHqVFXlGlbVhU8QcfKzgf0v0KWpmkj2pvaqnIAXt+3TZdYkhwlWLMsCEdTeSo7u lXd9hR35pUfwnlqdSVtx45W1OlI5Ll1/VZUTJTS/w1RSV9k3WwD8UQ66h3Djd6N5gOZ3 8mLm2ECf7OwgeOPDwFCymDW9ABpCKhBvdYimEVIbOMmA4Fki5Jsim4GMZNUdpVjAXDcF QuiA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="l/phVd9T"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f7f38b214si391950066b.262.2024.06.20.00.43.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 00:43:31 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="l/phVd9T"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7935F8834D; Thu, 20 Jun 2024 09:43:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="l/phVd9T"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6FCE987F3F; Thu, 20 Jun 2024 09:43:13 +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=unavailable autolearn_force=no version=3.4.2 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D65778813A for ; Thu, 20 Jun 2024 09:43:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=neil.armstrong@linaro.org Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-42172ed3487so4815205e9.0 for ; Thu, 20 Jun 2024 00:43:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718869388; x=1719474188; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=3s6QvRaLgBM9BVS5oof8t32fnskrrrw/ilAd8VvZ3SI=; b=l/phVd9TVNwDCvyzEnsnyKbbR96gjujOI9i/huJqz8ZSRquZ2FHHWyAU1OO+8wDxIZ HO4kvxuii5brBfojtuGJYTJ+ksyN7slisylz2iCGwiK5KGZXa2S2atIHLHgpFy+ROgeJ +//xyz7BjJ/5EgSREWhKe9PbMO9ACV4GuUSIcofII98xvra2WUW/8ieo88dssK/g6GJ9 oKlQsZ7uWYPhQH+7YDHpAD87pJ5sKJEyzo7zMTZSej9T/5vq90m/R0Shbd+97ZlSDrfZ SWq1yNvVdHbTNysHmaTWN28hqr2A5TLYNz3kdQqOVdzg6qQnzMcc6thoKvZqa+/NWwkc Iabw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718869388; x=1719474188; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3s6QvRaLgBM9BVS5oof8t32fnskrrrw/ilAd8VvZ3SI=; b=qp8DivrjPQMMk/OsfUfkYh3KSLUdLOkCyNSHOk1oR85MjVlxhpR57H3LwXYx8ghH9c 3OIlcKa12Kl2CWNTkCV99SsRH4j2ipB9FG/WitGnO/h3hLkj64xDJE78OqknrVU0PdEd H4tqlehiz0v5mOFZcLH0yrtvEwB5YmbPoge07PH3E0EzEtC7J3lHH5SKgc8nFX9b7Yw6 DywSJgGexvFyo1dm+meJ109aiM0LRDIno1YRYabij6GwIL6HwH1o/m6ErQzaUw3aPHU1 9EgSjMFKSc6WrmJwGt/uNm1zfgPh8xzmpB3DYNQmcDT9CjEmM0ooJqLfbippTwxjHcER 2DwQ== X-Forwarded-Encrypted: i=1; AJvYcCVUZyFdKt4HiWI+ZvXrHbDC2Hmv+1jqZ0MgxJ50DZFnTdhQ9hc3RJDN6x7IVVBRwhbzBroE9TA6t+/Mqedx8S6q4pRUwg== X-Gm-Message-State: AOJu0YxfytDMxSq4aumOqbDPRqWRx3M+xKtVhHaf0Ywzu819dtPSjDQz LAdVzW4HswVUgsIdSyi3sKJy/y0r4PK2JAs2d/cbhJG0xH7G4Ydq1Q4jjmizSJg= X-Received: by 2002:a05:600c:21a:b0:424:7bcf:2486 with SMTP id 5b1f17b1804b1-4247bcf275emr13205085e9.4.1718869388315; Thu, 20 Jun 2024 00:43:08 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4247d0b6402sm15506785e9.10.2024.06.20.00.43.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 00:43:07 -0700 (PDT) From: Neil Armstrong Date: Thu, 20 Jun 2024 09:42:51 +0200 Subject: [PATCH v2 2/5] usb: dwc3: meson-gxl: switch to generic_phy_set_mode MIME-Version: 1.0 Message-Id: <20240620-u-boot-usb-gxl-phy-set-mode-v2-2-b81c027bc02c@linaro.org> References: <20240620-u-boot-usb-gxl-phy-set-mode-v2-0-b81c027bc02c@linaro.org> In-Reply-To: <20240620-u-boot-usb-gxl-phy-set-mode-v2-0-b81c027bc02c@linaro.org> To: Tom Rini , Marek Vasut Cc: Mattijs Korpershoek , u-boot-amlogic@groups.io, u-boot@lists.denx.de, Neil Armstrong X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1732; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=GTrmp7WLhG6oe7Z7C9Uhs4G6Xkk3KHyHVOiiQerYuI0=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBmc92G0/IZjZzjkdX/z7K2yMmOecfZgFnq1gjztS6f FRdL47KJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZnPdhgAKCRB33NvayMhJ0R3+EA ClSEndbXm5rHM4EtWNSP2BlvSa6wWxqlCA8EykuPr7CfUhBMNeYZg1juvpnQhwzz0jo7ybKZ7Cchq0 V5T+Vw775CvMZTvIZpAF/y8TOI4vvZN+iBiOvaYiRrd2DQHN/ZFSs4tXbX9Id2Gd/6wxndXGv7Cy0m 5fnNcHNaFdXqn6Qq0dopmz9ctkcip0BVvrXrLHLS9XfJd6GIIfbMBusnDPgnN9AjR0dHwBKkqXxqgp XnX/a8POCU0RhDG9X6PcO09xa6k3HukUJ4ae1jKaYrvQuGl8/zewpJaempmwL7v4uQknh54CXUPpI4 UrgZbRoTgSw7OS2VbZ4mnRbES0tGRVPs1RfeclYK4iLwVCmUzw7pufq5JB58UxCwYR3Z2b4en3fnyh V4abYxiYco/bdilnAdH8E7HspC87weXOpoknt13eDnRyJ431PVGy8iUl4l8DklZq3NEHwS1JU8jhZo ugnQ80GXXXSAlcR175OwdxgZ9ifJE7TqnIqYCrGIKUX3MyaLMsOS4C6sV4mZrhPXFR9yehH+Ngfe+j Zn0bHpDaiib9/wXHjs4HSSCxouxa7eTixYRohJtWSYMx9qJol27HwtySSPDdkGen4ZrSH2ZYBKB2Qk F/Gx+5okayF7X2dkbal4Bmkbu4jx87VvjEPRtJchuXRUd+4V2rlO29fpN3Mg== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE 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 Use the PHY set_mode call instead of calling directly in the PHY shared function. Signed-off-by: Neil Armstrong Reviewed-by: Marek Vasut --- drivers/usb/dwc3/dwc3-meson-gxl.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-meson-gxl.c b/drivers/usb/dwc3/dwc3-meson-gxl.c index 3e693c5ff3..290ac03a37 100644 --- a/drivers/usb/dwc3/dwc3-meson-gxl.c +++ b/drivers/usb/dwc3/dwc3-meson-gxl.c @@ -158,9 +158,9 @@ static int dwc3_meson_gxl_usb2_init(struct dwc3_meson_gxl *priv) if (!priv->phys[i].dev) continue; - phy_meson_gxl_usb2_set_mode(&priv->phys[i], - (i == USB2_OTG_PHY) ? USB_DR_MODE_PERIPHERAL - : USB_DR_MODE_HOST); + generic_phy_set_mode(&priv->phys[i], + (i == USB2_OTG_PHY) ? PHY_MODE_USB_DEVICE + : PHY_MODE_USB_HOST, 0); } return 0; @@ -224,7 +224,9 @@ int dwc3_meson_gxl_force_mode(struct udevice *dev, enum usb_dr_mode mode) #endif priv->otg_phy_mode = mode; - phy_meson_gxl_usb2_set_mode(&priv->phys[USB2_OTG_PHY], mode); + generic_phy_set_mode(&priv->phys[USB2_OTG_PHY], + mode == USB_DR_MODE_PERIPHERAL ? PHY_MODE_USB_DEVICE + : PHY_MODE_USB_HOST, 0); dwc3_meson_gxl_usb2_set_mode(priv, mode); @@ -361,8 +363,9 @@ static int dwc3_meson_gxl_probe(struct udevice *dev) } if (priv->phys[USB2_OTG_PHY].dev) - phy_meson_gxl_usb2_set_mode(&priv->phys[USB2_OTG_PHY], - priv->otg_phy_mode); + generic_phy_set_mode(&priv->phys[USB2_OTG_PHY], + priv->otg_phy_mode == USB_DR_MODE_PERIPHERAL ? PHY_MODE_USB_DEVICE + : PHY_MODE_USB_HOST, 0); dwc3_meson_gxl_usb2_set_mode(priv, priv->otg_phy_mode);