Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
clock.c File Reference
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/gcd.h>
#include <linux/io.h>
#include <linux/err.h>
#include <linux/clk.h>
#include <asm/addrspace.h>
#include <asm/mach-ar7/ar7.h>

Go to the source code of this file.

Data Structures

struct  tnetd7300_clock
 
struct  tnetd7300_clocks
 
struct  tnetd7200_clock
 
struct  tnetd7200_clocks
 

Macros

#define BOOT_PLL_SOURCE_MASK   0x3
 
#define CPU_PLL_SOURCE_SHIFT   16
 
#define BUS_PLL_SOURCE_SHIFT   14
 
#define USB_PLL_SOURCE_SHIFT   18
 
#define DSP_PLL_SOURCE_SHIFT   22
 
#define BOOT_PLL_SOURCE_AFE   0
 
#define BOOT_PLL_SOURCE_BUS   0
 
#define BOOT_PLL_SOURCE_REF   1
 
#define BOOT_PLL_SOURCE_XTAL   2
 
#define BOOT_PLL_SOURCE_CPU   3
 
#define BOOT_PLL_BYPASS   0x00000020
 
#define BOOT_PLL_ASYNC_MODE   0x02000000
 
#define BOOT_PLL_2TO1_MODE   0x00008000
 
#define TNETD7200_CLOCK_ID_CPU   0
 
#define TNETD7200_CLOCK_ID_DSP   1
 
#define TNETD7200_CLOCK_ID_USB   2
 
#define TNETD7200_DEF_CPU_CLK   211000000
 
#define TNETD7200_DEF_DSP_CLK   125000000
 
#define TNETD7200_DEF_USB_CLK   48000000
 
#define PREDIV_MASK   0x001f0000
 
#define PREDIV_SHIFT   16
 
#define POSTDIV_MASK   0x0000001f
 
#define MUL_MASK   0x0000f000
 
#define MUL_SHIFT   12
 
#define PLL_MODE_MASK   0x00000001
 
#define PLL_NDIV   0x00000800
 
#define PLL_DIV   0x00000002
 
#define PLL_STATUS   0x00000001
 
#define DIVISOR_ENABLE_MASK   0x00008000
 

Functions

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)
 
struct clkclk_get (struct device *dev, const char *id)
 
 EXPORT_SYMBOL (clk_get)
 
void clk_put (struct clk *clk)
 
 EXPORT_SYMBOL (clk_put)
 
void __init ar7_init_clocks (void)
 

Macro Definition Documentation

#define BOOT_PLL_2TO1_MODE   0x00008000

Definition at line 46 of file clock.c.

#define BOOT_PLL_ASYNC_MODE   0x02000000

Definition at line 45 of file clock.c.

#define BOOT_PLL_BYPASS   0x00000020

Definition at line 44 of file clock.c.

#define BOOT_PLL_SOURCE_AFE   0

Definition at line 39 of file clock.c.

#define BOOT_PLL_SOURCE_BUS   0

Definition at line 40 of file clock.c.

#define BOOT_PLL_SOURCE_CPU   3

Definition at line 43 of file clock.c.

#define BOOT_PLL_SOURCE_MASK   0x3

Definition at line 34 of file clock.c.

#define BOOT_PLL_SOURCE_REF   1

Definition at line 41 of file clock.c.

#define BOOT_PLL_SOURCE_XTAL   2

Definition at line 42 of file clock.c.

#define BUS_PLL_SOURCE_SHIFT   14

Definition at line 36 of file clock.c.

#define CPU_PLL_SOURCE_SHIFT   16

Definition at line 35 of file clock.c.

#define DIVISOR_ENABLE_MASK   0x00008000

Definition at line 82 of file clock.c.

#define DSP_PLL_SOURCE_SHIFT   22

Definition at line 38 of file clock.c.

#define MUL_MASK   0x0000f000

Definition at line 63 of file clock.c.

#define MUL_SHIFT   12

Definition at line 64 of file clock.c.

#define PLL_DIV   0x00000002

Definition at line 67 of file clock.c.

#define PLL_MODE_MASK   0x00000001

Definition at line 65 of file clock.c.

#define PLL_NDIV   0x00000800

Definition at line 66 of file clock.c.

#define PLL_STATUS   0x00000001

Definition at line 68 of file clock.c.

#define POSTDIV_MASK   0x0000001f

Definition at line 60 of file clock.c.

#define PREDIV_MASK   0x001f0000

Definition at line 58 of file clock.c.

#define PREDIV_SHIFT   16

Definition at line 59 of file clock.c.

#define TNETD7200_CLOCK_ID_CPU   0

Definition at line 48 of file clock.c.

#define TNETD7200_CLOCK_ID_DSP   1

Definition at line 49 of file clock.c.

#define TNETD7200_CLOCK_ID_USB   2

Definition at line 50 of file clock.c.

#define TNETD7200_DEF_CPU_CLK   211000000

Definition at line 52 of file clock.c.

#define TNETD7200_DEF_DSP_CLK   125000000

Definition at line 53 of file clock.c.

#define TNETD7200_DEF_USB_CLK   48000000

Definition at line 54 of file clock.c.

#define USB_PLL_SOURCE_SHIFT   18

Definition at line 37 of file clock.c.

Function Documentation

void __init ar7_init_clocks ( void  )

Definition at line 459 of file clock.c.

void clk_disable ( struct clk clk)

Definition at line 426 of file clock.c.

int clk_enable ( struct clk clk)

Definition at line 420 of file clock.c.

struct clk* clk_get ( struct device dev,
const char id 
)
read

Definition at line 437 of file clock.c.

unsigned long clk_get_rate ( struct clk clk)

Definition at line 431 of file clock.c.

void clk_put ( struct clk clk)

Definition at line 454 of file clock.c.

EXPORT_SYMBOL ( clk_enable  )
EXPORT_SYMBOL ( clk_disable  )
EXPORT_SYMBOL ( clk_get_rate  )
EXPORT_SYMBOL ( clk_get  )
EXPORT_SYMBOL ( clk_put  )