Lines Matching +full:qcm2290 +full:- +full:cnoc

1 // SPDX-License-Identifier: GPL-2.0-only
7 #include <linux/clk-provider.h>
16 #include <linux/soc/qcom/smd-rpm.h>
18 #include <dt-bindings/clock/qcom,rpmcc.h>
193 .key = cpu_to_le32(r->rpm_key), in clk_smd_rpm_handoff()
195 .value = cpu_to_le32(r->branch ? 1 : INT_MAX), in clk_smd_rpm_handoff()
199 r->rpm_res_type, r->rpm_clk_id, &req, in clk_smd_rpm_handoff()
204 r->rpm_res_type, r->rpm_clk_id, &req, in clk_smd_rpm_handoff()
216 .key = cpu_to_le32(r->rpm_key), in clk_smd_rpm_set_rate_active()
222 r->rpm_res_type, r->rpm_clk_id, &req, in clk_smd_rpm_set_rate_active()
230 .key = cpu_to_le32(r->rpm_key), in clk_smd_rpm_set_rate_sleep()
236 r->rpm_res_type, r->rpm_clk_id, &req, in clk_smd_rpm_set_rate_sleep()
246 * Active-only clocks don't care what the rate is during sleep. So, in to_active_sleep()
249 if (r->active_only) in to_active_sleep()
258 struct clk_smd_rpm *peer = r->peer; in clk_smd_rpm_prepare()
267 if (!r->rate) in clk_smd_rpm_prepare()
270 to_active_sleep(r, r->rate, &this_rate, &this_sleep_rate); in clk_smd_rpm_prepare()
273 if (peer->enabled) in clk_smd_rpm_prepare()
274 to_active_sleep(peer, peer->rate, in clk_smd_rpm_prepare()
279 if (r->branch) in clk_smd_rpm_prepare()
287 if (r->branch) in clk_smd_rpm_prepare()
297 r->enabled = true; in clk_smd_rpm_prepare()
307 struct clk_smd_rpm *peer = r->peer; in clk_smd_rpm_unprepare()
314 if (!r->rate) in clk_smd_rpm_unprepare()
318 if (peer->enabled) in clk_smd_rpm_unprepare()
319 to_active_sleep(peer, peer->rate, &peer_rate, in clk_smd_rpm_unprepare()
322 active_rate = r->branch ? !!peer_rate : peer_rate; in clk_smd_rpm_unprepare()
327 sleep_rate = r->branch ? !!peer_sleep_rate : peer_sleep_rate; in clk_smd_rpm_unprepare()
332 r->enabled = false; in clk_smd_rpm_unprepare()
342 struct clk_smd_rpm *peer = r->peer; in clk_smd_rpm_set_rate()
350 if (!r->enabled) in clk_smd_rpm_set_rate()
356 if (peer->enabled) in clk_smd_rpm_set_rate()
357 to_active_sleep(peer, peer->rate, in clk_smd_rpm_set_rate()
370 r->rate = rate; in clk_smd_rpm_set_rate()
399 return r->rate; in clk_smd_rpm_recalc_rate()
461 DEFINE_CLK_SMD_RPM_BUS(cnoc, 2);
464 DEFINE_CLK_SMD_RPM_BUS(cnoc, 1);
1213 { .compatible = "qcom,rpmcc-mdm9607", .data = &rpm_clk_mdm9607 },
1214 { .compatible = "qcom,rpmcc-msm8226", .data = &rpm_clk_msm8974 },
1215 { .compatible = "qcom,rpmcc-msm8909", .data = &rpm_clk_msm8909 },
1216 { .compatible = "qcom,rpmcc-msm8916", .data = &rpm_clk_msm8916 },
1217 { .compatible = "qcom,rpmcc-msm8917", .data = &rpm_clk_msm8917 },
1218 { .compatible = "qcom,rpmcc-msm8936", .data = &rpm_clk_msm8936 },
1219 { .compatible = "qcom,rpmcc-msm8953", .data = &rpm_clk_msm8953 },
1220 { .compatible = "qcom,rpmcc-msm8974", .data = &rpm_clk_msm8974 },
1221 { .compatible = "qcom,rpmcc-msm8976", .data = &rpm_clk_msm8976 },
1222 { .compatible = "qcom,rpmcc-msm8992", .data = &rpm_clk_msm8992 },
1223 { .compatible = "qcom,rpmcc-msm8994", .data = &rpm_clk_msm8994 },
1224 { .compatible = "qcom,rpmcc-msm8996", .data = &rpm_clk_msm8996 },
1225 { .compatible = "qcom,rpmcc-msm8998", .data = &rpm_clk_msm8998 },
1226 { .compatible = "qcom,rpmcc-qcm2290", .data = &rpm_clk_qcm2290 },
1227 { .compatible = "qcom,rpmcc-qcs404", .data = &rpm_clk_qcs404 },
1228 { .compatible = "qcom,rpmcc-sdm660", .data = &rpm_clk_sdm660 },
1229 { .compatible = "qcom,rpmcc-sm6115", .data = &rpm_clk_sm6115 },
1230 { .compatible = "qcom,rpmcc-sm6125", .data = &rpm_clk_sm6125 },
1231 { .compatible = "qcom,rpmcc-sm6375", .data = &rpm_clk_sm6375 },
1240 unsigned int idx = clkspec->args[0]; in qcom_smdrpm_clk_hw_get()
1242 if (idx >= desc->num_clks) { in qcom_smdrpm_clk_hw_get()
1244 return ERR_PTR(-EINVAL); in qcom_smdrpm_clk_hw_get()
1247 return desc->clks[idx] ? &desc->clks[idx]->hw : ERR_PTR(-ENOENT); in qcom_smdrpm_clk_hw_get()
1265 rpmcc_smd_rpm = dev_get_drvdata(pdev->dev.parent); in rpm_smd_clk_probe()
1267 dev_err(&pdev->dev, "Unable to retrieve handle to RPM\n"); in rpm_smd_clk_probe()
1268 return -ENODEV; in rpm_smd_clk_probe()
1271 desc = of_device_get_match_data(&pdev->dev); in rpm_smd_clk_probe()
1273 return -EINVAL; in rpm_smd_clk_probe()
1275 rpm_smd_clks = desc->clks; in rpm_smd_clk_probe()
1276 num_clks = desc->num_clks; in rpm_smd_clk_probe()
1278 if (desc->scaling_before_handover) { in rpm_smd_clk_probe()
1293 for (i = 0; i < desc->num_icc_clks; i++) { in rpm_smd_clk_probe()
1294 if (!desc->icc_clks[i]) in rpm_smd_clk_probe()
1297 ret = clk_smd_rpm_handoff(desc->icc_clks[i]); in rpm_smd_clk_probe()
1302 if (!desc->scaling_before_handover) { in rpm_smd_clk_probe()
1312 ret = devm_clk_hw_register(&pdev->dev, &rpm_smd_clks[i]->hw); in rpm_smd_clk_probe()
1317 ret = devm_of_clk_add_hw_provider(&pdev->dev, qcom_smdrpm_clk_hw_get, in rpm_smd_clk_probe()
1322 icc_pdev = platform_device_register_data(pdev->dev.parent, in rpm_smd_clk_probe()
1323 "icc_smd_rpm", -1, NULL, 0); in rpm_smd_clk_probe()
1325 dev_err(&pdev->dev, "Failed to register icc_smd_rpm device: %pE\n", in rpm_smd_clk_probe()
1329 ret = devm_add_action_or_reset(&pdev->dev, rpm_smd_unregister_icc, in rpm_smd_clk_probe()
1337 dev_err(&pdev->dev, "Error registering SMD clock driver (%d)\n", ret); in rpm_smd_clk_probe()
1343 .name = "qcom-clk-smd-rpm",
1363 MODULE_ALIAS("platform:qcom-clk-smd-rpm");