Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros
mux.h File Reference
#include "mux2420.h"
#include "mux2430.h"
#include "mux34xx.h"
#include "mux44xx.h"

Go to the source code of this file.

Data Structures

struct  omap_board_data
 
struct  omap_mux_partition
 
struct  omap_mux
 
struct  omap_ball
 
struct  omap_board_mux
 
struct  omap_device_pad
 

Macros

#define OMAP_MUX_TERMINATOR   0xffff
 
#define OMAP_MUX_MODE0   0
 
#define OMAP_MUX_MODE1   1
 
#define OMAP_MUX_MODE2   2
 
#define OMAP_MUX_MODE3   3
 
#define OMAP_MUX_MODE4   4
 
#define OMAP_MUX_MODE5   5
 
#define OMAP_MUX_MODE6   6
 
#define OMAP_MUX_MODE7   7
 
#define OMAP_PULL_ENA   (1 << 3)
 
#define OMAP_PULL_UP   (1 << 4)
 
#define OMAP_ALTELECTRICALSEL   (1 << 5)
 
#define OMAP_INPUT_EN   (1 << 8)
 
#define OMAP_OFF_EN   (1 << 9)
 
#define OMAP_OFFOUT_EN   (1 << 10)
 
#define OMAP_OFFOUT_VAL   (1 << 11)
 
#define OMAP_OFF_PULL_EN   (1 << 12)
 
#define OMAP_OFF_PULL_UP   (1 << 13)
 
#define OMAP_WAKEUP_EN   (1 << 14)
 
#define OMAP_WAKEUP_EVENT   (1 << 15)
 
#define OMAP_PIN_OUTPUT   0
 
#define OMAP_PIN_INPUT   OMAP_INPUT_EN
 
#define OMAP_PIN_INPUT_PULLUP
 
#define OMAP_PIN_INPUT_PULLDOWN   (OMAP_PULL_ENA | OMAP_INPUT_EN)
 
#define OMAP_PIN_OFF_NONE   0
 
#define OMAP_PIN_OFF_OUTPUT_HIGH
 
#define OMAP_PIN_OFF_OUTPUT_LOW   (OMAP_OFF_EN | OMAP_OFFOUT_EN)
 
#define OMAP_PIN_OFF_INPUT_PULLUP
 
#define OMAP_PIN_OFF_INPUT_PULLDOWN   (OMAP_OFF_EN | OMAP_OFF_PULL_EN)
 
#define OMAP_PIN_OFF_WAKEUPENABLE   OMAP_WAKEUP_EN
 
#define OMAP_MODE_GPIO(x)   (((x) & OMAP_MUX_MODE7) == OMAP_MUX_MODE4)
 
#define OMAP_MODE_UART(x)   (((x) & OMAP_MUX_MODE7) == OMAP_MUX_MODE0)
 
#define OMAP_PACKAGE_MASK   0xffff
 
#define OMAP_PACKAGE_CBS   8 /* 547-pin 0.40 0.40 */
 
#define OMAP_PACKAGE_CBL   7 /* 547-pin 0.40 0.40 */
 
#define OMAP_PACKAGE_CBP   6 /* 515-pin 0.40 0.50 */
 
#define OMAP_PACKAGE_CUS   5 /* 423-pin 0.65 */
 
#define OMAP_PACKAGE_CBB   4 /* 515-pin 0.40 0.50 */
 
#define OMAP_PACKAGE_CBC   3 /* 515-pin 0.50 0.65 */
 
#define OMAP_PACKAGE_ZAC   2 /* 24xx 447-pin POP */
 
#define OMAP_PACKAGE_ZAF   1 /* 2420 447-pin SIP */
 
#define OMAP_MUX_NR_MODES   8 /* Available modes */
 
#define OMAP_MUX_NR_SIDES   2 /* Bottom & top */
 
#define OMAP_MUX_REG_8BIT   (1 << 0)
 
#define OMAP_MUX_GPIO_IN_MODE3   (1 << 1)
 
: name of the current partition

struct mux_partition - contain partition related information

: flags specific to this partition : physical address : partition size : virtual address after ioremap : list of nodes that belong to a partition : list node for the partitions linked list

#define OMAP_DEVICE_PAD_REMUX
 
#define OMAP_DEVICE_PAD_WAKEUP   BIT(0) /* Pad is wake-up capable */
 

Functions

: Name of the mux partition

omap_mux_get() - get a mux partition by name

struct omap_mux_partitionomap_mux_get (const char *name)
 
u16 omap_mux_read (struct omap_mux_partition *p, u16 mux_offset)
 
void omap_mux_write (struct omap_mux_partition *p, u16 val, u16 mux_offset)
 
void omap_mux_write_array (struct omap_mux_partition *p, struct omap_board_mux *board_mux)
 
