Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
mfp.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/io.h>
#include <plat/mfp.h>

Go to the source code of this file.

Data Structures

struct  mfp_pin
 

Macros

#define MFPR_SIZE   (PAGE_SIZE)
 
#define MFPR_PULL_SEL   (0x1 << 15)
 
#define MFPR_PULLUP_EN   (0x1 << 14)
 
#define MFPR_PULLDOWN_EN   (0x1 << 13)
 
#define MFPR_SLEEP_SEL   (0x1 << 9)
 
#define MFPR_SLEEP_OE_N   (0x1 << 7)
 
#define MFPR_EDGE_CLEAR   (0x1 << 6)
 
#define MFPR_EDGE_FALL_EN   (0x1 << 5)
 
#define MFPR_EDGE_RISE_EN   (0x1 << 4)
 
#define MFPR_SLEEP_DATA(x)   ((x) << 8)
 
#define MFPR_DRIVE(x)   (((x) & 0x7) << 10)
 
#define MFPR_AF_SEL(x)   (((x) & 0x7) << 0)
 
#define MFPR_EDGE_NONE   (0)
 
#define MFPR_EDGE_RISE   (MFPR_EDGE_RISE_EN)
 
#define MFPR_EDGE_FALL   (MFPR_EDGE_FALL_EN)
 
#define MFPR_EDGE_BOTH   (MFPR_EDGE_RISE | MFPR_EDGE_FALL)
 
#define MFPR_LPM_INPUT   (0)
 
#define MFPR_LPM_DRIVE_LOW   (MFPR_SLEEP_DATA(0) | MFPR_PULLDOWN_EN)
 
#define MFPR_LPM_DRIVE_HIGH   (MFPR_SLEEP_DATA(1) | MFPR_PULLUP_EN)
 
#define MFPR_LPM_PULL_LOW   (MFPR_LPM_DRIVE_LOW | MFPR_SLEEP_OE_N)
 
#define MFPR_LPM_PULL_HIGH   (MFPR_LPM_DRIVE_HIGH | MFPR_SLEEP_OE_N)
 
#define MFPR_LPM_FLOAT   (MFPR_SLEEP_OE_N)
 
#define MFPR_LPM_MASK   (0xe080)
 
#define MFPR_PULL_NONE   (0)
 
#define MFPR_PULL_LOW   (MFPR_PULL_SEL | MFPR_PULLDOWN_EN)
 
#define MFPR_PULL_BOTH   (MFPR_PULL_LOW | MFPR_PULLUP_EN)
 
#define MFPR_PULL_HIGH   (MFPR_PULL_SEL | MFPR_PULLUP_EN)
 
#define MFPR_PULL_FLOAT   (MFPR_PULL_SEL)
 
#define mfpr_readl(off)   __raw_readl(mfpr_mmio_base + (off))
 
#define mfpr_writel(off, val)   __raw_writel(val, mfpr_mmio_base + (off))
 
#define mfp_configured(p)   ((p)->config != -1)
 
#define mfpr_sync()   (void)__raw_readl(mfpr_mmio_base + mfpr_off_readback)
 

Functions

void mfp_config (unsigned long *mfp_cfgs, int num)
 
unsigned long mfp_read (int mfp)
 
void mfp_write (int mfp, unsigned long val)
 
void __init mfp_init_base (void __iomem *mfpr_base)
 
void __init mfp_init_addr (struct mfp_addr_map *map)
 
void mfp_config_lpm (void)
 
void mfp_config_run (void)
 

Macro Definition Documentation

#define mfp_configured (   p)    ((p)->config != -1)

Definition at line 138 of file mfp.c.

#define MFPR_AF_SEL (   x)    (((x) & 0x7) << 0)

Definition at line 37 of file mfp.c.

#define MFPR_DRIVE (   x)    (((x) & 0x7) << 10)

Definition at line 36 of file mfp.c.

#define MFPR_EDGE_BOTH   (MFPR_EDGE_RISE | MFPR_EDGE_FALL)

Definition at line 42 of file mfp.c.

#define MFPR_EDGE_CLEAR   (0x1 << 6)

Definition at line 31 of file mfp.c.

#define MFPR_EDGE_FALL   (MFPR_EDGE_FALL_EN)

