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: 18603 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp637146wru; Fri, 11 Nov 2022 01:27:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf5wADZo3Fw3sawxeQMq5EROfDMrPH426dLnEO+5x12xBa6MAhj6hNnKe6HC1usGcs2qUcZI X-Received: by 2002:a17:907:7659:b0:7a0:3125:f1e5 with SMTP id kj25-20020a170907765900b007a03125f1e5mr1162932ejc.314.1668158848672; Fri, 11 Nov 2022 01:27:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668158848; cv=none; d=google.com; s=arc-20160816; b=sIoBXMSFhwvP/7H0ncEZgUxvDvmefOR6MMy2gSY6aZA/+gNoPspxia+9/fxzGguYcw 0WdPk4rTFoo8PTQevPGMpZTRU9cM//bsIfcZbe2dy6xwHS56rgrDm/1MpKyR5m8E+X1x BTbsO+ROgUTTRhwEav6uWfbnV28O27JPUViI302MMmHJamdWcrrlQGAGyQr7wWdIpHBT gph0sxzt0CSgYqQ6inNKOXMfI3GhYykfKX1DF5NyqOSdwejK7pJH6f2+NRq+KR9JRafb Uwr5WCP54t4byf+4LDcx/lJqTEpyHB3BLTYDVNBL3btcwOxZ9kUFUsmy3+b5Hlhd+M14 1Tdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8Pf1H/biHsSJbVICwuSjPj048M9vRczGCEKJSbxRJgQ=; b=bdpBF+AnP6u8325zmMQo73NKRlLBZziGOFCIi57WVabEMvfhTBipA/vhPWaqUxsNpn 7fiYzrBJ9YUHZOmGmQleWnLaxWIdrjruRed6nDS1ZcPEFbkVScuDisNmp7FK5RbE8nPV chqhhxkfG+sZ8MLR589G2SjlAcGBBDgwC6TMvpZskRS5db48SUvZWVoJ7mBFPO9XZTkl wwp1dJ6X05FVjkb60N4i1pCK8Kk+Oje9791UMUGH0FaMn6bawCnegPVPtooAK8Ra13oQ KjhVdzGdlBnXI1C79t+4mUGAzsJlO9TkxP5/uIMcq13Gh+d6EkgJJ2s6vqwPmGqa9mlk WF0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dHKfKYMG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n19-20020a05640206d300b00458ea275c22si1584672edy.325.2022.11.11.01.27.02; Fri, 11 Nov 2022 01:27:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dHKfKYMG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233586AbiKKJ0a (ORCPT + 99 others); Fri, 11 Nov 2022 04:26:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233685AbiKKJ0S (ORCPT ); Fri, 11 Nov 2022 04:26:18 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18EAE78796; Fri, 11 Nov 2022 01:26:06 -0800 (PST) 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 61F8361F14; Fri, 11 Nov 2022 09:26:06 +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-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749191332985173192?= X-GMAIL-MSGID: =?utf-8?q?1749191332985173192?= 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;