Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
clock.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/errno.h>
#include <linux/err.h>
#include <linux/string.h>
#include <linux/clk.h>
#include <linux/mutex.h>
#include <linux/spinlock.h>
#include <linux/debugfs.h>
#include <linux/device.h>
#include <linux/init.h>
#include <linux/timer.h>
#include <linux/io.h>
#include <linux/seq_file.h>
#include <linux/clkdev.h>
#include <asm/clocks.h>

Go to the source code of this file.

Macros

#define CGU0_CTL_DF   (1 << 0)
 
#define CGU0_CTL_MSEL_SHIFT   8
 
#define CGU0_CTL_MSEL_MASK   (0x7f << 8)
 
#define CGU0_STAT_PLLEN   (1 << 0)
 
#define CGU0_STAT_PLLBP   (1 << 1)
 
#define CGU0_STAT_PLLLK   (1 << 2)
 
#define CGU0_STAT_CLKSALGN   (1 << 3)
 
#define CGU0_STAT_CCBF0   (1 << 4)
 
#define CGU0_STAT_CCBF1   (1 << 5)
 
#define CGU0_STAT_SCBF0   (1 << 6)
 
#define CGU0_STAT_SCBF1   (1 << 7)
 
#define CGU0_STAT_DCBF   (1 << 8)
 
#define CGU0_STAT_OCBF   (1 << 9)
 
#define CGU0_STAT_ADDRERR   (1 << 16)
 
#define CGU0_STAT_LWERR   (1 << 17)
 
#define CGU0_STAT_DIVERR   (1 << 18)
 
#define CGU0_STAT_WDFMSERR   (1 << 19)
 
#define CGU0_STAT_WDIVERR   (1 << 20)
 
#define CGU0_STAT_PLOCKERR   (1 << 21)
 
#define CGU0_DIV_CSEL_SHIFT   0
 
#define CGU0_DIV_CSEL_MASK   0x0000001F
 
#define CGU0_DIV_S0SEL_SHIFT   5
 
#define CGU0_DIV_S0SEL_MASK   (0x3 << CGU0_DIV_S0SEL_SHIFT)
 
#define CGU0_DIV_SYSSEL_SHIFT   8
 
#define CGU0_DIV_SYSSEL_MASK   (0x1f << CGU0_DIV_SYSSEL_SHIFT)
 
#define CGU0_DIV_S1SEL_SHIFT   13
 
#define CGU0_DIV_S1SEL_MASK   (0x3 << CGU0_DIV_S1SEL_SHIFT)
 
#define CGU0_DIV_DSEL_SHIFT   16
 
#define CGU0_DIV_DSEL_MASK   (0x1f << CGU0_DIV_DSEL_SHIFT)
 
#define CGU0_DIV_OSEL_SHIFT   22
 
#define CGU0_DIV_OSEL_MASK   (0x7f << CGU0_DIV_OSEL_SHIFT)
 
#define CLK(_clk, _devname, _conname)
 
#define NEEDS_INITIALIZATION   0x11
 

Functions

int wait_for_pll_align (void)
 
int clk_enable (struct clk *clk)
 
 EXPORT_SYMBOL (clk_enable)
 
void clk_disable (struct clk *clk)
 
 EXPORT_SYMBOL (clk_disable)
 
unsigned long clk_get_rate (struct clk *clk)
 
 EXPORT_SYMBOL (clk_get_rate)
 
long clk_round_rate (struct clk *clk, unsigned long rate)
 
 EXPORT_SYMBOL (clk_round_rate)
 
int clk_set_rate (struct clk *clk, unsigned long rate)
 
 EXPORT_SYMBOL (clk_set_rate)
 
unsigned long vco_get_rate (struct clk *clk)
 
unsigned long pll_get_rate (struct clk *clk)
 
unsigned long pll_round_rate (struct clk *clk, unsigned long rate)
 
int pll_set_rate (struct clk *clk, unsigned long rate)
 
unsigned long cclk_get_rate (struct clk *clk)
 
unsigned long sys_clk_get_rate (struct clk *clk)
 
unsigned long sys_clk_round_rate (struct clk *clk, unsigned long rate)
 
int sys_clk_set_rate (struct clk *clk, unsigned long rate)
 
int __init clk_init (void)
 

Macro Definition Documentation

#define CGU0_CTL_DF   (1 << 0)

Definition at line 20 of file clock.c.

#define CGU0_CTL_MSEL_MASK   (0x7f << 8)

Definition at line 23 of file clock.c.

#define CGU0_CTL_MSEL_SHIFT   8

Definition at line 22 of file clock.c.

#define CGU0_DIV_CSEL_MASK   0x0000001F

Definition at line 43 of file clock.c.

#define CGU0_DIV_CSEL_SHIFT   0

Definition at line 42 of file clock.c.

#define CGU0_DIV_DSEL_MASK   (0x1f << CGU0_DIV_DSEL_SHIFT)

Definition at line 51 of file clock.c.

