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

clk: qcom: a53pll/mux: Use unique clock name

Different from MSM8916 which has only one a53pll/mux clock, MSM8939 gets
three for Cluster0 (little cores), Cluster1 (big cores) and CCI (Cache
Coherent Interconnect). That said, a53pll/mux clock needs to be named
uniquely. Append @unit-address of device node to the clock name, so
that a53pll/mux will be named like below on MSM8939.

a53pll@b016000
a53pll@b116000
a53pll@b1d0000

a53mux@b1d1000
a53mux@b011000
a53mux@b111000

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Link: https://lore.kernel.org/r/20210704024032.11559-3-shawn.guo@linaro.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Shawn Guo and committed by
Stephen Boyd
05cc560c 0dfe9bf9

+14 -2
+7 -1
drivers/clk/qcom/a53-pll.c
··· 37 37 static int qcom_a53pll_probe(struct platform_device *pdev) 38 38 { 39 39 struct device *dev = &pdev->dev; 40 + struct device_node *np = dev->of_node; 40 41 struct regmap *regmap; 41 42 struct resource *res; 42 43 struct clk_pll *pll; ··· 67 66 pll->status_bit = 16; 68 67 pll->freq_tbl = a53pll_freq; 69 68 70 - init.name = "a53pll"; 69 + /* Use an unique name by appending @unit-address */ 70 + init.name = devm_kasprintf(dev, GFP_KERNEL, "a53pll%s", 71 + strchrnul(np->full_name, '@')); 72 + if (!init.name) 73 + return -ENOMEM; 74 + 71 75 init.parent_names = (const char *[]){ "xo" }; 72 76 init.num_parents = 1; 73 77 init.ops = &clk_pll_sr2_ops;
+7 -1
drivers/clk/qcom/apcs-msm8916.c
··· 46 46 { 47 47 struct device *dev = &pdev->dev; 48 48 struct device *parent = dev->parent; 49 + struct device_node *np = parent->of_node; 49 50 struct clk_regmap_mux_div *a53cc; 50 51 struct regmap *regmap; 51 52 struct clk_init_data init = { }; ··· 62 61 if (!a53cc) 63 62 return -ENOMEM; 64 63 65 - init.name = "a53mux"; 64 + /* Use an unique name by appending parent's @unit-address */ 65 + init.name = devm_kasprintf(dev, GFP_KERNEL, "a53mux%s", 66 + strchrnul(np->full_name, '@')); 67 + if (!init.name) 68 + return -ENOMEM; 69 + 66 70 init.parent_data = pdata; 67 71 init.num_parents = ARRAY_SIZE(pdata); 68 72 init.ops = &clk_regmap_mux_div_ops;