Skip to content

Commit a5c9c3b

Browse files
Srinivas-Kandagatlaandersson
authored andcommitted
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
1 parent 5683f11 commit a5c9c3b

3 files changed

Lines changed: 74 additions & 0 deletions

File tree

drivers/clk/qcom/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,15 @@ config SC_LPASSCC_7280
550550
Say Y if you want to use the LPASS branch clocks of the LPASS clock
551551
controller to reset the LPASS subsystem.
552552

553+
config SC_LPASSCC_8280XP
554+
tristate "SC8280 Low Power Audio Subsystem (LPASS) Clock Controller"
555+
depends on ARM64 || COMPILE_TEST
556+
select SC_GCC_8280XP
557+
help
558+
Support for the LPASS clock controller on SC8280XP devices.
559+
Say Y if you want to use the LPASS branch clocks of the LPASS clock
560+
controller to reset the LPASS subsystem.
561+
553562
config SC_LPASS_CORECC_7180
554563
tristate "SC7180 LPASS Core Clock Controller"
555564
depends on ARM64 || COMPILE_TEST

drivers/clk/qcom/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ obj-$(CONFIG_SC_GPUCC_7180) += gpucc-sc7180.o
8181
obj-$(CONFIG_SC_GPUCC_7280) += gpucc-sc7280.o
8282
obj-$(CONFIG_SC_GPUCC_8280XP) += gpucc-sc8280xp.o
8383
obj-$(CONFIG_SC_LPASSCC_7280) += lpasscc-sc7280.o
84+
obj-$(CONFIG_SC_LPASSCC_8280XP) += lpasscc-sc8280xp.o
8485
obj-$(CONFIG_SC_LPASS_CORECC_7180) += lpasscorecc-sc7180.o
8586
obj-$(CONFIG_SC_LPASS_CORECC_7280) += lpasscorecc-sc7280.o lpassaudiocc-sc7280.o
8687
obj-$(CONFIG_SC_MSS_7180) += mss-sc7180.o
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
/*
3+
* Copyright (c) 2022, Linaro Limited
4+
*/
5+
6+
#include <linux/clk-provider.h>
7+
#include <linux/err.h>
8+
#include <linux/kernel.h>
9+
#include <linux/module.h>
10+
#include <linux/of_device.h>
11+
#include <linux/regmap.h>
12+
13+
#include <dt-bindings/clock/qcom,sc8280xp-lpasscc.h>
14+
15+
#include "common.h"
16+
#include "reset.h"
17+
18+
static const struct qcom_reset_map lpasscc_sc8280xp_resets[] = {
19+
[LPASS_AUDIO_SWR_TX_CGCR] = { 0xc010, 1 },
20+
};
21+
22+
static struct regmap_config lpasscc_sc8280xp_regmap_config = {
23+
.reg_bits = 32,
24+
.reg_stride = 4,
25+
.val_bits = 32,
26+
.name = "lpass-tcsr",
27+
.max_register = 0x12000,
28+
};
29+
30+
static const struct qcom_cc_desc lpasscc_sc8280xp_reset_desc = {
31+
.config = &lpasscc_sc8280xp_regmap_config,
32+
.resets = lpasscc_sc8280xp_resets,
33+
.num_resets = ARRAY_SIZE(lpasscc_sc8280xp_resets),
34+
};
35+
36+
static const struct of_device_id lpasscc_sc8280xp_match_table[] = {
37+
{
38+
.compatible = "qcom,sc8280xp-lpasscc",
39+
.data = &lpasscc_sc8280xp_reset_desc,
40+
},
41+
{ }
42+
};
43+
MODULE_DEVICE_TABLE(of, lpasscc_sc8280xp_match_table);
44+
45+
static int lpasscc_sc8280xp_probe(struct platform_device *pdev)
46+
{
47+
const struct qcom_cc_desc *desc = of_device_get_match_data(&pdev->dev);
48+
49+
return qcom_cc_probe_by_index(pdev, 0, desc);
50+
}
51+
52+
static struct platform_driver lpasscc_sc8280xp_driver = {
53+
.probe = lpasscc_sc8280xp_probe,
54+
.driver = {
55+
.name = "lpasscc-sc8280xp",
56+
.of_match_table = lpasscc_sc8280xp_match_table,
57+
},
58+
};
59+
60+
module_platform_driver(lpasscc_sc8280xp_driver);
61+
62+
MODULE_AUTHOR("Srinivas Kandagatla <srinivas.kandagatla@linaro.org>");
63+
MODULE_DESCRIPTION("QTI LPASSCC SC8280XP Driver");
64+
MODULE_LICENSE("GPL");

0 commit comments

Comments
 (0)