Definition at line 41 of file mfp.c.

#define MFPR_EDGE_FALL_EN   (0x1 << 5)

Definition at line 32 of file mfp.c.

#define MFPR_EDGE_NONE   (0)

Definition at line 39 of file mfp.c.

#define MFPR_EDGE_RISE   (MFPR_EDGE_RISE_EN)

Definition at line 40 of file mfp.c.

#define MFPR_EDGE_RISE_EN   (0x1 << 4)

Definition at line 33 of file mfp.c.

#define MFPR_LPM_DRIVE_HIGH   (MFPR_SLEEP_DATA(1) | MFPR_PULLUP_EN)

Definition at line 62 of file mfp.c.

#define MFPR_LPM_DRIVE_LOW   (MFPR_SLEEP_DATA(0) | MFPR_PULLDOWN_EN)

Definition at line 61 of file mfp.c.

#define MFPR_LPM_FLOAT   (MFPR_SLEEP_OE_N)

Definition at line 65 of file mfp.c.

#define MFPR_LPM_INPUT   (0)

Definition at line 60 of file mfp.c.

#define MFPR_LPM_MASK   (0xe080)

Definition at line 66 of file mfp.c.

#define MFPR_LPM_PULL_HIGH   (MFPR_LPM_DRIVE_HIGH | MFPR_SLEEP_OE_N)

Definition at line 64 of file mfp.c.

#define MFPR_LPM_PULL_LOW   (MFPR_LPM_DRIVE_LOW | MFPR_SLEEP_OE_N)

Definition at line 63 of file mfp.c.

#define MFPR_PULL_BOTH   (MFPR_PULL_LOW | MFPR_PULLUP_EN)

Definition at line 83 of file mfp.c.

#define MFPR_PULL_FLOAT   (MFPR_PULL_SEL)

Definition at line 85 of file mfp.c.

#define MFPR_PULL_HIGH   (MFPR_PULL_SEL | MFPR_PULLUP_EN)

Definition at line 84 of file mfp.c.

#define MFPR_PULL_LOW   (MFPR_PULL_SEL | MFPR_PULLDOWN_EN)

Definition at line 82 of file mfp.c.

#define MFPR_PULL_NONE   (0)

Definition at line 81 of file mfp.c.

#define MFPR_PULL_SEL   (0x1 << 15)

Definition at line 26 of file mfp.c.

#define MFPR_PULLDOWN_EN   (0x1 << 13)

Definition at line 28 of file mfp.c.

#define MFPR_PULLUP_EN   (0x1 << 14)

Definition at line 27 of file mfp.c.

#define mfpr_readl (   off)    __raw_readl(mfpr_mmio_base + (off))

Definition at line 132 of file mfp.c.

#define MFPR_SIZE   (PAGE_SIZE)

Definition at line 23 of file mfp.c.

#define MFPR_SLEEP_DATA (   x)    ((x) << 8)

Definition at line 35 of file mfp.c.

#define MFPR_SLEEP_OE_N   (0x1 << 7)

Definition at line 30 of file mfp.c.

#define MFPR_SLEEP_SEL   (0x1 << 9)

Definition at line 29 of file mfp.c.

#define mfpr_sync ( )    (void)__raw_readl(mfpr_mmio_base + mfpr_off_readback)

Definition at line 145 of file mfp.c.

#define mfpr_writel (   off,
  val 
)    __raw_writel(val, mfpr_mmio_base + (off))

Definition at line 135 of file mfp.c.

Function Documentation

void mfp_config ( unsigned long mfp_cfgs,
int  num 
)

Definition at line 164 of file mfp.c.

void mfp_config_lpm ( void  )

Definition at line 269 of file mfp.c.

void mfp_config_run ( void  )

Definition at line 278 of file mfp.c.

void __init mfp_init_addr ( struct mfp_addr_map *  map)

Definition at line 243 of file mfp.c.

void __init mfp_init_base ( void __iomem mfpr_base)

Definition at line 232 of file mfp.c.

unsigned long mfp_read ( int  mfp)

Definition at line 207 of file mfp.c.

void mfp_write ( int  mfp,
unsigned long  val 
)

Definition at line 220 of file mfp.c.