Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1006890lqp; Fri, 22 Mar 2024 02:43:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUGQ8CW/Pl4BzQup5eSB7uwOY2D79TSUxTx8jzRDGbwvT5e7IwdAzRT5rp1iEVrPI+7hB2kDppsq84bq15Vqtgh7ALMGvmxwD9sRJceBw== X-Google-Smtp-Source: AGHT+IGXpbrv9JJOBzVXMXdfyxSmKFGBiKzuNM8XKI8rbOQlvUJ/5aosyCFt8LOwIE+mtlqEkxcL X-Received: by 2002:a81:8787:0:b0:60a:78aa:a302 with SMTP id x129-20020a818787000000b0060a78aaa302mr1751535ywf.24.1711100625243; Fri, 22 Mar 2024 02:43:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711100625; cv=pass; d=google.com; s=arc-20160816; b=rf8G40vfY/jDnWwMyAvJ2dhMREb3OVMQNIw9VqRzfKFm4Lnc1n9fH31rfmmEXqEwIv Y668NCCJgGZ3Rj4pDy8ovAkPOHEXrYPjrrJZ/NQnUFjF3o/4bzKNbw3onTkwobYqodcK zKoO1cWAZ/HPt4xfVwbcMR9149EF1TKrDcXY285fG2L5AbSSJxo2NXfi5XxnbRQ9Zrw0 9RWNWHwTfDdAU9gjPKgEmgkiljAhzYv2/nXqDR6CXqjSBGDokUpq4Nx1qjiAedUAwm4y rlkolFQKusEa5rf+9I7tgRXf2gsb8J1WNG/fJ8SMrHxPEj+3r3Y/Zyr6Ghu6w+Z7UAUZ c1sA== 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=SCVeYwWPRSz03B1OM4VXzQEUZALrlERjZIgaPDXj1aU=; fh=3l2Q5LtwONjIFfLkWPrpeWDsmMTy2UoWkx8k8QZAkdI=; b=MO8DFGb7qOtwqQtjm9cGamUpsdGg5156agu9/uFPlnq/8H1caonn/6jyvUpHexNzrU tHVqBXT8+19VeiUlEYm9LE0ZqlH2TBLVubwrcxCRxiXtlxIe6/Vsu4qZ2beioMBiel/S slh0vnYMoPWBlRnGJpxD0KMifOqoN3/aUW/E7cPDZ9AJ8xk2C4HJX7meyyyGL1zzhJMc 4BF2jXFLJa8B0XaEcTZX5VJbszzljccKwjYMMkLAzZ5uV/nmoTSejcNjYpubPl/HKP8g 07ZGg2VgbW1fG5CM4MikygfluTKYAEorM3ZTdBzQD43BluUJ/lO6qt/cI+iwtTTa/rtl Lffg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bxSbVXBJ; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-111236-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111236-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 7-20020ac85907000000b00430ec9e6b59si1671379qty.98.2024.03.22.02.43.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 02:43:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-111236-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bxSbVXBJ; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-111236-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111236-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 E1E6D1C2150D for ; Fri, 22 Mar 2024 09:43:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 858253CF65; Fri, 22 Mar 2024 09:42:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="bxSbVXBJ" Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 50CD0C14F for ; Fri, 22 Mar 2024 09:42:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711100572; cv=none; b=Xe2O9SEnxPaehsPtwEeRlMnyFhhBD0TZKX77Vkiqjgz8EYGltuJoUJwWDX2JhCeHeDl06LvEOpELk1grvfLxH2wcWieGXCFCEyku17wTsw9YkK3R0+INsswRBtxcaMPjSP+9qH9G2a4mEGZ8BW7ew2w4AS7dJ41+TolIYklcCmU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711100572; c=relaxed/simple; bh=Kx4iMHJO5z5RGLzsJX88ltZJ+Wx+25o5A/I8DsYjDng=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YNi/nIImNzDz+p9bgkyCYS4TDFB2ut2TAHf9AxfFXanmZgYQBQXA7INnmRHF0FHYBxEmoUcGOuoQ90PFQ815C3ZUAYnZEx4Mqit3SkUBOpcdgzY/LWdaMl3glsIt8fXBCCHg0D/f1PKB+KqqMY01NRFTiikgaspjwv3iruOz+xU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=bxSbVXBJ; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-414701303f7so18370725e9.2 for ; Fri, 22 Mar 2024 02:42:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711100567; x=1711705367; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=SCVeYwWPRSz03B1OM4VXzQEUZALrlERjZIgaPDXj1aU=; b=bxSbVXBJws315bLuoeUeFTBDZEWNGletHf3hZXt756ZSPYO/tHmQCp8d95iZQPDGuO IEvGOlWotNdEDYVkAD8hLK4vqiD4mylz0NbP+WgV04EJGPmkfFUi2QBuwFgZBQ3dxzhQ bqgi9WhEEim0Q1BdiMHjyvtD8gFLQkBTX81x+5cKCEFWOPa/tT0XsrJCKAb80Hv9Tc4s LGB90QS87nxNAAmm5ea1HpM8tW0csCl2QhWtOZ7E36a5QiEPGIDkj2lQ1SvMSqWP7U6o wm5L7jQZzRuitUUoxGYFACcxr9ObhqkLSzOk2iK8ZGI+flwx6shxLXCAhcraVjrpacOX JP6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711100567; x=1711705367; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SCVeYwWPRSz03B1OM4VXzQEUZALrlERjZIgaPDXj1aU=; b=lePjf5QFyyHdl28hv4rkYuQ2xU3GxvGzyRAJzv608UD7ibw7cuQsvEnj/BzmIb7ZNF 1iA0vLfHwV0UEFdbAfCCLFULp9vhfr65Nc6/TMfnXx2z5uwmibrbQe5N6huK4g35DnVe gek1hk2PSnyoiz8YoS9rS8Z6tdviK9ZgFik9Ew1EpQ0lVNOfWR+a9JAPNA9K/7bb2Ir+ m7zD3Ktc+TNuxrXabfaNFdazwjE5Jm4UfMAtP6XHXLuvHmgBXMB4TqzWiDlRXpHlxTqD QT53VG9M+L/1Z9ew8LMYHAXEMHE+a7BvOvzvvgGTsAF+eYZvHGNFZJIbI+6OoRL/E+vh A/hg== X-Forwarded-Encrypted: i=1; AJvYcCUP5F0qA0UKqfAKfKXVLjV8pac3GrIVJjFzf1Rih7Gbs2LZky9K2FWQDLwGw764W9X4Q6iHGhFMBbbkzoZ1Wq4QcVK8ck6Sp8jhkRQX X-Gm-Message-State: AOJu0YzcLMXIIFpRiSX7bR9JcEUGHT3nhDc9rtNH/ABS40dpMBPeSbUY sk8HDTJgGpa2PanIyHALeLUDOqYC9P6DY10oTD/JmT00w9jFyQhnWuhwL8eGC3c= X-Received: by 2002:a05:600c:3b99:b0:413:286c:4fc0 with SMTP id n25-20020a05600c3b9900b00413286c4fc0mr1244065wms.34.1711100566636; Fri, 22 Mar 2024 02:42:46 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id j9-20020a05600c190900b0041461a922c2sm2547845wmq.5.2024.03.22.02.42.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 02:42:46 -0700 (PDT) From: Neil Armstrong Date: Fri, 22 Mar 2024 10:42:39 +0100 Subject: [PATCH v2 2/7] phy: qcom: qmp-pcie: refactor clock register code 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: 7bit Message-Id: <20240322-topic-sm8x50-upstream-pcie-1-phy-aux-clk-v2-2-3ec0a966d52f@linaro.org> References: <20240322-topic-sm8x50-upstream-pcie-1-phy-aux-clk-v2-0-3ec0a966d52f@linaro.org> In-Reply-To: <20240322-topic-sm8x50-upstream-pcie-1-phy-aux-clk-v2-0-3ec0a966d52f@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1993; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=Kx4iMHJO5z5RGLzsJX88ltZJ+Wx+25o5A/I8DsYjDng=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBl/VKRV3QKxg4v+M8JT2fAbX1GHt2A5QnD7QKumt8Z s4yRYgKJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZf1SkQAKCRB33NvayMhJ0RfpD/ 4yoc9hDH+2tgpOUGvP8Jz8d3R1kJ7/9B9wDT3JPRVWRiBiP/dGO1eJl/Iwj+DgYHugvFp+iEPuCUHA /xOMr9SDEZy85xLhmLDBYZCHAQZtLyoYNi02ZwyHJ+cJM1MGMzq8H0NFLoDYVWxVkYJWzVAPOybBwF ojmpu7U1uJSMfycX6t9LfFetWI3+FUu0CZ+jchqV0vk9Io9hUEelywc7t7egRzf5r9XombNqjEaARg 7MIC2yGMb4iC/0T8SOf8fE2w80fzJSgOQuF97GMuEsOCTagBoZTnk6bI8RgKoLbm3X1UewEQXIumaP gw975Bfz02lsG02mE+eeehjA5kiZ8cw4/CUysHJbBMFtvXaCV2pp1ldMpt8l5lgH//+lJFw9/+Cryn j5U9fJxmqF0Si79c1OPURBBqDp1/eluNm7MXx6eDBQ39NILu7Q3qtPolPXyhlQSnwJIz0+dKWkyS0m Zlc3vsrtaoVF3kKYoYios8inatr8RQ8gRd9t/FisXA2OXBU2ylgPMVaavxpeyaGxqKGCuk6g0/o/51 3w6Z1plxH2RdQYlv47OYSI0wae7mKQjttKsd/Gi4opqjTbpWuOeoYaDcakKNAblF7ySlLHYz1Ck616 N082i3ZTsAm26Wgulfz3NipQxmoU85imns6bilNEwAMOxMnuoxLnT4qvmfYA== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE The PCIe Gen4x2 PHY found in the SM8[456]50 SoCs have a second clock, in order to expose it, split the current clock registering in two parts: - CCF clock registering - DT clock registering Keep the of_clk_add_hw_provider/devm_add_action_or_reset to keep compatibility with the legacy subnode bindings. Signed-off-by: Neil Armstrong --- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c index 8836bb1ff0cc..e8da2e9146dc 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c @@ -3664,7 +3664,7 @@ static int phy_pipe_clk_register(struct qmp_pcie *qmp, struct device_node *np) struct clk_init_data init = { }; int ret; - ret = of_property_read_string(np, "clock-output-names", &init.name); + ret = of_property_read_string_index(np, "clock-output-names", 0, &init.name); if (ret) { dev_err(qmp->dev, "%pOFn: No clock-output-names\n", np); return ret; @@ -3683,11 +3683,18 @@ static int phy_pipe_clk_register(struct qmp_pcie *qmp, struct device_node *np) fixed->hw.init = &init; - ret = devm_clk_hw_register(qmp->dev, &fixed->hw); + return devm_clk_hw_register(qmp->dev, &fixed->hw); +} + +static int qmp_pcie_register_clocks(struct qmp_pcie *qmp, struct device_node *np) +{ + int ret; + + ret = phy_pipe_clk_register(qmp, np); if (ret) return ret; - ret = of_clk_add_hw_provider(np, of_clk_hw_simple_get, &fixed->hw); + ret = of_clk_add_hw_provider(np, of_clk_hw_simple_get, &qmp->pipe_clk_fixed.hw); if (ret) return ret; @@ -3899,7 +3906,7 @@ static int qmp_pcie_probe(struct platform_device *pdev) if (ret) goto err_node_put; - ret = phy_pipe_clk_register(qmp, np); + ret = qmp_pcie_register_clocks(qmp, np); if (ret) goto err_node_put; -- 2.34.1