int omap2420_mux_init (struct omap_board_mux *board_mux, int flags)
 
int omap2430_mux_init (struct omap_board_mux *board_mux, int flags)
 
int omap3_mux_init (struct omap_board_mux *board_mux, int flags)
 
int omap4_mux_init (struct omap_board_mux *board_subset, struct omap_board_mux *board_wkup_subset, int flags)
 
int omap_mux_init (const char *name, u32 flags, u32 mux_pbase, u32 mux_size, struct omap_mux *superset, struct omap_mux *package_subset, struct omap_board_mux *board_mux, struct omap_ball *package_balls)
 

: signal name

struct omap_device_pad - device specific pad configuration

: pad specific runtime flags : runtime value for a pad : idle value for a pad : off value for a pad, defaults to safe mode : mux partition : mux register

#define OMAP_MUX_STATIC(signal, mode)
 
u16 omap_mux_get_gpio (int gpio)
 
void omap_mux_set_gpio (u16 val, int gpio)
 

Macro Definition Documentation

#define OMAP_ALTELECTRICALSEL   (1 << 5)

Definition at line 30 of file mux.h.

#define OMAP_DEVICE_PAD_REMUX
Value:
BIT(1) /* Dynamically remux a pad,
needs enable, idle and off
values */

Definition at line 162 of file mux.h.

#define OMAP_DEVICE_PAD_WAKEUP   BIT(0) /* Pad is wake-up capable */

Definition at line 163 of file mux.h.

#define OMAP_INPUT_EN   (1 << 8)

Definition at line 33 of file mux.h.

#define OMAP_MODE_GPIO (   x)    (((x) & OMAP_MUX_MODE7) == OMAP_MUX_MODE4)

Definition at line 61 of file mux.h.

#define OMAP_MODE_UART (   x)    (((x) & OMAP_MUX_MODE7) == OMAP_MUX_MODE0)

Definition at line 62 of file mux.h.

#define OMAP_MUX_GPIO_IN_MODE3   (1 << 1)

Definition at line 88 of file mux.h.

#define OMAP_MUX_MODE0   0

Definition at line 18 of file mux.h.

#define OMAP_MUX_MODE1   1

Definition at line 19 of file mux.h.

#define OMAP_MUX_MODE2   2

Definition at line 20 of file mux.h.

#define OMAP_MUX_MODE3   3

Definition at line 21 of file mux.h.

#define OMAP_MUX_MODE4   4

Definition at line 22 of file mux.h.

#define OMAP_MUX_MODE5   5

Definition at line 23 of file mux.h.

#define OMAP_MUX_MODE6   6

Definition at line 24 of file mux.h.

#define OMAP_MUX_MODE7   7

Definition at line 25 of file mux.h.

#define OMAP_MUX_NR_MODES   8 /* Available modes */

Definition at line 76 of file mux.h.

#define OMAP_MUX_NR_SIDES   2 /* Bottom & top */

Definition at line 77 of file mux.h.

#define OMAP_MUX_REG_8BIT   (1 << 0)

Definition at line 87 of file mux.h.

#define OMAP_MUX_STATIC (   signal,
  mode 
)
Value:
{ \
.name = (signal), \
.enable = (mode), \
}

Definition at line 187 of file mux.h.

#define OMAP_MUX_TERMINATOR   0xffff

Definition at line 15 of file mux.h.

#define OMAP_OFF_EN   (1 << 9)

Definition at line 34 of file mux.h.

#define OMAP_OFF_PULL_EN   (1 << 12)

Definition at line 37 of file mux.h.

#define OMAP_OFF_PULL_UP   (1 << 13)

Definition at line 38 of file mux.h.

#define OMAP_OFFOUT_EN   (1 << 10)

Definition at line 35 of file mux.h.

#define OMAP_OFFOUT_VAL   (1 << 11)

Definition at line 36 of file mux.h.

#define OMAP_PACKAGE_CBB   4 /* 515-pin 0.40 0.50 */

Definition at line 70 of file mux.h.

#define OMAP_PACKAGE_CBC   3 /* 515-pin 0.50 0.65 */

Definition at line 71 of file mux.h.

#define OMAP_PACKAGE_CBL   7 /* 547-pin 0.40 0.40 */

Definition at line 67 of file mux.h.

#define OMAP_PACKAGE_CBP   6 /* 515-pin 0.40 0.50 */

Definition at line 68 of file mux.h.

#define OMAP_PACKAGE_CBS   8 /* 547-pin 0.40 0.40 */

Definition at line 66 of file mux.h.

#define OMAP_PACKAGE_CUS   5 /* 423-pin 0.65 */

Definition at line 69 of file mux.h.

#define OMAP_PACKAGE_MASK   0xffff

