PebbleOS v4.47.0-1362-gd278268fe
Loading...
Searching...
No Matches
Clock controller drivers

Interface for clock controller drivers. More...

Data Structures

struct  pbl_clk_controller_ops
 Clock controller driver operations, called with interrupts locked. More...
 
struct  pbl_clk_controller
 A clock controller. More...
 

Macros

#define PBL_CLK_CONTROLLER_STATE_DEFINE(sym, _num_clks)
 Define the class state of clock controller sym, for the driver's define macro.
 
#define PBL_CLK_CONTROLLER_INIT(sym, _name, _init, _parent, _ops)
 Initializer for the struct pbl_clk_controller of controller sym.
 

Functions

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.
 

Detailed Description

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.


Data Structure Documentation

◆ pbl_clk_controller

struct pbl_clk_controller

A clock 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.

Macro Definition Documentation

◆ PBL_CLK_CONTROLLER_INIT

#define PBL_CLK_CONTROLLER_INIT (   sym,
  _name,
  _init,
  _parent,
  _ops 
)
Value:
{ \
.dev = PBL_DEVICE_INIT_CLASS(sym, _name, _init, _parent, &pbl_clk_controller_class), \
.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
symSymbol of the controller instance, with its state defined by PBL_CLK_CONTROLLER_STATE_DEFINE().
_nameName.
_initDevice init function, or NULL.
_parentParent device, or NULL.
_opsDriver 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
symSymbol of the controller instance.
_num_clksNumber of clocks.

Function Documentation

◆ 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
clkClock whose rate changed.