From patchwork Thu Feb 15 15:17:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Richard X-Patchwork-Id: 201595 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp494431dyb; Thu, 15 Feb 2024 07:58:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVyYlicHjOFWuy6WHOJJGrmzVDVE8Lhjl24d9CgpjpjG4sSheB6c7HnynhDAblDVsI6TuhVFA7ZK9s9sMraVKTvVbSqUg== X-Google-Smtp-Source: AGHT+IELDIXtronF7FEyKDjJovKZ+qn6OVt+bqqDeRzZ4e150NxD9DErFJfGXOFu5RbDY++zEP+5 X-Received: by 2002:a05:6a20:9c90:b0:1a0:566a:5974 with SMTP id mj16-20020a056a209c9000b001a0566a5974mr2892451pzb.61.1708012719590; Thu, 15 Feb 2024 07:58:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708012719; cv=pass; d=google.com; s=arc-20160816; b=KDrTARcWV+vKmpxSp3bfGkToAP6tQx9sHLR7f8qWULFd6iCQckvyYWuGrSmRYYh9Mg YHTtZemkSAO2GBgzGN2oVeNFie8lRiMCSDERxdape3ifge+GCf1xF6zBvapwSNQEgi2Q uMiIjLryIRdJTgwrRt/xaCPumaluDl9/C8YwqALsL0vCukp1ektfEaC6E43kdqsIyeQn zAh6OOrv/j2hzF1iW/bcAMUuYiHouO5C2n/k4BMUb04aIrIqKKxn4aqgUriXmpgfJLlQ b7L8pyno/89vNWifsN4xJSVa7TM1WWqvDCeXTkKiZiHR+ZUb4lI74pfzH5AQ2vy21BIW 0AUA== 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=Aje71ZCarb1ScswTolVHFXNrCcFCvavDi8CC5QUtYibCfoztMzya2zvjhswUOM2hn1 T5JIdw5gPeuk9Fg+M6hEfjoSYr6J+k33kEtGwDaCrZ6ZbXT9D3DFb98bNt04XwlTw0ga MOX8s5w1zqCaQMJZSVRYMVDoLT/5SiWdt2BNmLxpxLK8XQE/T2mwbjZVZjZ83I55aaRU oeIlfCy1zkAF3M1UXNNDjgRIbYEr3qIL4pUO3rmJB5evbDi9vuJmuxG/yxApmU1A/2JE G6RKF7BMbn0Dxo0B7vXlk4wd5EXQLpU2oKGWsqsZmEV+fx9F3fU38++IoIf7jVGz/9yn RaCw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=cgq1Kikm; 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-67160-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67160-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id k6-20020a632406000000b005d8e401b4a2si1245897pgk.801.2024.02.15.07.58.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 07:58:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67160-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=cgq1Kikm; 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-67160-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67160-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E0BBBB2C4D0 for ; Thu, 15 Feb 2024 15:22:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A8801369A9; Thu, 15 Feb 2024 15:18:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="cgq1Kikm" 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 877F51350FE; Thu, 15 Feb 2024 15:18:14 +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=1708010297; cv=none; b=frLDXMbopvP31oXlzbEqtq/l8vGtqAOkWOoE6IKM1joRnrK8KU2aQCDHlxLYY1pdVBlbkM56Yh2ukumfQNv4vrnAW49xkXiaqwdQtWh10PooiOjjhMV5tlT0orXLSU30B3N8mxtdGtPuPAtP/x+sic2uFtyZjqgkG4e+eHyAORk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708010297; c=relaxed/simple; bh=UqAZwTrAzmCyHsH2izjqH7bw1MyDaTQpcy6c25J6btU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JBf+vPihoxR8MLj32vtf2JYvj6/JQ4wYVhFkJuuSshEoXvElyUGaY9254gtMdbXdCZwDIgt1gPyB/qQES23Mzv+5Ab+ikvOaOJBKP8XM/j8aBv7EW9OIiXgGju0CkEXZAtp0MnvYUlZHv1ShdEoAhESWBZEdxywxebUsPp45vgY= 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=cgq1Kikm; 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 B63B5240005; Thu, 15 Feb 2024 15:18:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708010292; 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=cgq1KikmKWwRY3fHgpywpgJxAU8n6JrmIGAX1C1QLRJ0w3IDWjlwqtngjuY4VOB6DpFp+a t312R3t5G3xLbr8sQkqduzrN24tkUvPYBBVFqxQ4+TwfnOO3yfuXEUJhG1K4Kube7LuhqY NQVvf8//0/CUXqzEM60pZWc+5g8UEqDGnyW0MFfbU8W5NzyHbHGx6AswIUzLjzWTbfmZzG dlTzIx5E87Q7ZBaeNboPZ3FmT0INGxZ0b+mxGypxI7aC5qgaNTg1+MOqgRqLStaCXD0Ymo Z4UGrGtrP9cPm30L1PXF3aJXpPQ9E8YqGNJqVqRSuOSXvqGbjLmW9f6WuOjlEw== From: Thomas Richard Date: Thu, 15 Feb 2024 16:17:57 +0100 Subject: [PATCH v3 12/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-v3-12-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=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: 1790981145361180382 X-GMAIL-MSGID: 1790981145361180382 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;