Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 179774
b: refs/heads/master
c: d4bb72e
h: refs/heads/master
v: v3
  • Loading branch information
Tony Lindgren committed Jan 20, 2010
1 parent 2b80c15 commit f736cee
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2cb0c54f3a696351b81e6670f8419120c94b5e0b
refs/heads/master: d4bb72e50a0c4b6790dec127a38fd06d06e561cc
22 changes: 11 additions & 11 deletions trunk/arch/arm/mach-omap2/mux.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,30 @@ struct omap_mux_entry {
static unsigned long mux_phys;
static void __iomem *mux_base;

static inline u16 omap_mux_read(u16 reg)
u16 omap_mux_read(u16 reg)
{
if (cpu_is_omap24xx())
return __raw_readb(mux_base + reg);
else
return __raw_readw(mux_base + reg);
}

static inline void omap_mux_write(u16 val, u16 reg)
void omap_mux_write(u16 val, u16 reg)
{
if (cpu_is_omap24xx())
__raw_writeb(val, mux_base + reg);
else
__raw_writew(val, mux_base + reg);
}

void omap_mux_write_array(struct omap_board_mux *board_mux)
{
while (board_mux->reg_offset != OMAP_MUX_TERMINATOR) {
omap_mux_write(board_mux->value, board_mux->reg_offset);
board_mux++;
}
}

#if defined(CONFIG_ARCH_OMAP24XX) && defined(CONFIG_OMAP_MUX)

static struct omap_mux_cfg arch_mux_cfg;
Expand Down Expand Up @@ -833,14 +841,6 @@ static void __init omap_mux_set_cmdline_signals(void)
kfree(options);
}

static void __init omap_mux_set_board_signals(struct omap_board_mux *board_mux)
{
while (board_mux->reg_offset != OMAP_MUX_TERMINATOR) {
omap_mux_write(board_mux->value, board_mux->reg_offset);
board_mux++;
}
}

static int __init omap_mux_copy_names(struct omap_mux *src,
struct omap_mux *dst)
{
Expand Down Expand Up @@ -1004,7 +1004,7 @@ int __init omap_mux_init(u32 mux_pbase, u32 mux_size,

#ifdef CONFIG_OMAP_MUX
omap_mux_set_cmdline_signals();
omap_mux_set_board_signals(board_mux);
omap_mux_write_array(board_mux);
#endif

return 0;
Expand Down
24 changes: 24 additions & 0 deletions trunk/arch/arm/mach-omap2/mux.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,30 @@ u16 omap_mux_get_gpio(int gpio);
*/
void omap_mux_set_gpio(u16 val, int gpio);

/**
* omap_mux_read() - read mux register
* @mux_offset: Offset of the mux register
*
*/
u16 omap_mux_read(u16 mux_offset);

/**
* omap_mux_write() - write mux register
* @val: New mux register value
* @mux_offset: Offset of the mux register
*
* This should be only needed for dynamic remuxing of non-gpio signals.
*/
void omap_mux_write(u16 val, u16 mux_offset);

/**
* omap_mux_write_array() - write an array of mux registers
* @board_mux: Array of mux registers terminated by MAP_MUX_TERMINATOR
*
* This should be only needed for dynamic remuxing of non-gpio signals.
*/
void omap_mux_write_array(struct omap_board_mux *board_mux);

/**
* omap3_mux_init() - initialize mux system with board specific set
* @board_mux: Board specific mux table
Expand Down

0 comments on commit f736cee

Please sign in to comment.