-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clk: qcom: Add lpass clock controller driver for SC8280XP
Add support for the lpass clock controller found on SC8280XP based devices. This would allow lpass peripheral loader drivers to control the clocks and bring the subsystems out of reset. Currently this patch only supports resets as the Q6DSP is in control of LPASS IP which manages most of the clocks via Q6PRM service on GPR rpmsg channel. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Johan Hovold <johan+linaro@kernel.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230608125315.11454-4-srinivas.kandagatla@linaro.org
- Loading branch information
Srinivas Kandagatla
authored and
Bjorn Andersson
committed
Jun 13, 2023
1 parent
5683f11
commit a5c9c3b
Showing
3 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
/* | ||
* Copyright (c) 2022, Linaro Limited | ||
*/ | ||
|
||
#include <linux/clk-provider.h> | ||
#include <linux/err.h> | ||
#include <linux/kernel.h> | ||
#include <linux/module.h> | ||
#include <linux/of_device.h> | ||
#include <linux/regmap.h> | ||
|
||
#include <dt-bindings/clock/qcom,sc8280xp-lpasscc.h> | ||
|
||
#include "common.h" | ||
#include "reset.h" | ||
|
||
static const struct qcom_reset_map lpasscc_sc8280xp_resets[] = { | ||
[LPASS_AUDIO_SWR_TX_CGCR] = { 0xc010, 1 }, | ||
}; | ||
|
||
static struct regmap_config lpasscc_sc8280xp_regmap_config = { | ||
.reg_bits = 32, | ||
.reg_stride = 4, | ||
.val_bits = 32, | ||
.name = "lpass-tcsr", | ||
.max_register = 0x12000, | ||
}; | ||
|
||
static const struct qcom_cc_desc lpasscc_sc8280xp_reset_desc = { | ||
.config = &lpasscc_sc8280xp_regmap_config, | ||
.resets = lpasscc_sc8280xp_resets, | ||
.num_resets = ARRAY_SIZE(lpasscc_sc8280xp_resets), | ||
}; | ||
|
||
static const struct of_device_id lpasscc_sc8280xp_match_table[] = { | ||
{ | ||
.compatible = "qcom,sc8280xp-lpasscc", | ||
.data = &lpasscc_sc8280xp_reset_desc, | ||
}, | ||
{ } | ||
}; | ||
MODULE_DEVICE_TABLE(of, lpasscc_sc8280xp_match_table); | ||
|
||
static int lpasscc_sc8280xp_probe(struct platform_device *pdev) | ||
{ | ||
const struct qcom_cc_desc *desc = of_device_get_match_data(&pdev->dev); | ||
|
||
return qcom_cc_probe_by_index(pdev, 0, desc); | ||
} | ||
|
||
static struct platform_driver lpasscc_sc8280xp_driver = { | ||
.probe = lpasscc_sc8280xp_probe, | ||
.driver = { | ||
.name = "lpasscc-sc8280xp", | ||
.of_match_table = lpasscc_sc8280xp_match_table, | ||
}, | ||
}; | ||
|
||
module_platform_driver(lpasscc_sc8280xp_driver); | ||
|
||
MODULE_AUTHOR("Srinivas Kandagatla <srinivas.kandagatla@linaro.org>"); | ||
MODULE_DESCRIPTION("QTI LPASSCC SC8280XP Driver"); | ||
MODULE_LICENSE("GPL"); |