#define CGU0_DIV_DSEL_SHIFT   16

Definition at line 50 of file clock.c.

#define CGU0_DIV_OSEL_MASK   (0x7f << CGU0_DIV_OSEL_SHIFT)

Definition at line 53 of file clock.c.

#define CGU0_DIV_OSEL_SHIFT   22

Definition at line 52 of file clock.c.

#define CGU0_DIV_S0SEL_MASK   (0x3 << CGU0_DIV_S0SEL_SHIFT)

Definition at line 45 of file clock.c.

#define CGU0_DIV_S0SEL_SHIFT   5

Definition at line 44 of file clock.c.

#define CGU0_DIV_S1SEL_MASK   (0x3 << CGU0_DIV_S1SEL_SHIFT)

Definition at line 49 of file clock.c.

#define CGU0_DIV_S1SEL_SHIFT   13

Definition at line 48 of file clock.c.

#define CGU0_DIV_SYSSEL_MASK   (0x1f << CGU0_DIV_SYSSEL_SHIFT)

Definition at line 47 of file clock.c.

#define CGU0_DIV_SYSSEL_SHIFT   8

Definition at line 46 of file clock.c.

#define CGU0_STAT_ADDRERR   (1 << 16)

Definition at line 35 of file clock.c.

#define CGU0_STAT_CCBF0   (1 << 4)

Definition at line 29 of file clock.c.

#define CGU0_STAT_CCBF1   (1 << 5)

Definition at line 30 of file clock.c.

#define CGU0_STAT_CLKSALGN   (1 << 3)

Definition at line 28 of file clock.c.

#define CGU0_STAT_DCBF   (1 << 8)

Definition at line 33 of file clock.c.

#define CGU0_STAT_DIVERR   (1 << 18)

Definition at line 37 of file clock.c.

#define CGU0_STAT_LWERR   (1 << 17)

Definition at line 36 of file clock.c.

#define CGU0_STAT_OCBF   (1 << 9)

Definition at line 34 of file clock.c.

#define CGU0_STAT_PLLBP   (1 << 1)

Definition at line 26 of file clock.c.

#define CGU0_STAT_PLLEN   (1 << 0)

Definition at line 25 of file clock.c.

#define CGU0_STAT_PLLLK   (1 << 2)

Definition at line 27 of file clock.c.

#define CGU0_STAT_PLOCKERR   (1 << 21)

Definition at line 40 of file clock.c.

#define CGU0_STAT_SCBF0   (1 << 6)

Definition at line 31 of file clock.c.

#define CGU0_STAT_SCBF1   (1 << 7)

Definition at line 32 of file clock.c.

#define CGU0_STAT_WDFMSERR   (1 << 19)

Definition at line 38 of file clock.c.

#define CGU0_STAT_WDIVERR   (1 << 20)

Definition at line 39 of file clock.c.

#define CLK (   _clk,
  _devname,
  _conname 
)
Value:
{ \
.clk = &_clk, \
.dev_id = _devname, \
.con_id = _conname, \
}

Definition at line 55 of file clock.c.

#define NEEDS_INITIALIZATION   0x11

Definition at line 62 of file clock.c.

Function Documentation

unsigned long cclk_get_rate ( struct clk clk)

Definition at line 193 of file clock.c.

void clk_disable ( struct clk clk)

Definition at line 116 of file clock.c.

int clk_enable ( struct clk clk)

Definition at line 107 of file clock.c.

unsigned long clk_get_rate ( struct clk clk)

Definition at line 123 of file clock.c.

Definition at line 380 of file clock.c.

long clk_round_rate ( struct clk clk,
unsigned long  rate 
)

Definition at line 132 of file clock.c.

int clk_set_rate ( struct clk clk,
unsigned long  rate 
)

Definition at line 141 of file clock.c.

EXPORT_SYMBOL ( clk_enable  )
EXPORT_SYMBOL ( clk_disable  )
EXPORT_SYMBOL ( clk_get_rate  )
EXPORT_SYMBOL ( clk_round_rate  )
EXPORT_SYMBOL ( clk_set_rate  )
unsigned long pll_get_rate ( struct clk clk)

Definition at line 155 of file clock.c.

unsigned long pll_round_rate ( struct clk clk,
unsigned long  rate 
)

Definition at line 169 of file clock.c.

int pll_set_rate ( struct clk clk,
unsigned long  rate 
)

Definition at line 176 of file clock.c.

unsigned long sys_clk_get_rate ( struct clk clk)

Definition at line 201 of file clock.c.

unsigned long sys_clk_round_rate ( struct clk clk,
unsigned long  rate 
)

Definition at line 223 of file clock.c.

int sys_clk_set_rate ( struct clk clk,
unsigned long  rate 
)

Definition at line 247 of file clock.c.

unsigned long vco_get_rate ( struct clk clk)

Definition at line 150 of file clock.c.

int wait_for_pll_align ( void  )

Definition at line 94 of file clock.c.