Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp643955rdb; Fri, 26 Jan 2024 06:40:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IEprz9x3uhrxlalTOD4XvGvujwhw4BHcGgPIQKJg9OLrTh5wrgWDQz23EFbZN2WaFuT/vAg X-Received: by 2002:ad4:4ee6:0:b0:685:bf01:f0d0 with SMTP id dv6-20020ad44ee6000000b00685bf01f0d0mr1687426qvb.37.1706280018923; Fri, 26 Jan 2024 06:40:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706280018; cv=pass; d=google.com; s=arc-20160816; b=rb57F3b9bbcD8cko7t+e/KwPc06ciJBNSf0ee4Go8tTsKBHsDkriL1RoCt1qGT5x/A t18gU3dX4cM20NrE5Fd0xeHwjzwFwLbqMdTuPaJC+cj7Ta7TCkW/W1BLKoZrrRJkc2V6 LtToQgznL0FykeX13swgjTNTgxolgbT+e1M27MZRLF0WIvMQqHGELxxtM+QWkjyIieau OcYvTJtTh+1YavVuqU4XTc5110bnhK7mqC5JDGhWGfrodI915fCSn+376GEd8UHAZSQp xd+Zsla8B/m3YdPwpXDk31UT2k0QZ8DUyjR5oRzmQWLOlT1rleSj0j6a9qv3cTu0661u jYBg== 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=I18NFvlzsoQfZSmja7rXdApCroRS70XYkOT3y7UrK2g=; fh=ihwxVJW8DyodhmdJo1IfhLUDNDWeXh+49SpWXYbpL2Y=; b=CrjhyWpTJ718AsZtn1BEFkkaFXCui6wfBDtt0L/ILZrjzpTxLtk7qXZX3gQu6HLA6A G06ZLjhgr3gDI8rWxrbd+urx/vC1MvTZGz5DM9Q3h1kqEyBbua/96TQt8JLGWggFQP83 svUhpl2AFy3GMdTTRwjhZ7hqVB2UJORBHGGhq3P7qEpvuTg7oVS4iwd4VtnyjiL32riu zMMCCI7q3clYXshCw5N4+7Q542A6Q0wdSNvWwosu+27/OZfstCzj27tKgZK7FYOSykO1 iH/70iCR8Fe/vJRi8BjxKcO2RJD2kJAEPAJnZpR8j7UWBSeXp6RWBSxUY3/yO/vdUMLC VnoQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=fumspxXR; 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-40206-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40206-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 12-20020ad45bac000000b0068600507c19si1399665qvq.522.2024.01.26.06.40.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 06:40:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40206-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=fumspxXR; 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-40206-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40206-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 09F5B1C21D50 for ; Fri, 26 Jan 2024 14:40:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CDC311EEE6; Fri, 26 Jan 2024 14:37:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="fumspxXR" Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (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 47EE71EB2C; Fri, 26 Jan 2024 14:37:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706279876; cv=none; b=iG0ePickwu8OlVcUy+nc9RT07H6pmwCdDvsS2szyMq7phyLAU7Jrx+gZ/q21rFWjPWVcda22XzcJBcL9kvRPBU9WuW+CcAUZq035hDA6fjV040Cj9NkP2ihpS56XT15sh284zB8RSMLvqt0tuUARgAXrBpePH9X+ZFlnj+gOtxU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706279876; c=relaxed/simple; bh=gbQeK8jnzyoTJOAZKidUReVLJKue9e9o4CaN2088Z+w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WlCs07dl6qbIDf9HZmO8Ny/HIu2tdGdBi2TC+prgTgSuIn0z/9CrzLI2jOGISM8AyPHKmDcvbnSa11DnuFgFqqAnVTs5T2zML2mjVfzOfuE/PwUJQaCbTNPtu5yZPR7Ky3rHGEHrkq4j2iKz4BBYLY1pPZfUTbEmrvf9ZrewOyA= 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=fumspxXR; arc=none smtp.client-ip=217.70.183.194 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 466B04000F; Fri, 26 Jan 2024 14:37:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1706279872; 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=I18NFvlzsoQfZSmja7rXdApCroRS70XYkOT3y7UrK2g=; b=fumspxXRNw5UiOEesNyasc94ujx9HeTv582Up4GE0IaxaMpACWSc19XX5ZdiGHjcP2H5Cy foG4E5lxEtWWThdX+GRtdP2ppslw2kiq5USgOYsDkwvI9D/yQVdURPKIBjKtBoRn8kRSzM qd+FZ0ZJfKxIGSn9ziVAPpNEp8aCgkND7XQ1tlUdLFz+kb7b+CI2szTvaf8bkshv1Gx0Js 5UMY6+3ARpLmSGbzwOlqLZfz6tkvjZkcq2FW6rycjJSzffzsw8vQd3xumCNWCzSpQ5cLQQ feZjVdsEItXk5zxcz5wk+R/ZcGQs7JLBDLCXqc4Oc9Vg8bDFrhe3XB3qMirEjQ== From: Thomas Richard Date: Fri, 26 Jan 2024 15:36:49 +0100 Subject: [PATCH v2 07/15] 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-v2-7-8e4f7d228ec2@bootlin.com> References: <20240102-j7200-pcie-s2r-v2-0-8e4f7d228ec2@bootlin.com> In-Reply-To: <20240102-j7200-pcie-s2r-v2-0-8e4f7d228ec2@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 , Tom Joseph , 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 | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/drivers/phy/ti/phy-j721e-wiz.c b/drivers/phy/ti/phy-j721e-wiz.c index 09f7edf16562..163ac3e95ddb 100644 --- a/drivers/phy/ti/phy-j721e-wiz.c +++ b/drivers/phy/ti/phy-j721e-wiz.c @@ -1666,12 +1666,47 @@ 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); + + ret = wiz_clock_init(wiz, node, false); + if (ret < 0) { + dev_warn(dev, "Failed to initialize clocks\n"); + goto err_get_sync; + } + + 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); + +err_get_sync: + + 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