Lines Matching +full:pmu +full:- +full:supply
1 // SPDX-License-Identifier: GPL-2.0-only
45 if (!ctx->pdata->gpio_enable_delay_ms)
48 diff_jiffies = jiffies - ctx->last_gpio_enable_jf;
51 if (diff_msecs < ctx->pdata->gpio_enable_delay_ms)
52 msleep(ctx->pdata->gpio_enable_delay_ms - diff_msecs);
59 return regulator_bulk_enable(ctx->pdata->num_vregs, ctx->regs);
66 return regulator_bulk_disable(ctx->pdata->num_vregs, ctx->regs);
70 .name = "regulators-enable",
79 return clk_prepare_enable(ctx->clk);
86 clk_disable_unprepare(ctx->clk);
92 .name = "clock-enable",
107 if (!ctx->xo_clk_gpio)
112 gpiod_set_value_cansleep(ctx->xo_clk_gpio, 1);
119 .name = "xo-clk-assert",
135 gpiod_set_value_cansleep(ctx->bt_gpio, 1);
136 ctx->last_gpio_enable_jf = jiffies;
145 gpiod_set_value_cansleep(ctx->bt_gpio, 0);
151 .name = "bluetooth-enable",
158 .name = "wlan-enable",
169 gpiod_set_value_cansleep(ctx->wlan_gpio, 1);
170 ctx->last_gpio_enable_jf = jiffies;
179 gpiod_set_value_cansleep(ctx->wlan_gpio, 0);
185 .name = "wlan-enable",
192 .name = "wlan-enable",
202 if (ctx->pdata->pwup_delay_ms)
203 msleep(ctx->pdata->pwup_delay_ms);
212 if (ctx->xo_clk_gpio) {
214 gpiod_set_value_cansleep(ctx->xo_clk_gpio, 0);
335 struct device_node *dev_node = dev->of_node;
338 * The PMU supplies power to the Bluetooth and WLAN modules. both
339 * consume the PMU AON output so check the presence of the
340 * 'vddaon-supply' property and whether it leads us to the right
343 if (!of_property_present(dev_node, "vddaon-supply"))
347 of_parse_phandle(dev_node, "vddaon-supply", 0);
352 * `reg_node` is the PMU AON regulator, its parent is the `regulators`
353 * node and finally its grandparent is the PMU device node that we're
356 if (!reg_node->parent || !reg_node->parent->parent ||
357 reg_node->parent->parent != ctx->of_node)
365 struct device *dev = &pdev->dev;
372 return -ENOMEM;
374 ctx->of_node = dev->of_node;
376 ctx->pdata = of_device_get_match_data(dev);
377 if (!ctx->pdata)
378 return dev_err_probe(dev, -ENODEV,
381 ctx->regs = devm_kcalloc(dev, ctx->pdata->num_vregs,
382 sizeof(*ctx->regs), GFP_KERNEL);
383 if (!ctx->regs)
384 return -ENOMEM;
386 for (i = 0; i < ctx->pdata->num_vregs; i++)
387 ctx->regs[i].supply = ctx->pdata->vregs[i];
389 ret = devm_regulator_bulk_get(dev, ctx->pdata->num_vregs, ctx->regs);
394 ctx->bt_gpio = devm_gpiod_get_optional(dev, "bt-enable", GPIOD_OUT_LOW);
395 if (IS_ERR(ctx->bt_gpio))
396 return dev_err_probe(dev, PTR_ERR(ctx->bt_gpio),
406 ctx->wlan_gpio = devm_gpiod_get_optional(dev, "wlan-enable",
408 if (IS_ERR(ctx->wlan_gpio))
409 return dev_err_probe(dev, PTR_ERR(ctx->wlan_gpio),
412 ctx->xo_clk_gpio = devm_gpiod_get_optional(dev, "xo-clk",
414 if (IS_ERR(ctx->xo_clk_gpio))
415 return dev_err_probe(dev, PTR_ERR(ctx->xo_clk_gpio),
422 gpiod_direction_output(ctx->wlan_gpio,
423 gpiod_get_value_cansleep(ctx->wlan_gpio));
425 ctx->clk = devm_clk_get_optional(dev, NULL);
426 if (IS_ERR(ctx->clk))
427 return dev_err_probe(dev, PTR_ERR(ctx->clk),
436 config.targets = ctx->pdata->targets;
438 ctx->pwrseq = devm_pwrseq_device_register(dev, &config);
439 if (IS_ERR(ctx->pwrseq))
440 return dev_err_probe(dev, PTR_ERR(ctx->pwrseq),
448 .compatible = "qcom,qca6390-pmu",
452 .compatible = "qcom,wcn6855-pmu",
456 .compatible = "qcom,wcn7850-pmu",
460 .compatible = "qcom,wcn6750-pmu",
469 .name = "pwrseq-qcom_wcn",
477 MODULE_DESCRIPTION("Qualcomm WCN PMU power sequencing driver");