Commit cdbbc480 authored by Taniya Das's avatar Taniya Das Committed by Bjorn Andersson
Browse files

clk: qcom: lpassaudiocc-sc7280: Add support for LPASS resets for QCM6490



On the QCM6490 boards, the LPASS firmware controls the complete clock
controller functionalities and associated power domains. However, only
the LPASS resets required to be controlled by the high level OS. Thus,
add support for the resets in the clock driver to enable the Audio SW
driver to assert/deassert the audio resets as needed.

Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: default avatarTaniya Das <quic_tdas@quicinc.com>
Link: https://lore.kernel.org/r/20250221-lpass_qcm6490_resets-v5-2-6be0c0949a83@quicinc.com


Signed-off-by: default avatarBjorn Andersson <andersson@kernel.org>
parent c16e576b
Loading
Loading
Loading
Loading
+19 −4
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2021, The Linux Foundation. All rights reserved.
 * Copyright (c) 2025, Qualcomm Innovation Center, Inc. All rights reserved.
 */

#include <linux/clk-provider.h>
@@ -713,14 +714,24 @@ static const struct qcom_reset_map lpass_audio_cc_sc7280_resets[] = {
	[LPASS_AUDIO_SWR_WSA_CGCR] = { 0xb0, 1 },
};

static const struct regmap_config lpass_audio_cc_sc7280_reset_regmap_config = {
	.name = "lpassaudio_cc_reset",
	.reg_bits = 32,
	.reg_stride = 4,
	.val_bits = 32,
	.fast_io = true,
	.max_register = 0xc8,
};

static const struct qcom_cc_desc lpass_audio_cc_reset_sc7280_desc = {
	.config = &lpass_audio_cc_sc7280_regmap_config,
	.config = &lpass_audio_cc_sc7280_reset_regmap_config,
	.resets = lpass_audio_cc_sc7280_resets,
	.num_resets = ARRAY_SIZE(lpass_audio_cc_sc7280_resets),
};

static const struct of_device_id lpass_audio_cc_sc7280_match_table[] = {
	{ .compatible = "qcom,sc7280-lpassaudiocc" },
	{ .compatible = "qcom,qcm6490-lpassaudiocc", .data = &lpass_audio_cc_reset_sc7280_desc },
	{ .compatible = "qcom,sc7280-lpassaudiocc", .data = &lpass_audio_cc_sc7280_desc },
	{ }
};
MODULE_DEVICE_TABLE(of, lpass_audio_cc_sc7280_match_table);
@@ -752,13 +763,17 @@ static int lpass_audio_cc_sc7280_probe(struct platform_device *pdev)
	struct regmap *regmap;
	int ret;

	desc = device_get_match_data(&pdev->dev);

	if (of_device_is_compatible(pdev->dev.of_node, "qcom,qcm6490-lpassaudiocc"))
		return qcom_cc_probe_by_index(pdev, 1, desc);

	ret = lpass_audio_setup_runtime_pm(pdev);
	if (ret)
		return ret;

	lpass_audio_cc_sc7280_regmap_config.name = "lpassaudio_cc";
	lpass_audio_cc_sc7280_regmap_config.max_register = 0x2f000;
	desc = &lpass_audio_cc_sc7280_desc;

	regmap = qcom_cc_map(pdev, desc);
	if (IS_ERR(regmap)) {
@@ -772,7 +787,7 @@ static int lpass_audio_cc_sc7280_probe(struct platform_device *pdev)
	regmap_write(regmap, 0x4, 0x3b);
	regmap_write(regmap, 0x8, 0xff05);

	ret = qcom_cc_really_probe(&pdev->dev, &lpass_audio_cc_sc7280_desc, regmap);
	ret = qcom_cc_really_probe(&pdev->dev, desc, regmap);
	if (ret) {
		dev_err(&pdev->dev, "Failed to register LPASS AUDIO CC clocks\n");
		goto exit;