1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2022, Linaro Limited
6 #include <linux/clk-provider.h>
8 #include <linux/kernel.h>
9 #include <linux/mod_devicetable.h>
10 #include <linux/module.h>
12 #include <linux/platform_device.h>
13 #include <linux/regmap.h>
15 #include <dt-bindings/clock/qcom,sc8280xp-lpasscc.h>
20 static const struct qcom_reset_map lpass_audiocc_sc8280xp_resets
[] = {
21 [LPASS_AUDIO_SWR_RX_CGCR
] = { 0xa0, 1 },
22 [LPASS_AUDIO_SWR_WSA_CGCR
] = { 0xb0, 1 },
23 [LPASS_AUDIO_SWR_WSA2_CGCR
] = { 0xd8, 1 },
26 static const struct regmap_config lpass_audiocc_sc8280xp_regmap_config
= {
30 .name
= "lpass-audio-csr",
31 .max_register
= 0x1000,
34 static const struct qcom_cc_desc lpass_audiocc_sc8280xp_reset_desc
= {
35 .config
= &lpass_audiocc_sc8280xp_regmap_config
,
36 .resets
= lpass_audiocc_sc8280xp_resets
,
37 .num_resets
= ARRAY_SIZE(lpass_audiocc_sc8280xp_resets
),
40 static const struct qcom_reset_map lpasscc_sc8280xp_resets
[] = {
41 [LPASS_AUDIO_SWR_TX_CGCR
] = { 0xc010, 1 },
44 static const struct regmap_config lpasscc_sc8280xp_regmap_config
= {
49 .max_register
= 0x12000,
52 static const struct qcom_cc_desc lpasscc_sc8280xp_reset_desc
= {
53 .config
= &lpasscc_sc8280xp_regmap_config
,
54 .resets
= lpasscc_sc8280xp_resets
,
55 .num_resets
= ARRAY_SIZE(lpasscc_sc8280xp_resets
),
58 static const struct of_device_id lpasscc_sc8280xp_match_table
[] = {
60 .compatible
= "qcom,sc8280xp-lpassaudiocc",
61 .data
= &lpass_audiocc_sc8280xp_reset_desc
,
63 .compatible
= "qcom,sc8280xp-lpasscc",
64 .data
= &lpasscc_sc8280xp_reset_desc
,
68 MODULE_DEVICE_TABLE(of
, lpasscc_sc8280xp_match_table
);
70 static int lpasscc_sc8280xp_probe(struct platform_device
*pdev
)
72 const struct qcom_cc_desc
*desc
= of_device_get_match_data(&pdev
->dev
);
74 return qcom_cc_probe_by_index(pdev
, 0, desc
);
77 static struct platform_driver lpasscc_sc8280xp_driver
= {
78 .probe
= lpasscc_sc8280xp_probe
,
80 .name
= "lpasscc-sc8280xp",
81 .of_match_table
= lpasscc_sc8280xp_match_table
,
85 module_platform_driver(lpasscc_sc8280xp_driver
);
87 MODULE_AUTHOR("Srinivas Kandagatla <srinivas.kandagatla@linaro.org>");
88 MODULE_DESCRIPTION("QTI LPASSCC SC8280XP Driver");
89 MODULE_LICENSE("GPL");