Skip to content

Commit c3db512

Browse files
Ansuelbebarino
authored andcommitted
clk: qcom: kpss-xcc: convert to parent data API
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>
1 parent d791565 commit c3db512

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

drivers/clk/qcom/kpss-xcc.c

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
#include <linux/clk.h>
1313
#include <linux/clk-provider.h>
1414

15-
static const char *aux_parents[] = {
16-
"pll8_vote",
17-
"pxo",
15+
static const struct clk_parent_data aux_parents[] = {
16+
{ .fw_name = "pll8_vote", .name = "pll8_vote" },
17+
{ .fw_name = "pxo", .name = "pxo_board" },
1818
};
1919

2020
static const u32 aux_parent_map[] = {
@@ -32,8 +32,8 @@ MODULE_DEVICE_TABLE(of, kpss_xcc_match_table);
3232
static int kpss_xcc_driver_probe(struct platform_device *pdev)
3333
{
3434
const struct of_device_id *id;
35-
struct clk *clk;
3635
void __iomem *base;
36+
struct clk_hw *hw;
3737
const char *name;
3838

3939
id = of_match_device(kpss_xcc_match_table, &pdev->dev);
@@ -55,24 +55,16 @@ static int kpss_xcc_driver_probe(struct platform_device *pdev)
5555
base += 0x28;
5656
}
5757

58-
clk = clk_register_mux_table(&pdev->dev, name, aux_parents,
59-
ARRAY_SIZE(aux_parents), 0, base, 0, 0x3,
60-
0, aux_parent_map, NULL);
58+
hw = devm_clk_hw_register_mux_parent_data_table(&pdev->dev, name, aux_parents,
59+
ARRAY_SIZE(aux_parents), 0,
60+
base, 0, 0x3,
61+
0, aux_parent_map, NULL);
6162

62-
platform_set_drvdata(pdev, clk);
63-
64-
return PTR_ERR_OR_ZERO(clk);
65-
}
66-
67-
static int kpss_xcc_driver_remove(struct platform_device *pdev)
68-
{
69-
clk_unregister_mux(platform_get_drvdata(pdev));
70-
return 0;
63+
return PTR_ERR_OR_ZERO(hw);
7164
}
7265

7366
static struct platform_driver kpss_xcc_driver = {
7467
.probe = kpss_xcc_driver_probe,
75-
.remove = kpss_xcc_driver_remove,
7668
.driver = {
7769
.name = "kpss-xcc",
7870
.of_match_table = kpss_xcc_match_table,

0 commit comments

Comments
 (0)