Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
sh_clk.h File Reference
#include <linux/list.h>
#include <linux/seq_file.h>
#include <linux/cpufreq.h>
#include <linux/types.h>
#include <linux/kref.h>
#include <linux/clk.h>
#include <linux/err.h>

Go to the source code of this file.

Data Structures

struct  clk_mapping
 
struct  sh_clk_ops
 
struct  clk
 
struct  clk_div_mult_table
 
struct  clk_div_table
 

Macros

#define SH_CLK_DIV_MSK(div)   ((1 << (div)) - 1)
 
#define SH_CLK_DIV4_MSK   SH_CLK_DIV_MSK(4)
 
#define SH_CLK_DIV6_MSK   SH_CLK_DIV_MSK(6)
 
#define CLK_ENABLE_ON_INIT   BIT(0)
 
#define CLK_ENABLE_REG_32BIT   BIT(1) /* default access size */
 
#define CLK_ENABLE_REG_16BIT   BIT(2)
 
#define CLK_ENABLE_REG_8BIT   BIT(3)
 
#define CLK_MASK_DIV_ON_DISABLE   BIT(4)
 
#define CLK_ENABLE_REG_MASK
 
#define SH_CLK_MSTP(_parent, _enable_reg, _enable_bit, _flags)
 
#define SH_CLK_MSTP32(_p, _r, _b, _f)   SH_CLK_MSTP(_p, _r, _b, _f | CLK_ENABLE_REG_32BIT)
 
#define SH_CLK_MSTP16(_p, _r, _b, _f)   SH_CLK_MSTP(_p, _r, _b, _f | CLK_ENABLE_REG_16BIT)
 
#define SH_CLK_MSTP8(_p, _r, _b, _f)   SH_CLK_MSTP(_p, _r, _b, _f | CLK_ENABLE_REG_8BIT)
 
#define SH_CLK_DIV4(_parent, _reg, _shift, _div_bitmap, _flags)
 
#define clk_div4_table   clk_div_table
 
#define SH_CLK_DIV6_EXT(_reg, _flags, _parents,_num_parents, _src_shift, _src_width)
 
#define SH_CLK_DIV6(_parent, _reg, _flags)
 
#define CLKDEV_CON_ID(_id, _clk)   { .con_id = _id, .clk = _clk }
 
#define CLKDEV_DEV_ID(_id, _clk)   { .dev_id = _id, .clk = _clk }
 
#define CLKDEV_ICK_ID(_cid, _did, _clk)   { .con_id = _cid, .dev_id = _did, .clk = _clk }
 

Functions

unsigned long followparent_recalc (struct clk *)
 
void recalculate_root_clocks (void)
 
void propagate_rate (struct clk *)
 
int clk_reparent (struct clk *child, struct clk *parent)
 
int clk_register (struct clk *)
 
void clk_unregister (struct clk *)
 
void clk_enable_init_clocks (void)
 
void clk_rate_table_build (struct clk *clk, struct cpufreq_frequency_table *freq_table, int nr_freqs, struct clk_div_mult_table *src_table, unsigned long *bitmap)
 
long clk_rate_table_round (struct clk *clk, struct cpufreq_frequency_table *freq_table, unsigned long rate)
 
int clk_rate_table_find (struct clk *clk, struct cpufreq_frequency_table *freq_table, unsigned long rate)
 
long clk_rate_div_range_round (struct clk *clk, unsigned int div_min, unsigned int div_max, unsigned long rate)
 
long clk_rate_mult_range_round (struct clk *clk, unsigned int mult_min, unsigned int mult_max, unsigned long rate)
 
long clk_round_parent (struct clk *clk, unsigned long target, unsigned long *best_freq, unsigned long *parent_freq, unsigned int div_min, unsigned int div_max)
 
int sh_clk_mstp_register (struct clk *clks, int nr)
 
int sh_clk_div4_register (struct clk *clks, int nr, struct clk_div4_table *table)
 
int sh_clk_div4_enable_register (struct clk *clks, int nr, struct clk_div4_table *table)
 
int sh_clk_div4_reparent_register (struct clk *clks, int nr, struct clk_div4_table *table)
 
int sh_clk_div6_register (struct clk *clks, int nr)
 
int sh_clk_div6_reparent_register (struct clk *clks, int nr)
 

Macro Definition Documentation

#define clk_div4_table   clk_div_table

Definition at line 164 of file sh_clk.h.

#define CLK_ENABLE_ON_INIT   BIT(0)

Definition at line 66 of file sh_clk.h.

#define CLK_ENABLE_REG_16BIT   BIT(2)

Definition at line 69 of file sh_clk.h.

#define CLK_ENABLE_REG_32BIT   BIT(1) /* default access size */

Definition at line 68 of file sh_clk.h.

#define CLK_ENABLE_REG_8BIT   BIT(3)

Definition at line 70 of file sh_clk.h.

#define CLK_ENABLE_REG_MASK
Value:
CLK_ENABLE_REG_16BIT | \
CLK_ENABLE_REG_8BIT)

Definition at line 74 of file sh_clk.h.

#define CLK_MASK_DIV_ON_DISABLE   BIT(4)

Definition at line 72 of file sh_clk.h.

#define CLKDEV_CON_ID (   _id,
  _clk 
)    { .con_id = _id, .clk = _clk }

Definition at line 198 of file sh_clk.h.

