Commit 09be1a39 authored by Christian Marangi's avatar Christian Marangi Committed by Bjorn Andersson

clk: qcom: kpss-xcc: register it as clk provider

krait-cc use this driver for the secondary mux. Register it as a clk
provider to correctly use this clk in other drivers.
Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
Signed-off-by: default avatarBjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20221108211734.3707-1-ansuelsmth@gmail.com
parent ce520e31
...@@ -31,12 +31,13 @@ MODULE_DEVICE_TABLE(of, kpss_xcc_match_table); ...@@ -31,12 +31,13 @@ MODULE_DEVICE_TABLE(of, kpss_xcc_match_table);
static int kpss_xcc_driver_probe(struct platform_device *pdev) static int kpss_xcc_driver_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev;
const struct of_device_id *id; const struct of_device_id *id;
void __iomem *base; void __iomem *base;
struct clk_hw *hw; struct clk_hw *hw;
const char *name; const char *name;
id = of_match_device(kpss_xcc_match_table, &pdev->dev); id = of_match_device(kpss_xcc_match_table, dev);
if (!id) if (!id)
return -ENODEV; return -ENODEV;
...@@ -45,7 +46,7 @@ static int kpss_xcc_driver_probe(struct platform_device *pdev) ...@@ -45,7 +46,7 @@ static int kpss_xcc_driver_probe(struct platform_device *pdev)
return PTR_ERR(base); return PTR_ERR(base);
if (id->data) { if (id->data) {
if (of_property_read_string_index(pdev->dev.of_node, if (of_property_read_string_index(dev->of_node,
"clock-output-names", "clock-output-names",
0, &name)) 0, &name))
return -ENODEV; return -ENODEV;
...@@ -55,12 +56,16 @@ static int kpss_xcc_driver_probe(struct platform_device *pdev) ...@@ -55,12 +56,16 @@ static int kpss_xcc_driver_probe(struct platform_device *pdev)
base += 0x28; base += 0x28;
} }
hw = devm_clk_hw_register_mux_parent_data_table(&pdev->dev, name, aux_parents, hw = devm_clk_hw_register_mux_parent_data_table(dev, name, aux_parents,
ARRAY_SIZE(aux_parents), 0, ARRAY_SIZE(aux_parents), 0,
base, 0, 0x3, base, 0, 0x3,
0, aux_parent_map, NULL); 0, aux_parent_map, NULL);
if (IS_ERR(hw))
return PTR_ERR(hw);
return PTR_ERR_OR_ZERO(hw); of_clk_add_hw_provider(dev->of_node, of_clk_hw_simple_get, hw);
return 0;
} }
static struct platform_driver kpss_xcc_driver = { static struct platform_driver kpss_xcc_driver = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment