From patchwork Tue Nov 8 21:17:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 17225 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2963806wru; Tue, 8 Nov 2022 13:46:56 -0800 (PST) X-Google-Smtp-Source: AMsMyM6GTyjWCPADpJ30bOIhjxPRgJrVp8y0LW+3aVUBZ9WXk7NdoRH2oNgi5LSyzJzKw2fvuO6M X-Received: by 2002:a05:6402:3510:b0:461:f781:6dfe with SMTP id b16-20020a056402351000b00461f7816dfemr56099586edd.272.1667944015869; Tue, 08 Nov 2022 13:46:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667944015; cv=none; d=google.com; s=arc-20160816; b=UDStCKuAIbAGPdQHMhO8ilPLP/d4I0xY3kYs4DzuiIru8B0BNqww85Yjs6W47QBYqs BjRKDRbmy8K4BwbFF5o3jfWSyZjEtFgrhi2ppk7aZHm4Y/Z3jWFhhw9JcVpGyvXGwcqp c8Gy5J8wtoVUv7MC/Im6WAeP4Zku5qDbX/OpTABfg8jRhiv0wKoE7AXtHOzMYkH1Z8wq y3KWE7HvtRUbK72PKGQuZc8BIwqKzSKtOQhKXFZzJrFvEpri2lAmUnSDnf9HWR1XH5ab 9gS/4eCsiCq71RWPKLYG0HsIsIiKKCOuTv6lf0gaxzT8TQAyVdv9CUL6mycSUoTfBuwk E2PA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=JaQ3qz4RAxB0OZvGVNsixJMinEHr+Sa/4oPbj4kqOBA=; b=c11S4uZnFjNQTdxqR+rv415/W2ABH1peJpAdUnEOFvAyKNNf96Bgv/1T6LdkmFGprl 76Uy6ulFn49/ff30ipCcADvJTLE0jvrPEizNmTZqfQVzQG07POgMkdG4LdoWonks+mjX XC4UGIJ81JIoW42NNqtKDEvlLeNaAG044A3+X+JP6iLYABrPN/5y2netT0jl42SS8xpP Sj7UGwGE9weJvwzyh1Bzplqeuo0MwTlluCI8EyekE+S4S2bSwMluNiyuuyjAc2mIh3PF OCngOFkBEFyzNpqzoKpR23TFZR/19Q6yA14hBLsl3SKEJprc451Mpu7PxUMUJw4A/hgG h6hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="Mxkb/Cgp"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gg3-20020a170906e28300b007807e1ea26csi10460490ejb.637.2022.11.08.13.46.32; Tue, 08 Nov 2022 13:46:55 -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=@gmail.com header.s=20210112 header.b="Mxkb/Cgp"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229733AbiKHVRy (ORCPT + 99 others); Tue, 8 Nov 2022 16:17:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229801AbiKHVRr (ORCPT ); Tue, 8 Nov 2022 16:17:47 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5069160356; Tue, 8 Nov 2022 13:17:43 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id y16so22893544wrt.12; Tue, 08 Nov 2022 13:17:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=JaQ3qz4RAxB0OZvGVNsixJMinEHr+Sa/4oPbj4kqOBA=; b=Mxkb/CgpSin7mV3Vzf7xtXQ0c62wTqd7CKX7ftEpwmSr7vrwIteF4BqUjxqqimJfTO IdU74fecVdLsD4gBDDKI8JiEM8XHjIkdVyBz6pt+u6SmqZZzNW5yomEbh71H0n55/NtE kgoElk2VPcuCzbRSLaodyhNoLS6mT2oHHy76rNhb7rW7LVF3a2+1GVNf1SMrmNxr+UaR 7P/FDnrDlOS2zM1Bdf1RTnMh0O9o5TF0Dpsbtl6KmRUYSkLSL8eZ6h1/h8MiDqhGAILs J5UO8W5IsvH5WUQ9L8vHJUf8IQVxvwuv4xTxRPHk3dkMpaPw9st5uPmQQJVNhPjqAmzQ te3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JaQ3qz4RAxB0OZvGVNsixJMinEHr+Sa/4oPbj4kqOBA=; b=O5jIoRuwOl76Y+RFl01irGjqcMjobSB7vlZhCRia+/s2NzyliHhB6KvEat9fihCjE2 pv3IvyZoVKwFMuLV1BnWnzl9iJYfcRtjMqWm6duyWdEHUemhsy7aUqImr/BEhlXjfVNQ /jACiGb7jNPiyDT+pjnqo0Sq+LY1V1jEAT3odG9dtugusNs4K0Bl0sseRVO3TrcnK4yM p4A1wrc132N6PgJyYu3RJJ/7dZ2sUP0F0sFzhpzrsPWbtzRZRaHJSRfB4LxtEg+5dQz+ grWC4sGoibky1R7mp+DPAOIRltnZRAfo4SLYLYbhcPvyBW5NcrIYOI/GGMTphogi62JJ be3A== X-Gm-Message-State: ANoB5pmewRM5+PqfvcX/QBFPzuo1Xrf6YriT7hjUmeBtqJcVBjO1KYdb JCk7kzednJZ/HJ5Gca46Fz8= X-Received: by 2002:a5d:6392:0:b0:23b:4b0d:4591 with SMTP id p18-20020a5d6392000000b0023b4b0d4591mr15899667wru.635.1667942261715; Tue, 08 Nov 2022 13:17:41 -0800 (PST) Received: from localhost.localdomain (93-42-71-18.ip85.fastwebnet.it. [93.42.71.18]) by smtp.googlemail.com with ESMTPSA id t20-20020a05600c199400b003cf9bf5208esm14337980wmq.19.2022.11.08.13.17.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Nov 2022 13:17:41 -0800 (PST) From: Christian Marangi To: Bjorn Andersson , Andy Gross , Konrad Dybcio , Michael Turquette , Stephen Boyd , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christian Marangi Subject: [PATCH] clk: qcom: kpss-xcc: register it as clk provider Date: Tue, 8 Nov 2022 22:17:34 +0100 Message-Id: <20221108211734.3707-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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?1748966064256849348?= X-GMAIL-MSGID: =?utf-8?q?1748966064256849348?= krait-cc use this driver for the secondary mux. Register it as a clk provider to correctly use this clk in other drivers. Signed-off-by: Christian Marangi --- drivers/clk/qcom/kpss-xcc.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/clk/qcom/kpss-xcc.c b/drivers/clk/qcom/kpss-xcc.c index b1b370274ec4..97358c98c6c9 100644 --- a/drivers/clk/qcom/kpss-xcc.c +++ b/drivers/clk/qcom/kpss-xcc.c @@ -31,12 +31,13 @@ MODULE_DEVICE_TABLE(of, kpss_xcc_match_table); static int kpss_xcc_driver_probe(struct platform_device *pdev) { + struct device *dev = &pdev->dev; const struct of_device_id *id; void __iomem *base; struct clk_hw *hw; const char *name; - id = of_match_device(kpss_xcc_match_table, &pdev->dev); + id = of_match_device(kpss_xcc_match_table, dev); if (!id) return -ENODEV; @@ -45,7 +46,7 @@ static int kpss_xcc_driver_probe(struct platform_device *pdev) return PTR_ERR(base); if (id->data) { - if (of_property_read_string_index(pdev->dev.of_node, + if (of_property_read_string_index(dev->of_node, "clock-output-names", 0, &name)) return -ENODEV; @@ -55,12 +56,16 @@ static int kpss_xcc_driver_probe(struct platform_device *pdev) base += 0x28; } - hw = devm_clk_hw_register_mux_parent_data_table(&pdev->dev, name, aux_parents, + hw = devm_clk_hw_register_mux_parent_data_table(dev, name, aux_parents, ARRAY_SIZE(aux_parents), 0, base, 0, 0x3, 0, aux_parent_map, NULL); + if (IS_ERR(hw)) + return PTR_ERR(hw); - return PTR_ERR_OR_ZERO(hw); + of_clk_add_hw_provider(dev->of_node, of_clk_hw_simple_get, hw); + + return 0; } static struct platform_driver kpss_xcc_driver = {