Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / clk / qcom / lpasscc-sc8280xp.c
blob9fd9498d7dc8ac96c97ebe7b97d1c269090212a8
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * Copyright (c) 2022, Linaro Limited
4 */
6 #include <linux/clk-provider.h>
7 #include <linux/err.h>
8 #include <linux/kernel.h>
9 #include <linux/mod_devicetable.h>
10 #include <linux/module.h>
11 #include <linux/of.h>
12 #include <linux/platform_device.h>
13 #include <linux/regmap.h>
15 #include <dt-bindings/clock/qcom,sc8280xp-lpasscc.h>
17 #include "common.h"
18 #include "reset.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 = {
27 .reg_bits = 32,
28 .reg_stride = 4,
29 .val_bits = 32,
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 = {
45 .reg_bits = 32,
46 .reg_stride = 4,
47 .val_bits = 32,
48 .name = "lpass-tcsr",
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,
62 }, {
63 .compatible = "qcom,sc8280xp-lpasscc",
64 .data = &lpasscc_sc8280xp_reset_desc,
66 { }
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,
79 .driver = {
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");