aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/mux.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2008-01-25 03:42:48 -0500
committerTony Lindgren <tony@atomide.com>2008-04-14 12:57:11 -0400
commit225dfda1d676b70acf1e696ace68c23297926ce0 (patch)
tree4390425ac95cb0f4c62a2e042296df9e0b8c4eb6 /arch/arm/mach-omap2/mux.c
parent7d7f665d5dac8d19f2fcb56baea09c59a3f861be (diff)
ARM: OMAP: Split omap_cfg_reg() into omap processor specific functions
Use omap processor specific function depending on system type. Based on an earlier patch by Klaus Pedersen <klaus.k.pedersen@nokia.com>. Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/mux.c')
-rw-r--r--arch/arm/mach-omap2/mux.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index 351baab0503a..71cff46a8b71 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -172,8 +172,39 @@ MUX_CFG_24XX("B13_24XX_KBC6", 0x110, 3, 0, 0, 1)
172}; 172};
173 173
174#ifdef CONFIG_ARCH_OMAP24XX 174#ifdef CONFIG_ARCH_OMAP24XX
175
176#define OMAP24XX_L4_BASE 0x48000000
177#define OMAP24XX_PULL_ENA (1 << 3)
178#define OMAP24XX_PULL_UP (1 << 4)
179
180/* REVISIT: Convert this code to use ctrl_{read,write}_reg */
175int __init_or_module omap24xx_cfg_reg(const struct pin_config *cfg) 181int __init_or_module omap24xx_cfg_reg(const struct pin_config *cfg)
176{ 182{
183 u8 reg = 0;
184 unsigned int warn = 0;
185
186 reg |= cfg->mask & 0x7;
187 if (cfg->pull_val)
188 reg |= OMAP24XX_PULL_ENA;
189 if(cfg->pu_pd_val)
190 reg |= OMAP24XX_PULL_UP;
191#if defined(CONFIG_OMAP_MUX_DEBUG) || defined(CONFIG_OMAP_MUX_WARNINGS)
192 {
193 u8 orig = omap_readb(OMAP24XX_L4_BASE + cfg->mux_reg);
194 u8 debug = 0;
195
196#ifdef CONFIG_OMAP_MUX_DEBUG
197 debug = cfg->debug;
198#endif
199 warn = (orig != reg);
200 if (debug || warn)
201 printk("MUX: setup %s (0x%08x): 0x%02x -> 0x%02x\n",
202 cfg->name, OMAP24XX_L4_BASE + cfg->mux_reg,
203 orig, reg);
204 }
205#endif
206 omap_writeb(reg, OMAP24XX_L4_BASE + cfg->mux_reg);
207
177 return 0; 208 return 0;
178} 209}
179#endif 210#endif