drivers/power/sequencing/pwrseq-qcom-wcn.c
Source file repositories/reference/linux-study-clean/drivers/power/sequencing/pwrseq-qcom-wcn.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/power/sequencing/pwrseq-qcom-wcn.c- Extension
.c- Size
- 15978 bytes
- Lines
- 600
- Domain
- Driver Families
- Bucket
- drivers/power
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/clk.hlinux/delay.hlinux/device.hlinux/gpio/consumer.hlinux/jiffies.hlinux/mod_devicetable.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/property.hlinux/regulator/consumer.hlinux/pwrseq/provider.hlinux/string.hlinux/types.h
Detected Declarations
struct pwrseq_qcom_wcn_pdatastruct pwrseq_qcom_wcn_ctxfunction pwrseq_qcom_wcn_ensure_gpio_delayfunction pwrseq_qcom_wcn_vddio_enablefunction pwrseq_qcom_wcn_vddio_disablefunction pwrseq_qcom_wcn_vregs_enablefunction pwrseq_qcom_wcn_vregs_disablefunction pwrseq_qcom_wcn_clk_enablefunction pwrseq_qcom_wcn_clk_disablefunction pwrseq_qcom_wcn6855_clk_assertfunction pwrseq_qcom_wcn_bt_enablefunction pwrseq_qcom_wcn_bt_disablefunction pwrseq_qcom_wcn_wlan_enablefunction pwrseq_qcom_wcn_wlan_disablefunction pwrseq_qcom_wcn_pwup_delayfunction pwrseq_qcom_wcn6855_xo_clk_deassertfunction pwrseq_qcom_wcn_match_regulatorfunction pwrseq_qcom_wcn_matchfunction pwrseq_qcom_wcn3990_matchfunction pwrseq_qcom_wcn_probe
Annotated Snippet
struct pwrseq_qcom_wcn_pdata {
const char *const *vregs;
size_t num_vregs;
unsigned int pwup_delay_ms;
unsigned int gpio_enable_delay_ms;
const struct pwrseq_target_data **targets;
bool has_vddio; /* separate VDD IO regulator */
int (*match)(struct pwrseq_device *pwrseq, struct device *dev);
};
struct pwrseq_qcom_wcn_ctx {
struct pwrseq_device *pwrseq;
struct device_node *of_node;
const struct pwrseq_qcom_wcn_pdata *pdata;
struct regulator_bulk_data *regs;
struct regulator *vddio;
struct gpio_desc *bt_gpio;
struct gpio_desc *wlan_gpio;
struct gpio_desc *xo_clk_gpio;
struct clk *clk;
unsigned long last_gpio_enable_jf;
};
static void pwrseq_qcom_wcn_ensure_gpio_delay(struct pwrseq_qcom_wcn_ctx *ctx)
{
unsigned long diff_jiffies;
unsigned int diff_msecs;
if (!ctx->pdata->gpio_enable_delay_ms)
return;
diff_jiffies = jiffies - ctx->last_gpio_enable_jf;
diff_msecs = jiffies_to_msecs(diff_jiffies);
if (diff_msecs < ctx->pdata->gpio_enable_delay_ms)
msleep(ctx->pdata->gpio_enable_delay_ms - diff_msecs);
}
static int pwrseq_qcom_wcn_vddio_enable(struct pwrseq_device *pwrseq)
{
struct pwrseq_qcom_wcn_ctx *ctx = pwrseq_device_get_drvdata(pwrseq);
return regulator_enable(ctx->vddio);
}
static int pwrseq_qcom_wcn_vddio_disable(struct pwrseq_device *pwrseq)
{
struct pwrseq_qcom_wcn_ctx *ctx = pwrseq_device_get_drvdata(pwrseq);
return regulator_disable(ctx->vddio);
}
static const struct pwrseq_unit_data pwrseq_qcom_wcn_vddio_unit_data = {
.name = "vddio-enable",
.enable = pwrseq_qcom_wcn_vddio_enable,
.disable = pwrseq_qcom_wcn_vddio_disable,
};
static int pwrseq_qcom_wcn_vregs_enable(struct pwrseq_device *pwrseq)
{
struct pwrseq_qcom_wcn_ctx *ctx = pwrseq_device_get_drvdata(pwrseq);
return regulator_bulk_enable(ctx->pdata->num_vregs, ctx->regs);
}
static int pwrseq_qcom_wcn_vregs_disable(struct pwrseq_device *pwrseq)
{
struct pwrseq_qcom_wcn_ctx *ctx = pwrseq_device_get_drvdata(pwrseq);
return regulator_bulk_disable(ctx->pdata->num_vregs, ctx->regs);
}
static const struct pwrseq_unit_data pwrseq_qcom_wcn_vregs_unit_data = {
.name = "regulators-enable",
.enable = pwrseq_qcom_wcn_vregs_enable,
.disable = pwrseq_qcom_wcn_vregs_disable,
};
static int pwrseq_qcom_wcn_clk_enable(struct pwrseq_device *pwrseq)
{
struct pwrseq_qcom_wcn_ctx *ctx = pwrseq_device_get_drvdata(pwrseq);
return clk_prepare_enable(ctx->clk);
}
static int pwrseq_qcom_wcn_clk_disable(struct pwrseq_device *pwrseq)
{
struct pwrseq_qcom_wcn_ctx *ctx = pwrseq_device_get_drvdata(pwrseq);
clk_disable_unprepare(ctx->clk);
Annotation
- Immediate include surface: `linux/clk.h`, `linux/delay.h`, `linux/device.h`, `linux/gpio/consumer.h`, `linux/jiffies.h`, `linux/mod_devicetable.h`, `linux/module.h`, `linux/of.h`.
- Detected declarations: `struct pwrseq_qcom_wcn_pdata`, `struct pwrseq_qcom_wcn_ctx`, `function pwrseq_qcom_wcn_ensure_gpio_delay`, `function pwrseq_qcom_wcn_vddio_enable`, `function pwrseq_qcom_wcn_vddio_disable`, `function pwrseq_qcom_wcn_vregs_enable`, `function pwrseq_qcom_wcn_vregs_disable`, `function pwrseq_qcom_wcn_clk_enable`, `function pwrseq_qcom_wcn_clk_disable`, `function pwrseq_qcom_wcn6855_clk_assert`.
- Atlas domain: Driver Families / drivers/power.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.