Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp2036648lqp; Tue, 16 Apr 2024 05:53:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUDX5GiOMFWUlAimbe7TYsLsRip477WJ73vGQjRgYr66V6eNx9Q23Pf28f+ZclcerR2bE/M9vdi1NxtJxi2FIgTF6gL0kk9M55M2JnYfA== X-Google-Smtp-Source: AGHT+IGRQZxZqFy2eAjK33/bffcOjmY8qMN3bpq+4BRttNo1ORdNff4nJOhIEUD6VC0jiNnPIZj0 X-Received: by 2002:a0c:e0d0:0:b0:69b:6375:43f8 with SMTP id x16-20020a0ce0d0000000b0069b637543f8mr10439602qvk.13.1713272018587; Tue, 16 Apr 2024 05:53:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713272018; cv=pass; d=google.com; s=arc-20160816; b=KRKPuIy9gQOE/YcNkamBVAsYm2Hy4hsKZzz4slkafm43qShmbejDQn/7xZU+tefses +je/108iHPh4apCeNADQc5BHvv7ZmpPwr5UtwkSWabvKr9YFraB2DBZBDBmrLVHkhH3P tm0A0Qj9AXH3/gR8pYGL3uPSsuyDdcdneNbuuCD8MwV9+Oj1pstiYs3EyQI5SKHQpy51 VDZzNpMXDmgBPXWald+lZQsGJK1A5DIgeOLfSkr4z4TA+AxFmhx69e9kweaZxd6kpGA+ NCd5oHqzcP33YWm/CjZKnzL6bATMlFbJ/oWR3hArIRg9S7hbqSKuqcVcY0C7E2tYjHB2 iGUA== 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=eSCKVt3PzenyfZAdSt+Uuc2sxOPAq2JS3OulPvLdYig=; fh=GkNdvG04Lunqqv1Jt68/BI66vXiv28hSSvpkD3jAO7w=; b=EZsO8WBrDmnOltWF7sP3y8SHRP+0Bu5DcGxToyERMH3S/o62Z1WeYgnOL+jH2S+nMw 7G0AztKmd1g+x7eUaPnn+9V/3iPmXcQ6xZAMMvYlHrQGVhySBbyXvzFdgpyWPx/3aeTh rfe2qm4eTo2BEvAqBp5LW4VFl098BHE9svcsEEXOmci5IpJhTIq7qL8E1HdiUDkdeFXR bP/nGUBpRTk5zfz7YRXMeyQ6AMoXul+TD/aR4oyyNGQRDH25dx5bagM0zwBTuXGrkTk8 tweJ3+xZ0Syf6+MS9TSgLSBx3vXvnmHuQvXPBk76SipYPqD+VU41Ncv8TcectTFcjbrb r57Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=PnuH0l0l; 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-146824-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146824-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 t10-20020a05621405ca00b0069b40717220si11983143qvz.526.2024.04.16.05.53.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 05:53:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146824-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=PnuH0l0l; 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-146824-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146824-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 40EBE1C21C5D for ; Tue, 16 Apr 2024 12:53:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8253D12BF1A; Tue, 16 Apr 2024 12:53:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="PnuH0l0l" Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (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 3CA7D12C531 for ; Tue, 16 Apr 2024 12:53:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713271987; cv=none; b=jj8un3O8YsQQMpTID0Bz1ZOM7YlpyqKTZEQEYYfmQpdFQ1aS1pna/Y31BeM10ZTD2MROJVauIxiFp5J6NLSEWJ0Chu5Sy0H6HHx4ku4/P/1XEHjENJNC6ypDGy78JnKQFY/I5QRM8Fxx8shck3ru8WR16iUId8SAzBR8DHkVnb0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713271987; c=relaxed/simple; bh=sl5SRuv0DrtHW5bkZkmZdN6IxP9VaaJTX0VeczM4sbs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uMg7HFM2qNJU20THc2Md0VmX9b1hKheOkPlZlL9T2nMeE9l598GY/waC3w9zEvB4HQH69IW8gOTeuzblysinmP7GqYg4KtwDhAYBAUvolpT3MgsdIllKPuFxXWIufu+oWNepiGoNCAWhxzsrA4cvqqjm4MMLLJ/axg3xC9pJ01k= 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=PnuH0l0l; arc=none smtp.client-ip=217.70.183.200 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 D802D20007; Tue, 16 Apr 2024 12:52:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1713271984; 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=eSCKVt3PzenyfZAdSt+Uuc2sxOPAq2JS3OulPvLdYig=; b=PnuH0l0lvmrlNI/TjKBPEceAakQIcg0D6nTXGLXNxcGQuomiZOgahc2w4WGZgh9cmqZe+p 5x4UiNap8ydEjSPxH9upz/z131/oOvV0EACCmwXeS5EV8CeYFtpHXI4tFYOD+SalMWYnIo hbO4BoowDHIYbb0DNNX3Pt0WvuySI5NdsOT6xABNYzj4+OEDLUiQLJbMvJE3liEcC40thk F8/z9UxoaKHCjs6PGx5FR3k6D4sWFdtP9urojSMl+Hc9dOQYRcF/1uai3BNEbKLpuwdHk1 gIb5Ovj4fEx1Iaj25SJW9774f8ewuEoCGtDk0vX3w6TUIaSdqvKrSGjUHUSgPQ== From: Thomas Richard Date: Tue, 16 Apr 2024 14:52:32 +0200 Subject: [PATCH 3/8] 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: <20240412-j7200-phy-s2r-v1-3-f15815833974@bootlin.com> References: <20240412-j7200-phy-s2r-v1-0-f15815833974@bootlin.com> In-Reply-To: <20240412-j7200-phy-s2r-v1-0-f15815833974@bootlin.com> To: Vinod Koul , Kishon Vijay Abraham I , Philipp Zabel Cc: linux-phy@lists.infradead.org, linux-kernel@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 ba670109e7ad..7f626c597025 100644 --- a/drivers/phy/ti/phy-j721e-wiz.c +++ b/drivers/phy/ti/phy-j721e-wiz.c @@ -1659,12 +1659,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