Definition at line 65 of file mux.h.

#define OMAP_PACKAGE_ZAC   2 /* 24xx 447-pin POP */

Definition at line 72 of file mux.h.

#define OMAP_PACKAGE_ZAF   1 /* 2420 447-pin SIP */

Definition at line 73 of file mux.h.

#define OMAP_PIN_INPUT   OMAP_INPUT_EN

Definition at line 46 of file mux.h.

#define OMAP_PIN_INPUT_PULLDOWN   (OMAP_PULL_ENA | OMAP_INPUT_EN)

Definition at line 49 of file mux.h.

#define OMAP_PIN_INPUT_PULLUP
Value:

Definition at line 47 of file mux.h.

#define OMAP_PIN_OFF_INPUT_PULLDOWN   (OMAP_OFF_EN | OMAP_OFF_PULL_EN)

Definition at line 58 of file mux.h.

#define OMAP_PIN_OFF_INPUT_PULLUP
Value:

Definition at line 56 of file mux.h.

#define OMAP_PIN_OFF_NONE   0

Definition at line 52 of file mux.h.

#define OMAP_PIN_OFF_OUTPUT_HIGH
Value:

Definition at line 53 of file mux.h.

#define OMAP_PIN_OFF_OUTPUT_LOW   (OMAP_OFF_EN | OMAP_OFFOUT_EN)

Definition at line 55 of file mux.h.

#define OMAP_PIN_OFF_WAKEUPENABLE   OMAP_WAKEUP_EN

Definition at line 59 of file mux.h.

#define OMAP_PIN_OUTPUT   0

Definition at line 45 of file mux.h.

#define OMAP_PULL_ENA   (1 << 3)

Definition at line 28 of file mux.h.

#define OMAP_PULL_UP   (1 << 4)

Definition at line 29 of file mux.h.

#define OMAP_WAKEUP_EN   (1 << 14)

Definition at line 39 of file mux.h.

#define OMAP_WAKEUP_EVENT   (1 << 15)

Definition at line 42 of file mux.h.

Function Documentation

int omap2420_mux_init ( struct omap_board_mux board_mux,
int  flags 
)

omap2420_mux_init() - initialize mux system with board specific set : Board specific mux table : OMAP package type used for the board

Definition at line 670 of file mux2420.c.

int omap2430_mux_init ( struct omap_board_mux board_mux,
int  flags 
)

omap2430_mux_init() - initialize mux system with board specific set : Board specific mux table : OMAP package type used for the board

Definition at line 775 of file mux2430.c.

int omap3_mux_init ( struct omap_board_mux board_mux,
int  flags 
)

omap3_mux_init() - initialize mux system with board specific set : Board specific mux table : OMAP package type used for the board

Definition at line 2029 of file mux34xx.c.

int omap4_mux_init ( struct omap_board_mux board_subset,
struct omap_board_mux board_wkup_subset,
int  flags 
)

omap4_mux_init() - initialize mux system with board specific set : Board specific mux table : Board specific mux table for wakeup instance : OMAP package type used for the board

Definition at line 1312 of file mux44xx.c.

struct omap_mux_partition* omap_mux_get ( const char name)
read

Definition at line 57 of file mux.c.

u16 omap_mux_get_gpio ( int  gpio)

omap_mux_get_gpio() - get mux register value based on GPIO number : GPIO number

Definition at line 986 of file mux.c.

int omap_mux_init ( const char name,
u32  flags,
u32  mux_pbase,
u32  mux_size,
struct omap_mux superset,
struct omap_mux package_subset,
struct omap_board_mux board_mux,
struct omap_ball package_balls 
)

omap_mux_init - private mux init function, do not call

Definition at line 1119 of file mux.c.

u16 omap_mux_read ( struct omap_mux_partition p,
u16  mux_offset 
)

omap_mux_read() - read mux register : Mux partition : Offset of the mux register

Definition at line 69 of file mux.c.

void omap_mux_set_gpio ( u16  val,
int  gpio 
)

omap_mux_set_gpio() - set mux register value based on GPIO number : New mux register value : GPIO number

Definition at line 1004 of file mux.c.

void omap_mux_write ( struct omap_mux_partition p,
u16  val,
u16  mux_offset 
)

omap_mux_write() - write mux register : Mux partition : New mux register value : Offset of the mux register

This should be only needed for dynamic remuxing of non-gpio signals.

Definition at line 77 of file mux.c.

void omap_mux_write_array ( struct omap_mux_partition p,
struct omap_board_mux board_mux 
)

omap_mux_write_array() - write an array of mux registers : Mux partition : Array of mux registers terminated by MAP_MUX_TERMINATOR

This should be only needed for dynamic remuxing of non-gpio signals.

Definition at line 86 of file mux.c.