Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Enumerations | Functions
gptu.c File Reference
#include <linux/interrupt.h>
#include <linux/ioport.h>
#include <linux/module.h>
#include <linux/of_platform.h>
#include <linux/of_irq.h>
#include <lantiq_soc.h>
#include "../clk.h"

Go to the source code of this file.

Macros

#define GPTU_MAGIC   0x59
 
#define GPTU_CLC   0x00
 
#define GPTU_ID   0x08
 
#define GPTU_IRNEN   0xf4
 
#define GPTU_IRCR   0xf8
 
#define GPTU_IRNCR   0xfc
 
#define GPTU_SHIFT(x)   (x % 2 ? 4 : 0)
 
#define GPTU_BASE(x)   (((x >> 1) * 0x20) + 0x10)
 
#define GPTU_CON(x)   (GPTU_BASE(x) + GPTU_SHIFT(x) + 0x00)
 
#define GPTU_RUN(x)   (GPTU_BASE(x) + GPTU_SHIFT(x) + 0x08)
 
#define GPTU_RLD(x)   (GPTU_BASE(x) + GPTU_SHIFT(x) + 0x10)
 
#define GPTU_CNT(x)   (GPTU_BASE(x) + GPTU_SHIFT(x) + 0x18)
 
#define CON_CNT   BIT(2)
 
#define CON_EDGE_ANY   (BIT(7) | BIT(6))
 
#define CON_SYNC   BIT(8)
 
#define CON_CLK_INT   BIT(10)
 
#define RUN_SEN   BIT(0)
 
#define RUN_RL   BIT(2)
 
#define CLC_RMC   BIT(8)
 
#define CLC_SUSPEND   BIT(4)
 
#define CLC_DISABLE   BIT(0)
 
#define gptu_w32(x, y)   ltq_w32((x), gptu_membase + (y))
 
#define gptu_r32(x)   ltq_r32(gptu_membase + (x))
 

Enumerations

enum  gptu_timer {
  TIMER1A = 0, TIMER1B, TIMER2A, TIMER2B,
  TIMER3A, TIMER3B
}
 

Functions

 MODULE_DEVICE_TABLE (of, dma_match)
 
int __init gptu_init (void)
 
 arch_initcall (gptu_init)
 

Macro Definition Documentation

#define CLC_DISABLE   BIT(0)

Definition at line 58 of file gptu.c.

#define CLC_RMC   BIT(8)

Definition at line 54 of file gptu.c.

#define CLC_SUSPEND   BIT(4)

Definition at line 56 of file gptu.c.

#define CON_CLK_INT   BIT(10)

Definition at line 47 of file gptu.c.

#define CON_CNT   BIT(2)

Definition at line 44 of file gptu.c.

#define CON_EDGE_ANY   (BIT(7) | BIT(6))

Definition at line 45 of file gptu.c.

#define CON_SYNC   BIT(8)

Definition at line 46 of file gptu.c.

#define GPTU_BASE (   x)    (((x >> 1) * 0x20) + 0x10)

Definition at line 33 of file gptu.c.

#define GPTU_CLC   0x00

Definition at line 22 of file gptu.c.

#define GPTU_CNT (   x)    (GPTU_BASE(x) + GPTU_SHIFT(x) + 0x18)

Definition at line 41 of file gptu.c.

#define GPTU_CON (   x)    (GPTU_BASE(x) + GPTU_SHIFT(x) + 0x00)

Definition at line 35 of file gptu.c.

#define GPTU_ID   0x08

Definition at line 24 of file gptu.c.

#define GPTU_IRCR   0xf8

Definition at line 28 of file gptu.c.

#define GPTU_IRNCR   0xfc

Definition at line 30 of file gptu.c.

#define GPTU_IRNEN   0xf4

Definition at line 26 of file gptu.c.

#define GPTU_MAGIC   0x59

Definition at line 20 of file gptu.c.

#define gptu_r32 (   x)    ltq_r32(gptu_membase + (x))

Definition at line 61 of file gptu.c.

#define GPTU_RLD (   x)    (GPTU_BASE(x) + GPTU_SHIFT(x) + 0x10)

Definition at line 39 of file gptu.c.

#define GPTU_RUN (   x)    (GPTU_BASE(x) + GPTU_SHIFT(x) + 0x08)

Definition at line 37 of file gptu.c.

#define GPTU_SHIFT (   x)    (x % 2 ? 4 : 0)

Definition at line 32 of file gptu.c.

#define gptu_w32 (   x,
  y 
)    ltq_w32((x), gptu_membase + (y))

Definition at line 60 of file gptu.c.

#define RUN_RL   BIT(2)

Definition at line 51 of file gptu.c.

#define RUN_SEN   BIT(0)

Definition at line 50 of file gptu.c.

Enumeration Type Documentation

enum gptu_timer
Enumerator:
TIMER1A 
TIMER1B 
TIMER2A 
TIMER2B 
TIMER3A 
TIMER3B 

Definition at line 63 of file gptu.c.

Function Documentation

arch_initcall ( gptu_init  )
int __init gptu_init ( void  )

Definition at line 205 of file gptu.c.

MODULE_DEVICE_TABLE ( of  ,
dma_match   
)