Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
fsl_gtm.c File Reference
#include <linux/kernel.h>
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/list.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/spinlock.h>
#include <linux/bitops.h>
#include <linux/slab.h>
#include <linux/export.h>
#include <asm/fsl_gtm.h>

Go to the source code of this file.

Data Structures

struct  gtm_timers_regs
 
struct  gtm
 

Macros

#define GTCFR_STP(x)   ((x) & 1 ? 1 << 5 : 1 << 1)
 
#define GTCFR_RST(x)   ((x) & 1 ? 1 << 4 : 1 << 0)
 
#define GTMDR_ICLK_MASK   (3 << 1)
 
#define GTMDR_ICLK_ICAS   (0 << 1)
 
#define GTMDR_ICLK_ICLK   (1 << 1)
 
#define GTMDR_ICLK_SLGO   (2 << 1)
 
#define GTMDR_FRR   (1 << 3)
 
#define GTMDR_ORI   (1 << 4)
 
#define GTMDR_SPS(x)   ((x) << 8)
 

Functions

struct gtm_timers_regs __attribute__ ((packed))
 
struct gtm_timergtm_get_timer16 (void)
 
 EXPORT_SYMBOL (gtm_get_timer16)
 
struct gtm_timergtm_get_specific_timer16 (struct gtm *gtm, unsigned int timer)
 
 EXPORT_SYMBOL (gtm_get_specific_timer16)
 
void gtm_put_timer16 (struct gtm_timer *tmr)
 
 EXPORT_SYMBOL (gtm_put_timer16)
 
int gtm_set_timer16 (struct gtm_timer *tmr, unsigned long usec, bool reload)
 
 EXPORT_SYMBOL (gtm_set_timer16)
 
int gtm_set_exact_timer16 (struct gtm_timer *tmr, u16 usec, bool reload)
 
 EXPORT_SYMBOL (gtm_set_exact_timer16)
 
void gtm_stop_timer16 (struct gtm_timer *tmr)
 
 EXPORT_SYMBOL (gtm_stop_timer16)
 
void gtm_ack_timer16 (struct gtm_timer *tmr, u16 events)
 
 EXPORT_SYMBOL (gtm_ack_timer16)
 
 arch_initcall (fsl_gtm_init)
 

Variables

u8 gtcfr1
 
u8 res0 [0x3]
 
u8 gtcfr2
 
u8 res1 [0xB]
 
__be16 gtmdr1
 
__be16 gtmdr2
 
__be16 gtrfr1
 
__be16 gtrfr2
 
__be16 gtcpr1
 
__be16 gtcpr2
 
__be16 gtcnr1
 
__be16 gtcnr2
 
__be16 gtmdr3
 
__be16 gtmdr4
 
__be16 gtrfr3
 
__be16 gtrfr4
 
__be16 gtcpr3
 
__be16 gtcpr4
 
__be16 gtcnr3
 
__be16 gtcnr4
 
__be16 gtevr1
 
__be16 gtevr2
 
__be16 gtevr3
 
__be16 gtevr4
 
__be16 gtpsr1
 
__be16 gtpsr2
 
__be16 gtpsr3
 
__be16 gtpsr4
 
u8 res2 [0x40]
 
struct gtm __attribute__
 

Macro Definition Documentation

#define GTCFR_RST (   x)    ((x) & 1 ? 1 << 4 : 1 << 0)

Definition at line 29 of file fsl_gtm.c.

#define GTCFR_STP (   x)    ((x) & 1 ? 1 << 5 : 1 << 1)

Definition at line 28 of file fsl_gtm.c.

#define GTMDR_FRR   (1 << 3)

Definition at line 35 of file fsl_gtm.c.

#define GTMDR_ICLK_ICAS   (0 << 1)

Definition at line 32 of file fsl_gtm.c.

#define GTMDR_ICLK_ICLK   (1 << 1)

Definition at line 33 of file fsl_gtm.c.

#define GTMDR_ICLK_MASK   (3 << 1)

Definition at line 31 of file fsl_gtm.c.

#define GTMDR_ICLK_SLGO   (2 << 1)

Definition at line 34 of file fsl_gtm.c.

#define GTMDR_ORI   (1 << 4)

Definition at line 36 of file fsl_gtm.c.

#define GTMDR_SPS (   x)    ((x) << 8)

Definition at line 37 of file fsl_gtm.c.

Function Documentation

struct gtm_timers_regs __attribute__ ( (packed)  )
read

Definition at line 171 of file esd_usb2.c.

arch_initcall ( fsl_gtm_init  )
EXPORT_SYMBOL ( gtm_get_timer16  )
EXPORT_SYMBOL ( gtm_get_specific_timer16  )
EXPORT_SYMBOL ( gtm_put_timer16  )
EXPORT_SYMBOL ( gtm_set_timer16  )
EXPORT_SYMBOL ( gtm_set_exact_timer16  )
EXPORT_SYMBOL ( gtm_stop_timer16  )
EXPORT_SYMBOL ( gtm_ack_timer16  )
void gtm_ack_timer16 ( struct gtm_timer tmr,
u16  events 
)

gtm_ack_timer16 - acknowledge timer event (free-run timers only) : pointer to the gtm_timer structure obtained from gtm_get_timer : events mask to ack Context: any

