clk-rpmh.c (320424c7d44f54c18df9812fd7c45f6963524002) clk-rpmh.c (be5b605d34cdf2ddd6bc8fb771f6351a39ba958c)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
4 */
5
6#include <linux/clk-provider.h>
7#include <linux/err.h>
8#include <linux/kernel.h>

--- 522 unchanged lines hidden (view full) ---

531 [RPMH_HWKM_CLK] = &sm8350_hwkm.hw,
532};
533
534static const struct clk_rpmh_desc clk_rpmh_sc7280 = {
535 .clks = sc7280_rpmh_clocks,
536 .num_clks = ARRAY_SIZE(sc7280_rpmh_clocks),
537};
538
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
4 */
5
6#include <linux/clk-provider.h>
7#include <linux/err.h>
8#include <linux/kernel.h>

--- 522 unchanged lines hidden (view full) ---

531 [RPMH_HWKM_CLK] = &sm8350_hwkm.hw,
532};
533
534static const struct clk_rpmh_desc clk_rpmh_sc7280 = {
535 .clks = sc7280_rpmh_clocks,
536 .num_clks = ARRAY_SIZE(sc7280_rpmh_clocks),
537};
538
539DEFINE_CLK_RPMH_VRM(sm6350, ln_bb_clk2, ln_bb_clk2_ao, "lnbclkg2", 4);
540DEFINE_CLK_RPMH_VRM(sm6350, ln_bb_clk3, ln_bb_clk3_ao, "lnbclkg3", 4);
541DEFINE_CLK_RPMH_ARC(sm6350, qlink, qlink_ao, "qphy.lvl", 0x1, 4);
542
543static struct clk_hw *sm6350_rpmh_clocks[] = {
544 [RPMH_CXO_CLK] = &sc7280_bi_tcxo.hw,
545 [RPMH_CXO_CLK_A] = &sc7280_bi_tcxo_ao.hw,
546 [RPMH_LN_BB_CLK2] = &sm6350_ln_bb_clk2.hw,
547 [RPMH_LN_BB_CLK2_A] = &sm6350_ln_bb_clk2_ao.hw,
548 [RPMH_LN_BB_CLK3] = &sm6350_ln_bb_clk3.hw,
549 [RPMH_LN_BB_CLK3_A] = &sm6350_ln_bb_clk3_ao.hw,
550 [RPMH_QLINK_CLK] = &sm6350_qlink.hw,
551 [RPMH_QLINK_CLK_A] = &sm6350_qlink_ao.hw,
552};
553
554static const struct clk_rpmh_desc clk_rpmh_sm6350 = {
555 .clks = sm6350_rpmh_clocks,
556 .num_clks = ARRAY_SIZE(sm6350_rpmh_clocks),
557};
558
539static struct clk_hw *of_clk_rpmh_hw_get(struct of_phandle_args *clkspec,
540 void *data)
541{
542 struct clk_rpmh_desc *rpmh = data;
543 unsigned int idx = clkspec->args[0];
544
545 if (idx >= rpmh->num_clks) {
546 pr_err("%s: invalid index %u\n", __func__, idx);

--- 71 unchanged lines hidden (view full) ---

618 return 0;
619}
620
621static const struct of_device_id clk_rpmh_match_table[] = {
622 { .compatible = "qcom,sc7180-rpmh-clk", .data = &clk_rpmh_sc7180},
623 { .compatible = "qcom,sc8180x-rpmh-clk", .data = &clk_rpmh_sc8180x},
624 { .compatible = "qcom,sdm845-rpmh-clk", .data = &clk_rpmh_sdm845},
625 { .compatible = "qcom,sdx55-rpmh-clk", .data = &clk_rpmh_sdx55},
559static struct clk_hw *of_clk_rpmh_hw_get(struct of_phandle_args *clkspec,
560 void *data)
561{
562 struct clk_rpmh_desc *rpmh = data;
563 unsigned int idx = clkspec->args[0];
564
565 if (idx >= rpmh->num_clks) {
566 pr_err("%s: invalid index %u\n", __func__, idx);

--- 71 unchanged lines hidden (view full) ---

638 return 0;
639}
640
641static const struct of_device_id clk_rpmh_match_table[] = {
642 { .compatible = "qcom,sc7180-rpmh-clk", .data = &clk_rpmh_sc7180},
643 { .compatible = "qcom,sc8180x-rpmh-clk", .data = &clk_rpmh_sc8180x},
644 { .compatible = "qcom,sdm845-rpmh-clk", .data = &clk_rpmh_sdm845},
645 { .compatible = "qcom,sdx55-rpmh-clk", .data = &clk_rpmh_sdx55},
646 { .compatible = "qcom,sm6350-rpmh-clk", .data = &clk_rpmh_sm6350},
626 { .compatible = "qcom,sm8150-rpmh-clk", .data = &clk_rpmh_sm8150},
627 { .compatible = "qcom,sm8250-rpmh-clk", .data = &clk_rpmh_sm8250},
628 { .compatible = "qcom,sm8350-rpmh-clk", .data = &clk_rpmh_sm8350},
629 { .compatible = "qcom,sc7280-rpmh-clk", .data = &clk_rpmh_sc7280},
630 { }
631};
632MODULE_DEVICE_TABLE(of, clk_rpmh_match_table);
633

--- 22 unchanged lines hidden ---
647 { .compatible = "qcom,sm8150-rpmh-clk", .data = &clk_rpmh_sm8150},
648 { .compatible = "qcom,sm8250-rpmh-clk", .data = &clk_rpmh_sm8250},
649 { .compatible = "qcom,sm8350-rpmh-clk", .data = &clk_rpmh_sm8350},
650 { .compatible = "qcom,sc7280-rpmh-clk", .data = &clk_rpmh_sc7280},
651 { }
652};
653MODULE_DEVICE_TABLE(of, clk_rpmh_match_table);
654

--- 22 unchanged lines hidden ---