From patchwork Mon Mar 4 15:35:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Richard X-Patchwork-Id: 209609 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6359:6299:b0:17c:1df7:5ed3 with SMTP id se25csp271902rwb; Mon, 4 Mar 2024 07:41:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUkSPEC/LJO6atL4oJVOYjWdY2uy9E5x0wiAuiTa0sCF1vSTV20gM/4khAdNoY1xZvnPhu6SeuZuNOgeY+awWOx9DMf2Q== X-Google-Smtp-Source: AGHT+IESJ/MW4PfjWP2jk2yB6NhhUxsSYfyueXhHNGRxAT3rnRkQ0Ha4TV/snji/vKwNXI8R7Tv2 X-Received: by 2002:a17:90b:3ccf:b0:299:3ebf:d180 with SMTP id qd15-20020a17090b3ccf00b002993ebfd180mr7431412pjb.6.1709566906133; Mon, 04 Mar 2024 07:41:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709566906; cv=pass; d=google.com; s=arc-20160816; b=Nefn5S9TUcZrsxHVaxYkRVIbsmzHBkYspfgdWfHk/S3ntbOkaZ+Eg3baITnM4H0goO y67N8wCgYz65kc4Eb8KM38F2GRPFlzo5aVjZOTMi/DZwOugmVkUy53rTdVulQbcbsI/0 KsPh5Xs5SazZfX/rvzx84qDd4Qhnb/6N7gPmD3fzAwOXf70+i9YvJdTvoKXw7hEmfrTN yUpe8jGwYfiUpOvzO86ZSwYo9monCBX6QFIz7Zbi92g6tuicUiJ96Gik8A3wauh7AvuE Xn69eC/CrKV5YHUfbPrdncMd2XWivjCn9jcJDtLzqnqm0yq5/WD5NwjJ1d3VGRaus5wN OCuA== 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90847-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id nu11-20020a17090b1b0b00b0029b08d76286si8950793pjb.37.2024.03.04.07.41.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 07:41:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90847-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90847-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id EA6E928AFE2 for ; Mon, 4 Mar 2024 15:39:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6FAF254908; Mon, 4 Mar 2024 15:36:30 +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 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=84?= =?utf-8?q?ski?= , 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792610828141074275 X-GMAIL-MSGID: 1792610828141074275 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);