1 // SPDX-License-Identifier: GPL-2.0
2 // Copyright (c) 2018, The Linux Foundation. All rights reserved.
4 #include <linux/kernel.h>
5 #include <linux/init.h>
6 #include <linux/module.h>
7 #include <linux/platform_device.h>
8 #include <linux/property.h>
12 #include <linux/clk.h>
13 #include <linux/clk-provider.h>
15 static const struct clk_parent_data aux_parents[] = {
16 { .fw_name = "pll8_vote", .name = "pll8_vote" },
17 { .fw_name = "pxo", .name = "pxo_board" },
20 static const u32 aux_parent_map[] = {
25 static const struct of_device_id kpss_xcc_match_table[] = {
26 { .compatible = "qcom,kpss-acc-v1", .data = (void *)1UL },
27 { .compatible = "qcom,kpss-gcc" },
30 MODULE_DEVICE_TABLE(of, kpss_xcc_match_table);
32 static int kpss_xcc_driver_probe(struct platform_device *pdev)
34 struct device *dev = &pdev->dev;
39 base = devm_platform_ioremap_resource(pdev, 0);
43 if (device_get_match_data(&pdev->dev)) {
44 if (of_property_read_string_index(dev->of_node,
54 hw = devm_clk_hw_register_mux_parent_data_table(dev, name, aux_parents,
55 ARRAY_SIZE(aux_parents), 0,
57 0, aux_parent_map, NULL);
61 of_clk_add_hw_provider(dev->of_node, of_clk_hw_simple_get, hw);
66 static struct platform_driver kpss_xcc_driver = {
67 .probe = kpss_xcc_driver_probe,
70 .of_match_table = kpss_xcc_match_table,
73 module_platform_driver(kpss_xcc_driver);
75 MODULE_DESCRIPTION("Krait Processor Sub System (KPSS) Clock Driver");
76 MODULE_LICENSE("GPL v2");
77 MODULE_ALIAS("platform:kpss-xcc");