Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1919332lqg; Mon, 4 Mar 2024 07:39:42 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVUb4sLbS4BO+JP0M+yP+FDkZd0C4A+ui38M4xYGw3SQEFZyQapAzM0rfw4hx4qxbvUyZSYXsL8iPFuoPCM1Kcl7nsBT4NHbkC3ZpJbCA== X-Google-Smtp-Source: AGHT+IFA7VA8oU1AjGbksFE0H3NcZmrwyfFPuicUqmihr3x8pQD4cxTe67ieJsYvOHWc6shN+pTH X-Received: by 2002:a17:906:3497:b0:a45:20e4:e5ed with SMTP id g23-20020a170906349700b00a4520e4e5edmr2505565ejb.77.1709566782604; Mon, 04 Mar 2024 07:39:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709566782; cv=pass; d=google.com; s=arc-20160816; b=Dzm1kZ3o9y4B6Y3NrOR01vJao7g5O7ptrslOqdowG2c7UPZb0TmfvjYTTLyoDZBzVb gAqwhAkfRJdJEPaZfIuUvTkdbAxRSJWxJE1+9rYd0hkki6sZ+YgbocB6T+hyrzbIEvr6 PJhO4GQ5MslqRSuXwt7eEtoi51PUyIirLRsSz9e27/C9uma8cgd2jO2WSMfAGQnjKJGv rlM6/SIdTUpdxvzoViVfrc1UQr4N6OVnnDTbyoqO8Rt0r6FqY4KgldbP6UPdm9LjRM4Y eTbJPyoMfoI6jqK/0qW+o9/r2GdzJGzkcRN9JBkHo8A0xL2p9AyuaO0WjWrkvr6v13Ou SjKA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=O2OqSyPPWtiaASZZ8fL+0nOgh8uzFroOQ4LwJV+N5EE=; fh=wHZQkXie84v2FP+2z7dUEuyvptHwnAyqgx34WxJkhrY=; b=Gx3M3aB1hZL0WxTdcde2X3xf91XKGNJygGcb48i1NCwcxM3EHTOTPmLV3QHOjCq1KG oshGiGkNIsVXSS2an4Ht4wvQR75Hv4doPFQlzSErh7b0f/liJy0S4iigsfmfpz6LDXYv 2HstwlpJwfQS75/4BX0qhSzx5/T4IfIP4CVLu93w0nsEsD4I2qUxBFVv/O83VsbnQFPA d1dUHVxwfQlCIn+/nXBnkO/5XJZ3JQgKlpxY2Y1iAUvGW5zKHJorj7+JJxHz2aUTzAHW UN0Jfckq4DJ5cL7WjDth74OEFAACldReJgf8Qm7KXCw3v3SqBzU8lixFOOw2khQNZyZQ R9+w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Upw1ehRr; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-90847-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90847-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id hd30-20020a170907969e00b00a4499dbd6absi3009198ejc.171.2024.03.04.07.39.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 07:39:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90847-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Upw1ehRr; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-90847-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90847-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2B89F1F25375 for ; Mon, 4 Mar 2024 15:39:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B649E54770; Mon, 4 Mar 2024 15:36:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Upw1ehRr" Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B9B545BFD; Mon, 4 Mar 2024 15:36:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709566587; cv=none; b=YDTmVXuntU+Pf1LKOBP0GQA61HhPLSyMuY9ilRv6zhMPv0+KY1Gxn+rcj7iwBMLxY4nBQAjx56IyxbAmXplucHA1CwVv+MiKOb6SzzUfna3kEzUShWSuWj/ZM/9JUijqRBwq94LZ4bZb3nqQF2gX0LPdEEQ2TyClTm1EaBt2fxo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709566587; c=relaxed/simple; bh=gNPojeRs7uaeynf3JtSmScZnTJITifyQp2nnjKqNJJs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dhoqaD5c6ZWaytjgMEkE7bR9EIHSGZvgWrhXaITStcBDCPHZE4tYSJY8mNUCMUyL9pAwVxVo2LWflvp50R1TTBNPSPxVm0Ar3yJ9O1FGU5IZbwl0O6P+cPAuyCRb/oPmoFkraJuMVabB4nB1RQ438UlBOxLPzpO69JFO6mlOlao= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=Upw1ehRr; arc=none smtp.client-ip=217.70.183.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 948841BF214; Mon, 4 Mar 2024 15:36:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709566584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O2OqSyPPWtiaASZZ8fL+0nOgh8uzFroOQ4LwJV+N5EE=; b=Upw1ehRrYckmxR7s0sIaRde2rNTfRmIGymX3WOWIMcmwJn2tnZ5SJSZeFZzhVRZdPirmKr bni3uAVKVIw4fu7A1VZWffvCAqJQF060OqoWZNXHu/UiVrELnfqu195k/GHe8HsIAEZ3CC 7/ZYFec/AvlECjmYdwdzofKDYrpV20COkdQuetKUMQYw3lgKkROpYFIabNg8YvW38scIfM H04oJxv1HlhO9xpzMYEDGpylIN0kcTkZCvzKR3RcufYUsc69vIyKwhhn7KxCVNQND8IVrp 4izfZHh51RkXyhEVkG83Es2QoNVlTLtNZ9auBiCBaYRyFkJauy7nD1jV2SiOmA== From: Thomas Richard Date: Mon, 04 Mar 2024 16:35:51 +0100 Subject: [PATCH v4 08/18] phy: ti: phy-j721e-wiz: add resume support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240102-j7200-pcie-s2r-v4-8-6f1f53390c85@bootlin.com> References: <20240102-j7200-pcie-s2r-v4-0-6f1f53390c85@bootlin.com> In-Reply-To: <20240102-j7200-pcie-s2r-v4-0-6f1f53390c85@bootlin.com> To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Tony Lindgren , Haojian Zhuang , Vignesh R , Aaro Koskinen , Janusz Krzysztofik , Andi Shyti , Peter Rosin , Vinod Koul , Kishon Vijay Abraham I , Philipp Zabel , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-i2c@vger.kernel.org, linux-phy@lists.infradead.org, linux-pci@vger.kernel.org, gregory.clement@bootlin.com, theo.lebrun@bootlin.com, thomas.petazzoni@bootlin.com, u-kumar1@ti.com, Thomas Richard X-Mailer: b4 0.12.0 X-GND-Sasl: thomas.richard@bootlin.com Add resume support. It has been tested on J7200 SR1.0 and SR2.0. Co-developed-by: Théo Lebrun Signed-off-by: Théo Lebrun Signed-off-by: Thomas Richard --- drivers/phy/ti/phy-j721e-wiz.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/phy/ti/phy-j721e-wiz.c b/drivers/phy/ti/phy-j721e-wiz.c index 0e3cb1ed5a52..b2320f2efb72 100644 --- a/drivers/phy/ti/phy-j721e-wiz.c +++ b/drivers/phy/ti/phy-j721e-wiz.c @@ -1660,12 +1660,41 @@ static void wiz_remove(struct platform_device *pdev) pm_runtime_disable(dev); } +static int wiz_resume_noirq(struct device *dev) +{ + struct device_node *node = dev->of_node; + struct wiz *wiz = dev_get_drvdata(dev); + int ret; + + /* Enable supplemental Control override if available */ + if (wiz->sup_legacy_clk_override) + regmap_field_write(wiz->sup_legacy_clk_override, 1); + + wiz_clock_init(wiz); + + ret = wiz_init(wiz); + if (ret) { + dev_err(dev, "WIZ initialization failed\n"); + goto err_wiz_init; + } + + return 0; + +err_wiz_init: + wiz_clock_cleanup(wiz, node); + + return ret; +} + +static DEFINE_NOIRQ_DEV_PM_OPS(wiz_pm_ops, NULL, wiz_resume_noirq); + static struct platform_driver wiz_driver = { .probe = wiz_probe, .remove_new = wiz_remove, .driver = { .name = "wiz", .of_match_table = wiz_id_table, + .pm = pm_sleep_ptr(&wiz_pm_ops), }, }; module_platform_driver(wiz_driver); -- 2.39.2