PebbleOS v4.48.0-75-g7416f78a1
Loading...
Searching...
No Matches
pbl_clk_controller_ops Struct Reference

Clock controller driver operations, called with interrupts locked. More...

#include <driver.h>

Data Fields

int(* enable )(const struct pbl_clk_controller *ctrl, uint32_t id)
 Ungate a clock, or NULL if the clocks always run.
 
int(* disable )(const struct pbl_clk_controller *ctrl, uint32_t id)
 Gate a clock, or NULL if the clocks always run.
 
int(* get_rate )(const struct pbl_clk_controller *ctrl, uint32_t id, uint64_t parent_mhz, uint64_t *rate_mhz)
 Get a clock's rate in mHz from its parent's, 0 for a clock without one, or NULL if each clock runs at its parent's rate.
 
int(* get_parent )(const struct pbl_clk_controller *ctrl, uint32_t id, struct pbl_clk *parent)
 Get a clock's parent, or NULL if the clocks have none.
 
int(* set_parent )(const struct pbl_clk_controller *ctrl, uint32_t id, const struct pbl_clk *parent)
 Switch a clock to another parent, or NULL if no clock can.
 
int(* set_rate )(const struct pbl_clk_controller *ctrl, uint32_t id, uint64_t rate_mhz, uint64_t parent_mhz)
 Set a clock's rate in mHz from its parent's, 0 for a clock without one, or NULL if no clock can.
 

Detailed Description

Clock controller driver operations, called with interrupts locked.

Field Documentation

◆ disable

int(* pbl_clk_controller_ops::disable) (const struct pbl_clk_controller *ctrl, uint32_t id)

Gate a clock, or NULL if the clocks always run.

Returns 0 or a negative errno.

◆ enable

int(* pbl_clk_controller_ops::enable) (const struct pbl_clk_controller *ctrl, uint32_t id)

Ungate a clock, or NULL if the clocks always run.

Returns 0 or a negative errno.

◆ get_parent

int(* pbl_clk_controller_ops::get_parent) (const struct pbl_clk_controller *ctrl, uint32_t id, struct pbl_clk *parent)

Get a clock's parent, or NULL if the clocks have none.

Returns 0, -ENOENT if the clock has none, or another negative errno.

◆ get_rate

int(* pbl_clk_controller_ops::get_rate) (const struct pbl_clk_controller *ctrl, uint32_t id, uint64_t parent_mhz, uint64_t *rate_mhz)

Get a clock's rate in mHz from its parent's, 0 for a clock without one, or NULL if each clock runs at its parent's rate.

Returns 0 or a negative errno.

◆ set_parent

int(* pbl_clk_controller_ops::set_parent) (const struct pbl_clk_controller *ctrl, uint32_t id, const struct pbl_clk *parent)

Switch a clock to another parent, or NULL if no clock can.

Returns 0, -EINVAL if it cannot take that parent, or another negative errno.

◆ set_rate

int(* pbl_clk_controller_ops::set_rate) (const struct pbl_clk_controller *ctrl, uint32_t id, uint64_t rate_mhz, uint64_t parent_mhz)

Set a clock's rate in mHz from its parent's, 0 for a clock without one, or NULL if no clock can.

Returns 0, -EINVAL if the clock cannot run at that rate exactly, or another negative errno.


The documentation for this struct was generated from the following file: