From patchwork Mon Jul 3 18:20:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 115467 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp715528vqx; Mon, 3 Jul 2023 11:35:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlEkXT7tnG0XuGsQOIxA+T4X1Dddgt4noMryfs7bjxqIy6vbTxwTOzD6LA23auZMWw/JqpIi X-Received: by 2002:a92:c608:0:b0:345:a3d0:f0d4 with SMTP id p8-20020a92c608000000b00345a3d0f0d4mr10359465ilm.3.1688409324631; Mon, 03 Jul 2023 11:35:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688409324; cv=none; d=google.com; s=arc-20160816; b=mr5JiNY9ZM1RN1lmqExlps0wqkLAfUVIJyYRP6+UStDTAllmaM49AqEAjTHJGpj4wM lJV92xFPCY79yt/TSp07JOSiklgDqlk1bguJSvahieL9xZUMl9jBoWoIk49zCYl3jQoG fGD0vyYKafQUAxkeHhqJlAYQLRsZVGWJBHcJOoSjWfRsEsQ0TOS5aH3yPOOyedOwxQQO bIdfMuSjvrDxsDDdwbjJ2CXnm3ia/gUo2hwpz6X5rZMEJFZtTbqPGqdbdwtgUtEg9PCS D25km3UvS9zhv6fF3cYc7x1wuHKTDiA0wJWvUUXZb09HEmP+x3PiTvp/EV7AecbHs6u/ NO5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=IgXZ+eRdRJHN8xsGvQGmmBaJDurThI2IbqW/jpkrGj0=; fh=qlMPOal/Qkg2LQpocX7vYbzTtdVFSj3bgc1rELmt3A8=; b=K16ApryrNFxWfMsEWTTBo3E4AGahJ8A5JG8+L1FdFcTBDbok7WwmYUMIX+tE2X2fBh qSkRDw84+C0NxdprR4pSJT3Gri0zwys2jAzaBLK2Qls+ZG8OBoOLPKrWp5isDuLpVQGS pjDoCJKFOBzkXVHg3PJ5v+4U4RzfVUdbdhuTbRL7xBEqIGgRwDDmT2IzwnKjT6NB+lxc YCSkUbqA/+fehuci/ihdaDheaNlaOpQUBsJrPbFLNQy466r3dp0x3oTXoRSUEX81NYj7 sS7e75VoFTUryINtOBScqUQzZM2Hihw6S974dafPeD4h9Y1CbiC1XPpghDHTvWSdfiCP c1pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uceXZfbY; 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=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 6-20020a17090a190600b002507cbb009bsi19069057pjg.112.2023.07.03.11.35.12; Mon, 03 Jul 2023 11:35:24 -0700 (PDT) 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=@linaro.org header.s=google header.b=uceXZfbY; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231256AbjGCSU1 (ORCPT + 99 others); Mon, 3 Jul 2023 14:20:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231167AbjGCSUW (ORCPT ); Mon, 3 Jul 2023 14:20:22 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3AC2E6D for ; Mon, 3 Jul 2023 11:20:16 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2b6adef5c22so73346751fa.3 for ; Mon, 03 Jul 2023 11:20:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688408415; x=1691000415; 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=IgXZ+eRdRJHN8xsGvQGmmBaJDurThI2IbqW/jpkrGj0=; b=uceXZfbYZOlKkij7wFKMEyEmOpiTzp3vyUd3NWusgPamjZjrHdpgJB50UATD5qUJVN yp9pOw3lJ8SjlVVYm3i9XTH4z67lRQT9XmOFr7EK/+QEn1B6pJDUG73+Fk6XQW/t23a2 v09orOz49sLAu/xYaPDQBEPMjCS1afCRFuR+6U78OnhG8jZvNRC5lXe/en01U6Gg1WjL cR/IIlBbTerGBIy2WAlGeTDhO/9b5YhATd9fyCETx5k0HZbk0ht0bbpSYpR6r3Gp5+fp f7D1r7AhCXIxdpsTXe8BO2DYWL2ll75pKS9vibr74/hVWcznEJImkXoQYS89pdVafroc C2QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688408415; x=1691000415; 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=IgXZ+eRdRJHN8xsGvQGmmBaJDurThI2IbqW/jpkrGj0=; b=IcdtuUIYSN4Yxxp18I069BZKM3KjFJSqSAniIVGgOw/3FqarEdGuGHaE0mrSDzMO/U vnQ4oQ76Q0Srpa37F7TgVL6kWQO0bCECscz8Rg14Ijei5YWifO+OGw0ftjqI9Ce2m2vk j6citQ6SmDBvwOKNBLV1iPmsxXpAxIIGUtx28q880zuuAy+lYhP0iJ7xT/eeii4+LYGE BUC2ZscAV9DlfggFG2SM264JizFLkrGidO8smpHcQ957hQB4Zz3UoTZdNM+RLxlFL8o+ ohVh+SwPmZTTzFNAji7ntrDqtEHFomozQjHQBccaZ+TSsQlyS3D/bz1etDHkDKq2Kvp8 6yZg== X-Gm-Message-State: ABy/qLbMLo+gfDug0WLaaRXcL58CMSGu4OR3zohTI1Py37J+f/MtxZKV 9H3VYcGxxjkm6w5WgY/NwXUAmQ== X-Received: by 2002:a2e:9143:0:b0:2b4:6eb0:2a27 with SMTP id q3-20020a2e9143000000b002b46eb02a27mr8806972ljg.17.1688408415010; Mon, 03 Jul 2023 11:20:15 -0700 (PDT) Received: from [192.168.1.101] (abyj26.neoplus.adsl.tpnet.pl. [83.9.29.26]) by smtp.gmail.com with ESMTPSA id s9-20020a2e9c09000000b002b6995f38a2sm4946224lji.100.2023.07.03.11.20.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 11:20:14 -0700 (PDT) From: Konrad Dybcio Date: Mon, 03 Jul 2023 20:20:08 +0200 Subject: [PATCH v2 4/8] clk: qcom: mmcc-msm8998: Properly consume GPLL0 inputs MIME-Version: 1.0 Message-Id: <20230622-topic-8998clk-v2-4-6222fbc2916b@linaro.org> References: <20230622-topic-8998clk-v2-0-6222fbc2916b@linaro.org> In-Reply-To: <20230622-topic-8998clk-v2-0-6222fbc2916b@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jeffrey Hugo , Taniya Das Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1688408407; l=4937; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=pNpFd/werWG+oLvuHHpeYrlGmkALZ/dmf7xfH7d+kHc=; b=VW4i1+gxxDJfK3DsiUrdpLeAHClFLSCtu4j6f+S5L06ubK/8moZi9q4rRdK2cSupBisds/iH7 KHuuZiZqwb6AZ12Wzu9X4/WrbFYWG53iiaAox16NU35zKUvncwcDm8W X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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?1770425496333225281?= X-GMAIL-MSGID: =?utf-8?q?1770425496333225281?= Up until now, the GPLL0_DIV MMSS input has been modeled as a fixed child of MMSS_GPLL0_DIV that's always-on. Properly representing the former in the GCC driver makes us unable to keep doing so. Consume MSS_GPLL0_DIV through fw_name ("gpll0_div") as well as add a fixed .name link to keep backwards compatibility. Reviewed-by: Jeffrey Hugo Tested-by: Jeffrey Hugo Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/mmcc-msm8998.c | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/drivers/clk/qcom/mmcc-msm8998.c b/drivers/clk/qcom/mmcc-msm8998.c index 4490594bde69..040c495e91e4 100644 --- a/drivers/clk/qcom/mmcc-msm8998.c +++ b/drivers/clk/qcom/mmcc-msm8998.c @@ -46,19 +46,6 @@ enum { P_DPLINK, }; -static struct clk_fixed_factor gpll0_div = { - .mult = 1, - .div = 2, - .hw.init = &(struct clk_init_data){ - .name = "mmss_gpll0_div", - .parent_data = &(const struct clk_parent_data){ - .fw_name = "gpll0" - }, - .num_parents = 1, - .ops = &clk_fixed_factor_ops, - }, -}; - static const struct clk_div_table post_div_table_fabia_even[] = { { 0x0, 1 }, { 0x1, 2 }, @@ -354,7 +341,7 @@ static const struct parent_map mmss_xo_gpll0_gpll0_div_map[] = { static const struct clk_parent_data mmss_xo_gpll0_gpll0_div[] = { { .fw_name = "xo" }, { .fw_name = "gpll0" }, - { .hw = &gpll0_div.hw }, + { .fw_name = "gpll0_div", .name = "gcc_mmss_gpll0_div_clk" }, }; static const struct parent_map mmss_xo_mmpll0_gpll0_gpll0_div_map[] = { @@ -368,7 +355,7 @@ static const struct clk_parent_data mmss_xo_mmpll0_gpll0_gpll0_div[] = { { .fw_name = "xo" }, { .hw = &mmpll0_out_even.clkr.hw }, { .fw_name = "gpll0" }, - { .hw = &gpll0_div.hw }, + { .fw_name = "gpll0_div", .name = "gcc_mmss_gpll0_div_clk" }, }; static const struct parent_map mmss_xo_mmpll0_mmpll1_gpll0_gpll0_div_map[] = { @@ -384,7 +371,7 @@ static const struct clk_parent_data mmss_xo_mmpll0_mmpll1_gpll0_gpll0_div[] = { { .hw = &mmpll0_out_even.clkr.hw }, { .hw = &mmpll1_out_even.clkr.hw }, { .fw_name = "gpll0" }, - { .hw = &gpll0_div.hw }, + { .fw_name = "gpll0_div", .name = "gcc_mmss_gpll0_div_clk" }, }; static const struct parent_map mmss_xo_mmpll0_mmpll5_gpll0_gpll0_div_map[] = { @@ -400,7 +387,7 @@ static const struct clk_parent_data mmss_xo_mmpll0_mmpll5_gpll0_gpll0_div[] = { { .hw = &mmpll0_out_even.clkr.hw }, { .hw = &mmpll5_out_even.clkr.hw }, { .fw_name = "gpll0" }, - { .hw = &gpll0_div.hw }, + { .fw_name = "gpll0_div", .name = "gcc_mmss_gpll0_div_clk" }, }; static const struct parent_map mmss_xo_mmpll0_mmpll3_mmpll6_gpll0_gpll0_div_map[] = { @@ -418,7 +405,7 @@ static const struct clk_parent_data mmss_xo_mmpll0_mmpll3_mmpll6_gpll0_gpll0_div { .hw = &mmpll3_out_even.clkr.hw }, { .hw = &mmpll6_out_even.clkr.hw }, { .fw_name = "gpll0" }, - { .hw = &gpll0_div.hw }, + { .fw_name = "gpll0_div", .name = "gcc_mmss_gpll0_div_clk" }, }; static const struct parent_map mmss_xo_mmpll4_mmpll7_mmpll10_gpll0_gpll0_div_map[] = { @@ -436,7 +423,7 @@ static const struct clk_parent_data mmss_xo_mmpll4_mmpll7_mmpll10_gpll0_gpll0_di { .hw = &mmpll7_out_even.clkr.hw }, { .hw = &mmpll10_out_even.clkr.hw }, { .fw_name = "gpll0" }, - { .hw = &gpll0_div.hw }, + { .fw_name = "gpll0_div", .name = "gcc_mmss_gpll0_div_clk" }, }; static const struct parent_map mmss_xo_mmpll0_mmpll7_mmpll10_gpll0_gpll0_div_map[] = { @@ -454,7 +441,7 @@ static const struct clk_parent_data mmss_xo_mmpll0_mmpll7_mmpll10_gpll0_gpll0_di { .hw = &mmpll7_out_even.clkr.hw }, { .hw = &mmpll10_out_even.clkr.hw }, { .fw_name = "gpll0" }, - { .hw = &gpll0_div.hw }, + { .fw_name = "gpll0_div", .name = "gcc_mmss_gpll0_div_clk" }, }; static const struct parent_map mmss_xo_mmpll0_mmpll4_mmpll7_mmpll10_gpll0_gpll0_div_map[] = { @@ -474,7 +461,7 @@ static const struct clk_parent_data mmss_xo_mmpll0_mmpll4_mmpll7_mmpll10_gpll0_g { .hw = &mmpll7_out_even.clkr.hw }, { .hw = &mmpll10_out_even.clkr.hw }, { .fw_name = "gpll0" }, - { .hw = &gpll0_div.hw }, + { .fw_name = "gpll0_div", .name = "gcc_mmss_gpll0_div_clk" }, }; static struct clk_rcg2 byte0_clk_src = { @@ -2544,10 +2531,6 @@ static struct clk_branch vmem_ahb_clk = { }, }; -static struct clk_hw *mmcc_msm8998_hws[] = { - &gpll0_div.hw, -}; - static struct gdsc video_top_gdsc = { .gdscr = 0x1024, .pd = { @@ -2855,8 +2838,6 @@ static const struct qcom_cc_desc mmcc_msm8998_desc = { .num_resets = ARRAY_SIZE(mmcc_msm8998_resets), .gdscs = mmcc_msm8998_gdscs, .num_gdscs = ARRAY_SIZE(mmcc_msm8998_gdscs), - .clk_hws = mmcc_msm8998_hws, - .num_clk_hws = ARRAY_SIZE(mmcc_msm8998_hws), }; static const struct of_device_id mmcc_msm8998_match_table[] = {