1 From d08c79b818767f24c3c9cbba585d8a3ec896c1a1 Mon Sep 17 00:00:00 2001
2 From: Christian Marangi <ansuelsmth@gmail.com>
3 Date: Thu, 17 Feb 2022 22:43:34 +0100
4 Subject: [PATCH 4/4] clk: qcom: kpss-xcc: convert to parent data API
6 Convert the driver to parent data API. From the Documentation pll8_vote
7 and pxo should be declared in the DTS so fw_name can be used instead of
8 parent_names. Name is still used to save regression on old definition.
10 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
12 drivers/clk/qcom/kpss-xcc.c | 26 +++++++++-----------------
13 1 file changed, 9 insertions(+), 17 deletions(-)
15 --- a/drivers/clk/qcom/kpss-xcc.c
16 +++ b/drivers/clk/qcom/kpss-xcc.c
18 #include <linux/clk.h>
19 #include <linux/clk-provider.h>
21 -static const char *aux_parents[] = {
24 +static const struct clk_parent_data aux_parents[] = {
25 + { .name = "pll8_vote", .fw_name = "pll8_vote" },
26 + { .name = "pxo", .fw_name = "pxo" },
29 static unsigned int aux_parent_map[] = {
30 @@ -32,9 +32,9 @@ MODULE_DEVICE_TABLE(of, kpss_xcc_match_t
31 static int kpss_xcc_driver_probe(struct platform_device *pdev)
33 const struct of_device_id *id;
40 id = of_match_device(kpss_xcc_match_table, &pdev->dev);
41 @@ -57,24 +57,16 @@ static int kpss_xcc_driver_probe(struct
45 - clk = clk_register_mux_table(&pdev->dev, name, aux_parents,
46 - ARRAY_SIZE(aux_parents), 0, base, 0, 0x3,
47 - 0, aux_parent_map, NULL);
48 + hw = devm_clk_hw_register_mux_parent_data_table(&pdev->dev, name, aux_parents,
49 + ARRAY_SIZE(aux_parents), 0,
51 + 0, aux_parent_map, NULL);
53 - platform_set_drvdata(pdev, clk);
55 - return PTR_ERR_OR_ZERO(clk);
58 -static int kpss_xcc_driver_remove(struct platform_device *pdev)
60 - clk_unregister_mux(platform_get_drvdata(pdev));
62 + return PTR_ERR_OR_ZERO(hw);
65 static struct platform_driver kpss_xcc_driver = {
66 .probe = kpss_xcc_driver_probe,
67 - .remove = kpss_xcc_driver_remove,
70 .of_match_table = kpss_xcc_match_table,