Interface for clock controller drivers.
More...
Interface for clock controller drivers.
A driver embeds a struct pbl_clk_controller in its instance, sets it up with PBL_CLK_CONTROLLER_STATE_DEFINE() and PBL_CLK_CONTROLLER_INIT(), and implements the struct pbl_clk_controller_ops the class calls.
◆ pbl_clk_controller
| struct pbl_clk_controller |
| Data Fields |
|
struct pbl_device |
dev |
Device. |
|
uint16_t |
num_clks |
Number of clocks. |
|
const struct pbl_clk_controller_ops * |
ops |
Driver operations. |
|
uint8_t * |
use_counts |
Enable count of each clock. |
◆ PBL_CLK_CONTROLLER_INIT
| #define PBL_CLK_CONTROLLER_INIT |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_init, |
|
|
|
_parent, |
|
|
|
_ops |
|
) |
| |
Value: { \
.ops = (_ops), \
.use_counts = sym##_clk_use_counts, \
.num_clks = sizeof(sym##_clk_use_counts), \
}
#define PBL_DEVICE_INIT_CLASS(sym, _name, _init, _parent, _cls)
Initializer for the struct pbl_device of device instance sym, in class _cls.
Definition device.h:153
Initializer for the struct pbl_clk_controller of controller sym.
- Parameters
-
| sym | Symbol of the controller instance, with its state defined by PBL_CLK_CONTROLLER_STATE_DEFINE(). |
| _name | Name. |
| _init | Device init function, or NULL. |
| _parent | Parent device, or NULL. |
| _ops | Driver operations. |
◆ PBL_CLK_CONTROLLER_STATE_DEFINE
| #define PBL_CLK_CONTROLLER_STATE_DEFINE |
( |
|
sym, |
|
|
|
_num_clks |
|
) |
| |
Value:
static uint8_t sym##_clk_use_counts[_num_clks]
#define PBL_DEVICE_STATE_DEFINE(sym)
Define the runtime state of device instance sym.
Definition device.h:132
Define the class state of clock controller sym, for the driver's define macro.
- Parameters
-
| sym | Symbol of the controller instance. |
| _num_clks | Number of clocks. |
◆ pbl_clk_rate_changed()
| void pbl_clk_rate_changed |
( |
const struct pbl_clk * |
clk | ) |
|
Report a new rate to the notifiers of a clock and of the clocks below it.
- Parameters
-
| clk | Clock whose rate changed. |