Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros
clock.h File Reference
#include <linux/list.h>

Go to the source code of this file.

Data Structures

struct  clkops
 
struct  clk
 
struct  clk_functions
 

Macros

#define __clk_get_name(clk)   (clk->name)
 
#define __clk_get_parent(clk)   (clk->parent)
 
#define __clk_get_rate(clk)   (clk->rate)
 
#define ENABLE_REG_32BIT   (1 << 0) /* Use 32-bit access */
 
#define CLOCK_IDLE_CONTROL   (1 << 1)
 
#define CLOCK_NO_IDLE_PARENT   (1 << 2)
 
#define ENABLE_ON_INIT   (1 << 3) /* Enable upon framework init */
 
#define INVERT_ENABLE   (1 << 4) /* 0 enables, 1 disables */
 
#define CLOCK_CLKOUTX2   (1 << 5)
 

: the name of the clock in the hardware (used in hwmod data and debug)

struct clk - OMAP struct clk : list_head connecting this clock into the full clock list : struct clkops * for this clock

: pointer to this clock's parent struct clk : list_head connecting to the child clks' list_heads : list_head connecting this clk to its parent clk's : current clock rate : register to write to enable the clock (see ) : fn ptr that returns the clock's current rate : fn ptr that can change the clock's current rate : fn ptr that can round the clock's current rate : fn ptr to do clock-specific initialization : bitshift to write to enable/disable the clock (see ) : number of users that have requested this clock to be enabled : when > 0, this clock's rate is its parent's rate / : see "struct clk.flags possibilities" above : for clksel clks, register va containing src/divisor select : bitmask in for the src/divisor selector : for clksel clks, pointer to struct clksel for this clock : for DPLLs, pointer to struct dpll_data for this clock : clockdomain name that this clock is contained in : pointer to struct clockdomain, resolved from at runtime : bitshift for rate selection bitfield (OMAP1 only) : bitshift for source selection bitfield (OMAP1 only)

XXX , should probably be removed and OMAP1 clock code converted to use clksel.

XXX is poorly named. It should be "enable_count" or something similar. "users" in the description refers to kernel code (core code or drivers) that have called clk_enable() and not yet called clk_disable(); the usecount of parent clocks is also incremented by the clock code when clk_enable() is called on child clocks and decremented by the clock code when clk_disable() is called on child clocks.

XXX , , , should be marked for internal use only.

and are used to optimize parent-to-child clock tree traversals. (child-to-parent traversals use .)

XXX The notion of the clock's current rate probably needs to be separated from the clock's target rate.

int mpurate
 
struct clkops clkops_null
 
struct clk dummy_ck
 
int clk_init (struct clk_functions *custom_clocks)
 
void clk_preinit (struct clk *clk)
 
int clk_register (struct clk *clk)
 
void clk_reparent (struct clk *child, struct clk *parent)
 
void clk_unregister (struct clk *clk)
 
void propagate_rate (struct clk *clk)
 
void recalculate_root_clocks (void)
 
unsigned long followparent_recalc (struct clk *clk)
 
void clk_enable_init_clocks (void)
 
unsigned long omap_fixed_divisor_recalc (struct clk *clk)
 
struct clkomap_clk_get_by_name (const char *name)
 
int omap_clk_enable_autoidle_all (void)
 
int omap_clk_disable_autoidle_all (void)
 

Macro Definition Documentation

#define __clk_get_name (   clk)    (clk->name)

Definition at line 23 of file clock.h.

#define __clk_get_parent (   clk)    (clk->parent)

Definition at line 24 of file clock.h.

#define __clk_get_rate (   clk)    (clk->rate)

Definition at line 25 of file clock.h.

#define CLOCK_CLKOUTX2   (1 << 5)

Definition at line 196 of file clock.h.

#define CLOCK_IDLE_CONTROL   (1 << 1)

Definition at line 192 of file clock.h.

#define CLOCK_NO_IDLE_PARENT   (1 << 2)

Definition at line 193 of file clock.h.

#define ENABLE_ON_INIT   (1 << 3) /* Enable upon framework init */

Definition at line 194 of file clock.h.

#define ENABLE_REG_32BIT   (1 << 0) /* Use 32-bit access */

Definition at line 191 of file clock.h.

#define INVERT_ENABLE   (1 << 4) /* 0 enables, 1 disables */

Definition at line 195 of file clock.h.

Function Documentation

void clk_enable_init_clocks ( void  )

Definition at line 305 of file clock.c.

int clk_init ( struct clk_functions custom_clocks)

Definition at line 410 of file clock.c.

void clk_preinit ( struct clk clk)

clk_preinit - initialize any fields in the struct clk before clk init : struct clk * to initialize

Initialize any struct clk fields needed before normal clk initialization can run. No return value.

Definition at line 262 of file clock.c.

int clk_register ( struct clk clk)

Definition at line 528 of file clock.c.

void clk_reparent ( struct clk child,
struct clk parent 
)

Definition at line 212 of file clock.c.

void clk_unregister ( struct clk clk)

clk_unregister - unregister a currently registered clock : clock to unregister

Currently unimplemented.

Definition at line 200 of file clock.c.

unsigned long followparent_recalc ( struct clk clk)

Definition at line 196 of file clock.c.

int omap_clk_disable_autoidle_all ( void  )

Definition at line 331 of file clock.c.

int omap_clk_enable_autoidle_all ( void  )

Definition at line 315 of file clock.c.

struct clk* omap_clk_get_by_name ( const char name)
read
unsigned long omap_fixed_divisor_recalc ( struct clk clk)

Definition at line 205 of file clock.c.

void propagate_rate ( struct clk clk)

Definition at line 224 of file clock.c.

void recalculate_root_clocks ( void  )

recalculate_root_clocks - recalculate and propagate all root clocks

Recalculates all root clocks (clocks with no parent), which if the clock's .recalc is set correctly, should also propagate their rates. Called at init.

Definition at line 244 of file clock.c.

Variable Documentation

struct clkops clkops_null

Definition at line 359 of file clock.c.

struct clk dummy_ck

Definition at line 369 of file clock.c.

int mpurate

Definition at line 175 of file clock.c.