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.

Merge tag 'samsung-drivers-soc-pm-domains-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into next/drivers

Pull "soc: samsung: pm_domains for v4.11" from Krzysztof Kozłowski:

Improve the PM domains driver for Exynos by displaying a user-friendly name of
power domain. Till now, the name of node from DT was used which mostly is just
"power-domain". We need more than that.

* tag 'samsung-drivers-soc-pm-domains-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux:
soc: samsung: pm_domains: Read domain name from the new label property
soc: samsung: pm_domains: Remove message about failed memory allocation
soc: samsung: pm_domains: Remove unused name field
soc: samsung: pm_domains: Use full names in subdomains registration log

+18 -10
+4
Documentation/devicetree/bindings/power/pd-samsung.txt
··· 13 13 must be 0. 14 14 15 15 Optional Properties: 16 + - label: Human readable string with domain name. Will be visible in userspace 17 + to let user to distinguish between multiple domains in SoC. 16 18 - clocks: List of clock handles. The parent clocks of the input clocks to the 17 19 devices in this power domain are set to oscclk before power gating 18 20 and restored back after powering on a domain. This is required for ··· 41 39 compatible = "samsung,exynos4210-pd"; 42 40 reg = <0x10023C00 0x10>; 43 41 #power-domain-cells = <0>; 42 + label = "LCD0"; 44 43 }; 45 44 46 45 mfc_pd: power-domain@10044060 { ··· 50 47 clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MOUT_USER_ACLK333>; 51 48 clock-names = "oscclk", "clk0"; 52 49 #power-domain-cells = <0>; 50 + label = "MFC"; 53 51 }; 54 52 55 53 See Documentation/devicetree/bindings/power/power_domain.txt for description
+14 -10
drivers/soc/samsung/pm_domains.c
··· 35 35 */ 36 36 struct exynos_pm_domain { 37 37 void __iomem *base; 38 - char const *name; 39 38 bool is_off; 40 39 struct generic_pm_domain pd; 41 40 struct clk *oscclk; ··· 69 70 pd->pclk[i] = clk_get_parent(pd->clk[i]); 70 71 if (clk_set_parent(pd->clk[i], pd->oscclk)) 71 72 pr_err("%s: error setting oscclk as parent to clock %d\n", 72 - pd->name, i); 73 + domain->name, i); 73 74 } 74 75 } 75 76 ··· 100 101 continue; /* Skip on first power up */ 101 102 if (clk_set_parent(pd->clk[i], pd->pclk[i])) 102 103 pr_err("%s: error setting parent to clock%d\n", 103 - pd->name, i); 104 + domain->name, i); 104 105 } 105 106 } 106 107 ··· 142 143 { }, 143 144 }; 144 145 146 + static __init const char *exynos_get_domain_name(struct device_node *node) 147 + { 148 + const char *name; 149 + 150 + if (of_property_read_string(node, "label", &name) < 0) 151 + name = strrchr(node->full_name, '/') + 1; 152 + return kstrdup_const(name, GFP_KERNEL); 153 + } 154 + 145 155 static __init int exynos4_pm_init_power_domain(void) 146 156 { 147 157 struct device_node *np; ··· 165 157 166 158 pd = kzalloc(sizeof(*pd), GFP_KERNEL); 167 159 if (!pd) { 168 - pr_err("%s: failed to allocate memory for domain\n", 169 - __func__); 170 160 of_node_put(np); 171 161 return -ENOMEM; 172 162 } 173 - pd->pd.name = kstrdup_const(strrchr(np->full_name, '/') + 1, 174 - GFP_KERNEL); 163 + pd->pd.name = exynos_get_domain_name(np); 175 164 if (!pd->pd.name) { 176 165 kfree(pd); 177 166 of_node_put(np); 178 167 return -ENOMEM; 179 168 } 180 169 181 - pd->name = pd->pd.name; 182 170 pd->base = of_iomap(np, 0); 183 171 if (!pd->base) { 184 172 pr_warn("%s: failed to map memory\n", __func__); ··· 238 234 239 235 if (of_genpd_add_subdomain(&parent, &child)) 240 236 pr_warn("%s failed to add subdomain: %s\n", 241 - parent.np->name, child.np->name); 237 + parent.np->full_name, child.np->full_name); 242 238 else 243 239 pr_info("%s has as child subdomain: %s.\n", 244 - parent.np->name, child.np->name); 240 + parent.np->full_name, child.np->full_name); 245 241 } 246 242 247 243 return 0;