#define CLKDEV_DEV_ID (   _id,
  _clk 
)    { .dev_id = _id, .clk = _clk }

Definition at line 199 of file sh_clk.h.

#define CLKDEV_ICK_ID (   _cid,
  _did,
  _clk 
)    { .con_id = _cid, .dev_id = _did, .clk = _clk }

Definition at line 200 of file sh_clk.h.

#define SH_CLK_DIV4 (   _parent,
  _reg,
  _shift,
  _div_bitmap,
  _flags 
)
Value:
{ \
.parent = _parent, \
.enable_reg = (void __iomem *)_reg, \
.enable_bit = _shift, \
.arch_flags = _div_bitmap, \
.flags = _flags, \
}

Definition at line 149 of file sh_clk.h.

#define SH_CLK_DIV4_MSK   SH_CLK_DIV_MSK(4)

Definition at line 34 of file sh_clk.h.

#define SH_CLK_DIV6 (   _parent,
  _reg,
  _flags 
)
Value:
{ \
.parent = _parent, \
.enable_reg = (void __iomem *)_reg, \
.enable_bit = 0, /* unused */ \
}

Definition at line 186 of file sh_clk.h.

#define SH_CLK_DIV6_EXT (   _reg,
  _flags,
  _parents,
  _num_parents,
  _src_shift,
  _src_width 
)
Value:
{ \
.enable_reg = (void __iomem *)_reg, \
.enable_bit = 0, /* unused */ \
.parent_table = _parents, \
.parent_num = _num_parents, \
.src_shift = _src_shift, \
.src_width = _src_width, \
}

Definition at line 173 of file sh_clk.h.

#define SH_CLK_DIV6_MSK   SH_CLK_DIV_MSK(6)

Definition at line 35 of file sh_clk.h.

#define SH_CLK_DIV_MSK (   div)    ((1 << (div)) - 1)

Definition at line 33 of file sh_clk.h.

#define SH_CLK_MSTP (   _parent,
  _enable_reg,
  _enable_bit,
  _flags 
)
Value:
{ \
.parent = _parent, \
.enable_reg = (void __iomem *)_enable_reg, \
.enable_bit = _enable_bit, \
.flags = _flags, \
}

Definition at line 119 of file sh_clk.h.

#define SH_CLK_MSTP16 (   _p,
  _r,
  _b,
  _f 
)    SH_CLK_MSTP(_p, _r, _b, _f | CLK_ENABLE_REG_16BIT)

Definition at line 130 of file sh_clk.h.

#define SH_CLK_MSTP32 (   _p,
  _r,
  _b,
  _f 
)    SH_CLK_MSTP(_p, _r, _b, _f | CLK_ENABLE_REG_32BIT)

Definition at line 127 of file sh_clk.h.

#define SH_CLK_MSTP8 (   _p,
  _r,
  _b,
  _f 
)    SH_CLK_MSTP(_p, _r, _b, _f | CLK_ENABLE_REG_8BIT)

Definition at line 133 of file sh_clk.h.

Function Documentation

void clk_enable_init_clocks ( void  )

Definition at line 305 of file clock.c.

long clk_rate_div_range_round ( struct clk clk,
unsigned int  div_min,
unsigned int  div_max,
unsigned long  rate 
)

Definition at line 161 of file core.c.

long clk_rate_mult_range_round ( struct clk clk,
unsigned int  mult_min,
unsigned int  mult_max,
unsigned long  rate 
)

Definition at line 181 of file core.c.

void clk_rate_table_build ( struct clk clk,
struct cpufreq_frequency_table freq_table,
int  nr_freqs,
struct clk_div_mult_table src_table,
unsigned long bitmap 
)

Definition at line 39 of file core.c.

int clk_rate_table_find ( struct clk clk,
struct cpufreq_frequency_table freq_table,
unsigned long  rate 
)

Definition at line 195 of file core.c.

long clk_rate_table_round ( struct clk clk,
struct cpufreq_frequency_table freq_table,
unsigned long  rate 
)

Definition at line 137 of file core.c.

int clk_register ( struct clk )

Definition at line 528 of file clock.c.

int clk_reparent ( struct clk child,
struct clk parent 
)

Definition at line 212 of file clock.c.

long clk_round_parent ( struct clk clk,
unsigned long  target,
unsigned long best_freq,
unsigned long parent_freq,
unsigned int  div_min,
unsigned int  div_max 
)

Definition at line 564 of file core.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 )

Definition at line 196 of file clock.c.

void propagate_rate ( struct 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.

int sh_clk_div4_enable_register ( struct clk clks,
int  nr,
struct clk_div4_table table 
)

Definition at line 351 of file cpg.c.

int sh_clk_div4_register ( struct clk clks,
int  nr,
struct clk_div4_table table 
)

Definition at line 345 of file cpg.c.

int sh_clk_div4_reparent_register ( struct clk clks,
int  nr,
struct clk_div4_table table 
)

Definition at line 358 of file cpg.c.

int sh_clk_div6_register ( struct clk clks,
int  nr 
)

Definition at line 292 of file cpg.c.

int sh_clk_div6_reparent_register ( struct clk clks,
int  nr 
)

Definition at line 298 of file cpg.c.

int sh_clk_mstp_register ( struct clk clks,
int  nr 
)

Definition at line 56 of file cpg.c.