Thus function used to acknowledge timer interrupt event, use it inside the interrupt handler.

Definition at line 328 of file fsl_gtm.c.

struct gtm_timer* gtm_get_specific_timer16 ( struct gtm gtm,
unsigned int  timer 
)
read

gtm_get_specific_timer - request specific GTM timer : specific GTM, pass here GTM's device_node->data : specific timer number, Timer1 is 0. Context: non-IRQ

This function reserves GTM timer for later use. It returns gtm_timer structure to use with the rest of GTM API, you should use timer->irq to manage timer interrupt.

Definition at line 124 of file fsl_gtm.c.

struct gtm_timer* gtm_get_timer16 ( void  )
read

gtm_get_timer - request GTM timer to use it with the rest of GTM API Context: non-IRQ

This function reserves GTM timer for later use. It returns gtm_timer structure to use with the rest of GTM API, you should use timer->irq to manage timer interrupt.

Definition at line 89 of file fsl_gtm.c.

void gtm_put_timer16 ( struct gtm_timer tmr)

gtm_put_timer16 - release 16 bits GTM timer : pointer to the gtm_timer structure obtained from gtm_get_timer Context: any

This function releases GTM timer so others may request it.

Definition at line 153 of file fsl_gtm.c.

int gtm_set_exact_timer16 ( struct gtm_timer tmr,
u16  usec,
bool  reload 
)

gtm_set_exact_utimer16 - (re)set 16 bits timer : pointer to the gtm_timer structure obtained from gtm_get_timer : timer interval in microseconds : if set, the timer will reset upon expiry rather than continue running free. Context: any

This function (re)sets GTM timer so that it counts up to the requested interval value, and fires the interrupt when the value is reached. If reload flag was set, timer will also reset itself upon reference value, otherwise it continues to increment.

The exact bit in the function name states that this function will not crop precision of the "usec" argument, thus usec is limited to 16 bits (single timer width).

Definition at line 281 of file fsl_gtm.c.

int gtm_set_timer16 ( struct gtm_timer tmr,
unsigned long  usec,
bool  reload 
)

gtm_set_timer16 - (re)set 16 bit timer with arbitrary precision : pointer to the gtm_timer structure obtained from gtm_get_timer : timer interval in microseconds : if set, the timer will reset upon expiry rather than continue running free. Context: any

This function (re)sets the GTM timer so that it counts up to the requested interval value, and fires the interrupt when the value is reached. This function will reduce the precision of the timer as needed in order for the requested timeout to fit in a 16-bit register.

Definition at line 245 of file fsl_gtm.c.

void gtm_stop_timer16 ( struct gtm_timer tmr)

gtm_stop_timer16 - stop single timer : pointer to the gtm_timer structure obtained from gtm_get_timer Context: any

This function simply stops the GTM timer.

Definition at line 304 of file fsl_gtm.c.

Variable Documentation

u8 gtcfr1

Definition at line 70 of file fsl_gtm.c.

u8 gtcfr2

Definition at line 72 of file fsl_gtm.c.

__be16 gtcnr1

Definition at line 80 of file fsl_gtm.c.

__be16 gtcnr2

Definition at line 81 of file fsl_gtm.c.

__be16 gtcnr3

Definition at line 88 of file fsl_gtm.c.

__be16 gtcnr4

Definition at line 89 of file fsl_gtm.c.

__be16 gtcpr1

Definition at line 78 of file fsl_gtm.c.

__be16 gtcpr2

Definition at line 79 of file fsl_gtm.c.

__be16 gtcpr3

Definition at line 86 of file fsl_gtm.c.

__be16 gtcpr4

Definition at line 87 of file fsl_gtm.c.

__be16 gtevr1

Definition at line 90 of file fsl_gtm.c.

__be16 gtevr2

Definition at line 91 of file fsl_gtm.c.

__be16 gtevr3

Definition at line 92 of file fsl_gtm.c.

__be16 gtevr4

Definition at line 93 of file fsl_gtm.c.

__be16 gtmdr1

Definition at line 74 of file fsl_gtm.c.

__be16 gtmdr2

Definition at line 75 of file fsl_gtm.c.

__be16 gtmdr3

Definition at line 82 of file fsl_gtm.c.

__be16 gtmdr4

Definition at line 83 of file fsl_gtm.c.

__be16 gtpsr1

Definition at line 94 of file fsl_gtm.c.

__be16 gtpsr2

Definition at line 95 of file fsl_gtm.c.

__be16 gtpsr3

Definition at line 96 of file fsl_gtm.c.

__be16 gtpsr4

Definition at line 97 of file fsl_gtm.c.

__be16 gtrfr1

Definition at line 76 of file fsl_gtm.c.

__be16 gtrfr2

Definition at line 77 of file fsl_gtm.c.

__be16 gtrfr3

Definition at line 84 of file fsl_gtm.c.

__be16 gtrfr4

Definition at line 85 of file fsl_gtm.c.

__u32 res0

Definition at line 71 of file fsl_gtm.c.

u8 res1[0xB]

Definition at line 73 of file fsl_gtm.c.

u8 res2[0x40]

Definition at line 98 of file fsl_gtm.c.