Lines Matching +full:name +full:-

1 // SPDX-License-Identifier: GPL-2.0-or-later
8 #include <dt-bindings/soc/bcm6318-pm.h>
9 #include <dt-bindings/soc/bcm6328-pm.h>
10 #include <dt-bindings/soc/bcm6362-pm.h>
11 #include <dt-bindings/soc/bcm63268-pm.h>
34 const char * const name; member
41 struct bcm63xx_power *power = pmd->power; in bcm63xx_power_get_state()
43 if (!pmd->mask) { in bcm63xx_power_get_state()
45 return -EINVAL; in bcm63xx_power_get_state()
48 *is_on = !(__raw_readl(power->base) & pmd->mask); in bcm63xx_power_get_state()
55 struct bcm63xx_power *power = pmd->power; in bcm63xx_power_set_state()
59 if (!pmd->mask) in bcm63xx_power_set_state()
60 return -EINVAL; in bcm63xx_power_set_state()
62 spin_lock_irqsave(&power->lock, flags); in bcm63xx_power_set_state()
63 val = __raw_readl(power->base); in bcm63xx_power_set_state()
65 val &= ~pmd->mask; in bcm63xx_power_set_state()
67 val |= pmd->mask; in bcm63xx_power_set_state()
68 __raw_writel(val, power->base); in bcm63xx_power_set_state()
69 spin_unlock_irqrestore(&power->lock, flags); in bcm63xx_power_set_state()
92 struct device *dev = &pdev->dev; in bcm63xx_power_probe()
93 struct device_node *np = dev->of_node; in bcm63xx_power_probe()
102 return -ENOMEM; in bcm63xx_power_probe()
104 power->base = devm_platform_ioremap_resource(pdev, 0); in bcm63xx_power_probe()
105 if (IS_ERR(power->base)) in bcm63xx_power_probe()
106 return PTR_ERR(power->base); in bcm63xx_power_probe()
110 return -EINVAL; in bcm63xx_power_probe()
112 power->genpd_data.num_domains = 0; in bcm63xx_power_probe()
114 for (entry = table; entry->name; entry++) { in bcm63xx_power_probe()
115 max_bit = max(max_bit, entry->bit); in bcm63xx_power_probe()
120 return -ENODEV; in bcm63xx_power_probe()
122 power->genpd_data.num_domains = max_bit + 1; in bcm63xx_power_probe()
124 power->dev = devm_kcalloc(dev, power->genpd_data.num_domains, in bcm63xx_power_probe()
127 if (!power->dev) in bcm63xx_power_probe()
128 return -ENOMEM; in bcm63xx_power_probe()
130 power->genpd = devm_kcalloc(dev, power->genpd_data.num_domains, in bcm63xx_power_probe()
133 if (!power->genpd) in bcm63xx_power_probe()
134 return -ENOMEM; in bcm63xx_power_probe()
136 power->genpd_data.domains = power->genpd; in bcm63xx_power_probe()
139 for (entry = table; entry->name; entry++) { in bcm63xx_power_probe()
140 struct bcm63xx_power_dev *pmd = &power->dev[ndom]; in bcm63xx_power_probe()
143 pmd->power = power; in bcm63xx_power_probe()
144 pmd->mask = BIT(entry->bit); in bcm63xx_power_probe()
145 pmd->genpd.name = entry->name; in bcm63xx_power_probe()
146 pmd->genpd.flags = entry->flags; in bcm63xx_power_probe()
151 pmd->genpd.name); in bcm63xx_power_probe()
153 pmd->genpd.power_on = bcm63xx_power_on; in bcm63xx_power_probe()
154 pmd->genpd.power_off = bcm63xx_power_off; in bcm63xx_power_probe()
156 pm_genpd_init(&pmd->genpd, NULL, !is_on); in bcm63xx_power_probe()
157 power->genpd[entry->bit] = &pmd->genpd; in bcm63xx_power_probe()
162 spin_lock_init(&power->lock); in bcm63xx_power_probe()
164 ret = of_genpd_add_provider_onecell(np, &power->genpd_data); in bcm63xx_power_probe()
177 .name = "pcie",
180 .name = "usb",
183 .name = "ephy0",
186 .name = "ephy1",
189 .name = "ephy2",
192 .name = "ephy3",
195 .name = "ldo2p5",
199 .name = "ldo2p9",
203 .name = "sw1p0",
207 .name = "pad",
217 .name = "adsl2-mips",
220 .name = "adsl2-phy",
223 .name = "adsl2-afe",
226 .name = "sar",
229 .name = "pcm",
232 .name = "usbd",
235 .name = "usbh",
238 .name = "pcie",
241 .name = "robosw",
244 .name = "ephy",
253 .name = "sar",
256 .name = "ipsec",
259 .name = "mips",
263 .name = "dect",
266 .name = "usbh",
269 .name = "usbd",
272 .name = "robosw",
275 .name = "pcm",
278 .name = "periph",
282 .name = "adsl-phy",
285 .name = "gmii-pads",
288 .name = "fap",
291 .name = "pcie",
294 .name = "wlan-pads",
303 .name = "sar",
306 .name = "ipsec",
309 .name = "mips",
313 .name = "dect",
316 .name = "usbh",
319 .name = "usbd",
322 .name = "robosw",
325 .name = "pcm",
328 .name = "periph",
332 .name = "vdsl-phy",
335 .name = "vdsl-mips",
338 .name = "fap",
341 .name = "pcie",
344 .name = "wlan-pads",
353 .compatible = "brcm,bcm6318-power-controller",
356 .compatible = "brcm,bcm6328-power-controller",
359 .compatible = "brcm,bcm6362-power-controller",
362 .compatible = "brcm,bcm63268-power-controller",
371 .name = "bcm63xx-power-controller",