From patchwork Mon Mar 4 15:35:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Richard X-Patchwork-Id: 209611 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6359:6299:b0:17c:1df7:5ed3 with SMTP id se25csp272221rwb; Mon, 4 Mar 2024 07:42:24 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV1lsbv9VBg+oxIxx8lwiotbdT9XxomRAiGYLRxIwX4HzG9+aevndS5BRsauxEuKJ7CZbo5hybxCnuniuP8s5XrDbpD3A== X-Google-Smtp-Source: AGHT+IH+fQh2CqDof5d1M8buSTYWTcbi5n1/ZtHrIjlOAWVovCqm1YHD10rmENkHy27DihnoHtVN X-Received: by 2002:a17:903:1111:b0:1dc:d73e:a202 with SMTP id n17-20020a170903111100b001dcd73ea202mr11131748plh.59.1709566944495; Mon, 04 Mar 2024 07:42:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709566944; cv=pass; d=google.com; s=arc-20160816; b=HISZ28OFAd0/0c4GakoawNWoehXYrKRlbO81KpcGLfb9iDvgJZlYA960Ku4tVug4K7 NTdZpBIpJWh6CJ6RF7Erg47/DW9rbWzuAMJwaGZuOez4u7JzGp7OzCHf39iMp6Z/jvBv I1DTFv5Fd35tsjd8vBA1rXsf5P/sWz5HcbWSpSnpew9G2/3kyvbJtULqnTOXWd9xXTi4 ddrV79P9kkF8ugi0ciyeMOoKG/oWgeaVg/TNAP0835rgDbm/baEK5r66oDIigZmjHk+h AQ5S4u4T3J9Md2/Ct9G0aHVTN2BRgDlVpMFiKl9XHfKfsWMfHgCV3AHvZd47EWTks0wi HCXw== 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=pYylQruqGYeQlChK9yp+O0x5NERS4bDbicxfArQ0TLI=; fh=wHZQkXie84v2FP+2z7dUEuyvptHwnAyqgx34WxJkhrY=; b=W/b271ZM5gqNBPZ/lsC62BRPnGT4zvpVRLPqd/YW1CMbBddm/Ok5PQub/SFKIf3zj3 T0guVG2YTxNhibR7rft4dQdxRNsYTn4YdM3y65V80//USn3JiP404AW06v/h+GvlWxE/ iQP5+EMfkBisLRNXSuwU8L1EjSev/e5TKXEsnwjJx8bRDWVeK4a4eVrd/4j6pjFfS1Uj 6IPEr7gTL0dN3PY0MH/hOnZPfyBz0mGMe+OfQRihpIeh7aelK7bDE8XfYF1S+1dAmcm8 S5KqVIG2r7nLoUNnr2BFxUtQKJAvhu3M3ZZbJie3TiVqa6b2vILloPdDcqZ6PXU2k8V2 squg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=E2zbC+yq; 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-90850-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90850-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. [139.178.88.99]) by mx.google.com with ESMTPS id p16-20020a1709027ed000b001dcb3207229si8144220plb.209.2024.03.04.07.42.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 07:42:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90850-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=E2zbC+yq; 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-90850-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90850-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 9A6FE282481 for ; Mon, 4 Mar 2024 15:40:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0C21056774; Mon, 4 Mar 2024 15:36:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="E2zbC+yq" 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 E8D2C54911; Mon, 4 Mar 2024 15:36:30 +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=1709566593; cv=none; b=OnwsOQxubE/E9khrzSLiIRbB3NBWflLaiTyBO26S8qM4OQr8/BR16xTz2JefW39qaxJP70lYIsdtXtYTlV01mKSvqeM0nwxeRoCcU3ZqbYYNp/tIm8HMXB59X5Qlpp5Q9+V/ot1kXtyqS74LZuUK5BCxiRtNS8EVLhWimk1PKcQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709566593; c=relaxed/simple; bh=UqAZwTrAzmCyHsH2izjqH7bw1MyDaTQpcy6c25J6btU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NsAuITHXzhwykt1FfVCxz341a98kEFYHMPK/CzMfJO2ZyeF4Rmb4xrY1KlAz2sF1zFBc1xYsPUnsFEl4E8+XnHbLlK68RDSJqh5HK7jxGocCnYmmghTboHidmse6GjeEYA5/swL2Nz84zE+6y8vDtehhoJ6F6Zi/iFWlLx+qY4g= 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=E2zbC+yq; 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 DAED21BF208; Mon, 4 Mar 2024 15:36:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709566589; 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=pYylQruqGYeQlChK9yp+O0x5NERS4bDbicxfArQ0TLI=; b=E2zbC+yqxH66Y+sgHXfmfZEJlUauI8MAjGg9gvo0YqhU6jEQo1+fykcbR8/rbe4Lr/hjFE PUGrU1vAad8WxrR9izlR1IeliCl8pryvt4qPkzsN1H0/FiNyHRkYcraJZ+6ncS3t2TBVVm AsFvm4Hz7lWgW5QzixDELPAzH1bdPznet9aVsRqJSnCkK5PmZIA5HRELvwyHzutgvaQTBK Ons2kyGwWN46QFCL2/6v3b+qLJV+9XAQZPaK7pXizi5B01ponQ6XafIVVxyd+ML2qNJkNV 4V3y3YAh504XdzggzA+J7bId67/5dVy0gmn0DfvK/bDkij1GT6YwUlEGTL/QcQ== From: Thomas Richard Date: Mon, 04 Mar 2024 16:35:54 +0100 Subject: [PATCH v4 11/18] phy: cadence-torrent: add already_configured to struct cdns_torrent_phy 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-11-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: 1792610868338259025 X-GMAIL-MSGID: 1792610868338259025 Add already_configured to struct cdns_torrent_phy, so it can be used at differents stages. Signed-off-by: Thomas Richard --- drivers/phy/cadence/phy-cadence-torrent.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/phy/cadence/phy-cadence-torrent.c b/drivers/phy/cadence/phy-cadence-torrent.c index bba10ca0bfdd..b35fbc8a60e5 100644 --- a/drivers/phy/cadence/phy-cadence-torrent.c +++ b/drivers/phy/cadence/phy-cadence-torrent.c @@ -358,6 +358,7 @@ struct cdns_torrent_phy { enum cdns_torrent_ref_clk ref_clk_rate; struct cdns_torrent_inst phys[MAX_NUM_LANES]; int nsubnodes; + int already_configured; const struct cdns_torrent_data *init_data; struct regmap *regmap_common_cdb; struct regmap *regmap_phy_pcs_common_cdb; @@ -2740,7 +2741,6 @@ static int cdns_torrent_phy_probe(struct platform_device *pdev) struct device_node *child; int ret, subnodes, node = 0, i; u32 total_num_lanes = 0; - int already_configured; u8 init_dp_regmap = 0; u32 phy_type; @@ -2787,9 +2787,9 @@ static int cdns_torrent_phy_probe(struct platform_device *pdev) if (ret) goto clk_cleanup; - regmap_field_read(cdns_phy->phy_pma_cmn_ctrl_1, &already_configured); + regmap_field_read(cdns_phy->phy_pma_cmn_ctrl_1, &cdns_phy->already_configured); - if (!already_configured) { + if (!cdns_phy->already_configured) { ret = cdns_torrent_clk(cdns_phy); if (ret) goto clk_cleanup; @@ -2869,7 +2869,7 @@ static int cdns_torrent_phy_probe(struct platform_device *pdev) of_property_read_u32(child, "cdns,ssc-mode", &cdns_phy->phys[node].ssc_mode); - if (!already_configured) + if (!cdns_phy->already_configured) gphy = devm_phy_create(dev, child, &cdns_torrent_phy_ops); else gphy = devm_phy_create(dev, child, &noop_ops); @@ -2955,7 +2955,7 @@ static int cdns_torrent_phy_probe(struct platform_device *pdev) goto put_lnk_rst; } - if (cdns_phy->nsubnodes > 1 && !already_configured) { + if (cdns_phy->nsubnodes > 1 && !cdns_phy->already_configured) { ret = cdns_torrent_phy_configure_multilink(cdns_phy); if (ret) goto put_lnk_rst;