Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
clk-vt8500.c File Reference
#include <linux/io.h>
#include <linux/of.h>
#include <linux/slab.h>
#include <linux/bitops.h>
#include <linux/clkdev.h>
#include <linux/clk-provider.h>

Go to the source code of this file.

Data Structures

struct  clk_device
 
struct  clk_pll
 

Macros

#define PLL_TYPE_VT8500   0
 
#define PLL_TYPE_WM8650   1
 
#define to_clk_device(_hw)   container_of(_hw, struct clk_device, hw)
 
#define VT8500_PMC_BUSY_MASK   0x18
 
#define CLK_INIT_GATED   BIT(0)
 
#define CLK_INIT_DIVISOR   BIT(1)
 
#define CLK_INIT_GATED_DIVISOR   (CLK_INIT_DIVISOR | CLK_INIT_GATED)
 
#define to_clk_pll(_hw)   container_of(_hw, struct clk_pll, hw)
 
#define VT8500_PLL_MUL(x)   ((x & 0x1F) << 1)
 
#define VT8500_PLL_DIV(x)   ((x & 0x100) ? 1 : 2)
 
#define VT8500_BITS_TO_FREQ(r, m, d)   ((r / d) * m)
 
#define VT8500_BITS_TO_VAL(m, d)   ((d == 2 ? 0 : 0x100) | ((m >> 1) & 0x1F))
 
#define WM8650_PLL_MUL(x)   (x & 0x3FF)
 
#define WM8650_PLL_DIV(x)   (((x >> 10) & 7) * (1 << ((x >> 13) & 3)))
 
#define WM8650_BITS_TO_FREQ(r, m, d1, d2)   (r * m / (d1 * (1 << d2)))
 
#define WM8650_BITS_TO_VAL(m, d1, d2)   ((d2 << 13) | (d1 << 10) | (m & 0x3FF))
 

Functions

void __init vtwm_clk_init (void __iomem *base)
 

Variables

struct clk_ops vtwm_pll_ops
 

Macro Definition Documentation

#define CLK_INIT_DIVISOR   BIT(1)

Definition at line 177 of file clk-vt8500.c.

#define CLK_INIT_GATED   BIT(0)

Definition at line 176 of file clk-vt8500.c.

#define CLK_INIT_GATED_DIVISOR   (CLK_INIT_DIVISOR | CLK_INIT_GATED)

Definition at line 178 of file clk-vt8500.c.

#define PLL_TYPE_VT8500   0

Definition at line 42 of file clk-vt8500.c.

#define PLL_TYPE_WM8650   1

Definition at line 43 of file clk-vt8500.c.

#define to_clk_device (   _hw)    container_of(_hw, struct clk_device, hw)

Definition at line 54 of file clk-vt8500.c.

#define to_clk_pll (   _hw)    container_of(_hw, struct clk_pll, hw)

Definition at line 261 of file clk-vt8500.c.

#define VT8500_BITS_TO_FREQ (   r,
  m,
  d 
)    ((r / d) * m)

Definition at line 267 of file clk-vt8500.c.

#define VT8500_BITS_TO_VAL (   m,
  d 
)    ((d == 2 ? 0 : 0x100) | ((m >> 1) & 0x1F))

Definition at line 270 of file clk-vt8500.c.

#define VT8500_PLL_DIV (   x)    ((x & 0x100) ? 1 : 2)

Definition at line 265 of file clk-vt8500.c.

#define VT8500_PLL_MUL (   x)    ((x & 0x1F) << 1)

Definition at line 264 of file clk-vt8500.c.

#define VT8500_PMC_BUSY_MASK   0x18

Definition at line 56 of file clk-vt8500.c.

#define WM8650_BITS_TO_FREQ (   r,
  m,
  d1,
  d2 
)    (r * m / (d1 * (1 << d2)))

Definition at line 277 of file clk-vt8500.c.

#define WM8650_BITS_TO_VAL (   m,
  d1,
  d2 
)    ((d2 << 13) | (d1 << 10) | (m & 0x3FF))

Definition at line 280 of file clk-vt8500.c.

#define WM8650_PLL_DIV (   x)    (((x >> 10) & 7) * (1 << ((x >> 13) & 3)))

Definition at line 275 of file clk-vt8500.c.

#define WM8650_PLL_MUL (   x)    (x & 0x3FF)

Definition at line 274 of file clk-vt8500.c.

Function Documentation

void __init vtwm_clk_init ( void __iomem base)

Definition at line 502 of file clk-vt8500.c.

Variable Documentation

struct clk_ops vtwm_pll_ops
Initial value:
= {
.round_rate = vtwm_pll_round_rate,
.set_rate = vtwm_pll_set_rate,
.recalc_rate = vtwm_pll_recalc_rate,
}

Definition at line 432 of file clk-vt8500.c.