From patchwork Fri Nov 11 09:24:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 13039978 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 149D4C4167B for ; Fri, 11 Nov 2022 09:26:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pqrArlYHUvKVeIBblbipkRht0BhchbuRqa4jDCuaybk=; b=NCL6+loPN9mUf+ IgRwIXNy7EIz+W8G3vVHPNnpMHfAIiJskwh1laZgHXq8rStOIJfY1bFdQZpqHQEkyFVFDgJIyNdqR Z52ZEoeKAmPSurlFGW2xxuEV01hVQPQhCMOzGhrBfV+dzE6ef8qeE9aBUzcFm7csm4znEJcvOgF53 +ga/0kiQC83GcY7y9xwSECXwLqTgfY5+POcxLxeVwwNDBSrVe2LAYrShXm38TJ+Rr5L9ekY8EyJrF SP++p3hbGu1KKJay2XIOLLZuYvTSe/fXj1E+QaygHc66KpofI08gsucKdf21HaVUyU05l3SHN6MEY 64PTNHZMscRxKqW94o2Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1otQIj-00EaNZ-Bp; Fri, 11 Nov 2022 09:26:17 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1otQIZ-00EaGk-NT for linux-phy@lists.infradead.org; Fri, 11 Nov 2022 09:26:13 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 55B6861F21; Fri, 11 Nov 2022 09:26:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18EB8C4167D; Fri, 11 Nov 2022 09:26:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668158765; bh=T9qqTTBL27ycLB1W/KzDlhrr+fxrApzTdIw4MN0Ey6I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dHKfKYMGVMadIo0eJUaMr8jltPskcAKWZ6BW0NJje0uRDKWt3NAeTlWUvz5axT5c8 54PhJJ5Tr84XIBhuv69S+ufmb67UjYzV4vIdFqvlsE+fAM8UcaonjXhy4z+qmz1+9O ZupfEOgejTyJWkHJ80E4i3+a9QdmZqfVvMQirgn7nxqsJWFqs55bQAdXw4RqkOmLmr APHoZ4x4alf1lGbC/DJtUx3HBzvzum4ekX5nXGxP8AOSMHTIb5gyHx99R3Mgj+R0xp i2zzqhDIgLx7+x9CLx4UiHxqi4KydB1GIoy0+0ffy7blRrASkZhalXwTeaPlCVqeN7 kPYhGalitvkCg== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1otQI5-0002lB-80; Fri, 11 Nov 2022 10:25:37 +0100 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 09/14] phy: qcom-qmp-combo: add clock registration helper Date: Fri, 11 Nov 2022 10:24:52 +0100 Message-Id: <20221111092457.10546-10-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221111092457.10546-1-johan+linaro@kernel.org> References: <20221111092457.10546-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221111_012608_242478_68F3E653 X-CRM114-Status: GOOD ( 14.28 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org In preparation for supporting devicetree bindings which do not use child nodes, add a clock registration helper to handle the registration of both the USB and DP clocks. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov --- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c index d513b8924aee..4309ae6db997 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c @@ -2459,6 +2459,22 @@ static int phy_dp_clks_register(struct qmp_combo *qmp, struct device_node *np) return devm_add_action_or_reset(qmp->dev, phy_clk_release_provider, np); } +static int qmp_combo_register_clocks(struct qmp_combo *qmp, struct device_node *usb_np, + struct device_node *dp_np) +{ + int ret; + + ret = phy_pipe_clk_register(qmp, usb_np); + if (ret) + return ret; + + ret = phy_dp_clks_register(qmp, dp_np); + if (ret) + return ret; + + return 0; +} + static int qmp_combo_parse_dt_lecacy_dp(struct qmp_combo *qmp, struct device_node *np) { const struct qmp_phy_cfg *cfg = qmp->cfg; @@ -2618,11 +2634,7 @@ static int qmp_combo_probe(struct platform_device *pdev) if (ret) goto err_node_put; - ret = phy_pipe_clk_register(qmp, usb_np); - if (ret) - goto err_node_put; - - ret = phy_dp_clks_register(qmp, dp_np); + ret = qmp_combo_register_clocks(qmp, usb_np, dp_np); if (ret) goto err_node_put;