Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp524067rdb; Thu, 15 Feb 2024 07:20:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVfJ8APrRX52My2AkV8yu0ff5JWwR3mZWseMmdB5msn9Xv6uAsdXkiP8J6wMXjZJ6Hz39ITMOp+IPZWAwHh8QZF8EE86MlowwN2auP0GA== X-Google-Smtp-Source: AGHT+IHPMacqtSu+CaPh5J93DvF3rCApduT0NONqpAYRjRg4dKszO3/SnrEbQd+uewOKS1NENcw9 X-Received: by 2002:aa7:c359:0:b0:560:d9d5:7b0f with SMTP id j25-20020aa7c359000000b00560d9d57b0fmr1441681edr.22.1708010442905; Thu, 15 Feb 2024 07:20:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708010442; cv=pass; d=google.com; s=arc-20160816; b=HrTyCRgPz5ldIJSfoN4HbZK6gXgLheYo8yf2eooeOExb7YBQvZqiw1L0i/aCnsEQbq nJDVwt7vHtjmswy8JqGwqF3KWIePGrHD3jyAJGd9tgxo0k3emcu8VK53dXiWytuygpU2 3HiTNALwJnoTUAy6Rl4yRavV4z9knswTYIuDbvNM4eczDeG4j15wV2DxQRfwnhBmYp/1 /zXAhlNgmZM9XiROxwyF3ouavy4mZa7+2qY6dsMe9d+0ieqXUqxFSDrUFh3v7aawKa7Q o8Qne91P0mqIo+hwIyodXCs7wPEAxBj+K99tQ6BIXn0N7J54Kv8TvHP2GyNkrRUieNLl 1cjg== 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=elGcazR3RAYdE1WwV1YDwOp1CVUqVY3SVp9Rpe8awS8=; fh=wHZQkXie84v2FP+2z7dUEuyvptHwnAyqgx34WxJkhrY=; b=EZElNdoVwVSbWn/NmJwmlUYSZQVszdr/+pGIARAAgMdrZZCH30UjXM8oP8IRFydxD3 clHm4OWV54lLf0ztJB86x7qphg0o2oGuziISh2r29cjKOY5V1d5T99fz3jmq7lPOLwiS B4okfHbTi0fSp2BHAgIpMTcbhbcXRQ+FZxDc567xGe5cWKmHly50F/QXPFoB2cVBe08Z aLgf80TE4TKUGldNRtIY93U6pRf9x+lCSG97jX3EdiQxpYNBcIxMM3AKHp/2/aVU7p3d chrm1qRdeFO/SEEsW0r32QwgXmjLyaWVZ3ERq9l8FJIUNpXC/H4+b5xeJWjNAlQWpOyW w8zw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=hxT15fox; 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-67156-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67156-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id x6-20020aa7d386000000b00561e6543600si719423edq.149.2024.02.15.07.20.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 07:20:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67156-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=hxT15fox; 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-67156-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67156-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 A67711F22C1C for ; Thu, 15 Feb 2024 15:20:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6328C1350F8; Thu, 15 Feb 2024 15:18:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="hxT15fox" Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 3ADD613472D; Thu, 15 Feb 2024 15:18:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708010293; cv=none; b=DMaamLEk1wGc7gaMYCALjKQOy+mdh7vnE4bTF5gzxP+Ht0u0deOmkDPbKVPflLep+g0dxF2NeA9ldGZysVl87ZgrB+3FLYMT1I3Bcr2+ICMt9AJwisMLkANeNjywdcGqZsKABq5HVPng5twicPkUvkZX32YaCt03wmedjNlGOi4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708010293; c=relaxed/simple; bh=0rF0ydUKx8DNLmpqL/zl2WtbHYCxIoALNzEdbFbOyKA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LprEVNhoYTP7bJoC3VGuj2dpYC65/PAVL7dbbpSax1KsK1RcFvmc0Vg58U3msOuHAVvBKy1vsihpTyaEWlreFrKbXw+F+/nNG0ypCSx3lS1A8jkEVcqlgiE3j0Iu4CqPMLRY602pzAWriFklPV2C/S8TzvI0aMSh0e4KODM7hmo= 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=hxT15fox; arc=none smtp.client-ip=217.70.183.193 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 8C55F240010; Thu, 15 Feb 2024 15:18:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708010289; 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=elGcazR3RAYdE1WwV1YDwOp1CVUqVY3SVp9Rpe8awS8=; b=hxT15foxAPdxrh9+jDZrsMZme2b4pSEQWPLGbELqJ7wHekbnDI4a/szJ/LLrGNVMRlaSiw 076ABYE/WZmzZMwjI3bycuJPack20ILG4yg725ztMdc5CLGRPzyWHCtY1zKp+4/3VHEhsB SRKDRfcJ4e7PDc0SNPOL5DehAGDQpTlBOPVJfwxDpK4dUIsvOuWZLjHxGw8oRUXPTuoGds VVaGdH6s2ZhGypPJZDxGJnOGgSJiO/ebirE1trq8DkcfdN8VOvRN7PbNr6vDC2FY7AVAXg vX4lNr7DwDKjfJiqYEZWBkqihZ7ZyoYTqVtaghUUkQGyyc1RBvJtUHZptjjzhw== From: Thomas Richard Date: Thu, 15 Feb 2024 16:17:54 +0100 Subject: [PATCH v3 09/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-v3-9-5c2e4a3fac1f@bootlin.com> References: <20240102-j7200-pcie-s2r-v3-0-5c2e4a3fac1f@bootlin.com> In-Reply-To: <20240102-j7200-pcie-s2r-v3-0-5c2e4a3fac1f@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. Based on the work of 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 45c5a4e9cd12..cde38182e34c 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