Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

clk: qcom: apss-ipq-pll: use OF match data for Alpha PLL config

Convert the driver to use OF match data for providing the Alpha PLL config
per compatible.
This is required for IPQ8074 support since it uses a different Alpha PLL
config.

While we are here rename "ipq_pll_config" to "ipq6018_pll_config" to make
it clear that it is for IPQ6018 only.

Signed-off-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20220818220628.339366-5-robimarko@gmail.com

authored by

Robert Marko and committed by
Bjorn Andersson
823a117e d522c77a

+9 -3
+9 -3
drivers/clk/qcom/apss-ipq-pll.c
··· 2 2 // Copyright (c) 2018, The Linux Foundation. All rights reserved. 3 3 #include <linux/clk-provider.h> 4 4 #include <linux/module.h> 5 + #include <linux/of_device.h> 5 6 #include <linux/platform_device.h> 6 7 #include <linux/regmap.h> 7 8 ··· 37 36 }, 38 37 }; 39 38 40 - static const struct alpha_pll_config ipq_pll_config = { 39 + static const struct alpha_pll_config ipq6018_pll_config = { 41 40 .l = 0x37, 42 41 .config_ctl_val = 0x04141200, 43 42 .config_ctl_hi_val = 0x0, ··· 55 54 56 55 static int apss_ipq_pll_probe(struct platform_device *pdev) 57 56 { 57 + const struct alpha_pll_config *ipq_pll_config; 58 58 struct device *dev = &pdev->dev; 59 59 struct regmap *regmap; 60 60 void __iomem *base; ··· 69 67 if (IS_ERR(regmap)) 70 68 return PTR_ERR(regmap); 71 69 72 - clk_alpha_pll_configure(&ipq_pll, regmap, &ipq_pll_config); 70 + ipq_pll_config = of_device_get_match_data(&pdev->dev); 71 + if (!ipq_pll_config) 72 + return -ENODEV; 73 + 74 + clk_alpha_pll_configure(&ipq_pll, regmap, ipq_pll_config); 73 75 74 76 ret = devm_clk_register_regmap(dev, &ipq_pll.clkr); 75 77 if (ret) ··· 84 78 } 85 79 86 80 static const struct of_device_id apss_ipq_pll_match_table[] = { 87 - { .compatible = "qcom,ipq6018-a53pll" }, 81 + { .compatible = "qcom,ipq6018-a53pll", .data = &ipq6018_pll_config }, 88 82 { } 89 83 }; 90 84 MODULE_DEVICE_TABLE(of, apss_ipq_pll_match_table);