From patchwork Tue Nov 15 14:39:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 20418 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2768100wru; Tue, 15 Nov 2022 06:44:22 -0800 (PST) X-Google-Smtp-Source: AA0mqf5WRNKJi1aBps2H6hq76Jpyy8m25LSIeHNJb/x4qCjqpO5GCpxn8b3RTEBCC4716kyZIKGR X-Received: by 2002:a50:f68c:0:b0:463:c067:8277 with SMTP id d12-20020a50f68c000000b00463c0678277mr15674053edn.185.1668523462278; Tue, 15 Nov 2022 06:44:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668523462; cv=none; d=google.com; s=arc-20160816; b=EtppqZr3gNZP1wW3AzoA2sue5DZUhGZgop8s7yViTGfbRHdUo+0uxUZ/EJcqn8O276 748tDG1bpvhO94mAAhJgAwl5hul/ufd5mG0HnpxJ39v0jKWxNaG7wjcFXEQursfLHvPb PMGfB0nMdefFbfn25WrcPmCKVAonKVi25/iTZ5arB0y8QQwuHpKT7Z0Y1R6bJTduq0KW JrBxRNGmyI4eujXaTdbVtC6z22d/3HcZlHX27M/mPXO0wpd5JA8etwiOTdnfop9gMe3Q VWgUx5NWnMK/9PEVk7Pcwca4b+AUsfhC1oK6EfdpqOxx8IHxaw+tyNoC281nuZCDF2Pp GFxg== 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=+c9liiv1dEk6ICReXreJ32scSckDlZbEQ2khJ1mHGkY=; b=jFZKHzLdXEghEncZ3ngAhV/CDsfsDoeDqNANTlNaHLAeILsLzrvGMh88klioWd/5Lj VHa+dM28CqL1FkfTdoitVniEWp7XscC8hPJNiizDNfTgIpouhMeY5PSf25I49DW5K8qp fsBT6n7UiIRwZSjme8a3wrXZSCEePKwJctUnyO5xzInqZ/+tj1IzdLbGy/4Nde1pdteP 0G0ZrWXYEnwHXJQf56Ygys+4nbba0JhtaNb1kYjUmFnY5ZDn1CP+bIs7u+VLWWtFbPE5 79qofygq4F0GS0+MKywIJKYV+NGMFDxBAW1wnDsVZTxx+/F0d+LWtkmZoysOnbXpLOw5 bRPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c4sUW9ho; 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 g3-20020a170906868300b0073c14b6560bsi10080433ejx.177.2022.11.15.06.43.57; Tue, 15 Nov 2022 06:44:22 -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=c4sUW9ho; 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 S238340AbiKOOlu (ORCPT + 99 others); Tue, 15 Nov 2022 09:41:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232592AbiKOOk4 (ORCPT ); Tue, 15 Nov 2022 09:40:56 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADD782A73A; Tue, 15 Nov 2022 06:40:55 -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 ams.source.kernel.org (Postfix) with ESMTPS id 6500DB81992; Tue, 15 Nov 2022 14:40:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0107C43163; Tue, 15 Nov 2022 14:40:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668523252; bh=S5xseugGMZk5s5FcsKTKBF2KLbZ80lWoZS12gqBQ1d4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c4sUW9hogyCa31J6Qv+mNMfxHSZnXctk6F1/KzR4T23CozYKpCBu8eW/K82jeOUr9 Pqzqhhiz/kUHDOAjaWfp8+oe6DDT3iGrpdpcFhRt5IHvu0ysr6VGpQXwmPlFqT+Y/C kCqmUZHYT9UUghQxhnJkBD7eRyeSjpG2i030G8W8dH3k1SPdfHZGCMIWK76Xoc5TXz gK6B188jBQbd/WkVu/GlKqKamU4lxlnJC6gy+65Y1w2flzsCDMYmrY5gSp67RdRVfB mn4l+tZOSzjdB/9OYereSDnNlZB2S5YnTqPvivus8Q5tmlV44WfYDVFCuZhRQ2YTW1 3aByUrcGxtgeQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1oux6t-0000ff-4z; Tue, 15 Nov 2022 15:40:23 +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, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v2 08/15] phy: qcom-qmp-combo: add clock registration helper Date: Tue, 15 Nov 2022 15:39:58 +0100 Message-Id: <20221115144005.2478-9-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221115144005.2478-1-johan+linaro@kernel.org> References: <20221115144005.2478-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?1749573658287875144?= X-GMAIL-MSGID: =?utf-8?q?1749573658287875144?= 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. Reviewed-by: Dmitry Baryshkov Signed-off-by: Johan Hovold --- 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 9b945a72ae9b..1079a16b45f6 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c @@ -2447,6 +2447,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) { struct device *dev = qmp->dev; @@ -2606,11 +2622,7 @@ static int qmp_combo_probe(struct platform_device *pdev) */ pm_runtime_forbid(dev); - 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;