[PATCH 3/7] clk: qcom: hfpll: Allow matching pdata

Adam Skladowski posted 7 patches 2 years, 6 months ago
[PATCH 3/7] clk: qcom: hfpll: Allow matching pdata
Posted by Adam Skladowski 2 years, 6 months ago
HFPLL driver can be used to drive PLLs also on different SoCs like MSM8976
On MSM8976 each PLL gets it own different configuration,
add matching pdata to driver to support multiple configurations.

Signed-off-by: Adam Skladowski <a39.skl@gmail.com>
---
 drivers/clk/qcom/hfpll.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/qcom/hfpll.c b/drivers/clk/qcom/hfpll.c
index f4d78003d189..ec18bc8f0089 100644
--- a/drivers/clk/qcom/hfpll.c
+++ b/drivers/clk/qcom/hfpll.c
@@ -6,6 +6,7 @@
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/of.h>
+#include <linux/of_device.h>
 #include <linux/clk.h>
 #include <linux/clk-provider.h>
 #include <linux/regmap.h>
@@ -32,7 +33,7 @@ static const struct hfpll_data hdata = {
 };
 
 static const struct of_device_id qcom_hfpll_match_table[] = {
-	{ .compatible = "qcom,hfpll" },
+	{ .compatible = "qcom,hfpll", &hdata },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, qcom_hfpll_match_table);
@@ -83,7 +84,7 @@ static int qcom_hfpll_probe(struct platform_device *pdev)
 
 	init.parent_data = &pdata;
 
-	h->d = &hdata;
+	h->d = of_device_get_match_data(&pdev->dev);
 	h->clkr.hw.init = &init;
 	spin_lock_init(&h->lock);
 
-- 
2.41.0
Re: [PATCH 3/7] clk: qcom: hfpll: Allow matching pdata
Posted by AngeloGioacchino Del Regno 2 years, 6 months ago
Il 23/07/23 16:06, Adam Skladowski ha scritto:
> HFPLL driver can be used to drive PLLs also on different SoCs like MSM8976
> On MSM8976 each PLL gets it own different configuration,
> add matching pdata to driver to support multiple configurations.
> 
> Signed-off-by: Adam Skladowski <a39.skl@gmail.com>
> ---
>   drivers/clk/qcom/hfpll.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/clk/qcom/hfpll.c b/drivers/clk/qcom/hfpll.c
> index f4d78003d189..ec18bc8f0089 100644
> --- a/drivers/clk/qcom/hfpll.c
> +++ b/drivers/clk/qcom/hfpll.c
> @@ -6,6 +6,7 @@
>   #include <linux/module.h>
>   #include <linux/platform_device.h>
>   #include <linux/of.h>
> +#include <linux/of_device.h>
>   #include <linux/clk.h>
>   #include <linux/clk-provider.h>
>   #include <linux/regmap.h>
> @@ -32,7 +33,7 @@ static const struct hfpll_data hdata = {
>   };
>   
>   static const struct of_device_id qcom_hfpll_match_table[] = {
> -	{ .compatible = "qcom,hfpll" },
> +	{ .compatible = "qcom,hfpll", &hdata },

This is supposed to be

{ .compatible = xxx, .data = &hdata }

Regards,
Angelo

>   	{ }
>   };
>   MODULE_DEVICE_TABLE(of, qcom_hfpll_match_table);
> @@ -83,7 +84,7 @@ static int qcom_hfpll_probe(struct platform_device *pdev)
>   
>   	init.parent_data = &pdata;
>   
> -	h->d = &hdata;
> +	h->d = of_device_get_match_data(&pdev->dev);
>   	h->clkr.hw.init = &init;
>   	spin_lock_init(&h->lock);
>