OSDN Git Service

clk: qcom: kpss-xcc: convert to parent data API
authorChristian Marangi <ansuelsmth@gmail.com>
Wed, 14 Sep 2022 14:47:43 +0000 (16:47 +0200)
committerStephen Boyd <sboyd@kernel.org>
Tue, 4 Oct 2022 03:50:22 +0000 (20:50 -0700)
Convert the driver to parent data API. From the Documentation pll8_vote
and pxo should be declared in the DTS so fw_name can be used instead of
parent_names. .name is changed to the legacy pxo_board following how
it's declared in other drivers.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Link: https://lore.kernel.org/r/20220914144743.17369-2-ansuelsmth@gmail.com
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/qcom/kpss-xcc.c

index 88d4b33..b1b3702 100644 (file)
@@ -12,9 +12,9 @@
 #include <linux/clk.h>
 #include <linux/clk-provider.h>
 
-static const char *aux_parents[] = {
-       "pll8_vote",
-       "pxo",
+static const struct clk_parent_data aux_parents[] = {
+       { .fw_name = "pll8_vote", .name = "pll8_vote" },
+       { .fw_name = "pxo", .name = "pxo_board" },
 };
 
 static const u32 aux_parent_map[] = {
@@ -32,8 +32,8 @@ MODULE_DEVICE_TABLE(of, kpss_xcc_match_table);
 static int kpss_xcc_driver_probe(struct platform_device *pdev)
 {
        const struct of_device_id *id;
-       struct clk *clk;
        void __iomem *base;
+       struct clk_hw *hw;
        const char *name;
 
        id = of_match_device(kpss_xcc_match_table, &pdev->dev);
@@ -55,24 +55,16 @@ static int kpss_xcc_driver_probe(struct platform_device *pdev)
                base += 0x28;
        }
 
-       clk = clk_register_mux_table(&pdev->dev, name, aux_parents,
-                                    ARRAY_SIZE(aux_parents), 0, base, 0, 0x3,
-                                    0, aux_parent_map, NULL);
+       hw = devm_clk_hw_register_mux_parent_data_table(&pdev->dev, name, aux_parents,
+                                                       ARRAY_SIZE(aux_parents), 0,
+                                                       base, 0, 0x3,
+                                                       0, aux_parent_map, NULL);
 
-       platform_set_drvdata(pdev, clk);
-
-       return PTR_ERR_OR_ZERO(clk);
-}
-
-static int kpss_xcc_driver_remove(struct platform_device *pdev)
-{
-       clk_unregister_mux(platform_get_drvdata(pdev));
-       return 0;
+       return PTR_ERR_OR_ZERO(hw);
 }
 
 static struct platform_driver kpss_xcc_driver = {
        .probe = kpss_xcc_driver_probe,
-       .remove = kpss_xcc_driver_remove,
        .driver = {
                .name = "kpss-xcc",
                .of_match_table = kpss_xcc_match_table,